Skip to content

fix(cli): template help names only what the base serves - #12419

Merged
josephfarina merged 3 commits into
mainfrom
bases-template-help
Nov 18, 2026
Merged

josephfarina merged 3 commits into
mainfrom
bases-template-help

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Record changes: spec:AST-017 FR14 adds that option help leaves out a part naming a command or option the base does not serve; architecture:cli-surface INV7 describes the option pointers field. Proof: on a non-Core base, template --help and mcp --help no longer name --skeleton, @astryxdesign/core or theme targets; on Core, help, JSON help, docs and manifest are byte-identical to main.

User impact

In a project whose base is not Core, option help described Core-only usage. In astryx template --help, the --list text said --skeleton is refused, but that base hides --skeleton, and the --package text suggested @astryxdesign/core, which that project does not have. In astryx mcp --help, the --docs-only text named theme targets, which that base hides. An agent that reads help could try an option or package the base does not serve.

Problem and solution fit

Help already leaves out a command's pointer, and a root option's pointer part (--detail), when the run's base does not serve what it names. But options built from a command doc had a plain description only, so these clauses could not be marked. This change lets a command doc's option declare its parts, and the existing option-description path drops them per base.

Expected behavior and authority

  • spec:AST-017 FR14 (current): help leaves out the commands and options the run's base does not serve. This PR records in FR14 that an option's text in help also leaves out a part that names one of them.
  • architecture:cli-surface INV7 (current): help comes from each command's CommandDoc. This PR records the option pointers field there.
  • spec:AST-114 FR7 is draft context only.

Smallest restoration

  • A command doc's option can declare pointers: parts that continue its description, in order. Each part is plain text, or {commands, text} like a command's pointers. The command builder passes them to describeOption, so help and JSON help (both read servedHelpOptionDescription) drop a pointer the base does not serve. Type, schema, and the command self-doc describe the field.
  • The manifest and the Commander description keep the full text. The docs and search read each option's published description (description plus every part), the same way they read a command's summary with its pointers.
  • When an option has no description of its own, its text inherits its API parameter's description, and its parts follow that text. This works the same in help and in the docs.
  • template.doc.mjs uses it for the two clauses: , --skeleton in --list names template --skeleton, and the @astryxdesign/core sentence in --package names the run that selects a replaced Core original.
  • mcp.doc.mjs uses it for and theme targets in --docs-only. A scan of every command's option help on a non-Core base finds no other option text that names a hidden command or option.

Evidence

  • Before: on a native base fixture, template --help printed <name>, <path>, --skeleton and --overwrite are refused and Use @astryxdesign/core to select an original….
  • Before: mcp --help on that base printed (search, build, component, hook, docs, template, discover, theme list and theme targets).
  • After: it prints <name>, <path> and --overwrite are refused and Narrow to templates from a specific package., and mcp --help prints (…, discover, theme list), one message at a time.
  • Unchanged path: on Core, template --help, --json template --help, docs cli/commands/template, mcp --help, --json mcp --help, docs cli/commands/mcp, --json manifest, and search skeleton --json are byte-identical to main. The goldens did not change.
  • Unit tests: define-command.test.mjs builds an option's text from its parts and drops a part the base does not serve. cli-self-docs.test.mjs renders every part, after the option's own text or its parameter's text.
  • Regression test: bases.test.mjs ("names in option help only what the base serves") checks that template text and JSON help on the native base name neither --skeleton nor @astryxdesign/core, and that mcp --help does not name theme targets.

Scope

Components: CLI (template and mcp command docs, help, authoring doc types), AST-017 FR14, cli-surface INV7, CLI conventions guide

  • One defect is restored (option help names what the base hides).
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label. (The fix adds one optional authoring field, options[].pointers. It works like the existing command-level pointers. The authoring self-doc, the CLI surface record, and the CLI conventions guide describe it.)
  • Public text and artifacts contain no internal Meta context.

Writing rubric results

Run over the added sentences in AST-017 FR14 and cli-surface INV7.

  • R1 narration: none. Both additions state present-tense help and manifest behavior.
  • R2 research: none.
  • R3 evidence: no evidence cells changed.
  • R4 rejected alternatives: none added.
  • R5 change references: none.
  • R6 open questions: none touched.
  • R7 project status: none.

Testing

  • vitest (node project, --maxWorkers=4): bases.test, golden-reads, experimental-isolation, template.flag-help, clients/cli/lib, authoring, cli-self-docs: all pass.
  • pnpm sync:api-types, pnpm typecheck, pnpm typecheck:json-api, pnpm typecheck:authoring, pnpm readme:check (in packages/cli)
  • node .github/scripts/cli-api-types-verify.mjs, pnpm check:knowledge, node scripts/check-changesets.mjs, eslint on changed files

@vercel

vercel Bot commented Nov 17, 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 Nov 18, 2026 9:05am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 9:14 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 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.

Approval waits on an engineering owner decision: no current spec governs the new options[].pointers authoring field (CommandOptionDoc.pointers in @astryxdesign/cli/authoring) or leaving the @astryxdesign/core sentence out of template --package help on a base other than Core, and the closest record, the bases spec's FR7, is still draft. An engineering owner settles both by naming the governing record, or by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. The help change itself works: the new bases test passes, and Core output is unchanged.

  • The "Expected behavior and authority" line calls the bases spec current, but spec:AST-114 is draft, so cite spec:AST-017 FR14 for the --skeleton part and the record the owner names for the rest.

Non-blocking: an option documented only through param would show just its pointer text in astryx docs once it gains pointers, because publishedOptionDescription does not fall back to the param description (inline note).

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Changeset: on a non-Core base, template help no longer names --skeleton in the --list text: verified (new bases test; base and head help output).
  • Changeset: it no longer suggests --package @astryxdesign/core: verified (same).
  • Changeset: a command doc's option can declare pointers that help leaves out when the base does not serve what they name: verified (type.ts:58-64, _schema.mjs:657-669, define-command.mjs:341-350).
  • Description: base help named an option and a package the base does not serve, and following them fails: verified (on a native base, template --list --package @astryxdesign/core and template shell-side-nav --package @astryxdesign/core exit 1).
  • Description: help already drops command pointers and the root --detail pointer parts, while doc options had one plain description: verified (define-command.mjs:300-313, index.mjs:694-703).
  • Description: the governing record is the current bases spec: false (spec:AST-114 is draft).
  • Description: help and JSON help both read the served option description: verified (base-gate.mjs:207, json-shim.mjs:114).
  • Description: the manifest and Commander description keep the full text, and docs and search read every part: verified (define-command.mjs:212-216, cli-self-docs.mjs:124-142; manifest and docs output unchanged).
  • Description: the template doc marks the two clauses: verified (template.doc.mjs:47-71).
  • Description: on Core, template help, JSON help, the template docs page, the JSON manifest and search skeleton --json are byte-identical, and goldens did not change: verified (base and head output; golden-reads test passes).
  • Description: the regression test checks text and JSON help on a native base: verified (bases.test.mjs:594-615).
  • Description: no internal context in public text: verified.
  • Description: the listed tests and checks pass: verified for the tests, authoring and JSON-API typechecks, README, changeset and published-type checks and lint; the strict typecheck needs a theme build.
  • Files: .changeset/cli-template-help-base.md clear; _schema.mjs clear; command.doc.mjs clear; type.ts new public member, held for an owner; bases.test.mjs clear; template.doc.mjs clear; define-command.mjs clear; cli-self-docs.mjs non-blocking note; command-pointers.mjs non-blocking note.

Automated review (maintainer link)

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 2666050

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 5.43 MB packed (+950 B); no new dependencies.

API changes: cli +1 · ~0 · −0

1 API change (advisory)
Package Where Signature Usage
+ cli ./authoring · Types · interface CommandOptionDoc pointers?: (string | {commands: string[]; text: string})[] import type {CommandOptionDoc} from '@astryxdesign/cli/authoring'; const x: CommandOptionDoc = {pointers: …}

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): a command doc's option may declare pointers, an optional additive field on CommandOptionDoc, so the help on a base other than Core does not point at Core-only options. On another base, template --help leaves "--skeleton" out of --list and the Core sentence out of --package. Core's help, JSON help, docs and goldens stay byte-identical. spec:AST-017 FR14 records the --skeleton part, the current CLI authoring record names the pointers field, the authoring docs describe it, and a test covers help on a non-Core base.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 441d001

@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.

Changes requested: the template help fix works, and an engineering owner has approved the new options[].pointers field and the record text, but one help line still contradicts the FR14 sentence this pull request adds.

  • astryx mcp --help on a base other than Core still names theme targets in --docs-only (packages/cli/clients/cli/commands/mcp.doc.mjs:34), a command that base hides, so either mark that clause as a pointer ({commands: ['theme targets'], text: ' and theme targets'}) or narrow the new FR14 sentence to the parts a command doc marks as pointers.

