@amsterdamdatalabs/enact-extensions 0.1.0 → 0.1.1

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 (152) hide show
  1. package/README.md +94 -20
  2. package/dist/index.d.ts +3 -3
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +2 -2
  5. package/dist/index.js.map +1 -1
  6. package/dist/install.d.ts +89 -0
  7. package/dist/install.d.ts.map +1 -1
  8. package/dist/install.js +219 -18
  9. package/dist/install.js.map +1 -1
  10. package/dist/validate/index.d.ts +21 -0
  11. package/dist/validate/index.d.ts.map +1 -1
  12. package/dist/validate/index.js +77 -0
  13. package/dist/validate/index.js.map +1 -1
  14. package/extensions/cmux/.agents/plugin.json +37 -0
  15. package/extensions/cmux/skills/cmux/SKILL.md +82 -0
  16. package/extensions/cmux/skills/cmux/agents/openai.yaml +4 -0
  17. package/extensions/cmux/skills/cmux/references/handles-and-identify.md +35 -0
  18. package/extensions/cmux/skills/cmux/references/panes-surfaces.md +37 -0
  19. package/extensions/cmux/skills/cmux/references/trigger-flash-and-health.md +23 -0
  20. package/extensions/cmux/skills/cmux/references/windows-workspaces.md +31 -0
  21. package/extensions/cmux/skills/cmux-vm-monitor/SKILL.md +122 -0
  22. package/extensions/cmux/skills/cmux-vm-monitor/agents/openai.yaml +4 -0
  23. package/extensions/cmux/skills/cmux-vm-monitor/references/cmux-commands.md +66 -0
  24. package/extensions/cmux/skills/cmux-vm-monitor/scripts/codex_vm_monitor.sh +45 -0
  25. package/extensions/cmux/skills/cmux-workspace/SKILL.md +93 -0
  26. package/extensions/dev-state/.agents/plugin.json +35 -0
  27. package/extensions/dev-state/skills/dev-state-plan-graduation/SKILL.md +194 -0
  28. package/extensions/dev-state/skills/dev-state-plan-graduation/agents/openai.yaml +4 -0
  29. package/extensions/dev-state/skills/dev-state-plan-graduation/references/reference.md +130 -0
  30. package/extensions/devops/.agents/plugin.json +36 -0
  31. package/extensions/devops/skills/azure-devops-cli/SKILL.md +431 -0
  32. package/extensions/devops/skills/azure-devops-cli/agents/openai.yaml +4 -0
  33. package/extensions/devops/skills/ci-pipeline-strategy/SKILL.md +217 -0
  34. package/extensions/devops/skills/ci-pipeline-strategy/agents/openai.yaml +4 -0
  35. package/{plugins/net-revenue-management/.codex-plugin → extensions/net-revenue-management/.agents}/plugin.json +10 -6
  36. package/extensions/plugin-dev/.agents/plugin.json +42 -0
  37. package/extensions/plugin-dev/.mcp.json +3 -0
  38. package/extensions/plugin-dev/agents/agent-creator.md +199 -0
  39. package/extensions/plugin-dev/agents/plugin-validator.md +91 -0
  40. package/extensions/plugin-dev/agents/skill-reviewer.md +212 -0
  41. package/extensions/plugin-dev/commands/_archive/create-marketplace.md +427 -0
  42. package/extensions/plugin-dev/commands/_archive/plugin-dev-guide.md +12 -0
  43. package/extensions/plugin-dev/commands/create-plugin.md +498 -0
  44. package/extensions/plugin-dev/commands/start.md +81 -0
  45. package/extensions/plugin-dev/hooks/hooks.json +3 -0
  46. package/extensions/plugin-dev/skills/agent-development/SKILL.md +641 -0
  47. package/extensions/plugin-dev/skills/agent-development/examples/agent-creation-prompt.md +250 -0
  48. package/extensions/plugin-dev/skills/agent-development/examples/complete-agent-examples.md +461 -0
  49. package/extensions/plugin-dev/skills/agent-development/references/advanced-agent-fields.md +246 -0
  50. package/extensions/plugin-dev/skills/agent-development/references/agent-creation-system-prompt.md +216 -0
  51. package/extensions/plugin-dev/skills/agent-development/references/permission-modes-rules.md +226 -0
  52. package/extensions/plugin-dev/skills/agent-development/references/system-prompt-design.md +464 -0
  53. package/extensions/plugin-dev/skills/agent-development/references/triggering-examples.md +474 -0
  54. package/extensions/plugin-dev/skills/agent-development/scripts/create-agent-skeleton.sh +176 -0
  55. package/extensions/plugin-dev/skills/agent-development/scripts/test-agent-trigger.sh +227 -0
  56. package/extensions/plugin-dev/skills/agent-development/scripts/validate-agent.sh +227 -0
  57. package/extensions/plugin-dev/skills/command-development/SKILL.md +763 -0
  58. package/extensions/plugin-dev/skills/command-development/examples/plugin-commands.md +612 -0
  59. package/extensions/plugin-dev/skills/command-development/examples/simple-commands.md +527 -0
  60. package/extensions/plugin-dev/skills/command-development/references/advanced-workflows.md +762 -0
  61. package/extensions/plugin-dev/skills/command-development/references/documentation-patterns.md +769 -0
  62. package/extensions/plugin-dev/skills/command-development/references/frontmatter-reference.md +508 -0
  63. package/extensions/plugin-dev/skills/command-development/references/interactive-commands.md +966 -0
  64. package/extensions/plugin-dev/skills/command-development/references/marketplace-considerations.md +943 -0
  65. package/extensions/plugin-dev/skills/command-development/references/plugin-features-reference.md +637 -0
  66. package/extensions/plugin-dev/skills/command-development/references/plugin-integration.md +191 -0
  67. package/extensions/plugin-dev/skills/command-development/references/skill-tool.md +447 -0
  68. package/extensions/plugin-dev/skills/command-development/references/testing-strategies.md +723 -0
  69. package/extensions/plugin-dev/skills/command-development/scripts/check-frontmatter.sh +234 -0
  70. package/extensions/plugin-dev/skills/command-development/scripts/validate-command.sh +160 -0
  71. package/extensions/plugin-dev/skills/hook-development/SKILL.md +861 -0
  72. package/extensions/plugin-dev/skills/hook-development/examples/load-context.sh +55 -0
  73. package/extensions/plugin-dev/skills/hook-development/examples/validate-bash.sh +57 -0
  74. package/extensions/plugin-dev/skills/hook-development/examples/validate-write.sh +48 -0
  75. package/extensions/plugin-dev/skills/hook-development/references/advanced.md +871 -0
  76. package/extensions/plugin-dev/skills/hook-development/references/hook-input-schemas.md +145 -0
  77. package/extensions/plugin-dev/skills/hook-development/references/migration.md +392 -0
  78. package/extensions/plugin-dev/skills/hook-development/references/patterns.md +430 -0
  79. package/extensions/plugin-dev/skills/hook-development/scripts/README.md +181 -0
  80. package/extensions/plugin-dev/skills/hook-development/scripts/hook-linter.sh +153 -0
  81. package/extensions/plugin-dev/skills/hook-development/scripts/test-hook.sh +276 -0
  82. package/extensions/plugin-dev/skills/hook-development/scripts/validate-hook-schema.sh +159 -0
  83. package/extensions/plugin-dev/skills/mcp-integration/SKILL.md +775 -0
  84. package/extensions/plugin-dev/skills/mcp-integration/examples/http-server.json +20 -0
  85. package/extensions/plugin-dev/skills/mcp-integration/examples/sse-server.json +19 -0
  86. package/extensions/plugin-dev/skills/mcp-integration/examples/stdio-server.json +38 -0
  87. package/extensions/plugin-dev/skills/mcp-integration/examples/ws-server.json +26 -0
  88. package/extensions/plugin-dev/skills/mcp-integration/references/authentication.md +601 -0
  89. package/extensions/plugin-dev/skills/mcp-integration/references/server-discovery.md +190 -0
  90. package/extensions/plugin-dev/skills/mcp-integration/references/server-types.md +572 -0
  91. package/extensions/plugin-dev/skills/mcp-integration/references/tool-usage.md +623 -0
  92. package/extensions/plugin-dev/skills/plugin-dev-guide/SKILL.md +222 -0
  93. package/extensions/plugin-dev/skills/plugin-structure/SKILL.md +705 -0
  94. package/extensions/plugin-dev/skills/plugin-structure/examples/advanced-plugin.md +774 -0
  95. package/extensions/plugin-dev/skills/plugin-structure/examples/minimal-plugin.md +83 -0
  96. package/extensions/plugin-dev/skills/plugin-structure/examples/standard-plugin.md +611 -0
  97. package/extensions/plugin-dev/skills/plugin-structure/references/advanced-topics.md +289 -0
  98. package/extensions/plugin-dev/skills/plugin-structure/references/component-patterns.md +592 -0
  99. package/extensions/plugin-dev/skills/plugin-structure/references/github-actions.md +233 -0
  100. package/extensions/plugin-dev/skills/plugin-structure/references/headless-ci-mode.md +193 -0
  101. package/extensions/plugin-dev/skills/plugin-structure/references/manifest-reference.md +625 -0
  102. package/extensions/plugin-dev/skills/plugin-structure/references/output-styles.md +116 -0
  103. package/extensions/plugin-dev/skills/skill-development/SKILL.md +564 -0
  104. package/extensions/plugin-dev/skills/skill-development/examples/complete-skill.md +465 -0
  105. package/extensions/plugin-dev/skills/skill-development/examples/frontmatter-templates.md +167 -0
  106. package/extensions/plugin-dev/skills/skill-development/examples/minimal-skill.md +111 -0
  107. package/extensions/plugin-dev/skills/skill-development/references/advanced-frontmatter.md +225 -0
  108. package/extensions/plugin-dev/skills/skill-development/references/commands-vs-skills.md +39 -0
  109. package/extensions/plugin-dev/skills/skill-development/references/skill-creation-workflow.md +379 -0
  110. package/extensions/plugin-dev/skills/skill-development/references/skill-creator-original.md +210 -0
  111. package/package.json +8 -11
  112. package/scripts/enact-extensions.mjs +751 -16
  113. package/scripts/hooks/session-start-drift-check.mjs +58 -0
  114. package/scripts/lib/build-index.mjs +50 -0
  115. package/scripts/lib/bundle-hash.mjs +137 -0
  116. package/scripts/lib/hooks.mjs +389 -0
  117. package/scripts/lib/ledger.mjs +162 -0
  118. package/scripts/lib/list-bundles.mjs +70 -0
  119. package/scripts/lib/outdated.mjs +144 -0
  120. package/scripts/lib/provision-mcp.mjs +369 -0
  121. package/scripts/lib/resolve-bundle.mjs +121 -0
  122. package/scripts/lib/run-install.mjs +321 -39
  123. package/scripts/lib/run-uninstall.mjs +220 -0
  124. package/scripts/lib/run-update.mjs +152 -0
  125. package/scripts/lib/run-validate.mjs +12 -18
  126. package/scripts/lib/serve.mjs +454 -0
  127. package/scripts/postinstall.mjs +63 -0
  128. package/scripts/setup-enact-context.sh +2 -2
  129. package/spec/index.json +59 -0
  130. package/web/assets/README.md +111 -0
  131. package/web/assets/logo-full.png +0 -0
  132. package/web/assets/logo-slim.png +0 -0
  133. package/web/assets/tokens/base.css +45 -0
  134. package/web/assets/tokens/colors.css +248 -0
  135. package/web/assets/tokens/effects.css +24 -0
  136. package/web/assets/tokens/fonts.css +8 -0
  137. package/web/assets/tokens/index.css +18 -0
  138. package/web/assets/tokens/spacing.css +50 -0
  139. package/web/index.html +1188 -0
  140. package/.agents/plugins/marketplace.json +0 -20
  141. package/catalog/enact-context.json +0 -9
  142. package/catalog/enact-factory.json +0 -7
  143. package/catalog/enact-operator.json +0 -7
  144. package/catalog/enact-wiki.json +0 -7
  145. package/catalog/net-revenue-management.json +0 -8
  146. package/scripts/rename-supervisor-to-operator.pl +0 -66
  147. package/scripts/sync-manifests.mjs +0 -23
  148. package/scripts/validate-catalog.mjs +0 -37
  149. package/scripts/validate-plugin.mjs +0 -10
  150. /package/{plugins → extensions}/net-revenue-management/.mcp.json +0 -0
  151. /package/{plugins → extensions}/net-revenue-management/skills/net-revenue-risks/SKILL.md +0 -0
  152. /package/{plugins → extensions}/net-revenue-management/skills/net-revenue-scenario/SKILL.md +0 -0
