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,796 @@
1
+ # Command Patterns Reference
2
+
3
+ Verified patterns from official Claude Code documentation.
4
+
5
+ ## Git Workflow Patterns
6
+
7
+ ### Pattern: Commit with Full Context
8
+
9
+ **Source**: Official Claude Code documentation
10
+
11
+ ```markdown
12
+ ---
13
+ allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
14
+ description: Create a git commit
15
+ ---
16
+
17
+ <objective>
18
+ Create a git commit for current changes following repository conventions.
19
+ </objective>
20
+
21
+ <context>
22
+ - Current git status: ! `git status`
23
+ - Current git diff (staged and unstaged changes): ! `git diff HEAD`
24
+ - Current branch: ! `git branch --show-current`
25
+ - Recent commits: ! `git log --oneline -10`
26
+ </context>
27
+
28
+ <process>
29
+ 1. Review staged and unstaged changes
30
+ 2. Stage relevant files with git add
31
+ 3. Write commit message following recent commit style
32
+ 4. Create commit
33
+ </process>
34
+
35
+ <success_criteria>
36
+ - All relevant changes staged
37
+ - Commit message follows repository conventions
38
+ - Commit created successfully
39
+ </success_criteria>
40
+ ```
41
+
42
+ **Key features**:
43
+ - Tool restrictions prevent running arbitrary bash commands
44
+ - Dynamic context loaded via the exclamation mark prefix before backticks
45
+ - Git state injected before prompt execution
46
+
47
+ ### Pattern: Simple Git Commit
48
+
49
+ ```markdown
50
+ ---
51
+ allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
52
+ description: Create a git commit
53
+ ---
54
+
55
+ <objective>
56
+ Create a commit for current changes.
57
+ </objective>
58
+
59
+ <context>
60
+ Current changes: ! `git status`
61
+ </context>
62
+
63
+ <process>
64
+ 1. Review changes
65
+ 2. Stage files
66
+ 3. Create commit
67
+ </process>
68
+
69
+ <success_criteria>
70
+ - Changes committed successfully
71
+ </success_criteria>
72
+ ```
73
+
74
+ ## Code Analysis Patterns
75
+
76
+ ### Pattern: Performance Optimization
77
+
78
+ **Source**: Official Claude Code documentation
79
+
80
+ **File**: `.claude/commands/optimize.md`
81
+ ```markdown
82
+ ---
83
+ description: Analyze the performance of this code and suggest three specific optimizations
84
+ ---
85
+
86
+ <objective>
87
+ Analyze code performance and suggest three specific optimizations.
88
+
89
+ This helps improve application performance through targeted improvements.
90
+ </objective>
91
+
92
+ <process>
93
+ 1. Review code in current conversation context
94
+ 2. Identify bottlenecks and inefficiencies
95
+ 3. Suggest three specific optimizations with rationale
96
+ 4. Estimate performance impact of each
97
+ </process>
98
+
99
+ <success_criteria>
100
+ - Performance issues clearly identified
101
+ - Three concrete optimizations suggested
102
+ - Implementation guidance provided
103
+ - Performance impact estimated
104
+ </success_criteria>
105
+ ```
106
+
107
+ **Usage**: `/optimize`
108
+
109
+ Claude analyzes code in the current conversation context.
110
+
111
+ ### Pattern: Security Review
112
+
113
+ **File**: `.claude/commands/security-review.md`
114
+ ```markdown
115
+ ---
116
+ description: Review this code for security vulnerabilities
117
+ ---
118
+
119
+ <objective>
120
+ Review code for security vulnerabilities and suggest fixes.
121
+ </objective>
122
+
123
+ <process>
124
+ 1. Scan code for common vulnerabilities (XSS, SQL injection, CSRF, etc.)
125
+ 2. Identify specific issues with line numbers
126
+ 3. Assess severity of each vulnerability
127
+ 4. Suggest remediation for each issue
128
+ </process>
129
+
130
+ <success_criteria>
131
+ - All major vulnerability types checked
132
+ - Specific issues identified with locations
133
+ - Severity levels assigned
134
+ - Actionable fixes provided
135
+ </success_criteria>
136
+ ```
137
+
138
+ **Usage**: `/security-review`
139
+
140
+ ### Pattern: File-Specific Analysis
141
+
142
+ ```markdown
143
+ ---
144
+ description: Optimize specific file
145
+ argument-hint: [file-path]
146
+ ---
147
+
148
+ <objective>
149
+ Analyze performance of @ $ARGUMENTS and suggest three specific optimizations.
150
+
151
+ This helps improve application performance through targeted file improvements.
152
+ </objective>
153
+
154
+ <process>
155
+ 1. Review code in @ $ARGUMENTS for performance issues
156
+ 2. Identify bottlenecks and inefficiencies
157
+ 3. Suggest three specific optimizations with rationale
158
+ 4. Estimate performance impact of each
159
+ </process>
160
+
161
+ <success_criteria>
162
+ - File analyzed thoroughly
163
+ - Performance issues identified
164
+ - Three concrete optimizations suggested
165
+ - Implementation guidance provided
166
+ </success_criteria>
167
+ ```
168
+
169
+ **Usage**: `/optimize src/utils/helpers.js`
170
+
171
+ References the specified file.
172
+
173
+ ## Issue Tracking Patterns
174
+
175
+ ### Pattern: Fix Issue with Workflow
176
+
177
+ **Source**: Official Claude Code documentation
178
+
179
+ ```markdown
180
+ ---
181
+ description: Find and fix issue following workflow
182
+ argument-hint: [issue-number]
183
+ ---
184
+
185
+ <objective>
186
+ Find and fix issue #$ARGUMENTS following project workflow.
187
+
188
+ This ensures bugs are resolved systematically with proper testing and documentation.
189
+ </objective>
190
+
191
+ <process>
192
+ 1. Understand the issue described in ticket #$ARGUMENTS
193
+ 2. Locate the relevant code in codebase
194
+ 3. Implement a solution that addresses the root cause
195
+ 4. Add appropriate tests
196
+ 5. Prepare a concise PR description
197
+ </process>
198
+
199
+ <success_criteria>
200
+ - Issue fully understood and addressed
201
+ - Solution addresses root cause
202
+ - Tests added and passing
203
+ - PR description clearly explains fix
204
+ </success_criteria>
205
+ ```
206
+
207
+ **Usage**: `/fix-issue 123`
208
+
209
+ ### Pattern: PR Review with Context
210
+
211
+ ```markdown
212
+ ---
213
+ description: Review PR with priority and assignment
214
+ argument-hint: <pr-number> <priority> <assignee>
215
+ ---
216
+
217
+ <objective>
218
+ Review PR #$1 with priority $2 and assign to $3.
219
+
220
+ This ensures PRs are reviewed systematically with proper prioritization and assignment.
221
+ </objective>
222
+
223
+ <process>
224
+ 1. Fetch PR #$1 details
225
+ 2. Review code changes
226
+ 3. Assess based on priority $2
227
+ 4. Provide feedback
228
+ 5. Assign to $3
229
+ </process>
230
+
231
+ <success_criteria>
232
+ - PR reviewed thoroughly
233
+ - Priority considered in review depth
234
+ - Constructive feedback provided
235
+ - Assigned to correct person
236
+ </success_criteria>
237
+ ```
238
+
239
+ **Usage**: `/review-pr 456 high alice`
240
+
241
+ Uses positional arguments for structured input.
242
+
243
+ ## File Operation Patterns
244
+
245
+ ### Pattern: File Reference
246
+
247
+ **Source**: Official Claude Code documentation
248
+
249
+ ```markdown
250
+ ---
251
+ description: Review implementation
252
+ ---
253
+
254
+ <objective>
255
+ Review the implementation in @ src/utils/helpers.js.
256
+
257
+ This ensures code quality and identifies potential improvements.
258
+ </objective>
259
+
260
+ <process>
261
+ 1. Read @ src/utils/helpers.js
262
+ 2. Analyze code structure and patterns
263
+ 3. Check for best practices
264
+ 4. Identify potential improvements
265
+ 5. Suggest specific changes
266
+ </process>
267
+
268
+ <success_criteria>
269
+ - File reviewed thoroughly
270
+ - Code quality assessed
271
+ - Specific improvements identified
272
+ - Actionable suggestions provided
273
+ </success_criteria>
274
+ ```
275
+
276
+ Uses `@` prefix to reference specific files.
277
+
278
+ ### Pattern: Dynamic File Reference
279
+
280
+ ```markdown
281
+ ---
282
+ description: Review specific file
283
+ argument-hint: [file-path]
284
+ ---
285
+
286
+ <objective>
287
+ Review the implementation in @ $ARGUMENTS.
288
+
289
+ This allows flexible file review based on user specification.
290
+ </objective>
291
+
292
+ <process>
293
+ 1. Read @ $ARGUMENTS
294
+ 2. Analyze code structure and patterns
295
+ 3. Check for best practices
296
+ 4. Identify potential improvements
297
+ 5. Suggest specific changes
298
+ </process>
299
+
300
+ <success_criteria>
301
+ - File reviewed thoroughly
302
+ - Code quality assessed
303
+ - Specific improvements identified
304
+ - Actionable suggestions provided
305
+ </success_criteria>
306
+ ```
307
+
308
+ **Usage**: `/review src/app.js`
309
+
310
+ File path comes from argument.
311
+
312
+ ### Pattern: Multi-File Analysis
313
+
314
+ ```markdown
315
+ ---
316
+ description: Compare two files
317
+ argument-hint: <file1> <file2>
318
+ ---
319
+
320
+ <objective>
321
+ Compare @ $1 with @ $2 and highlight key differences.
322
+
323
+ This helps understand changes and identify important variations between files.
324
+ </objective>
325
+
326
+ <process>
327
+ 1. Read @ $1 and @ $2
328
+ 2. Identify structural differences
329
+ 3. Compare functionality and logic
330
+ 4. Highlight key changes
331
+ 5. Assess impact of differences
332
+ </process>
333
+
334
+ <success_criteria>
335
+ - Both files analyzed
336
+ - Key differences identified
337
+ - Impact of changes assessed
338
+ - Clear comparison provided
339
+ </success_criteria>
340
+ ```
341
+
342
+ **Usage**: `/compare src/old.js src/new.js`
343
+
344
+ ## Thinking-Only Patterns
345
+
346
+ ### Pattern: Deep Analysis
347
+
348
+ ```markdown
349
+ ---
350
+ description: Analyze problem from first principles
351
+ allowed-tools: SequentialThinking
352
+ ---
353
+
354
+ <objective>
355
+ Analyze the current problem from first principles.
356
+
357
+ This helps discover optimal solutions by stripping away assumptions and rebuilding from fundamental truths.
358
+ </objective>
359
+
360
+ <process>
361
+ 1. Identify the core problem
362
+ 2. Strip away all assumptions
363
+ 3. Identify fundamental truths and constraints
364
+ 4. Rebuild solution from first principles
365
+ 5. Compare with current approach
366
+ </process>
367
+
368
+ <success_criteria>
369
+ - Problem analyzed from ground up
370
+ - Assumptions identified and questioned
371
+ - Solution rebuilt from fundamentals
372
+ - Novel insights discovered
373
+ </success_criteria>
374
+ ```
375
+
376
+ Tool restriction ensures Claude only uses SequentialThinking.
377
+
378
+ ### Pattern: Strategic Planning
379
+
380
+ ```markdown
381
+ ---
382
+ description: Plan implementation strategy
383
+ allowed-tools: SequentialThinking
384
+ argument-hint: [task description]
385
+ ---
386
+
387
+ <objective>
388
+ Create a detailed implementation strategy for: $ARGUMENTS
389
+
390
+ This ensures complex tasks are approached systematically with proper planning.
391
+ </objective>
392
+
393
+ <process>
394
+ 1. Break down task into phases
395
+ 2. Identify dependencies between phases
396
+ 3. Estimate complexity for each phase
397
+ 4. Suggest optimal approach
398
+ 5. Identify potential risks
399
+ </process>
400
+
401
+ <success_criteria>
402
+ - Task broken into clear phases
403
+ - Dependencies mapped
404
+ - Complexity estimated
405
+ - Optimal approach identified
406
+ - Risks and mitigations outlined
407
+ </success_criteria>
408
+ ```
409
+
410
+ ## Bash Execution Patterns
411
+
412
+ ### Pattern: Dynamic Environment Loading
413
+
414
+ ```markdown
415
+ ---
416
+ description: Check project status
417
+ ---
418
+
419
+ <objective>
420
+ Provide a comprehensive project health summary.
421
+
422
+ This helps understand current project state across git, dependencies, and tests.
423
+ </objective>
424
+
425
+ <context>
426
+ - Git: ! `git status --short`
427
+ - Node: ! `npm list --depth=0 2>/dev/null | head -20`
428
+ - Tests: ! `npm test -- --listTests 2>/dev/null | wc -l`
429
+ </context>
430
+
431
+ <process>
432
+ 1. Analyze git status for uncommitted changes
433
+ 2. Review npm dependencies for issues
434
+ 3. Check test coverage
435
+ 4. Identify potential problems
436
+ 5. Provide actionable recommendations
437
+ </process>
438
+
439
+ <success_criteria>
440
+ - All metrics checked
441
+ - Current state clearly described
442
+ - Issues identified
443
+ - Recommendations provided
444
+ </success_criteria>
445
+ ```
446
+
447
+ Multiple bash commands load environment state.
448
+
449
+ ### Pattern: Conditional Execution
450
+
451
+ ```markdown
452
+ ---
453
+ description: Deploy if tests pass
454
+ allowed-tools: Bash(npm test:*), Bash(npm run deploy:*)
455
+ ---
456
+
457
+ <objective>
458
+ Deploy to production only if all tests pass.
459
+
460
+ This ensures deployment safety through automated testing gates.
461
+ </objective>
462
+
463
+ <context>
464
+ Test results: ! `npm test`
465
+ </context>
466
+
467
+ <process>
468
+ 1. Review test results
469
+ 2. If all tests passed, proceed to deployment
470
+ 3. If any tests failed, report failures and abort
471
+ 4. Monitor deployment process
472
+ 5. Confirm successful deployment
473
+ </process>
474
+
475
+ <success_criteria>
476
+ - All tests verified passing
477
+ - Deployment executed only on test success
478
+ - Deployment confirmed successful
479
+ - Or deployment aborted with clear failure reasons
480
+ </success_criteria>
481
+ ```
482
+
483
+ ## Multi-Step Workflow Patterns
484
+
485
+ ### Pattern: Structured Workflow
486
+
487
+ ```markdown
488
+ ---
489
+ description: Complete feature development workflow
490
+ argument-hint: [feature description]
491
+ ---
492
+
493
+ <objective>
494
+ Complete full feature development workflow for: $ARGUMENTS
495
+
496
+ This ensures features are developed systematically with proper planning, implementation, testing, and documentation.
497
+ </objective>
498
+
499
+ <process>
500
+ 1. **Planning**
501
+ - Review requirements
502
+ - Design approach
503
+ - Identify files to modify
504
+
505
+ 2. **Implementation**
506
+ - Write code
507
+ - Add tests
508
+ - Update documentation
509
+
510
+ 3. **Review**
511
+ - Run tests: ! `npm test`
512
+ - Check lint: ! `npm run lint`
513
+ - Verify changes: ! `git diff`
514
+
515
+ 4. **Completion**
516
+ - Create commit
517
+ - Write PR description
518
+ </process>
519
+
520
+ <testing>
521
+ - Run tests: ! `npm test`
522
+ - Check lint: ! `npm run lint`
523
+ </testing>
524
+
525
+ <verification>
526
+ Before completing:
527
+ - All tests passing
528
+ - No lint errors
529
+ - Documentation updated
530
+ - Changes verified with git diff
531
+ </verification>
532
+
533
+ <success_criteria>
534
+ - Feature fully implemented
535
+ - Tests added and passing
536
+ - Code passes linting
537
+ - Documentation updated
538
+ - Commit created
539
+ - PR description written
540
+ </success_criteria>
541
+ ```
542
+
543
+ ## Command Chaining Patterns
544
+
545
+ ### Pattern: Analysis → Action
546
+
547
+ ```markdown
548
+ ---
549
+ description: Analyze and fix performance issues
550
+ argument-hint: [file-path]
551
+ ---
552
+
553
+ <objective>
554
+ Analyze and fix performance issues in @ $ARGUMENTS.
555
+
556
+ This provides end-to-end performance improvement from analysis through verification.
557
+ </objective>
558
+
559
+ <process>
560
+ 1. Analyze @ $ARGUMENTS for performance issues
561
+ 2. Identify top 3 most impactful optimizations
562
+ 3. Implement the optimizations
563
+ 4. Verify improvements with benchmarks
564
+ </process>
565
+
566
+ <verification>
567
+ Before completing:
568
+ - Benchmarks run showing performance improvement
569
+ - No functionality regressions
570
+ - Code quality maintained
571
+ </verification>
572
+
573
+ <success_criteria>
574
+ - Performance issues identified and fixed
575
+ - Measurable performance improvement
576
+ - Benchmarks confirm gains
577
+ - No regressions introduced
578
+ </success_criteria>
579
+ ```
580
+
581
+ Sequential steps in single command.
582
+
583
+ ## Tool Restriction Patterns
584
+
585
+ ### Pattern: Git-Only Command
586
+
587
+ ```markdown
588
+ ---
589
+ allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git diff:*), Bash(git commit:*)
590
+ description: Git workflow command
591
+ ---
592
+
593
+ <objective>
594
+ Perform git operations safely with tool restrictions.
595
+
596
+ This prevents running arbitrary bash commands while allowing necessary git operations.
597
+ </objective>
598
+
599
+ <context>
600
+ Current git state: ! `git status`
601
+ </context>
602
+
603
+ <process>
604
+ 1. Review git status
605
+ 2. Perform git operations
606
+ 3. Verify changes
607
+ </process>
608
+
609
+ <success_criteria>
610
+ - Git operations completed successfully
611
+ - No arbitrary commands executed
612
+ - Repository state as expected
613
+ </success_criteria>
614
+ ```
615
+
616
+ Prevents running non-git bash commands.
617
+
618
+ ### Pattern: Read-Only Analysis
619
+
620
+ ```markdown
621
+ ---
622
+ allowed-tools: [Read, Grep, Glob]
623
+ description: Analyze codebase
624
+ argument-hint: [search pattern]
625
+ ---
626
+
627
+ <objective>
628
+ Search codebase for pattern: $ARGUMENTS
629
+
630
+ This provides safe codebase analysis without modification or execution permissions.
631
+ </objective>
632
+
633
+ <process>
634
+ 1. Use Grep to search for pattern across codebase
635
+ 2. Analyze findings
636
+ 3. Identify relevant files and code sections
637
+ 4. Provide summary of results
638
+ </process>
639
+
640
+ <success_criteria>
641
+ - Pattern search completed
642
+ - All matches identified
643
+ - Relevant context provided
644
+ - No files modified
645
+ </success_criteria>
646
+ ```
647
+
648
+ No write or execution permissions.
649
+
650
+ ### Pattern: Specific Bash Commands
651
+
652
+ ```markdown
653
+ ---
654
+ allowed-tools: Bash(npm test:*), Bash(npm run lint:*)
655
+ description: Run project checks
656
+ ---
657
+
658
+ <objective>
659
+ Run project quality checks (tests and linting).
660
+
661
+ This ensures code quality while restricting to specific npm scripts.
662
+ </objective>
663
+
664
+ <testing>
665
+ Tests: ! `npm test`
666
+ Lint: ! `npm run lint`
667
+ </testing>
668
+
669
+ <process>
670
+ 1. Run tests and capture results
671
+ 2. Run linting and capture results
672
+ 3. Analyze both outputs
673
+ 4. Report on pass/fail status
674
+ 5. Provide specific failure details if any
675
+ </process>
676
+
677
+ <success_criteria>
678
+ - All tests passing
679
+ - No lint errors
680
+ - Clear report of results
681
+ - Or specific failures identified with details
682
+ </success_criteria>
683
+ ```
684
+
685
+ Only allows specific npm scripts.
686
+
687
+ ## Best Practices
688
+
689
+ ### 1. Use Tool Restrictions for Safety
690
+
691
+ ```yaml
692
+ # Git commands
693
+ allowed-tools: Bash(git add:*), Bash(git status:*)
694
+
695
+ # Analysis only
696
+ allowed-tools: [Read, Grep, Glob]
697
+
698
+ # Thinking only
699
+ allowed-tools: SequentialThinking
700
+ ```
701
+
702
+ ### 2. Load Dynamic Context When Needed
703
+
704
+ ```markdown
705
+ Current state: ! `git status`
706
+ Recent activity: ! `git log --oneline -5`
707
+ ```
708
+
709
+ ### 3. Reference Files Explicitly
710
+
711
+ ```markdown
712
+ Review @ package.json for dependencies
713
+ Check @ src/config/* for settings
714
+ ```
715
+
716
+ ### 4. Structure Complex Commands
717
+
718
+ ```markdown
719
+ ## Step 1: Analysis
720
+ [analysis prompt]
721
+
722
+ ## Step 2: Implementation
723
+ [implementation prompt]
724
+
725
+ ## Step 3: Verification
726
+ [verification prompt]
727
+ ```
728
+
729
+ ### 5. Use Arguments for Flexibility
730
+
731
+ ```markdown
732
+ # Simple
733
+ Fix issue #$ARGUMENTS
734
+
735
+ # Positional
736
+ Review PR #$1 with priority $2
737
+
738
+ # File reference
739
+ Analyze @ $ARGUMENTS
740
+ ```
741
+
742
+ ## Anti-Patterns to Avoid
743
+
744
+ ### ❌ No Description
745
+
746
+ ```yaml
747
+ ---
748
+ # Missing description field
749
+ ---
750
+ ```
751
+
752
+ ### ❌ Overly Broad Tool Access
753
+
754
+ ```yaml
755
+ # Git command with no restrictions
756
+ ---
757
+ description: Create commit
758
+ ---
759
+ ```
760
+
761
+ Better:
762
+ ```yaml
763
+ ---
764
+ description: Create commit
765
+ allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
766
+ ---
767
+ ```
768
+
769
+ ### ❌ Vague Instructions
770
+
771
+ ```markdown
772
+ Do the thing for $ARGUMENTS
773
+ ```
774
+
775
+ Better:
776
+ ```markdown
777
+ Fix issue #$ARGUMENTS by:
778
+ 1. Understanding the issue
779
+ 2. Locating relevant code
780
+ 3. Implementing solution
781
+ 4. Adding tests
782
+ ```
783
+
784
+ ### ❌ Missing Context for State-Dependent Tasks
785
+
786
+ ```markdown
787
+ Create a git commit
788
+ ```
789
+
790
+ Better:
791
+ ```markdown
792
+ Current changes: ! `git status`
793
+ Diff: ! `git diff`
794
+
795
+ Create a git commit for these changes
796
+ ```