Skip to content

fix(repo): stop gitignoring skills directories for non-claude tools#1405

Merged
stack72 merged 2 commits into
mainfrom
worktree-gitignore
May 19, 2026
Merged

fix(repo): stop gitignoring skills directories for non-claude tools#1405
stack72 merged 2 commits into
mainfrom
worktree-gitignore

Conversation

@stack72
Copy link
Copy Markdown
Contributor

@stack72 stack72 commented May 19, 2026

Summary

  • Remove skills directory entries (.cursor/skills/, .agents/skills/, .kiro/skills/) from GITIGNORE_TOOL_ENTRIES so they are no longer gitignored during repo init / repo upgrade
  • Skills should be checked in to version control for all tools, matching the existing behavior for Claude (which correctly did not gitignore .claude/skills/)
  • Legacy migration patterns preserved so old gitignore content with skills entries is still correctly detected and replaced

Test plan

  • All 98 repo_service tests pass
  • Type checking passes (deno check)
  • Linting passes (deno lint)
  • Verify swamp repo init --tool cursor no longer includes .cursor/skills/ in .gitignore
  • Verify swamp repo upgrade on existing repo removes skills from managed gitignore section

🤖 Generated with Claude Code

stack72 and others added 2 commits May 19, 2026 22:25
Skills should be checked in to version control for all tools, not just
Claude. Previously, cursor/opencode/codex/copilot/kiro all had their
skills directories (.cursor/skills/, .agents/skills/, .kiro/skills/)
in the managed gitignore section, preventing users from committing them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The integration test expected .agents/skills/ to appear once in the
gitignore; it should now expect zero occurrences since skills are no
longer gitignored for any tool.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Code Review

Clean, well-scoped PR. The change correctly removes skills directories from gitignore — skills should be version-controlled across all tools, not just Claude. The implementation is sound:

  • Legacy migration preserved: migrateLegacyGitignore still includes .cursor/skills/, .agents/skills/, and .kiro/skills/ in swampPatterns (line ~1069-1077), so old gitignore files with those entries are correctly detected and migrated. Good.
  • DDD: Changes are properly scoped to the domain service (RepoService) and its internal configuration constant. No aggregate or boundary violations.
  • Test coverage: Tests are thorough — both unit tests and integration tests updated to verify skills directories are not gitignored. The assertion pattern (assertEquals(content.includes("skills/"), false)) is clear and correct.
  • No libswamp import boundary issues: Changes are entirely within the domain layer.
  • No security concerns: The change actually improves the default posture by ensuring project-specific AI instructions are tracked in version control.

Blocking Issues

None.

Suggestions

  1. Minor test gap: copilot is missing from the toolsWithNoSkillsIgnore array at src/domain/repo/repo_service_test.ts:998. It was in the old GITIGNORE_TOOL_ENTRIES alongside opencode/codex/kiro, and the multi-tool integration test at line 2338 does exercise copilot indirectly, so this is very low risk. Adding it to the loop would make the unit test exhaustive.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Adversarial Review

Critical / High

None.

Medium

  1. src/domain/repo/repo_service_test.ts ~line 1003: The toolsWithNoSkillsIgnore array lists ["cursor", "opencode", "codex", "kiro"] but omits copilot, which was one of the five tools that previously had a skills gitignore entry. The copilot tool does get partial coverage in the shared-dir dedup test at line 2338 (which tests opencode + codex + copilot together), but there's no standalone test verifying that a copilot-only init produces no skills/ in .gitignore. Minor gap — the logic is clearly correct since GITIGNORE_TOOL_ENTRIES no longer has a copilot key, but adding "copilot" to that array would make the test suite more thorough.

Low

None.

Verdict

PASS — Clean, well-scoped change. The GITIGNORE_TOOL_ENTRIES removal is correct: skills directories for non-Claude tools are no longer gitignored, while legacy migration patterns in migrateLegacyGitignore still recognize the old entries (.cursor/skills/, .agents/skills/, .kiro/skills/) so users upgrading from older versions get a clean migration. The generateGitignoreSectionBody logic with seenEntries dedup still works correctly — it just has fewer entries to process (only claude). Tests are updated to assert the new behavior (skills directories absent from .gitignore). No logic errors, no resource leaks, no security concerns.

@stack72 stack72 merged commit 07da543 into main May 19, 2026
11 checks passed
@stack72 stack72 deleted the worktree-gitignore branch May 19, 2026 21:47
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