@amsterdamdatalabs/enact-extensions 0.1.0 → 0.1.3

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 (245) hide show
  1. package/README.md +96 -21
  2. package/dist/index.d.ts +5 -3
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +3 -2
  5. package/dist/index.js.map +1 -1
  6. package/dist/install.d.ts +171 -1
  7. package/dist/install.d.ts.map +1 -1
  8. package/dist/install.js +402 -49
  9. package/dist/install.js.map +1 -1
  10. package/dist/internal/codex.d.ts.map +1 -1
  11. package/dist/internal/codex.js +7 -1
  12. package/dist/internal/codex.js.map +1 -1
  13. package/dist/internal/platform.d.ts +8 -0
  14. package/dist/internal/platform.d.ts.map +1 -1
  15. package/dist/internal/platform.js +46 -2
  16. package/dist/internal/platform.js.map +1 -1
  17. package/dist/provision.d.ts +30 -0
  18. package/dist/provision.d.ts.map +1 -0
  19. package/dist/provision.js +202 -0
  20. package/dist/provision.js.map +1 -0
  21. package/dist/validate/index.d.ts +44 -0
  22. package/dist/validate/index.d.ts.map +1 -1
  23. package/dist/validate/index.js +157 -0
  24. package/dist/validate/index.js.map +1 -1
  25. package/extensions/cmux/.agents/plugin.json +37 -0
  26. package/extensions/cmux/skills/cmux/SKILL.md +82 -0
  27. package/extensions/cmux/skills/cmux/agents/openai.yaml +4 -0
  28. package/extensions/cmux/skills/cmux/references/handles-and-identify.md +35 -0
  29. package/extensions/cmux/skills/cmux/references/panes-surfaces.md +37 -0
  30. package/extensions/cmux/skills/cmux/references/trigger-flash-and-health.md +23 -0
  31. package/extensions/cmux/skills/cmux/references/windows-workspaces.md +31 -0
  32. package/extensions/cmux/skills/cmux-vm-monitor/SKILL.md +122 -0
  33. package/extensions/cmux/skills/cmux-vm-monitor/agents/openai.yaml +4 -0
  34. package/extensions/cmux/skills/cmux-vm-monitor/references/cmux-commands.md +66 -0
  35. package/extensions/cmux/skills/cmux-vm-monitor/scripts/codex_vm_monitor.sh +45 -0
  36. package/extensions/cmux/skills/cmux-workspace/SKILL.md +93 -0
  37. package/extensions/dev-state/.agents/plugin.json +35 -0
  38. package/extensions/dev-state/skills/dev-state-plan-graduation/SKILL.md +194 -0
  39. package/extensions/dev-state/skills/dev-state-plan-graduation/agents/openai.yaml +4 -0
  40. package/extensions/dev-state/skills/dev-state-plan-graduation/references/reference.md +130 -0
  41. package/extensions/devops/.agents/plugin.json +36 -0
  42. package/extensions/devops/skills/azure-devops-cli/SKILL.md +431 -0
  43. package/extensions/devops/skills/azure-devops-cli/agents/openai.yaml +4 -0
  44. package/extensions/devops/skills/ci-pipeline-strategy/SKILL.md +217 -0
  45. package/extensions/devops/skills/ci-pipeline-strategy/agents/openai.yaml +4 -0
  46. package/extensions/enact-context/.agents/plugin.json +40 -0
  47. package/extensions/enact-context/.mcp.json +8 -0
  48. package/extensions/enact-context/README.md +25 -0
  49. package/extensions/enact-context/assets/icon.png +0 -0
  50. package/extensions/enact-context/assets/logo.png +0 -0
  51. package/extensions/enact-context/hooks/hooks.json +115 -0
  52. package/extensions/enact-context/skills/enact-context/SKILL.md +149 -0
  53. package/extensions/enact-context/skills/enact-context/scripts/install.sh +69 -0
  54. package/extensions/enact-factory/.agents/plugin.json +42 -0
  55. package/extensions/enact-factory/.mcp.json +8 -0
  56. package/extensions/enact-factory/assets/icon.png +0 -0
  57. package/extensions/enact-factory/assets/logo.png +0 -0
  58. package/extensions/enact-factory/hooks/user-prompt-submit.mjs +67 -0
  59. package/extensions/enact-factory/skills/testing-strategy/SKILL.md +167 -0
  60. package/extensions/enact-factory/skills/workitem-triage/SKILL.md +22 -0
  61. package/extensions/enact-operator/.agents/plugin.json +57 -0
  62. package/extensions/enact-operator/.app.json +3 -0
  63. package/extensions/enact-operator/.mcp.json +10 -0
  64. package/extensions/enact-operator/_taxonomy.md +86 -0
  65. package/extensions/enact-operator/agents/README.md +5 -0
  66. package/extensions/enact-operator/agents/architect.toml +25 -0
  67. package/extensions/enact-operator/agents/code-reviewer.toml +24 -0
  68. package/extensions/enact-operator/agents/critic.toml +30 -0
  69. package/extensions/enact-operator/agents/executor.toml +24 -0
  70. package/extensions/enact-operator/agents/explore.toml +23 -0
  71. package/extensions/enact-operator/agents/planner.toml +24 -0
  72. package/extensions/enact-operator/agents/verifier.toml +24 -0
  73. package/extensions/enact-operator/assets/icon.png +0 -0
  74. package/extensions/enact-operator/assets/logo.png +0 -0
  75. package/extensions/enact-operator/commands/doctor.md +39 -0
  76. package/extensions/enact-operator/commands/setup.md +51 -0
  77. package/extensions/enact-operator/hooks/hooks.json +146 -0
  78. package/extensions/enact-operator/skills/_variants.md +44 -0
  79. package/extensions/enact-operator/skills/ai-slop-cleaner/SKILL.md +50 -0
  80. package/extensions/enact-operator/skills/analyze/SKILL.md +91 -0
  81. package/extensions/enact-operator/skills/ask/SKILL.md +47 -0
  82. package/extensions/enact-operator/skills/autopilot/SKILL.md +170 -0
  83. package/extensions/enact-operator/skills/autoresearch-goal/SKILL.md +79 -0
  84. package/extensions/enact-operator/skills/cancel/SKILL.md +99 -0
  85. package/extensions/enact-operator/skills/configure-notifications/SKILL.md +77 -0
  86. package/extensions/enact-operator/skills/deep-interview/SKILL.md +80 -0
  87. package/extensions/enact-operator/skills/doctor/SKILL.md +48 -0
  88. package/extensions/enact-operator/skills/hud/SKILL.md +49 -0
  89. package/extensions/enact-operator/skills/hyperplan/SKILL.md +47 -0
  90. package/extensions/enact-operator/skills/plan/SKILL.md +78 -0
  91. package/extensions/enact-operator/skills/ralph/SKILL.md +201 -0
  92. package/extensions/enact-operator/skills/ralph/gemini.md +18 -0
  93. package/extensions/enact-operator/skills/ralplan/SKILL.md +151 -0
  94. package/extensions/enact-operator/skills/remove-deadcode/SKILL.md +45 -0
  95. package/extensions/enact-operator/skills/research/SKILL.md +74 -0
  96. package/extensions/enact-operator/skills/review/SKILL.md +58 -0
  97. package/extensions/enact-operator/skills/security-research/SKILL.md +54 -0
  98. package/extensions/enact-operator/skills/setup/SKILL.md +91 -0
  99. package/extensions/enact-operator/skills/setup/scripts/install.sh +50 -0
  100. package/extensions/enact-operator/skills/skill/SKILL.md +82 -0
  101. package/extensions/enact-operator/skills/tdd/SKILL.md +59 -0
  102. package/extensions/enact-operator/skills/team/SKILL.md +199 -0
  103. package/extensions/enact-operator/skills/trace/SKILL.md +41 -0
  104. package/extensions/enact-operator/skills/ultragoal/SKILL.md +99 -0
  105. package/extensions/enact-operator/skills/ultraqa/SKILL.md +113 -0
  106. package/extensions/enact-operator/skills/ultrawork/SKILL.md +145 -0
  107. package/extensions/enact-operator/skills/ultrawork/planner.md +28 -0
  108. package/extensions/enact-operator/skills/wiki/SKILL.md +41 -0
  109. package/extensions/enact-operator/skills/work-with-workitem/SKILL.md +51 -0
  110. package/extensions/enact-wiki/.agents/plugin.json +42 -0
  111. package/extensions/enact-wiki/.mcp.json +15 -0
  112. package/extensions/enact-wiki/README.md +44 -0
  113. package/extensions/enact-wiki/assets/icon.png +0 -0
  114. package/extensions/enact-wiki/assets/logo.png +0 -0
  115. package/extensions/enact-wiki/skills/document-parser/SKILL.md +17 -0
  116. package/extensions/enact-wiki/skills/document-parser/scripts/parse.sh +60 -0
  117. package/extensions/enact-wiki/skills/document-parser/skill.json +9 -0
  118. package/extensions/enact-wiki/skills/enact-wiki/SKILL.md +30 -0
  119. package/extensions/enact-wiki/skills/enact-wiki/references/ingest.md +62 -0
  120. package/extensions/enact-wiki/skills/enact-wiki/references/manage.md +34 -0
  121. package/extensions/enact-wiki/skills/enact-wiki/references/query.md +59 -0
  122. package/extensions/enact-wiki/skills/search-lab/SKILL.md +57 -0
  123. package/extensions/enact-wiki/skills/search-lab/scripts/analyze.ts +23 -0
  124. package/{plugins/net-revenue-management/.codex-plugin → extensions/net-revenue-management/.agents}/plugin.json +10 -6
  125. package/extensions/plugin-dev/.agents/plugin.json +42 -0
  126. package/extensions/plugin-dev/.mcp.json +3 -0
  127. package/extensions/plugin-dev/agents/agent-creator.md +199 -0
  128. package/extensions/plugin-dev/agents/plugin-validator.md +91 -0
  129. package/extensions/plugin-dev/agents/skill-reviewer.md +212 -0
  130. package/extensions/plugin-dev/commands/_archive/create-marketplace.md +427 -0
  131. package/extensions/plugin-dev/commands/_archive/plugin-dev-guide.md +12 -0
  132. package/extensions/plugin-dev/commands/create-plugin.md +498 -0
  133. package/extensions/plugin-dev/commands/start.md +81 -0
  134. package/extensions/plugin-dev/hooks/hooks.json +3 -0
  135. package/extensions/plugin-dev/skills/agent-development/SKILL.md +641 -0
  136. package/extensions/plugin-dev/skills/agent-development/examples/agent-creation-prompt.md +250 -0
  137. package/extensions/plugin-dev/skills/agent-development/examples/complete-agent-examples.md +461 -0
  138. package/extensions/plugin-dev/skills/agent-development/references/advanced-agent-fields.md +246 -0
  139. package/extensions/plugin-dev/skills/agent-development/references/agent-creation-system-prompt.md +216 -0
  140. package/extensions/plugin-dev/skills/agent-development/references/permission-modes-rules.md +226 -0
  141. package/extensions/plugin-dev/skills/agent-development/references/system-prompt-design.md +464 -0
  142. package/extensions/plugin-dev/skills/agent-development/references/triggering-examples.md +474 -0
  143. package/extensions/plugin-dev/skills/agent-development/scripts/create-agent-skeleton.sh +176 -0
  144. package/extensions/plugin-dev/skills/agent-development/scripts/test-agent-trigger.sh +227 -0
  145. package/extensions/plugin-dev/skills/agent-development/scripts/validate-agent.sh +227 -0
  146. package/extensions/plugin-dev/skills/command-development/SKILL.md +763 -0
  147. package/extensions/plugin-dev/skills/command-development/examples/plugin-commands.md +612 -0
  148. package/extensions/plugin-dev/skills/command-development/examples/simple-commands.md +527 -0
  149. package/extensions/plugin-dev/skills/command-development/references/advanced-workflows.md +762 -0
  150. package/extensions/plugin-dev/skills/command-development/references/documentation-patterns.md +769 -0
  151. package/extensions/plugin-dev/skills/command-development/references/frontmatter-reference.md +508 -0
  152. package/extensions/plugin-dev/skills/command-development/references/interactive-commands.md +966 -0
  153. package/extensions/plugin-dev/skills/command-development/references/marketplace-considerations.md +943 -0
  154. package/extensions/plugin-dev/skills/command-development/references/plugin-features-reference.md +637 -0
  155. package/extensions/plugin-dev/skills/command-development/references/plugin-integration.md +191 -0
  156. package/extensions/plugin-dev/skills/command-development/references/skill-tool.md +447 -0
  157. package/extensions/plugin-dev/skills/command-development/references/testing-strategies.md +723 -0
  158. package/extensions/plugin-dev/skills/command-development/scripts/check-frontmatter.sh +234 -0
  159. package/extensions/plugin-dev/skills/command-development/scripts/validate-command.sh +160 -0
  160. package/extensions/plugin-dev/skills/hook-development/SKILL.md +861 -0
  161. package/extensions/plugin-dev/skills/hook-development/examples/load-context.sh +55 -0
  162. package/extensions/plugin-dev/skills/hook-development/examples/validate-bash.sh +57 -0
  163. package/extensions/plugin-dev/skills/hook-development/examples/validate-write.sh +48 -0
  164. package/extensions/plugin-dev/skills/hook-development/references/advanced.md +871 -0
  165. package/extensions/plugin-dev/skills/hook-development/references/hook-input-schemas.md +145 -0
  166. package/extensions/plugin-dev/skills/hook-development/references/migration.md +392 -0
  167. package/extensions/plugin-dev/skills/hook-development/references/patterns.md +430 -0
  168. package/extensions/plugin-dev/skills/hook-development/scripts/README.md +181 -0
  169. package/extensions/plugin-dev/skills/hook-development/scripts/hook-linter.sh +153 -0
  170. package/extensions/plugin-dev/skills/hook-development/scripts/test-hook.sh +276 -0
  171. package/extensions/plugin-dev/skills/hook-development/scripts/validate-hook-schema.sh +159 -0
  172. package/extensions/plugin-dev/skills/mcp-integration/SKILL.md +775 -0
  173. package/extensions/plugin-dev/skills/mcp-integration/examples/http-server.json +20 -0
  174. package/extensions/plugin-dev/skills/mcp-integration/examples/sse-server.json +19 -0
  175. package/extensions/plugin-dev/skills/mcp-integration/examples/stdio-server.json +38 -0
  176. package/extensions/plugin-dev/skills/mcp-integration/examples/ws-server.json +26 -0
  177. package/extensions/plugin-dev/skills/mcp-integration/references/authentication.md +601 -0
  178. package/extensions/plugin-dev/skills/mcp-integration/references/server-discovery.md +190 -0
  179. package/extensions/plugin-dev/skills/mcp-integration/references/server-types.md +572 -0
  180. package/extensions/plugin-dev/skills/mcp-integration/references/tool-usage.md +623 -0
  181. package/extensions/plugin-dev/skills/plugin-dev-guide/SKILL.md +222 -0
  182. package/extensions/plugin-dev/skills/plugin-structure/SKILL.md +705 -0
  183. package/extensions/plugin-dev/skills/plugin-structure/examples/advanced-plugin.md +774 -0
  184. package/extensions/plugin-dev/skills/plugin-structure/examples/minimal-plugin.md +83 -0
  185. package/extensions/plugin-dev/skills/plugin-structure/examples/standard-plugin.md +611 -0
  186. package/extensions/plugin-dev/skills/plugin-structure/references/advanced-topics.md +289 -0
  187. package/extensions/plugin-dev/skills/plugin-structure/references/component-patterns.md +592 -0
  188. package/extensions/plugin-dev/skills/plugin-structure/references/github-actions.md +233 -0
  189. package/extensions/plugin-dev/skills/plugin-structure/references/headless-ci-mode.md +193 -0
  190. package/extensions/plugin-dev/skills/plugin-structure/references/manifest-reference.md +625 -0
  191. package/extensions/plugin-dev/skills/plugin-structure/references/output-styles.md +116 -0
  192. package/extensions/plugin-dev/skills/skill-development/SKILL.md +564 -0
  193. package/extensions/plugin-dev/skills/skill-development/examples/complete-skill.md +465 -0
  194. package/extensions/plugin-dev/skills/skill-development/examples/frontmatter-templates.md +167 -0
  195. package/extensions/plugin-dev/skills/skill-development/examples/minimal-skill.md +111 -0
  196. package/extensions/plugin-dev/skills/skill-development/references/advanced-frontmatter.md +225 -0
  197. package/extensions/plugin-dev/skills/skill-development/references/commands-vs-skills.md +39 -0
  198. package/extensions/plugin-dev/skills/skill-development/references/skill-creation-workflow.md +379 -0
  199. package/extensions/plugin-dev/skills/skill-development/references/skill-creator-original.md +210 -0
  200. package/package.json +8 -11
  201. package/scripts/enact-extensions.mjs +823 -21
  202. package/scripts/hooks/session-start-drift-check.mjs +58 -0
  203. package/scripts/lib/build-index.mjs +50 -0
  204. package/scripts/lib/bundle-hash.mjs +137 -0
  205. package/scripts/lib/hooks.mjs +741 -0
  206. package/scripts/lib/ledger.mjs +163 -0
  207. package/scripts/lib/list-bundles.mjs +70 -0
  208. package/scripts/lib/outdated.mjs +144 -0
  209. package/scripts/lib/provision-mcp.mjs +16 -0
  210. package/scripts/lib/resolve-bundle.mjs +121 -0
  211. package/scripts/lib/run-install.mjs +402 -38
  212. package/scripts/lib/run-prune.mjs +73 -0
  213. package/scripts/lib/run-sync.mjs +9 -1
  214. package/scripts/lib/run-uninstall.mjs +244 -0
  215. package/scripts/lib/run-update.mjs +152 -0
  216. package/scripts/lib/run-validate.mjs +21 -18
  217. package/scripts/lib/serve.mjs +472 -0
  218. package/scripts/postinstall.mjs +63 -0
  219. package/scripts/setup-enact-context.sh +2 -2
  220. package/scripts/version-bump.sh +463 -0
  221. package/spec/codex.json +1 -11
  222. package/spec/index.json +59 -0
  223. package/web/assets/README.md +111 -0
  224. package/web/assets/logo-full.png +0 -0
  225. package/web/assets/logo-slim.png +0 -0
  226. package/web/assets/tokens/base.css +45 -0
  227. package/web/assets/tokens/colors.css +248 -0
  228. package/web/assets/tokens/effects.css +24 -0
  229. package/web/assets/tokens/fonts.css +8 -0
  230. package/web/assets/tokens/index.css +18 -0
  231. package/web/assets/tokens/spacing.css +50 -0
  232. package/web/index.html +1188 -0
  233. package/.agents/plugins/marketplace.json +0 -20
  234. package/catalog/enact-context.json +0 -9
  235. package/catalog/enact-factory.json +0 -7
  236. package/catalog/enact-operator.json +0 -7
  237. package/catalog/enact-wiki.json +0 -7
  238. package/catalog/net-revenue-management.json +0 -8
  239. package/scripts/rename-supervisor-to-operator.pl +0 -66
  240. package/scripts/sync-manifests.mjs +0 -23
  241. package/scripts/validate-catalog.mjs +0 -37
  242. package/scripts/validate-plugin.mjs +0 -10
  243. /package/{plugins → extensions}/net-revenue-management/.mcp.json +0 -0
  244. /package/{plugins → extensions}/net-revenue-management/skills/net-revenue-risks/SKILL.md +0 -0
  245. /package/{plugins → extensions}/net-revenue-management/skills/net-revenue-scenario/SKILL.md +0 -0
