Skip to content

feat(cli): component reads print a short answer by default - #12291

Merged
josephfarina merged 5 commits into
mainfrom
josephfarina/component-short-answer
Nov 18, 2026
Merged

josephfarina merged 5 commits into
mainfrom
josephfarina/component-short-answer

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

User need

An agent that builds with Astryx runs astryx component <Name> before it uses a component, and it reads every byte the answer prints. Today the default answer is the whole doc: anatomy, every best practice, every prop with its description, theming tables. To write the code it needs the import, how to use it, the prop names and types, and the pieces it is used with. The rest costs context on every read, and the pieces are another lookup per component.

Problem and solution fit

A component read now prints a short answer by default (the --detail compact level, rewritten):

  • the first paragraph of the description and the import;
  • a usage block: the doc's first example when it is short and runs on its own, else one element built from the required props (<Dialog isOpen={...} onOpenChange={...}>...</Dialog>), and no usage block when the component has neither; setup examples keep their label;
  • every prop as one line: name, type, default, required, experimental, and its description's first sentence (architecture:cli-surface INV4's cut; --props prints them whole);
  • the authored accessibility requirements and component icon slots, as before;
  • the pieces from the same family doc, with one batch command that reads them all;
  • a line naming component <Name> --props for each prop's whole description, and as the last line the --detail full command for the full output (anatomy, best practices, examples and theming).

Every part comes from fields each component doc already has, so a component from an integration gets the same answer with no extra authoring.

Current specification

  • architecture:cli-surface INV4: text is a projection of the JSON; a shortened field keeps a route (--detail full, --props, and --json carry every field). INV5 unchanged.
  • spec:AST-017 DEC-4 and FR13: --json is unchanged at every detail level, and --detail full remains the text projection of every field. Before this change --detail compact printed up to three examples and the derived theme properties, and --detail brief printed a usage example and theme variables; the new compact level prints a usage line and names --detail full for the rest.
  • This PR amends architecture:cli-surface INV4 to name the component-read default (compact), its routes (--props, --detail full) and that the detail level never changes a component read's JSON (list and hook JSON keep their levels).
  • docs/contributing/cli-conventions.md, "Output: keep answers short": the change names its routes and is tested with agents.

Public delta and caller burden

  • Default text of astryx component <Name> (and of each row of a batch read) is the short answer. --detail full prints exactly what the default printed before. --detail brief, --props, --source, --showcase, --blocks, list views and --json are unchanged.
  • --detail compact prints the new short answer.
  • Help text for --detail, the component command description, the component() API JSDoc, the CLI README's global options, the getting-started, working-with-AI and author-a-theme docs, the themeTargets() and theme targets docs, the theme template's comments (they name component <Name> --detail full as the theming reference), the component-docs skill and the repository agent prompt say so. The component-text and docs-topics goldens are regenerated.

Before (default, component Dialog): 3,956 bytes. After: 1,876 bytes. Button 8,439 → 3,915. Table 7,945 → 4,467.

Design and alternatives

  • A new detail level was rejected: --detail is a global option shared with docs reads, and compact already meant "the component read with less".
  • Choosing a few "key" props per component was rejected: it needs usage data that a new component or an integration does not have. The short answer keeps every prop with its description's first sentence.
  • Reading each piece's props into the parent's answer needs a JSON change (INV4), so it is left for a separate change; the batch command reads all pieces in one call.

Evidence

  • component.short-answer.test.mjs: the default read prints the short answer and ends with the --detail full line; --detail full prints the whole doc; a batch gives each row its routes; --json is the same bytes at every detail level (single and batch) and keeps every field.
  • doc-text-ascii.test.mjs: the short answer is plain ASCII.
  • component-format.test.mjs: first paragraph only, each prop with its first sentence, usage from a short example or from required props, long examples skipped, hooks print no usage, bare pieces in one batch command.
  • No-context agent check on this head, against the same CLI built from its base: agents with no context did 37 tasks (21 component tasks and 16 tasks whose facts sit in prop descriptions or theming) with the old and the new answer. After a re-run with more runs on every task that differed, no task came out worse; each remaining failure was a code slip or a single-judge call seen in both arms. Component-answer text fell by about 44% at the median and all CLI text by about 21%. On narrow prop-detail tasks agents open --detail full or --props for the fact, as the answer tells them.

