Skip to content

feat(core): docs.mjs redirects to the CLI (converge agents on init)#4207

Merged
josephfarina merged 2 commits into
mainfrom
feat/core-docs-redirect-to-cli
Jul 22, 2026
Merged

feat(core): docs.mjs redirects to the CLI (converge agents on init)#4207
josephfarina merged 2 commits into
mainfrom
feat/core-docs-redirect-to-cli

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

@astryxdesign/core ships docs.mjs, a zero-install component-docs script. In fresh-install testing it turned out to be a self-sufficient off-ramp: agents get "what components exist + how to use them" from it and never reach the CLI or run astryx init — which is what actually installs the full component guide + design rules + tokens into AGENTS.md/CLAUDE.md.

It's also a shallower view than the CLI. Same component, side by side:

  • node docs.mjs Button82 lines
  • npx @astryxdesign/cli component Button269 lines (adds Import, Variants, fuller anatomy/best-practices)

So an agent that stops at docs.mjs gets less and skips setup.

Change

docs.mjs now redirects to the CLI instead of printing docs — for any invocation:

npx @astryxdesign/cli init            # writes the full guide into AGENTS.md / CLAUDE.md
npx @astryxdesign/cli component <Name>
npx @astryxdesign/cli component --list

Why this is safe

Across the install harness (Opus 4.8 ×3, Sonnet 5 ×3) agents converge on the CLI + init via the README regardless — docs.mjs is rarely the path taken. This change closes the off-ramp for the cases that do land there (weaker models, greppers) and routes them to the current, richer source. Net: the doc surface everyone lands on is the maintained one.

Trade-off: removes the bundled zero-install doc dump. Deliberate — the CLI is the canonical, current source and component/build cover the same ground with more detail.

…docs

core's bundled docs.mjs was a self-sufficient off-ramp: agents (and humans) got
component docs from it and never reached the CLI or ran `astryx init` — which is
what installs the full component guide + design rules + tokens into
AGENTS.md/CLAUDE.md. It was also a shallower view than the CLI (e.g. Button: 82
lines here vs 269 via `astryx component Button` — no Import, no Variants, terser).

