Skip to content

Bundle plain-writing and comment-cleanup into address-pr-reviews - #216

Merged
haacked merged 2 commits into
mainfrom
haacked/more-cloud-skills
Sep 22, 2026
Merged

haacked merged 2 commits into
mainfrom
haacked/more-cloud-skills

Conversation

@haacked

@haacked haacked commented Sep 22, 2026

Copy link
Copy Markdown
Owner

A cloud agent run unpacks one skill folder into a sandbox with no clone of this repo, so the plain-writing pass in Step 3 and the comment-cleanup pass in Step 5 had no skill to invoke and were skipped. PostHog Desktop can upload a referenced skill as a dependency, but it refuses when that skill is a symlink the user did not select, and ai/install-claude.sh symlinks every skill into ~/.claude/skills. Naming those two skills without a leading slash is what kept the upload working, and it is also what kept them out of the bundle.

address-pr-reviews now carries a copy of both skills under references/ and reads the copy rather than invoking the skill, so each pass runs by the same rules on every harness. Each copy keeps its source skill's folder shape, so the relative paths written inside it resolve, including the plain-writing copy's own scripts/plain-writing-lint.py.

Portable-skill table destinations are relative to a skill's own directory instead of its scripts/ directory, which puts a vendored skill under the same sync and staleness check as a vendored helper. PORTABLE_SKILL_OWN_FILES declares SKILL.md, and the undeclared-file walk covers the whole skill folder.

A fourth sync pass reports a file added to a vendored skill that no table row copies. Every other check starts from the table, so without it the bundle falls behind its source with CI green. That pass finds each source folder by mirroring the destination, so it checks the mirror first: a row writing references/<name>/<rel> has to read from ai/skills/<name>/<rel>.

comment-cleanup named the Style section of AGENTS.md as its standard in its preamble, which Step 5 reaches on every run and which a sandbox does not have. It now names the rules in its own steps as the standard and reads that section as well when the run has one.

One thing a copy still names outside the bundle: the comment-cleanup copy carries a $HOME/.dotfiles/ path that only --branch reaches, and this caller always passes explicit file paths.

Test plan

All 18 tests in the ai/README.md list pass. Each new assertion is mutation-tested: scoping the walk back to scripts/ fails 3, removing the source-walk exclusions fails 5, deleting the fourth pass fails 2, and removing the mirror check fails 2.

ai/bin/sync-portable-skills.sh --check
ai/tests/test-portable-sync.sh
ai/skills/address-pr-reviews/scripts/tests/test-portable-skill.sh

For the sandbox itself, copy ai/skills/address-pr-reviews alone to a temp directory and run python3 references/plain-writing/scripts/plain-writing-lint.py under env -i. That is what the upload gets.

https://claude.ai/code/session_01X4SWXXerzsNdeZ7eWjB7Mw

A cloud agent run unpacks one skill folder into a sandbox with no clone of this repo, so the plain-writing pass in Step 3 and the comment-cleanup pass in Step 5 had no skill to invoke there. PostHog Desktop uploads a referenced skill as a dependency, but it refuses when that skill is a symlink the user did not select, and the installer symlinks every skill.

address-pr-reviews carries a copy of both skills under references/ and reads the copy rather than invoking the skill, so each pass runs the same way on every harness. Each copy keeps its source skill's folder shape, so the relative paths written inside it resolve.

Portable-skill table destinations are relative to a skill's own directory, which puts a vendored skill under the same sync and staleness check as a vendored helper. The undeclared-file walk covers the whole skill folder and skips SKILL.md.

Claude-Session: https://claude.ai/code/session_01X4SWXXerzsNdeZ7eWjB7Mw
The sync's other passes all start from the table, so a file added to a vendored skill reached no copy while CI stayed green, and the sandbox followed a link into a file that never travelled. A fourth pass walks each vendored skill's source folder and reports a file no row copies. It finds that folder by mirroring the destination, so it checks the mirror first: a row that breaks it would otherwise send the walk to a directory that is not there, where it reads nothing and reports nothing.

PORTABLE_SKILL_OWN_FILES declares SKILL.md, which drops the hardcoded exception from the undeclared-file walk and makes the walk's own error message the whole rule.

comment-cleanup names the rules in its own steps as the standard, and reads the Style section of AGENTS.md as well when the run has one. A copy of the skill in a sandbox has no AGENTS.md, so the standard has to travel with the rules.

The two undeclared-file scenarios in the sync test share one function, and the first assertion in that file prints the output it rejected.

Claude-Session: https://claude.ai/code/session_01X4SWXXerzsNdeZ7eWjB7Mw
@haacked
haacked marked this pull request as ready for review September 22, 2026 17:33
@haacked
haacked requested a lite review from Copilot September 22, 2026 17:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The only remaining finding is a minor diagnostic-wording nit, with no approval-blocking issues.

Review effort: Lite
Findings: None

What changed in this PR

This PR makes address-pr-reviews portable by bundling the plain-writing and comment-cleanup skills.

Changes:

  • Vendors both skills and their supporting files.
  • Strengthens portable-skill synchronization and drift checks.
  • Expands documentation and test coverage.
File Summary
ai/​tests/​test-portable-sync.sh Tests orphan, mirror, and source checks.
ai/​skills/​comment-cleanup/​SKILL.md Makes cleanup rules self-contained.
ai/​skills/​address-pr-reviews/​SKILL.md Uses bundled prose and cleanup rules.
ai/​skills/​address-pr-reviews/​scripts/​tests/​test-portable-skill.sh Tests bundled lint execution.
ai/​skills/​address-pr-reviews/​references/​plain-writing/​SKILL.md Bundles plain-writing rules.
ai/​skills/​address-pr-reviews/​references/​plain-writing/​scripts/​plain-writing-lint.py Bundles the prose linter.
ai/​skills/​address-pr-reviews/​references/​plain-writing/​references/​voice-match.md Bundles voice-matching guidance.
ai/​skills/​address-pr-reviews/​references/​plain-writing/​references/​strict.md Bundles strict-writing guidance.
ai/​skills/​address-pr-reviews/​references/​comment-cleanup/​SKILL.md Bundles comment-cleanup rules.
ai/​README.md Documents portability and synchronization conventions.
ai/​helpers/​portable-skills.sh Defines vendored skill paths; contains a minor diagnostic-wording nit.
ai/​bin/​sync-portable-skills.sh Syncs copies and validates source completeness.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@haacked
haacked merged commit 9dc6b96 into main Sep 22, 2026
2 checks passed
@haacked
haacked deleted the haacked/more-cloud-skills branch September 22, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants