claude-all-hands 1.0.1 → 1.0.3

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 (170) hide show
  1. package/.claude/agents/code-simplifier.md +52 -0
  2. package/.claude/agents/curator.md +186 -246
  3. package/.claude/agents/documentation-taxonomist.md +255 -0
  4. package/.claude/agents/documentation-writer.md +366 -0
  5. package/.claude/agents/planner.md +123 -166
  6. package/.claude/agents/researcher.md +58 -41
  7. package/.claude/agents/surveyor.md +81 -0
  8. package/.claude/agents/worker.md +74 -0
  9. package/.claude/commands/continue.md +122 -0
  10. package/.claude/commands/create-skill.md +107 -0
  11. package/.claude/commands/create-specialist.md +111 -0
  12. package/.claude/commands/curator-audit.md +4 -0
  13. package/.claude/commands/debug.md +183 -0
  14. package/.claude/commands/docs-adjust.md +214 -0
  15. package/.claude/commands/docs-audit.md +172 -0
  16. package/.claude/commands/docs-init.md +210 -0
  17. package/.claude/commands/plan.md +199 -102
  18. package/.claude/commands/validate.md +11 -0
  19. package/.claude/commands/whats-next.md +106 -134
  20. package/.claude/envoy/README.md +5 -5
  21. package/.claude/envoy/envoy +11 -14
  22. package/.claude/envoy/package-lock.json +1594 -0
  23. package/.claude/envoy/package.json +38 -0
  24. package/.claude/envoy/src/cli.ts +126 -0
  25. package/.claude/envoy/src/commands/base.ts +216 -0
  26. package/.claude/envoy/src/commands/docs.ts +881 -0
  27. package/.claude/envoy/src/commands/gemini.ts +999 -0
  28. package/.claude/envoy/src/commands/git.ts +639 -0
  29. package/.claude/envoy/src/commands/index.ts +73 -0
  30. package/.claude/envoy/src/commands/knowledge.ts +178 -0
  31. package/.claude/envoy/src/commands/perplexity.ts +129 -0
  32. package/.claude/envoy/src/commands/plan/core.ts +134 -0
  33. package/.claude/envoy/src/commands/plan/findings.ts +446 -0
  34. package/.claude/envoy/src/commands/plan/gates.ts +672 -0
  35. package/.claude/envoy/src/commands/plan/index.ts +135 -0
  36. package/.claude/envoy/src/commands/plan/lifecycle.ts +648 -0
  37. package/.claude/envoy/src/commands/plan/plan-file.ts +138 -0
  38. package/.claude/envoy/src/commands/plan/prompts.ts +285 -0
  39. package/.claude/envoy/src/commands/plan/protocols.ts +166 -0
  40. package/.claude/envoy/src/commands/repomix.ts +99 -0
  41. package/.claude/envoy/src/commands/tavily.ts +220 -0
  42. package/.claude/envoy/src/commands/xai.ts +168 -0
  43. package/.claude/envoy/src/lib/ast-queries.ts +261 -0
  44. package/.claude/envoy/src/lib/design.ts +41 -0
  45. package/.claude/envoy/src/lib/feedback-schemas.ts +154 -0
  46. package/.claude/envoy/src/lib/findings.ts +215 -0
  47. package/.claude/envoy/src/lib/gates.ts +572 -0
  48. package/.claude/envoy/src/lib/git.ts +132 -0
  49. package/.claude/envoy/src/lib/index.ts +188 -0
  50. package/.claude/envoy/src/lib/knowledge.ts +646 -0
  51. package/.claude/envoy/src/lib/markdown.ts +75 -0
  52. package/.claude/envoy/src/lib/observability.ts +262 -0
  53. package/.claude/envoy/src/lib/paths.ts +130 -0
  54. package/.claude/envoy/src/lib/plan-io.ts +117 -0
  55. package/.claude/envoy/src/lib/prompts.ts +231 -0
  56. package/.claude/envoy/src/lib/protocols.ts +314 -0
  57. package/.claude/envoy/src/lib/repomix.ts +133 -0
  58. package/.claude/envoy/src/lib/retry.ts +138 -0
  59. package/.claude/envoy/src/lib/tree-sitter-utils.ts +301 -0
  60. package/.claude/envoy/src/lib/watcher.ts +167 -0
  61. package/.claude/envoy/src/types/tree-sitter.d.ts +76 -0
  62. package/.claude/envoy/tsconfig.json +21 -0
  63. package/.claude/hooks/scripts/enforce_research_fetch.py +1 -1
  64. package/.claude/hooks/scripts/scan_agents.py +62 -0
  65. package/.claude/hooks/scripts/scan_commands.py +50 -0
  66. package/.claude/hooks/scripts/scan_skills.py +46 -70
  67. package/.claude/hooks/scripts/validate_artifacts.py +128 -0
  68. package/.claude/hooks/startup.sh +26 -24
  69. package/.claude/protocols/bug-discovery.yaml +55 -0
  70. package/.claude/protocols/debugging.yaml +51 -0
  71. package/.claude/protocols/discovery.yaml +53 -0
  72. package/.claude/protocols/implementation.yaml +84 -0
  73. package/.claude/settings.json +38 -97
  74. package/.claude/skills/brainstorming/SKILL.md +54 -0
  75. package/.claude/skills/commands-development/SKILL.md +630 -0
  76. package/.claude/skills/commands-development/references/arguments.md +252 -0
  77. package/.claude/skills/commands-development/references/patterns.md +796 -0
  78. package/.claude/skills/commands-development/references/tool-restrictions.md +376 -0
  79. package/.claude/skills/discovery-mode/SKILL.md +108 -0
  80. package/.claude/skills/documentation-taxonomy/SKILL.md +287 -0
  81. package/.claude/skills/hooks-development/SKILL.md +332 -0
  82. package/.claude/skills/hooks-development/references/command-vs-prompt.md +269 -0
  83. package/.claude/skills/hooks-development/references/examples.md +658 -0
  84. package/.claude/skills/hooks-development/references/hook-types.md +463 -0
  85. package/.claude/skills/hooks-development/references/input-output-schemas.md +469 -0
  86. package/.claude/skills/hooks-development/references/matchers.md +470 -0
  87. package/.claude/skills/hooks-development/references/troubleshooting.md +587 -0
  88. package/.claude/skills/implementation-mode/SKILL.md +171 -0
  89. package/.claude/skills/knowledge-discovery/SKILL.md +178 -0
  90. package/.claude/skills/research-tools/SKILL.md +35 -33
  91. package/.claude/skills/skills-development/SKILL.md +192 -0
  92. package/.claude/skills/skills-development/references/api-security.md +226 -0
  93. package/.claude/skills/skills-development/references/be-clear-and-direct.md +531 -0
  94. package/.claude/skills/skills-development/references/common-patterns.md +595 -0
  95. package/.claude/skills/skills-development/references/core-principles.md +437 -0
  96. package/.claude/skills/skills-development/references/executable-code.md +175 -0
  97. package/.claude/skills/skills-development/references/iteration-and-testing.md +474 -0
  98. package/.claude/skills/skills-development/references/recommended-structure.md +168 -0
  99. package/.claude/skills/skills-development/references/skill-structure.md +372 -0
  100. package/.claude/skills/skills-development/references/use-xml-tags.md +466 -0
  101. package/.claude/skills/skills-development/references/using-scripts.md +113 -0
  102. package/.claude/skills/skills-development/references/using-templates.md +112 -0
  103. package/.claude/skills/skills-development/references/workflows-and-validation.md +510 -0
  104. package/.claude/skills/skills-development/templates/router-skill.md +73 -0
  105. package/.claude/skills/skills-development/templates/simple-skill.md +33 -0
  106. package/.claude/skills/skills-development/workflows/add-reference.md +96 -0
  107. package/.claude/skills/skills-development/workflows/add-script.md +93 -0
  108. package/.claude/skills/skills-development/workflows/add-template.md +74 -0
  109. package/.claude/skills/skills-development/workflows/add-workflow.md +120 -0
  110. package/.claude/skills/skills-development/workflows/audit-skill.md +138 -0
  111. package/.claude/skills/skills-development/workflows/create-domain-expertise-skill.md +605 -0
  112. package/.claude/skills/skills-development/workflows/create-new-skill.md +191 -0
  113. package/.claude/skills/skills-development/workflows/get-guidance.md +121 -0
  114. package/.claude/skills/skills-development/workflows/upgrade-to-router.md +161 -0
  115. package/.claude/skills/skills-development/workflows/verify-skill.md +204 -0
  116. package/.claude/skills/subagents-development/SKILL.md +325 -0
  117. package/.claude/skills/subagents-development/references/context-management.md +567 -0
  118. package/.claude/skills/subagents-development/references/debugging-agents.md +714 -0
  119. package/.claude/skills/subagents-development/references/error-handling-and-recovery.md +502 -0
  120. package/.claude/skills/subagents-development/references/evaluation-and-testing.md +374 -0
  121. package/.claude/skills/subagents-development/references/orchestration-patterns.md +591 -0
  122. package/.claude/skills/subagents-development/references/subagents.md +508 -0
  123. package/.claude/skills/subagents-development/references/writing-subagent-prompts.md +517 -0
  124. package/.claude/statusline.sh +24 -0
  125. package/bin/cli.js +150 -72
  126. package/package.json +1 -1
  127. package/.claude/agents/explorer.md +0 -62
  128. package/.claude/agents/parallel-worker.md +0 -121
  129. package/.claude/commands/curation-fix.md +0 -92
  130. package/.claude/commands/new-branch.md +0 -36
  131. package/.claude/commands/parallel-discovery.md +0 -69
  132. package/.claude/commands/parallel-orchestration.md +0 -99
  133. package/.claude/commands/plan-checkpoint.md +0 -37
  134. package/.claude/envoy/commands/__init__.py +0 -1
  135. package/.claude/envoy/commands/base.py +0 -95
  136. package/.claude/envoy/commands/parallel.py +0 -439
  137. package/.claude/envoy/commands/perplexity.py +0 -86
  138. package/.claude/envoy/commands/plans.py +0 -451
  139. package/.claude/envoy/commands/tavily.py +0 -156
  140. package/.claude/envoy/commands/vertex.py +0 -358
  141. package/.claude/envoy/commands/xai.py +0 -124
  142. package/.claude/envoy/envoy.py +0 -122
  143. package/.claude/envoy/pyrightconfig.json +0 -4
  144. package/.claude/envoy/requirements.txt +0 -2
  145. package/.claude/hooks/capture-queries.sh +0 -3
  146. package/.claude/hooks/scripts/enforce_planning.py +0 -118
  147. package/.claude/hooks/scripts/enforce_rg.py +0 -34
  148. package/.claude/hooks/scripts/validate_skill.py +0 -81
  149. package/.claude/skills/claude-envoy-curation/SKILL.md +0 -162
  150. package/.claude/skills/claude-envoy-usage/SKILL.md +0 -46
  151. package/.claude/skills/command-development/SKILL.md +0 -206
  152. package/.claude/skills/command-development/examples/simple-commands.md +0 -212
  153. package/.claude/skills/command-development/references/frontmatter-reference.md +0 -221
  154. package/.claude/skills/hook-development/SKILL.md +0 -127
  155. package/.claude/skills/hook-development/examples/command-hooks.md +0 -301
  156. package/.claude/skills/hook-development/examples/prompt-hooks.md +0 -114
  157. package/.claude/skills/hook-development/references/event-reference.md +0 -226
  158. package/.claude/skills/repomix-extraction/SKILL.md +0 -91
  159. package/.claude/skills/skill-development/SKILL.md +0 -168
  160. package/.claude/skills/skill-development/examples/complete-skill-examples.md +0 -281
  161. package/.claude/skills/skill-development/references/progressive-disclosure.md +0 -141
  162. package/.claude/skills/skill-development/references/writing-style.md +0 -180
  163. package/.claude/skills/skill-development/scripts/validate-skill.sh +0 -144
  164. package/.claude/skills/specialist-builder/SKILL.md +0 -327
  165. package/.claude/skills/specialist-builder/docs/agent-catalog.md +0 -28
  166. package/.claude/skills/specialist-builder/examples/complete-agent-examples.md +0 -206
  167. package/.claude/skills/specialist-builder/references/system-prompt-patterns.md +0 -281
  168. package/.claude/skills/specialist-builder/references/triggering-examples.md +0 -162
  169. package/.claude/skills/specialist-builder/scripts/validate-agent.sh +0 -137
  170. /package/.claude/{envoy/claude-envoy.py → skills/claude-envoy-patterns/SKILL.md} +0 -0
@@ -0,0 +1,517 @@
1
+ <key_insight>
2
+ Subagent prompts should be task-specific, not generic. They define a specialized role with clear focus areas, workflows, and constraints.
3
+
4
+ **Critical**: Subagent.md files use pure XML structure (no markdown headings). Like skills and slash commands, this improves parsing and token efficiency.
5
+ </key_insight>
6
+
7
+ <xml_structure_rule>
8
+ **Remove ALL markdown headings (##, ###) from subagent body.** Use semantic XML tags instead.
9
+
10
+ Keep markdown formatting WITHIN content (bold, italic, lists, code blocks, links).
11
+
12
+ See @skills/create-agent-skills/references/use-xml-tags.md for XML structure principles - they apply to subagents too.
13
+ </xml_structure_rule>
14
+
15
+ <core_principles>
16
+ <principle name="specificity">
17
+ Define exactly what the subagent does and how it approaches tasks.
18
+
19
+ ❌ Bad: "You are a helpful coding assistant"
20
+ ✅ Good: "You are a React performance optimizer. Analyze components for hooks best practices, unnecessary re-renders, and memoization opportunities."
21
+ </principle>
22
+
23
+ <principle name="clarity">
24
+ State the role, focus areas, and approach explicitly.
25
+
26
+ ❌ Bad: "Help with tests"
27
+ ✅ Good: "You are a test automation specialist. Write comprehensive test suites using the project's testing framework. Focus on edge cases and error conditions."
28
+ </principle>
29
+
30
+ <principle name="constraints">
31
+ Include what the subagent should NOT do. Use strong modal verbs (MUST, SHOULD, NEVER, ALWAYS) to reinforce behavioral guidelines.
32
+
33
+ Example:
34
+ ```markdown
35
+ <constraints>
36
+ - NEVER modify production code, ONLY test files
37
+ - MUST verify tests pass before completing
38
+ - ALWAYS include edge case coverage
39
+ - DO NOT run tests without explicit user request
40
+ </constraints>
41
+ ```
42
+
43
+ **Why strong modals matter**: Reinforces critical boundaries, reduces ambiguity, improves constraint adherence.
44
+ </principle>
45
+ </core_principles>
46
+
47
+ <structure_with_xml>
48
+ Use XML tags to structure subagent prompts for clarity:
49
+
50
+ <example type="security_reviewer">
51
+ ```markdown
52
+ ---
53
+ name: security-reviewer
54
+ description: Reviews code for security vulnerabilities. Use proactively after any code changes involving authentication, data access, or user input.
55
+ tools: Read, Grep, Glob, Bash
56
+ model: sonnet
57
+ skills: security-patterns
58
+ ---
59
+
60
+ <role>
61
+ You are a senior security engineer specializing in web application security.
62
+ </role>
63
+
64
+ <focus_areas>
65
+ - SQL injection vulnerabilities
66
+ - XSS (Cross-Site Scripting) attack vectors
67
+ - Authentication and authorization flaws
68
+ - Sensitive data exposure
69
+ - CSRF (Cross-Site Request Forgery)
70
+ - Insecure deserialization
71
+ </focus_areas>
72
+
73
+ <workflow>
74
+ 1. Run git diff to identify recent changes
75
+ 2. Read modified files focusing on data flow
76
+ 3. Identify security risks with severity ratings
77
+ 4. Provide specific remediation steps
78
+ </workflow>
79
+
80
+ <severity_ratings>
81
+ - **Critical**: Immediate exploitation possible, high impact
82
+ - **High**: Exploitation likely, significant impact
83
+ - **Medium**: Exploitation requires conditions, moderate impact
84
+ - **Low**: Limited exploitability or impact
85
+ </severity_ratings>
86
+
87
+ <output_format>
88
+ For each issue found:
89
+ 1. **Severity**: [Critical/High/Medium/Low]
90
+ 2. **Location**: [File:LineNumber]
91
+ 3. **Vulnerability**: [Type and description]
92
+ 4. **Risk**: [What could happen]
93
+ 5. **Fix**: [Specific code changes needed]
94
+ </output_format>
95
+
96
+ <constraints>
97
+ - Focus only on security issues, not code style
98
+ - Provide actionable fixes, not vague warnings
99
+ - If no issues found, confirm the review was completed
100
+ </constraints>
101
+ ```
102
+ </example>
103
+
104
+ <example type="test_writer">
105
+ ```markdown
106
+ ---
107
+ name: test-writer
108
+ description: Creates comprehensive test suites. Use when new code needs tests or test coverage is insufficient.
109
+ tools: Read, Write, Grep, Glob, Bash
110
+ model: sonnet
111
+ skills: testing-patterns
112
+ ---
113
+
114
+ <role>
115
+ You are a test automation specialist creating thorough, maintainable test suites.
116
+ </role>
117
+
118
+ <testing_philosophy>
119
+ - Test behavior, not implementation
120
+ - One assertion per test when possible
121
+ - Tests should be readable documentation
122
+ - Cover happy path, edge cases, and error conditions
123
+ </testing_philosophy>
124
+
125
+ <workflow>
126
+ 1. Analyze the code to understand functionality
127
+ 2. Identify test cases:
128
+ - Happy path (expected usage)
129
+ - Edge cases (boundary conditions)
130
+ - Error conditions (invalid inputs, failures)
131
+ 3. Write tests using the project's testing framework
132
+ 4. Run tests to verify they pass
133
+ 5. Ensure tests are independent (no shared state)
134
+ </workflow>
135
+
136
+ <test_structure>
137
+ Follow AAA pattern:
138
+ - **Arrange**: Set up test data and conditions
139
+ - **Act**: Execute the functionality being tested
140
+ - **Assert**: Verify the expected outcome
141
+ </test_structure>
142
+
143
+ <quality_criteria>
144
+ - Descriptive test names that explain what's being tested
145
+ - Clear failure messages
146
+ - No test interdependencies
147
+ - Fast execution (mock external dependencies)
148
+ - Clean up after tests (no side effects)
149
+ </quality_criteria>
150
+
151
+ <constraints>
152
+ - Do not modify production code
153
+ - Do not run tests without confirming setup is complete
154
+ - Do not create tests that depend on external services without mocking
155
+ </constraints>
156
+ ```
157
+ </example>
158
+
159
+ <example type="debugger">
160
+ ```markdown
161
+ ---
162
+ name: debugger
163
+ description: Investigates and fixes bugs. Use when errors occur or behavior is unexpected.
164
+ tools: Read, Edit, Bash, Grep, Glob
165
+ model: sonnet
166
+ skills: debugging-patterns
167
+ ---
168
+
169
+ <role>
170
+ You are a debugging specialist skilled at root cause analysis and systematic problem-solving.
171
+ </role>
172
+
173
+ <debugging_methodology>
174
+ 1. **Reproduce**: Understand and reproduce the issue
175
+ 2. **Isolate**: Identify the failing component or function
176
+ 3. **Analyze**: Examine code, logs, error messages, and stack traces
177
+ 4. **Hypothesize**: Form theories about the root cause
178
+ 5. **Test**: Verify hypotheses systematically
179
+ 6. **Fix**: Implement the solution
180
+ 7. **Verify**: Confirm the fix resolves the issue without side effects
181
+ </debugging_methodology>
182
+
183
+ <debugging_techniques>
184
+ - Add logging to trace execution flow
185
+ - Use binary search to isolate the problem (comment out code sections)
186
+ - Check assumptions about inputs, state, and environment
187
+ - Review recent changes that might have introduced the bug
188
+ - Look for similar patterns in the codebase that work correctly
189
+ - Test edge cases and boundary conditions
190
+ </debugging_techniques>
191
+
192
+ <common_bug_patterns>
193
+ - Off-by-one errors in loops
194
+ - Null/undefined reference errors
195
+ - Race conditions in async code
196
+ - Incorrect variable scope
197
+ - Type coercion issues
198
+ - Missing error handling
199
+ </common_bug_patterns>
200
+
201
+ <output_format>
202
+ 1. **Root cause**: Clear explanation of what's wrong
203
+ 2. **Why it happens**: The underlying reason
204
+ 3. **Fix**: Specific code changes
205
+ 4. **Verification**: How to confirm it's fixed
206
+ 5. **Prevention**: How to avoid similar bugs
207
+ </output_format>
208
+
209
+ <constraints>
210
+ - Make minimal changes to fix the issue
211
+ - Preserve existing functionality
212
+ - Add tests to prevent regression
213
+ - Document non-obvious fixes
214
+ </constraints>
215
+ ```
216
+ </example>
217
+ </structure_with_xml>
218
+
219
+ <anti_patterns>
220
+ <anti_pattern name="too_generic">
221
+ ❌ Bad:
222
+ ```markdown
223
+ You are a helpful assistant that helps with code.
224
+ ```
225
+
226
+ This provides no specialization. The subagent won't know what to focus on or how to approach tasks.
227
+ </anti_pattern>
228
+
229
+ <anti_pattern name="no_workflow">
230
+ ❌ Bad:
231
+ ```markdown
232
+ You are a code reviewer. Review code for issues.
233
+ ```
234
+
235
+ Without a workflow, the subagent may skip important steps or review inconsistently.
236
+
237
+ ✅ Good:
238
+ ```markdown
239
+ <workflow>
240
+ 1. Run git diff to see changes
241
+ 2. Read modified files
242
+ 3. Check for: security issues, performance problems, code quality
243
+ 4. Provide specific feedback with examples
244
+ </workflow>
245
+ ```
246
+ </anti_pattern>
247
+
248
+ <anti_pattern name="unclear_trigger">
249
+ The `description` field is critical for automatic invocation. LLM agents use descriptions to make routing decisions.
250
+
251
+ **Description must be specific enough to differentiate from peer agents.**
252
+
253
+ ❌ Bad (too vague):
254
+ ```yaml
255
+ description: Helps with testing
256
+ ```
257
+
258
+ ❌ Bad (not differentiated):
259
+ ```yaml
260
+ description: Billing agent
261
+ ```
262
+
263
+ ✅ Good (specific triggers + differentiation):
264
+ ```yaml
265
+ description: Creates comprehensive test suites. Use when new code needs tests or test coverage is insufficient. Proactively use after implementing new features.
266
+ ```
267
+
268
+ ✅ Good (clear scope):
269
+ ```yaml
270
+ description: Handles current billing statements and payment processing. Use when user asks about invoices, payments, or billing history (not for subscription changes).
271
+ ```
272
+
273
+ **Optimization tips**:
274
+ - Include **trigger keywords** that match common user requests
275
+ - Specify **when to use** (not just what it does)
276
+ - **Differentiate** from similar agents (what this one does vs others)
277
+ - Include **proactive triggers** if agent should be invoked automatically
278
+ </anti_pattern>
279
+
280
+ <anti_pattern name="missing_constraints">
281
+ ❌ Bad: No constraints specified
282
+
283
+ Without constraints, subagents might:
284
+ - Modify code they shouldn't touch
285
+ - Run dangerous commands
286
+ - Skip important steps
287
+
288
+ ✅ Good:
289
+ ```markdown
290
+ <constraints>
291
+ - Only modify test files, never production code
292
+ - Always run tests after writing them
293
+ - Do not commit changes automatically
294
+ </constraints>
295
+ ```
296
+ </anti_pattern>
297
+
298
+ <anti_pattern name="requires_user_interaction">
299
+ ❌ **Critical**: Subagents cannot interact with users.
300
+
301
+ **Bad example:**
302
+ ```markdown
303
+ ---
304
+ name: intake-agent
305
+ description: Gathers requirements from user
306
+ tools: AskUserQuestion
307
+ ---
308
+
309
+ <workflow>
310
+ 1. Ask user about their requirements using AskUserQuestion
311
+ 2. Follow up with clarifying questions
312
+ 3. Return finalized requirements
313
+ </workflow>
314
+ ```
315
+
316
+ **Why this fails:**
317
+ Subagents execute in isolated contexts ("black boxes"). They cannot use AskUserQuestion or any tool requiring user interaction. The user never sees intermediate steps.
318
+
319
+ **Correct approach:**
320
+ ```markdown
321
+ # Main chat handles user interaction
322
+ 1. Main chat: Use AskUserQuestion to gather requirements
323
+ 2. Launch subagent: Research based on requirements (no user interaction)
324
+ 3. Main chat: Present research to user, get confirmation
325
+ 4. Launch subagent: Generate code based on confirmed plan
326
+ 5. Main chat: Present results to user
327
+ ```
328
+
329
+ **Tools that require user interaction (cannot use in subagents):**
330
+ - AskUserQuestion
331
+ - Any workflow expecting user to respond mid-execution
332
+ - Presenting options and waiting for selection
333
+
334
+ **Design principle:**
335
+ If your subagent prompt includes "ask user", "present options", or "wait for confirmation", it's designed incorrectly. Move user interaction to main chat.
336
+ </anti_pattern>
337
+ </anti_patterns>
338
+
339
+ <best_practices>
340
+ <practice name="start_with_role">
341
+ Begin with a clear role statement:
342
+
343
+ ```markdown
344
+ <role>
345
+ You are a [specific expertise] specializing in [specific domain].
346
+ </role>
347
+ ```
348
+ </practice>
349
+
350
+ <practice name="define_focus">
351
+ List specific focus areas to guide attention:
352
+
353
+ ```markdown
354
+ <focus_areas>
355
+ - Specific concern 1
356
+ - Specific concern 2
357
+ - Specific concern 3
358
+ </focus_areas>
359
+ ```
360
+ </practice>
361
+
362
+ <practice name="provide_workflow">
363
+ Give step-by-step workflow for consistency:
364
+
365
+ ```markdown
366
+ <workflow>
367
+ 1. First step
368
+ 2. Second step
369
+ 3. Third step
370
+ </workflow>
371
+ ```
372
+ </practice>
373
+
374
+ <practice name="specify_output">
375
+ Define expected output format:
376
+
377
+ ```markdown
378
+ <output_format>
379
+ Structure:
380
+ 1. Component 1
381
+ 2. Component 2
382
+ 3. Component 3
383
+ </output_format>
384
+ ```
385
+ </practice>
386
+
387
+ <practice name="set_boundaries">
388
+ Clearly state constraints with strong modal verbs:
389
+
390
+ ```markdown
391
+ <constraints>
392
+ - NEVER modify X
393
+ - ALWAYS verify Y before Z
394
+ - MUST include edge case testing
395
+ - DO NOT proceed without validation
396
+ </constraints>
397
+ ```
398
+
399
+ **Security constraints** (when relevant):
400
+ - Environment awareness (production vs development)
401
+ - Safe operation boundaries (what commands are allowed)
402
+ - Data handling rules (sensitive information)
403
+ </practice>
404
+
405
+ <practice name="use_examples">
406
+ Include examples for complex behaviors:
407
+
408
+ ```markdown
409
+ <example>
410
+ Input: [scenario]
411
+ Expected action: [what the subagent should do]
412
+ Output: [what the subagent should produce]
413
+ </example>
414
+ ```
415
+ </practice>
416
+
417
+ <practice name="extended_thinking">
418
+ For complex reasoning tasks, leverage extended thinking:
419
+
420
+ ```markdown
421
+ <thinking_approach>
422
+ Use extended thinking for:
423
+ - Root cause analysis of complex bugs
424
+ - Security vulnerability assessment
425
+ - Architectural design decisions
426
+ - Multi-step logical reasoning
427
+
428
+ Provide high-level guidance rather than prescriptive steps:
429
+ "Analyze the authentication flow for security vulnerabilities, considering common attack vectors and edge cases."
430
+
431
+ Rather than:
432
+ "Step 1: Check for SQL injection. Step 2: Check for XSS. Step 3: ..."
433
+ </thinking_approach>
434
+ ```
435
+
436
+ **When to use extended thinking**:
437
+ - Debugging complex issues
438
+ - Security analysis
439
+ - Code architecture review
440
+ - Performance optimization requiring deep analysis
441
+
442
+ **Minimum thinking budget**: 1024 tokens (increase for more complex tasks)
443
+ </practice>
444
+
445
+ <practice name="success_criteria">
446
+ Define what successful completion looks like:
447
+
448
+ ```markdown
449
+ <success_criteria>
450
+ Task is complete when:
451
+ - All modified files have been reviewed
452
+ - Each issue has severity rating and specific fix
453
+ - Output format is valid JSON
454
+ - No vulnerabilities were missed (cross-check against OWASP Top 10)
455
+ </success_criteria>
456
+ ```
457
+
458
+ **Benefit**: Clear completion criteria reduce ambiguity and partial outputs.
459
+ </practice>
460
+ </best_practices>
461
+
462
+ <testing_subagents>
463
+ <test_checklist>
464
+ 1. **Invoke the subagent** with a representative task
465
+ 2. **Check if it follows the workflow** specified in the prompt
466
+ 3. **Verify output format** matches what you defined
467
+ 4. **Test edge cases** - does it handle unusual inputs well?
468
+ 5. **Check constraints** - does it respect boundaries?
469
+ 6. **Iterate** - refine the prompt based on observed behavior
470
+ </test_checklist>
471
+
472
+ <common_issues>
473
+ - **Subagent too broad**: Narrow the focus areas
474
+ - **Skipping steps**: Make workflow more explicit
475
+ - **Inconsistent output**: Define output format more clearly
476
+ - **Overstepping bounds**: Add or clarify constraints
477
+ - **Not automatically invoked**: Improve description field with trigger keywords
478
+ </common_issues>
479
+ </testing_subagents>
480
+
481
+ <quick_reference>
482
+ ```markdown
483
+ ---
484
+ name: subagent-name
485
+ description: What it does and when to use it. Include trigger keywords.
486
+ tools: Tool1, Tool2, Tool3
487
+ model: sonnet
488
+ skills: skill1, skill2 # CRITICAL - auto-loads domain expertise
489
+ ---
490
+
491
+ <role>
492
+ You are a [specific role] specializing in [domain].
493
+ </role>
494
+
495
+ <focus_areas>
496
+ - Focus 1
497
+ - Focus 2
498
+ - Focus 3
499
+ </focus_areas>
500
+
501
+ <workflow>
502
+ 1. Step 1
503
+ 2. Step 2
504
+ 3. Step 3
505
+ </workflow>
506
+
507
+ <output_format>
508
+ Expected output structure
509
+ </output_format>
510
+
511
+ <constraints>
512
+ - Do not X
513
+ - Always Y
514
+ - Never Z
515
+ </constraints>
516
+ ```
517
+ </quick_reference>
@@ -0,0 +1,24 @@
1
+ #!/bin/bash
2
+ # Project status line - uses ccline if available, adds validation errors
3
+
4
+ input=$(cat)
5
+ PROJECT_DIR=$(printf '%s' "$input" | jq -r '.workspace.project_dir // empty')
6
+
7
+ # Check for validation errors first
8
+ ERROR_COUNT=0
9
+ if [ -n "$PROJECT_DIR" ] && [ -f "$PROJECT_DIR/.claude/hooks/scripts/validate_artifacts.py" ]; then
10
+ RESULT=$(cd "$PROJECT_DIR" && python3 .claude/hooks/scripts/validate_artifacts.py 2>/dev/null)
11
+ if [ -n "$RESULT" ]; then
12
+ ERROR_COUNT=$(printf '%s' "$RESULT" | jq -r '.systemMessage // empty' | grep -c "•" 2>/dev/null || echo "0")
13
+ fi
14
+ fi
15
+
16
+ # Try ccline (global install)
17
+ CCLINE="$HOME/.claude/ccline/ccline"
18
+ if [ -x "$CCLINE" ]; then
19
+ printf '%s' "$input" | "$CCLINE" 2>/dev/null
20
+ [ "$ERROR_COUNT" -gt 0 ] && echo -e "\033[31m⚠ ${ERROR_COUNT} errors (run /validate to view)\033[0m"
21
+ else
22
+ # No ccline - only show validation errors if any
23
+ [ "$ERROR_COUNT" -gt 0 ] && echo -e "\033[31m⚠ ${ERROR_COUNT} errors (run /validate to view)\033[0m"
24
+ fi