Non-blocking: the changeset is tagged [fix] but also announces the new authoring field, which spec:AST-017 FR7 would tag [feat]. The earlier note about parameter-only options in the docs is fixed.

Claims and files checked

Review mode: full; reason: spec-record

  • Changeset: on a non-Core base, template help no longer names --skeleton in the --list text: verified (new bases test; base and head help on the same fixture).
  • Changeset: it no longer suggests --package @astryxdesign/core: verified (same).
  • Changeset: a command doc's option can declare pointers that help leaves out when the base does not serve what they name: verified (type.ts:58-64, _schema.mjs:657-669, define-command.mjs:341-350).
  • Description: on a non-Core base, help named an option and a package that fail there: verified (base help on the fixture).
  • Description: help already drops a command's pointer and the root --detail pointer part, while doc options had one plain description: verified (define-command.mjs:299-313, index.mjs:695).
  • Description: help and JSON help both read the served option description: verified (base-gate.mjs:207, json-shim.mjs:114).
  • Description: the manifest and the Commander description keep the full text, and docs and search read the description plus every part: verified (define-command.mjs:212-222, manifest.mjs:113, cli-self-docs.mjs:189-191; manifest and docs output unchanged on the fixture).
  • Description: an option with no description of its own leads with its parameter's text, then its parts, in help and docs alike: verified (define-command.mjs:339, command-pointers.mjs:44-52, unit tests).
  • Description: the template doc marks the two clauses: verified (template.doc.mjs:46-72).
  • Description: before and after help text on a native base fixture: verified (base and head output).
  • Description: on Core, template help, JSON help, the template docs page, the JSON manifest and skeleton search are byte-identical, and the goldens did not change: verified (base and head output; golden reads test passes).
  • Description: the unit tests build an option's text from its parts, drop an unserved part, and render every part in the docs: verified (define-command.test.mjs:33, cli-self-docs.test.mjs:320).
  • Description: the regression test checks text and JSON help on a native base: verified (bases.test.mjs:594-615).
  • Description: FR14 now records that an option's text in help leaves out a part that names an unserved command or option: false for mcp --docs-only (finding above).
  • Description: INV7 records the option pointers field, and the bases spec's FR7 is draft context only: verified (cli-surface.md:169-174).
  • Description: the rubric results cover the added record sentences: verified (no narration, status or change references in them).
  • Description: no internal context in public text: verified.
  • Description: the listed tests and checks pass: verified for the listed test suites, the authoring, JSON-API and template-doc typechecks, the README, knowledge and changeset checks and lint; the packed published-type check was not rerun.
  • Files: .changeset/cli-template-help-base.md non-blocking note; docs/architecture/cli-surface.md clear; docs/contributing/cli-conventions.md clear; docs/specs/AST-017/spec.md blocking (the FR14 sentence); _schema.mjs clear; command.doc.mjs clear; type.ts clear; bases.test.mjs clear; template.doc.mjs clear; define-command.mjs clear; define-command.test.mjs clear; cli-self-docs.mjs clear; cli-self-docs.test.mjs clear; command-pointers.mjs clear.

Automated review (maintainer link)

Comment thread docs/specs/AST-017/spec.md Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec c4fbfe7

@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.

Approved pending CI: the CI workflow has not finished on this head yet, so this is not ready to merge until it passes.

The mcp --docs-only help line now marks the theme targets clause as a pointer, so on a base other than Core no option help names a command or option that base hides, as the new FR14 sentence says; the changeset is now tagged [feat] for the new options[].pointers authoring field, and an engineering owner approved the record text at this head. No blocking findings remain.

Claims and files checked

