@wbern/claude-instructions 1.21.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +4 -2
  2. package/bin/cli.js +414 -229
  3. package/package.json +8 -6
  4. package/src/README.md +279 -0
  5. package/src/fragments/aaa-pattern.md +7 -0
  6. package/src/fragments/beads-awareness.md +1 -0
  7. package/src/fragments/beads-integration.md +8 -0
  8. package/{downloads/without-beads/commit.md → src/fragments/commit-process.md} +0 -17
  9. package/src/fragments/consistency-check.md +1 -0
  10. package/src/fragments/discovery-phase.md +22 -0
  11. package/src/fragments/fallback-arguments-beads.md +3 -0
  12. package/src/fragments/fallback-arguments.md +1 -0
  13. package/src/fragments/fullwidth-dollar-note.md +1 -0
  14. package/src/fragments/gap-beads.md +1 -0
  15. package/src/fragments/git-host-detection.md +19 -0
  16. package/src/fragments/github-issue-fetch.md +10 -0
  17. package/src/fragments/no-plan-files.md +3 -0
  18. package/src/fragments/peeping-tom-warning.md +9 -0
  19. package/src/fragments/plan-beads-context-hint.md +1 -0
  20. package/src/fragments/plan-beads-details.md +49 -0
  21. package/src/fragments/plan-beads-integration.md +2 -0
  22. package/src/fragments/summarize-beads.md +8 -0
  23. package/{downloads/without-beads/summarize.md → src/fragments/summarize-structure.md} +0 -20
  24. package/{downloads/without-beads/tdd.md → src/fragments/tdd-fundamentals.md} +0 -21
  25. package/src/fragments/test-quality-criteria.md +24 -0
  26. package/src/fragments/universal-guidelines.md +6 -0
  27. package/{downloads/without-beads → src/sources}/add-command.md +11 -25
  28. package/{downloads/without-beads → src/sources}/ask.md +11 -6
  29. package/{downloads/without-beads → src/sources}/beepboop.md +7 -6
  30. package/{downloads/without-beads → src/sources}/busycommit.md +9 -36
  31. package/{downloads/without-beads → src/sources}/code-review.md +16 -30
  32. package/src/sources/commit.md +23 -0
  33. package/src/sources/cycle.md +23 -0
  34. package/{downloads/without-beads → src/sources}/gap.md +11 -8
  35. package/src/sources/green.md +23 -0
  36. package/src/sources/issue.md +42 -0
  37. package/{downloads/without-beads → src/sources}/kata.md +10 -9
  38. package/{downloads/without-beads → src/sources}/plan.md +18 -39
  39. package/{downloads/without-beads → src/sources}/pr.md +10 -6
  40. package/src/sources/red.md +26 -0
  41. package/src/sources/refactor.md +27 -0
  42. package/{downloads/without-beads → src/sources}/ship.md +11 -6
  43. package/{downloads/without-beads → src/sources}/show.md +11 -6
  44. package/src/sources/spike.md +23 -0
  45. package/src/sources/summarize.md +23 -0
  46. package/{downloads/without-beads → src/sources}/tdd-review.md +11 -31
  47. package/src/sources/tdd.md +24 -0
  48. package/{downloads/without-beads → src/sources}/worktree-add.md +13 -31
  49. package/{downloads/without-beads → src/sources}/worktree-cleanup.md +9 -27
  50. package/downloads/with-beads/add-command.md +0 -159
  51. package/downloads/with-beads/ask.md +0 -144
  52. package/downloads/with-beads/beepboop.md +0 -47
  53. package/downloads/with-beads/busycommit.md +0 -78
  54. package/downloads/with-beads/code-review.md +0 -263
  55. package/downloads/with-beads/commands-metadata.json +0 -155
  56. package/downloads/with-beads/commit.md +0 -49
  57. package/downloads/with-beads/cycle.md +0 -95
  58. package/downloads/with-beads/gap.md +0 -38
  59. package/downloads/with-beads/green.md +0 -95
  60. package/downloads/with-beads/issue.md +0 -152
  61. package/downloads/with-beads/kata.md +0 -444
  62. package/downloads/with-beads/plan.md +0 -186
  63. package/downloads/with-beads/pr.md +0 -82
  64. package/downloads/with-beads/red.md +0 -103
  65. package/downloads/with-beads/refactor.md +0 -105
  66. package/downloads/with-beads/ship.md +0 -98
  67. package/downloads/with-beads/show.md +0 -114
  68. package/downloads/with-beads/spike.md +0 -95
  69. package/downloads/with-beads/summarize.md +0 -54
  70. package/downloads/with-beads/tdd-review.md +0 -102
  71. package/downloads/with-beads/tdd.md +0 -94
  72. package/downloads/with-beads/worktree-add.md +0 -357
  73. package/downloads/with-beads/worktree-cleanup.md +0 -250
  74. package/downloads/without-beads/commands-metadata.json +0 -155
  75. package/downloads/without-beads/cycle.md +0 -90
  76. package/downloads/without-beads/green.md +0 -90
  77. package/downloads/without-beads/issue.md +0 -140
  78. package/downloads/without-beads/red.md +0 -98
  79. package/downloads/without-beads/refactor.md +0 -100
  80. package/downloads/without-beads/spike.md +0 -90
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: Execute TDD Red Phase - write ONE failing test
3
+ argument-hint: [optional additional info]
4
+ _hint: Failing test
5
+ _category: Test-Driven Development
6
+ _order: 2
7
+ ---
8
+
9
+ RED PHASE! Apply the below to the info given by user input here:
10
+
11
+ $ARGUMENTS
12
+
13
+ <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
14
+ <!-- /docs -->
15
+
16
+ <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
17
+ <!-- /docs -->
18
+
19
+ <!-- docs INCLUDE path='src/fragments/fallback-arguments-beads.md' featureFlag='beads' elsePath='src/fragments/fallback-arguments.md' -->
20
+ <!-- /docs -->
21
+
22
+ <!-- docs INCLUDE path='src/fragments/tdd-fundamentals.md' -->
23
+ <!-- /docs -->
24
+
25
+ <!-- docs INCLUDE path='src/fragments/aaa-pattern.md' -->
26
+ <!-- /docs -->
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: Execute TDD Refactor Phase - improve code structure while keeping tests green
3
+ argument-hint: <refactoring description>
4
+ _hint: Clean up code
5
+ _category: Test-Driven Development
6
+ _order: 4
7
+ ---
8
+
9
+ Apply this document (specifically the Refactor phase), to the info given by user input here: $ARGUMENTS
10
+
11
+ <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
12
+ <!-- /docs -->
13
+
14
+ <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
15
+ <!-- /docs -->
16
+
17
+ <!-- docs INCLUDE path='src/fragments/fallback-arguments-beads.md' featureFlag='beads' elsePath='src/fragments/fallback-arguments.md' -->
18
+ <!-- /docs -->
19
+
20
+ <!-- docs INCLUDE path='src/fragments/tdd-fundamentals.md' -->
21
+ <!-- /docs -->
22
+
23
+ <!-- docs INCLUDE path='src/fragments/peeping-tom-warning.md' -->
24
+ <!-- /docs -->
25
+
26
+ <!-- docs INCLUDE path='src/fragments/consistency-check.md' -->
27
+ <!-- /docs -->
@@ -1,17 +1,19 @@
1
1
  ---
