aiblueprint-cli 1.4.11 → 1.4.13

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 (55) hide show
  1. package/claude-code-config/scripts/.claude/commands/fix-on-my-computer.md +87 -0
  2. package/claude-code-config/scripts/command-validator/CLAUDE.md +112 -0
  3. package/claude-code-config/scripts/command-validator/src/__tests__/validator.test.ts +62 -111
  4. package/claude-code-config/scripts/command-validator/src/cli.ts +5 -3
  5. package/claude-code-config/scripts/command-validator/src/lib/security-rules.ts +3 -4
  6. package/claude-code-config/scripts/command-validator/src/lib/types.ts +1 -0
  7. package/claude-code-config/scripts/command-validator/src/lib/validator.ts +47 -317
  8. package/claude-code-config/scripts/statusline/CLAUDE.md +29 -7
  9. package/claude-code-config/scripts/statusline/README.md +89 -1
  10. package/claude-code-config/scripts/statusline/defaults.json +75 -0
  11. package/claude-code-config/scripts/statusline/src/index.ts +101 -24
  12. package/claude-code-config/scripts/statusline/src/lib/config-types.ts +100 -0
  13. package/claude-code-config/scripts/statusline/src/lib/config.ts +21 -0
  14. package/claude-code-config/scripts/statusline/src/lib/context.ts +32 -11
  15. package/claude-code-config/scripts/statusline/src/lib/formatters.ts +360 -22
  16. package/claude-code-config/scripts/statusline/src/lib/git.ts +100 -0
  17. package/claude-code-config/scripts/statusline/src/lib/render-pure.ts +177 -0
  18. package/claude-code-config/scripts/statusline/src/lib/types.ts +11 -0
  19. package/claude-code-config/scripts/statusline/statusline.config.json +93 -0
  20. package/claude-code-config/skills/claude-memory/SKILL.md +689 -0
  21. package/claude-code-config/skills/claude-memory/references/comprehensive-example.md +175 -0
  22. package/claude-code-config/skills/claude-memory/references/project-patterns.md +334 -0
  23. package/claude-code-config/skills/claude-memory/references/prompting-techniques.md +411 -0
  24. package/claude-code-config/skills/claude-memory/references/section-templates.md +347 -0
  25. package/claude-code-config/skills/create-slash-commands/SKILL.md +1110 -0
  26. package/claude-code-config/skills/create-slash-commands/references/arguments.md +273 -0
  27. package/claude-code-config/skills/create-slash-commands/references/patterns.md +947 -0
  28. package/claude-code-config/skills/create-slash-commands/references/prompt-examples.md +656 -0
  29. package/claude-code-config/skills/create-slash-commands/references/tool-restrictions.md +389 -0
  30. package/claude-code-config/skills/create-subagents/SKILL.md +425 -0
  31. package/claude-code-config/skills/create-subagents/references/context-management.md +567 -0
  32. package/claude-code-config/skills/create-subagents/references/debugging-agents.md +714 -0
  33. package/claude-code-config/skills/create-subagents/references/error-handling-and-recovery.md +502 -0
  34. package/claude-code-config/skills/create-subagents/references/evaluation-and-testing.md +374 -0
  35. package/claude-code-config/skills/create-subagents/references/orchestration-patterns.md +591 -0
  36. package/claude-code-config/skills/create-subagents/references/subagents.md +599 -0
  37. package/claude-code-config/skills/create-subagents/references/writing-subagent-prompts.md +513 -0
  38. package/dist/cli.js +20 -3
  39. package/package.json +1 -1
  40. package/claude-code-config/commands/apex.md +0 -109
  41. package/claude-code-config/commands/tasks/run-task.md +0 -220
  42. package/claude-code-config/commands/utils/watch-ci.md +0 -47
  43. package/claude-code-config/scripts/command-validator/biome.json +0 -29
  44. package/claude-code-config/scripts/command-validator/bun.lockb +0 -0
  45. package/claude-code-config/scripts/command-validator/package.json +0 -27
  46. package/claude-code-config/scripts/command-validator/vitest.config.ts +0 -7
  47. package/claude-code-config/scripts/hook-post-file.ts +0 -162
  48. package/claude-code-config/scripts/statusline/biome.json +0 -34
  49. package/claude-code-config/scripts/statusline/bun.lockb +0 -0
  50. package/claude-code-config/scripts/statusline/fixtures/test-input.json +0 -25
  51. package/claude-code-config/scripts/statusline/package.json +0 -19
  52. package/claude-code-config/scripts/statusline/statusline.config.ts +0 -25
  53. package/claude-code-config/scripts/statusline/test.ts +0 -20
  54. package/claude-code-config/scripts/validate-command.js +0 -712
  55. package/claude-code-config/scripts/validate-command.readme.md +0 -283
@@ -0,0 +1,425 @@
1
+ ---
2
+ name: create-subagents
3
+ description: Expert guidance for creating, building, and using Claude Code subagents and the Task tool. Use when working with subagents, setting up agent configurations, understanding how agents work, or using the Task tool to launch specialized agents.
4
+ ---
5
+
6
+ <objective>
7
+ Subagents are specialized Claude instances that run in isolated contexts with focused roles and limited tool access. This skill teaches you how to create effective subagents, write strong system prompts, configure tool access, and orchestrate multi-agent workflows using the Task tool.
8
+
9
+ Subagents enable delegation of complex tasks to specialized agents that operate autonomously without user interaction, returning their final output to the main conversation.
10
+ </objective>
11
+
12
+ <quick_start>
13
+ <workflow>
14
+ 1. Run `/agents` command
15
+ 2. Select "Create New Agent"
16
+ 3. Choose project-level (`.claude/agents/`) or user-level (`~/.claude/agents/`)
17
+ 4. Define the subagent:
18
+ - **name**: lowercase-with-hyphens
19
+ - **description**: When should this subagent be used?
20
+ - **tools**: Optional comma-separated list (inherits all if omitted)
21
+ - **model**: Optional (`sonnet`, `opus`, `haiku`, or `inherit`)
22
+ 5. Write the system prompt (the subagent's instructions)
23
+ </workflow>
24
+
25
+ <example>
26
+ ```markdown
27
+ ---
28
+ name: code-reviewer
29
+ description: Expert code reviewer. Use proactively after code changes to review for quality, security, and best practices.
30
+ tools: Read, Grep, Glob, Bash
31
+ model: sonnet
32
+ ---
33
+
34
+ <role>
35
+ You are a senior code reviewer focused on quality, security, and best practices.
36
+ </role>
37
+
38
+ <focus_areas>
39
+ - Code quality and maintainability
40
+ - Security vulnerabilities
41
+ - Performance issues
42
+ - Best practices adherence
43
+ </focus_areas>
44
+
45
+ <output_format>
46
+ Provide specific, actionable feedback with file:line references.
47
+ </output_format>
48
+ ```
49
+ </example>
50
+ </quick_start>
51
+
52
+ <file_structure>
53
+ | Type | Location | Scope | Priority |
54
+ |------|----------|-------|----------|
55
+ | **Project** | `.claude/agents/` | Current project only | Highest |
56
+ | **User** | `~/.claude/agents/` | All projects | Lower |
57
+ | **Plugin** | Plugin's `agents/` dir | All projects | Lowest |
58
+
59
+ Project-level subagents override user-level when names conflict.
60
+ </file_structure>
61
+
62
+ <configuration>
63
+ <field name="name">
64
+ - Lowercase letters and hyphens only
65
+ - Must be unique
66
+ </field>
67
+
68
+ <field name="description">
69
+ - Natural language description of purpose
70
+ - Include when Claude should invoke this subagent
71
+ - Used for automatic subagent selection
72
+ </field>
73
+
74
+ <field name="tools">
75
+ - Comma-separated list: `Read, Write, Edit, Bash, Grep`
76
+ - If omitted: inherits all tools from main thread
77
+ - Use `/agents` interface to see all available tools
78
+ </field>
79
+
80
+ <field name="model">
81
+ - `sonnet`, `opus`, `haiku`, or `inherit`
82
+ - `inherit`: uses same model as main conversation
83
+ - If omitted: defaults to configured subagent model (usually sonnet)
84
+ </field>
85
+ </configuration>
86
+
87
+ <execution_model>
88
+ <critical_constraint>
89
+ **Subagents are black boxes that cannot interact with users.**
90
+
91
+ Subagents run in isolated contexts and return their final output to the main conversation. They:
92
+ - ✅ Can use tools like Read, Write, Edit, Bash, Grep, Glob
93
+ - ✅ Can access MCP servers and other non-interactive tools
94
+ - ❌ **Cannot use AskUserQuestion** or any tool requiring user interaction
95
+ - ❌ **Cannot present options or wait for user input**
96
+ - ❌ **User never sees subagent's intermediate steps**
97
+
98
+ The main conversation sees only the subagent's final report/output.
99
+ </critical_constraint>
100
+
101
+ <workflow_design>
102
+ **Designing workflows with subagents:**
103
+
104
+ Use **main chat** for:
105
+ - Gathering requirements from user (AskUserQuestion)
106
+ - Presenting options or decisions to user
107
+ - Any task requiring user confirmation/input
108
+ - Work where user needs visibility into progress
109
+
110
+ Use **subagents** for:
111
+ - Research tasks (API documentation lookup, code analysis)
112
+ - Code generation based on pre-defined requirements
113
+ - Analysis and reporting (security review, test coverage)
114
+ - Context-heavy operations that don't need user interaction
115
+
116
+ **Example workflow pattern:**
117
+ ```
118
+ Main Chat: Ask user for requirements (AskUserQuestion)
119
+
120
+ Subagent: Research API and create documentation (no user interaction)
121
+
122
+ Main Chat: Review research with user, confirm approach
123
+
124
+ Subagent: Generate code based on confirmed plan
125
+
126
+ Main Chat: Present results, handle testing/deployment
127
+ ```
128
+ </workflow_design>
129
+ </execution_model>
130
+
131
+ <system_prompt_guidelines>
132
+ <principle name="be_specific">
133
+ Clearly define the subagent's role, capabilities, and constraints.
134
+ </principle>
135
+
136
+ <principle name="use_pure_xml_structure">
137
+ Structure the system prompt with pure XML tags. Remove ALL markdown headings from the body.
138
+
139
+ ```markdown
140
+ ---
141
+ name: security-reviewer
142
+ description: Reviews code for security vulnerabilities
143
+ tools: Read, Grep, Glob, Bash
144
+ model: sonnet
145
+ ---
146
+
147
+ <role>
148
+ You are a senior code reviewer specializing in security.
149
+ </role>
150
+
151
+ <focus_areas>
152
+ - SQL injection vulnerabilities
153
+ - XSS attack vectors
154
+ - Authentication/authorization issues
155
+ - Sensitive data exposure
156
+ </focus_areas>
157
+
158
+ <workflow>
159
+ 1. Read the modified files
160
+ 2. Identify security risks
161
+ 3. Provide specific remediation steps
162
+ 4. Rate severity (Critical/High/Medium/Low)
163
+ </workflow>
164
+ ```
165
+ </principle>
166
+
167
+ <principle name="task_specific">
168
+ Tailor instructions to the specific task domain. Don't create generic "helper" subagents.
169
+
170
+ ❌ Bad: "You are a helpful assistant that helps with code"
171
+ ✅ Good: "You are a React component refactoring specialist. Analyze components for hooks best practices, performance anti-patterns, and accessibility issues."
172
+ </principle>
173
+ </system_prompt_guidelines>
174
+
175
+ <subagent_xml_structure>
176
+ Subagent.md files are system prompts consumed only by Claude. Like skills and slash commands, they should use pure XML structure for optimal parsing and token efficiency.
177
+
178
+ <recommended_tags>
179
+ Common tags for subagent structure:
180
+
181
+ - `<role>` - Who the subagent is and what it does
182
+ - `<constraints>` - Hard rules (NEVER/MUST/ALWAYS)
183
+ - `<focus_areas>` - What to prioritize
184
+ - `<workflow>` - Step-by-step process
185
+ - `<output_format>` - How to structure deliverables
186
+ - `<success_criteria>` - Completion criteria
187
+ - `<validation>` - How to verify work
188
+ </recommended_tags>
189
+
190
+ <intelligence_rules>
191
+ **Simple subagents** (single focused task):
192
+ - Use role + constraints + workflow minimum
193
+ - Example: code-reviewer, test-runner
194
+
195
+ **Medium subagents** (multi-step process):
196
+ - Add workflow steps, output_format, success_criteria
197
+ - Example: api-researcher, documentation-generator
198
+
199
+ **Complex subagents** (research + generation + validation):
200
+ - Add all tags as appropriate including validation, examples
201
+ - Example: mcp-api-researcher, comprehensive-auditor
202
+ </intelligence_rules>
203
+
204
+ <critical_rule>
205
+ **Remove ALL markdown headings (##, ###) from subagent body.** Use semantic XML tags instead.
206
+
207
+ Keep markdown formatting WITHIN content (bold, italic, lists, code blocks, links).
208
+
209
+ For XML structure principles and token efficiency details, see @skills/create-agent-skills/references/use-xml-tags.md - the same principles apply to subagents.
210
+ </critical_rule>
211
+ </subagent_xml_structure>
212
+
213
+ <invocation>
214
+ <automatic>
215
+ Claude automatically selects subagents based on the `description` field when it matches the current task.
216
+ </automatic>
217
+
218
+ <explicit>
219
+ You can explicitly invoke a subagent:
220
+
221
+ ```
222
+ > Use the code-reviewer subagent to check my recent changes
223
+ ```
224
+
225
+ ```
226
+ > Have the test-writer subagent create tests for the new API endpoints
227
+ ```
228
+ </explicit>
229
+ </invocation>
230
+
231
+ <background_execution>
232
+ Subagents can run in the background using the `run_in_background` parameter, allowing parallel execution while the main conversation continues.
233
+
234
+ <how_it_works>
235
+ **Starting a background subagent:**
236
+ The Task tool accepts `run_in_background: true` to launch agents asynchronously:
237
+
238
+ ```
239
+ Task tool call:
240
+ - description: "Analyze security vulnerabilities"
241
+ - prompt: "Review all authentication code for security issues..."
242
+ - subagent_type: "security-reviewer"
243
+ - run_in_background: true
244
+ ```
245
+
246
+ The agent starts immediately and returns an `agent_id` for tracking.
247
+ </how_it_works>
248
+
249
+ <retrieving_results>
250
+ **Getting results with TaskOutput:**
251
+ Use the `TaskOutput` tool to retrieve results from background agents:
252
+
253
+ ```
254
+ TaskOutput tool call:
255
+ - task_id: "agent-12345" # The agent_id from the Task call
256
+ - block: true # Wait for completion (default)
257
+ - timeout: 30000 # Max wait time in ms
258
+ ```
259
+
260
+ **Parameters:**
261
+ | Parameter | Default | Description |
262
+ |-----------|---------|-------------|
263
+ | `task_id` | Required | The agent ID returned from Task tool |
264
+ | `block` | `true` | Wait for completion or check current status |
265
+ | `timeout` | `30000` | Max wait time in milliseconds (up to 600000) |
266
+
267
+ **Non-blocking check:**
268
+ Set `block: false` to check status without waiting:
269
+ ```
270
+ TaskOutput tool call:
271
+ - task_id: "agent-12345"
272
+ - block: false
273
+ ```
274
+ Returns current status: running, completed, or the final result.
275
+ </retrieving_results>
276
+
277
+ <parallel_agents>
278
+ **Launching multiple agents in parallel:**
279
+
280
+ To maximize performance, launch multiple independent agents simultaneously:
281
+
282
+ ```
283
+ Single message with multiple Task tool calls:
284
+
285
+ Task 1:
286
+ - description: "Review code quality"
287
+ - prompt: "Check code quality..."
288
+ - subagent_type: "code-reviewer"
289
+ - run_in_background: true
290
+
291
+ Task 2:
292
+ - description: "Run security scan"
293
+ - prompt: "Scan for vulnerabilities..."
294
+ - subagent_type: "security-scanner"
295
+ - run_in_background: true
296
+
297
+ Task 3:
298
+ - description: "Check test coverage"
299
+ - prompt: "Analyze test coverage..."
300
+ - subagent_type: "test-analyzer"
301
+ - run_in_background: true
302
+ ```
303
+
304
+ Then retrieve all results:
305
+ ```
306
+ TaskOutput calls for each agent_id
307
+ ```
308
+ </parallel_agents>
309
+
310
+ <when_to_use_background>
311
+ **Use background agents for:**
312
+ - Long-running analysis (security review, comprehensive code analysis)
313
+ - Multiple independent tasks that can run in parallel
314
+ - Tasks where you want to continue working while waiting
315
+ - Research tasks that may take significant time
316
+
317
+ **Don't use background for:**
318
+ - Quick operations (< 10 seconds)
319
+ - Tasks that depend on each other sequentially
320
+ - Tasks where immediate results are needed for next step
321
+ - Simple single-file operations
322
+
323
+ **Pattern: Parallel Analysis Pipeline**
324
+ ```
325
+ 1. Launch multiple analysis agents in background
326
+ 2. Continue with other work or wait
327
+ 3. Collect all results
328
+ 4. Synthesize findings in main conversation
329
+ ```
330
+ </when_to_use_background>
331
+
332
+ <resuming_agents>
333
+ **Resuming agents:**
334
+ Agents can be resumed using the `resume` parameter with their agent ID:
335
+
336
+ ```
337
+ Task tool call:
338
+ - description: "Continue security review"
339
+ - prompt: "Please continue with the remaining files..."
340
+ - subagent_type: "security-reviewer"
341
+ - resume: "agent-12345" # Previous agent ID
342
+ ```
343
+
344
+ The agent continues with its full previous context preserved.
345
+ </resuming_agents>
346
+ </background_execution>
347
+
348
+ <management>
349
+ <using_agents_command>
350
+ Run `/agents` for an interactive interface to:
351
+ - View all available subagents
352
+ - Create new subagents
353
+ - Edit existing subagents
354
+ - Delete custom subagents
355
+ </using_agents_command>
356
+
357
+ <manual_editing>
358
+ You can also edit subagent files directly:
359
+ - Project: `.claude/agents/subagent-name.md`
360
+ - User: `~/.claude/agents/subagent-name.md`
361
+ </manual_editing>
362
+ </management>
363
+
364
+ <reference>
365
+ **Core references**:
366
+
367
+ **Subagent usage and configuration**: [references/subagents.md](references/subagents.md)
368
+ - File format and configuration
369
+ - Model selection (Sonnet 4.5 + Haiku 4.5 orchestration)
370
+ - Tool security and least privilege
371
+ - Prompt caching optimization
372
+ - **Background execution** (run_in_background, TaskOutput, parallel agents)
373
+ - Complete examples
374
+
375
+ **Writing effective prompts**: [references/writing-subagent-prompts.md](references/writing-subagent-prompts.md)
376
+ - Core principles and XML structure
377
+ - Description field optimization for routing
378
+ - Extended thinking for complex reasoning
379
+ - Security constraints and strong modal verbs
380
+ - Success criteria definition
381
+
382
+ **Advanced topics**:
383
+
384
+ **Evaluation and testing**: [references/evaluation-and-testing.md](references/evaluation-and-testing.md)
385
+ - Evaluation metrics (task completion, tool correctness, robustness)
386
+ - Testing strategies (offline, simulation, online monitoring)
387
+ - Evaluation-driven development
388
+ - G-Eval for custom criteria
389
+
390
+ **Error handling and recovery**: [references/error-handling-and-recovery.md](references/error-handling-and-recovery.md)
391
+ - Common failure modes and causes
392
+ - Recovery strategies (graceful degradation, retry, circuit breakers)
393
+ - Structured communication and observability
394
+ - Anti-patterns to avoid
395
+
396
+ **Context management**: [references/context-management.md](references/context-management.md)
397
+ - Memory architecture (STM, LTM, working memory)
398
+ - Context strategies (summarization, sliding window, scratchpads)
399
+ - Managing long-running tasks
400
+ - Prompt caching interaction
401
+
402
+ **Orchestration patterns**: [references/orchestration-patterns.md](references/orchestration-patterns.md)
403
+ - Sequential, parallel, hierarchical, coordinator patterns
404
+ - Sonnet + Haiku orchestration for cost/performance
405
+ - Multi-agent coordination
406
+ - Pattern selection guidance
407
+
408
+ **Debugging and troubleshooting**: [references/debugging-agents.md](references/debugging-agents.md)
409
+ - Logging, tracing, and correlation IDs
410
+ - Common failure types (hallucinations, format errors, tool misuse)
411
+ - Diagnostic procedures
412
+ - Continuous monitoring
413
+ </reference>
414
+
415
+ <success_criteria>
416
+ A well-configured subagent has:
417
+
418
+ - Valid YAML frontmatter (name matches file, description includes triggers)
419
+ - Clear role definition in system prompt
420
+ - Appropriate tool restrictions (least privilege)
421
+ - XML-structured system prompt with role, approach, and constraints
422
+ - Description field optimized for automatic routing
423
+ - Successfully tested on representative tasks
424
+ - Model selection appropriate for task complexity (Sonnet for reasoning, Haiku for simple tasks)
425
+ </success_criteria>