@amsterdamdatalabs/enact-extensions 0.1.3 → 0.1.8

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 (105) hide show
  1. package/README.md +2 -2
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +1 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/install.d.ts.map +1 -1
  7. package/dist/install.js +15 -1
  8. package/dist/install.js.map +1 -1
  9. package/dist/internal/agents.d.ts +29 -0
  10. package/dist/internal/agents.d.ts.map +1 -0
  11. package/dist/internal/agents.js +83 -0
  12. package/dist/internal/agents.js.map +1 -0
  13. package/extensions/enact-context/hooks/hooks.json +17 -7
  14. package/extensions/enact-core/.agents/plugin.json +39 -0
  15. package/extensions/enact-core/hooks/hooks.json +14 -0
  16. package/extensions/enact-factory/.agents/plugin.json +9 -3
  17. package/extensions/enact-factory/agents/architect.toml +30 -0
  18. package/extensions/enact-factory/agents/code-reviewer.toml +29 -0
  19. package/extensions/enact-factory/agents/critic.toml +35 -0
  20. package/extensions/enact-factory/agents/executor.toml +23 -0
  21. package/extensions/enact-factory/agents/explore.toml +22 -0
  22. package/extensions/enact-factory/agents/planner.toml +23 -0
  23. package/extensions/enact-factory/agents/verifier.toml +29 -0
  24. package/extensions/enact-factory/skills/ai-slop-cleaner/SKILL.md +52 -0
  25. package/extensions/enact-factory/skills/azdo-ci-strategy/SKILL.md +262 -0
  26. package/extensions/enact-factory/skills/azdo-ci-strategy/references/build-failures.md +60 -0
  27. package/extensions/enact-factory/skills/azdo-ci-strategy/references/cli-reference.md +87 -0
  28. package/extensions/enact-factory/skills/azdo-ci-strategy/references/policies-and-pipelines.md +132 -0
  29. package/extensions/enact-factory/skills/azdo-ci-strategy/references/troubleshooting.md +53 -0
  30. package/extensions/enact-factory/skills/deep-interview/SKILL.md +72 -0
  31. package/extensions/enact-factory/skills/drive-loop/SKILL.md +259 -0
  32. package/extensions/enact-factory/skills/drive-loop/references/contract-schema.md +107 -0
  33. package/extensions/enact-factory/skills/hyperplan/SKILL.md +51 -0
  34. package/extensions/enact-factory/skills/looplan/SKILL.md +103 -0
  35. package/extensions/enact-factory/skills/plan/SKILL.md +71 -0
  36. package/extensions/enact-factory/skills/remove-deadcode/SKILL.md +41 -0
  37. package/extensions/enact-factory/skills/research/SKILL.md +73 -0
  38. package/extensions/enact-factory/skills/review/SKILL.md +48 -0
  39. package/extensions/enact-factory/skills/security-research/SKILL.md +54 -0
  40. package/extensions/enact-factory/skills/tdd/SKILL.md +56 -0
  41. package/extensions/enact-factory/skills/trace/SKILL.md +37 -0
  42. package/extensions/enact-factory/skills/ultraqa/SKILL.md +79 -0
  43. package/extensions/enact-factory/skills/work-with-workitem/SKILL.md +51 -0
  44. package/extensions/enact-factory/skills/workitem-triage/SKILL.md +15 -0
  45. package/extensions/enact-loop/.agents/plugin.json +46 -0
  46. package/extensions/enact-loop/.mcp.json +1 -0
  47. package/extensions/enact-loop/hooks/hooks.json +27 -0
  48. package/extensions/enact-loop/skills/enact-loop/SKILL.md +327 -0
  49. package/extensions/enact-operator/.agents/plugin.json +0 -1
  50. package/extensions/enact-operator/hooks/hooks.json +0 -55
  51. package/extensions/enact-wiki/skills/wiki/SKILL.md +42 -0
  52. package/extensions/plugin-dev/.agents/plugin.json +4 -6
  53. package/extensions/plugin-dev/agents/plugin-validator.md +1 -1
  54. package/extensions/plugin-dev/skills/agent-development/SKILL.md +7 -7
  55. package/extensions/plugin-dev/{commands/create-plugin.md → skills/create-plugin/SKILL.md} +44 -37
  56. package/extensions/plugin-dev/skills/plugin-dev-guide/SKILL.md +13 -14
  57. package/extensions/plugin-dev/skills/skill-development/SKILL.md +0 -2
  58. package/extensions/plugin-dev/{commands/start.md → skills/start/SKILL.md} +7 -6
  59. package/package.json +11 -6
  60. package/scripts/check-hooks.mjs +174 -0
  61. package/scripts/check-principles.mjs +101 -0
  62. package/scripts/enact-extensions.mjs +87 -3
  63. package/scripts/lib/run-validate.mjs +36 -2
  64. package/scripts/lib/ups-router.mjs +432 -0
  65. package/spec/enact.json +4 -0
  66. package/spec/enact.md +5 -2
  67. package/extensions/cmux/.agents/plugin.json +0 -37
  68. package/extensions/cmux/skills/cmux/SKILL.md +0 -82
  69. package/extensions/cmux/skills/cmux/agents/openai.yaml +0 -4
  70. package/extensions/cmux/skills/cmux/references/handles-and-identify.md +0 -35
  71. package/extensions/cmux/skills/cmux/references/panes-surfaces.md +0 -37
  72. package/extensions/cmux/skills/cmux/references/trigger-flash-and-health.md +0 -23
  73. package/extensions/cmux/skills/cmux/references/windows-workspaces.md +0 -31
  74. package/extensions/cmux/skills/cmux-vm-monitor/SKILL.md +0 -122
  75. package/extensions/cmux/skills/cmux-vm-monitor/agents/openai.yaml +0 -4
  76. package/extensions/cmux/skills/cmux-vm-monitor/references/cmux-commands.md +0 -66
  77. package/extensions/cmux/skills/cmux-vm-monitor/scripts/codex_vm_monitor.sh +0 -45
  78. package/extensions/cmux/skills/cmux-workspace/SKILL.md +0 -93
  79. package/extensions/devops/.agents/plugin.json +0 -36
  80. package/extensions/devops/skills/azure-devops-cli/SKILL.md +0 -431
  81. package/extensions/devops/skills/azure-devops-cli/agents/openai.yaml +0 -4
  82. package/extensions/devops/skills/ci-pipeline-strategy/SKILL.md +0 -217
  83. package/extensions/devops/skills/ci-pipeline-strategy/agents/openai.yaml +0 -4
  84. package/extensions/enact-factory/hooks/user-prompt-submit.mjs +0 -67
  85. package/extensions/enact-operator/commands/doctor.md +0 -39
  86. package/extensions/enact-operator/commands/setup.md +0 -51
  87. package/extensions/plugin-dev/.mcp.json +0 -3
  88. package/extensions/plugin-dev/commands/_archive/create-marketplace.md +0 -427
  89. package/extensions/plugin-dev/commands/_archive/plugin-dev-guide.md +0 -12
  90. package/extensions/plugin-dev/hooks/hooks.json +0 -3
  91. package/extensions/plugin-dev/skills/command-development/SKILL.md +0 -763
  92. package/extensions/plugin-dev/skills/command-development/examples/plugin-commands.md +0 -612
  93. package/extensions/plugin-dev/skills/command-development/examples/simple-commands.md +0 -527
  94. package/extensions/plugin-dev/skills/command-development/references/advanced-workflows.md +0 -762
  95. package/extensions/plugin-dev/skills/command-development/references/documentation-patterns.md +0 -769
  96. package/extensions/plugin-dev/skills/command-development/references/frontmatter-reference.md +0 -508
  97. package/extensions/plugin-dev/skills/command-development/references/interactive-commands.md +0 -966
  98. package/extensions/plugin-dev/skills/command-development/references/marketplace-considerations.md +0 -943
  99. package/extensions/plugin-dev/skills/command-development/references/plugin-features-reference.md +0 -637
  100. package/extensions/plugin-dev/skills/command-development/references/plugin-integration.md +0 -191
  101. package/extensions/plugin-dev/skills/command-development/references/skill-tool.md +0 -447
  102. package/extensions/plugin-dev/skills/command-development/references/testing-strategies.md +0 -723
  103. package/extensions/plugin-dev/skills/command-development/scripts/check-frontmatter.sh +0 -234
  104. package/extensions/plugin-dev/skills/command-development/scripts/validate-command.sh +0 -160
  105. /package/extensions/enact-operator/{skills/_variants.md → docs/skill-variants.md} +0 -0
