Repository navigation
feat(cli): let doc sections include canonical docs - #6768
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Visual Regression11 of 420 shot(s) changed. View the report A change here is a question, not a failure: check whether the after is the
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Approval is on hold pending a maintainer decision on the governing spec.
This change lets a guide section include a canonical doc (for example, two fields of the integration manifest schema) instead of copying it, and the implementation evidence for that behaviour is solid. However, the only record describing which blocks a topic section may hold is currently a draft, and it says topic sections hold only the stable blocks, with reference blocks belonging to namespace docs for a later phase. No current, approved record was found that authorises reference blocks in topic sections, and the change description notes the same. A maintainer therefore needs to first provide or identify the governing spec for this addition — for example, by promoting the draft record with its amended wording to approved/current status on the main branch, or by identifying a different current record that covers topic-section reference blocks, their projections and presentations, authoring-schema targets, and the new authoring-check failure behaviour. The spec edit inside this PR is a proposal and cannot authorise itself, so approval waits on that maintainer decision rather than on removing or splitting the feature.
[Automated review]
|
/approve-spec 3151e09 |
There was a problem hiding this comment.
Approval is on hold pending a maintainer decision on the governing spec.
This change lets a guide section include a canonical doc (for example, two fields of the integration manifest schema) instead of copying it, and the implementation evidence for that behaviour is solid. However, the only record describing which blocks a topic section may hold is currently a draft, and it says topic sections hold only the stable blocks, with reference blocks belonging to namespace docs for a later phase. No current, approved record was found that authorises reference blocks in topic sections, and the change description notes the same. A maintainer therefore needs to first provide or identify the governing spec for this addition — for example, by promoting the draft record with its amended wording to approved/current status on the main branch, or by identifying a different current record that covers topic-section reference blocks, their projections and presentations, authoring-schema targets, and the new authoring-check failure behaviour. The spec edit inside this PR is a proposal and cannot authorise itself, so approval waits on that maintainer decision rather than on removing or splitting the feature.
[Automated review]
…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.
…ion verify` (#6737) * cli docs: integration guides, a last pass on every doc, and integration verify * Audit fixes: old command spelling, search without Core, retitled sections, guide corrections * Second audit round: build and search ranking, codemod guides, task titles, older-CLI facts * Round 3: stable-CLI wording, doctor unknown subcommands, rename and version drift tests * feat(cli): let doc sections include canonical docs * Restore the integration guide work lost on Sep 29: Make a package, Components, 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. * fix(cli): dedupe sameWord in search, drop duplicated single-component section, regenerate README tables Co-authored-by: Cursor <[email protected]> * wip(cli-docs): restructure cli/integrations into phases; add namespace intros; make-a-package -> Quick Start Co-authored-by: Cursor <[email protected]> * refactor(cli-docs): rename contribute namespace -> Building Blocks Co-authored-by: Cursor <[email protected]> * docs(cli): add Building Blocks intro (what you can add, mix freely) Co-authored-by: Cursor <[email protected]> * docs(cli): group Building Blocks into Types and Configuration Co-authored-by: Cursor <[email protected]> * docs(cli): make Configuration its own namespace under Building Blocks (types stay top-level) Co-authored-by: Cursor <[email protected]> * fix(cli-docs): re-point grade-template-with-agent example routes under building-blocks/templates Co-authored-by: Cursor <[email protected]> * docs(cli): replace banned word 'tarball' with '.tgz file' / packed package (keep quoted CLI error) Co-authored-by: Cursor <[email protected]> * docs(cli): flatten components (drop single-item Advanced group) Co-authored-by: Cursor <[email protected]> * docs(cli): inline overview into describe-the-component, retire overview page, drop 'consumers' Co-authored-by: Cursor <[email protected]> * test(cli): migrate doc test expectations to the restructured tree (tree, docs); move devDependency note to quick-start Co-authored-by: Cursor <[email protected]> * docs(cli): single-component — one ComponentDoc orientation link up front; drop per-section field embeds (lighter usage/props/examples) Co-authored-by: Cursor <[email protected]> * docs(cli): document ComponentDoc `replaces` as a first-class field - Declare `replaces` on ComponentBaseDoc (type), ComponentBaseSchema (validation), and component.doc.mjs (schema doc) so it is a documented contract, not a passthrough-only field. - Fixes the broken `reference` embed in replace-a-core-component (the guide embedded fields:['replaces'] but the schema never declared it) — also clears a real-tree reference-gap failure in reference-blocks.test. - replace-a-core-component: drop banned word 'autolink' -> 'the automatic pick'. Co-authored-by: Cursor <[email protected]> * docs(cli): start-a-template — lead with the component-vs-template distinction, drop re-definition that echoed the templates landing summary Co-authored-by: Cursor <[email protected]> * docs(cli): replace-a-core-template — drop banned words (autolink -> picked automatically / configured explicitly; 'fails closed' -> 'is safe by default') templates.test asserted 'fails closed' (enforcing a banned word); updated to 'is safe by default' to match. Co-authored-by: Cursor <[email protected]> * test(cli): drop brittle templates.test content-assertion (exact-string doc coupling fights editing; re-add non-brittle coverage at the end) Co-authored-by: Cursor <[email protected]> * test(cli): remove the integration-docs test suite (content/route-coupled) These assert exact doc prose, routes, and tree structure, so they break on every wording tweak or restructure during this authoring pass. Removing them per the 'explore now, add non-brittle tests at the end' plan. Kept reference-blocks.test (fixture-based embed mechanism, not coupled to our content). Co-authored-by: Cursor <[email protected]> * docs(cli): inline template-assets-overview into the Assets namespace intro; retire the separate page (owner-table orientation now opens the namespace, 4 asset guides remain as children) Co-authored-by: Cursor <[email protected]> * docs(cli): restructure templates Quality into a 'How to write good templates' namespace - New write-good-templates namespace: the dissolved template-quality overview (what good means + the review loop) is now its intro; children are the rubric and grade-with-agent. - Moved the TEMPLATE_RUBRIC source-of-truth into template-grading-rubric (its owner) and gave the rubric the score overview (grade bands + version). - Reparented template-grading-rubric and grade-template-with-agent under write-good-templates; repointed grade-with-agent's import + prompt routes and test-template-in-app's link. Retired template-quality. Co-authored-by: Cursor <[email protected]> * docs(cli): expand themes into a namespace Convert the single themes guide into a Themes namespace with an intro and 7 guides: add-a-theme, generate-a-palette, define-the-theme, ship-fonts-and-assets, use-a-theme-in-an-app, document-the-theme, themes-on-older-clis. New content from real theme-integration reviews: fonts/keyframes do not travel with 'theme add' (export ./fonts.css, ship the files, import once, not the root); light-dark() is colors-only; never set Core --_* private vars; document a theme by extending the core 'theme' topic (not agentDocs). Co-authored-by: Cursor <[email protected]> * docs(cli): rewrite themes to install-and-apply + extends (not copy) An integration theme is the same shape as a standalone theme package: apps install the package, apply it with <Theme>, and customize with extends. No copy. - add-a-theme: scaffold blank, or --from to fork an existing theme as a start - define-the-theme: add 'build on another theme' with extends - use-a-theme-in-an-app: install + apply + extend, point to the core theme docs - document-the-theme: extend the core theme topic (no copy/fonts step) - remove ship-fonts-and-assets (a copy-only problem) Matches delegated task T291109887 (agentcloud implementing the CLI to match). Co-authored-by: Cursor <[email protected]> * docs(cli): drop themes-on-older-clis guide Transitional edge case — themes are new in 0.7, so there is no installed base of theme-consuming apps on older CLIs. The durable action (declare the optional @astryxdesign/cli peer) already lives in add-a-theme/define-the-theme, and versioning owns compatibility. Co-authored-by: Cursor <[email protected]> * docs(cli): themes — add fonts-and-assets guide (designer learnings) Ship a theme's fonts and keyframes so they load when an app installs + applies it: every weight/style, unicode-range, font-display: swap, license, ship the files; keyframes + sideEffects; and verify in the browser (italic face resolves, no system fallback, animations run, contrast holds). Linked from the intro and use-a-theme-in-an-app. Co-authored-by: Cursor <[email protected]> * docs(cli): palette preview — 'ship in your package' not 'copy' (install model) Co-authored-by: Cursor <[email protected]> * docs(cli): rewrite generate-a-palette for first-time authors Explain what a palette is, why you generate it from seeds, and how; drop the confusing 'palette request' term for 'palette config' (matches the palette.config.json file). Co-authored-by: Cursor <[email protected]> * docs(cli): define-the-theme — explain what a token is and why you map palette to tokens Co-authored-by: Cursor <[email protected]> * docs(cli): correct themes font model — theme names fonts, app loads them fonts-and-assets claimed the package ships font files and 'nothing extra in the app', the opposite of theme.template.ts: Astryx never loads a font file. Rewrite to name fonts in typography tokens and have the app load them (hosted link or self-host @font-face). Fix the same error that leaked into use-a-theme-in-an-app. Co-authored-by: Cursor <[email protected]> * docs(cli): document-the-theme — tell users which fonts to load (closes fonts loop) Co-authored-by: Cursor <[email protected]> * fix(cli): dedupe reference-problem loop in integration doc checks 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]> * fix(cli): restore build-kit page matches + fix themes doc link - 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]> * fix(cli): repoint score-ledger to grading-rubric; declare CLI peer in 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]> --------- Co-authored-by: Joey Farina <[email protected]> Co-authored-by: Cursor <[email protected]>









User need
Integration guides keep copying canonical CLI docs. A guide that says "set these fields in
astryx.integration.mjs" pastes the field table from the manifest schema, and the copy goes stale the next time the schema changes. Same with command options and API functions.This lets a normal guide section pull in the canonical doc instead of copying it.
Problem and solution fit
A topic section can now hold the existing
referenceblock shape. No new block kind.astryx docs <topic> <section>then prints the two field rows straight from the schema's own doc, then where they came from:astryx docsprints it.projection.fieldskeeps only the named fields of a schema, in the order you list them.presentationisfullby default.compactdrops code blocks.summaryis one line with the doc's title, summary, and the command that opens it.schema:integrationresolves now. The authoring schemas are sections ofastryx docs authoring, not tree nodes, so before this they didn't resolve at all.Current specification
No current record covers doc block types. Draft
spec:AST-047FR9 said a topic's sections hold only the stable blocks, and that reference blocks belong to namespace docs "which a later phase renders". This PR is that later phase, forreferenceonly. I amended that one FR9 sentence to match.workflowandcollectionstay namespace-only.Public delta and caller burden
ReferenceSection.contentis now(ReferenceContentBlock | ReferenceDocBlock)[].ReferenceContentBlockkeeps its six members, so exhaustive renderers written against it don't break.docs.detailanddocs.detail.sectionstill return only the stable block kinds. The docs JSON types pin a read section's content toReferenceContentBlock[].astryx doctor integration docsfails (invalid_doc_reference) when the target names no doc, a named field doesn't exist, or the doc can't take the projection or presentation. A read marks the gap instead of silently dropping it. A project'sastryx doctoronly warns, since an app can't fix an integration's docs.@astryxdesign/cli:schema:integration. That's the existing link rule.Compatibility
A stable CLI before 0.7.0 rejects a topic that holds a reference block, the same way it rejects other docs-tree fields. I didn't add a gate for this one feature. One optional
@astryxdesign/clipeer floor for every integration comes as a separate follow-up. Until it lands, integrations shouldn't publish reference blocks. The CLI's own docs can use them now, since they ship with the CLI.Design and alternatives
referenceblock in the JSON with alinkandcontent. Rejected. It adds a block kind every JSON consumer and the docsite would have to handle. Inlining it the way token-refs are inlined keeps the contract, and the CLI and docsite render it with no changes.projection.sections. Not in this PR. It needs nested references and token-refs resolved inside the included content. For now it fails the authoring check with a clear message.Evidence
astryx docs authoring integrationprints for the same fields.Scope
Testing
api/docs/reference-blocks.test.mjs: the fields projection, reading from the canonical doc, stable kinds in every read, compact and summary, text output, identity resolution for authoring schemas, a clean authoring check, a failing authoring check with one error per gap, visible gaps in a read, and a project doctor warning.links.test.mjs,docs-discovery.test.mjs, andload-contract.test.mjs. A newtypecheck:authoringfixture fails if a section takes any other block kind.packages/clisuite, typecheck strict/json-api/authoring/template-docs,check:repo, the copyright/exports/README/api-types checks, and docsite generate, test, and typecheck all pass.Merging with #6737
Both PRs touch some of the same files, like the docs adapter, the authoring checks, and the reference doc type. I merged this commit with #6737's current head. Git merged it with no conflicts, and the full
packages/clisuite passes on the merged tree, #6737's rename and version-wording checks included.@josephfarina