2
2
  description: Ship code directly to main - for small, obvious changes that don't need review
3
3
  argument-hint: [optional-commit-message]
4
+ _hint: Direct to main
5
+ _category: Ship / Show / Ask
6
+ _order: 1
7
+ _selectedByDefault: false
4
8
  ---
5
9
 
6
10
  # Ship - Direct Merge to Main
7
11
 
8
- ## General Guidelines
12
+ <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
13
+ <!-- /docs -->
9
14
 
10
- ### Output Style
11
-
12
- - **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
13
- - Write natural, descriptive code without meta-commentary about the development process
14
- - The code should speak for itself - TDD is the process, not the product
15
+ <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
16
+ <!-- /docs -->
15
17
 
16
18
  **Ship/Show/Ask Pattern - SHIP**
17
19
 
@@ -84,3 +86,6 @@ If tests fail, linter fails, or changes are large/complex, STOP and suggest:
84
86
 
85
87
  - Use `/show` for changes that should be seen but don't need approval
86
88
  - Use `/ask` (traditional PR) for complex changes needing discussion
89
+
90
+ <!-- docs INCLUDE path='src/fragments/beads-integration.md' featureFlag='beads' -->
91
+ <!-- /docs -->
@@ -1,17 +1,19 @@
1
1
  ---