@@ -0,0 +1,723 @@
1
+ # Command Testing Strategies
2
+
3
+ Comprehensive strategies for testing slash commands before deployment and distribution.
4
+
5
+ ## Overview
6
+
7
+ Testing commands ensures they work correctly, handle edge cases, and provide good user experience. A systematic testing approach catches issues early and builds confidence in command reliability.
8
+
9
+ ## Testing Levels
10
+
11
+ ### Level 1: Syntax and Structure Validation
12
+
13
+ **What to test:**
14
+
15
+ - YAML frontmatter syntax
16
+ - Markdown format
17
+ - File location and naming
18
+
19
+ **How to test:**
20
+
21
+ ```bash
22
+ # Validate YAML frontmatter
23
+ head -n 20 .claude/commands/my-command.md | grep -A 10 "^---"
24
+
25
+ # Check for closing frontmatter marker
26
+ head -n 20 .claude/commands/my-command.md | grep -c "^---" # Should be 2
27
+
28
+ # Verify file has .md extension
29
+ ls .claude/commands/*.md
30
+
31
+ # Check file is in correct location
32
+ test -f .claude/commands/my-command.md && echo "Found" || echo "Missing"
33
+ ```
34
+
35
+ **Automated validation script:**
36
+
37
+ ```bash
38
+ #!/bin/bash
39
+ # validate-command.sh
40
+
41
+ COMMAND_FILE="$1"
42
+
43
+ if [ ! -f "$COMMAND_FILE" ]; then
44
+ echo "ERROR: File not found: $COMMAND_FILE"
45
+ exit 1
46
+ fi
47
+
48
+ # Check .md extension
49
+ if [[ ! "$COMMAND_FILE" =~ \.md$ ]]; then
50
+ echo "ERROR: File must have .md extension"
51
+ exit 1
52
+ fi
53
+
54
+ # Validate YAML frontmatter if present
55
+ if head -n 1 "$COMMAND_FILE" | grep -q "^---"; then
56
+ # Count frontmatter markers
57
+ MARKERS=$(head -n 50 "$COMMAND_FILE" | grep -c "^---")
58
+ if [ "$MARKERS" -ne 2 ]; then
59
+ echo "ERROR: Invalid YAML frontmatter (need exactly 2 '---' markers)"
60
+ exit 1
61
+ fi
62
+ echo "✓ YAML frontmatter syntax valid"
63
+ fi
64
+
65
+ # Check for empty file
66
+ if [ ! -s "$COMMAND_FILE" ]; then
67
+ echo "ERROR: File is empty"
68
+ exit 1
69
+ fi
70
+
71
+ echo "✓ Command file structure valid"
72
+ ```
73
+
74
+ ### Level 2: Frontmatter Field Validation
75
+
76
+ **What to test:**
77
+
78
+ - Field types correct
79
+ - Values in valid ranges
80
+ - Required fields present (if any)
81
+
82
+ **Validation script:**
83
+
84
+ ```bash
85
+ #!/bin/bash
86
+ # validate-frontmatter.sh
87
+
88
+ COMMAND_FILE="$1"
89
+
90
+ # Extract YAML frontmatter
91
+ FRONTMATTER=$(sed -n '/^---$/,/^---$/p' "$COMMAND_FILE" | sed '1d;$d')
92
+
93
+ if [ -z "$FRONTMATTER" ]; then
94
+ echo "No frontmatter to validate"
95
+ exit 0
96
+ fi
97
+
98
+ # Check 'model' field if present
99
+ if echo "$FRONTMATTER" | grep -q "^model:"; then
100
+ MODEL=$(echo "$FRONTMATTER" | grep "^model:" | cut -d: -f2 | tr -d ' ')
101
+ if ! echo "sonnet opus haiku" | grep -qw "$MODEL"; then
102
+ echo "ERROR: Invalid model '$MODEL' (must be sonnet, opus, or haiku)"
103
+ exit 1
104
+ fi
105
+ echo "✓ Model field valid: $MODEL"
106
+ fi
107
+
108
+ # Check 'allowed-tools' field format
109
+ if echo "$FRONTMATTER" | grep -q "^allowed-tools:"; then
110
+ echo "✓ allowed-tools field present"
111
+ # Could add more sophisticated validation here
112
+ fi
113
+
114
+ # Check 'description' length
115
+ if echo "$FRONTMATTER" | grep -q "^description:"; then
116
+ DESC=$(echo "$FRONTMATTER" | grep "^description:" | cut -d: -f2-)
117
+ LENGTH=${#DESC}
118
+ if [ "$LENGTH" -gt 80 ]; then
119
+ echo "WARNING: Description length $LENGTH (recommend < 60 chars)"
120
+ else
121
+ echo "✓ Description length acceptable: $LENGTH chars"
122
+ fi
123
+ fi
124
+
125
+ echo "✓ Frontmatter fields valid"
126
+ ```
127
+
128
+ ### Level 3: Manual Command Invocation
129
+
130
+ **What to test:**
131
+
132
+ - Command appears in `/help`
133
+ - Command executes without errors
134
+ - Output is as expected
135
+
136
+ **Test procedure:**
137
+
138
+ ```bash
139
+ # 1. Start Claude Code
140
+ claude --debug
141
+
142
+ # 2. Check command appears in help
143
+ > /help
144
+ # Look for your command in the list
145
+
146
+ # 3. Invoke command without arguments
147
+ > /my-command
148
+ # Check for reasonable error or behavior
149
+
150
+ # 4. Invoke with valid arguments
151
+ > /my-command arg1 arg2
152
+ # Verify expected behavior
153
+
154
+ # 5. Check debug logs
155
+ tail -f ~/.claude/debug-logs/latest
156
+ # Look for errors or warnings
157
+ ```
158
+
159
+ ### Level 4: Argument Testing
160
+
161
+ **What to test:**
162
+
163
+ - Positional arguments work ($1, $2, etc.)
164
+ - $ARGUMENTS captures all arguments
165
+ - Missing arguments handled gracefully
166
+ - Invalid arguments detected
167
+
168
+ **Test matrix:**
169
+
170
+ | Test Case | Command | Expected Result |
171
+ | ------------- | ------------------------ | -------------------------------------------- |
172
+ | No args | `/cmd` | Graceful handling or useful message |
173
+ | One arg | `/cmd arg1` | $1 substituted correctly |
174
+ | Two args | `/cmd arg1 arg2` | $1 and $2 substituted |
175
+ | Extra args | `/cmd a b c d` | All captured or extras ignored appropriately |
176
+ | Special chars | `/cmd "arg with spaces"` | Quotes handled correctly |
177
+ | Empty arg | `/cmd ""` | Empty string handled |
178
+
179
+ **Test script:**
180
+
181
+ ```bash
182
+ #!/bin/bash
183
+ # test-command-arguments.sh
184
+
185
+ COMMAND="$1"
186
+
187
+ echo "Testing argument handling for /$COMMAND"
188
+ echo
189
+
190
+ echo "Test 1: No arguments"
191
+ echo " Command: /$COMMAND"
192
+ echo " Expected: [describe expected behavior]"
193
+ echo " Manual test required"
194
+ echo
195
+
196
+ echo "Test 2: Single argument"
197
+ echo " Command: /$COMMAND test-value"
198
+ echo " Expected: 'test-value' appears in output"
199
+ echo " Manual test required"
200
+ echo
201
+
202
+ echo "Test 3: Multiple arguments"
203
+ echo " Command: /$COMMAND arg1 arg2 arg3"
204
+ echo " Expected: All arguments used appropriately"
205
+ echo " Manual test required"
206
+ echo
207
+
208
+ echo "Test 4: Special characters"
209
+ echo " Command: /$COMMAND \"value with spaces\""
210
+ echo " Expected: Entire phrase captured"
211
+ echo " Manual test required"
212
+ ```
213
+
214
+ ### Level 5: File Reference Testing
215
+
216
+ **What to test:**
217
+
218
+ - @ syntax loads file contents
219
+ - Non-existent files handled
220
+ - Large files handled appropriately
221
+ - Multiple file references work
222
+
223
+ **Test procedure:**
224
+
225
+ ```bash
226
+ # Create test files
227
+ echo "Test content" > /tmp/test-file.txt
228
+ echo "Second file" > /tmp/test-file-2.txt
229
+
230
+ # Test single file reference
231
+ > /my-command /tmp/test-file.txt
232
+ # Verify file content is read
233
+
234
+ # Test non-existent file
235
+ > /my-command /tmp/nonexistent.txt
236
+ # Verify graceful error handling
237
+
238
+ # Test multiple files
239
+ > /my-command /tmp/test-file.txt /tmp/test-file-2.txt
240
+ # Verify both files processed
241
+
242
+ # Test large file
243
+ dd if=/dev/zero of=/tmp/large-file.bin bs=1M count=100
244
+ > /my-command /tmp/large-file.bin
245
+ # Verify reasonable behavior (may truncate or warn)
246
+
247
+ # Cleanup
248
+ rm /tmp/test-file*.txt /tmp/large-file.bin
249
+ ```
250
+
251
+ ### Level 6: Bash Execution Testing
252
+
253
+ **What to test:**
254
+
255
+ - ` commands execute correctly
256
+ - Command output included in prompt
257
+ - Command failures handled
258
+ - Security: only allowed commands run
259
+
260
+ **Test procedure:**
261
+
262
+ ```bash
263
+ # Create test command with bash execution
264
+ cat > .claude/commands/test-bash.md << 'EOF'
265
+ ---
266
+ description: Test bash execution
267
+ allowed-tools: Bash(echo:*), Bash(date:*)
268
+ ---
269
+
270
+ Current date: `date`
271
+ Test output: `echo "Hello from bash"`
272
+
273
+ Analysis of output above...
274
+ EOF
275
+
276
+ # Test in Claude Code
277
+ > /test-bash
278
+ # Verify:
279
+ # 1. Date appears correctly
280
+ # 2. Echo output appears
281
+ # 3. No errors in debug logs
282
+
283
+ # Test with disallowed command (should fail or be blocked)
284
+ cat > .claude/commands/test-forbidden.md << 'EOF'
285
+ ---
286
+ description: Test forbidden command
287
+ allowed-tools: Bash(echo:*)
288
+ ---
289
+
290
+ Trying forbidden: `ls -la /`
291
+ EOF
292
+
293
+ > /test-forbidden
294
+ # Verify: Permission denied or appropriate error
295
+ ```
296
+
297
+ ### Level 7: Integration Testing
298
+
299
+ **What to test:**
300
+
301
+ - Commands work with other plugin components
302
+ - Commands interact correctly with each other
303
+ - State management works across invocations
304
+ - Workflow commands execute in sequence
305
+
306
+ **Test scenarios:**
307
+
308
+ #### Scenario 1: Command + Hook Integration
309
+
310
+ ```bash
311
+ # Setup: Command that triggers a hook
312
+ # Test: Invoke command, verify hook executes
313
+
314
+ # Command: .claude/commands/risky-operation.md
315
+ # Hook: PreToolUse that validates the operation
316
+
317
+ > /risky-operation
318
+ # Verify: Hook executes and validates before command completes
319
+ ```
320
+
321
+ #### Scenario 2: Command Sequence
322
+
323
+ ```bash
324
+ # Setup: Multi-command workflow
325
+ > /workflow-init
326
+ # Verify: State file created
327
+
328
+ > /workflow-step2
329
+ # Verify: State file read, step 2 executes
330
+
331
+ > /workflow-complete
332
+ # Verify: State file cleaned up
333
+ ```
334
+
335
+ #### Scenario 3: Command + MCP Integration
336
+
337
+ ```bash
338
+ # Setup: Command uses MCP tools
339
+ # Test: Verify MCP server accessible
340
+
341
+ > /mcp-command
342
+ # Verify:
343
+ # 1. MCP server starts (if stdio)
344
+ # 2. Tool calls succeed
345
+ # 3. Results included in output
346
+ ```
347
+
348
+ ## Automated Testing Approaches
349
+
350
+ ### Command Test Suite
351
+
352
+ Create a test suite script:
353
+
354
+ ```bash
355
+ #!/bin/bash
356
+ # test-commands.sh - Command test suite
357
+
358
+ TEST_DIR=".claude/commands"
359
+ FAILED_TESTS=0
360
+
361
+ echo "Command Test Suite"
362
+ echo "=================="
363
+ echo
364
+
365
+ for cmd_file in "$TEST_DIR"/*.md; do
366
+ cmd_name=$(basename "$cmd_file" .md)
367
+ echo "Testing: $cmd_name"
368
+
369
+ # Validate structure
370
+ if ./validate-command.sh "$cmd_file"; then
371
+ echo " ✓ Structure valid"
372
+ else
373
+ echo " ✗ Structure invalid"
374
+ ((FAILED_TESTS++))
375
+ fi
376
+
377
+ # Validate frontmatter
378
+ if ./validate-frontmatter.sh "$cmd_file"; then
379
+ echo " ✓ Frontmatter valid"
380
+ else
381
+ echo " ✗ Frontmatter invalid"
382
+ ((FAILED_TESTS++))
383
+ fi
384
+
385
+ echo
386
+ done
387
+
388
+ echo "=================="
389
+ echo "Tests complete"
390
+ echo "Failed: $FAILED_TESTS"
391
+
392
+ exit $FAILED_TESTS
393
+ ```
394
+
395
+ ### Pre-Commit Hook
396
+
397
+ Validate commands before committing:
398
+
399
+ ```bash
400
+ #!/bin/bash
401
+ # .git/hooks/pre-commit
402
+
403
+ echo "Validating commands..."
404
+
405
+ COMMANDS_CHANGED=$(git diff --cached --name-only | grep "\.claude/commands/.*\.md")
406
+
407
+ if [ -z "$COMMANDS_CHANGED" ]; then
408
+ echo "No commands changed"
409
+ exit 0
410
+ fi
411
+
412
+ for cmd in $COMMANDS_CHANGED; do
413
+ echo "Checking: $cmd"
414
+
415
+ if ! ./scripts/validate-command.sh "$cmd"; then
416
+ echo "ERROR: Command validation failed: $cmd"
417
+ exit 1
418
+ fi
419
+ done
420
+
421
+ echo "✓ All commands valid"
422
+ ```
423
+
424
+ ### Continuous Testing
425
+
426
+ Test commands in CI/CD:
427
+
428
+ ```yaml
429
+ # .github/workflows/test-commands.yml
430
+ name: Test Commands
431
+
432
+ on: [push, pull_request]
433
+
434
+ jobs:
435
+ test:
436
+ runs-on: ubuntu-latest
437
+ steps:
438
+ - uses: actions/checkout@v2
439
+
440
+ - name: Validate command structure
441
+ run: |
442
+ for cmd in .claude/commands/*.md; do
443
+ echo "Testing: $cmd"
444
+ ./scripts/validate-command.sh "$cmd"
445
+ done
446
+
447
+ - name: Validate frontmatter
448
+ run: |
449
+ for cmd in .claude/commands/*.md; do
450
+ ./scripts/validate-frontmatter.sh "$cmd"
451
+ done
452
+
453
+ - name: Check for TODOs
454
+ run: |
455
+ if grep -r "TODO" .claude/commands/; then
456
+ echo "ERROR: TODOs found in commands"
457
+ exit 1
458
+ fi
459
+ ```
460
+
461
+ ## Edge Case Testing
462
+
463
+ ### Test Edge Cases
464
+
465
+ **Empty arguments:**
466
+
467
+ ```bash
468
+ > /cmd ""
469
+ > /cmd '' ''
470
+ ```
471
+
472
+ **Special characters:**
473
+
474
+ ```bash
475
+ > /cmd "arg with spaces"
476
+ > /cmd arg-with-dashes
477
+ > /cmd arg_with_underscores
478
+ > /cmd arg/with/slashes
479
+ > /cmd 'arg with "quotes"'
480
+ ```
481
+
482
+ **Long arguments:**
483
+
484
+ ```bash
485
+ > /cmd $(python -c "print('a' * 10000)")
486
+ ```
487
+
488
+ **Unusual file paths:**
489
+
490
+ ```bash
491
+ > /cmd ./file
492
+ > /cmd ../file
493
+ > /cmd ~/file
494
+ > /cmd "/path with spaces/file"
495
+ ```
496
+
497
+ **Bash command edge cases:**
498
+
499
+ ```markdown
500
+ # Commands that might fail
501
+
502
+ `exit 1`
503
+ `false`
504
+ `command-that-does-not-exist`
505
+
506
+ # Commands with special output
507
+
508
+ `echo ""`
509
+ `cat /dev/null`
510
+ `yes | head -n 1000000`
511
+ ```
512
+
513
+ ## Performance Testing
514
+
515
+ ### Response Time Testing
516
+
517
+ ```bash
518
+ #!/bin/bash
519
+ # test-command-performance.sh
520
+
521
+ COMMAND="$1"
522
+
523
+ echo "Testing performance of /$COMMAND"
524
+ echo
525
+
526
+ for i in {1..5}; do
527
+ echo "Run $i:"
528
+ START=$(date +%s%N)
529
+
530
+ # Invoke command (manual step - record time)
531
+ echo " Invoke: /$COMMAND"
532
+ echo " Start time: $START"
533
+ echo " (Record end time manually)"
534
+ echo
535
+ done
536
+
537
+ echo "Analyze results:"
538
+ echo " - Average response time"
539
+ echo " - Variance"
540
+ echo " - Acceptable threshold: < 3 seconds for fast commands"
541
+ ```
542
+
543
+ ### Resource Usage Testing
544
+
545
+ ```bash
546
+ # Monitor Claude Code during command execution
547
+ # In terminal 1:
548
+ claude --debug
549
+
550
+ # In terminal 2:
551
+ watch -n 1 'ps aux | grep claude'
552
+
553
+ # Execute command and observe:
554
+ # - Memory usage
555
+ # - CPU usage
556
+ # - Process count
557
+ ```
558
+
559
+ ## User Experience Testing
560
+
561
+ ### Usability Checklist
562
+
563
+ - [ ] Command name is intuitive
564
+ - [ ] Description is clear in `/help`
565
+ - [ ] Arguments are well-documented
566
+ - [ ] Error messages are helpful
567
+ - [ ] Output is formatted readably
568
+ - [ ] Long-running commands show progress
569
+ - [ ] Results are actionable
570
+ - [ ] Edge cases have good UX
571
+
572
+ ### User Acceptance Testing
573
+
574
+ Recruit testers:
575
+
576
+ ```markdown
577
+ # Testing Guide for Beta Testers
578
+
579
+ ## Command: /my-new-command
580
+
581
+ ### Test Scenarios
582
+
583
+ 1. **Basic usage:**
584
+ - Run: `/my-new-command`
585
+ - Expected: [describe]
586
+ - Rate clarity: 1-5
587
+
588
+ 2. **With arguments:**
589
+ - Run: `/my-new-command arg1 arg2`
590
+ - Expected: [describe]
591
+ - Rate usefulness: 1-5
592
+
593
+ 3. **Error case:**
594
+ - Run: `/my-new-command invalid-input`
595
+ - Expected: Helpful error message
596
+ - Rate error message: 1-5
597
+
598
+ ### Feedback Questions
599
+
600
+ 1. Was the command easy to understand?
601
+ 2. Did the output meet your expectations?
602
+ 3. What would you change?
603
+ 4. Would you use this command regularly?
604
+ ```
605
+
606
+ ## Testing Checklist
607
+
608
+ Before releasing a command:
609
+
610
+ ### Structure
611
+
612
+ - [ ] File in correct location
613
+ - [ ] Correct .md extension
614
+ - [ ] Valid YAML frontmatter (if present)
615
+ - [ ] Markdown syntax correct
616
+
617
+ ### Functionality
618
+
619
+ - [ ] Command appears in `/help`
620
+ - [ ] Description is clear
621
+ - [ ] Command executes without errors
622
+ - [ ] Arguments work as expected
623
+ - [ ] File references work
624
+ - [ ] Bash execution works (if used)
625
+
626
+ ### Edge Cases
627
+
628
+ - [ ] Missing arguments handled
629
+ - [ ] Invalid arguments detected
630
+ - [ ] Non-existent files handled
631
+ - [ ] Special characters work
632
+ - [ ] Long inputs handled
633
+
634
+ ### Integration
635
+
636
+ - [ ] Works with other commands
637
+ - [ ] Works with hooks (if applicable)
638
+ - [ ] Works with MCP (if applicable)
639
+ - [ ] State management works
640
+
641
+ ### Quality
642
+
643
+ - [ ] Performance acceptable
644
+ - [ ] No security issues
645
+ - [ ] Error messages helpful
646
+ - [ ] Output formatted well
647
+ - [ ] Documentation complete
648
+
649
+ ### Distribution
650
+
651
+ - [ ] Tested by others
652
+ - [ ] Feedback incorporated
653
+ - [ ] README updated
654
+ - [ ] Examples provided
655
+
656
+ ## Debugging Failed Tests
657
+
658
+ ### Common Issues and Solutions
659
+
660
+ #### Issue: Command not appearing in /help
661
+
662
+ ```bash
663
+ # Check file location
664
+ ls -la .claude/commands/my-command.md
665
+
666
+ # Check permissions
667
+ chmod 644 .claude/commands/my-command.md
668
+
669
+ # Check syntax
670
+ head -n 20 .claude/commands/my-command.md
671
+
672
+ # Restart Claude Code
673
+ claude --debug
674
+ ```
675
+
676
+ #### Issue: Arguments not substituting
677
+
678
+ ```bash
679
+ # Verify syntax
680
+ grep '\$1' .claude/commands/my-command.md
681
+ grep '\$ARGUMENTS' .claude/commands/my-command.md
682
+
683
+ # Test with simple command first
684
+ echo "Test: \$1 and \$2" > .claude/commands/test-args.md
685
+ ```
686
+
687
+ #### Issue: Bash commands not executing
688
+
689
+ ```bash
690
+ # Check allowed-tools
691
+ grep "allowed-tools" .claude/commands/my-command.md
692
+
693
+ # Verify command has bash execution syntax (! followed by backtick)
694
+ # Note: Command files use actual ! syntax, not [BANG] placeholder
695
+ grep -E '!\x60' .claude/commands/my-command.md
696
+
697
+ # Test command manually
698
+ date
699
+ echo "test"
700
+ ```
701
+
702
+ #### Issue: File references not working
703
+
704
+ ```bash
705
+ # Check @ syntax
706
+ grep '@' .claude/commands/my-command.md
707
+
708
+ # Verify file exists
709
+ ls -la /path/to/referenced/file
710
+
711
+ # Check permissions
712
+ chmod 644 /path/to/referenced/file
713
+ ```
714
+
715
+ ## Best Practices
716
+
717
+ 1. **Test early, test often**: Validate as you develop
718
+ 2. **Automate validation**: Use scripts for repeatable checks
719
+ 3. **Test edge cases**: Don't just test the happy path
720
+ 4. **Get feedback**: Have others test before wide release
721
+ 5. **Document tests**: Keep test scenarios for regression testing
722
+ 6. **Monitor in production**: Watch for issues after release
723
+ 7. **Iterate**: Improve based on real usage data