Skip to content

chore: track .claude/commands/ in Kit repo for worktree support#19

Merged
emredursun merged 2 commits intomainfrom
fix/gitignore-worktree-support
Apr 8, 2026
Merged

chore: track .claude/commands/ in Kit repo for worktree support#19
emredursun merged 2 commits intomainfrom
fix/gitignore-worktree-support

Conversation

@emredursun
Copy link
Copy Markdown
Contributor

Summary

  • Migrate .claude/.claude/* glob pattern in Kit repo's own .gitignore
  • Add !.claude/commands/ negation so bridge files are git-tracked
  • Ensures slash commands work in Kit repo worktrees (same fix kit init applies to consumer projects)

Context

PR #18 added automatic bridge generation for consumer projects, but the Kit repo's own .gitignore still had the old .claude/ pattern. This one-line fix applies the same worktree-safe pattern to the Kit repo itself.

Test Plan

  • E2E verified: npx @devran-ai/kit@5.2.0 init in clean project generates bridges correctly
  • Worktree test: .claude/commands/ visible in worktrees, .agent/ correctly gitignored
  • .claude/settings.json remains gitignored

Migrate .claude/ to .claude/* glob pattern and add !.claude/commands/
negation so bridge files are available in git worktrees. Settings,
plans, and worktree metadata remain gitignored.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist 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

This pull request updates the .gitignore file to ignore the contents of the .claude directory while explicitly unignoring the .claude/commands/ subdirectory. The review feedback suggests extending this pattern to other IDE-specific directories for consistency and recommends grouping negation rules directly with their corresponding ignore patterns to enhance maintainability.

.gitignore Outdated
Comment on lines 11 to 13
.claude/*
.cursor/
.opencode/
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The worktree support for slash commands should be consistent across all supported IDEs. Currently, only .claude/commands/ is unignored, but the Kit repo also ignores .cursor/ and .opencode/, which contain similar bridge files generated by the tool. To ensure a consistent developer experience in worktrees, consider applying the same /* and !/commands/ pattern to these directories. Additionally, keeping the negation patterns adjacent to their respective ignore patterns improves maintainability.

.claude/*
!.claude/commands/
.cursor/*
!.cursor/commands/
.opencode/*
!.opencode/commands/

.gitignore Outdated
Comment on lines +43 to +44

!.claude/commands/
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This negation is better placed immediately following the corresponding ignore pattern in the # IDE section (around line 11) to improve readability. Keeping related ignore and unignore rules together makes the .gitignore file easier to maintain and prevents confusion as the project grows.

- Extend /*  + !/commands/ pattern to .cursor/ and .opencode/
- Place negation rules adjacent to their ignore patterns for readability
- Addresses gemini-code-assist review on PR #19
@emredursun emredursun merged commit 466c1df into main Apr 8, 2026
4 checks passed
emredursun added a commit that referenced this pull request Apr 8, 2026
Bridge files generated by kit init --force for Kit's own development.
Tracked via .gitignore negation patterns (PR #19) so they appear in
worktrees. These files are not included in the npm package — end users
get them generated at runtime by lib/command-bridge.js.

3 IDEs x 25 workflows = 75 bridge files:
- .claude/commands/*.md (Claude Code / Antigravity)
- .cursor/commands/*.md (Cursor)
- .opencode/commands/*.md (OpenCode)
emredursun added a commit that referenced this pull request Apr 8, 2026
* chore: add generated slash command bridge files for Kit repo

Bridge files generated by kit init --force for Kit's own development.
Tracked via .gitignore negation patterns (PR #19) so they appear in
worktrees. These files are not included in the npm package — end users
get them generated at runtime by lib/command-bridge.js.

3 IDEs x 25 workflows = 75 bridge files:
- .claude/commands/*.md (Claude Code / Antigravity)
- .cursor/commands/*.md (Cursor)
- .opencode/commands/*.md (OpenCode)

* fix: place YAML frontmatter before provenance header for IDE compatibility

- Claude and OpenCode bridges now start with --- frontmatter block
- Provenance header moved after frontmatter closing ---
- Workflow paths wrapped in backticks for AI agent recognition
- Consistent with VS Code adapter pattern (already frontmatter-first)
- Addresses gemini-code-assist review on PR #20
@emredursun emredursun deleted the fix/gitignore-worktree-support branch April 10, 2026 01:23
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