Repository navigation
refactor(cli): one renderer for the SKILL.md files Astryx manages - #12956
josephfarina wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The CI workflow runs only for pull requests into main or a release branch that are not drafts, so it has not started for this one.
No blocking findings. The three SKILL.md renderers now share renderSkillFile, and the files they write are byte-for-byte the same as before for every input a caller passes.
- Optional:
withHashis still exported frommanaged-skill-file.mjs, butrenderSkillFileis now its only caller; dropping the export keeps the layout behind one function. - Optional: the header of
managed-skill-file.mjsstill describes only file state and the write and remove actions, though the module now also renders the SKILL.md text.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim (changeset): the computer-level, project and integration skills render SKILL.md through one function. Verified:
computer-agent-text.mjs:323,skill-places.mjs:289andskill-places.mjs:319callrenderSkillFile(managed-skill-file.mjs:58). - Claim (changeset and description): the written files are byte-for-byte unchanged. Verified: base and head render identical text for every input a caller can pass, and the plugin copy check passes.
- Claim (description): the same layout was written in three places. Verified in the three blocks this change removes.
- Claim (description): refactor only. Verified: the one new behaviour, a guard that throws on a block without both markers, cannot be reached by any caller.
- Claim (description): the governing record's owner agreed. Consistent: the record for the computer-level text names the author as its owner.
- Claim (description): public text has no internal context. Verified: none in the added lines, title, body, branch name or commit message.
- Claim (description): the plugin skill check is unchanged. Verified:
node scripts/generate-agent-plugin-skill.mjs --checkexits 0. - Claim (description): a new test checks the frontmatter and a hash line over the rest. Verified:
computer-agent-text.test.mjs:96-118, passing. - Claim (description): the listed Vitest run passes. Verified: 53 test files pass.
- Claim (description): strict typecheck after syncing API types. Verified: exits 0 once the neutral theme is built.
- File
.changeset/one-skill-file-renderer.md: clear. - File
packages/cli/foundation/agent-docs/computer-agent-text.mjs: clear. - File
packages/cli/foundation/agent-docs/computer-agent-text.test.mjs: clear. - File
packages/cli/foundation/agent-docs/managed-skill-file.mjs: the two optional notes above. - File
packages/cli/foundation/agent-docs/skill-places.mjs: clear (renderer swap plus formatter reflow, no behaviour change).
| 'A managed skill file needs the Astryx markers around its text.', | ||
| ); | ||
| } | ||
| return withHash( |
There was a problem hiding this comment.
Optional: withHash (line 43) is still exported, but this is now its only caller in the repository. Dropping the export keeps the SKILL.md layout behind renderSkillFile, so a new renderer cannot hand-build it again.
4a3b8ef to
49e6c71
Compare
f686b33 to
27b94a6
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. This pull request is a draft into a branch other than main, and CI runs only for pull requests into main or a release branch that are ready for review. It will run once this change targets main and is marked ready.
There are no blocking findings. The three SKILL.md renderers now share renderSkillFile, and for every input a caller passes they write the same files as before, byte for byte.
- Optional:
withHashis still exported frommanaged-skill-file.mjs, thoughrenderSkillFileis now its only caller. Dropping the export keeps the layout behind one function.
Claims and files checked
Review mode: full; reason: rebase
- Claim (changeset and description): the computer-level, project and integration skills render SKILL.md through one function. Verified:
computer-agent-text.mjs:323,skill-places.mjs:286andskill-places.mjs:316callrenderSkillFile(managed-skill-file.mjs:58). - Claim (changeset): the frontmatter and hash line stay the same shape. Verified: one function builds both for all three skill kinds.
- Claim (changeset and description): the written files are byte-for-byte unchanged. Verified: base and head render identical text for 19 caller inputs across the three renderers, and the plugin copy check passes.
- Claim (changeset): a
chorepatch for the CLI that credits the author. Verified: the changeset check passes. - Claim (description): the same layout was written in three places. Verified in the three blocks this change removes.
- Claim (description): the output change was agreed with the owner of the computer-level text. Consistent: the governing record names the author as its owner.
- Claim (description): the change is stacked on the placed-guide test change. Consistent: that test change is the tip of the base branch.
- Claim (description): this is a refactor only. Verified: the one new behaviour, a guard that throws on a block without both markers, cannot be reached by any caller.
- Claim (description): public text has no internal context. Verified: none in the added lines, title, body, branch name or commit message.
- Claim (description): the plugin skill check is unchanged. Verified:
node scripts/generate-agent-plugin-skill.mjs --checkexits 0. - Claim (description): a new test checks the frontmatter and a hash line over the rest. Verified:
computer-agent-text.test.mjs:96-118, passing. - Claim (description): the listed Vitest run passes. Verified: 54 test files pass.
- Claim (description): the strict typecheck passes after syncing API types. Verified: it exits 0 once the neutral theme package is built.
- File
.changeset/one-skill-file-renderer.md: clear. - File
packages/cli/foundation/agent-docs/computer-agent-text.mjs: clear. - File
packages/cli/foundation/agent-docs/computer-agent-text.test.mjs: clear. - File
packages/cli/foundation/agent-docs/managed-skill-file.mjs: the optional note above. - File
packages/cli/foundation/agent-docs/skill-places.mjs: clear (renderer swap plus formatter reflow, no behaviour change).
…mputer, project and integration skills) [skip ci]
49e6c71 to
640eb12
Compare
27b94a6 to
e8b36bb
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. This pull request is a draft into a branch other than main, and CI runs only for pull requests into main or a release branch that are ready for review, so the required checks run once this change targets main and is marked ready.
There are no blocking findings. The three SKILL.md renderers now share renderSkillFile, and for every input a caller passes they write the same files as before, byte for byte.
- Optional:
withHashis still exported frommanaged-skill-file.mjs, thoughrenderSkillFileis now its only caller; dropping the export keeps the layout behind one function.
Claims and files checked
Review mode: full; reason: rebase
- Claim (changeset and description): the computer-level, project and integration skills render SKILL.md through one function. Verified:
computer-agent-text.mjs:323,skill-places.mjs:286andskill-places.mjs:316callrenderSkillFile(managed-skill-file.mjs:58). - Claim (changeset): the frontmatter and hash line stay the same shape. Verified: one function builds both for all three skill kinds (
managed-skill-file.mjs:67-79). - Claim (changeset and description): the written files are byte-for-byte unchanged. Verified: base and head render identical text for 20 caller inputs across the three renderers, and the plugin copy check passes.
- Claim (changeset): a
chorepatch for the CLI that credits the author. Verified: the changeset check passes. - Claim (description): the change is stacked on the placed-guide test change and lands with it. Consistent: that test change is the tip of the base branch.
- Claim (description): the same layout was written in three places. Verified in the three blocks this change removes.
- Claim (description): the output change was agreed with the owner of the computer-level text. Consistent: the governing record names the author as its owner.
- Claim (description): the scope is the CLI's agent docs. Verified: every code change is in the CLI's agent-docs folder.
- Claim (description): this is a refactor only and every written file is unchanged. Verified: the one new behaviour, a guard that throws on a block without both markers, cannot be reached by any caller.
- Claim (description): public text has no internal context. Verified: none in the added lines, title, body, branch name or commit message.
- Claim (description): the plugin skill check is unchanged. Verified:
node scripts/generate-agent-plugin-skill.mjs --checkexits 0. - Claim (description): a new test checks the frontmatter and a hash line over the rest. Verified:
computer-agent-text.test.mjs:96-118, passing. - Claim (description): the listed Vitest run passes. Verified: 53 test files pass.
- Claim (description): the strict typecheck passes after syncing API types. Verified: it exits 0 once the neutral theme package is built.
- File
.changeset/one-skill-file-renderer.md: clear. - File
packages/cli/foundation/agent-docs/computer-agent-text.mjs: clear. - File
packages/cli/foundation/agent-docs/computer-agent-text.test.mjs: clear. - File
packages/cli/foundation/agent-docs/managed-skill-file.mjs: the optional note above. - File
packages/cli/foundation/agent-docs/skill-places.mjs: clear (renderer swap plus formatter reflow, no behaviour change).
- #12953 fix(cli): a skill whose integration has a doc that did not load is unread, not left out Author: @josephfarina - #12954 docs(cli): astryx docs --help names docs skills Author: @josephfarina - #12955 test(cli): a skill on a placed guide reads that guide and init writes it Author: @josephfarina - #12956 refactor(cli): one renderer for the SKILL.md files Astryx manages Author: @josephfarina - #13001 test(cli): the swizzle proof renders Lab's MediaPlayer with its required label Author: @josephfarina
|
Landed in #12993. |
Stacked on the placed-guide test layer; it lands with the stack.
Why
The computer-level skill, the project skill and each integration skill wrote the same SKILL.md layout (frontmatter, Astryx markers, hash line) in three places, so a fix to one could miss the others.
Change
renderSkillFile({name, description, block})infoundation/agent-docs/managed-skill-file.mjswrites the layout once.renderComputerAgentText,renderProjectSkillandrenderIntegrationSkillcall it. The output is byte-for-byte unchanged (agreed with the owner of the computer-level text, which moves in the same change).Scope
Components: cli (agent docs)
Testing
node scripts/generate-agent-plugin-skill.mjs --check(the plugin copy hashes the computer skill's rendering; unchanged).computer-agent-text.test.mjs: the frontmatter, then a hash line equal to the sha256 of the rest.vitest run --project node packages/cli/foundation/agent-docs packages/cli/api/docs packages/cli/api/init packages/cli/api/upgrade packages/cli/api/doctor packages/cli/test/driftwithCI=1; strict typecheck afterpnpm sync:api-types.