Unify skill sync and stop writing .gitignore into shared directories#239
Merged
Conversation
fa6fd26 to
f98c359
Compare
nikomatsakis
commented
Jun 9, 2026
Replace two inconsistent install paths with a single `sync_skill_dir` function shared by both plugin-skill and user-authored-skill syncing: - Removes `Agent::install_skill` (only copied SKILL.md, didn't handle multi-file skills). - Removes `propagate_user_skill` (had its own conflict-check logic that is now inline at the call site). The new function copies the full skill directory tree, adds a 60-second debounce (keyed on marker mtime), and compares source/dest content before replacing — so disk shows no modifications when nothing changed. As part of this, `create_managed_dir_all` no longer writes `.gitignore` into every ancestor it creates. The `.gitignore` is now written only by `mark_generated_skill_directory` into the leaf skill directory, avoiding polluting shared namespace directories like `.claude/` or `.kiro/`. Co-authored-by: Claude <claude@anthropic.com>
- Test now asserts .gitignore exists only in the skill directory, and explicitly checks that the parent (e.g. `.claude/skills/`) does NOT get one. - Update module-structure.md to reflect the new behavior. Co-authored-by: Claude <claude@anthropic.com>
bdfffef to
27617cd
Compare
Add `sync-debounce-secs` config field (default 5s, set to 0 to disable) and thread it into `sync_skill_dir` so tests can bypass the debounce. New test `agents_syncing_detects_modified_source_skill` verifies that modifying a user-authored skill in `.agents/skills/` is picked up on re-sync and propagated to `.claude/skills/`. Co-authored-by: Claude <claude@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Agent::install_skillfor plugin skills,propagate_user_skillfor user-authored skills) with a singlesync_skill_dirfunction that copies the full skill directory tree, debounces on marker mtime, and only replaces content when it actually differs..gitignorepollution: previouslycreate_managed_dir_allwrote a wildcard*gitignore into every ancestor it created (.claude/,.claude/skills/,.kiro/, etc.), which could suppress user-managed files. Now.gitignoreis written only into individual skill directories.Disclosure questions
AI disclosure.
Questions for reviewers.