@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,612 @@
1
+ # Plugin Command Examples
2
+
3
+ Practical examples of commands designed for Claude Code plugins, demonstrating plugin-specific patterns and features.
4
+
5
+ ## Table of Contents
6
+
7
+ 1. [Simple Plugin Command](#1-simple-plugin-command)
8
+ 2. [Script-Based Analysis](#2-script-based-analysis)
9
+ 3. [Template-Based Generation](#3-template-based-generation)
10
+ 4. [Multi-Script Workflow](#4-multi-script-workflow)
11
+ 5. [Configuration-Driven Deployment](#5-configuration-driven-deployment)
12
+ 6. [Agent Integration](#6-agent-integration)
13
+ 7. [Skill Integration](#7-skill-integration)
14
+ 8. [Multi-Component Workflow](#8-multi-component-workflow)
15
+ 9. [Validated Input Command](#9-validated-input-command)
16
+ 10. [Environment-Aware Command](#10-environment-aware-command)
17
+
18
+ ---
19
+
20
+ ## 1. Simple Plugin Command
21
+
22
+ **Use case:** Basic command that uses plugin script
23
+
24
+ **File:** `commands/analyze.md`
25
+
26
+ ```markdown
27
+ ---
28
+ description: Analyze code quality using plugin tools
29
+ argument-hint: [file-path]
30
+ allowed-tools: Bash(node:*), Read
31
+ ---
32
+
33
+ Analyze @$1 using plugin's quality checker:
34
+
35
+ `node ${CLAUDE_PLUGIN_ROOT}/scripts/quality-check.js $1`
36
+
37
+ Review the analysis output and provide:
38
+
39
+ 1. Summary of findings
40
+ 2. Priority issues to address
41
+ 3. Suggested improvements
42
+ 4. Code quality score interpretation
43
+ ```
44
+
45
+ **Key features:**
46
+
47
+ - Uses `${CLAUDE_PLUGIN_ROOT}` for portable path
48
+ - Combines file reference with script execution
49
+ - Simple single-purpose command
50
+
51
+ ---
52
+
53
+ ## 2. Script-Based Analysis
54
+
55
+ **Use case:** Run comprehensive analysis using multiple plugin scripts
56
+
57
+ **File:** `commands/full-audit.md`
58
+
59
+ ```markdown
60
+ ---
61
+ description: Complete code audit using plugin suite
62
+ argument-hint: [directory]
63
+ allowed-tools: Bash(*)
64
+ model: sonnet
65
+ ---
66
+
67
+ Running complete audit on $1:
68
+
69
+ **Security scan:**
70
+ `bash ${CLAUDE_PLUGIN_ROOT}/scripts/security-scan.sh $1`
71
+
72
+ **Performance analysis:**
73
+ `bash ${CLAUDE_PLUGIN_ROOT}/scripts/perf-analyze.sh $1`
74
+
75
+ **Best practices check:**
76
+ `bash ${CLAUDE_PLUGIN_ROOT}/scripts/best-practices.sh $1`
77
+
78
+ Analyze all results and create comprehensive report including:
79
+
80
+ - Critical issues requiring immediate attention
81
+ - Performance optimization opportunities
82
+ - Security vulnerabilities and fixes
83
+ - Overall health score and recommendations
84
+ ```
85
+
86
+ **Key features:**
87
+
88
+ - Multiple script executions
89
+ - Organized output sections
90
+ - Comprehensive workflow
91
+ - Clear reporting structure
92
+
93
+ ---
94
+
95
+ ## 3. Template-Based Generation
96
+
97
+ **Use case:** Generate documentation following plugin template
98
+
99
+ **File:** `commands/gen-api-docs.md`
100
+
101
+ ```markdown
102
+ ---
103
+ description: Generate API documentation from template
104
+ argument-hint: [api-file]
105
+ ---
106
+
107
+ Template structure: @${CLAUDE_PLUGIN_ROOT}/templates/api-documentation.md
108
+
109
+ API implementation: @$1
110
+
111
+ Generate complete API documentation following the template format above.
112
+
113
+ Ensure documentation includes:
114
+
115
+ - Endpoint descriptions with HTTP methods
116
+ - Request/response schemas
117
+ - Authentication requirements
118
+ - Error codes and handling
119
+ - Usage examples with curl commands
120
+ - Rate limiting information
121
+
122
+ Format output as markdown suitable for README or docs site.
123
+ ```
124
+
125
+ **Key features:**
126
+
127
+ - Uses plugin template
128
+ - Combines template with source file
129
+ - Standardized output format
130
+ - Clear documentation structure
131
+
132
+ ---
133
+
134
+ ## 4. Multi-Script Workflow
135
+
136
+ **Use case:** Orchestrate build, test, and deploy workflow
137
+
138
+ **File:** `commands/release.md`
139
+
140
+ ```markdown
141
+ ---
142
+ description: Execute complete release workflow
143
+ argument-hint: [version]
144
+ allowed-tools: Bash(*), Read
145
+ ---
146
+
147
+ Executing release workflow for version $1:
148
+
149
+ **Step 1 - Pre-release validation:**
150
+ `bash ${CLAUDE_PLUGIN_ROOT}/scripts/pre-release-check.sh $1`
151
+
152
+ **Step 2 - Build artifacts:**
153
+ `bash ${CLAUDE_PLUGIN_ROOT}/scripts/build-release.sh $1`
154
+
155
+ **Step 3 - Run test suite:**
156
+ `bash ${CLAUDE_PLUGIN_ROOT}/scripts/run-tests.sh`
157
+
158
+ **Step 4 - Package release:**
159
+ `bash ${CLAUDE_PLUGIN_ROOT}/scripts/package.sh $1`
160
+
161
+ Review all step outputs and report:
162
+
163
+ 1. Any failures or warnings
164
+ 2. Build artifacts location
165
+ 3. Test results summary
166
+ 4. Next steps for deployment
167
+ 5. Rollback plan if needed
168
+ ```
169
+
170
+ **Key features:**
171
+
172
+ - Multi-step workflow
173
+ - Sequential script execution
174
+ - Clear step numbering
175
+ - Comprehensive reporting
176
+
177
+ ---
178
+
179
+ ## 5. Configuration-Driven Deployment
180
+
181
+ **Use case:** Deploy using environment-specific plugin configuration
182
+
183
+ **File:** `commands/deploy.md`
184
+
185
+ ```markdown
186
+ ---
187
+ description: Deploy application to environment
188
+ argument-hint: [environment]
189
+ allowed-tools: Read, Bash(*)
190
+ ---
191
+
192
+ Deployment configuration for $1: @${CLAUDE_PLUGIN_ROOT}/config/$1-deploy.json
193
+
194
+ Current git state: `git rev-parse --short HEAD`
195
+
196
+ Build info: `cat package.json | grep -E '(name|version)'`
197
+
198
+ Execute deployment to $1 environment using configuration above.
199
+
200
+ Deployment checklist:
201
+
202
+ 1. Validate configuration settings
203
+ 2. Build application for $1
204
+ 3. Run pre-deployment tests
205
+ 4. Deploy to target environment
206
+ 5. Run smoke tests
207
+ 6. Verify deployment success
208
+ 7. Update deployment log
209
+
210
+ Report deployment status and any issues encountered.
211
+ ```
212
+
213
+ **Key features:**
214
+
215
+ - Environment-specific configuration
216
+ - Dynamic config file loading
217
+ - Pre-deployment validation
218
+ - Structured checklist
219
+
220
+ ---
221
+
222
+ ## 6. Agent Integration
223
+
224
+ **Use case:** Command that launches plugin agent for complex task
225
+
226
+ **File:** `commands/deep-review.md`
227
+
228
+ ```markdown
229
+ ---
230
+ description: Deep code review using plugin agent
231
+ argument-hint: [file-or-directory]
232
+ ---
233
+
234
+ Initiate comprehensive code review of @$1 using the code-reviewer agent.
235
+
236
+ The agent will perform:
237
+
238
+ 1. **Static analysis** - Check for code smells and anti-patterns
239
+ 2. **Security audit** - Identify potential vulnerabilities
240
+ 3. **Performance review** - Find optimization opportunities
241
+ 4. **Best practices** - Ensure code follows standards
242
+ 5. **Documentation check** - Verify adequate documentation
243
+
244
+ The agent has access to:
245
+
246
+ - Plugin's linting rules: ${CLAUDE_PLUGIN_ROOT}/config/lint-rules.json
247
+ - Security checklist: ${CLAUDE_PLUGIN_ROOT}/checklists/security.md
248
+ - Performance guidelines: ${CLAUDE_PLUGIN_ROOT}/docs/performance.md
249
+
250
+ Note: This uses the Task tool to launch the plugin's code-reviewer agent for thorough analysis.
251
+ ```
252
+
253
+ **Key features:**
254
+
255
+ - Delegates to plugin agent
256
+ - Documents agent capabilities
257
+ - References plugin resources
258
+ - Clear scope definition
259
+
260
+ ---
261
+
262
+ ## 7. Skill Integration
263
+
264
+ **Use case:** Command that leverages plugin skill for specialized knowledge
265
+
266
+ **File:** `commands/document-api.md`
267
+
268
+ ```markdown
269
+ ---
270
+ description: Document API following plugin standards
271
+ argument-hint: [api-file]
272
+ ---
273
+
274
+ API source code: @$1
275
+
276
+ Generate API documentation following the plugin's API documentation standards.
277
+
278
+ Use the api-documentation-standards skill to ensure:
279
+
280
+ - **OpenAPI compliance** - Follow OpenAPI 3.0 specification
281
+ - **Consistent formatting** - Use plugin's documentation style
282
+ - **Complete coverage** - Document all endpoints and schemas
283
+ - **Example quality** - Provide realistic usage examples
284
+ - **Error documentation** - Cover all error scenarios
285
+
286
+ The skill provides:
287
+
288
+ - Standard documentation templates
289
+ - API documentation best practices
290
+ - Common patterns for this codebase
291
+ - Quality validation criteria
292
+
293
+ Generate production-ready API documentation.
294
+ ```
295
+
296
+ **Key features:**
297
+
298
+ - Invokes plugin skill by name
299
+ - Documents skill purpose
300
+ - Clear expectations
301
+ - Leverages skill knowledge
302
+
303
+ ---
304
+
305
+ ## 8. Multi-Component Workflow
306
+
307
+ **Use case:** Complex workflow using agents, skills, and scripts
308
+
309
+ **File:** `commands/complete-review.md`
310
+
311
+ ```markdown
312
+ ---
313
+ description: Comprehensive review using all plugin components
314
+ argument-hint: [file-path]
315
+ allowed-tools: Bash(node:*), Read
316
+ ---
317
+
318
+ Target file: @$1
319
+
320
+ Execute comprehensive review workflow:
321
+
322
+ **Phase 1: Automated Analysis**
323
+ Run plugin analyzer: `node ${CLAUDE_PLUGIN_ROOT}/scripts/analyze.js $1`
324
+
325
+ **Phase 2: Deep Review (Agent)**
326
+ Launch the code-quality-reviewer agent for detailed analysis.
327
+ Agent will examine:
328
+
329
+ - Code structure and organization
330
+ - Error handling patterns
331
+ - Testing coverage
332
+ - Documentation quality
333
+
334
+ **Phase 3: Standards Check (Skill)**
335
+ Use the coding-standards skill to validate:
336
+
337
+ - Naming conventions
338
+ - Code formatting
339
+ - Best practices adherence
340
+ - Framework-specific patterns
341
+
342
+ **Phase 4: Report Generation**
343
+ Template: @${CLAUDE_PLUGIN_ROOT}/templates/review-report.md
344
+
345
+ Compile all findings into comprehensive report following template.
346
+
347
+ **Phase 5: Recommendations**
348
+ Generate prioritized action items:
349
+
350
+ 1. Critical issues (must fix)
351
+ 2. Important improvements (should fix)
352
+ 3. Nice-to-have enhancements (could fix)
353
+
354
+ Include specific file locations and suggested changes for each item.
355
+ ```
356
+
357
+ **Key features:**
358
+
359
+ - Multi-phase workflow
360
+ - Combines scripts, agents, skills
361
+ - Template-based reporting
362
+ - Prioritized outputs
363
+
364
+ ---
365
+
366
+ ## 9. Validated Input Command
367
+
368
+ **Use case:** Command with input validation and error handling
369
+
370
+ **File:** `commands/build-env.md`
371
+
372
+ ```markdown
373
+ ---
374
+ description: Build for specific environment with validation
375
+ argument-hint: [environment]
376
+ allowed-tools: Bash(*)
377
+ ---
378
+
379
+ Validate environment argument: `echo "$1" | grep -E "^(dev|staging|prod)$" && echo "VALID" || echo "INVALID"`
380
+
381
+ Check build script exists: `test -x ${CLAUDE_PLUGIN_ROOT}/scripts/build.sh && echo "EXISTS" || echo "MISSING"`
382
+
383
+ Verify configuration available: `test -f ${CLAUDE_PLUGIN_ROOT}/config/$1.json && echo "FOUND" || echo "NOT_FOUND"`
384
+
385
+ If all validations pass:
386
+
387
+ **Configuration:** @${CLAUDE_PLUGIN_ROOT}/config/$1.json
388
+
389
+ **Execute build:** `bash ${CLAUDE_PLUGIN_ROOT}/scripts/build.sh $1 2>&1`
390
+
391
+ **Validation results:** `bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate-build.sh $1 2>&1`
392
+
393
+ Report build status and any issues.
394
+
395
+ If validations fail:
396
+
397
+ - Explain which validation failed
398
+ - Provide expected values/locations
399
+ - Suggest corrective actions
400
+ - Document troubleshooting steps
401
+ ```
402
+
403
+ **Key features:**
404
+
405
+ - Input validation
406
+ - Resource existence checks
407
+ - Error handling
408
+ - Helpful error messages
409
+ - Graceful failure handling
410
+
411
+ ---
412
+
413
+ ## 10. Environment-Aware Command
414
+
415
+ **Use case:** Command that adapts behavior based on environment
416
+
417
+ **File:** `commands/run-checks.md`
418
+
419
+ ```markdown
420
+ ---
421
+ description: Run environment-appropriate checks
422
+ argument-hint: [environment]
423
+ allowed-tools: Bash(*), Read
424
+ ---
425
+
426
+ Environment: $1
427
+
428
+ Load environment configuration: @${CLAUDE_PLUGIN_ROOT}/config/$1-checks.json
429
+
430
+ Determine check level: `echo "$1" | grep -E "^prod$" && echo "FULL" || echo "BASIC"`
431
+
432
+ **For production environment:**
433
+
434
+ - Full test suite: `bash ${CLAUDE_PLUGIN_ROOT}/scripts/test-full.sh`
435
+ - Security scan: `bash ${CLAUDE_PLUGIN_ROOT}/scripts/security-scan.sh`
436
+ - Performance audit: `bash ${CLAUDE_PLUGIN_ROOT}/scripts/perf-check.sh`
437
+ - Compliance check: `bash ${CLAUDE_PLUGIN_ROOT}/scripts/compliance.sh`
438
+
439
+ **For non-production environments:**
440
+
441
+ - Basic tests: `bash ${CLAUDE_PLUGIN_ROOT}/scripts/test-basic.sh`
442
+ - Quick lint: `bash ${CLAUDE_PLUGIN_ROOT}/scripts/lint.sh`
443
+
444
+ Analyze results based on environment requirements:
445
+
446
+ **Production:** All checks must pass with zero critical issues
447
+ **Staging:** No critical issues, warnings acceptable
448
+ **Development:** Focus on blocking issues only
449
+
450
+ Report status and recommend proceed/block decision.
451
+ ```
452
+
453
+ **Key features:**
454
+
455
+ - Environment-aware logic
456
+ - Conditional execution
457
+ - Different validation levels
458
+ - Appropriate reporting per environment
459
+
460
+ ---
461
+
462
+ ## Common Patterns Summary
463
+
464
+ ### Pattern: Plugin Script Execution
465
+
466
+ ```markdown
467
+ `node ${CLAUDE_PLUGIN_ROOT}/scripts/script-name.js $1`
468
+ ```
469
+
470
+ Use for: Running plugin-provided Node.js scripts
471
+
472
+ ### Pattern: Plugin Configuration Loading
473
+
474
+ ```markdown
475
+ @${CLAUDE_PLUGIN_ROOT}/config/config-name.json
476
+ ```
477
+
478
+ Use for: Loading plugin configuration files
479
+
480
+ ### Pattern: Plugin Template Usage
481
+
482
+ ```markdown
483
+ @${CLAUDE_PLUGIN_ROOT}/templates/template-name.md
484
+ ```
485
+
486
+ Use for: Using plugin templates for generation
487
+
488
+ ### Pattern: Agent Invocation
489
+
490
+ ```markdown
491
+ Launch the [agent-name] agent for [task description].
492
+ ```
493
+
494
+ Use for: Delegating complex tasks to plugin agents
495
+
496
+ ### Pattern: Skill Reference
497
+
498
+ ```markdown
499
+ Use the [skill-name] skill to ensure [requirements].
500
+ ```
501
+
502
+ Use for: Leveraging plugin skills for specialized knowledge
503
+
504
+ ### Pattern: Input Validation
505
+
506
+ ```markdown
507
+ Validate input: `echo "$1" | grep -E "^pattern$" && echo "OK" || echo "ERROR"`
508
+ ```
509
+
510
+ Use for: Validating command arguments
511
+
512
+ ### Pattern: Resource Validation
513
+
514
+ ```markdown
515
+ Check exists: `test -f ${CLAUDE_PLUGIN_ROOT}/path/file && echo "YES" || echo "NO"`
516
+ ```
517
+
518
+ Use for: Verifying required plugin files exist
519
+
520
+ ---
521
+
522
+ ## Development Tips
523
+
524
+ ### Testing Plugin Commands
525
+
526
+ 1. **Test with plugin installed:**
527
+
528
+ ```bash
529
+ cd /path/to/plugin
530
+ claude /command-name args
531
+ ```
532
+
533
+ 2. **Verify ${CLAUDE_PLUGIN_ROOT} expansion:**
534
+
535
+ ```bash
536
+ # Add debug output to command
537
+ `echo "Plugin root: ${CLAUDE_PLUGIN_ROOT}"`
538
+ ```
539
+
540
+ 3. **Test across different working directories:**
541
+
542
+ ```bash
543
+ cd /tmp && claude /command-name
544
+ cd /other/project && claude /command-name
545
+ ```
546
+
547
+ 4. **Validate resource availability:**
548
+ ```bash
549
+ # Check all plugin resources exist
550
+ `ls -la ${CLAUDE_PLUGIN_ROOT}/scripts/`
551
+ `ls -la ${CLAUDE_PLUGIN_ROOT}/config/`
552
+ ```
553
+
554
+ ### Common Mistakes to Avoid
555
+
556
+ 1. **Using relative paths instead of ${CLAUDE_PLUGIN_ROOT}:**
557
+
558
+ ```markdown
559
+ # Wrong
560
+
561
+ `node ./scripts/analyze.js`
562
+
563
+ # Correct
564
+
565
+ `node ${CLAUDE_PLUGIN_ROOT}/scripts/analyze.js`
566
+ ```
567
+
568
+ 2. **Forgetting to allow required tools:**
569
+
570
+ ```markdown
571
+ # Missing allowed-tools
572
+
573
+ `bash script.sh` # Will fail without Bash permission
574
+
575
+ # Correct
576
+
577
+ ---
578
+
579
+ ## allowed-tools: Bash(\*)
580
+
581
+ `bash ${CLAUDE_PLUGIN_ROOT}/scripts/script.sh`
582
+ ```
583
+
584
+ 3. **Not validating inputs:**
585
+
586
+ ```markdown
587
+ # Risky - no validation
588
+
589
+ Deploy to $1 environment
590
+
591
+ # Better - with validation
592
+
593
+ Validate: `echo "$1" | grep -E "^(dev|staging|prod)$" || echo "INVALID"`
594
+ Deploy to $1 environment (if valid)
595
+ ```
596
+
597
+ 4. **Hardcoding plugin paths:**
598
+
599
+ ```markdown
600
+ # Wrong - breaks on different installations
601
+
602
+ @/home/user/.claude/plugins/my-plugin/config.json
603
+
604
+ # Correct - works everywhere
605
+
606
+ @${CLAUDE_PLUGIN_ROOT}/config.json
607
+ ```
608
+
609
+ ---
610
+
611
+ For detailed plugin-specific features, see `references/plugin-features-reference.md`.
612
+ For general command development, see main `SKILL.md`.