Skip to content

feat(cli): where icon features are on, the agent block sends agents to the icon finder - #12210

Merged
josephfarina merged 3 commits into
mainfrom
josephfarina/icon-finder-agent-line
Nov 18, 2026
Merged

josephfarina merged 3 commits into
mainfrom
josephfarina/icon-finder-agent-line

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

User need

An agent building a page that needs icons almost never asks Astryx for one. It copies an icon from the template it scaffolded, from the starter app's own code, or installs a library the template imports. In a project that installed an icon-set package, that means the pack the project chose goes unused, and in every project the icons drift away from the ones Astryx would pick for the meaning.

We tested where a pointer to the icon finder has to live for agents to act on it. Agents doing everyday tasks that need icons (a sidebar, a text toolbar, an empty state) without ever being told "icon" were given the same one-line pointer in three places: the agent instructions that astryx init writes, the end of astryx component Icon / IconButton output, and the template-copy output. Only the line in the agent instructions changed what they did: with it, every run asked the finder before writing an icon, and in a project with a pack the icons came from the pack. Lines at the end of command output were rarely seen, because agents trim long output and often print templates instead of copying them.

Problem and solution fit

  • Where icon features are on (iconFeatureGate(project).on: an installed icon-set package, or experimental.iconSet), renderAgentDocsBlock passes iconFeatures: true and generateCompressedIndex adds one line right under the runner line:

    Need an icon? Run \astryx experimental icon ` and paste the import it prints, instead of copying one from a template or other code.`

  • The line writes the bare command, like every other command in the block; the runner line directly above it names the project's runner.

  • Where icon features are off, the block is byte-for-byte the block it was.

  • The computer-level agent text (computer-agent-text.mjs) never gets the line: it keeps experimental commands out (spec:AST-081 FR8). A test proves it.

Current specification

  • spec:AST-084 (icon sets) FR0 gains one sentence: where icon features are on, the agent docs block carries this line under its runner line; where they are off, it has none. agent-docs.test.mjs joins its verified_by.
  • spec:AST-017 FR27: installing an icon-set package is an opt-in, so an omitted opt-in still leaves the stable block unchanged.

Public delta and caller burden

Project Agent block before Agent block after
No icon-set package, no experimental.iconSet unchanged unchanged (same bytes)
An icon-set package installed, or experimental.iconSet set no icon line one line under CLI: run every command as …

astryx init writes the line, and astryx upgrade reports a block without it and rewrites it with --apply; doctor checks only that the Astryx block is there. No JSON shape changes. Caller burden: none.

Design and alternatives

  • The agent instructions, gated. The line is shown only where an icon finder answer can lead to a pack icon, so stable projects see no change while icon sets stay experimental.
  • Rejected: the end of component Icon / IconButton output, and the template-copy note. Agents trim command output (| head, | grep) and print templates rather than copy them, so a line at the end of output rarely reaches them.
  • Rejected: a runner in the line. The block names the runner once; every command below it is bare.

Evidence

  • agent-docs.test.mjs, "the icon finder line in the agent block":
    • no icon-set package: the block has no icon line, and the line after the runner line is blank;
    • an installed icon-set package: the line follows the runner line, which names the project's package manager, and appears once;
    • experimental.iconSet in the config turns it on too;
    • experimental.iconSet with no package installed: the line shows exactly when iconFeatureGate says icon features are on for that project, so it cannot drift from the gate;
    • the computer-level skill never gets it.
  • The rendered block in a no-pack project is byte-identical with and without this change (same sha256); with a pack it differs only by the one line.

Scope

Components: CLI agent docs (packages/cli/foundation/agent-docs/agent-docs.mjs)

  • 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: all pass except one Yarn Plug'n'Play row (G59) that fails the same way on the base without this change on the test machine (no Yarn runtime there).
  • pnpm check:repo, pnpm check:knowledge, pnpm -F @astryxdesign/cli typecheck:strict, ESLint and Prettier on the changed files.