Redirect docs.mjs to the CLI so everyone converges on the current, richer source
and gets init:
- any invocation now prints how to install + run the CLI, using the scoped
  `npx @astryxdesign/cli` form (never the bare `npx astryx` footgun — see #4151).
- README "Component Docs" section updated to point at the CLI.

Validated in the fresh-install harness (Opus 4.8 + Sonnet 5): agents converge on
the CLI + init; docs.mjs is no longer a dead-end off-ramp.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 22, 2026
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jul 22, 2026 8:29pm

Request Review

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.7KB 0B

Accessibility Audit

Status: 68 accessibility violation(s) found — 6 critical, 56 serious, 6 moderate.

AppShell - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 9/10 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Avatar - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/12 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
AvatarGroup - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/12 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Badge - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Banner - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/15 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Card - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 7/13 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Carousel - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 8/8 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Chat - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/8 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatComposer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/14 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatComposerInput - 2 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/14 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 8/14 stories · Learn more
    • WCAG: 4.1.2 (Level A)
ChatLayout - 1 issue(s)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 2/3 stories · Learn more
    • WCAG: 4.1.2 (Level A)
ChatReasoning - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatToolCalls - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 10/11 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CheckboxList - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 6/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ClickableCard - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeEditor - 2 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/7 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
  • 🟠 serious: Ensure elements that have scrollable content are accessible by keyboard in Safari
    • Rule: scrollable-region-focusable · Affects 1/7 stories · Learn more
    • WCAG: 2.1.1, 2.1.3 (Level A)
CodeEditorPerf - 2 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/2 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
  • 🟠 serious: Ensure elements that have scrollable content are accessible by keyboard in Safari
    • Rule: scrollable-region-focusable · Affects 2/2 stories · Learn more
    • WCAG: 2.1.1, 2.1.3 (Level A)
CodeEditorTheme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 14/14 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
CodeTheme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 14/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Collapsible - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/10 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
DateRangeInput - 1 issue(s)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 1/16 stories · Learn more
    • WCAG: 4.1.2 (Level A)
FileInput - 3 issue(s)
  • 🟠 serious: Ensure interactive controls are not nested as they are not always announced by screen readers or can cause focus problems for assistive technologies
    • Rule: nested-interactive · Affects 12/14 stories · Learn more
    • WCAG: 4.1.2 (Level A)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 1/14 stories · Learn more
    • WCAG: 4.1.2 (Level A)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/14 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Grid - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/12 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
GridMasonry - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/3 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Heading - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Icon - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
InputGroup - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 9/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Item - 2 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/9 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 1/9 stories · Learn more
    • WCAG: 4.1.2 (Level A)
Kbd - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 6/8 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Layout - 2 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 14/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
  • 🟡 moderate: Ensure landmarks are unique
    • Rule: landmark-unique · Affects 1/18 stories · Learn more
List - 2 issue(s)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 1/12 stories · Learn more
    • WCAG: 4.1.2 (Level A)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/12 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
LogStream - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/3 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Outline - 1 issue(s)
  • 🟠 serious: Ensure elements that have scrollable content are accessible by keyboard in Safari
    • Rule: scrollable-region-focusable · Affects 1/10 stories · Learn more
    • WCAG: 2.1.1, 2.1.3 (Level A)
OverflowList - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/8 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Overlay - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/10 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Pagination - 1 issue(s)
  • 🟡 moderate: Ensure landmarks are unique
    • Rule: landmark-unique · Affects 1/14 stories · Learn more
PowerSearch - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/24 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ProgressBar - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/13 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
RadioList - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/12 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Schedule - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/7 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Section - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/7 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
SegmentedControl - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/7 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
SelectableCard - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/4 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Stack - 1 issue(s)
  • 🟠 serious: Ensure elements that have scrollable content are accessible by keyboard in Safari
    • Rule: scrollable-region-focusable · Affects 1/16 stories · Learn more
    • WCAG: 2.1.1, 2.1.3 (Level A)
Stepper - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
TabList - 1 issue(s)
  • 🟡 moderate: Ensure landmarks are unique
    • Rule: landmark-unique · Affects 2/11 stories · Learn more
Table - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/24 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
TableGroupedRows - 2 issue(s)
  • 🟠 serious: Ensure ARIA attributes are used as described in the specification of the element's role
    • Rule: aria-conditional-attr · Affects 3/3 stories · Learn more
    • WCAG: 4.1.2 (Level A)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/3 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
TablePagination - 1 issue(s)
  • 🟡 moderate: Ensure landmarks are unique
    • Rule: landmark-unique · Affects 2/9 stories · Learn more
TableTree - 1 issue(s)
  • 🟠 serious: Ensure ARIA attributes are used as described in the specification of the element's role
    • Rule: aria-conditional-attr · Affects 6/7 stories · Learn more
    • WCAG: 4.1.2 (Level A)
Text - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/23 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Theme - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/5 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
PopArt - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/6 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Thumbnail - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/11 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Timestamp - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/13 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Token - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/10 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Tokenizer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/20 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
Toolbar - 1 issue(s)
  • 🟡 moderate: Ensure landmarks are unique
    • Rule: landmark-unique · Affects 1/13 stories · Learn more
ToolbarEdgeCompensation - 1 issue(s)
  • 🟡 moderate: Ensure landmarks are unique
    • Rule: landmark-unique · Affects 1/23 stories · Learn more

Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

docs.mjs now redirects to the Astryx CLI instead of printing a component
catalog / per-component docs, so assert the redirect banner + exit 0
regardless of args rather than the old catalog output.

Co-authored-by: Cursor <cursoragent@cursor.com>
github-actions Bot added a commit that referenced this pull request Jul 22, 2026
@josephfarina
josephfarina merged commit 7ceccc1 into main Jul 22, 2026
19 checks passed
cixzhang added a commit that referenced this pull request Jul 22, 2026
Seven published-behavior PRs merged since v0.1.7 without a changeset, which
would leave their contributors uncredited in the CHANGELOG. Add changesets so
the v0.1.8 bump credits them:

- core docs.mjs redirect to the CLI (#4207)
- Table tree-data plugin: useTableTreeState / useTableTreeData (#3789)
- Table tree expander aria-label localization (#4149)
- foolproof init: postinstall nudges + non-interactive init (#4147, #4153, #4154, #4155)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant