Skip to content

cli docs: integration guides, a last pass on every doc, and integration verify - #6737

Merged
josephfarina merged 45 commits into
mainfrom
docs/cli-integration-guides
Oct 2, 2026
Merged

josephfarina merged 45 commits into
mainfrom
docs/cli-integration-guides

Conversation

@josephfarina

@josephfarina josephfarina commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

One PR for the CLI's docs before 0.7: the integration guides rewritten as short guides by task, a last pass on every other doc, and the CLI fixes the guides need to be true.

Integration guides

astryx docs cli/integrations is now a level of 21 short guides, grouped by task, instead of one 14-section guide plus cli/writing-docs:

  • Start: overview, quick start, package setup
  • Contribute: components, templates, themes, codemods, agent guidance, debug and gap reports, and a docs level (add a topic, sections and placement, links, extend or replace, short and findable, check your docs)
  • Ship: test in an app, checks, versioning, publishing, upgrading
  • Help: troubleshooting

Every command, file, and receipt in them was run in a scratch package and app, and every claim about an older CLI against the published stable 0.6.3 and 0.6.0. The quick start runs end to end as written, from an empty folder to a component an app reads. A reader with no context who asked to "make an integration", "ship a theme and docs", or "help apps upgrade after a breaking change" reached a working result from the docs alone; what slowed them down is fixed here or listed below.

Version wording: every push to main publishes a canary (0.6.3-canary.<sha>) that already reads docs sections, section ids, replaces, and the new themes layout. So the guides and the verify messages say "a stable CLI before 0.7.0", not "a CLI older than 0.7.0", and say which command a CLI has by what it lists, not by its version number. A test fails if a guide's CLI version drifts from the version the checks enforce, or if a guide's quoted verify failure stops matching the real one.

Last pass on the other docs

  • Topics and overlays: copy-paste snippets that did not compile or run are fixed (StyleX token imports, the locale path, Tailwind classes, token and icon names, the Cursor path), claims the code contradicts are corrected, long sections are split, vague titles renamed, and the --dense and Chinese versions no longer drop blocks. astryx docs tokens lists all 258 tokens. Contributor-only sections moved to CONTRIBUTING.md. Shortened section keys keep answering to their old keys, but one.
  • Reference: command and function docs match what the commands do (options, defaults, exit codes, error codes, examples that run), the response-type enum lists every type, and the upgrade page explains protected files. The agent block init writes says upgrade --from <old version> --apply, since upgrade --apply alone stops.
  • Rendering: a code block's label prints above the fence, not as a // label line inside copied bash or CSS; table cells escape |; compact tables skip empty cells.
  • Search: takes several words; a doc that matches every word, with at least one strong hit, or the whole phrase, ranks first; keywords are documented and read, including a namespace's; a phrase survives stopwords (make an integration); a component name typed as words is its name (command palette); a guide answers to its own name (codemods); a plural sits just under the exact name. Outside an app, where Core is not installed, astryx search searches the docs instead of failing, and says so.

Build and search, before and after

Replayed on base main (4ec26d7) and on this branch at 889bf96, its previous head: 119 astryx build prompts and 151 open searches. The ranking code has not changed since.

  • Build: 12 of 119 kits change, and none newly becomes a direct match.
  • Search: 37 of 151 top results change, about 33 for the better (dark mode, the guides, SideNav, useTheme, error codes).
  • Four kits lose their lowest-scoring items: the analytics dashboard prompt (GridDashboardLayout, EmptyStateContainer), theme card (useTheme, useImageMode), settings dashboard (two layout blocks), and landing hero (useInteractiveRole). Their scores are unchanged. build reads only the top 60 search results, and the new guides move these items from ranks 52 to 58 down to 61 to 66, past that window. The window is older than this PR: on main, 30 to 48 of those 60 results were already docs. Leaving docs out of the 60 would bring these back, but it adds weak items to about 10 other kits, so it is not done here. A cutoff by score instead of by count is a follow-up.

CLI changes the guides depend on

Each has tests, and a test that fails without it.

  • astryx integration pack --check is now astryx integration verify. No alias, per the CLI rename rule: integration pack, with or without --check, fails as an unknown subcommand and lists verify. The integrationPackCheck() API and its integration.pack-check JSON do not change.
  • Unknown subcommands of integration, theme, theme palette, doctor, and doctor integration fail the same way in text and in JSON (ERR_UNKNOWN_SUBCOMMAND, listing the group's subcommands). astryx doctor integrations used to run the project checks, and doctor integration bogus exited 0 in text. Other groups, such as layout, still report an unknown command.
  • integration verify resolves public imports in the packed package. Its temporary app used to resolve the package's own name through the source package.json, so an exports target left out of the tarball passed.
  • A package that ships a theme or a doc section id needs the CLI that reads them: integration add theme declares the optional @astryxdesign/cli >=0.7.0 peer, and verify fails without it (themes_need_cli, section_ids_need_cli), as it already did for a namespace doc, a placed guide, and replaces.
  • doctor integration docs fails when a namespace or placement fails, since that hides the doc; a link that names no doc still only warns. Doctor no longer prints [ok] after a failed check.
  • An integration section that extends a Core topic by a section's old title still replaces that section after the title changed.
  • integration add codemod --to help says it takes the Core version whose upgrade runs the codemod.
  • The docsite redirects /docs/cli-integrations and /docs/cli-writing-docs to where their content now starts, and keeps a reference to a docs-tree route it has no page for as plain code.

The rename, checked

  • A repo-wide search for the old name finds only its history: the breaking changeset, the older-CLI notes in checks and troubleshooting, the 0.6 CHANGELOG, and the tests that prove the old spelling fails.
  • A test now fails if the old command appears in any doc the CLI ships, any message or example in the CLI's source (the agent block, hints, the manifest), any Markdown file in the repo (READMEs, AGENTS.md, CONTRIBUTING.md, records, pending changesets, skills), or a docsite page. The docs-graph test also rejects a subcommand a command group does not have, in docs, the agent block, and the manifest examples.
  • Before these tests, 13 of 17 planted stale references passed the rename checks; only 4 were caught. Now all 17 fail a test. They were planted one at a time, in each of those places, as the old route, and with a wrong flag.

Records

  • AST-046 FR9 and FR11 (draft): cli/integrations is a level of guides; the CLI-peer rule names themes and section ids; doctor integration docs fails a tree error and warns on a dead link.
  • architecture:cli-surface (current): the two lines that named integration pack --check now name integration verify. Nothing else in it changes.

Checks

  • packages/cli: 336 files, 5,439 tests pass.
  • check:repo (all checks), readme:check, sync:api-types, typecheck:strict, typecheck:json-api, typecheck:authoring, prettier, and eslint on every changed file pass.
  • Docsite: generate passes, and every test file passes but interactive-preview, which needs @astryxdesign/lab built and fails the same way on main in this environment.

Not in this PR

  • Placing the flat topics in real docs sections: a placed doc stops answering to its bare name, and app agent files run astryx docs tokens, so bare names must keep resolving first.
  • astryx upgrade skipping codemods from integrations that are only autolinked, and which version an integration's codemod folder names. The guides describe today's behavior, each in one section.
  • The build window described above.
  • Other CLI behavior bugs the review found (wrong imports from layout expand, component --category in text mode, extra words that init ignores, and more), tracked for a separate fix.

@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 2, 2026 6:24am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 29, 2026
@astracat-bot

astracat-bot Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Oct 2, 2026, 6:37 AM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Sep 29, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Sep 29, 2026
github-actions Bot added a commit that referenced this pull request Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Previews ready: Storybook and Sandbox were built with this PR's docsite. CI evidence will be added when available.

View Storybook for this PR · View Sandbox for this PR

josephfarina and others added 5 commits September 30, 2026 11:03
…mponents, and Templates

Reconstructed on 2026-09-30 by replaying the recorded edits from the lost work tree onto this branch. The rendered Templates routes match review draft V16 byte for byte. Also merges current main, which now includes #6768.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 5dffc06

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 2, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough pass — the short task guides, the corrected reference docs, and naming the pre-publish check integration verify all read as real improvements, and keeping integration pack --check working as a deprecated alias is the right compatibility call.

A few things need attention before this can be approved:

  • Scope. This is about 18,700 changed lines across many separable pieces: the guide restructure, the last pass on every other doc, the rename, unknown-subcommand parity, packed-import resolution, the new peer failures, the doctor severity change, search ranking, docsite redirects, contributor-doc additions, and test deletions. Please split these into reviewable changes, or show why they have to land as one.
  • Deleted coverage for the behaviour that changed most. The search ranking gains new multi-word and phrase tiers, and every CLI doc route moves — while the colocated search tests, the docs-tree builder tests, the docs dispatcher tests, and the docs-graph walk are deleted with no replacement added. Please restore or replace that coverage (the non-brittle version the commit messages promise) in this change.
  • The route inventory is now unchecked. doc-routes.json is updated for the new tree, but its header says doc-routes.test.mjs fails when a route is missing or stale — and that test is one of the deleted files. Please restore an inventory check or remove the inventory and its claim.
  • Description mismatch. The PR body says the old command spelling fails with no alias, but the shipped code and changeset keep it as a deprecated alias. Please update the body to match.

Splitting the bundle and bringing back the search/tree/docs coverage would make this approvable.

[Automated review]

A merge left the packageReferenceProblems loop pasted twice in
authoring-checks, so each un-includable reference block was reported
twice (reference-blocks.test: expected 5, got 10). Remove the duplicate.

Co-authored-by: Cursor <[email protected]>
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec c57dada

Take main's removal of the experimental layout command; keep integration-docs
test deletions; regenerate README. (reference-blocks + doctor link fixes from
prior commits included.)

Co-authored-by: Cursor <[email protected]>
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec b81f2d8

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough pass — the short task guides, the corrected reference docs, and naming the pre-publish check integration verify all read as real improvements, and keeping integration pack --check working as a deprecated alias is the right compatibility call.

A few things need attention before this can be approved:

  • Scope. This is about 18,700 changed lines across many separable pieces: the guide restructure, the last pass on every other doc, the rename, unknown-subcommand parity, packed-import resolution, the new peer failures, the doctor severity change, search ranking, docsite redirects, and test deletions. Please split these into reviewable changes, or show why they have to land as one.
  • A broken rubric import. The template score ledger imports TEMPLATE_RUBRIC from packages/cli/assets/docs/tree/template-quality.doc.mjs, which does not exist — the rubric lives in template-grading-rubric.doc.mjs. Please point the import at the agreed file so the ledger can load.
  • Deleted coverage for the behaviour that changed most. The search ranking gains new multi-word and phrase tiers, and every CLI doc route moves — while the colocated search tests, the docs-tree builder tests, the docs dispatcher tests, and the docs-graph walk are deleted with no replacement added. Please restore or replace that coverage in this change.
  • The route inventory is now unchecked. doc-routes.json is updated for the new tree, but its header says doc-routes.test.mjs fails when a route is missing or stale — and that test is one of the deleted files. Please restore an inventory check or remove the inventory and its claim.
  • Description mismatch. The PR body says the old command spelling fails with no alias, but the shipped code and changeset keep it as a deprecated alias. Please update the body to match.

Splitting the bundle, fixing the import, and bringing back the search/tree/docs coverage would make this approvable.

[Automated review]

Comment thread scripts/template-score-ledger.mjs Outdated
import path from 'node:path';
import {execFileSync} from 'node:child_process';
import {fileURLToPath} from 'node:url';
import {TEMPLATE_RUBRIC} from '../packages/cli/assets/docs/tree/template-quality.doc.mjs';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import names packages/cli/assets/docs/tree/template-quality.doc.mjs, which does not exist at this head — the rubric is exported from template-grading-rubric.doc.mjs in the same directory. As written the ledger will fail to load; please point this import (and the header comment naming that file) at the agreed rubric file.

- buildKit searched limit=60 across all domains; the search titles-tier
  floods multi-word queries with doc matches, burying page templates past
  the cutoff (build.test 'news feed' -> 0 pages). Search wider for
  candidates, cap the surfaced kit to the caller's limit.
- add-a-topic linked {@link generic:themes}, but themes is a namespace now
  (doctor one-route-per-doc failure). Use namespace:themes.
- Remove leftover api/layout generated declarations after main's #6615.

Co-authored-by: Cursor <[email protected]>
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec b81f2d8

@josephfarina
josephfarina force-pushed the docs/cli-integration-guides branch from b81f2d8 to 508f1d7 Compare October 2, 2026 05:26
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 508f1d7

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough pass — the short task guides, the corrected reference docs, and naming the pre-publish check integration verify all read as real improvements, and keeping integration pack --check working as a deprecated alias is the right compatibility call.

A few things need attention before this can be approved:

  • Scope. This is about 18,700 changed lines across many separable pieces: the guide restructure, the last pass on every other doc, the rename, unknown-subcommand parity, packed-import resolution, the new peer failures, the doctor severity change, search ranking, docsite redirects, and test deletions. Please split these into reviewable changes, or show why they have to land as one.
  • A broken rubric import. The template score ledger imports TEMPLATE_RUBRIC from packages/cli/assets/docs/tree/template-quality.doc.mjs, which does not exist — the rubric lives in template-grading-rubric.doc.mjs. Please point the import at the agreed file so the ledger can load.
  • Deleted coverage for the behaviour that changed most. The search ranking gains new multi-word and phrase tiers, and every CLI doc route moves — while the colocated search tests, the docs-tree builder tests, the docs dispatcher tests, and the docs-graph walk are deleted with no replacement added. Please restore or replace that coverage in this change.
  • The route inventory is now unchecked. doc-routes.json is updated for the new tree, but its header says doc-routes.test.mjs fails when a route is missing or stale — and that test is one of the deleted files. Please restore an inventory check or remove the inventory and its claim.
  • Description mismatch. The PR body says the old command spelling fails with no alias, but the shipped code and changeset keep it as a deprecated alias. Please update the body to match.

Splitting the bundle, fixing the import, and bringing back the search/tree/docs coverage would make this approvable.

[Automated review]

josephfarina and others added 2 commits October 1, 2026 23:12
… theme fixture

- template-score-ledger imported the deleted template-quality.doc.mjs; the
  TEMPLATE_RUBRIC owner is template-grading-rubric.doc.mjs after the Quality
  restructure.
- pack-check.lifecycle fixture ships a theme with no @astryxdesign/cli peer,
  which themes_need_cli (this PR) flags; declare the peer so the fixture is a
  valid theme package.

Co-authored-by: Cursor <[email protected]>
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec b2efc29

@josephfarina
josephfarina merged commit f0355e3 into main Oct 2, 2026
40 checks passed
cixzhang added a commit that referenced this pull request Oct 2, 2026
…6887)

