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