Skip to content

Unify skill sync and stop writing .gitignore into shared directories#239

Merged
nikomatsakis merged 4 commits into
symposium-dev:mainfrom
nikomatsakis:gitignoreless
Jun 10, 2026
Merged

Unify skill sync and stop writing .gitignore into shared directories#239
nikomatsakis merged 4 commits into
symposium-dev:mainfrom
nikomatsakis:gitignoreless

Conversation

@nikomatsakis

@nikomatsakis nikomatsakis commented Jun 9, 2026

Copy link
Copy Markdown
Member

What does this PR do?

  • Replaces two inconsistent skill installation paths (Agent::install_skill for plugin skills, propagate_user_skill for user-authored skills) with a single sync_skill_dir function that copies the full skill directory tree, debounces on marker mtime, and only replaces content when it actually differs.
  • Fixes .gitignore pollution: previously create_managed_dir_all wrote a wildcard * gitignore into every ancestor it created (.claude/, .claude/skills/, .kiro/, etc.), which could suppress user-managed files. Now .gitignore is written only into individual skill directories.
Disclosure questions

AI disclosure.

  • The AI tool authored large parts of the code

Questions for reviewers.

@nikomatsakis nikomatsakis changed the title Only write .gitignore into individual skill directories Unify skill sync and stop writing .gitignore into shared directories Jun 9, 2026
Comment thread src/sync.rs Outdated
@nikomatsakis nikomatsakis marked this pull request as ready for review June 9, 2026 19:02
nikomatsakis and others added 2 commits June 9, 2026 22:50
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>
nikomatsakis and others added 2 commits June 9, 2026 23:00
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>
@nikomatsakis nikomatsakis added this pull request to the merge queue Jun 10, 2026
Merged via the queue into symposium-dev:main with commit 32f2955 Jun 10, 2026
6 checks passed
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.

1 participant