Review mode: incremental; reason: none

  • Changeset: a command doc's option can declare pointers, parts that help leaves out when the base does not serve what they name: verified (type.ts:58-64, _schema.mjs:657-669, define-command.mjs:340-350, define-command.test.mjs:33).
  • Changeset: on a non-Core base, template help no longer names --skeleton in the --list text: verified (bases.test.mjs:594-619; base and head help on the same fixture).
  • Changeset: it no longer suggests --package @astryxdesign/core: verified (same).
  • Changeset: mcp help no longer names theme targets in the --docs-only text: verified (bases.test.mjs:613-616; base and head help).
  • Description: on a non-Core base, three option texts named an option, a package and a command that base does not serve: verified (base help on the fixture).
  • Description: help already dropped a command's pointer and the root --detail part, while command-doc options had one plain description: verified (define-command.mjs:299-313, index.mjs:695).
  • Description: FR14 already hides unserved commands and options, and the pull request records the option-text case there: verified (docs/specs/AST-017/spec.md:313-322).
  • Description: INV7 already generates help from each command doc, and the pull request records the option pointers field there; the bases spec's FR7 is draft context only: verified (docs/architecture/cli-surface.md:165-174).
  • Description: help and JSON help both read the served option description: verified (base-gate.mjs:207, json-shim.mjs:114).
  • Description: the type, schema and command self-doc describe the field: verified (type.ts:58-64, _schema.mjs:657-669, command.doc.mjs:162-167).
  • Description: the manifest and the Commander description keep the full text, and docs and search read the description plus every part: verified (define-command.mjs:212-222, manifest.mjs:113, cli-self-docs.mjs:189-190; manifest, docs and search output unchanged).
  • Description: an option with no description of its own leads with its parameter's text, then its parts, in help and docs alike: verified (define-command.mjs:339, command-pointers.mjs:44-52, both unit tests).
  • Description: the template doc marks the two clauses and the mcp doc marks the theme targets clause: verified (template.doc.mjs:51-54, :66-71, mcp.doc.mjs:35-38).
  • Description: no other option text on a non-Core base names a hidden command or option: verified (option help of all 43 served commands scanned; none).
  • Description: the before and after help text on a non-Core fixture: verified (base and head output).
  • Description: on Core, template and mcp help, JSON help and docs pages, the JSON manifest and skeleton search are byte-identical, and the goldens did not change: verified (base and head output; golden reads test passes).
  • Description: the unit tests build an option's text from its parts, drop an unserved part, and render every part in the docs: verified (define-command.test.mjs:33, cli-self-docs.test.mjs:320).
  • Description: the regression test checks template text and JSON help and mcp help on a non-Core base: verified (bases.test.mjs:594-619).
  • Description: the scope checklist discloses the one optional authoring field: verified.
  • Description: no internal context in public text: verified.
  • Description: the writing rubric results cover the added record sentences: verified (present tense, no narration, status or change references).
  • Description: the listed tests and checks pass: verified for the listed test suites, the authoring, JSON-API and template-doc typechecks, the README, knowledge and changeset checks, lint and the published type check; the strict typecheck stops only on two unchanged template pages that need a theme build.
  • Files: .changeset/cli-template-help-base.md clear; docs/architecture/cli-surface.md clear; docs/contributing/cli-conventions.md clear; docs/specs/AST-017/spec.md clear; packages/cli/authoring/doctypes/_schema.mjs clear; packages/cli/authoring/doctypes/command/command.doc.mjs clear; packages/cli/authoring/doctypes/command/type.ts clear; packages/cli/clients/cli/bases.test.mjs clear; packages/cli/clients/cli/commands/mcp.doc.mjs clear; packages/cli/clients/cli/commands/template.doc.mjs clear; packages/cli/clients/cli/lib/define-command.mjs clear; packages/cli/clients/cli/lib/define-command.test.mjs clear; packages/cli/foundation/discovery/cli-self-docs.mjs clear; packages/cli/foundation/discovery/cli-self-docs.test.mjs clear; packages/cli/foundation/discovery/command-pointers.mjs clear.

Automated review (maintainer link)

On a base other than Core, `astryx template --help` described Core-only
usage: the `--list` text named `--skeleton`, which that base hides, and
`--package` suggested `@astryxdesign/core`.

A command doc's option can now declare `pointers`: parts that continue its
description, each plain text or a pointer that names command paths. The
command builder passes them to describeOption, so help and JSON help drop a
pointer the run's base does not serve. The manifest, docs, and search read
the whole text, which on Core is unchanged.
AST-017 FR14 records that an option's text in help leaves out a part that
names a command or option the run's base does not serve. The CLI surface
record (INV7) and the CLI conventions guide describe the option `pointers`
field.

An option with pointers and no description of its own now leads with its
API parameter's text in the docs, as it does without pointers. Unit tests
cover building the parts, dropping an unserved one, and the docs text.
The `--docs-only` text in `astryx mcp --help` marks ` and theme targets`
as a pointer, so a base that hides `theme targets` does not name it. A
scan of every command's option help on a non-Core base finds no other
option text that names a hidden command or option. The bases test covers
`mcp --help`. The changeset is `[feat]`: it adds an authoring field.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 2666050

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed needs:spec-owner-review Current knowledge records await owner approval labels Nov 18, 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.

Approved. After the rebase onto main, option help on a base other than Core still leaves out only the parts that name what that base hides (--skeleton, the Core package sentence and theme targets), Core output is byte-identical, CI passed on this head, and an engineering owner approved the record text at this head.

  • Non-blocking: component --package and swizzle --package still suggest @astryxdesign/core on a base other than Core, the same kind of sentence this change marks in template --package; marking them the same way would make the three commands agree.