2
2
  description: Show code to team with auto-merge - for changes that should be visible but don't need approval
3
3
  argument-hint: [optional-pr-title-and-description]
4
+ _hint: Auto-merge PR
5
+ _category: Ship / Show / Ask
6
+ _order: 2
7
+ _selectedByDefault: false
4
8
  ---
5
9
 
6
10
  # Show - Visible Merge with Optional Feedback
7
11
 
8
- ## General Guidelines
12
+ <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
13
+ <!-- /docs -->
9
14
 
10
- ### Output Style
11
-
12
- - **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
13
- - Write natural, descriptive code without meta-commentary about the development process
14
- - The code should speak for itself - TDD is the process, not the product
15
+ <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
16
+ <!-- /docs -->
15
17
 
16
18
  **Ship/Show/Ask Pattern - SHOW**
17
19
 
@@ -100,3 +102,6 @@ Use **Show** when:
100
102
  Use **/ship** instead if: change is tiny and obvious (typo, formatting)
101
103
 
102
104
  Use **/ask** instead if: change needs discussion, breaks APIs, or you're uncertain
105
+
106
+ <!-- docs INCLUDE path='src/fragments/beads-integration.md' featureFlag='beads' -->
107
+ <!-- /docs -->
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Execute TDD Spike Phase - exploratory coding to understand problem space before TDD
3
+ argument-hint: <exploration description>
4
+ _hint: Explore first
5
+ _category: Test-Driven Development
6
+ _order: 1
7
+ ---
8
+
9
+ SPIKE PHASE! Apply the below to the info given by user input here:
10
+
11
+ $ARGUMENTS
12
+
13
+ <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
14
+ <!-- /docs -->
15
+
16
+ <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
17
+ <!-- /docs -->
18
+
19
+ <!-- docs INCLUDE path='src/fragments/fallback-arguments-beads.md' featureFlag='beads' elsePath='src/fragments/fallback-arguments.md' -->
20
+ <!-- /docs -->
21
+
22
+ <!-- docs INCLUDE path='src/fragments/tdd-fundamentals.md' -->
23
+ <!-- /docs -->
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Summarize conversation progress and next steps
3
+ argument-hint: [optional additional info]
4
+ _hint: Summarize chat
5
+ _category: Workflow
6
+ _order: 10
7
+ ---
8
+
9
+ <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
10
+ <!-- /docs -->
11
+
12
+ <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
13
+ <!-- /docs -->
14
+
15
+ Create a concise summary of the current conversation suitable for transferring context to a new conversation.
16
+
17
+ Additional info: $ARGUMENTS
18
+
19
+ <!-- docs INCLUDE path='src/fragments/summarize-structure.md' -->
20
+ <!-- /docs -->
21
+
22
+ <!-- docs INCLUDE path='src/fragments/summarize-beads.md' featureFlag='beads' -->
23
+ <!-- /docs -->
@@ -1,17 +1,19 @@
1
1
  ---
2
2
  description: Review test suite quality against FIRST principles and TDD anti-patterns
3
3
  argument-hint: [optional test file or directory path]
4
+ _hint: Review tests
5
+ _category: Test-Driven Development
6
+ _order: 45
4
7
  ---
5
8
 
6
- ## General Guidelines
9
+ <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
10
+ <!-- /docs -->
7
11
 
8
- ### Output Style
12
+ <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
13
+ <!-- /docs -->
9
14
 
10
- - **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
11
- - Write natural, descriptive code without meta-commentary about the development process
12
- - The code should speak for itself - TDD is the process, not the product
13
-
14
- (If there was no info above, fallback to the context of the conversation)
15
+ <!-- docs INCLUDE path='src/fragments/fallback-arguments-beads.md' featureFlag='beads' elsePath='src/fragments/fallback-arguments.md' -->
16
+ <!-- /docs -->
15
17
 