Writing rubric results

  • R1 narration: none. The FR0 sentence states the behavior in the present tense.
  • R2 research: none. The test that motivated the line stays in this description.
  • R3 evidence: none. No pull request or result is named in the record.
  • R4 rejected alternatives: none in the record; they live in this description.
  • R5 references: none.
  • R6 open questions: none.

@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:03am UTC

Request Review

@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 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:06 AM UTC

@josephfarina josephfarina left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wording review (agent docs): OK.

  • The line is exactly the measured text. It sits right under the runner line and writes the bare astryx command, which the runner line above it covers.
  • The computer-level skill stays free of experimental commands, and a test proves it.
  • The changeset and the spec sentence describe the same rule in the present tense.

Optional, not blocking: the experimental.iconSet test also installs an icon-set package, so it does not isolate the config path. If the config alone is meant to turn the line on, as the changeset says, a case with no package installed would show it.

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@josephfarina
josephfarina force-pushed the josephfarina/icon-feature-gate branch from f19ca5d to cf943e0 Compare November 17, 2026 01:52
@josephfarina
josephfarina force-pushed the josephfarina/icon-finder-agent-line branch from 696ea51 to ed82bab Compare November 17, 2026 01:53
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec ed82bab

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval 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.

Requesting changes for one false sentence in the pull request description; the code, the new AST-084 sentence, the changeset and the tests check out, and the spec sentence carries an engineering owner's approval for this head.

  • The description says doctor's agent-docs freshness check expects the new line because it compares against the same rendered block, but checkAgentDocs in packages/cli/api/doctor/doctor.mjs only checks that the Astryx block is present; only astryx upgrade compares the block, so please reword that sentence (for example: "astryx init writes the line, and astryx upgrade reports a block without it and rewrites it with --apply; doctor checks only that the block is there").

Two optional suggestions are inline: move the new iconFeatures JSDoc paragraph off the version parameter, and have the config-only test assert that the line is present.

Claims and files checked

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

  • Changeset: with an icon-set package installed or experimental.iconSet set, the block that init and upgrade write gains the line under the runner line: verified (agent-docs.mjs:651, :827; tests; a config-only render).
  • Changeset: with icon features off, the block does not change: verified (agent-docs.mjs:651; agent-docs.test.mjs:400-409).
  • renderAgentDocsBlock passes the gate's answer and generateCompressedIndex adds the line right under the runner line: verified.
  • The line writes the bare command and the runner line above it names the project's runner: verified (agent-docs.test.mjs:416-417).
  • Off, the block is byte-for-byte the same: verified (the only off-path change is the conditional push).
  • The computer-level agent text never gets the line, and a test proves it: verified (agent-docs.test.mjs:421-425).
  • AST-084 FR0 gains one sentence and the agent-docs test joins its verified files: verified (spec.md:23, :129-133).
  • Installing an icon-set package counts as an opt-in under AST-017 FR27: verified on the base branch, where the stacked pull request adds that sentence.
  • init and upgrade write the line: verified (api/init/run/run.mjs:126, api/upgrade/_adapter.mjs:558).
  • doctor's agent-docs check compares against the same rendered block: false (api/doctor/doctor.mjs:843-950 checks markers only).
  • No JSON shape changes and no caller burden: verified.
  • The five listed tests exist and cover what they say: verified; the config-only test compares with the gate rather than asserting the line.
  • Without a pack the block is identical; with a pack it differs by the one line only: verified (rendered blocks compared).
  • Test runs: the agent-docs, icon-set, init, upgrade, doctor and experimental-isolation suites (34 files) and the knowledge check pass at this head; the full CLI suite, the repository check, the strict typecheck, ESLint and Prettier were not re-run.
  • File .changeset/icon-finder-agent-line.md: clear.
  • File docs/specs/AST-084-icon-sets/spec.md: clear.
  • File packages/cli/foundation/agent-docs/agent-docs.mjs: non-blocking JSDoc placement note.
  • File packages/cli/foundation/agent-docs/agent-docs.test.mjs: non-blocking assertion note.