Scope

Components: none (CLI component command text output only)

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --project node packages/cli/clients/cli/commands/component packages/cli/clients/cli/lib packages/cli/api/component packages/cli/test/docs-graph.test.mjs packages/cli/assets/docs (1,110 tests; 6 slow files that timed out under box load pass when re-run alone)
  • pnpm check:knowledge (records aligned)
  • node .github/scripts/cli-api-types-verify.mjs (passed)
  • tsc --project tsconfig.strict.json in packages/cli: no new errors (2 existing errors on main from an unbuilt theme package on the test box)

Writing rubric results

Record touched: architecture:cli-surface (INV4 text and its verification row).

R1 narration: none; the added sentences state what a component read prints, in the present tense.
R2 research: none in the record; the agent-check results stay in this description.
R3 evidence: the verification row names the test file, not a change.
R4 rejected alternatives: none in the record.
R5 change references: none.
R6 open questions: none.
R7 project status: none.

A component read prints what the component is, its import, a usage line,
every prop as one line, its accessibility requirements, its pieces with one
command that reads them all, and the commands that print the rest. The same
answer is --detail compact; --detail full prints the whole doc and --json is
unchanged.
@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 17, 2026 4:39pm 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 17, 2026, 4:50 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 9a200e6

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 5.32 MB packed (+1.0 kB); no new dependencies.

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

@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 about the new default, and five fixes are needed whatever that decision is.

No current spec clause sets which detail level astryx component <Name> prints by default, or lets the default read leave out anatomy, best practices, examples and theming: architecture:cli-surface INV4 only allows shortening a prose field to its first sentence. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, or by amending INV4 to name the component-read default and its routes; the author may record it as an engineering owner.

Fixes needed:

  • The synthesized usage line prints … (U+2026) from component-format.mjs lines 599-604, which breaks INV4's plain-ASCII output and fails doc-text-ascii.test.mjs, so use ... and update the two expectations in component-format.test.mjs.
  • Two existing tests in packages/cli/api/component/component.test.mjs now fail: the scoped --props test (line 447) expects the removed pointer line, and the detail-level test (line 601) compares the new default with --detail compact, which now print the same text.
  • packages/cli/README.md line 129 still says single-item views default to full, so update it to say a component read defaults to compact while hook and docs reads default to full.
  • packages/cli/clients/cli/index.mjs carries a 275-line Prettier reflow beside its one real change on line 795, although the description says unrelated cleanup was removed, so revert the reflow or move it to its own pull request.
  • The description says compact and brief already left out theming and examples, but on the base compact printed up to three examples and the derived theme properties and brief printed a usage example and theme variables, so correct that sentence.
Claims and files checked

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

Claims:

  • A component read, and each row of a batch read, prints the short answer by default: verified (default switch in component.mjs; Dialog, Button, Table and a two-name batch run).
  • --detail full prints exactly what the default printed before: verified (byte-identical for Dialog, Button and Table).
  • --json is unchanged: verified (the Dialog envelope is byte-identical).
  • --detail brief, --props, --source, --showcase, --blocks and list views are unchanged: verified (their code paths are untouched).
  • --detail compact prints the new short answer: verified.
  • The --detail help and the component description say so: verified.
  • Usage is a short standalone example, else one element built from the required props: verified, with the non-ASCII placeholder above.
  • Every prop prints on one line with its description's first sentence, and --props prints them whole: verified in code; the unit test's cut assertion can never fail.
  • Accessibility requirements and component icon slots print as before: verified for the component itself; sub-component requirements now print only under --detail full.
  • The pieces get one batch command that reads them all: verified (the Dialog pieces command exits 0).
  • Every part comes from fields each component doc already has: verified.
  • Compact and brief already left out theming and examples: false (fix above).
  • The cited spec clauses cover the new default: not settled (owner decision above).
  • Before and after byte counts: verified within a few bytes, the length of the CLI invocation in each route line.
  • Unrelated cleanup was removed or split: false (fix above).
  • The focused vitest run passes: true for the files named; three other existing tests fail (fixes above).
  • The CLI API types check passes: verified.
  • Strict type checking shows no new errors: verified (the same two errors on the base and the head).
  • Changeset: the short answer by default, the same answer at --detail compact, the whole doc at --detail full, and JSON unchanged: verified.