16
18
  # Test Quality Review
17
19
 
@@ -35,30 +37,8 @@ For each test file, check against these criteria:
35
37
 
36
38
  ### Quality Criteria
37
39
 
38
- #### FIRST Principles
39
-
40
- | Principle | What to Check |
41
- |-----------|---------------|
42
- | **Fast** | Tests complete quickly, no I/O, no network calls, no sleep()/setTimeout delays |
43
- | **Independent** | No shared mutable state, no execution order dependencies between tests |
44
- | **Repeatable** | No Date.now(), no Math.random() without seeding, no external service dependencies |
45
- | **Self-validating** | Meaningful assertions that verify behavior, no manual verification needed |
46
-
47
- #### TDD Anti-patterns
48
-
49
- | Anti-pattern | Detection Signals |
50
- |--------------|-------------------|
51
- | **The Liar** | `expect(true).toBe(true)`, empty test bodies, tests with no assertions |
52
- | **Excessive Setup** | >20 lines of arrange code, >5 mocks, deep nested object construction |
53
- | **The One** | >5 assertions testing unrelated behaviors in a single test |
54
- | **The Peeping Tom** | Testing private methods, asserting on internal state, tests that break on any refactor |
55
- | **The Slow Poke** | Real database/network calls, file I/O, hard-coded timeouts |
56
-
57
- #### Test Structure (AAA Pattern)
58
-
59
- - **Arrange**: Clear setup with minimal fixtures
60
- - **Act**: Single action being tested
61
- - **Assert**: Specific, behavior-focused assertions
40
+ <!-- docs INCLUDE path='src/fragments/test-quality-criteria.md' -->
41
+ <!-- /docs -->
62
42
 
63
43
  ## Phase 3: Report
64
44
 
@@ -0,0 +1,24 @@
1
+ ---
2
+ description: Remind agent about TDD approach and continue conversation
3
+ argument-hint: [optional-response-to-last-message]
4
+ _hint: TDD reminder
5
+ _category: Test-Driven Development
6
+ _order: 1
7
+ ---
8
+
9
+ # TDD Reminder
10
+
11
+ <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
12
+ <!-- /docs -->
13
+
14
+ <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
15
+ <!-- /docs -->
16
+
17
+ <!-- docs INCLUDE path='src/fragments/tdd-fundamentals.md' -->
18
+ <!-- /docs -->
19
+
20
+ ## Continue Conversation
21
+
22
+ User response to the last message: $ARGUMENTS
23
+
24
+ Please continue with TDD approach based on the above response.
@@ -1,17 +1,18 @@
1
1
  ---
2
2
  description: Add a new git worktree from branch name or issue URL, copy settings, install deps, and open in current IDE
3
3
  argument-hint: <branch-name-or-issue-url> [optional-base-branch]
4
+ _hint: Add worktree
5
+ _category: Worktree Management
6
+ _order: 1
4
7
  ---
5
8
 
6
9
  # Git Worktree Setup
7
10
 
8
- ## General Guidelines
11
+ <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
12
+ <!-- /docs -->
9
13
 
10
- ### Output Style
11
-
12
- - **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
13
- - Write natural, descriptive code without meta-commentary about the development process
14
- - The code should speak for itself - TDD is the process, not the product
14
+ <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
15
+ <!-- /docs -->
15
16
 
16
17
  Create a new git worktree for branch: $ARGUMENTS
17
18
 
@@ -45,26 +46,8 @@ Uncommitted changes: `git status --short`
45
46
  <step_0b>
46
47
  <description>Detect git hosting provider and available tools (only needed if argument is an issue URL)</description>
47
48
  <condition>Only run this step if first argument looks like a git hosting URL</condition>
