Skip to content

fix(anthropic-subscription): rewrite skill_roots entries to Claude skill dirs - #4566

Merged
code-yeongyu merged 4 commits into
mainfrom
fix/4518-subscription-skill-roots-rewrite
Oct 29, 2026
Merged

code-yeongyu merged 4 commits into
mainfrom
fix/4518-subscription-skill-roots-rewrite

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Fixes #4518

What

rewriteSkillsLocations (Claude subscription lane, preset-append) rewrites the <rN> entries of the catalog's <skill_roots> table again:

  • a root at or under the global skills root becomes ~/.claude/skills[/<sub>], one at or under the project skills root becomes .claude/skills[/<sub>]; every other root is untouched;
  • this covers both the XML catalog and the one-line catalog from feat(coding-agent): list a large skill catalog one line per skill #4456, because both resolve rN through the same table;
  • the absolute <location> rewrite for a catalog without the table is kept;
  • roots are matched by path containment (path.relative), so a sibling directory such as <agent>/skills-extra is no longer treated as inside skills (the old startsWith check had no boundary).

Tests

RED -> GREEN test/suite/regressions/4518-subscription-skill-roots-rewrite.test.ts (renders a real catalog with formatSkillsForPrompt, runs it through buildAnthropicSubscriptionQueryOptions, reads the appended <skill_roots>):

  • XML catalog with a roots table: global and project roots rewritten, unrelated roots untouched: RED on main (roots kept as <agent>/skills, <cwd>/.senpi/skills) -> GREEN
  • one-line catalog: ... (101 skills): RED on main -> GREEN
  • legacy XML catalog with absolute locations: ...: green before and after (kept behavior)

Rows cover the global root, a nested global root (skills/team), the project root, an unrelated plugin root, and the skills-extra sibling.

Push gates (each its own process via gated-push, all rc=0 at this head): git diff --check origin/main...HEAD; bun run check; the new test plus test/anthropic-subscription-options.test.ts and test/anthropic-subscription-project-instructions.test.ts (3 files, 67 tests); node scripts/check-pr-changelog.mjs --base origin/main.


Summary by cubic

Fixes the Claude subscription lane's skill-roots rewrite so catalogs that list their roots in the <skill_roots> table—both the XML and the one-line format—point at ~/.claude/skills and .claude/skills again. The old rewrite only touched absolute <location> paths, so these catalogs kept senpi's own skill paths (#4518).

  • Rewrites <rN> entries for roots at or under the global or project skills root, keeping the path below the root; all other roots are untouched.
  • Matches roots by path containment, so a sibling directory like skills-extra is no longer treated as inside skills.
  • Keeps the absolute <location> rewrite for catalogs without the table.
  • Adds a regression test covering the XML catalog, the one-line catalog, and the legacy absolute-location case.

Written for commit 7ff70b7. Summary will update on new commits.

View guided diff Turn on auto-fix

@code-yeongyu
code-yeongyu merged commit 5e50670 into main Oct 29, 2026
37 checks passed
@code-yeongyu
code-yeongyu deleted the fix/4518-subscription-skill-roots-rewrite branch October 29, 2026 05:42
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.

Anthropic subscription lane: rewriteSkillsLocations no longer rewrites any skill location (roots-table aliases)

1 participant