Skip to content

refactor(cli): one renderer for the SKILL.md files Astryx manages - #12956

Closed
josephfarina wants to merge 1 commit into
skills-fu3from
skills-fu4
Closed

josephfarina wants to merge 1 commit into
skills-fu3from
skills-fu4

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

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}) in foundation/agent-docs/managed-skill-file.mjs writes the layout once. renderComputerAgentText, renderProjectSkill and renderIntegrationSkill call 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)

  • Refactor only; every written file is unchanged.
  • Public text and artifacts contain no internal Meta context.

Testing

  • node scripts/generate-agent-plugin-skill.mjs --check (the plugin copy hashes the computer skill's rendering; unchanged).
  • New test in 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/drift with CI=1; strict typecheck after pnpm sync:api-types.

@vercel

vercel Bot commented Nov 19, 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 19, 2026 7:23pm UTC

Request Review

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

astracat-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 19, 2026, 7:28 PM UTC

@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 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: withHash is still exported from managed-skill-file.mjs, but renderSkillFile is now its only caller; dropping the export keeps the layout behind one function.
  • Optional: the header of managed-skill-file.mjs still 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:289 and skill-places.mjs:319 call renderSkillFile (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 --check exits 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).

Automated review (maintainer link)

'A managed skill file needs the Astryx markers around its text.',
);
}
return withHash(

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.

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.

@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. 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: withHash is still exported from managed-skill-file.mjs, though renderSkillFile is 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:286 and skill-places.mjs:316 call renderSkillFile (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 chore patch 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 --check exits 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).

Automated review (maintainer link)

…mputer, project and integration skills)

[skip ci]

@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. 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: withHash is still exported from managed-skill-file.mjs, though renderSkillFile is 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:286 and skill-places.mjs:316 call renderSkillFile (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 chore patch 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 --check exits 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).

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 19, 2026
- #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
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12993.

@github-actions
github-actions Bot deleted the skills-fu4 branch November 20, 2026 06:06

This branch was successfully deployed

1 active deployment
Preview — e8b36bbe Deployed Nov 19, 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