`astryx layout expand`, `astryx layout check` and `astryx layout grammar`
shipped in published `@astryxdesign/[email protected]`, as ordinary registered
top-level commands with documented examples, manifest entries, a `layout`
docs topic, and the `layout.expand` / `layout.check` / `layout.grammar`
response schemas. Four fixes to them (#6564, #6569, #6565, #6572) are in
0.6.4's changelog. They are a stable released CLI surface under
`spec:AST-017` FR3.

#6615 removed that surface in one step. `spec:AST-017` (authority: current)
does not allow this yet:

- FR28 requires a replacement-first deprecation patch and a public `DEP-*`
  record before a removal becomes eligible. There is none.
- FR31 allows a removal only when its `DEP-*` and `CLN-*` ids appear in a
  frozen minor manifest. There is no such manifest.
- FR37 requires an owner-approved public minor plan before freeze. There is
  no approved minor plan.
- FR22 forbids retroactively demoting a released stable surface to
  experimental. `layout` was never behind an experimental boundary: FR27
  requires a dedicated experimental namespace, and only the
  `experimental.xle.components` config key had one — the command did not.

So this reverts #6615 and drops its `[breaking]` Changeset.

Effect on the next release, measured with `changeset status`:

- before: all ten fixed-group packages bump **minor** -> 0.7.0
- after:  all ten bump **patch** -> 0.6.5

The ten manifests read 0.6.4, which is the published base; the target is
derived from that base plus the highest pending bump. One `minor` Changeset
in a `fixed` group moves all ten, which is why a single unplanned removal
re-targeted the whole release.

This is compatibility restoration, not new behavior. Nothing is invented and
no deprecation metadata is added: `layout` returns to exactly its 0.6.4
shape, and its deprecation is left to be decided explicitly under AST-017.
Because the removal was never published, main after this change is identical
to 0.6.4 for consumers, so the restoration needs no Changeset of its own.
The retained `@astryxdesign/cli/xle` barrel and the
`experimental.xle.components` config key are untouched.

Conflicts with later main commits were resolved toward main, not toward the
revert:

- `packages/cli/README.md` keeps main's rewritten descriptions and is
  regenerated, so the `layout` row and config row come from the restored
  docs.
- `packages/cli/test/docs-graph.test.mjs` stays deleted; #6737 removed it
  for unrelated reasons.
- `doc-routes.ids.json` keeps both `integration verify` (#6737) and the
  layout ids.

Note for a follow-up: #6737 re-added the layout ids to
`packages/cli/test/doc-routes.ids.json` while the command stayed deleted, so
main currently claims four layout commands and three layout functions that
do not exist. This change makes that file honest again.

Test plan:
- `npx vitest run --root . packages/cli` — 5314 passed, 0 failed
- `pnpm check:repo` — passes, including `check:changesets`
- `npx changeset status` — all ten packages at patch (0.6.5), none at minor
- `astryx layout grammar|check|expand` run again from the built CLI
- `astryx manifest --json` reports 17 top-level commands, matching the
  restored `spec:AST-042` text
@github-actions
github-actions Bot deleted the docs/cli-integration-guides branch October 3, 2026 06:24

This branch was successfully deployed

1 active deployment
Preview — b2efc298 Deployed Oct 2, 2026 by vercel[bot]
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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant