claude-all-hands 1.0.1 → 1.0.2

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 (160) hide show
  1. package/.claude/agents/code-simplifier.md +52 -0
  2. package/.claude/agents/curator.md +189 -245
  3. package/.claude/agents/documentor.md +147 -0
  4. package/.claude/agents/planner.md +123 -166
  5. package/.claude/agents/researcher.md +58 -41
  6. package/.claude/agents/surveyor.md +81 -0
  7. package/.claude/agents/worker.md +74 -0
  8. package/.claude/commands/audit-docs.md +94 -0
  9. package/.claude/commands/continue.md +120 -0
  10. package/.claude/commands/create-docs.md +100 -0
  11. package/.claude/commands/create-skill.md +107 -0
  12. package/.claude/commands/create-specialist.md +111 -0
  13. package/.claude/commands/curator-audit.md +4 -0
  14. package/.claude/commands/debug.md +183 -0
  15. package/.claude/commands/plan.md +199 -102
  16. package/.claude/commands/validate.md +11 -0
  17. package/.claude/commands/whats-next.md +106 -134
  18. package/.claude/envoy/envoy +11 -14
  19. package/.claude/envoy/package-lock.json +1388 -0
  20. package/.claude/envoy/package.json +29 -0
  21. package/.claude/envoy/src/cli.ts +126 -0
  22. package/.claude/envoy/src/commands/base.ts +216 -0
  23. package/.claude/envoy/src/commands/gemini.ts +999 -0
  24. package/.claude/envoy/src/commands/git.ts +639 -0
  25. package/.claude/envoy/src/commands/index.ts +73 -0
  26. package/.claude/envoy/src/commands/knowledge.ts +187 -0
  27. package/.claude/envoy/src/commands/perplexity.ts +129 -0
  28. package/.claude/envoy/src/commands/plan/core.ts +134 -0
  29. package/.claude/envoy/src/commands/plan/findings.ts +446 -0
  30. package/.claude/envoy/src/commands/plan/gates.ts +672 -0
  31. package/.claude/envoy/src/commands/plan/index.ts +135 -0
  32. package/.claude/envoy/src/commands/plan/lifecycle.ts +648 -0
  33. package/.claude/envoy/src/commands/plan/plan-file.ts +138 -0
  34. package/.claude/envoy/src/commands/plan/prompts.ts +285 -0
  35. package/.claude/envoy/src/commands/plan/protocols.ts +166 -0
  36. package/.claude/envoy/src/commands/repomix.ts +99 -0
  37. package/.claude/envoy/src/commands/tavily.ts +220 -0
  38. package/.claude/envoy/src/commands/xai.ts +168 -0
  39. package/.claude/envoy/src/lib/design.ts +41 -0
  40. package/.claude/envoy/src/lib/feedback-schemas.ts +154 -0
  41. package/.claude/envoy/src/lib/findings.ts +215 -0
  42. package/.claude/envoy/src/lib/gates.ts +572 -0
  43. package/.claude/envoy/src/lib/git.ts +132 -0
  44. package/.claude/envoy/src/lib/index.ts +188 -0
  45. package/.claude/envoy/src/lib/knowledge.ts +594 -0
  46. package/.claude/envoy/src/lib/markdown.ts +75 -0
  47. package/.claude/envoy/src/lib/observability.ts +262 -0
  48. package/.claude/envoy/src/lib/paths.ts +130 -0
  49. package/.claude/envoy/src/lib/plan-io.ts +117 -0
  50. package/.claude/envoy/src/lib/prompts.ts +231 -0
  51. package/.claude/envoy/src/lib/protocols.ts +314 -0
  52. package/.claude/envoy/src/lib/repomix.ts +133 -0
  53. package/.claude/envoy/src/lib/retry.ts +138 -0
  54. package/.claude/envoy/src/lib/watcher.ts +167 -0
  55. package/.claude/envoy/tsconfig.json +21 -0
  56. package/.claude/hooks/scripts/scan_agents.py +62 -0
  57. package/.claude/hooks/scripts/scan_commands.py +50 -0
  58. package/.claude/hooks/scripts/scan_skills.py +46 -70
  59. package/.claude/hooks/scripts/validate_artifacts.py +128 -0
  60. package/.claude/hooks/startup.sh +26 -24
  61. package/.claude/protocols/bug-discovery.yaml +55 -0
  62. package/.claude/protocols/debugging.yaml +51 -0
  63. package/.claude/protocols/discovery.yaml +53 -0
  64. package/.claude/protocols/implementation.yaml +84 -0
  65. package/.claude/settings.json +37 -97
  66. package/.claude/skills/brainstorming/SKILL.md +54 -0
  67. package/.claude/skills/commands-development/SKILL.md +630 -0
  68. package/.claude/skills/commands-development/references/arguments.md +252 -0
  69. package/.claude/skills/commands-development/references/patterns.md +796 -0
  70. package/.claude/skills/commands-development/references/tool-restrictions.md +376 -0
  71. package/.claude/skills/discovery-mode/SKILL.md +108 -0
  72. package/.claude/skills/hooks-development/SKILL.md +332 -0
  73. package/.claude/skills/hooks-development/references/command-vs-prompt.md +269 -0
  74. package/.claude/skills/hooks-development/references/examples.md +658 -0
  75. package/.claude/skills/hooks-development/references/hook-types.md +463 -0
  76. package/.claude/skills/hooks-development/references/input-output-schemas.md +469 -0
  77. package/.claude/skills/hooks-development/references/matchers.md +470 -0
  78. package/.claude/skills/hooks-development/references/troubleshooting.md +587 -0
  79. package/.claude/skills/implementation-mode/SKILL.md +171 -0
  80. package/.claude/skills/research-tools/SKILL.md +35 -33
  81. package/.claude/skills/skills-development/SKILL.md +192 -0
  82. package/.claude/skills/skills-development/references/api-security.md +226 -0
  83. package/.claude/skills/skills-development/references/be-clear-and-direct.md +531 -0
  84. package/.claude/skills/skills-development/references/common-patterns.md +595 -0
  85. package/.claude/skills/skills-development/references/core-principles.md +437 -0
  86. package/.claude/skills/skills-development/references/executable-code.md +175 -0
  87. package/.claude/skills/skills-development/references/iteration-and-testing.md +474 -0
  88. package/.claude/skills/skills-development/references/recommended-structure.md +168 -0
  89. package/.claude/skills/skills-development/references/skill-structure.md +372 -0
  90. package/.claude/skills/skills-development/references/use-xml-tags.md +466 -0
  91. package/.claude/skills/skills-development/references/using-scripts.md +113 -0
  92. package/.claude/skills/skills-development/references/using-templates.md +112 -0
  93. package/.claude/skills/skills-development/references/workflows-and-validation.md +510 -0
  94. package/.claude/skills/skills-development/templates/router-skill.md +73 -0
  95. package/.claude/skills/skills-development/templates/simple-skill.md +33 -0
  96. package/.claude/skills/skills-development/workflows/add-reference.md +96 -0
  97. package/.claude/skills/skills-development/workflows/add-script.md +93 -0
  98. package/.claude/skills/skills-development/workflows/add-template.md +74 -0
  99. package/.claude/skills/skills-development/workflows/add-workflow.md +120 -0
  100. package/.claude/skills/skills-development/workflows/audit-skill.md +138 -0
  101. package/.claude/skills/skills-development/workflows/create-domain-expertise-skill.md +605 -0
  102. package/.claude/skills/skills-development/workflows/create-new-skill.md +191 -0
  103. package/.claude/skills/skills-development/workflows/get-guidance.md +121 -0
  104. package/.claude/skills/skills-development/workflows/upgrade-to-router.md +161 -0
  105. package/.claude/skills/skills-development/workflows/verify-skill.md +204 -0
  106. package/.claude/skills/subagents-development/SKILL.md +325 -0
  107. package/.claude/skills/subagents-development/references/context-management.md +567 -0
  108. package/.claude/skills/subagents-development/references/debugging-agents.md +714 -0
  109. package/.claude/skills/subagents-development/references/error-handling-and-recovery.md +502 -0
  110. package/.claude/skills/subagents-development/references/evaluation-and-testing.md +374 -0
  111. package/.claude/skills/subagents-development/references/orchestration-patterns.md +591 -0
  112. package/.claude/skills/subagents-development/references/subagents.md +508 -0
  113. package/.claude/skills/subagents-development/references/writing-subagent-prompts.md +517 -0
  114. package/.claude/statusline.sh +24 -0
  115. package/bin/cli.js +110 -72
  116. package/package.json +1 -1
  117. package/.claude/agents/explorer.md +0 -62
  118. package/.claude/agents/parallel-worker.md +0 -121
  119. package/.claude/commands/curation-fix.md +0 -92
  120. package/.claude/commands/new-branch.md +0 -36
  121. package/.claude/commands/parallel-discovery.md +0 -69
  122. package/.claude/commands/parallel-orchestration.md +0 -99
  123. package/.claude/commands/plan-checkpoint.md +0 -37
  124. package/.claude/envoy/commands/__init__.py +0 -1
  125. package/.claude/envoy/commands/base.py +0 -95
  126. package/.claude/envoy/commands/parallel.py +0 -439
  127. package/.claude/envoy/commands/perplexity.py +0 -86
  128. package/.claude/envoy/commands/plans.py +0 -451
  129. package/.claude/envoy/commands/tavily.py +0 -156
  130. package/.claude/envoy/commands/vertex.py +0 -358
  131. package/.claude/envoy/commands/xai.py +0 -124
  132. package/.claude/envoy/envoy.py +0 -122
  133. package/.claude/envoy/pyrightconfig.json +0 -4
  134. package/.claude/envoy/requirements.txt +0 -2
  135. package/.claude/hooks/capture-queries.sh +0 -3
  136. package/.claude/hooks/scripts/enforce_planning.py +0 -118
  137. package/.claude/hooks/scripts/enforce_rg.py +0 -34
  138. package/.claude/hooks/scripts/validate_skill.py +0 -81
  139. package/.claude/skills/claude-envoy-curation/SKILL.md +0 -162
  140. package/.claude/skills/claude-envoy-usage/SKILL.md +0 -46
  141. package/.claude/skills/command-development/SKILL.md +0 -206
  142. package/.claude/skills/command-development/examples/simple-commands.md +0 -212
  143. package/.claude/skills/command-development/references/frontmatter-reference.md +0 -221
  144. package/.claude/skills/hook-development/SKILL.md +0 -127
  145. package/.claude/skills/hook-development/examples/command-hooks.md +0 -301
  146. package/.claude/skills/hook-development/examples/prompt-hooks.md +0 -114
  147. package/.claude/skills/hook-development/references/event-reference.md +0 -226
  148. package/.claude/skills/repomix-extraction/SKILL.md +0 -91
  149. package/.claude/skills/skill-development/SKILL.md +0 -168
  150. package/.claude/skills/skill-development/examples/complete-skill-examples.md +0 -281
  151. package/.claude/skills/skill-development/references/progressive-disclosure.md +0 -141
  152. package/.claude/skills/skill-development/references/writing-style.md +0 -180
  153. package/.claude/skills/skill-development/scripts/validate-skill.sh +0 -144
  154. package/.claude/skills/specialist-builder/SKILL.md +0 -327
  155. package/.claude/skills/specialist-builder/docs/agent-catalog.md +0 -28
  156. package/.claude/skills/specialist-builder/examples/complete-agent-examples.md +0 -206
  157. package/.claude/skills/specialist-builder/references/system-prompt-patterns.md +0 -281
  158. package/.claude/skills/specialist-builder/references/triggering-examples.md +0 -162
  159. package/.claude/skills/specialist-builder/scripts/validate-agent.sh +0 -137
  160. /package/.claude/{envoy/claude-envoy.py → skills/claude-envoy-patterns/SKILL.md} +0 -0
@@ -0,0 +1,630 @@
1
+ ---
2
+ name: commands-development
3
+ description: Expert guidance for creating, refining, and auditing Claude Code slash commands. Use when working with slash commands, creating custom commands, understanding command structure, or learning YAML configuration.
4
+ ---
5
+
6
+ <objective>
7
+ Create effective slash commands for Claude Code that enable users to trigger reusable prompts with `/command-name` syntax. Slash commands expand as prompts in the current conversation, allowing teams to standardize workflows and operations. This skill teaches you to structure commands with XML tags, YAML frontmatter, dynamic context loading, and intelligent argument handling.
8
+ </objective>
9
+
10
+ <quick_start>
11
+
12
+ <workflow>
13
+ 1. Create `.claude/commands/` directory (project) or use `~/.claude/commands/` (personal)
14
+ 2. Create `command-name.md` file
15
+ 3. Add YAML frontmatter (at minimum: `description`)
16
+ 4. Write command prompt
17
+ 5. Test with `/command-name [args]`
18
+ </workflow>
19
+
20
+ <example>
21
+ **File**: `.claude/commands/optimize.md`
22
+
23
+ ```markdown
24
+ ---
25
+ description: Analyze this code for performance issues and suggest optimizations
26
+ ---
27
+
28
+ Analyze the performance of this code and suggest three specific optimizations:
29
+ ```
30
+
31
+ **Usage**: `/optimize`
32
+
33
+ Claude receives the expanded prompt and analyzes the code in context.
34
+ </example>
35
+ </quick_start>
36
+
37
+ <xml_structure>
38
+ All generated slash commands should use XML tags in the body (after YAML frontmatter) for clarity and consistency.
39
+
40
+ <required_tags>
41
+
42
+ **`<objective>`** - What the command does and why it matters
43
+ ```markdown
44
+ <objective>
45
+ What needs to happen and why this matters.
46
+ Context about who uses this and what it accomplishes.
47
+ </objective>
48
+ ```
49
+
50
+ **`<process>` or `<steps>`** - How to execute the command
51
+ ```markdown
52
+ <process>
53
+ Sequential steps to accomplish the objective:
54
+ 1. First step
55
+ 2. Second step
56
+ 3. Final step
57
+ </process>
58
+ ```
59
+
60
+ **`<success_criteria>`** - How to know the command succeeded
61
+ ```markdown
62
+ <success_criteria>
63
+ Clear, measurable criteria for successful completion.
64
+ </success_criteria>
65
+ ```
66
+ </required_tags>
67
+
68
+ <conditional_tags>
69
+
70
+ **`<context>`** - When loading dynamic state or files
71
+ ```markdown
72
+ <context>
73
+ Current state: ! `git status`
74
+ Relevant files: @ package.json
75
+ </context>
76
+ ```
77
+ (Note: Remove the space after @ in actual usage)
78
+
79
+ **`<verification>`** - When producing artifacts that need checking
80
+ ```markdown
81
+ <verification>
82
+ Before completing, verify:
83
+ - Specific test or check to perform
84
+ - How to confirm it works
85
+ </verification>
86
+ ```
87
+
88
+ **`<testing>`** - When running tests is part of the workflow
89
+ ```markdown
90
+ <testing>
91
+ Run tests: ! `npm test`
92
+ Check linting: ! `npm run lint`
93
+ </testing>
94
+ ```
95
+
96
+ **`<output>`** - When creating/modifying specific files
97
+ ```markdown
98
+ <output>
99
+ Files created/modified:
100
+ - `./path/to/file.ext` - Description
101
+ </output>
102
+ ```
103
+ </conditional_tags>
104
+
105
+ <structure_example>
106
+
107
+ ```markdown
108
+ ---
109
+ name: example-command
110
+ description: Does something useful
111
+ argument-hint: [input]
112
+ ---
113
+
114
+ <objective>
115
+ Process $ARGUMENTS to accomplish [goal].
116
+
117
+ This helps [who] achieve [outcome].
118
+ </objective>
119
+
120
+ <context>
121
+ Current state: ! `relevant command`
122
+ Files: @ relevant/files
123
+ </context>
124
+
125
+ <process>
126
+ 1. Parse $ARGUMENTS
127
+ 2. Execute operation
128
+ 3. Verify results
129
+ </process>
130
+
131
+ <success_criteria>
132
+ - Operation completed without errors
133
+ - Output matches expected format
134
+ </success_criteria>
135
+ ```
136
+ </structure_example>
137
+
138
+ <intelligence_rules>
139
+
140
+ **Simple commands** (single operation, no artifacts):
141
+ - Required: `<objective>`, `<process>`, `<success_criteria>`
142
+ - Example: `/check-todos`, `/first-principles`
143
+
144
+ **Complex commands** (multi-step, produces artifacts):
145
+ - Required: `<objective>`, `<process>`, `<success_criteria>`
146
+ - Add: `<context>` (if loading state), `<verification>` (if creating files), `<output>` (what gets created)
147
+ - Example: `/commit`, `/create-prompt`, `/run-prompt`
148
+
149
+ **Commands with dynamic arguments**:
150
+ - Use `$ARGUMENTS` in `<objective>` or `<process>` tags
151
+ - Include `argument-hint` in frontmatter
152
+ - Make it clear what the arguments are for
153
+
154
+ **Commands that produce files**:
155
+ - Always include `<output>` tag specifying what gets created
156
+ - Always include `<verification>` tag with checks to perform
157
+
158
+ **Commands that run tests/builds**:
159
+ - Include `<testing>` tag with specific commands
160
+ - Include pass/fail criteria in `<success_criteria>`
161
+ </intelligence_rules>
162
+ </xml_structure>
163
+
164
+ <arguments_intelligence>
165
+ The skill should intelligently determine whether a slash command needs arguments.
166
+
167
+ <commands_that_need_arguments>
168
+
169
+ **User provides specific input:**
170
+ - `/fix-issue [issue-number]` - Needs issue number
171
+ - `/review-pr [pr-number]` - Needs PR number
172
+ - `/optimize [file-path]` - Needs file to optimize
173
+ - `/commit [type]` - Needs commit type (optional)
174
+
175
+ **Pattern:** Task operates on user-specified data
176
+
177
+ Include `argument-hint: [description]` in frontmatter and reference `$ARGUMENTS` in the body.
178
+ </commands_that_need_arguments>
179
+
180
+ <commands_without_arguments>
181
+
182
+ **Self-contained procedures:**
183
+ - `/check-todos` - Operates on known file (TO-DOS.md)
184
+ - `/first-principles` - Operates on current conversation
185
+ - `/whats-next` - Analyzes current context
186
+
187
+ **Pattern:** Task operates on implicit context (current conversation, known files, project state)
188
+
189
+ Omit `argument-hint` and don't reference `$ARGUMENTS`.
190
+ </commands_without_arguments>
191
+
192
+ <incorporating_arguments>
193
+
194
+ **In `<objective>` tag:**
195
+ ```markdown
196
+ <objective>
197
+ Fix issue #$ARGUMENTS following project conventions.
198
+
199
+ This ensures bugs are resolved systematically with proper testing.
200
+ </objective>
201
+ ```
202
+
203
+ **In `<process>` tag:**
204
+ ```markdown
205
+ <process>
206
+ 1. Understand issue #$ARGUMENTS from issue tracker
207
+ 2. Locate relevant code
208
+ 3. Implement fix
209
+ 4. Add tests
210
+ </process>
211
+ ```
212
+
213
+ **In `<context>` tag:**
214
+ ```markdown
215
+ <context>
216
+ Issue details: @ issues/$ARGUMENTS.md
217
+ Related files: ! `grep -r "TODO.*$ARGUMENTS" src/`
218
+ </context>
219
+ ```
220
+ (Note: Remove the space after the exclamation mark in actual usage)
221
+ </incorporating_arguments>
222
+
223
+ <positional_arguments>
224
+
225
+ For structured input, use `$1`, `$2`, `$3`:
226
+
227
+ ```markdown
228
+ ---
229
+ argument-hint: <pr-number> <priority> <assignee>
230
+ ---
231
+
232
+ <objective>
233
+ Review PR #$1 with priority $2 and assign to $3.
234
+ </objective>
235
+ ```
236
+
237
+ **Usage:** `/review-pr 456 high alice`
238
+ </positional_arguments>
239
+ </arguments_intelligence>
240
+
241
+ <file_structure>
242
+
243
+ **Project commands**: `.claude/commands/`
244
+ - Shared with team via version control
245
+ - Shows `(project)` in `/help` list
246
+
247
+ **Personal commands**: `~/.claude/commands/`
248
+ - Available across all your projects
249
+ - Shows `(user)` in `/help` list
250
+
251
+ **File naming**: `command-name.md` → invoked as `/command-name`
252
+ </file_structure>
253
+
254
+ <yaml_frontmatter>
255
+
256
+ <field name="description">
257
+ **Required** - Describes what the command does
258
+
259
+ ```yaml
260
+ description: Analyze this code for performance issues and suggest optimizations
261
+ ```
262
+
263
+ Shown in the `/help` command list.
264
+ </field>
265
+
266
+ <field name="allowed-tools">
267
+ **Optional** - Restricts which tools Claude can use
268
+
269
+ ```yaml
270
+ allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
271
+ ```
272
+
273
+ **Formats**:
274
+ - Array: `allowed-tools: [Read, Edit, Write]`
275
+ - Single tool: `allowed-tools: SequentialThinking`
276
+ - Bash restrictions: `allowed-tools: Bash(git add:*)`
277
+
278
+ If omitted: All tools available
279
+ </field>
280
+ </yaml_frontmatter>
281
+
282
+ <arguments>
283
+ <all_arguments_string>
284
+
285
+ **Command file**: `.claude/commands/fix-issue.md`
286
+ ```markdown
287
+ ---
288
+ description: Fix issue following coding standards
289
+ ---
290
+
291
+ Fix issue #$ARGUMENTS following our coding standards
292
+ ```
293
+
294
+ **Usage**: `/fix-issue 123 high-priority`
295
+
296
+ **Claude receives**: "Fix issue #123 high-priority following our coding standards"
297
+ </all_arguments_string>
298
+
299
+ <positional_arguments_syntax>
300
+
301
+ **Command file**: `.claude/commands/review-pr.md`
302
+ ```markdown
303
+ ---
304
+ description: Review PR with priority and assignee
305
+ ---
306
+
307
+ Review PR #$1 with priority $2 and assign to $3
308
+ ```
309
+
310
+ **Usage**: `/review-pr 456 high alice`
311
+
312
+ **Claude receives**: "Review PR #456 with priority high and assign to alice"
313
+
314
+ See [references/arguments.md](references/arguments.md) for advanced patterns.
315
+ </positional_arguments_syntax>
316
+ </arguments>
317
+
318
+ <dynamic_context>
319
+
320
+ Execute bash commands before the prompt using the exclamation mark prefix directly before backticks (no space between).
321
+
322
+ **Note:** Examples below show a space after the exclamation mark to prevent execution during skill loading. In actual slash commands, remove the space.
323
+
324
+ Example:
325
+
326
+ ```markdown
327
+ ---
328
+ description: Create a git commit
329
+ allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
330
+ ---
331
+
332
+ ## Context
333
+
334
+ - Current git status: ! `git status`
335
+ - Current git diff: ! `git diff HEAD`
336
+ - Current branch: ! `git branch --show-current`
337
+ - Recent commits: ! `git log --oneline -10`
338
+
339
+ ## Your task
340
+
341
+ Based on the above changes, create a single git commit.
342
+ ```
343
+
344
+ The bash commands execute and their output is included in the expanded prompt.
345
+ </dynamic_context>
346
+
347
+ <file_references>
348
+
349
+ Use `@` prefix to reference specific files:
350
+
351
+ ```markdown
352
+ ---
353
+ description: Review implementation
354
+ ---
355
+
356
+ Review the implementation in @ src/utils/helpers.js
357
+ ```
358
+ (Note: Remove the space after @ in actual usage)
359
+
360
+ Claude can access the referenced file's contents.
361
+ </file_references>
362
+
363
+ <best_practices>
364
+
365
+ **1. Always use XML structure**
366
+ ```yaml
367
+ # All slash commands should have XML-structured bodies
368
+ ```
369
+
370
+ After frontmatter, use XML tags:
371
+ - `<objective>` - What and why (always)
372
+ - `<process>` - How to do it (always)
373
+ - `<success_criteria>` - Definition of done (always)
374
+ - Additional tags as needed (see xml_structure section)
375
+
376
+ **2. Clear descriptions**
377
+ ```yaml
378
+ # Good
379
+ description: Analyze this code for performance issues and suggest optimizations
380
+
381
+ # Bad
382
+ description: Optimize stuff
383
+ ```
384
+
385
+ **3. Use dynamic context for state-dependent tasks**
386
+ ```markdown
387
+ Current git status: ! `git status`
388
+ Files changed: ! `git diff --name-only`
389
+ ```
390
+
391
+ **4. Restrict tools when appropriate**
392
+ ```yaml
393
+ # For git commands - prevent running arbitrary bash
394
+ allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
395
+
396
+ # For analysis - thinking only
397
+ allowed-tools: SequentialThinking
398
+ ```
399
+
400
+ **5. Use $ARGUMENTS for flexibility**
401
+ ```markdown
402
+ Find and fix issue #$ARGUMENTS
403
+ ```
404
+
405
+ **6. Reference relevant files**
406
+ ```markdown
407
+ Review @ package.json for dependencies
408
+ Analyze @ src/database/* for schema
409
+ ```
410
+ (Note: Remove the space after @ in actual usage)
411
+ </best_practices>
412
+
413
+ <common_patterns>
414
+
415
+ **Simple analysis command**:
416
+ ```markdown
417
+ ---
418
+ description: Review this code for security vulnerabilities
419
+ ---
420
+
421
+ <objective>
422
+ Review code for security vulnerabilities and suggest fixes.
423
+ </objective>
424
+
425
+ <process>
426
+ 1. Scan code for common vulnerabilities (XSS, SQL injection, etc.)
427
+ 2. Identify specific issues with line numbers
428
+ 3. Suggest remediation for each issue
429
+ </process>
430
+
431
+ <success_criteria>
432
+ - All major vulnerability types checked
433
+ - Specific issues identified with locations
434
+ - Actionable fixes provided
435
+ </success_criteria>
436
+ ```
437
+
438
+ **Git workflow with context**:
439
+ ```markdown
440
+ ---
441
+ description: Create a git commit
442
+ allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
443
+ ---
444
+
445
+ <objective>
446
+ Create a git commit for current changes following repository conventions.
447
+ </objective>
448
+
449
+ <context>
450
+ - Current status: ! `git status`
451
+ - Changes: ! `git diff HEAD`
452
+ - Recent commits: ! `git log --oneline -5`
453
+ </context>
454
+
455
+ <process>
456
+ 1. Review staged and unstaged changes
457
+ 2. Stage relevant files
458
+ 3. Write commit message following recent commit style
459
+ 4. Create commit
460
+ </process>
461
+
462
+ <success_criteria>
463
+ - All relevant changes staged
464
+ - Commit message follows repository conventions
465
+ - Commit created successfully
466
+ </success_criteria>
467
+ ```
468
+
469
+ **Parameterized command**:
470
+ ```markdown
471
+ ---
472
+ description: Fix issue following coding standards
473
+ argument-hint: [issue-number]
474
+ ---
475
+
476
+ <objective>
477
+ Fix issue #$ARGUMENTS following project coding standards.
478
+
479
+ This ensures bugs are resolved systematically with proper testing.
480
+ </objective>
481
+
482
+ <process>
483
+ 1. Understand the issue described in ticket #$ARGUMENTS
484
+ 2. Locate the relevant code in codebase
485
+ 3. Implement a solution that addresses root cause
486
+ 4. Add appropriate tests
487
+ 5. Verify fix resolves the issue
488
+ </process>
489
+
490
+ <success_criteria>
491
+ - Issue fully understood and addressed
492
+ - Solution follows coding standards
493
+ - Tests added and passing
494
+ - No regressions introduced
495
+ </success_criteria>
496
+ ```
497
+
498
+ **File-specific command**:
499
+ ```markdown
500
+ ---
501
+ description: Optimize code performance
502
+ argument-hint: [file-path]
503
+ ---
504
+
505
+ <objective>
506
+ Analyze performance of @ $ARGUMENTS and suggest specific optimizations.
507
+
508
+ This helps improve application performance through targeted improvements.
509
+ </objective>
510
+
511
+ <process>
512
+ 1. Review code in @ $ARGUMENTS for performance issues
513
+ 2. Identify bottlenecks and inefficiencies
514
+ 3. Suggest three specific optimizations with rationale
515
+ 4. Estimate performance impact of each
516
+ </process>
517
+
518
+ <success_criteria>
519
+ - Performance issues clearly identified
520
+ - Three concrete optimizations suggested
521
+ - Implementation guidance provided
522
+ - Performance impact estimated
523
+ </success_criteria>
524
+ ```
525
+
526
+ **Usage**: `/optimize src/utils/helpers.js`
527
+
528
+ See [references/patterns.md](references/patterns.md) for more examples.
529
+ </common_patterns>
530
+
531
+ <reference_guides>
532
+
533
+ **Arguments reference**: [references/arguments.md](references/arguments.md)
534
+ - $ARGUMENTS variable
535
+ - Positional arguments ($1, $2, $3)
536
+ - Parsing strategies
537
+ - Examples from official docs
538
+
539
+ **Patterns reference**: [references/patterns.md](references/patterns.md)
540
+ - Git workflows
541
+ - Code analysis
542
+ - File operations
543
+ - Security reviews
544
+ - Examples from official docs
545
+
546
+ **Tool restrictions**: [references/tool-restrictions.md](references/tool-restrictions.md)
547
+ - Bash command patterns
548
+ - Security best practices
549
+ - When to restrict tools
550
+ - Examples from official docs
551
+ </reference_guides>
552
+
553
+ <generation_protocol>
554
+
555
+ 1. **Analyze the user's request**:
556
+ - What is the command's purpose?
557
+ - Does it need user input ($ARGUMENTS)?
558
+ - Does it produce files or artifacts?
559
+ - Does it require verification or testing?
560
+ - Is it simple (single-step) or complex (multi-step)?
561
+
562
+ 2. **Create frontmatter**:
563
+ ```yaml
564
+ ---
565
+ name: command-name
566
+ description: Clear description of what it does
567
+ argument-hint: [input] # Only if arguments needed
568
+ allowed-tools: [...] # Only if tool restrictions needed
569
+ ---
570
+ ```
571
+
572
+ 3. **Create XML-structured body**:
573
+
574
+ **Always include:**
575
+ - `<objective>` - What and why
576
+ - `<process>` - How to do it (numbered steps)
577
+ - `<success_criteria>` - Definition of done
578
+
579
+ **Include when relevant:**
580
+ - `<context>` - Dynamic state (! `commands`) or file references (@ files)
581
+ - `<verification>` - Checks to perform if creating artifacts
582
+ - `<testing>` - Test commands if tests are part of workflow
583
+ - `<output>` - Files created/modified
584
+
585
+ 4. **Integrate $ARGUMENTS properly**:
586
+ - If user input needed: Add `argument-hint` and use `$ARGUMENTS` in tags
587
+ - If self-contained: Omit `argument-hint` and `$ARGUMENTS`
588
+
589
+ 5. **Apply intelligence**:
590
+ - Simple commands: Keep it concise (objective + process + success criteria)
591
+ - Complex commands: Add context, verification, testing as needed
592
+ - Don't over-engineer simple commands
593
+ - Don't under-specify complex commands
594
+
595
+ 6. **Save the file**:
596
+ - Project: `.claude/commands/command-name.md`
597
+ - Personal: `~/.claude/commands/command-name.md`
598
+ </generation_protocol>
599
+
600
+ <success_criteria>
601
+ A well-structured slash command meets these criteria:
602
+
603
+ **YAML Frontmatter**:
604
+ - `description` field is clear and concise
605
+ - `argument-hint` present if command accepts arguments
606
+ - `allowed-tools` specified if tool restrictions needed
607
+
608
+ **XML Structure**:
609
+ - All three required tags present: `<objective>`, `<process>`, `<success_criteria>`
610
+ - Conditional tags used appropriately based on complexity
611
+ - No raw markdown headings in body
612
+ - All XML tags properly closed
613
+
614
+ **Arguments Handling**:
615
+ - `$ARGUMENTS` used when command operates on user-specified data
616
+ - Positional arguments (`$1`, `$2`, etc.) used when structured input needed
617
+ - No `$ARGUMENTS` reference for self-contained commands
618
+
619
+ **Functionality**:
620
+ - Command expands correctly when invoked
621
+ - Dynamic context loads properly (bash commands, file references)
622
+ - Tool restrictions prevent unauthorized operations
623
+ - Command accomplishes intended purpose reliably
624
+
625
+ **Quality**:
626
+ - Clear, actionable instructions in `<process>` tag
627
+ - Measurable completion criteria in `<success_criteria>`
628
+ - Appropriate level of detail (not over-engineered for simple tasks)
629
+ - Examples provided when beneficial
630
+ </success_criteria>