48
- <detect_provider>
49
- <check_remote_url>git remote get-url origin</check_remote_url>
50
- <identify_host>
51
- - github.com → GitHub
52
- - gitlab.com → GitLab
53
- - bitbucket.org → Bitbucket
54
- - Other → Ask user
55
- </identify_host>
56
- </detect_provider>
57
- <check_available_tools>
58
- <list_mcp_servers>Check which git-hosting MCP servers are available (github, gitlab, etc.)</list_mcp_servers>
59
- <check_cli>Check if gh/glab CLI is available as fallback</check_cli>
60
- </check_available_tools>
61
- <select_tool>
62
- <if_single_mcp>If only one relevant MCP available, confirm with user</if_single_mcp>
63
- <if_multiple>Let user choose which tool to use</if_multiple>
64
- <if_told_earlier>If user specified tool earlier in conversation, use that without asking again</if_told_earlier>
65
- <store_as>$GIT_HOST_TOOL (e.g., "github_mcp", "gitlab_mcp", "gh_cli")</store_as>
66
- </select_tool>
67
-
49
+ <!-- docs INCLUDE path='src/fragments/git-host-detection.md' -->
50
+ <!-- /docs -->
68
51
  <purpose>Detect git hosting provider and select appropriate tool for issue lookup</purpose>
69
52
  </step_0b>
70
53
 
@@ -116,9 +99,9 @@ Uncommitted changes: `git status --short`
116
99
  <bitbucket>Check if argument contains "bitbucket.org" and "/issues/"</bitbucket>
117
100
  </url_detection>
118
101
  <url_parsing>
119
- <github_pattern><https://github.com/{owner}/{repo}/issues/{issue_number}></github_pattern>
120
- <gitlab_pattern><https://gitlab.com/{owner}/{repo}/-/issues/{issue_number}></gitlab_pattern>
121
- <bitbucket_pattern><https://bitbucket.org/{owner}/{repo}/issues/{issue_number}></bitbucket_pattern>
102
+ <github_pattern>https://github.com/{owner}/{repo}/issues/{issue_number}</github_pattern>
103
+ <gitlab_pattern>https://gitlab.com/{owner}/{repo}/-/issues/{issue_number}</gitlab_pattern>
104
+ <bitbucket_pattern>https://bitbucket.org/{owner}/{repo}/issues/{issue_number}</bitbucket_pattern>
122
105
  <extract>owner, repo, issue_number from URL</extract>
123
106
  </url_parsing>
124
107
  <fetch_issue_details>
