@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,111 @@
1
+ # Minimal Skill Example
2
+
3
+ A bare-bones skill with just a SKILL.md file.
4
+
5
+ ## Directory Structure
6
+
7
+ ```text
8
+ git-conventions/
9
+ └── SKILL.md
10
+ ```
11
+
12
+ ## File Contents
13
+
14
+ ### SKILL.md
15
+
16
+ ````markdown
17
+ ---
18
+ name: git-conventions
19
+ description: This skill should be used when the user asks about "git commit message format", "conventional commits", "commit conventions", "branch naming", or needs guidance on git workflow standards.
20
+ ---
21
+
22
+ # Git Conventions
23
+
24
+ This skill provides guidance on git commit messages and branch naming conventions.
25
+
26
+ ## Commit Message Format
27
+
28
+ Follow the Conventional Commits specification:
29
+
30
+ ```text
31
+ <type>(<scope>): <description>
32
+
33
+ [optional body]
34
+
35
+ [optional footer(s)]
36
+ ```
37
+ ````
38
+
39
+ ### Types
40
+
41
+ - **feat**: New feature
42
+ - **fix**: Bug fix
43
+ - **docs**: Documentation changes
44
+ - **style**: Code style changes (formatting, semicolons)
45
+ - **refactor**: Code refactoring without behavior change
46
+ - **test**: Adding or updating tests
47
+ - **chore**: Maintenance tasks
48
+
49
+ ### Examples
50
+
51
+ ```text
52
+ feat(auth): add OAuth2 login support
53
+
54
+ fix(api): handle null response from external service
55
+
56
+ docs(readme): update installation instructions
57
+ ```
58
+
59
+ ## Branch Naming
60
+
61
+ Use descriptive prefixes:
62
+
63
+ - `feature/` - New features
64
+ - `fix/` - Bug fixes
65
+ - `docs/` - Documentation updates
66
+ - `chore/` - Maintenance tasks
67
+
68
+ ### Examples
69
+
70
+ ```text
71
+ feature/user-authentication
72
+ fix/null-pointer-exception
73
+ docs/api-reference
74
+ ```
75
+
76
+ ````
77
+
78
+ ## Usage
79
+
80
+ After installing the plugin containing this skill:
81
+
82
+ ```text
83
+ $ claude
84
+ > What format should I use for commit messages?
85
+
86
+ [Skill loads and provides Conventional Commits guidance]
87
+ ````
88
+
89
+ ## Key Points
90
+
91
+ 1. **Single file**: Only SKILL.md required
92
+ 2. **Strong triggers**: Description includes specific phrases users would say
93
+ 3. **Third-person description**: "This skill should be used when..."
94
+ 4. **Imperative body**: Instructions use "Follow...", "Use...", not "You should..."
95
+ 5. **Focused content**: ~300 words, no external resources needed
96
+
97
+ ## When to Use This Pattern
98
+
99
+ - Simple domain knowledge
100
+ - Quick reference guides
101
+ - Team conventions and standards
102
+ - Single-topic utilities
103
+ - Learning skill development
104
+
105
+ ## Extending This Skill
106
+
107
+ To add more functionality:
108
+
109
+ 1. **Add references**: Create `references/` for detailed documentation
110
+ 2. **Add examples**: Create `examples/` for working code samples
111
+ 3. **Add scripts**: Create `scripts/` for automation utilities
@@ -0,0 +1,225 @@
1
+ # Advanced Skill Frontmatter Fields
2
+
3
+ This reference covers frontmatter fields that go beyond the core `name` and `description` requirements. These fields enable model selection, scoped hooks, and context budget optimization.
4
+
5
+ ## model
6
+
7
+ Override the model used when a skill is active.
8
+
9
+ ### Values
10
+
11
+ | Value | Behavior |
12
+ | ------------- | ----------------------------------------------------- |
13
+ | `inherit` | Use the conversation's current model (default) |
14
+ | `sonnet` | Claude Sonnet — balanced performance and cost |
15
+ | `opus` | Claude Opus — maximum capability, highest cost |
16
+ | `haiku` | Claude Haiku — fastest, lowest cost |
17
+ | Full model ID | Specific version (e.g., `claude-sonnet-4-5-20250929`) |
18
+
19
+ ### When to Use Each
20
+
21
+ - **`inherit` (default):** Most skills. Lets the user's model choice apply.
22
+ - **`haiku`:** Fast, cost-sensitive operations — linting, formatting checks, simple lookups. Good for skills that run frequently.
23
+ - **`sonnet`:** Standard workflows — code review, generation, analysis. The balanced default.
24
+ - **`opus`:** Complex reasoning — architectural decisions, security audits, detailed analysis requiring maximum capability.
25
+ - **Full model ID:** Pin to a specific version when skill behavior depends on exact model capabilities.
26
+
27
+ ### Example
28
+
29
+ ```yaml
30
+ ---
31
+ name: quick-lint
32
+ description: This skill should be used for fast code quality checks...
33
+ model: haiku
34
+ ---
35
+ ```
36
+
37
+ ### Notes
38
+
39
+ - Shorthand names (`sonnet`, `opus`, `haiku`) resolve to the current default version of each family
40
+ - The `model` field is shared with commands (same syntax and behavior)
41
+ - When `context: fork` is set, the model applies to the forked subagent
42
+
43
+ ## hooks (Scoped Hooks)
44
+
45
+ Define hooks that activate only when the skill is in use, rather than globally for all tool calls.
46
+
47
+ ### Concept
48
+
49
+ Unlike `hooks.json` (which applies globally whenever the plugin is active), scoped hooks in frontmatter are lifecycle-bound to the skill. They activate when the skill loads and deactivate when it completes. This enables skill-specific validation without affecting other workflows.
50
+
51
+ ### Format
52
+
53
+ The `hooks` field uses the same event/matcher/hook structure as `hooks.json`:
54
+
55
+ ```yaml
56
+ ---
57
+ name: validated-writer
58
+ description: Write files with safety validation...
59
+ hooks:
60
+ PreToolUse:
61
+ - matcher: Write
62
+ hooks:
63
+ - type: command
64
+ command: "${CLAUDE_PLUGIN_ROOT}/scripts/validate-write.sh"
65
+ timeout: 10
66
+ PostToolUse:
67
+ - matcher: Write
68
+ hooks:
69
+ - type: command
70
+ command: "${CLAUDE_PLUGIN_ROOT}/scripts/post-write-check.sh"
71
+ ---
72
+ ```
73
+
74
+ ### Supported Events
75
+
76
+ Scoped hooks support a subset of hook events:
77
+
78
+ | Event | Purpose |
79
+ | ------------- | ------------------------------------------------ |
80
+ | `PreToolUse` | Validate or block tool calls before execution |
81
+ | `PostToolUse` | Run checks after successful tool execution |
82
+ | `Stop` | Verify completion criteria before skill finishes |
83
+
84
+ Other events (`SessionStart`, `UserPromptSubmit`, etc.) are session-level and don't apply to skill scope.
85
+
86
+ ### Comparison with hooks.json
87
+
88
+ | Aspect | `hooks.json` | Frontmatter `hooks` |
89
+ | -------- | ------------------------------------------ | --------------------------------------------- |
90
+ | Scope | Global (always active when plugin enabled) | Skill-specific (active only during skill use) |
91
+ | Events | All 11+ hook events | PreToolUse, PostToolUse, Stop |
92
+ | Location | `hooks/hooks.json` file | YAML frontmatter in SKILL.md |
93
+ | Use case | Plugin-wide validation, logging | Skill-specific safety checks |
94
+
95
+ ### Use Cases
96
+
97
+ - **Skill-specific validation:** A "database writer" skill that validates SQL before execution
98
+ - **Restricted workflows:** A "deploy" skill that checks branch and test status before allowing Bash commands
99
+ - **Quality gates:** A "code generator" skill that runs linting after every Write operation
100
+
101
+ ### Hook Types in Frontmatter
102
+
103
+ Both `command` and `prompt` hook types work in frontmatter:
104
+
105
+ **Command hook** (executes a script):
106
+
107
+ ```yaml
108
+ hooks:
109
+ PreToolUse:
110
+ - matcher: Bash
111
+ hooks:
112
+ - type: command
113
+ command: "${CLAUDE_PLUGIN_ROOT}/scripts/check-safety.sh"
114
+ ```
115
+
116
+ **Prompt hook** (LLM evaluation — for Stop events):
117
+
118
+ ```yaml
119
+ hooks:
120
+ Stop:
121
+ - hooks:
122
+ - type: prompt
123
+ prompt: 'Verify that all generated code has tests. Return {"decision": "stop"} if satisfied or {"decision": "continue", "reason": "missing tests for..."} if not.'
124
+ ```
125
+
126
+ ## Skill Visibility Budget
127
+
128
+ Claude Code allocates a character budget for skill descriptions to manage context window usage efficiently.
129
+
130
+ ### How It Works
131
+
132
+ 1. All installed skills contribute their `description` text to a shared budget
133
+ 2. Default budget: approximately 2% of the context window or ~16KB fallback (controlled by `SLASH_COMMAND_TOOL_CHAR_BUDGET`)
134
+ 3. When total descriptions exceed the budget, lower-priority skills may be excluded from auto-discovery
135
+ 4. Excluded skills are still available via explicit `/skill-name` invocation — they just won't auto-trigger
136
+
137
+ ### What Counts Against the Budget
138
+
139
+ - The `description` frontmatter field text
140
+ - Skill name and metadata overhead
141
+ - This applies across ALL installed plugins, not just yours
142
+
143
+ ### Optimization Strategies
144
+
145
+ 1. **Keep descriptions concise:** Target 100-300 characters for the description field
146
+ 2. **Use trigger phrases, not explanations:** "create a hook", "add PreToolUse" is better than "This skill provides comprehensive guidance for creating event-driven automation..."
147
+ 3. **Move detail to SKILL.md body:** The body only loads when the skill triggers, not at discovery time
148
+ 4. **Progressive disclosure:** Description (always loaded) → SKILL.md body (on trigger) → references (on demand)
149
+
150
+ ### Checking Budget Usage
151
+
152
+ - `/context` command shows context usage including excluded skills if over budget
153
+ - Environment variable: `SLASH_COMMAND_TOOL_CHAR_BUDGET=20000` to increase budget
154
+ - Monitor with: `claude --debug` shows skill loading details
155
+
156
+ ### Practical Impact
157
+
158
+ For most plugins with 5-15 skills, the default budget is sufficient. Budget becomes a concern when:
159
+
160
+ - Multiple plugins are installed simultaneously (each adding descriptions)
161
+ - Individual skill descriptions exceed 500 characters
162
+ - A plugin has 20+ skills with verbose descriptions
163
+
164
+ ## Skill Permission Syntax
165
+
166
+ Skills can be referenced in settings.json allow rules using the `Skill()` syntax:
167
+
168
+ ### Exact Match
169
+
170
+ Allow a specific skill to be invoked:
171
+
172
+ ```json
173
+ {
174
+ "permissions": {
175
+ "allow": ["Skill(my-skill-name)"]
176
+ }
177
+ }
178
+ ```
179
+
180
+ ### Prefix Match with Arguments
181
+
182
+ Allow a skill with any arguments:
183
+
184
+ ```json
185
+ {
186
+ "permissions": {
187
+ "allow": ["Skill(my-skill-name *)"]
188
+ }
189
+ }
190
+ ```
191
+
192
+ This enables fine-grained control over which skills can be auto-invoked by Claude vs requiring explicit user invocation. Combine with `disable-model-invocation` frontmatter for maximum control.
193
+
194
+ ## Visual Output Generators
195
+
196
+ Skills can bundle scripts that generate visual output (HTML files, charts, interactive visualizations) for rich user experiences.
197
+
198
+ ### Pattern
199
+
200
+ 1. Bundle a script (Python, Node.js, etc.) in the skill's `scripts/` directory
201
+ 2. The script generates an HTML file or other visual output
202
+ 3. Claude orchestrates: reads data, runs the script, presents the result
203
+
204
+ ### Example Structure
205
+
206
+ ```
207
+ visualization-skill/
208
+ ├── SKILL.md
209
+ ├── scripts/
210
+ │ └── generate-chart.py # Produces HTML output
211
+ └── references/
212
+ └── chart-options.md # Configuration reference
213
+ ```
214
+
215
+ ### SKILL.md Usage
216
+
217
+ ```markdown
218
+ To generate the visualization:
219
+
220
+ 1. Gather the data from the user's project
221
+ 2. Run the script: `python ${CLAUDE_PLUGIN_ROOT}/skills/visualization-skill/scripts/generate-chart.py`
222
+ 3. The script outputs an HTML file — inform the user of its location
223
+ ```
224
+
225
+ Visual output generators combine the power of deterministic scripts with Claude's ability to gather context and present results. The script handles rendering while Claude handles data gathering and user interaction.
@@ -0,0 +1,39 @@
1
+ # Commands vs Skills: When to Use Each
2
+
3
+ ## Same Mechanism, Different Complexity
4
+
5
+ Both commands and skills:
6
+
7
+ - Are invoked via the Skill tool
8
+ - Support $ARGUMENTS and `[BANG]` bash execution
9
+ - Support frontmatter (description, allowed-tools, model)
10
+ - Can control invocability (disable-model-invocation)
11
+
12
+ ## Decision Matrix
13
+
14
+ | Need | Use | Location |
15
+ | ----------------------- | ------- | ---------------------- |
16
+ | Simple reusable prompt | Command | commands/foo.md |
17
+ | Dynamic arguments only | Command | commands/foo.md |
18
+ | Scripts for validation | Skill | skills/foo/ |
19
+ | Reference documentation | Skill | skills/foo/references/ |
20
+ | Working examples | Skill | skills/foo/examples/ |
21
+ | Progressive disclosure | Skill | skills/foo/ |
22
+
23
+ ## Invocation Control
24
+
25
+ | Setting | User (/) | Claude (Skill tool) |
26
+ | ----------------------------------- | -------- | ------------------- |
27
+ | Default | Yes | Yes |
28
+ | disable-model-invocation: true | Yes | No |
29
+ | user-invocable: false (skills only) | No | Yes |
30
+
31
+ ## Migration: Command to Skill
32
+
33
+ When a command grows complex:
34
+
35
+ 1. Create `skills/name/SKILL.md`
36
+ 2. Move command content to SKILL.md body (frontmatter fields like `description`, `allowed-tools`, `model` work identically)
37
+ 3. Add `references/` for detailed docs
38
+ 4. Add `scripts/` for utilities
39
+ 5. Delete original command file