@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,641 @@
1
+ ---
2
+ name: agent-development
3
+ description: This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", "disallowedTools", "block tools", "agent denylist", "maxTurns", "agent memory", "mcpServers in agent", "agent hooks", "background agent", "resume agent", "agent teams", "permission rules", "permission mode", "delegate mode", "agent team", "team lead", "teammate", "multi-agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
4
+ ---
5
+
6
+ # Agent Development for Claude Code Plugins
7
+
8
+ ## Overview
9
+
10
+ Agents are autonomous subprocesses that handle complex, multi-step tasks independently. Master agent structure, triggering conditions, and system prompt design to create powerful autonomous capabilities.
11
+
12
+ **Key concepts:**
13
+
14
+ - Agents are FOR autonomous work, commands are FOR user-initiated actions
15
+ - Markdown file format with YAML frontmatter
16
+ - Triggering via description field with examples
17
+ - System prompt defines agent behavior
18
+ - Model and color customization
19
+
20
+ > **Important - Field Name Difference:** Agents use `tools` to restrict tool access. Skills use `allowed-tools` for the same purpose. Don't confuse these when switching between component types.
21
+ >
22
+ > **Note on Official Documentation:** The `color` field documented in this skill is supported by Claude Code and is generated by the built-in `/agents` command, but it is not yet reflected in the [official sub-agents documentation](https://docs.claude.com/en/docs/claude-code/sub-agents). See [anthropics/claude-code#8501](https://github.com/anthropics/claude-code/issues/8501) for tracking. The [plugins-reference.md](https://docs.claude.com/en/docs/claude-code/plugins-reference) may show an older agent format using a `capabilities` field; for Claude Code plugins, prefer the structure documented in this skill which uses `tools` for tool restrictions.
23
+
24
+ ## Quick Start
25
+
26
+ Minimal working agent (copy-paste ready):
27
+
28
+ ```markdown
29
+ ---
30
+ name: my-reviewer
31
+ description: Use this agent when the user asks to review code. Examples:
32
+
33
+ <example>
34
+ Context: User wrote new code
35
+ user: "Review my changes"
36
+ assistant: "I'll use the my-reviewer agent to analyze the code."
37
+ <commentary>
38
+ Code review request triggers the agent.
39
+ </commentary>
40
+ </example>
41
+
42
+ model: inherit
43
+ color: blue
44
+ ---
45
+
46
+ You are a code reviewer. Analyze code for issues and provide feedback.
47
+
48
+ **Process:**
49
+
50
+ 1. Read the code
51
+ 2. Identify issues
52
+ 3. Provide recommendations
53
+
54
+ **Output:** Summary with file:line references for each finding.
55
+ ```
56
+
57
+ For complete format with all options, see [Agent File Structure](#agent-file-structure).
58
+
59
+ ## When to Use Agents vs Commands vs Skills
60
+
61
+ | Component | Best For | Triggering | Example Use Case |
62
+ | ------------ | --------------------------- | -------------------------------- | ----------------------------------- |
63
+ | **Agents** | Autonomous multi-step tasks | Proactive or description-matched | Code review after implementation |
64
+ | **Commands** | User-initiated actions | Explicit `/command` invocation | `/deploy production` |
65
+ | **Skills** | Knowledge and guidance | Model-invoked based on context | Domain expertise for PDF processing |
66
+
67
+ > **See also:** For command development, load the `command-development` skill. For skill development, load the `skill-development` skill.
68
+
69
+ ### Choose Agents When
70
+
71
+ - Task requires autonomous, multi-step execution
72
+ - Proactive triggering after certain events is desired
73
+ - Specialized subprocess with focused tools needed
74
+ - Work should happen in the background or as a subagent
75
+
76
+ ### Choose Commands When
77
+
78
+ - User should explicitly trigger the action
79
+ - Task has clear start/end with specific inputs
80
+ - Action should not happen automatically
81
+ - Workflow requires user confirmation at each step
82
+
83
+ ### Choose Skills When
84
+
85
+ - Providing knowledge or procedural guidance
86
+ - Extending Claude's domain expertise
87
+ - No autonomous execution needed
88
+ - Information should be available contextually on-demand
89
+
90
+ ## Agent File Structure
91
+
92
+ ### Complete Format
93
+
94
+ ```markdown
95
+ ---
96
+ name: agent-identifier
97
+ description: Use this agent when [triggering conditions]. Examples:
98
+
99
+ <example>
100
+ Context: [Situation description]
101
+ user: "[User request]"
102
+ assistant: "[How assistant should respond and use this agent]"
103
+ <commentary>
104
+ [Why this agent should be triggered]
105
+ </commentary>
106
+ </example>
107
+
108
+ <example>
109
+ [Additional example...]
110
+ </example>
111
+
112
+ model: inherit
113
+ color: blue
114
+ tools: Read, Write, Grep
115
+ ---
116
+
117
+ You are [agent role description]...
118
+
119
+ **Your Core Responsibilities:**
120
+
121
+ 1. [Responsibility 1]
122
+ 2. [Responsibility 2]
123
+
124
+ **Analysis Process:**
125
+ [Step-by-step workflow]
126
+
127
+ **Output Format:**
128
+ [What to return]
129
+ ```
130
+
131
+ ## Frontmatter Fields
132
+
133
+ ### name (required)
134
+
135
+ Agent identifier used for namespacing and invocation.
136
+
137
+ **Format:** lowercase, numbers, hyphens only
138
+ **Length:** 3-50 characters
139
+ **Pattern:** Must start and end with alphanumeric
140
+
141
+ **Good examples:**
142
+
143
+ - `code-reviewer`
144
+ - `test-generator`
145
+ - `api-docs-writer`
146
+ - `security-analyzer`
147
+
148
+ **Bad examples:**
149
+
150
+ - `helper` (too generic)
151
+ - `-agent-` (starts/ends with hyphen)
152
+ - `my_agent` (underscores not allowed)
153
+ - `ag` (too short, < 3 chars)
154
+
155
+ ### description (required)
156
+
157
+ Defines when Claude should trigger this agent. **This is the most critical field.**
158
+
159
+ **Must include:**
160
+
161
+ 1. Triggering conditions ("Use this agent when...")
162
+ 2. Multiple `<example>` blocks showing usage
163
+ 3. Context, user request, and assistant response in each example
164
+ 4. `<commentary>` explaining why agent triggers
165
+
166
+ **Format:**
167
+
168
+ ```
169
+ Use this agent when [conditions]. Examples:
170
+
171
+ <example>
172
+ Context: [Scenario description]
173
+ user: "[What user says]"
174
+ assistant: "[How Claude should respond]"
175
+ <commentary>
176
+ [Why this agent is appropriate]
177
+ </commentary>
178
+ </example>
179
+
180
+ [More examples...]
181
+ ```
182
+
183
+ **Best practices:**
184
+
185
+ - Include 2-4 concrete examples
186
+ - Show proactive and reactive triggering
187
+ - Cover different phrasings of same intent
188
+ - Explain reasoning in commentary
189
+ - Be specific about when NOT to use the agent
190
+
191
+ ### model (required)
192
+
193
+ Which model the agent should use.
194
+
195
+ **Options:**
196
+
197
+ - `inherit` - Use same model as parent (recommended)
198
+ - `sonnet` - Claude Sonnet (balanced)
199
+ - `opus` - Claude Opus (most capable, expensive)
200
+ - `haiku` - Claude Haiku (fast, cheap)
201
+
202
+ **When to choose:**
203
+
204
+ - `haiku` - Fast, simple tasks; quick analysis; cost-sensitive operations
205
+ - `sonnet` - Balanced performance; most use cases (default recommendation)
206
+ - `opus` - Complex reasoning; detailed analysis; highest capability needed
207
+
208
+ **Recommendation:** Use `inherit` (recommended default) unless the agent specifically needs:
209
+
210
+ - `haiku` for fast, cost-sensitive operations
211
+ - `opus` for complex reasoning requiring maximum capability
212
+
213
+ ### color (required)
214
+
215
+ Visual identifier for agent in UI.
216
+
217
+ > **Note:** This field is supported by Claude Code but not yet in official documentation. See the [Overview note](#overview) for details.
218
+
219
+ **Options:** `blue`, `cyan`, `green`, `yellow`, `magenta`, `red`
220
+
221
+ **Guidelines:**
222
+
223
+ - Choose distinct colors for different agents in same plugin
224
+ - Use consistent colors for similar agent types
225
+ - Blue/cyan: Analysis, review
226
+ - Green: Success-oriented tasks
227
+ - Yellow: Caution, validation
228
+ - Red: Critical, security
229
+ - Magenta: Creative, generation
230
+
231
+ ### tools (optional)
232
+
233
+ Restrict agent to specific tools.
234
+
235
+ **Format:** Comma-separated tool names
236
+
237
+ ```yaml
238
+ tools: Read, Write, Grep, Bash
239
+ ```
240
+
241
+ **Default:** If omitted, agent has access to all tools
242
+
243
+ **Best practice:** Limit tools to minimum needed (principle of least privilege)
244
+
245
+ **Common tool sets:**
246
+
247
+ - Read-only analysis: `Read, Grep, Glob`
248
+ - Code generation: `Read, Write, Grep`
249
+ - Testing: `Read, Bash, Grep`
250
+ - Full access: Omit field entirely
251
+
252
+ > **Important:** Agents use `tools` while Skills use `allowed-tools`. The field names differ between component types. For skill tool restrictions, see the `skill-development` skill.
253
+
254
+ ### disallowedTools (optional)
255
+
256
+ Denylist complement to `tools`. Block specific tools while allowing all others:
257
+
258
+ ```yaml
259
+ disallowedTools: Bash, Write
260
+ ```
261
+
262
+ **Format:** Comma-separated tool names
263
+
264
+ **Default:** No tools blocked
265
+
266
+ | Field | Approach | Use When |
267
+ | ----------------- | --------- | --------------------------------------- |
268
+ | `tools` | Allowlist | Few tools needed, restrict to minimum |
269
+ | `disallowedTools` | Denylist | Most tools needed, block specific risks |
270
+
271
+ **Best practice:** Prefer `tools` (allowlist) for tighter security. Use `disallowedTools` when an agent needs broad access but specific tools are dangerous.
272
+
273
+ > **Note:** Use one or the other. If both are specified, behavior is undefined.
274
+
275
+ ### skills (optional)
276
+
277
+ Load specific skills into the agent's context:
278
+
279
+ ```yaml
280
+ skills:
281
+ - testing-patterns
282
+ - security-audit
283
+ - api-design
284
+ ```
285
+
286
+ **Use cases:**
287
+
288
+ - Give agent domain expertise via skills
289
+ - Combine multiple skills for comprehensive workflows
290
+ - Share knowledge between agents and skills
291
+
292
+ Skills must be from the same plugin. The skill's SKILL.md content loads into the agent's context.
293
+
294
+ ### permissionMode (optional)
295
+
296
+ Control how the agent handles permission requests:
297
+
298
+ ```yaml
299
+ permissionMode: acceptEdits
300
+ ```
301
+
302
+ **Values:**
303
+
304
+ - `default` - Standard permission model, prompts user for each action (implicit when omitted)
305
+ - `acceptEdits` - Auto-accept file edit operations (Write, Edit, NotebookEdit)
306
+ - `dontAsk` - Skip permission dialogs for all operations
307
+ - `bypassPermissions` - Full bypass (requires trust)
308
+ - `plan` - Planning mode, propose changes without executing
309
+ - `delegate` - Coordination-only, restricted to team management tools (spawn, message, manage tasks)
310
+
311
+ **Default:** `default` (standard permission model, asks user)
312
+
313
+ **Security note:** Use restrictive modes (`plan`, `acceptEdits`) for untrusted agents. `bypassPermissions` should only be used for fully trusted agents. Use `delegate` for team lead agents that should coordinate work without implementing directly.
314
+
315
+ For complete permission mode details and permission rule syntax, see `references/permission-modes-rules.md`.
316
+
317
+ ### maxTurns (optional)
318
+
319
+ Limit the maximum number of agentic turns before the agent stops:
320
+
321
+ ```yaml
322
+ maxTurns: 50
323
+ ```
324
+
325
+ **Use cases:**
326
+
327
+ - Prevent runaway agents from consuming excessive resources
328
+ - Set reasonable bounds for task complexity
329
+ - Higher values (50-100) for complex multi-file tasks; lower values (10-20) for focused checks
330
+
331
+ If omitted, the agent runs until it completes or the user interrupts.
332
+
333
+ ### memory (optional)
334
+
335
+ Enable persistent memory across sessions:
336
+
337
+ ```yaml
338
+ memory: user
339
+ ```
340
+
341
+ **Scopes:** `user` (~/.claude/agent-memory/), `project` (.claude/agent-memory/), `local` (.claude/agent-memory-local/)
342
+
343
+ When enabled, the agent's first 200 lines of `MEMORY.md` are auto-injected into its system prompt. The agent can read/write its memory directory to learn across sessions. See `references/advanced-agent-fields.md` for details.
344
+
345
+ ### mcpServers (optional)
346
+
347
+ Scope MCP servers to this agent:
348
+
349
+ ```yaml
350
+ mcpServers:
351
+ slack:
352
+ ```
353
+
354
+ Reference an already-configured server by name, or provide inline config. Restricts which MCP servers the agent can access. See `references/advanced-agent-fields.md` for configuration examples.
355
+
356
+ ### hooks (optional)
357
+
358
+ Define lifecycle hooks scoped to this agent:
359
+
360
+ ```yaml
361
+ hooks:
362
+ PreToolUse:
363
+ - matcher: Bash
364
+ hooks:
365
+ - type: command
366
+ command: "${CLAUDE_PLUGIN_ROOT}/scripts/validate-bash.sh"
367
+ ```
368
+
369
+ Supports all hook events. Note: `Stop` hooks in agent frontmatter are auto-converted to `SubagentStop` at runtime. Hooks activate when the agent starts and deactivate when it finishes. See `references/advanced-agent-fields.md` for full details.
370
+
371
+ ### Fields NOT Available for Agents
372
+
373
+ Some frontmatter fields are specific to skills and do not apply to agents:
374
+
375
+ | Skill-Only Field | Purpose | Why Not for Agents |
376
+ | -------------------------- | -------------------------------------- | ------------------------------------------------------- |
377
+ | `context: fork` | Run skill in separate subagent context | Agents already run as subprocesses by design |
378
+ | `agent` | Specify agent type for forked context | Only applies when `context: fork` is set |
379
+ | `user-invocable` | Control slash menu visibility | Agents aren't invoked via slash commands |
380
+ | `disable-model-invocation` | Block programmatic Skill tool usage | Agents use Task tool, not Skill tool |
381
+ | `allowed-tools` | Restrict tool access (skill syntax) | Agents use `tools` field instead (different field name) |
382
+
383
+ **Key distinction:** Skills provide knowledge and guidance that loads into context. Agents are autonomous subprocesses that execute independently. This architectural difference explains why context-forking options don't apply to agents—they're already isolated processes.
384
+
385
+ ## System Prompt Design
386
+
387
+ The markdown body becomes the agent's system prompt. Write in second person, addressing the agent directly.
388
+
389
+ **Key elements:**
390
+
391
+ - Role definition ("You are [role] specializing in [domain]")
392
+ - Core responsibilities (numbered list)
393
+ - Process steps (concrete, actionable)
394
+ - Quality standards (measurable criteria)
395
+ - Output format (specific structure)
396
+ - Edge cases (how to handle exceptions)
397
+
398
+ **Best practices:**
399
+
400
+ - Write in second person ("You are...", "You will...")
401
+ - Be specific, not vague
402
+ - Keep under 10,000 characters
403
+ - Include concrete steps, not generic instructions
404
+
405
+ For detailed templates and patterns (Analysis, Generation, Validation, Orchestration agents), see `references/system-prompt-design.md`.
406
+
407
+ ## Creating Agents
408
+
409
+ ### Method 1: AI-Assisted Generation
410
+
411
+ Use this prompt pattern (extracted from Claude Code):
412
+
413
+ ```
414
+ Create an agent configuration based on this request: "[YOUR DESCRIPTION]"
415
+
416
+ Requirements:
417
+ 1. Extract core intent and responsibilities
418
+ 2. Design expert persona for the domain
419
+ 3. Create comprehensive system prompt with:
420
+ - Clear behavioral boundaries
421
+ - Specific methodologies
422
+ - Edge case handling
423
+ - Output format
424
+ 4. Create identifier (lowercase, hyphens, 3-50 chars)
425
+ 5. Write description with triggering conditions
426
+ 6. Include 2-3 <example> blocks showing when to use
427
+
428
+ Return JSON with:
429
+ {
430
+ "identifier": "agent-name",
431
+ "whenToUse": "Use this agent when... Examples: <example>...</example>",
432
+ "systemPrompt": "You are..."
433
+ }
434
+ ```
435
+
436
+ Then convert to agent file format with frontmatter.
437
+
438
+ See `examples/agent-creation-prompt.md` for complete template.
439
+
440
+ ### Method 2: Manual Creation
441
+
442
+ 1. Choose agent identifier (3-50 chars, lowercase, hyphens)
443
+ 2. Write description with examples
444
+ 3. Select model (usually `inherit`)
445
+ 4. Choose color for visual identification
446
+ 5. Define tools (if restricting access)
447
+ 6. Write system prompt with structure above
448
+ 7. Save as `agents/agent-name.md`
449
+
450
+ ## Validation Rules
451
+
452
+ ### Identifier Validation
453
+
454
+ ```
455
+ ✅ Valid: code-reviewer, test-gen, api-analyzer-v2
456
+ ❌ Invalid: ag (too short), -start (starts with hyphen), my_agent (underscore)
457
+ ```
458
+
459
+ **Rules:**
460
+
461
+ - 3-50 characters
462
+ - Lowercase letters, numbers, hyphens only
463
+ - Must start and end with alphanumeric
464
+ - No underscores, spaces, or special characters
465
+
466
+ ### Description Validation
467
+
468
+ **Length:** 10-5,000 characters
469
+ **Must include:** Triggering conditions and examples
470
+ **Best:** 200-1,000 characters with 2-4 examples
471
+
472
+ ### System Prompt Validation
473
+
474
+ **Length:** 20-10,000 characters
475
+ **Best:** 500-3,000 characters
476
+ **Structure:** Clear responsibilities, process, output format
477
+
478
+ ## Agent Organization
479
+
480
+ ### Plugin Agents Directory
481
+
482
+ ```
483
+ plugin-name/
484
+ └── agents/
485
+ ├── analyzer.md
486
+ ├── reviewer.md
487
+ └── generator.md
488
+ ```
489
+
490
+ All `.md` files in `agents/` are auto-discovered.
491
+
492
+ **Agent precedence:** `--agents` CLI flag > `.claude/agents/` (project) > `~/.claude/agents/` (personal) > Plugin `agents/` directory. Higher-priority agents with the same name shadow lower-priority ones. Use distinctive, namespaced names for plugin agents to avoid collisions.
493
+
494
+ ### Portable Paths
495
+
496
+ When referencing files within your plugin (scripts, references, etc.) from agent system prompts, use `${CLAUDE_PLUGIN_ROOT}` for portable paths:
497
+
498
+ ```markdown
499
+ Run the validation script at `${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh`
500
+ ```
501
+
502
+ This variable resolves to the plugin's installation directory at runtime, ensuring paths work regardless of where the plugin is installed.
503
+
504
+ ### Namespacing
505
+
506
+ Agents are namespaced automatically:
507
+
508
+ - Single plugin: `agent-name`
509
+ - With subdirectories: `plugin:subdir:agent-name`
510
+
511
+ ## Testing Agents
512
+
513
+ ### Test Triggering
514
+
515
+ Create test scenarios to verify agent triggers correctly:
516
+
517
+ 1. Write agent with specific triggering examples
518
+ 2. Use similar phrasing to examples in test
519
+ 3. Check Claude loads the agent
520
+ 4. Verify agent provides expected functionality
521
+
522
+ ### Load Agents at Session Start
523
+
524
+ Use the `--agents` CLI flag to pre-load specific agents:
525
+
526
+ ```bash
527
+ # Load single agent
528
+ claude --agents code-reviewer
529
+
530
+ # Load multiple agents
531
+ claude --agents "code-reviewer,test-generator"
532
+ ```
533
+
534
+ **Use cases:**
535
+
536
+ - Testing agent behavior without triggering
537
+ - Workflows requiring specific agents
538
+ - Debugging agent system prompts
539
+
540
+ ### Test System Prompt
541
+
542
+ Ensure system prompt is complete:
543
+
544
+ 1. Give agent typical task
545
+ 2. Check it follows process steps
546
+ 3. Verify output format is correct
547
+ 4. Test edge cases mentioned in prompt
548
+ 5. Confirm quality standards are met
549
+
550
+ ## Quick Reference
551
+
552
+ ### Frontmatter Fields Summary
553
+
554
+ | Field | Required | Format | Example |
555
+ | --------------- | -------- | -------------------------- | ------------------------ |
556
+ | name | Yes | lowercase-hyphens | code-reviewer |
557
+ | description | Yes | Text + examples | Use when... <example>... |
558
+ | model | Yes | inherit/sonnet/opus/haiku | inherit |
559
+ | color | Yes | Color name | blue |
560
+ | tools | No | Comma-separated tool names | Read, Grep |
561
+ | disallowedTools | No | Comma-separated tool names | Bash, Write |
562
+ | skills | No | Array of skill names | [testing, security] |
563
+ | permissionMode | No | Permission mode string | acceptEdits |
564
+ | maxTurns | No | Number | 50 |
565
+ | memory | No | user/project/local | user |
566
+ | mcpServers | No | Object or server names | { "slack": {} } |
567
+ | hooks | No | Hook event config | { PreToolUse: [...] } |
568
+
569
+ > **Note:** Agents use `tools` to restrict tool access. Skills use `allowed-tools` for the same purpose. The field names differ between component types.
570
+
571
+ ### Best Practices
572
+
573
+ **DO:**
574
+
575
+ - ✅ Include 2-4 concrete examples in description
576
+ - ✅ Write specific triggering conditions
577
+ - ✅ Use `inherit` for model unless specific need
578
+ - ✅ Choose appropriate tools (least privilege)
579
+ - ✅ Write clear, structured system prompts
580
+ - ✅ Test agent triggering thoroughly
581
+
582
+ **DON'T:**
583
+
584
+ - ❌ Use generic descriptions without examples
585
+ - ❌ Omit triggering conditions
586
+ - ❌ Give all agents same color
587
+ - ❌ Grant unnecessary tool access
588
+ - ❌ Write vague system prompts
589
+ - ❌ Skip testing
590
+
591
+ ## Execution Modes
592
+
593
+ Agents can run in foreground (blocking) or background (concurrent) mode:
594
+
595
+ - **Foreground** (default): Blocks the main conversation until the agent completes
596
+ - **Background**: Runs concurrently; permissions must be pre-approved at spawn time since the user can't be prompted
597
+
598
+ Background agents that need an unapproved permission will fail. Plan tool restrictions accordingly.
599
+
600
+ **MCP limitation:** MCP tools are unavailable in background subagents. If your agent relies on MCP tools (from the plugin's `.mcp.json`), it must run in foreground mode. Design agents that may run in background to use only built-in tools.
601
+
602
+ **Resuming agents:** Each Task invocation creates a fresh agent. To continue with full prior context, ask Claude to "resume that agent" — it will restore the previous transcript.
603
+
604
+ **Restricting spawnable agents:** Use `Task(agent_type1, agent_type2)` syntax in settings.json allow rules to control which agent types can be spawned. Omitting `Task` entirely prevents subagent spawning.
605
+
606
+ **Built-in agent types:** Explore (read-only, Haiku), Plan (read-only research), general-purpose (all tools), Bash (terminal commands), statusline-setup (Haiku), Claude Code Guide (Haiku).
607
+
608
+ ## Agent Teams (Experimental)
609
+
610
+ Agent teams enable multi-agent coordination where a team lead spawns and manages multiple independent Claude Code sessions as teammates. Requires `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`.
611
+
612
+ Teams provide shared task lists, inter-agent messaging, and parallel execution. Use `permissionMode: delegate` to restrict a lead to coordination-only tools.
613
+
614
+ This is an advanced feature — see the [official agent teams documentation](https://code.claude.com/docs/en/agent-teams) for details.
615
+
616
+ ## Additional Resources
617
+
618
+ ### Reference Files
619
+
620
+ For detailed guidance, consult:
621
+
622
+ - **`references/advanced-agent-fields.md`** - Detailed docs for maxTurns, memory, mcpServers, hooks, execution modes, and agent teams
623
+ - **`references/permission-modes-rules.md`** - Complete permission mode details and permission rule syntax for fine-grained access control
624
+ - **`references/system-prompt-design.md`** - Four system prompt patterns (Analysis, Generation, Validation, Orchestration) with complete templates and common pitfalls
625
+ - **`references/triggering-examples.md`** - Example block anatomy, four example types, template library, and debugging guide
626
+ - **`references/agent-creation-system-prompt.md`** - The exact prompt used by Claude Code's agent generation feature with usage patterns
627
+
628
+ ### Example Files
629
+
630
+ Working examples in `examples/`:
631
+
632
+ - **`agent-creation-prompt.md`** - AI-assisted agent generation template
633
+ - **`complete-agent-examples.md`** - Full agent examples for different use cases
634
+
635
+ ### Utility Scripts
636
+
637
+ Development tools in `scripts/`:
638
+
639
+ - **`create-agent-skeleton.sh`** - Generate new agent file from template
640
+ - **`validate-agent.sh`** - Validate agent file structure
641
+ - **`test-agent-trigger.sh`** - Test if agent triggers correctly