@@ -263,7 +246,7 @@ Uncommitted changes: `git status --short`
263
246
  - packages/*/.env.local
264
247
  - (any other .env.local files found)
265
248
  </common_locations>
266
- <copy_command>find . -name ".env.local" -type f -exec sh -c 'mkdir -p "$(dirname "${parent_path}/${branch_name}/$1")" && cp "$1" "${parent_path}/${branch_name}/$1"'_ {} \;</copy_command>
249
+ <copy_command>find . -name ".env.local" -type f -exec sh -c 'mkdir -p "$(dirname "${parent_path}/${branch_name}/$1")" && cp "$1" "${parent_path}/${branch_name}/$1"' _ {} \;</copy_command>
267
250
  <purpose>Preserve local environment configurations for development</purpose>
268
251
  <note>Only copies files that exist; ignores missing ones</note>
269
252
  </step_9>
@@ -347,7 +330,6 @@ EOF</create_file_command>
347
330
  - New branches are automatically pushed with `-u` to set up remote tracking
348
331
 
349
332
  Limitations:
350
-
351
333
  - Assumes remote is named "origin" (most common convention)
352
334
  - Supports macOS and Linux only (no Windows support)
353
335
  - Requires MCP server or CLI for git hosting provider when using issue URLs (GitHub, GitLab, etc.)
@@ -1,17 +1,18 @@
1
1
  ---
2
2
  description: Clean up merged worktrees by verifying PR/issue status, consolidating settings, and removing stale worktrees
3
3
  argument-hint: (no arguments)
4
+ _hint: Cleanup worktree
5
+ _category: Worktree Management
6
+ _order: 2
4
7
  ---
5
8
 
6
9
  # Worktree Cleanup
7
10
 
8
- ## General Guidelines
11
+ <!-- docs INCLUDE path='src/fragments/universal-guidelines.md' -->
12
+ <!-- /docs -->
9
13
 
10
- ### Output Style
11
-
12
- - **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
13
- - Write natural, descriptive code without meta-commentary about the development process
14
- - The code should speak for itself - TDD is the process, not the product
14
+ <!-- docs INCLUDE path='src/fragments/beads-awareness.md' featureFlag='beads' -->
15
+ <!-- /docs -->
15
16
 
16
17
  Clean up merged worktrees by finding the oldest merged branch, consolidating settings, and removing stale worktrees.
17
18
 
@@ -25,26 +26,8 @@ Current worktrees: `git worktree list`
25
26
  <execution_steps>
26
27
  <step_0>
27
28
  <description>Detect git hosting provider and available tools</description>
28
- <detect_provider>
29
- <check_remote_url>git remote get-url origin</check_remote_url>
30
- <identify_host>
31
- - github.com → GitHub
32
- - gitlab.com → GitLab
33
- - bitbucket.org → Bitbucket
34
- - Other → Ask user
35
- </identify_host>
36
- </detect_provider>
37
- <check_available_tools>
38
- <list_mcp_servers>Check which git-hosting MCP servers are available (github, gitlab, etc.)</list_mcp_servers>
39
- <check_cli>Check if gh/glab CLI is available as fallback</check_cli>
40
- </check_available_tools>
41
- <select_tool>
42
- <if_single_mcp>If only one relevant MCP available, confirm with user</if_single_mcp>
43
- <if_multiple>Let user choose which tool to use</if_multiple>
44
- <if_told_earlier>If user specified tool earlier in conversation, use that without asking again</if_told_earlier>
45
- <store_as>$GIT_HOST_TOOL (e.g., "github_mcp", "gitlab_mcp", "gh_cli")</store_as>
46
- </select_tool>
47
-
29
+ <!-- docs INCLUDE path='src/fragments/git-host-detection.md' -->
30
+ <!-- /docs -->
48
31
  <purpose>Detect git hosting provider and select appropriate tool for PR verification</purpose>
49
32
  </step_0>
50
33
 
@@ -241,7 +224,6 @@ Current worktrees: `git worktree list`
241
224
  - Must be run from default branch for safety
242
225
 
243
226
  Limitations:
244
-
245
227
  - Assumes remote is named "origin" (most common convention)
246
228
  - Supports macOS and Linux only (no Windows support)
247
229
  - Requires MCP server or CLI for git hosting provider (GitHub, GitLab, etc.)
@@ -1,159 +0,0 @@
1
- ---
2
- description: Guide for creating new slash commands
3
- argument-hint: <command-name> <description>
4
- ---
5
-
6
- ## General Guidelines
7
-
8
- ### Output Style
9
-
10
- - **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
11
- - Write natural, descriptive code without meta-commentary about the development process
12
- - The code should speak for itself - TDD is the process, not the product
13
-
14
- Beads is available for task tracking. Use `mcp__beads__*` tools to manage issues (the user interacts via `bd` commands).
15
-
16
- # Slash Command Creator Guide
17
-
18
- ## How This Command Works
19
-
20
- The `/add-command` command shows this guide for creating new slash commands. It includes:
21
-
22
- - Command structure and syntax
23
- - Common patterns and examples
24
- - Security restrictions and limitations
25
- - Frontmatter options
26
-
27
- **Note for AI**: When creating commands, you CAN use bash tools like `Bash(mkdir:*)`, `Bash(ls:*)`, `Bash(git status:*)` in the `allowed-tools` frontmatter of NEW commands - but ONLY for operations within the current project directory. This command itself doesn't need bash tools since it's just documentation.
28
-
29
- ## Command Locations
30
-
31
- - **Personal**: `~/.claude/commands/` (available across all projects)
32
- - **Project**: `.claude/commands/` (shared with team, shows "(project)")
33
-
34
- ## Basic Structure
35
-
36
- ```markdown
37
- ---
38
- allowed-tools: Read, Glob, Grep, Bash(git status:*), Task
39
- description: Brief description of what this command does
40
- argument-hint: [required-arg] [optional-arg]
41
- ---
42
-
43
- # Command Title
44
-
45
- Your command instructions here.
46
-
47
- Arguments: $ARGUMENTS
48
-
49
- File reference: @path/to/file.js
50
-
51
- Bash command output: (exclamation)git status(backticks)
52
- ```
53
-
54
- ## ⚠️ Security Restrictions
55
-
56
- **Bash Commands (exclamation prefix)**: Limited to current working directory only.
57
-
58
- - ✅ Works: `! + backtick + git status + backtick` (in project dir)
59
- - ❌ Blocked: `! + backtick + ls /outside/project + backtick` (outside project)
60
- - ❌ Blocked: `! + backtick + pwd + backtick` (if referencing dirs outside project)
61
-
62
- **File References (`@` prefix)**: No directory restrictions.
63
-
64
- - ✅ Works: `@/path/to/system/file.md`
65
- - ✅ Works: `@../other-project/file.js`
66
-
67
- ## Common Patterns
68
-
69
- ### Simple Command
70
-
71
- ```bash
72
- echo "Review this code for bugs and suggest fixes" > ~/.claude/commands/review.md
73
- ```
74
-
75
- ### Command with Arguments
76
-
77
- **Note for AI**: The example below uses a fullwidth dollar sign ($, U+FF04) to prevent interpolation in this documentation. When creating actual commands, use the regular `$` character.
78
-
79
- ```markdown
80
- Fix issue $ARGUMENTS following our coding standards
81
- ```
82
-
83
- ### Command with File References
84
-
85
- ```markdown
86
- Compare @src/old.js with @src/new.js and explain differences
87
- ```
88
-
89
- ### Command with Bash Output (Project Directory Only)
90
-
91
- ```markdown
92
- ---
93
- allowed-tools: Bash(git status:*), Bash(git branch:*), Bash(git log:*)
94
- ---
95
- Current status: (!)git status(`)
96
- Current branch: (!)git branch --show-current(`)
97
- Recent commits: (!)git log --oneline -5(`)
98
-
99
- Create commit for these changes.
100
- ```
101
-
102
- **Note**: Only works with commands in the current project directory.
103
-
104
- ### Namespaced Command
105
-
106
- **Note for AI**: The example below uses a fullwidth dollar sign ($, U+FF04) to prevent interpolation in this documentation. When creating actual commands, use the regular `$` character.
107
-
108
- ```bash
109
- mkdir -p ~/.claude/commands/ai
110
- echo "Ask GPT-5 about: $ARGUMENTS" > ~/.claude/commands/ai/gpt5.md
111
- # Creates: /ai:gpt5
112
- ```
113
-
114
- ## Frontmatter Options
115
-
116
- - `allowed-tools`: Tools this command can use
117
- - **Important**: Intrusive tools like `Write`, `Edit`, `NotebookEdit` should NEVER be allowed in commands unless the user explicitly requests them. These tools modify files and should only be used when the command's purpose is to make changes.
118
- - ✅ Safe for most commands: `Read`, `Glob`, `Grep`, `Bash(git status:*)`, `Task`, `AskUserQuestion`
119
- - `description`: Brief description (shows in /help)
120
- - `argument-hint`: Help text for arguments
121
- - `model`: Specific model to use
122
-
123
- ## Best Practices
124
-
125
- ### Safe Commands (No Security Issues)
126
-
127
- ```markdown
128
- # System prompt editor (file reference only)
129
- (@)path/to/system/prompt.md
130
-
131
- Edit your system prompt above.
132
- ```
133
-
134
- ### Project-Specific Commands (Bash OK)
135
-
136
- ```markdown
137
- ---
138
- allowed-tools: Bash(git status:*), Bash(npm list:*)
139
- ---
140
- Current git status: (!)git status(`)
141
- Package info: (!)npm list --depth=0(`)
142
-
143
- Review project state and suggest next steps.
144
- ```
145
-
146
- ### Cross-Directory File Access (Use @ not !)
147
-
148
- ```markdown
149
- # Compare config files
150
- Compare (@)path/to/system.md with (@)project/config.md
151
-
152
- Show differences and suggest improvements.
153
- ```
154
-
155
- ## Usage
156
-
157
- After creating: `/<command-name> [arguments]`
158
-
159
- Example: `/review` or `/ai:gpt5 "explain this code"`