Files:

  • .changeset/component-short-answer.md: clear
  • packages/cli/clients/cli/commands/component.doc.mjs: clear
  • packages/cli/clients/cli/commands/component.mjs: the new default waits on the owner decision
  • packages/cli/clients/cli/commands/component.short-answer.test.mjs: clear
  • packages/cli/clients/cli/index.mjs: unrelated reflow (fix above)
  • packages/cli/clients/cli/lib/component-format.mjs: non-ASCII placeholders (fix above)
  • packages/cli/clients/cli/lib/component-format.test.mjs: expects the non-ASCII placeholder; one assertion can never fail

Automated review (maintainer link)

Comment thread packages/cli/clients/cli/index.mjs Resolved
Plain ASCII placeholders, a last line that names --detail full, INV4 names
the component-read default and its routes, docs and help describe the new
default, and a test proves the JSON is the same at every detail level.
@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): astryx component <Name> prints a short answer by default: the props, a usage line and the key notes, ending with one line that says how to get the full output (--detail full, the detail flag the CLI already uses). --detail full prints today's complete reference. The JSON output is byte-identical at every detail level, which a test proves. architecture:cli-surface INV4 names the component read's default and its routes, and the docs, skills and help that describe component output say the same.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 1454ddf

@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: one sentence in the architecture:cli-surface INV4 amendment needs narrowing; the rest of the change is ready.

  • docs/architecture/cli-surface.md:157 says "The detail level never changes the JSON", but astryx component --list --json and astryx hook --json return different JSON at brief, compact and full, so scope it to component reads, for example "The detail level never changes a component read's JSON."

The engineering-owner approval settles the new default, and the earlier fixes (ASCII placeholders, the two updated tests, the README, the removed reflow and the corrected description) are in. The fix is a new commit, so an engineering owner posts /approve-spec again for the new head. Non-blocking: the More text. assertion in component-format.test.mjs cannot fail, and the working-with-AI guide and the component() JSDoc still describe the old default.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • The default read prints the short answer (first paragraph, import, usage, one line per prop with its first sentence, accessibility, pieces with one batch command, then the --props and --detail full lines): verified on Dialog, Button and Table and by component.short-answer.test.mjs.
  • --detail compact prints the same answer: verified (component.mjs:267; default and compact output are byte-identical).
  • --detail full prints the whole doc as before: verified, byte-identical to the base default for Dialog, Button and Table.
  • --json is unchanged at every detail level, single and batch: verified against the base and by component.short-answer.test.mjs:54-68.
  • Every part comes from existing doc fields, so an integration's component gets the same answer: verified (component-format.mjs:621-710 reads only doc fields; component.mjs:136-141 builds the routes for any package).
  • --detail brief, --props, --source, --showcase, --blocks and list views are unchanged: verified byte for byte for brief, --props and lists; the other paths are untouched (component.mjs:176-240).
  • Help, the command description, the README, the getting-started and author-a-theme docs, the docs skill and the agent prompt describe the new default: verified in the diff.
  • Byte counts for Dialog, Button and Table: verified within a few bytes of invocation text (3,946 to 1,881; 8,434 to 3,920; 7,935 to 4,472).
  • Before this change compact printed up to three examples and derived theming, and brief a usage line and theme variables: verified in the base formatter.
  • The INV4 amendment says the detail level never changes the JSON: false for list reads (blocking finding above).
  • The ASCII test covers the short answer: verified, its formatCompact row passes.
  • The formatter tests cover the first paragraph, first sentences, usage, long examples, hooks and bare pieces: verified, except that the first-sentence assertion cannot fail (non-blocking).
  • The agent-task results: not reproduced; they are the author's own measurement.
  • Unrelated cleanup was removed: verified, index.mjs changes one help line.
  • The targeted tests, the knowledge check and the type-surface check pass: verified (577 tests pass here).
  • The record touched is the INV4 text and its verification row: verified.