Automated review (maintainer link)

@josephfarina
josephfarina force-pushed the josephfarina/icon-feature-gate branch from e34f57b to 9f75bc0 Compare November 17, 2026 06:40
@josephfarina
josephfarina force-pushed the josephfarina/icon-finder-agent-line branch from ed82bab to 3ca1021 Compare November 17, 2026 08:51
@josephfarina
josephfarina changed the base branch from josephfarina/icon-feature-gate to main November 17, 2026 08:51
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 3ca1021

@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 gated agent-block line, the new AST-084 FR0 sentence (approved by an engineering owner for this head), the changeset and the tests check out, and the earlier description fix and both optional suggestions are in.

  • Miss: (optional) where experimental.iconSet names a set that no installed package ships, the block still says to paste the import the finder prints, but astryx experimental icon there prints only an install step; the approved FR0 sentence covers this case, so nothing needs to change unless you want the finder's no-set answer to say what to do instead.
Claims and files checked

Review mode: full; reason: rebase

  • Changeset: with an icon-set package installed or experimental.iconSet set, the block that init and upgrade write gains the line under the runner line: verified (agent-docs.mjs:667, :843; tests; rendered blocks).
  • Changeset: with icon features off, the block does not change: verified (a no-pack block is byte-identical at the base and the head).
  • renderAgentDocsBlock passes the gate's answer and generateCompressedIndex adds the line right under the runner line: verified (agent-docs.mjs:664-668, :843).
  • The line writes the bare command and the runner line above it names the project's runner: verified (agent-docs.test.mjs:412-419).
  • Off, the block is byte-for-byte the same: verified (same sha256 at base and head).
  • The computer-level agent text never gets the line, and a test proves it: verified (agent-docs.test.mjs:421-425).
  • AST-084 FR0 gains one sentence and the agent-docs test joins its verified files: verified (spec.md:23, :129-133).
  • Installing an icon-set package is an opt-in under AST-017 FR27: verified on main.
  • The before/after table (unchanged without an opt-in; one line under the runner line with one): verified.
  • init writes the line, upgrade reports a block without it and rewrites it with --apply, and doctor checks only that the block is there: verified (api/init/run/run.mjs:172, api/upgrade/_adapter.mjs:558, api/doctor/doctor.mjs:843-950).
  • No JSON shape changes and no caller burden: verified.
  • The line shows only where a finder answer can lead to a pack icon: verified for installed sets; a configured set that is not installed gets an install step instead of an import (the optional note above).
  • The block names the runner once and every command below it is bare: verified.
  • The five listed tests exist and cover what they say: verified; the config-only test now asserts the gate is on.
  • Without a pack the rendered block is identical; with a pack it differs by the one line only: verified (rendered blocks compared).
  • One capability, no unrelated changes, and no internal context: verified (four files; nothing internal in the added lines, title, body or commits).
  • Test runs: the agent-docs, icon-gate, experimental-isolation, init, doctor and upgrade suites (12 files), the knowledge and changeset checks, and ESLint pass at this head; Prettier passes on every added line; the strict typecheck reports only two template pages that need a theme build; the full CLI suite and the repository check were not re-run.
  • The author's agent experiment and the reasons for rejecting the other placements: not checkable from the code.
  • Writing rubric: the FR0 sentence is present tense, with no narration, research, references or open questions: verified.
  • File .changeset/icon-finder-agent-line.md: clear.
  • File docs/specs/AST-084-icon-sets/spec.md: clear.
  • File packages/cli/foundation/agent-docs/agent-docs.mjs: clear.
  • File packages/cli/foundation/agent-docs/agent-docs.test.mjs: clear.

Automated review (maintainer link)

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 2ea912c

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 5.43 MB packed (+466 B); 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

…o the icon finder

Where an icon-set package is installed or experimental.iconSet is set, the
agent block that init and upgrade write carries one line under its runner
line: "Need an icon? Run `astryx experimental icon <what it means>` and
paste the import it prints, instead of copying one from a template or other
code." Where icon features are off, the block does not change. The
computer-level agent text never carries it.
@josephfarina
josephfarina force-pushed the josephfarina/icon-finder-agent-line branch from 3ca1021 to 2ea912c Compare November 18, 2026 08:49
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 18, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 2ea912c

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label 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 pending CI: CI has not finished on this head yet. The gated agent-block line, the new icon-set FR0 sentence (approved by an engineering owner for this head), the release note and the tests check out after the rebase, and both earlier optional suggestions are in.

  • Optional: where experimental.iconSet names a set that no installed package ships, the block still says to paste the import the finder prints, but astryx experimental icon there prints only an install step; the approved FR0 sentence covers this case, so nothing needs to change unless you want the finder's no-set answer to say what to do instead.
Claims and files checked

Review mode: full; reason: rebase

  • Release note: with an icon-set package installed or experimental.iconSet set, the block that init and upgrade write gains the line under the runner line: verified (agent-docs.mjs:676, :856; tests; rendered blocks).
  • Release note: with icon features off, the block does not change: verified (a no-pack block is byte-identical at the base and the head).
  • renderAgentDocsBlock passes the gate's answer and generateCompressedIndex adds the line right under the runner line: verified (agent-docs.mjs:673-676, :856).
  • The line text is the same in the code, the spec sentence, the release note and the description: verified (byte-for-byte).
  • The line writes the bare command and the runner line above it names the project's runner: verified (agent-docs.test.mjs:428-435).
  • Off, the block is byte-for-byte the same: verified (same sha256 at base and head).
  • The computer-level agent text never gets the line, and a test proves it: verified (agent-docs.test.mjs:437-441).
  • The icon-set spec's FR0 gains one sentence and the agent-docs test joins its verified files: verified (spec.md:24, :131-135).
  • Installing an icon-set package is an opt-in under the release spec's FR27: verified.
  • The before/after table (unchanged without an opt-in; one line under the runner line with one): verified.
  • init writes the line, upgrade reports a block without it and rewrites it with --apply, and doctor checks only that the block is there: verified (api/init/run/run.mjs:171, :186; api/upgrade/_adapter.mjs:558-571, :611; api/doctor/doctor.mjs:1122-1229).
  • No JSON shape changes and no caller burden: verified.
  • The line shows only where a finder answer can lead to a pack icon: verified for installed sets; a configured set with no package gets an install step instead of an import (the optional note above).
  • The block names the runner once and every command below it is bare: verified.
  • The five listed tests exist and cover what they say: verified (agent-docs.test.mjs:412-457), and they pass.
  • Without a pack the rendered block is identical; with a pack it differs by the one line only: verified (rendered blocks compared).
  • One capability, no unrelated changes, and no internal context: verified (four files; nothing internal in the added lines, title, body, branch or commits).
  • Test runs: the agent-docs, icon-gate, experimental-isolation, init, upgrade, search-icons and MCP suites (17 files, 552 tests), the knowledge and changeset checks, and ESLint pass at this head; Prettier finds nothing in the added lines (the same whole-file differences exist on the base); the strict typecheck reports only two template pages that need a theme build; the full CLI suite and the repository check were not re-run.
  • The author's agent experiment and the reasons for rejecting the other placements: not checkable from the code.
  • Writing rubric: the FR0 sentence is present tense, with no narration, research, references or open questions: verified.
  • File .changeset/icon-finder-agent-line.md: clear.
  • File docs/specs/AST-084-icon-sets/spec.md: clear.
  • File packages/cli/foundation/agent-docs/agent-docs.mjs: clear.
  • File packages/cli/foundation/agent-docs/agent-docs.test.mjs: clear.

Automated review (maintainer link)

@josephfarina
josephfarina merged commit 4f0a13a into main Nov 18, 2026
80 checks passed
@github-actions
github-actions Bot deleted the josephfarina/icon-finder-agent-line branch November 19, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 2ea912cc 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