@@ -1,763 +0,0 @@
1
- ---
2
- name: command-development
3
- description: This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", "Skill tool", "programmatic command invocation", "disable-model-invocation", "prevent Claude from running command", "debug command", "command debugging", "troubleshoot command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, programmatic invocation control, debugging commands, or command development best practices for Claude Code.
4
- ---
5
-
6
- # Command Development for Claude Code
7
-
8
- ## Overview
9
-
10
- Slash commands are frequently-used prompts defined as Markdown files that Claude executes during interactive sessions. Master command structure, frontmatter options, and dynamic features to create powerful, reusable workflows.
11
-
12
- **Key concepts:**
13
-
14
- - Markdown file format for commands
15
- - YAML frontmatter for configuration
16
- - Dynamic arguments and file references
17
- - Bash execution for context
18
- - Command organization and namespacing
19
-
20
- ## Command Basics
21
-
22
- ### What is a Slash Command?
23
-
24
- A slash command is a Markdown file containing a prompt that Claude executes when invoked. Commands provide:
25
-
26
- - **Reusability**: Define once, use repeatedly
27
- - **Consistency**: Standardize common workflows
28
- - **Sharing**: Distribute across team or projects
29
- - **Efficiency**: Quick access to complex prompts
30
-
31
- ### Critical: Commands are Instructions FOR Claude
32
-
33
- **Commands are written for agent consumption, not human consumption.**
34
-
35
- When a user invokes `/command-name`, the command content becomes Claude's instructions. Write commands as directives TO Claude about what to do, not as messages TO the user.
36
-
37
- **Correct approach (instructions for Claude):**
38
-
39
- ```markdown
40
- Review this code for security vulnerabilities including:
41
-
42
- - SQL injection
43
- - XSS attacks
44
- - Authentication issues
45
-
46
- Provide specific line numbers and severity ratings.
47
- ```
48
-
49
- **Incorrect approach (messages to user):**
50
-
51
- ```markdown
52
- This command will review your code for security issues.
53
- You'll receive a report with vulnerability details.
54
- ```
55
-
56
- The first example tells Claude what to do. The second tells the user what will happen but doesn't instruct Claude. Always use the first approach.
57
-
58
- ### Commands and Skills: Same Mechanism, Different Complexity
59
-
60
- Commands and skills are both invoked via the same **Skill tool**. The difference is organizational complexity:
61
-
62
- | Aspect | Commands | Skills |
63
- | --------- | ------------------------------- | --------------------------------- |
64
- | Location | `commands/` | `skills/name/` |
65
- | Format | Single `.md` file | `SKILL.md` + optional resources |
66
- | Resources | None | scripts/, references/, examples/ |
67
- | Best for | Quick prompts, simple workflows | Complex knowledge, bundled assets |
68
-
69
- **Invocation control** (works for both):
70
-
71
- - `disable-model-invocation: true` → User-only (for side effects: deploy, commit)
72
- - Default → Both Claude and user can invoke
73
-
74
- **When to graduate a command to a skill**: If you need scripts, reference files, or progressive disclosure, convert the command to a skill. See the `skill-development` skill for guidance.
75
-
76
- ### Command Locations
77
-
78
- **Project commands** (shared with team):
79
-
80
- - Location: `.claude/commands/`
81
- - Scope: Available in specific project
82
- - Label: Shown as "(project)" in `/help`
83
- - Use for: Team workflows, project-specific tasks
84
-
85
- **Personal commands** (available everywhere):
86
-
87
- - Location: `~/.claude/commands/`
88
- - Scope: Available in all projects
89
- - Label: Shown as "(user)" in `/help`
90
- - Use for: Personal workflows, cross-project utilities
91
-
92
- **Plugin commands** (bundled with plugins):
93
-
94
- - Location: `plugin-name/commands/`
95
- - Scope: Available when plugin installed
96
- - Label: Shown as "(plugin-name)" in `/help`
97
- - Use for: Plugin-specific functionality
98
-
99
- ## File Format
100
-
101
- ### Basic Structure
102
-
103
- Commands are Markdown files with `.md` extension:
104
-
105
- ```
106
- .claude/commands/
107
- ├── review.md # /review command
108
- ├── test.md # /test command
109
- └── deploy.md # /deploy command
110
- ```
111
-
112
- **Simple command:**
113
-
114
- ```markdown
115
- Review this code for security vulnerabilities including:
116
-
117
- - SQL injection
118
- - XSS attacks
119
- - Authentication bypass
120
- - Insecure data handling
121
- ```
122
-
123
- No frontmatter needed for basic commands.
124
-
125
- ### With YAML Frontmatter
126
-
127
- Add configuration using YAML frontmatter:
128
-
129
- ```markdown
130
- ---
131
- description: Review code for security issues
132
- allowed-tools: Read, Grep, Bash(git:*)
133
- model: sonnet
134
- ---
135
-
136
- Review this code for security vulnerabilities...
137
- ```
138
-
139
- ## YAML Frontmatter Fields
140
-
141
- ### description
142
-
143
- **Purpose:** Brief description shown in `/help`
144
- **Type:** String
145
- **Default:** First line of command prompt
146
-
147
- ```yaml
148
- ---
149
- description: Review pull request for code quality
150
- ---
151
- ```
152
-
153
- **Best practice:** Clear, actionable description (under 60 characters)
154
-
155
- ### allowed-tools
156
-
157
- **Purpose:** Specify which tools command can use
158
- **Type:** String or Array
159
- **Default:** Inherits from conversation
160
-
161
- ```yaml
162
- ---
163
- allowed-tools: Read, Write, Edit, Bash(git:*)
164
- ---
165
- ```
166
-
167
- **Patterns:**
168
-
169
- - `Read, Write, Edit` - Specific tools
170
- - `Bash(git:*)` - Bash with git commands only
171
- - `*` - All tools (rarely needed)
172
-
173
- **Use when:** Command requires specific tool access
174
-
175
- ### model
176
-
177
- **Purpose:** Specify model for command execution
178
- **Type:** String
179
- **Values:** Shorthand (`sonnet`, `opus`, `haiku`) or full model ID (e.g., `claude-sonnet-4-5-20250929`)
180
- **Default:** Inherits from conversation
181
-
182
- ```yaml
183
- ---
184
- model: haiku
185
- ---
186
- ```
187
-
188
- **Use cases:**
189
-
190
- - `haiku` - Fast, simple commands
191
- - `sonnet` - Standard workflows
192
- - `opus` - Complex analysis
193
-
194
- Shorthand names use the current default version of each model family.
195
-
196
- ### argument-hint
197
-
198
- **Purpose:** Document expected arguments for autocomplete
199
- **Type:** String
200
- **Default:** None
201
-
202
- ```yaml
203
- ---
204
- argument-hint: [pr-number] [priority] [assignee]
205
- ---
206
- ```
207
-
208
- **Benefits:**
209
-
210
- - Helps users understand command arguments
211
- - Improves command discovery
212
- - Documents command interface
213
-
214
- ### disable-model-invocation
215
-
216
- **Purpose:** Prevent Skill tool from programmatically calling command
217
- **Type:** Boolean
218
- **Default:** false
219
-
220
- ```yaml
221
- ---
222
- disable-model-invocation: true
223
- ---
224
- ```
225
-
226
- **Use when:** Command should only be manually invoked
227
-
228
- ## Dynamic Arguments
229
-
230
- ### Using $ARGUMENTS
231
-
232
- Capture all arguments as single string:
233
-
234
- ```markdown
235
- ---
236
- description: Fix issue by number
237
- argument-hint: [issue-number]
238
- ---
239
-
240
- Fix issue #$ARGUMENTS following our coding standards and best practices.
241
- ```
242
-
243
- **Usage:**
244
-
245
- ```
246
- > /fix-issue 123
247
- > /fix-issue 456
248
- ```
249
-
250
- **Expands to:**
251
-
252
- ```
253
- Fix issue #123 following our coding standards...
254
- Fix issue #456 following our coding standards...
255
- ```
256
-
257
- ### Using Positional Arguments
258
-
259
- Capture individual arguments with `$1`, `$2`, `$3`, etc.:
260
-
261
- ```markdown
262
- ---
263
- description: Review PR with priority and assignee
264
- argument-hint: [pr-number] [priority] [assignee]
265
- ---
266
-
267
- Review pull request #$1 with priority level $2.
268
- After review, assign to $3 for follow-up.
269
- ```
270
-
271
- **Usage:**
272
-
273
- ```
274
- > /review-pr 123 high alice
275
- ```
276
-
277
- **Expands to:**
278
-
279
- ```
280
- Review pull request #123 with priority level high.
281
- After review, assign to alice for follow-up.
282
- ```
283
-
284
- ### Combining Arguments
285
-
286
- Mix positional and remaining arguments:
287
-
288
- ```markdown
289
- Deploy $1 to $2 environment with options: $3
290
- ```
291
-
292
- **Usage:**
293
-
294
- ```
295
- > /deploy api staging --force --skip-tests
296
- ```
297
-
298
- **Expands to:**
299
-
300
- ```
301
- Deploy api to staging environment with options: --force --skip-tests
302
- ```
303
-
304
- ## File References
305
-
306
- ### Using @ Syntax
307
-
308
- Include file contents in command:
309
-
310
- ```markdown
311
- ---
312
- description: Review specific file
313
- argument-hint: [file-path]
314
- ---
315
-
316
- Review @$1 for:
317
-
318
- - Code quality
319
- - Best practices
320
- - Potential bugs
321
- ```
322
-
323
- **Usage:**
324
-
325
- ```
326
- > /review-file src/api/users.ts
327
- ```
328
-
329
- **Effect:** Claude reads `src/api/users.ts` before processing command
330
-
331
- ### Multiple File References
332
-
333
- Reference multiple files:
334
-
335
- ```markdown
336
- Compare @src/old-version.js with @src/new-version.js
337
-
338
- Identify:
339
-
340
- - Breaking changes
341
- - New features
342
- - Bug fixes
343
- ```
344
-
345
- ### Static File References
346
-
347
- Reference known files without arguments:
348
-
349
- ```markdown
350
- Review @package.json and @tsconfig.json for consistency
351
-
352
- Ensure:
353
-
354
- - TypeScript version matches
355
- - Dependencies are aligned
356
- - Build configuration is correct
357
- ```
358
-
359
- ## Bash Execution in Commands
360
-
361
- Commands can execute bash commands inline to dynamically gather context before Claude processes the command. This is useful for including repository state, environment information, or project-specific context.
362
-
363
- ### Syntax: The `[BANG]` Prefix
364
-
365
- In actual command files, use `[BANG]` (exclamation mark) before backticks for pre-execution:
366
-
367
- ```markdown
368
- Current branch: [BANG]`git branch --show-current`
369
- Files changed: [BANG]`git diff --name-only`
370
- Environment: [BANG]`echo $NODE_ENV`
371
- ```
372
-
373
- **How it works:**
374
-
375
- 1. Before Claude sees the command, Claude Code executes `[BANG]`command`` blocks
376
- 2. The bash output replaces the entire `[BANG]`command`` expression
377
- 3. Claude receives the expanded prompt with actual values
378
-
379
- **Example expansion:**
380
-
381
- Command file contains:
382
-
383
- ```markdown
384
- Review the [BANG]`git diff --name-only | wc -l | tr -d ' '` changed files on branch [BANG]`git branch --show-current`.
385
- ```
386
-
387
- Claude receives (after pre-execution):
388
-
389
- ```markdown
390
- Review the 3 changed files on branch feature/add-auth.
391
- ```
392
-
393
- ### Why Skill Examples Omit `[BANG]`
394
-
395
- Examples in skill documentation use plain backticks without `[BANG]`:
396
-
397
- ```markdown
398
- Files changed: `git diff --name-only`
399
- ```
400
-
401
- This is intentional. When skill content loads into Claude's context, `[BANG]` followed by `[command name]` would actually execute. Skill examples show the conceptual pattern; add the `[BANG]` prefix when writing actual command files.
402
-
403
- **When to use:**
404
-
405
- - Include dynamic context (git status, environment vars, etc.)
406
- - Gather project/repository state
407
- - Build context-aware workflows
408
-
409
- ### Load-Time Injection vs Runtime Execution
410
-
411
- The `[BANG]` syntax performs **load-time context injection**: commands execute when the skill or command is loaded, and their output becomes static text in the prompt Claude receives. This is different from Claude choosing to run commands at runtime via the Bash tool. Use `[BANG]` for gathering context (git status, environment variables, config files) that informs Claude's starting state, not for actions Claude should perform during the task.
412
-
413
- **Implementation details:**
414
- For advanced patterns, environment-specific configurations, and plugin integration, see `references/plugin-features-reference.md`
415
-
416
- ## Command Organization
417
-
418
- ### Flat Structure
419
-
420
- Simple organization for small command sets:
421
-
422
- ```
423
- .claude/commands/
424
- ├── build.md
425
- ├── test.md
426
- ├── deploy.md
427
- ├── review.md
428
- └── docs.md
429
- ```
430
-
431
- **Use when:** 5-15 commands, no clear categories
432
-
433
- ### Namespaced Structure
434
-
435
- Organize commands in subdirectories:
436
-
437
- ```
438
- .claude/commands/
439
- ├── ci/
440
- │ ├── build.md # /build (project:ci)
441
- │ ├── test.md # /test (project:ci)
442
- │ └── lint.md # /lint (project:ci)
443
- ├── git/
444
- │ ├── commit.md # /commit (project:git)
445
- │ └── pr.md # /pr (project:git)
446
- └── docs/
447
- ├── generate.md # /generate (project:docs)
448
- └── publish.md # /publish (project:docs)
449
- ```
450
-
451
- **Benefits:**
452
-
453
- - Logical grouping by category
454
- - Namespace shown in `/help`
455
- - Easier to find related commands
456
-
457
- **Use when:** 15+ commands, clear categories
458
-
459
- ## Best Practices
460
-
461
- ### Command Design
462
-
463
- 1. **Single responsibility:** One command, one task
464
- 2. **Clear descriptions:** Self-explanatory in `/help`
465
- 3. **Explicit dependencies:** Use `allowed-tools` when needed
466
- 4. **Document arguments:** Always provide `argument-hint`
467
- 5. **Consistent naming:** Use verb-noun pattern (review-pr, fix-issue)
468
-
469
- ### Argument Handling
470
-
471
- 1. **Validate arguments:** Check for required arguments in prompt
472
- 2. **Provide defaults:** Suggest defaults when arguments missing
473
- 3. **Document format:** Explain expected argument format
474
- 4. **Handle edge cases:** Consider missing or invalid arguments
475
-
476
- ```markdown
477
- ---
478
- argument-hint: [pr-number]
479
- ---
480
-
481
- $IF($1,
482
- Review PR #$1,
483
- Please provide a PR number. Usage: /review-pr [number]
484
- )
485
- ```
486
-
487
- ### File References
488
-
489
- 1. **Explicit paths:** Use clear file paths
490
- 2. **Check existence:** Handle missing files gracefully
491
- 3. **Relative paths:** Use project-relative paths
492
- 4. **Glob support:** Consider using Glob tool for patterns
493
-
494
- ### Bash Commands
495
-
496
- 1. **Limit scope:** Use `Bash(git:*)` not `Bash(*)`
497
- 2. **Safe commands:** Avoid destructive operations
498
- 3. **Handle errors:** Consider command failures
499
- 4. **Keep fast:** Long-running commands slow invocation
500
-
501
- ### Documentation
502
-
503
- 1. **Add comments:** Explain complex logic
504
- 2. **Provide examples:** Show usage in comments
505
- 3. **List requirements:** Document dependencies
506
- 4. **Version commands:** Note breaking changes
507
-
508
- ## Common Patterns
509
-
510
- ### Review Pattern
511
-
512
- ```markdown
513
- ---
514
- description: Review code changes
515
- allowed-tools: Read, Bash(git:*)
516
- ---
517
-
518
- Files changed: `git diff --name-only`
519
-
520
- Review each file for code quality, bugs, test coverage, documentation needs.
521
- ```
522
-
523
- ### Testing Pattern
524
-
525
- ```markdown
526
- ---
527
- description: Run tests for specific file
528
- argument-hint: [test-file]
529
- allowed-tools: Bash(npm:*)
530
- ---
531
-
532
- Run tests: `npm test $1`
533
- Analyze results and suggest fixes for failures.
534
- ```
535
-
536
- ### Workflow Pattern
537
-
538
- ```markdown
539
- ---
540
- description: Complete PR workflow
541
- argument-hint: [pr-number]
542
- allowed-tools: Bash(gh:*), Read
543
- ---
544
-
545
- PR #$1 Workflow:
546
-
547
- 1. Fetch PR: `gh pr view $1`
548
- 2. Review changes
549
- 3. Run checks
550
- 4. Approve or request changes
551
- ```
552
-
553
- ## Troubleshooting
554
-
555
- **Command not appearing:**
556
-
557
- - Check file is in correct directory
558
- - Verify `.md` extension present
559
- - Ensure valid Markdown format
560
- - Restart Claude Code
561
-
562
- **Arguments not working:**
563
-
564
- - Verify `$1`, `$2` syntax correct
565
- - Check `argument-hint` matches usage
566
- - Ensure no extra spaces
567
-
568
- **Bash execution failing:**
569
-
570
- - Check `allowed-tools` includes Bash
571
- - Verify command syntax in backticks
572
- - Test command in terminal first
573
- - Check for required permissions
574
-
575
- **File references not working:**
576
-
577
- - Verify `@` syntax correct
578
- - Check file path is valid
579
- - Ensure Read tool allowed
580
- - Use absolute or project-relative paths
581
-
582
- ## Plugin-Specific Features
583
-
584
- ### CLAUDE_PLUGIN_ROOT Variable
585
-
586
- Plugin commands have access to `${CLAUDE_PLUGIN_ROOT}`, an environment variable that resolves to the plugin's absolute path.
587
-
588
- **Purpose:**
589
-
590
- - Reference plugin files portably
591
- - Execute plugin scripts
592
- - Load plugin configuration
593
- - Access plugin templates
594
-
595
- **Basic usage:**
596
-
597
- ```markdown
598
- ---
599
- description: Analyze using plugin script
600
- allowed-tools: Bash(node:*)
601
- ---
602
-
603
- Run analysis: `node ${CLAUDE_PLUGIN_ROOT}/scripts/analyze.js $1`
604
-
605
- Review results and report findings.
606
- ```
607
-
608
- **Common patterns:**
609
-
610
- ```markdown
611
- # Execute plugin script
612
-
613
- `bash ${CLAUDE_PLUGIN_ROOT}/scripts/script.sh`
614
-
615
- # Load plugin configuration
616
-
617
- @${CLAUDE_PLUGIN_ROOT}/config/settings.json
618
-
619
- # Use plugin template
620
-
621
- @${CLAUDE_PLUGIN_ROOT}/templates/report.md
622
-
623
- # Access plugin resources
624
-
625
- @${CLAUDE_PLUGIN_ROOT}/docs/reference.md
626
- ```
627
-
628
- **Why use it:**
629
-
630
- - Works across all installations
631
- - Portable between systems
632
- - No hardcoded paths needed
633
- - Essential for multi-file plugins
634
-
635
- ### Plugin Command Organization
636
-
637
- Plugin commands discovered automatically from `commands/` directory:
638
-
639
- ```
640
- plugin-name/
641
- ├── commands/
642
- │ ├── foo.md # /foo (plugin:plugin-name)
643
- │ ├── bar.md # /bar (plugin:plugin-name)
644
- │ └── utils/
645
- │ └── helper.md # /helper (plugin:plugin-name:utils)
646
- └── plugin.json
647
- ```
648
-
649
- **Namespace benefits:**
650
-
651
- - Logical command grouping
652
- - Shown in `/help` output
653
- - Avoid name conflicts
654
- - Organize related commands
655
-
656
- **Naming conventions:**
657
-
658
- - Use descriptive action names
659
- - Avoid generic names (test, run)
660
- - Consider plugin-specific prefix
661
- - Use hyphens for multi-word names
662
-
663
- ### Plugin Command Patterns
664
-
665
- **Configuration-based pattern:**
666
-
667
- ```markdown
668
- ---
669
- description: Deploy using plugin configuration
670
- argument-hint: [environment]
671
- allowed-tools: Read, Bash(*)
672
- ---
673
-
674
- Load configuration: @${CLAUDE_PLUGIN_ROOT}/config/$1-deploy.json
675
-
676
- Deploy to $1 using configuration settings.
677
- Monitor deployment and report status.
678
- ```
679
-
680
- **Template-based pattern:**
681
-
682
- ```markdown
683
- ---
684
- description: Generate docs from template
685
- argument-hint: [component]
686
- ---
687
-
688
- Template: @${CLAUDE_PLUGIN_ROOT}/templates/docs.md
689
-
690
- Generate documentation for $1 following template structure.
691
- ```
692
-
693
- **Multi-script pattern:**
694
-
695
- ```markdown
696
- ---
697
- description: Complete build workflow
698
- allowed-tools: Bash(*)
699
- ---
700
-
701
- Build: `bash ${CLAUDE_PLUGIN_ROOT}/scripts/build.sh`
702
- Test: `bash ${CLAUDE_PLUGIN_ROOT}/scripts/test.sh`
703
- Package: `bash ${CLAUDE_PLUGIN_ROOT}/scripts/package.sh`
704
-
705
- Review outputs and report workflow status.
706
- ```
707
-
708
- **See `references/plugin-features-reference.md` for detailed patterns.**
709
-
710
- ## Integration with Plugin Components
711
-
712
- Commands integrate with other plugin components for powerful workflows:
713
-
714
- - **Agents**: Launch plugin agents for complex tasks (agent must exist in `plugin/agents/`)
715
- - **Skills**: Leverage plugin skills for specialized knowledge (mention skill name to trigger)
716
- - **Hooks**: Coordinate with hooks that execute on tool events
717
- - **Multi-component**: Combine agents, skills, and scripts in phased workflows
718
-
719
- **See `references/plugin-integration.md` for detailed patterns and examples.**
720
-
721
- ## Validation Patterns
722
-
723
- Commands should validate inputs and resources before processing:
724
-
725
- - **Argument validation**: Check required arguments match expected values
726
- - **File existence**: Verify files exist before processing
727
- - **Plugin resources**: Validate scripts and configs are present
728
- - **Error handling**: Capture failures and provide helpful messages
729
-
730
- **Best practices:** Validate early, provide helpful errors, suggest corrections.
731
-
732
- **See `references/plugin-integration.md` for validation examples.**
733
-
734
- ---
735
-
736
- ## Additional Resources
737
-
738
- For detailed frontmatter field specifications, see `references/frontmatter-reference.md`.
739
- For Skill tool, programmatic invocation, and permission configuration, see `references/skill-tool.md`.
740
- For plugin-specific features and patterns, see `references/plugin-features-reference.md`.
741
- For plugin integration and validation patterns, see `references/plugin-integration.md`.
742
- For interactive user input patterns using AskUserQuestion, see `references/interactive-commands.md`.
743
- For multi-step command sequences and state management, see `references/advanced-workflows.md`.
744
- For self-documenting command patterns and maintenance docs, see `references/documentation-patterns.md`.
745
- For testing approaches from syntax validation to user acceptance, see `references/testing-strategies.md`.
746
- For distribution guidelines and quality standards, see `references/marketplace-considerations.md`.
747
- For command pattern examples, see `examples/` directory.
748
-
749
- ## Validation Scripts
750
-
751
- Utility scripts for validating commands (execute without loading into context):
752
-
753
- ```bash
754
- # Validate command file structure
755
- ./scripts/validate-command.sh .claude/commands/my-command.md
756
-
757
- # Validate YAML frontmatter fields
758
- ./scripts/check-frontmatter.sh .claude/commands/my-command.md
759
-
760
- # Validate multiple files
761
- ./scripts/validate-command.sh commands/*.md
762
- ./scripts/check-frontmatter.sh commands/*.md
763
- ```