@@ -0,0 +1,637 @@
1
+ # Plugin-Specific Command Features Reference
2
+
3
+ This reference covers features and patterns specific to commands bundled in Claude Code plugins.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Plugin Command Discovery](#plugin-command-discovery)
8
+ - [CLAUDE_PLUGIN_ROOT Environment Variable](#claude_plugin_root-environment-variable)
9
+ - [Plugin Command Patterns](#plugin-command-patterns)
10
+ - [Integration with Plugin Components](#integration-with-plugin-components)
11
+ - [Validation Patterns](#validation-patterns)
12
+
13
+ ## Plugin Command Discovery
14
+
15
+ ### Auto-Discovery
16
+
17
+ Claude Code automatically discovers commands in plugins using the following locations:
18
+
19
+ ```
20
+ plugin-name/
21
+ ├── commands/ # Auto-discovered commands
22
+ │ ├── foo.md # /foo (plugin:plugin-name)
23
+ │ └── bar.md # /bar (plugin:plugin-name)
24
+ └── plugin.json # Plugin manifest
25
+ ```
26
+
27
+ **Key points:**
28
+
29
+ - Commands are discovered at plugin load time
30
+ - No manual registration required
31
+ - Commands appear in `/help` with "(plugin:plugin-name)" label
32
+ - Subdirectories create namespaces
33
+
34
+ ### Namespaced Plugin Commands
35
+
36
+ Organize commands in subdirectories for logical grouping:
37
+
38
+ ```
39
+ plugin-name/
40
+ └── commands/
41
+ ├── review/
42
+ │ ├── security.md # /security (plugin:plugin-name:review)
43
+ │ └── style.md # /style (plugin:plugin-name:review)
44
+ └── deploy/
45
+ ├── staging.md # /staging (plugin:plugin-name:deploy)
46
+ └── prod.md # /prod (plugin:plugin-name:deploy)
47
+ ```
48
+
49
+ **Namespace behavior:**
50
+
51
+ - Subdirectory name becomes namespace
52
+ - Shown as "(plugin:plugin-name:namespace)" in `/help`
53
+ - Helps organize related commands
54
+ - Use when plugin has 5+ commands
55
+
56
+ ### Command Naming Conventions
57
+
58
+ **Plugin command names should:**
59
+
60
+ 1. Be descriptive and action-oriented
61
+ 2. Avoid conflicts with common command names
62
+ 3. Use hyphens for multi-word names
63
+ 4. Consider prefixing with plugin name for uniqueness
64
+
65
+ **Examples:**
66
+
67
+ ```
68
+ Good:
69
+ - /mylyn-sync (plugin-specific prefix)
70
+ - /analyze-performance (descriptive action)
71
+ - /docker-compose-up (clear purpose)
72
+
73
+ Avoid:
74
+ - /test (conflicts with common name)
75
+ - /run (too generic)
76
+ - /do-stuff (not descriptive)
77
+ ```
78
+
79
+ ## CLAUDE_PLUGIN_ROOT Environment Variable
80
+
81
+ ### Purpose
82
+
83
+ `${CLAUDE_PLUGIN_ROOT}` is a special environment variable available in plugin commands that resolves to the absolute path of the plugin directory.
84
+
85
+ **Why it matters:**
86
+
87
+ - Enables portable paths within plugin
88
+ - Allows referencing plugin files and scripts
89
+ - Works across different installations
90
+ - Essential for multi-file plugin operations
91
+
92
+ ### Basic Usage
93
+
94
+ Reference files within your plugin:
95
+
96
+ ```markdown
97
+ ---
98
+ description: Analyze using plugin script
99
+ allowed-tools: Bash(node:*), Read
100
+ ---
101
+
102
+ Run analysis: [BANG]`node ${CLAUDE_PLUGIN_ROOT}/scripts/analyze.js`
103
+
104
+ Read template: @${CLAUDE_PLUGIN_ROOT}/templates/report.md
105
+ ```
106
+
107
+ **Expands to:**
108
+
109
+ ```markdown
110
+ Run analysis: [actual output from analyze.js]
111
+
112
+ Read template: @/path/to/plugins/plugin-name/templates/report.md
113
+ ```
114
+
115
+ ### Common Patterns
116
+
117
+ #### 1. Executing Plugin Scripts
118
+
119
+ ```markdown
120
+ ---
121
+ description: Run custom linter from plugin
122
+ allowed-tools: Bash(node:*)
123
+ ---
124
+
125
+ Lint results: [BANG]`node ${CLAUDE_PLUGIN_ROOT}/bin/lint.js $1`
126
+
127
+ Review the linting output and suggest fixes.
128
+ ```
129
+
130
+ #### 2. Loading Configuration Files
131
+
132
+ ```markdown
133
+ ---
134
+ description: Deploy using plugin configuration
135
+ allowed-tools: Read, Bash(*)
136
+ ---
137
+
138
+ Configuration: @${CLAUDE_PLUGIN_ROOT}/config/deploy-config.json
139
+
140
+ Deploy application using the configuration above for $1 environment.
141
+ ```
142
+
143
+ #### 3. Accessing Plugin Resources
144
+
145
+ ```markdown
146
+ ---
147
+ description: Generate report from template
148
+ ---
149
+
150
+ Use this template: @${CLAUDE_PLUGIN_ROOT}/templates/api-report.md
151
+
152
+ Generate a report for @$1 following the template format.
153
+ ```
154
+
155
+ #### 4. Multi-Step Plugin Workflows
156
+
157
+ ```markdown
158
+ ---
159
+ description: Complete plugin workflow
160
+ allowed-tools: Bash(*), Read
161
+ ---
162
+
163
+ Step 1 - Prepare: [BANG]`bash ${CLAUDE_PLUGIN_ROOT}/scripts/prepare.sh $1`
164
+ Step 2 - Config: @${CLAUDE_PLUGIN_ROOT}/config/$1.json
165
+ Step 3 - Execute: [BANG]`${CLAUDE_PLUGIN_ROOT}/bin/execute $1`
166
+
167
+ Review results and report status.
168
+ ```
169
+
170
+ ### Best Practices
171
+
172
+ 1. **Always use for plugin-internal paths:**
173
+
174
+ ```markdown
175
+ # Good
176
+
177
+ @${CLAUDE_PLUGIN_ROOT}/templates/foo.md
178
+
179
+ # Bad
180
+
181
+ @./templates/foo.md # Relative to current directory, not plugin
182
+ ```
183
+
184
+ 2. **Validate file existence:**
185
+
186
+ ```markdown
187
+ ---
188
+ description: Use plugin config if exists
189
+ allowed-tools: Bash(test:*), Read
190
+ ---
191
+
192
+ [BANG]`test -f ${CLAUDE_PLUGIN_ROOT}/config.json && echo "exists" || echo "missing"`
193
+
194
+ If config exists, load it: @${CLAUDE_PLUGIN_ROOT}/config.json
195
+ Otherwise, use defaults...
196
+ ```
197
+
198
+ 3. **Document plugin file structure:**
199
+
200
+ ```markdown
201
+ <!--
202
+ Plugin structure:
203
+ ${CLAUDE_PLUGIN_ROOT}/
204
+ ├── scripts/analyze.js (analysis script)
205
+ ├── templates/ (report templates)
206
+ └── config/ (configuration files)
207
+ -->
208
+ ```
209
+
210
+ 4. **Combine with arguments:**
211
+ ```markdown
212
+ Run: [BANG]`${CLAUDE_PLUGIN_ROOT}/bin/process.sh $1 $2`
213
+ ```
214
+
215
+ ### Troubleshooting
216
+
217
+ **Variable not expanding:**
218
+
219
+ - Ensure command is loaded from plugin
220
+ - Check bash execution is allowed
221
+ - Verify syntax is exact: `${CLAUDE_PLUGIN_ROOT}`
222
+
223
+ **File not found errors:**
224
+
225
+ - Verify file exists in plugin directory
226
+ - Check file path is correct relative to plugin root
227
+ - Ensure file permissions allow reading/execution
228
+
229
+ **Path with spaces:**
230
+
231
+ - Bash commands automatically handle spaces
232
+ - File references work with spaces in paths
233
+ - No special quoting needed
234
+
235
+ ## Plugin Command Patterns
236
+
237
+ ### Pattern 1: Configuration-Based Commands
238
+
239
+ Commands that load plugin-specific configuration:
240
+
241
+ ```markdown
242
+ ---
243
+ description: Deploy using plugin settings
244
+ allowed-tools: Read, Bash(*)
245
+ ---
246
+
247
+ Load configuration: @${CLAUDE_PLUGIN_ROOT}/deploy-config.json
248
+
249
+ Deploy to $1 environment using:
250
+
251
+ 1. Configuration settings above
252
+ 2. Current git branch: [BANG]`git branch --show-current`
253
+ 3. Application version: [BANG]`cat package.json | grep version`
254
+
255
+ Execute deployment and monitor progress.
256
+ ```
257
+
258
+ **When to use:** Commands that need consistent settings across invocations
259
+
260
+ ### Pattern 2: Template-Based Generation
261
+
262
+ Commands that use plugin templates:
263
+
264
+ ```markdown
265
+ ---
266
+ description: Generate documentation from template
267
+ argument-hint: [component-name]
268
+ ---
269
+
270
+ Template: @${CLAUDE_PLUGIN_ROOT}/templates/component-docs.md
271
+
272
+ Generate documentation for $1 component following the template structure.
273
+ Include:
274
+
275
+ - Component purpose and usage
276
+ - API reference
277
+ - Examples
278
+ - Testing guidelines
279
+ ```
280
+
281
+ **When to use:** Standardized output generation
282
+
283
+ ### Pattern 3: Multi-Script Workflow
284
+
285
+ Commands that orchestrate multiple plugin scripts:
286
+
287
+ ```markdown
288
+ ---
289
+ description: Complete build and test workflow
290
+ allowed-tools: Bash(*)
291
+ ---
292
+
293
+ Build: [BANG]`bash ${CLAUDE_PLUGIN_ROOT}/scripts/build.sh`
294
+ Validate: [BANG]`bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh`
295
+ Test: [BANG]`bash ${CLAUDE_PLUGIN_ROOT}/scripts/test.sh`
296
+
297
+ Review all outputs and report:
298
+
299
+ 1. Build status
300
+ 2. Validation results
301
+ 3. Test results
302
+ 4. Recommended next steps
303
+ ```
304
+
305
+ **When to use:** Complex plugin workflows with multiple steps
306
+
307
+ ### Pattern 4: Environment-Aware Commands
308
+
309
+ Commands that adapt to environment:
310
+
311
+ ```markdown
312
+ ---
313
+ description: Deploy based on environment
314
+ argument-hint: [dev|staging|prod]
315
+ ---
316
+
317
+ Environment config: @${CLAUDE_PLUGIN_ROOT}/config/$1.json
318
+
319
+ Environment check: [BANG]`echo "Deploying to: $1"`
320
+
321
+ Deploy application using $1 environment configuration.
322
+ Verify deployment and run smoke tests.
323
+ ```
324
+
325
+ **When to use:** Commands that behave differently per environment
326
+
327
+ ### Pattern 5: Plugin Data Management
328
+
329
+ Commands that manage plugin-specific data:
330
+
331
+ ```markdown
332
+ ---
333
+ description: Save analysis results to plugin cache
334
+ allowed-tools: Bash(*), Read, Write
335
+ ---
336
+
337
+ Cache directory: ${CLAUDE_PLUGIN_ROOT}/cache/
338
+
339
+ Analyze @$1 and save results to cache:
340
+ [BANG]`mkdir -p ${CLAUDE_PLUGIN_ROOT}/cache && date > ${CLAUDE_PLUGIN_ROOT}/cache/last-run.txt`
341
+
342
+ Store analysis for future reference and comparison.
343
+ ```
344
+
345
+ **When to use:** Commands that need persistent data storage
346
+
347
+ ## Integration with Plugin Components
348
+
349
+ ### Invoking Plugin Agents
350
+
351
+ Commands can trigger plugin agents using the Task tool:
352
+
353
+ ```markdown
354
+ ---
355
+ description: Deep analysis using plugin agent
356
+ argument-hint: [file-path]
357
+ ---
358
+
359
+ Initiate deep code analysis of @$1 using the code-analyzer agent.
360
+
361
+ The agent will:
362
+
363
+ 1. Analyze code structure
364
+ 2. Identify patterns
365
+ 3. Suggest improvements
366
+ 4. Generate detailed report
367
+
368
+ Note: This uses the Task tool to launch the plugin's code-analyzer agent.
369
+ ```
370
+
371
+ **Key points:**
372
+
373
+ - Agent must be defined in plugin's `agents/` directory
374
+ - Claude will automatically use Task tool to launch agent
375
+ - Agent has access to same plugin resources
376
+
377
+ ### Invoking Plugin Skills
378
+
379
+ Commands can reference plugin skills for specialized knowledge:
380
+
381
+ ```markdown
382
+ ---
383
+ description: API documentation with best practices
384
+ argument-hint: [api-file]
385
+ ---
386
+
387
+ Document the API in @$1 following our API documentation standards.
388
+
389
+ Use the api-docs-standards skill to ensure documentation includes:
390
+
391
+ - Endpoint descriptions
392
+ - Parameter specifications
393
+ - Response formats
394
+ - Error codes
395
+ - Usage examples
396
+
397
+ Note: This leverages the plugin's api-docs-standards skill for consistency.
398
+ ```
399
+
400
+ **Key points:**
401
+
402
+ - Skill must be defined in plugin's `skills/` directory
403
+ - Mention skill by name to hint Claude should invoke it
404
+ - Skills provide specialized domain knowledge
405
+
406
+ ### Coordinating with Plugin Hooks
407
+
408
+ Commands can be designed to work with plugin hooks:
409
+
410
+ ```markdown
411
+ ---
412
+ description: Commit with pre-commit validation
413
+ allowed-tools: Bash(git:*)
414
+ ---
415
+
416
+ Stage changes: [BANG]`git add $1`
417
+
418
+ Commit changes: [BANG]`git commit -m "$2"`
419
+
420
+ Note: This commit will trigger the plugin's pre-commit hook for validation.
421
+ Review hook output for any issues.
422
+ ```
423
+
424
+ **Key points:**
425
+
426
+ - Hooks execute automatically on events
427
+ - Commands can prepare state for hooks
428
+ - Document hook interaction in command
429
+
430
+ ### Multi-Component Plugin Commands
431
+
432
+ Commands that coordinate multiple plugin components:
433
+
434
+ ```markdown
435
+ ---
436
+ description: Comprehensive code review workflow
437
+ argument-hint: [file-path]
438
+ ---
439
+
440
+ File to review: @$1
441
+
442
+ Execute comprehensive review:
443
+
444
+ 1. **Static Analysis** (via plugin scripts)
445
+ [BANG]`node ${CLAUDE_PLUGIN_ROOT}/scripts/lint.js $1`
446
+
447
+ 2. **Deep Review** (via plugin agent)
448
+ Launch the code-reviewer agent for detailed analysis.
449
+
450
+ 3. **Best Practices** (via plugin skill)
451
+ Use the code-standards skill to ensure compliance.
452
+
453
+ 4. **Documentation** (via plugin template)
454
+ Template: @${CLAUDE_PLUGIN_ROOT}/templates/review-report.md
455
+
456
+ Generate final report combining all outputs.
457
+ ```
458
+
459
+ **When to use:** Complex workflows leveraging multiple plugin capabilities
460
+
461
+ ## Validation Patterns
462
+
463
+ ### Input Validation
464
+
465
+ Commands should validate inputs before processing:
466
+
467
+ ```markdown
468
+ ---
469
+ description: Deploy to environment with validation
470
+ argument-hint: [environment]
471
+ ---
472
+
473
+ Validate environment: [BANG]`echo "$1" | grep -E "^(dev|staging|prod)$" || echo "INVALID"`
474
+
475
+ $IF($1 in [dev, staging, prod],
476
+ Deploy to $1 environment using validated configuration,
477
+ ERROR: Invalid environment '$1'. Must be one of: dev, staging, prod
478
+ )
479
+ ```
480
+
481
+ **Validation approaches:**
482
+
483
+ 1. Bash validation using grep/test
484
+ 2. Inline validation in prompt
485
+ 3. Script-based validation
486
+
487
+ ### File Existence Checks
488
+
489
+ Verify required files exist:
490
+
491
+ ```markdown
492
+ ---
493
+ description: Process configuration file
494
+ argument-hint: [config-file]
495
+ ---
496
+
497
+ Check file: [BANG]`test -f $1 && echo "EXISTS" || echo "MISSING"`
498
+
499
+ Process configuration if file exists: @$1
500
+
501
+ If file doesn't exist, explain:
502
+
503
+ - Expected location
504
+ - Required format
505
+ - How to create it
506
+ ```
507
+
508
+ ### Required Arguments
509
+
510
+ Validate required arguments provided:
511
+
512
+ ```markdown
513
+ ---
514
+ description: Create deployment with version
515
+ argument-hint: [environment] [version]
516
+ ---
517
+
518
+ Validate inputs: [BANG]`test -n "$1" -a -n "$2" && echo "OK" || echo "MISSING"`
519
+
520
+ $IF($1 AND $2,
521
+ Deploy version $2 to $1 environment,
522
+ ERROR: Both environment and version required. Usage: /deploy [env] [version]
523
+ )
524
+ ```
525
+
526
+ ### Plugin Resource Validation
527
+
528
+ Verify plugin resources available:
529
+
530
+ ```markdown
531
+ ---
532
+ description: Run analysis with plugin tools
533
+ allowed-tools: Bash(test:*)
534
+ ---
535
+
536
+ Validate plugin setup:
537
+
538
+ - Config exists: [BANG]`test -f ${CLAUDE_PLUGIN_ROOT}/config.json && echo "✓" || echo "✗"`
539
+ - Scripts exist: [BANG]`test -d ${CLAUDE_PLUGIN_ROOT}/scripts && echo "✓" || echo "✗"`
540
+ - Tools available: [BANG]`test -x ${CLAUDE_PLUGIN_ROOT}/bin/analyze && echo "✓" || echo "✗"`
541
+
542
+ If all checks pass, proceed with analysis.
543
+ Otherwise, report missing components and installation steps.
544
+ ```
545
+
546
+ ### Output Validation
547
+
548
+ Validate command execution results:
549
+
550
+ ```markdown
551
+ ---
552
+ description: Build and validate output
553
+ allowed-tools: Bash(*)
554
+ ---
555
+
556
+ Build: [BANG]`bash ${CLAUDE_PLUGIN_ROOT}/scripts/build.sh`
557
+
558
+ Validate output:
559
+
560
+ - Exit code: [BANG]`echo $?`
561
+ - Output exists: [BANG]`test -d dist && echo "✓" || echo "✗"`
562
+ - File count: [BANG]`find dist -type f | wc -l`
563
+
564
+ Report build status and any validation failures.
565
+ ```
566
+
567
+ ### Graceful Error Handling
568
+
569
+ Handle errors gracefully with helpful messages:
570
+
571
+ ```markdown
572
+ ---
573
+ description: Process file with error handling
574
+ argument-hint: [file-path]
575
+ ---
576
+
577
+ Try processing: [BANG]`node ${CLAUDE_PLUGIN_ROOT}/scripts/process.js $1 2>&1 || echo "ERROR: $?"`
578
+
579
+ If processing succeeded:
580
+
581
+ - Report results
582
+ - Suggest next steps
583
+
584
+ If processing failed:
585
+
586
+ - Explain likely causes
587
+ - Provide troubleshooting steps
588
+ - Suggest alternative approaches
589
+ ```
590
+
591
+ ## Best Practices Summary
592
+
593
+ ### Plugin Commands Should
594
+
595
+ 1. **Use ${CLAUDE_PLUGIN_ROOT} for all plugin-internal paths**
596
+ - Scripts, templates, configuration, resources
597
+
598
+ 2. **Validate inputs early**
599
+ - Check required arguments
600
+ - Verify file existence
601
+ - Validate argument formats
602
+
603
+ 3. **Document plugin structure**
604
+ - Explain required files
605
+ - Document script purposes
606
+ - Clarify dependencies
607
+
608
+ 4. **Integrate with plugin components**
609
+ - Reference agents for complex tasks
610
+ - Use skills for specialized knowledge
611
+ - Coordinate with hooks when relevant
612
+
613
+ 5. **Provide helpful error messages**
614
+ - Explain what went wrong
615
+ - Suggest how to fix
616
+ - Offer alternatives
617
+
618
+ 6. **Handle edge cases**
619
+ - Missing files
620
+ - Invalid arguments
621
+ - Failed script execution
622
+ - Missing dependencies
623
+
624
+ 7. **Keep commands focused**
625
+ - One clear purpose per command
626
+ - Delegate complex logic to scripts
627
+ - Use agents for multi-step workflows
628
+
629
+ 8. **Test across installations**
630
+ - Verify paths work everywhere
631
+ - Test with different arguments
632
+ - Validate error cases
633
+
634
+ ---
635
+
636
+ For general command development, see main SKILL.md.
637
+ For command examples, see examples/ directory.