Files:

  • .changeset/component-short-answer.md: clear
  • .claude/skills/writing-component-docs.md: clear
  • AGENTS.md: clear
  • docs/architecture/cli-surface.md: blocking finding (line 157)
  • packages/cli/README.md: clear
  • packages/cli/api/component/component.test.mjs: clear
  • packages/cli/assets/docs/author-a-theme.doc.mjs: clear
  • packages/cli/assets/docs/getting-started.doc.mjs: clear
  • packages/cli/clients/cli/commands/component.doc.mjs: clear
  • packages/cli/clients/cli/commands/component.mjs: clear
  • packages/cli/clients/cli/commands/component.short-answer.test.mjs: clear
  • packages/cli/clients/cli/index.mjs: clear
  • packages/cli/clients/cli/lib/component-format.mjs: clear
  • packages/cli/clients/cli/lib/component-format.test.mjs: non-blocking (line 541)

Automated review (maintainer link)

Comment thread docs/architecture/cli-surface.md Resolved
…ining docs

INV4 says the detail level never changes a component read's JSON. The
working-with-AI guide and the component() JSDoc describe the new default, a
test assertion can now fail, and the component-text and docs-topics goldens
are regenerated.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 5ad6202

@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 new default is owner-approved and checks out, but a few docs still promise theming output from the default component <Name> read.

  • Miss: the theme template that astryx theme template and astryx init --features theme write (packages/cli/assets/theme.template.ts:273-276, :293, :302), packages/cli/assets/docs/author-a-theme.doc.mjs:81 and packages/cli/api/theme/themeTargets.doc.mjs:21 still say astryx component <Name> prints theming targets and public CSS variables, which only component <Name> --detail full prints now, so point them at --detail full as line 79 of the author-a-theme guide already does.

The fix is a new commit, so an engineering owner posts /approve-spec <full head SHA> again for the new head. Optional follow-ups are in the review: the working-with-AI guide still offers --detail compact as a shorter component read, and components with no short example and no required props get a bare <Name /> usage line.

Claims and files checked

Review mode: full; reason: spec-record

  • Claims:
    • A default component read prints the short answer (what it is, import, usage, one line per prop, accessibility, pieces with one batch command, and the commands for the rest): verified (component-format.mjs:621-709, component.short-answer.test.mjs:12-33); family docs whose props sit only under their pieces print no usage line (non-blocking).
    • The same answer is --detail compact: verified (component.mjs:157-164).
    • --detail full prints the whole doc as before: verified (byte-identical to the base default for 14 components).
    • --json is unchanged: verified (byte-identical to the base for 14 components and a batch; component.short-answer.test.mjs:54-68).
    • Every part comes from existing doc fields, so an integration's component gets the same answer: verified (the integration golden component-text.txt).
    • Each batch row gets its own short answer: verified (component.short-answer.test.mjs:45-50).
    • --detail brief, --props, --source, list views and --json are unchanged: verified (byte-identical for Dialog, Button, Table and the list).
    • Help, the command description, the component() JSDoc, README, getting-started, working-with-AI, author-a-theme, the docs skill and the agent prompt describe the new default: false in part (author-a-theme.doc.mjs:81, the blocking finding above).
    • Default reads shrink (Dialog about 3.9 KB to 1.9 KB, Button 8.4 KB to 3.9 KB, Table 7.9 KB to 4.5 KB): verified within 1% (the figure depends on the printed invocation).
    • The CLI surface record names the component-read default, its routes and that the level never changes a component read's JSON: verified (docs/architecture/cli-surface.md:150-157).
    • The new tests cover the default, --detail full, batch rows, JSON identity, ASCII and the formatter cases: verified (they pass on the head; 8 fail on the base).
    • The agent study results: unverified (the author's own study, not reproduced; nothing in this review rests on it).
    • Testing: the targeted test suites, the knowledge check and the published type check pass: verified (156 tests in 6 files, pnpm check:knowledge and the type-surface check pass on the head; CI's typecheck passes at this head).
  • Files:
    • .changeset/component-short-answer.md: clear (usage-line note).
    • .claude/skills/writing-component-docs.md: clear.
    • AGENTS.md: clear (line 249 still offers --detail compact as less output; non-blocking).
    • docs/architecture/cli-surface.md: clear (owner-approved at this head).
    • packages/cli/README.md: clear.
    • packages/cli/api/component/component.mjs: clear.
    • packages/cli/api/component/component.test.mjs: clear.
    • packages/cli/assets/docs/author-a-theme.doc.mjs: finding (line 81).
    • packages/cli/assets/docs/getting-started.doc.mjs: clear.
    • packages/cli/assets/docs/working-with-ai.doc.mjs: clear for its change (lines 168 and 175 non-blocking).
    • packages/cli/clients/cli/commands/component.doc.mjs: clear.
    • packages/cli/clients/cli/commands/component.mjs: clear.
    • packages/cli/clients/cli/commands/component.short-answer.test.mjs: clear.
    • packages/cli/clients/cli/index.mjs: clear.
    • packages/cli/clients/cli/lib/component-format.mjs: clear (usage fallback note).
    • packages/cli/clients/cli/lib/component-format.test.mjs: clear.
    • packages/cli/test/__golden__/component-text.txt: clear.
    • packages/cli/test/__golden__/no-icon-set/docs-topics.json: clear.
    • Unchanged but affected: packages/cli/assets/theme.template.ts and packages/cli/api/theme/themeTargets.doc.mjs: finding (above).

Automated review (maintainer link)

The theme template, the author-a-theme guide and the theme targets docs name
component <Name> --detail full for theming targets and CSS variables, the
working-with-AI guide offers --detail brief for a shorter component read, and
a component with no example and no required prop prints no usage line.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 9a200e6

@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: CI has not run on this head yet. The new default is owner-approved for this head, and the stale theming references from the last review now point at --detail full.

Next: CI's admission job found no room ("CI is full"), so re-run the CI jobs; the required checks still have to pass before merge.

Optional follow-ups, none blocking:

  • The changeset and the INV4 text say the short answer prints "a usage line", but 50 of 174 Core component reads (Card, Table and Layout among them) print none, so "a usage line where the doc has a short demo example or required props" would match the code and the description.
  • The working-with-AI guide says --detail brief "cuts it to a one-line signature", while brief prints a signature and four or five more lines.
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claims:
    • A default component read prints the short answer: description's first paragraph, import, usage, one line per prop, accessibility requirements, pieces with one batch command, and the --props and --detail full commands: verified (component-format.mjs:625-714, component.short-answer.test.mjs:12-33); a usage block prints only where the doc has a short demo example or required props (non-blocking note above).
    • The usage block is the first short example that runs on its own, else one element from the required props, else none; setup examples keep their label: verified (component-format.mjs:579-608, :647-658; formatter tests).
    • Every prop prints name, type, default, required, experimental and its first sentence, and --props prints them whole: verified (Dialog default and --props reads).
    • Accessibility requirements and icon slots print as before: verified (component-format.mjs:660, :696-699).
    • The same answer is --detail compact: verified (component.mjs:157-164).
    • --detail full prints the whole doc as before: verified (byte-identical to the base default for 9 components).
    • --json is unchanged at every detail level, single and batch: verified (byte-identical to the base for 9 components; component.short-answer.test.mjs:54-68).
    • Each batch row gets its own short answer and routes: verified (component.short-answer.test.mjs:45-50; batch probe).
    • Every part comes from existing doc fields, so an integration's component gets the same answer: verified (integration golden component-text.txt).
    • --detail brief, --props, --source, --showcase, --blocks, list views and --json are unchanged: verified (byte-identical for Dialog, Button and Card, the list and hook --json).
    • Before this change --detail compact printed up to three examples and the derived theme properties, and --detail brief a usage line and theme variables: verified (the removed formatCompact lines; formatBrief unchanged).
    • The CLI surface record names the component-read default, its routes and that the level never changes a component read's JSON: verified (docs/architecture/cli-surface.md:150-157).
    • Help, the command description, the component() JSDoc, README, getting-started, working-with-AI, author-a-theme, the theme targets docs, the theme template comments, the docs skill and the agent prompt describe the new default: verified (the brief sentence is a non-blocking note).
    • Default reads shrink (Dialog about 3.9 KB to 1.9 KB, Button 8.4 KB to 3.9 KB, Table 7.9 KB to 4.5 KB): verified within 1% (the figure depends on the printed invocation).
    • The new tests cover the default, --detail full, batch rows, JSON identity, ASCII and the formatter cases: verified (157 tests in 6 files pass on this head).
    • The knowledge check and the published type check pass: verified (both pass on this head).
    • The agent study results: unverified (the author's own study, not reproduced; nothing here rests on it).
  • Files:
    • .changeset/component-short-answer.md: clear (usage-line note).
    • .claude/skills/writing-component-docs.md: clear.
    • AGENTS.md: clear (line 249 still offers --detail compact as less output; non-blocking).
    • docs/architecture/cli-surface.md: clear (owner-approved at this head; usage-line note).
    • packages/cli/README.md: clear.
    • packages/cli/api/component/component.mjs: clear.
    • packages/cli/api/component/component.test.mjs: clear.
    • packages/cli/api/theme/themeTargets.doc.mjs: clear.
    • packages/cli/assets/docs/author-a-theme.doc.mjs: clear.
    • packages/cli/assets/docs/getting-started.doc.mjs: clear.
    • packages/cli/assets/docs/working-with-ai.doc.mjs: clear (brief sentence note).
    • packages/cli/assets/theme.template.ts: clear.
    • packages/cli/clients/cli/commands/component.doc.mjs: clear.
    • packages/cli/clients/cli/commands/component.mjs: clear.
    • packages/cli/clients/cli/commands/component.short-answer.test.mjs: clear.
    • packages/cli/clients/cli/commands/theme-targets.doc.mjs: clear.
    • packages/cli/clients/cli/index.mjs: clear.
    • packages/cli/clients/cli/lib/component-format.mjs: clear (usage fallback note).
    • packages/cli/clients/cli/lib/component-format.test.mjs: clear.
    • packages/cli/test/__golden__/component-text.txt: clear.
    • packages/cli/test/__golden__/no-icon-set/docs-topics.json: clear.

Automated review (maintainer link)

'@astryxdesign/cli': patch
---

[feat] `astryx component <Name>` prints a short answer by default: what the component is, its import, a usage line, every prop as one line (name, type, default, required, and its description's first sentence), its accessibility requirements, its pieces with one command that reads them all, and the commands that print the rest (`--props` for each prop's whole description, `--detail full` for anatomy, best practices, examples and theming). The same answer is `--detail compact`; `--detail full` prints the whole doc as before, and `--json` is unchanged. Every part comes from fields each component doc already has, so an integration's component gets the same answer.

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.

Non-blocking: "a usage line" is broader than the code. With no demo example of 20 lines or fewer and no required prop, shortUsage returns null, so 50 of 174 Core component reads (Card, Table and Layout among them) print no usage block. "a usage line where the doc has a short demo example or required props" matches the code and the description; INV4's list says the same at its next amendment.

{
type: 'prose',
text: 'For a shorter read, add `--detail brief` (one line per section) or `--detail compact`. `--dense` swaps in a shorter text where a doc ships one. Use them when pasting CLI output into a web-based AI tool like ChatGPT or Claude.',
text: 'For a shorter read, add `--detail brief` (one line per section). A component read is short by default; `--detail brief` cuts it to a one-line signature. `--dense` swaps in a shorter text where a doc ships one. Use them when pasting CLI output into a web-based AI tool like ChatGPT or Claude.',

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.

Non-blocking: component Dialog --detail brief prints the signature and four more lines (description, Derived, Targets, the other props), so "a one-line signature" overstates the cut. "a short signature summary" fits.

@josephfarina josephfarina reopened this Nov 18, 2026
@josephfarina
josephfarina merged commit f63cf9f into main Nov 18, 2026
109 of 140 checks passed
@github-actions
github-actions Bot deleted the josephfarina/component-short-answer branch November 19, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 9a200e67 Deployed Nov 17, 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