Claims and files checked

Review mode: full; reason: rebase

  • Changeset: a command doc's option can declare pointers, parts that help leaves out when the base does not serve what they name: verified (type.ts:58-64, _schema.mjs:657-669, define-command.mjs:341-350, define-command.test.mjs:33).
  • Changeset: on a base other than Core, template help no longer names --skeleton in the --list text or suggests --package @astryxdesign/core: verified (bases.test.mjs:594-620; base and head help on the same fixture).
  • Changeset: on such a base, mcp help no longer names theme targets in the --docs-only text: verified (same).
  • Description: the requirement record now says option help leaves out a part naming a hidden command or option, and the CLI surface record describes the option pointers field: verified (docs/specs/AST-017/spec.md:316-319, docs/architecture/cli-surface.md:169-174).
  • Description: before, three option lines on such a base named an option, a package and a command that base hides: verified (base help on the fixture).
  • Description: help already dropped a command's pointer and the root --detail part per base, while command-doc options carried one plain description: verified (define-command.mjs:182-251, index.mjs:695).
  • Description: the current requirement already hides unserved commands and options, help comes from each command doc, and the bases record is draft context only: verified (current records on main, unchanged since the merge base).
  • Description: help and JSON help both read the served option description: verified (base-gate.mjs:145-150, :207; json-shim.mjs:114).
  • Description: the type, schema and command self-doc describe the field: verified (type.ts:58-64, _schema.mjs:657-669, command.doc.mjs:162-167).
  • Description: the manifest and the Commander description keep the whole text, and docs and search read the description plus every part: verified (manifest.mjs:107-115, cli-self-docs.mjs:189-190, :258; manifest, docs and search output unchanged on both projects).
  • Description: an option with no description of its own leads with its parameter's text, then its parts, in help and docs alike: verified (define-command.mjs:339-349, command-pointers.mjs:44-52, both unit tests).
  • Description: the template doc marks the --skeleton clause and the Core sentence, and the mcp doc marks the theme targets clause: verified (template.doc.mjs:51-54, :66-71, mcp.doc.mjs:35-38).
  • Description: no other option text on such a base names a hidden command or option: verified (option help of all 43 served commands; none).
  • Description: the before and after help text: verified (base and head output on the fixture).
  • Description: on Core, template and mcp help, JSON help, both docs pages, the JSON manifest and skeleton search are byte-identical, and the goldens did not change: verified (base and head output; golden reads test passes).
  • Description: the unit tests build an option's text from its parts, drop an unserved part and render every part in the docs; the regression test checks template text and JSON help and mcp help on such a base: verified (define-command.test.mjs:33, cli-self-docs.test.mjs:320, bases.test.mjs:594-620).
  • Description: the scope checklist discloses the one optional authoring field: verified.
  • Description: public text carries no internal context: verified.
  • Description: the writing rubric results cover the added record sentences: verified (present tense; no narration, status or change references).
  • Description: the listed tests and checks pass: verified for the listed test suites, API type sync, the authoring, JSON-API and template-doc typechecks, the README, knowledge and changeset checks, lint and the published type check; the strict typecheck here stops only on two unchanged template pages that import a theme build output this environment did not build.
  • Files: .changeset/cli-template-help-base.md clear; docs/architecture/cli-surface.md clear; docs/contributing/cli-conventions.md clear; docs/specs/AST-017/spec.md clear; packages/cli/authoring/doctypes/_schema.mjs clear; packages/cli/authoring/doctypes/command/command.doc.mjs clear; packages/cli/authoring/doctypes/command/type.ts clear; packages/cli/clients/cli/bases.test.mjs clear; packages/cli/clients/cli/commands/mcp.doc.mjs clear; packages/cli/clients/cli/commands/template.doc.mjs clear; packages/cli/clients/cli/lib/define-command.mjs clear; packages/cli/clients/cli/lib/define-command.test.mjs clear; packages/cli/foundation/discovery/cli-self-docs.mjs clear; packages/cli/foundation/discovery/cli-self-docs.test.mjs clear; packages/cli/foundation/discovery/command-pointers.mjs clear.

Automated review (maintainer link)

@josephfarina
josephfarina merged commit 4a8df8b into main Nov 18, 2026
81 checks passed
@github-actions
github-actions Bot deleted the bases-template-help branch November 19, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 26660501 Deployed Nov 18, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant