start-vibing 4.1.0 → 4.1.2

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 (72) hide show
  1. package/package.json +1 -1
  2. package/template/.claude/CLAUDE.md +86 -20
  3. package/template/.claude/agents/sd-audit.md +197 -0
  4. package/template/.claude/agents/sd-fix-verify-semantic.md +112 -0
  5. package/template/.claude/agents/sd-fix-verify-technical.md +36 -0
  6. package/template/.claude/agents/sd-fix.md +194 -0
  7. package/template/.claude/agents/sd-research.md +61 -0
  8. package/template/.claude/agents/sd-synthesis.md +74 -0
  9. package/template/.claude/commands/super-design.md +15 -0
  10. package/template/.claude/hooks/super-design-session-start.sh +4 -0
  11. package/template/.claude/settings.json +14 -0
  12. package/template/.claude/skills/codebase-knowledge/SKILL.md +145 -0
  13. package/template/.claude/skills/codebase-knowledge/TEMPLATE.md +35 -0
  14. package/template/.claude/skills/codebase-knowledge/domains/claude-system.md +93 -0
  15. package/template/.claude/skills/composition-patterns/SKILL.md +89 -0
  16. package/template/.claude/skills/docs-tracker/SKILL.md +239 -0
  17. package/template/.claude/skills/mcp-builder/SKILL.md +236 -0
  18. package/template/.claude/skills/quality-gate/scripts/check-all.sh +83 -0
  19. package/template/.claude/skills/react-best-practices/SKILL.md +146 -0
  20. package/template/.claude/skills/security-scan/reference/owasp-top-10.md +257 -0
  21. package/template/.claude/skills/security-scan/scripts/scan.py +190 -0
  22. package/template/.claude/skills/super-design/README.md +37 -0
  23. package/template/.claude/skills/super-design/SKILL.md +105 -0
  24. package/template/.claude/skills/super-design/hooks/guard-paths.py +35 -0
  25. package/template/.claude/skills/super-design/hooks/post-edit-lint.py +57 -0
  26. package/template/.claude/skills/super-design/references/audit-methodology.md +513 -0
  27. package/template/.claude/skills/super-design/references/change-detection-playbook.md +1432 -0
  28. package/template/.claude/skills/super-design/references/design-theory.md +706 -0
  29. package/template/.claude/skills/super-design/references/fix-agent-playbook.md +118 -0
  30. package/template/.claude/skills/super-design/references/market-research-playbook.md +773 -0
  31. package/template/.claude/skills/super-design/references/playwright-mcp-reference.md +1057 -0
  32. package/template/.claude/skills/super-design/references/skills-subagents-reference.md +784 -0
  33. package/template/.claude/skills/super-design/references/superpowers-and-distribution.md +136 -0
  34. package/template/.claude/skills/super-design/scripts/detect-changes.sh +61 -0
  35. package/template/.claude/skills/super-design/scripts/diff-tokens.sh +13 -0
  36. package/template/.claude/skills/super-design/scripts/discover-routes.sh +45 -0
  37. package/template/.claude/skills/super-design/scripts/extract-tokens.mjs +41 -0
  38. package/template/.claude/skills/super-design/scripts/hash-pages.sh +42 -0
  39. package/template/.claude/skills/super-design/scripts/validate-state.sh +15 -0
  40. package/template/.claude/skills/super-design/scripts/verify-audit.sh +19 -0
  41. package/template/.claude/skills/super-design/templates/audit-state.schema.json +57 -0
  42. package/template/.claude/skills/super-design/templates/findings.schema.json +57 -0
  43. package/template/.claude/skills/super-design/templates/fix-history.md.tpl +26 -0
  44. package/template/.claude/skills/super-design/templates/overview.md.tpl +52 -0
  45. package/template/.claude/skills/test-coverage/reference/playwright-patterns.md +260 -0
  46. package/template/.claude/skills/test-coverage/scripts/coverage-check.sh +52 -0
  47. package/template/.claude/skills/typeui-ant/SKILL.md +133 -0
  48. package/template/.claude/skills/typeui-application/SKILL.md +128 -0
  49. package/template/.claude/skills/typeui-artistic/SKILL.md +133 -0
  50. package/template/.claude/skills/typeui-bento/SKILL.md +127 -0
  51. package/template/.claude/skills/typeui-bold/SKILL.md +127 -0
  52. package/template/.claude/skills/typeui-clean/SKILL.md +128 -0
  53. package/template/.claude/skills/typeui-dashboard/SKILL.md +133 -0
  54. package/template/.claude/skills/typeui-doodle/SKILL.md +142 -0
  55. package/template/.claude/skills/typeui-dramatic/SKILL.md +127 -0
  56. package/template/.claude/skills/typeui-enterprise/SKILL.md +132 -0
  57. package/template/.claude/skills/typeui-neobrutalism/SKILL.md +127 -0
  58. package/template/.claude/skills/typeui-paper/SKILL.md +127 -0
  59. package/template/.claude/skills/ui-ux-audit/QUICK-START.md +450 -0
  60. package/template/.claude/skills/ui-ux-audit/README.md +470 -0
  61. package/template/.claude/skills/ui-ux-audit/templates/audit-report.md +591 -0
  62. package/template/.claude/skills/ui-ux-audit/templates/competitor-analysis.md +363 -0
  63. package/template/.claude/skills/ui-ux-audit/templates/component-spec.md +491 -0
  64. package/template/.claude/skills/ui-ux-audit/templates/improvement-recommendation.md +450 -0
  65. package/template/.claude/skills/web-design-guidelines/SKILL.md +39 -0
  66. package/template/.claude/skills/webapp-testing/SKILL.md +96 -0
  67. package/template/.claude/skills/workflow-state/workflow-state.json +77 -0
  68. package/template/.claude/config/README.md +0 -27
  69. package/template/.claude/config/project-config.json +0 -53
  70. package/template/.claude/config/quality-gates.json +0 -46
  71. package/template/.claude/config/security-rules.json +0 -45
  72. package/template/.claude/config/testing-config.json +0 -164
@@ -0,0 +1,784 @@
1
+ # Claude Code Skills & Subagents: A Production Reference for Building `super-design`
2
+
3
+ This document is a dense, build-ready reference for authoring a production skill that lives at `.claude/skills/super-design/` and orchestrates multiple subagents under `.claude/agents/`. It consolidates the official Claude Code docs (`code.claude.com`), the Claude Developer Platform docs (`platform.claude.com`), the `anthropics/skills` and `anthropics/claude-code` repositories, and battle-tested community patterns current as of April 2026. Every non-obvious claim is cited inline.
4
+
5
+ **Naming warning up front.** An existing project named **SuperDesign** (https://github.com/superdesigndev/superdesign, VS Code extension + companion `superdesign-skill` CLI + `superdesign-mcp` server) already occupies the "design / generate UI mockups" trigger space. Keep your skill's `description` narrowly scoped to *orchestration of subagents*, or rename to something like `super-design-orchestrator` to avoid cross-triggering with its skill/MCP entries.
6
+
7
+ ---
8
+
9
+ ## 1. SKILL.md anatomy for Claude Code
10
+
11
+ ### 1.1 Canonical frontmatter schema
12
+
13
+ All fields are optional. Only `description` is recommended so Claude knows when to invoke the skill ([code.claude.com/docs/en/skills](https://code.claude.com/docs/en/skills)).
14
+
15
+ | Field | Required | Notes |
16
+ |---|---|---|
17
+ | `name` | No | Lowercase letters, digits, hyphens; **max 64 chars**; no reserved words `anthropic` / `claude`. Defaults to the directory name. |
18
+ | `description` | Recommended | **Hard limit 1,024 chars** (API validation). In the Claude Code slash-command listing, combined `description + when_to_use` is truncated at **1,536 chars** per entry. Primary triggering mechanism. |
19
+ | `when_to_use` | No | Additional trigger phrases / example requests. Appended to `description` in the listing. |
20
+ | `argument-hint` | No | Autocomplete hint, e.g. `[issue-number]` or `[filename] [format]`. |
21
+ | `disable-model-invocation` | No | `true` → only invocable via `/name`; Claude won't auto-load. Default `false`. |
22
+ | `user-invocable` | No | `false` → hidden from `/` menu (use for reference-only skills). Default `true`. |
23
+ | `allowed-tools` | No | Space-separated string or YAML list. Whitelist for no-ask permission while active; does **not** restrict (use `/permissions` deny-rules to restrict). |
24
+ | `model` | No | Override session model while skill is active. |
25
+ | `effort` | No | `low` \| `medium` \| `high` \| `xhigh` \| `max` — availability depends on model. |
26
+ | `context` | No | `fork` runs the skill body inside a forked subagent (see §3). |
27
+ | `agent` | No | Which subagent type to use when `context: fork` is set. `Explore` \| `Plan` \| `general-purpose` \| a custom agent name. Defaults to `general-purpose`. |
28
+ | `hooks` | No | Lifecycle hooks scoped to this skill only. |
29
+ | `paths` | No | Glob patterns; when set, skill auto-loads only on matching files. |
30
+ | `shell` | No | `bash` (default) or `powershell` (requires `CLAUDE_CODE_USE_POWERSHELL_TOOL=1`). |
31
+
32
+ **Undocumented but accepted in the wild**: `license` (appears in Anthropic's `pdf/SKILL.md`, `canvas-design/SKILL.md` — metadata only, not parsed); `compatibility` (skill-creator, rarely needed); `version` (ignored by Claude Code); `memory`/`metadata` (not part of the documented Claude Code schema — any such field is silently ignored).
33
+
34
+ > The older Anthropic support article (support.claude.com/en/articles/12512198) claims a 200-char `description` limit. **This is outdated** — treat the platform best-practices page (1,024 chars) as authoritative.
35
+
36
+ ### 1.2 How `description` drives automatic invocation — the "pushy" pattern
37
+
38
+ At startup, Claude Code scans skill directories and injects an `<available_skills>` block into the system prompt of the built-in **`Skill` tool**. Each entry exposes `name`, `description`, and `location` (`user` or `project`) — the SKILL.md body is **never** pre-loaded. Claude decides whether to call `Skill(command="super-design")` based on the description alone (reverse-engineered by Mikhail Shilkov, [mikhail.io/2025/10/claude-code-skills/](https://mikhail.io/2025/10/claude-code-skills/), consistent with the published docs).
39
+
40
+ The canonical "pushy" pattern from `skill-creator/SKILL.md` ([github.com/anthropics/skills/blob/main/skills/skill-creator/SKILL.md](https://github.com/anthropics/skills/blob/main/skills/skill-creator/SKILL.md)) — quoted verbatim:
41
+
42
+ > "Claude has a tendency to 'undertrigger' skills — to not use them when they'd be useful. To combat this, please make the skill descriptions a little bit 'pushy'. So for instance, instead of *'How to build a simple fast dashboard to display internal Anthropic data.'* you might write *'How to build a simple fast dashboard to display internal Anthropic data. **Make sure to use this skill whenever the user mentions dashboards, data visualization, internal metrics, or wants to display any kind of company data, even if they don't explicitly ask for a "dashboard."**'*"
43
+
44
+ Best-practices formula ([platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices)):
45
+
46
+ - **Third person, always.** *"The description is injected into the system prompt, and inconsistent point-of-view can cause discovery problems."*
47
+ - Formula = **what it does + when to use it + key capabilities**.
48
+ - Good: `"Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction."`
49
+ - Avoid: `"I can help you…"`, `"You can use this to…"`, broad catchalls like `"Assists with any development task"`.
50
+
51
+ **Under-triggering** remedies: include keywords users naturally say; front-load the use case; be pushy; add explicit trigger phrases in `when_to_use`. **Over-triggering** remedies: make description more specific or set `disable-model-invocation: true`. Recommended length: **100–200 words, comfortably under 1,024 chars** ([skill-creator scripts/improve_description.py guidance](https://github.com/anthropics/skills/blob/main/skills/skill-creator/scripts/improve_description.py)).
52
+
53
+ > "Claude only consults skills for tasks it can't easily handle on its own — simple, one-step queries like 'read this PDF' may not trigger a skill even if the description matches perfectly." — [code.claude.com/docs/en/skills](https://code.claude.com/docs/en/skills)
54
+
55
+ ### 1.3 Progressive disclosure and the 500-line limit
56
+
57
+ Three loading levels ([platform.claude.com/docs/en/agents-and-tools/agent-skills/overview](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview)):
58
+
59
+ | Level | Loaded when | Budget | Content |
60
+ |---|---|---|---|
61
+ | **L1 Metadata** | Always at startup | ~100 tokens / skill | `name` + `description` |
62
+ | **L2 Instructions** | When skill is triggered | target < 5k tokens | SKILL.md body |
63
+ | **L3+ Resources** | On demand via Read/Bash | effectively unlimited | Bundled files |
64
+
65
+ The 500-line rule appears in three canonical places:
66
+
67
+ > "Keep SKILL.md under 500 lines. Move detailed reference material to separate files." ([Claude Code docs](https://code.claude.com/docs/en/skills))
68
+
69
+ > "Keep SKILL.md under 500 lines; if you're approaching this limit, add an additional layer of hierarchy along with clear pointers about where the model using the skill should go next to follow up." (skill-creator)
70
+
71
+ **Anti-pattern**: nested references. *"Keep references one level deep from SKILL.md"* because Claude will `head -100` partial-read deeply nested files. Add a table of contents to any file > 100 lines.
72
+
73
+ **Session lifecycle quirk**: once invoked, the rendered SKILL.md enters the conversation as a **single message that persists for the session**; Claude Code does **not** re-read it on later turns. At auto-compaction, *"the most recent invocation of each skill is re-attached after the summary, keeping the first 5,000 tokens of each, with a combined budget of 25,000 tokens across all re-attached skills."*
74
+
75
+ ### 1.4 Bundled-resources layout
76
+
77
+ The canonical hierarchy (skill-creator SKILL.md):
78
+
79
+ ```
80
+ super-design/
81
+ ├── SKILL.md # required — YAML frontmatter + ≤500 lines markdown
82
+ ├── scripts/ # executable code, run via Bash; output-only in context
83
+ │ ├── dispatch.py
84
+ │ └── package_artifacts.py
85
+ ├── references/ # markdown docs loaded on demand
86
+ │ ├── agent-playbooks.md
87
+ │ ├── orchestration-patterns.md
88
+ │ └── troubleshooting.md
89
+ └── assets/ # templates/icons/fonts used in output
90
+ └── design-spec-template.md
91
+ ```
92
+
93
+ Conventions:
94
+
95
+ - **`scripts/`** — *"More reliable than generated code. Save tokens. Save time. Ensure consistency."* Describe scripts as **execute** (`Run \`dispatch.py\` to fan out subagents`) vs **read-as-reference** (`See \`dispatch.py\` for the algorithm`). Always forward slashes, even on Windows.
96
+ - **`references/`** — organize by variant: `references/component-design.md`, `references/systems-design.md`, etc., so Claude reads only the relevant file.
97
+ - **`assets/`** — templated output files. Use `__PLACEHOLDER__` tokens that Claude substitutes (pattern from `skill-creator/assets/eval_review.html`).
98
+
99
+ ### 1.5 How agents read bundled files and the "Base Path"
100
+
101
+ When the `Skill` tool is invoked (`{"name":"Skill","input":{"command":"super-design"}}`), the tool result is a **plain-text injection** into the conversation whose first line is literally:
102
+
103
+ ```
104
+ Base Path: /Users/<you>/.claude/skills/super-design/
105
+
106
+ # Super-Design Orchestrator
107
+ ... body of SKILL.md (frontmatter stripped) ...
108
+ ```
109
+
110
+ This is **not** an OS env var — it is prompt-injected ([mikhail.io/2025/10/claude-code-skills/](https://mikhail.io/2025/10/claude-code-skills/), consistent with docs). Claude then uses Read/Bash tools with that absolute path to reach `scripts/`, `references/`, `assets/`.
111
+
112
+ At authoring time, the portable template variable is **`${CLAUDE_SKILL_DIR}`**:
113
+
114
+ > "The directory containing the skill's SKILL.md file. For plugin skills, this is the skill's subdirectory within the plugin, not the plugin root. Use this in bash injection commands to reference scripts or files bundled with the skill, regardless of the current working directory." — [code.claude.com/docs/en/skills](https://code.claude.com/docs/en/skills)
115
+
116
+ Other runtime substitutions: `$ARGUMENTS` (full raw arg string), `$ARGUMENTS[N]` / `$N` (shell-quoted positional args), `${CLAUDE_SESSION_ID}`. Inline shell injection: `` !`gh pr diff` `` (preprocessed before Claude sees the body; disable with `"disableSkillShellExecution": true`).
117
+
118
+ ### 1.6 Install locations and precedence
119
+
120
+ From [code.claude.com/docs/en/skills](https://code.claude.com/docs/en/skills):
121
+
122
+ | Location | Path | Scope |
123
+ |---|---|---|
124
+ | Enterprise | managed settings | org-wide |
125
+ | Personal | `~/.claude/skills/<name>/SKILL.md` | all projects |
126
+ | Project | `.claude/skills/<name>/SKILL.md` | this project |
127
+ | Plugin | `<plugin>/skills/<name>/SKILL.md` | where plugin enabled |
128
+
129
+ Precedence: **enterprise > personal > project**; plugin skills are namespaced (`plugin:skill`) and cannot collide. If a skill and a command share a name, **the skill wins**. Edits to existing skills are hot-reloaded mid-session; adding a *new* top-level skills directory requires a restart. Monorepo auto-discovery: `packages/frontend/.claude/skills/` is auto-loaded when editing files under `packages/frontend/`. Directories added with `--add-dir` are the exception to the normal rule — their `.claude/skills/` **is** loaded. Custom skill paths outside these four locations are **not yet supported** as of Feb 2026 (open FR [anthropics/claude-code#22902](https://github.com/anthropics/claude-code/issues/22902)).
130
+
131
+ ### 1.7 CLI commands (Claude Code terminal)
132
+
133
+ There is no dedicated `claude skill create`; you create skills by filesystem convention:
134
+
135
+ ```bash
136
+ # Project skill (recommended for super-design)
137
+ mkdir -p .claude/skills/super-design/{scripts,references,assets}
138
+ $EDITOR .claude/skills/super-design/SKILL.md
139
+
140
+ # Or bootstrap from Anthropic's template (requires cloning anthropics/skills once)
141
+ python scripts/init_skill.py super-design --path .claude/skills
142
+ ```
143
+
144
+ Invocation at runtime:
145
+
146
+ ```
147
+ /super-design # invoke by name
148
+ /super-design "component auth" react # with quoted args ($0="component auth", $1="react")
149
+ /plugin-name:super-design # plugin-qualified
150
+ ```
151
+
152
+ Discovery: type `/` in the prompt for autocomplete, or ask Claude `What skills are available?` (recommended in the official troubleshooting guide). Plugin manager: `/plugin`, `/plugin marketplace add <org>/<repo>`, `/plugin install <plugin>@<marketplace>`.
153
+
154
+ Useful env vars:
155
+
156
+ | Var | Effect |
157
+ |---|---|
158
+ | `SLASH_COMMAND_TOOL_CHAR_BUDGET` | Raises per-session char budget for skill listings (default `max(8000, 1% of context)`). |
159
+ | `CLAUDE_CODE_USE_POWERSHELL_TOOL=1` | Enables `shell: powershell`. |
160
+ | `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1` | Disables background subagent execution. |
161
+ | `CLAUDE_CODE_SUBAGENT_MODEL` | Forces all subagents to a specific model ID. |
162
+
163
+ Permission rules: `Skill` (deny-all), `Skill(super-design)` exact-match, `Skill(super-design *)` prefix-with-args.
164
+
165
+ ---
166
+
167
+ ## 2. Subagents in Claude Code (.claude/agents/)
168
+
169
+ ### 2.1 Canonical definition
170
+
171
+ > "Subagents are specialized AI assistants that handle specific types of tasks. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a task that matches a subagent's description, it delegates to that subagent, which works independently and returns results." — [code.claude.com/docs/en/sub-agents](https://code.claude.com/docs/en/sub-agents)
172
+
173
+ > "Subagents receive only this system prompt (plus basic environment details like working directory), not the full Claude Code system prompt."
174
+
175
+ Built-in subagents always available: **Explore** (Haiku, read-only, codebase discovery), **Plan** (read-only, for plan mode), **general-purpose** (all tools), plus `statusline-setup` and `Claude Code Guide`.
176
+
177
+ ### 2.2 Frontmatter schema
178
+
179
+ Only `name` and `description` are required.
180
+
181
+ | Field | Notes |
182
+ |---|---|
183
+ | `name` | Lowercase + hyphens. Becomes `@agent-<name>` and the `subagent_type` parameter. |
184
+ | `description` | Drives automatic routing. Add **"use PROACTIVELY"** / **"Use immediately after…"** for auto-delegation. |
185
+ | `tools` | Comma-separated string **or** YAML array. **Omit → inherits every tool (including MCP)**. Allowlist. |
186
+ | `disallowedTools` | Denylist; resolved **before** `tools`. |
187
+ | `model` | `sonnet` \| `opus` \| `haiku` \| explicit model ID \| `inherit` (default). Resolution order: env `CLAUDE_CODE_SUBAGENT_MODEL` → per-invocation `model` param → frontmatter → main model. |
188
+ | `permissionMode` | `default` \| `acceptEdits` \| `auto` \| `dontAsk` \| `bypassPermissions` \| `plan`. Parent's `bypassPermissions`/`acceptEdits` wins. |
189
+ | `maxTurns` | Hard cap on agentic turns. |
190
+ | `skills` | List of skill names to inject into this subagent's startup context. **Full skill content is injected, not just made discoverable.** Subagents don't inherit parent skills. |
191
+ | `mcpServers` | Scope MCP servers to this subagent only; connected at start, disconnected at end. |
192
+ | `hooks` | Per-subagent lifecycle hooks. `Stop` → auto-converted to `SubagentStop`. |
193
+ | `memory` | `user` \| `project` \| `local`; auto-enables Read/Write/Edit and injects first 200 lines / 25 KB of `MEMORY.md`. |
194
+ | `background` | `true` → always background. |
195
+ | `effort` | Overrides session effort. |
196
+ | `isolation` | `worktree` → runs in a temporary git worktree (auto-cleaned if no changes). |
197
+ | `color` | `red`\|`blue`\|`green`\|`yellow`\|`purple`\|`orange`\|`pink`\|`cyan` (display only). |
198
+ | `initialPrompt` | Auto-submitted first turn when agent runs as main session via `--agent`. |
199
+
200
+ **Plugin-sourced subagents cannot use `hooks`, `mcpServers`, or `permissionMode` for security reasons** — copy into `.claude/agents/` if you need those.
201
+
202
+ ### 2.3 Routing mechanics
203
+
204
+ Three invocation pathways:
205
+
206
+ 1. **Automatic** — Claude reads the `description` field and calls the `Agent` tool (formerly `Task`, renamed in Claude Code **v2.1.63** — old `Task(...)` still works as alias). Automatic routing is **unreliable in practice** — community consensus is to use explicit invocation for production skills.
207
+ 2. **Explicit `@-mention`** — `@agent-code-reviewer look at the auth changes` guarantees the subagent runs once.
208
+ 3. **Whole-session**: `claude --agent <name>` replaces the default system prompt entirely.
209
+
210
+ Inside a SKILL.md body, natural language reliably triggers the Agent tool call:
211
+
212
+ ```markdown
213
+ Use the Task tool (now called Agent) to launch the code-explorer subagent.
214
+ Each instance should:
215
+ - Target a different aspect of the codebase
216
+ - Return a self-contained summary
217
+
218
+ Spawn 3 instances **in parallel** (all in a single message).
219
+ ```
220
+
221
+ ### 2.4 Context isolation (exact semantics)
222
+
223
+ From [platform.claude.com/docs/en/agent-sdk/subagents](https://platform.claude.com/docs/en/agent-sdk/subagents):
224
+
225
+ > "A subagent's context window starts fresh (no parent conversation) but isn't empty. The only channel from parent to subagent is the Agent tool's prompt string, so include any file paths, error messages, or decisions the subagent needs directly in that prompt."
226
+
227
+ | Subagent receives | Subagent does NOT receive |
228
+ |---|---|
229
+ | Its own system prompt (markdown body) | Parent conversation history or tool results |
230
+ | The Agent tool's `prompt` argument | Skills (unless in `skills:` frontmatter) |
231
+ | Project `CLAUDE.md` (if `settingSources` permits) | Parent's system prompt |
232
+ | Tool definitions (inherited or subset) | The standard Claude Code system prompt |
233
+ | Working directory | |
234
+
235
+ Back to parent:
236
+
237
+ > "The parent receives the subagent's final message verbatim as the Agent tool result, but may summarize it in its own response. To preserve subagent output verbatim in the user-facing response, include an instruction to do so in the prompt you pass to the main `query()` call."
238
+
239
+ Transcript: persisted at `~/.claude/projects/{project}/{sessionId}/subagents/agent-{agentId}.jsonl`, unaffected by parent compaction, subagent-level auto-compaction at ~95% (tunable with `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`).
240
+
241
+ ### 2.5 Hard limits
242
+
243
+ - **No nesting.** *"Subagents cannot spawn other subagents. If your workflow requires nested delegation, use Skills or chain subagents from the main conversation."* Max depth = 1.
244
+ - **Concurrency ceiling (community-measured, not Anthropic-published): ~10 concurrent tasks**, then batched — "Claude doesn't dynamically pull from the queue as Tasks complete. It waits for the entire batch to finish before starting the next one" ([amitkoth.com/claude-code-task-tool-vs-subagents](https://amitkoth.com/claude-code-task-tool-vs-subagents/)). Anthropic's research system scales to **10+ subagents** for complex research.
245
+ - **Token cost: agents ≈ 4× chat, multi-agent ≈ 15× chat** ([anthropic.com/engineering/multi-agent-research-system](https://www.anthropic.com/engineering/multi-agent-research-system)).
246
+ - **Subagents cannot invoke the `Skill` tool** ([issue #38719](https://github.com/anthropics/claude-code/issues/38719)) — skills must be pre-loaded via `skills:` frontmatter or the main session must orchestrate.
247
+
248
+ ### 2.6 Skills inside subagents — two inverse patterns
249
+
250
+ **Pattern A — `skills:` field in subagent frontmatter** (subagent USES skills):
251
+ ```yaml
252
+ ---
253
+ name: api-developer
254
+ description: Implement API endpoints following team conventions
255
+ skills:
256
+ - api-conventions
257
+ - error-handling-patterns
258
+ ---
259
+ ```
260
+ > "The full content of each skill is injected into the subagent's context, not just made available for invocation. Subagents don't inherit skills from the parent conversation; you must list them explicitly." — [code.claude.com/docs/en/sub-agents](https://code.claude.com/docs/en/sub-agents)
261
+
262
+ **Pattern B — `context: fork` in SKILL.md** (skill RUNS in a subagent):
263
+ ```yaml
264
+ ---
265
+ name: pr-summary
266
+ description: Summarize changes in a pull request
267
+ context: fork
268
+ agent: Explore
269
+ allowed-tools: Bash(gh *)
270
+ ---
271
+ ```
272
+ Known bug: the Skill tool may currently ignore `context: fork` / `agent:` and run inline ([issue #17283](https://github.com/anthropics/claude-code/issues/17283)).
273
+
274
+ ### 2.7 CLI and install locations
275
+
276
+ ```bash
277
+ /agents # interactive manager: list, create, edit, delete
278
+ claude agents # non-interactive list
279
+ claude --agent code-reviewer # whole session as that agent
280
+ claude --agents '{ "scout": {...} }' # ephemeral session-scoped
281
+ claude --disallowedTools "Agent(Explore)" # block a specific subagent type
282
+ ```
283
+
284
+ Precedence (highest first): managed org settings → `--agents` CLI flag → project `.claude/agents/` → `~/.claude/agents/` → plugin `agents/`. Manually adding a file usually requires restart; `/agents` edits hot-reload.
285
+
286
+ ### 2.8 Canonical real examples
287
+
288
+ **Code reviewer** ([docs verbatim](https://code.claude.com/docs/en/sub-agents)):
289
+ ```markdown
290
+ ---
291
+ name: code-reviewer
292
+ description: Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code.
293
+ tools: Read, Grep, Glob, Bash
294
+ model: inherit
295
+ ---
296
+
297
+ You are a senior code reviewer ensuring high standards of code quality and security.
298
+
299
+ When invoked:
300
+ 1. Run git diff to see recent changes
301
+ 2. Focus on modified files
302
+ 3. Begin review immediately
303
+
304
+ Review checklist:
305
+ - Code is clear and readable
306
+ - Functions and variables are well-named
307
+ - Proper error handling
308
+ - No exposed secrets or API keys
309
+ - Input validation implemented
310
+ - Good test coverage
311
+
312
+ Provide feedback organized by priority:
313
+ - Critical issues (must fix)
314
+ - Warnings (should fix)
315
+ - Suggestions (consider improving)
316
+ ```
317
+
318
+ **DB reader with per-agent hook**:
319
+ ```markdown
320
+ ---
321
+ name: db-reader
322
+ description: Execute read-only database queries. Use when analyzing data or generating reports.
323
+ tools: Bash
324
+ hooks:
325
+ PreToolUse:
326
+ - matcher: "Bash"
327
+ hooks:
328
+ - type: command
329
+ command: "./scripts/validate-readonly-query.sh"
330
+ ---
331
+
332
+ You are a database analyst with read-only access. If asked to modify data, explain that you only have read access.
333
+ ```
334
+
335
+ **Repo explorer with memory** (community pattern matching docs):
336
+ ```markdown
337
+ ---
338
+ name: repo-explorer
339
+ description: Search unfamiliar codebases, map entry points, and summarize the architecture. Do not edit files.
340
+ tools: [Read, Grep, Glob]
341
+ disallowedTools: [Edit, Write, Bash]
342
+ model: haiku
343
+ permissionMode: plan
344
+ memory: project
345
+ ---
346
+ Find main entry points, core data flow, likely risk areas. Return a short summary with file paths, key abstractions, and open questions. Update MEMORY.md with discoveries.
347
+ ```
348
+
349
+ ---
350
+
351
+ ## 3. Orchestration patterns
352
+
353
+ ### 3.1 The Agent (Task) tool — parameters and return
354
+
355
+ | Param | Type | Example |
356
+ |---|---|---|
357
+ | `subagent_type` | string | `"Explore"`, `"code-reviewer"`, `"general-purpose"` |
358
+ | `description` | string | `"Find auth files"` |
359
+ | `prompt` | string | Full self-contained task (subagent sees ONLY this) |
360
+ | `model` | string (optional) | `"sonnet"`, `"haiku"` |
361
+ | `run_in_background` | bool (optional) | `true` for concurrent fire-and-continue |
362
+
363
+ Pseudo-XML the model actually emits:
364
+ ```
365
+ <invoke name="Agent">
366
+ <parameter name="subagent_type">code-explorer</parameter>
367
+ <parameter name="description">Trace auth flow</parameter>
368
+ <parameter name="prompt">Full self-contained task with all paths and context...</parameter>
369
+ </invoke>
370
+ ```
371
+
372
+ Return: only the subagent's **final assistant message** is injected into parent context. Full transcript stays on disk. Parent may summarize further unless you instruct verbatim pass-through.
373
+
374
+ ### 3.2 Forcing parallel dispatch
375
+
376
+ Parallel execution happens when **all `Agent()` calls are emitted in a single assistant message**. Across separate messages → sequential.
377
+
378
+ The canonical prompt block, used in Anthropic's own research system ([simonwillison.net/2025/Jun/14/multi-agent-research-system/](https://simonwillison.net/2025/Jun/14/multi-agent-research-system/)):
379
+
380
+ ```
381
+ <use_parallel_tool_calls>
382
+ For maximum efficiency, whenever you need to perform multiple
383
+ independent operations, invoke all relevant tools simultaneously
384
+ rather than sequentially. Call tools in parallel to run subagents
385
+ at the same time. You MUST use parallel tool calls for creating
386
+ multiple subagents (typically running 3 subagents at the same time)
387
+ at the start of the research, unless it is a straightforward query.
388
+ </use_parallel_tool_calls>
389
+ ```
390
+
391
+ User-facing phrasings that reliably parallelize:
392
+ - *"Explore the codebase using 4 tasks in parallel. Each agent should explore different directories."*
393
+ - *"Launch 3 code-reviewer agents in parallel with different focuses: simplicity/DRY, bugs/correctness, conventions."*
394
+
395
+ Effort-scaling heuristics Anthropic embeds in prompts: simple fact-finding → **1 agent, 3–10 tool calls**; comparisons → **2–4 subagents, 10–15 calls each**; complex research → **10+ subagents**. Anthropic's research system reports the multi-agent configuration (Opus lead + Sonnet workers) outperformed single-agent Opus by **90.2%** on internal research evals.
396
+
397
+ ### 3.3 Sequential vs parallel routing rules (community pattern)
398
+
399
+ From [claudefa.st/blog/guide/agents/sub-agent-best-practices](https://claudefa.st/blog/guide/agents/sub-agent-best-practices) — paste this into your orchestrator skill body or `CLAUDE.md`:
400
+
401
+ ```markdown
402
+ ## Sub-Agent Routing Rules
403
+ **Parallel dispatch** (ALL conditions must be met):
404
+ - 3+ unrelated tasks or independent domains
405
+ - No shared state between tasks
406
+ - Clear file boundaries with no overlap
407
+
408
+ **Sequential dispatch** (ANY condition triggers):
409
+ - Tasks have dependencies (B needs output from A)
410
+ - Shared files or state (merge conflict risk)
411
+ - Unclear scope (need to understand before proceeding)
412
+
413
+ **Background dispatch**:
414
+ - Research or analysis tasks (not file modifications)
415
+ - Results aren't blocking your current work
416
+ ```
417
+
418
+ ### 3.4 Hooks for chaining (SubagentStop, Stop, PreToolUse/PostToolUse)
419
+
420
+ Hook config lives in `.claude/settings.json`, `.claude/settings.local.json`, `~/.claude/settings.json`, or plugin `hooks/hooks.json`. Three-level nesting: **event → matcher group → hook handler**. Four handler types: `command` (default timeout **600s**), `http` (POST), `prompt` (LLM eval, 30s), `agent` (spawns inspection subagent, 60s). Context injection from hooks is capped at **10,000 characters**; larger content is saved to a file and replaced with a path preview.
421
+
422
+ Events relevant to orchestration:
423
+
424
+ | Event | Matcher | Can block? |
425
+ |---|---|---|
426
+ | `SubagentStart` | agent type | No (can inject context) |
427
+ | `SubagentStop` | agent type | **Yes** (exit 2 or `{"decision":"block","reason":"..."}`) |
428
+ | `PreToolUse` | `Agent` | Yes — allow/deny/ask/defer + `updatedInput` |
429
+ | `PostToolUse` | `Agent` | No (feedback only) |
430
+ | `Stop` | — | Yes |
431
+
432
+ `SubagentStop` input (verbatim from docs):
433
+ ```json
434
+ {
435
+ "session_id": "abc123",
436
+ "hook_event_name": "SubagentStop",
437
+ "stop_hook_active": false,
438
+ "agent_id": "def456",
439
+ "agent_type": "Explore",
440
+ "agent_transcript_path": "~/.claude/projects/.../abc123/subagents/agent-def456.jsonl",
441
+ "last_assistant_message": "Analysis complete. Found 3 potential issues..."
442
+ }
443
+ ```
444
+
445
+ Always check `stop_hook_active` to avoid infinite loops — it's `true` when Claude is already continuing from a prior blocked stop.
446
+
447
+ **Example: project `.claude/settings.json` dispatcher**:
448
+
449
+ ```json
450
+ {
451
+ "hooks": {
452
+ "SubagentStop": [
453
+ {
454
+ "matcher": "sd-research",
455
+ "hooks": [
456
+ { "type": "command",
457
+ "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/next-step.sh",
458
+ "timeout": 30 }
459
+ ]
460
+ }
461
+ ],
462
+ "Stop": [
463
+ {
464
+ "hooks": [
465
+ { "type": "command",
466
+ "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/safety-net.sh" }
467
+ ]
468
+ }
469
+ ],
470
+ "PreToolUse": [
471
+ {
472
+ "matcher": "Agent",
473
+ "hooks": [
474
+ { "type": "command",
475
+ "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/gate-subagent.sh" }
476
+ ]
477
+ }
478
+ ]
479
+ }
480
+ }
481
+ ```
482
+
483
+ **Example: `.claude/hooks/next-step.sh`** — a queue-popping hook that forces Claude to dispatch the next subagent:
484
+
485
+ ```bash
486
+ #!/bin/bash
487
+ INPUT=$(cat)
488
+ QUEUE=".claude/queue.jsonl"
489
+ NEXT=$(head -n 1 "$QUEUE")
490
+ [ -z "$NEXT" ] && exit 0 # queue empty → allow stop
491
+ tail -n +2 "$QUEUE" > "$QUEUE.tmp" && mv "$QUEUE.tmp" "$QUEUE"
492
+
493
+ NEXT_AGENT=$(echo "$NEXT" | jq -r '.agent')
494
+ NEXT_PROMPT=$(echo "$NEXT" | jq -r '.prompt')
495
+
496
+ jq -n --arg a "$NEXT_AGENT" --arg p "$NEXT_PROMPT" '{
497
+ decision: "block",
498
+ reason: ("Previous subagent finished. Next: invoke the " + $a +
499
+ " subagent with prompt: " + $p)
500
+ }'
501
+ ```
502
+
503
+ A `SubagentStop` output of `{"decision":"block","reason":"..."}` forces Claude to continue; the `reason` arrives as a system reminder that it obeys. Common failure mode (PubNub): output must go to **STDOUT, not `/dev/tty`**.
504
+
505
+ **`async: true`** (January 2026+) lets command hooks run non-blockingly; `asyncRewake: true` wakes Claude on exit code 2 by feeding stderr as a system reminder.
506
+
507
+ ### 3.5 Handoff mechanisms — files vs prompts
508
+
509
+ | Mechanism | Pros | Cons |
510
+ |---|---|---|
511
+ | **Return value (prompt string)** | Zero coord, automatic summarization | Non-deterministic, parent-context bloat, reports of 160k-token runs for 3k-token work |
512
+ | **Files on disk** | Deterministic, debuggable, tiny parent context | Requires explicit write protocol |
513
+ | **Agent memory (`memory:` field)** | Persists across sessions | Shared-write contention |
514
+ | **`isolation: worktree`** | Per-subagent repo checkout | Auto-cleaned only if no changes |
515
+ | **`SendMessage` / agent teams** (`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`) | Background resume without new `Agent` call | Experimental |
516
+
517
+ The **file-based pattern is what Anthropic itself uses** for long-running research:
518
+
519
+ > "We implemented patterns where agents summarize completed work phases and store essential information in external memory before proceeding to new tasks. When context limits approach, agents can spawn fresh subagents with clean contexts while maintaining continuity through careful handoffs." — [anthropic.com/engineering/multi-agent-research-system](https://www.anthropic.com/engineering/multi-agent-research-system)
520
+
521
+ Canonical workspace layout (from `altmbr/claude-research-skill`, mirrored by skill-creator):
522
+
523
+ ```
524
+ super-design-workspace/
525
+ └── <session-id>/
526
+ ├── brief.md # orchestrator writes; workers read
527
+ ├── agent-1-research.md # worker 1 output
528
+ ├── agent-2-design.md # worker 2 output
529
+ ├── agent-3-critique.md # worker 3 output
530
+ └── synthesis.md # final synthesis-agent output
531
+ ```
532
+
533
+ Enforce a **write-after-every-search** protocol in your worker prompts: "search → write → search → write" (agents that research without writing get stuck in loops — per the research-skill repo).
534
+
535
+ ### 3.6 Queue pattern with a hook watcher
536
+
537
+ ```
538
+ .claude/
539
+ ├── settings.json # registers SubagentStop + Stop hooks
540
+ ├── queue.jsonl # one JSON task per line
541
+ ├── skills/super-design/SKILL.md # orchestrator
542
+ ├── agents/ # workers
543
+ │ ├── sd-research.md
544
+ │ ├── sd-design.md
545
+ │ └── sd-critique.md
546
+ └── hooks/
547
+ ├── next-step.sh # pops queue, blocks stop
548
+ └── safety-net.sh # Stop fallback
549
+ ```
550
+
551
+ `queue.jsonl`:
552
+ ```jsonl
553
+ {"id":"t1","agent":"sd-research","prompt":"Gather design constraints for $TARGET","status":"pending"}
554
+ {"id":"t2","agent":"sd-design","prompt":"Produce 3 design candidates using research/t1.md","depends_on":"t1"}
555
+ {"id":"t3","agent":"sd-critique","prompt":"Critique candidates; recommend 1","depends_on":"t2"}
556
+ ```
557
+
558
+ ### 3.7 Reference orchestrators in the wild
559
+
560
+ | Repo | Pattern |
561
+ |---|---|
562
+ | [wshobson/agents](https://github.com/wshobson/agents) | 182 agents + 16 workflow orchestrators; chains like `backend-architect → database-architect → frontend → test-automator → security-auditor` |
563
+ | [vanzan01/claude-code-sub-agent-collective](https://github.com/vanzan01/claude-code-sub-agent-collective) | Hub-and-spoke `@task-orchestrator` + `test-driven-handoff.sh` hook |
564
+ | [altmbr/claude-research-skill](https://github.com/altmbr/claude-research-skill) | Decompose → parallel workstreams via Task → kill-and-relaunch if stuck → synthesis |
565
+ | [obra/superpowers](https://github.com/obra/superpowers) | 20+ skills; TDD/debugging orchestrators dispatch to `.claude/agents/` specialists |
566
+ | [glebis/claude-skills](https://github.com/glebis/claude-skills) | TDD orchestrator with strict per-slice context filtering (test-writer sees spec only, implementer sees failing test only) |
567
+ | [kieranklaassen/orchestrating-swarms gist](https://gist.github.com/kieranklaassen/4f2aba89594a4aea4ad64d753984b2ea) | TeammateTool + TaskCreate/TaskUpdate + per-agent JSON inboxes |
568
+ | [barkain/claude-code-workflow-orchestration](https://github.com/barkain/claude-code-workflow-orchestration) | Plan-mode phase decomposition; picks team vs subagent based on `TeamCreate` availability |
569
+ | [disler/claude-code-hooks-mastery](https://github.com/disler/claude-code-hooks-mastery) | Builder/Validator agent pattern, per-hook UV scripts |
570
+ | [turtir-ai/nexus-v3-5](https://github.com/turtir-ai/nexus-v3-5) | `nexus_agent_dispatcher.py` routes by `task.type`; quality-gate → self-heal → auto-learn |
571
+
572
+ ---
573
+
574
+ ## 4. skill-creator and the Anthropic skills repo
575
+
576
+ ### 4.1 Skills in `anthropics/skills`
577
+
578
+ Top-level skills at [github.com/anthropics/skills/tree/main/skills](https://github.com/anthropics/skills/tree/main/skills):
579
+
580
+ | Skill | Purpose |
581
+ |---|---|
582
+ | algorithmic-art | Generative visual art |
583
+ | brand-guidelines | Apply brand color/typography (defaults to Anthropic brand) |
584
+ | canvas-design | Visual design on a canvas surface |
585
+ | claude-api | Build LLM apps with decision tree (single call → workflow → agent) |
586
+ | doc-coauthoring | Multi-phase document collaboration (gather → refine → reader-test) |
587
+ | docx | Word creation/editing/tracked-changes (powers Claude.ai docs) |
588
+ | frontend-design | Production-grade frontend avoiding "AI slop" |
589
+ | internal-comms | 3P updates, all-hands emails, incident reports |
590
+ | mcp-builder | Guide for building MCP servers |
591
+ | pdf | PDF extraction, merge/split, form handling |
592
+ | pptx | PowerPoint creation with layouts, charts, visual QA |
593
+ | **skill-creator** | Meta-skill: create, iterate, evaluate, optimize skills |
594
+ | slack-gif-creator | Animated GIFs |
595
+ | theme-factory | Theme/style system generation |
596
+ | web-artifacts-builder | Multi-component React+shadcn artifacts |
597
+ | webapp-testing | Playwright reconnaissance-then-action |
598
+ | xlsx | Excel workbooks with formulas, charts |
599
+
600
+ Plus `spec/` (Agent Skills spec) and `template/` (starter).
601
+
602
+ ### 4.2 skill-creator — authoring rules worth copying
603
+
604
+ Frontmatter (verbatim):
605
+ > `description: Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.`
606
+
607
+ Core writing style (verbatim):
608
+
609
+ > "Try to explain to the model why things are important in lieu of heavy-handed musty MUSTs. Use theory of mind and try to make the skill general and not super-narrow to specific examples. … If you find yourself writing ALWAYS or NEVER in all caps, or using super rigid structures, that's a yellow flag — if possible, reframe and explain the reasoning so that the model understands *why* the thing you're asking for is important."
610
+
611
+ Improvement heuristics:
612
+ 1. **Generalize from feedback** — try different metaphors for stubborn issues.
613
+ 2. **Keep the prompt lean** — remove what doesn't pull weight; read transcripts, not just outputs.
614
+ 3. **Explain the why** — Claude has theory of mind; imperative MUSTs are a code smell.
615
+ 4. **Look for repeated work across test cases** — if all 3 tests resulted in Claude writing a `build_chart.py`, bundle that script.
616
+
617
+ ### 4.3 `init_skill.py` and `package_skill.py`
618
+
619
+ **`init_skill.py`** scaffolds a skill folder with `SKILL.md` (TODO frontmatter), `scripts/example.py`, `references/api_reference.md`, `assets/example_asset.txt`.
620
+ ```bash
621
+ python scripts/init_skill.py super-design --path .claude/skills
622
+ ```
623
+ Enforces kebab-case on `<skill-name>`. Mandate from skill-creator: *"When creating a new skill from scratch, always run the `init_skill.py` script."*
624
+
625
+ **`package_skill.py`** validates then zips a skill into a distributable `.skill` file (ZIP format).
626
+ ```bash
627
+ python -m scripts.package_skill .claude/skills/super-design ./dist
628
+ ```
629
+ Exclusions (verbatim):
630
+ ```python
631
+ EXCLUDE_DIRS = {"__pycache__", "node_modules"}
632
+ EXCLUDE_GLOBS = {"*.pyc"}
633
+ EXCLUDE_FILES = {".DS_Store"}
634
+ ROOT_EXCLUDE_DIRS = {"evals"} # evals/ excluded only at skill root
635
+ ```
636
+
637
+ Other scripts in `skills/skill-creator/scripts/`: `aggregate_benchmark.py`, `generate_report.py`, `improve_description.py`, `quick_validate.py`, `run_eval.py`, `run_loop.py`, `utils.py`.
638
+
639
+ ### 4.4 Evaluation patterns
640
+
641
+ Parallel **with-skill vs without-skill** runs in the same turn (never sequentially), workspace laid out as:
642
+ ```
643
+ <skill-name>-workspace/iteration-<N>/eval-<ID>/{with_skill,without_skill}/outputs/
644
+ ```
645
+ Each eval has `eval_metadata.json` (`eval_id`, `eval_name`, `prompt`, `assertions`) and `timing.json` (`total_tokens`, `duration_ms`). Grade with `agents/grader.md` → `grading.json` with `text`/`passed`/`evidence` fields. Aggregate:
646
+ ```bash
647
+ python -m scripts.aggregate_benchmark <workspace>/iteration-N --skill-name super-design
648
+ ```
649
+
650
+ **Description-optimization loop** (`run_loop.py`):
651
+ ```bash
652
+ python -m scripts.run_loop \
653
+ --eval-set <trigger-eval.json> \
654
+ --skill-path <path-to-skill> \
655
+ --model <model-id> \
656
+ --max-iterations 5 \
657
+ --verbose
658
+ ```
659
+ Mechanics (verbatim): *"It splits the eval set into 60% train and 40% held-out test, evaluates the current description (running each query 3 times to get a reliable trigger rate), then calls Claude to propose improvements based on what failed. … It returns JSON with `best_description` — selected by test score rather than train score to avoid overfitting."* Eval set should be 20 queries total, ~50/50 should-trigger vs should-not-trigger.
660
+
661
+ ### 4.5 Description-writing pitfalls (verbatim)
662
+
663
+ - "Your description should not be more than about 100-200 words, even if that comes at the cost of accuracy. **There is a hard limit of 1024 characters** — descriptions over that will be truncated."
664
+ - "Avoid lists of specific queries; instead, **generalize to categories of intent**."
665
+ - "Should use **'Use this skill for...'** rather than 'This skill does...'."
666
+ - "Focus on **user goals rather than implementation details**."
667
+ - "Don't make should-not-trigger queries obviously irrelevant. 'Write a fibonacci function' as a negative test for a PDF skill is too easy."
668
+ - "Subjective skills (writing style, design quality) are better evaluated qualitatively — don't force assertions onto things that need human judgment."
669
+ - **Overtriggering on Opus 4.5**: "Prompts designed to reduce undertriggering on previous models may cause Opus 4.5 to overtrigger." Remedy: remove "CRITICAL: You MUST…" and similar capitalized imperatives (from `claude-opus-4-5-migration/prompt-snippets.md`).
670
+
671
+ ### 4.6 anthropics/claude-code plugins relevant to super-design
672
+
673
+ - **plugin-dev** — comprehensive plugin-development toolkit; 7 skills (`hook-development`, `mcp-integration`, `plugin-structure`, `plugin-settings`, `commands`, `agents`, `skill-development`); agents `agent-creator`, `plugin-validator`, `skill-reviewer`; `/plugin-dev:create-plugin` (8-phase workflow).
674
+ - **feature-dev** — "Comprehensive feature development workflow with specialized agents for codebase exploration, architecture design, and quality review." 7 phases. Its commands demonstrate the **parallel research-agent fan-out** pattern verbatim:
675
+ > "Step 1: Launch Parallel Research Agents. Use the Task tool to spawn these subagents in parallel (all in a single message): 1. Web Documentation Agent (general-purpose) … 2. Stack Overflow Agent (general-purpose) … 3. Codebase Explorer Agent (Explore)."
676
+ - **pr-review-toolkit** — `/pr-review-toolkit:review-pr [comments|tests|errors|types|code|simplify|all]`; agents `comment-analyzer`, `pr-test-analyzer`, `silent-failure-hunter`, `type-design-analyzer`, `code-reviewer`, `code-simplifier`.
677
+ - **ralph-wiggum** — self-referential loops; Stop hook intercepts exit to continue iteration; state file `ralph-loop.local.md`.
678
+ - **hookify** — generates hooks from markdown rules without editing `hooks.json`.
679
+ - **code-review** — launches 4 review agents in parallel, filters by ≥80 confidence threshold.
680
+ - **claude-opus-4-5-migration** — anti-pattern → pattern replacement table for overtriggering.
681
+
682
+ ---
683
+
684
+ ## 5. A reference skeleton for `super-design`
685
+
686
+ ### 5.1 Recommended directory layout
687
+
688
+ ```
689
+ .claude/
690
+ ├── settings.json # hooks config
691
+ ├── skills/
692
+ │ └── super-design/
693
+ │ ├── SKILL.md # ≤500 lines, orchestrator
694
+ │ ├── scripts/
695
+ │ │ ├── dispatch.py # optional parallel dispatcher
696
+ │ │ └── synthesize.py
697
+ │ ├── references/
698
+ │ │ ├── routing-rules.md # parallel vs sequential rules
699
+ │ │ ├── agent-playbooks.md # what each subagent does
700
+ │ │ └── handoff-protocol.md
701
+ │ └── assets/
702
+ │ └── brief-template.md
703
+ ├── agents/
704
+ │ ├── sd-research.md # Haiku, read-only
705
+ │ ├── sd-design.md # Sonnet, Write
706
+ │ ├── sd-critique.md # Sonnet, Read + Grep
707
+ │ └── sd-synthesis.md # Opus, Read + Write
708
+ └── hooks/
709
+ ├── next-step.sh # queue dispatcher
710
+ ├── safety-net.sh # Stop fallback
711
+ └── gate-subagent.sh # PreToolUse(Agent) gate
712
+ ```
713
+
714
+ ### 5.2 Minimal SKILL.md starter
715
+
716
+ ```yaml
717
+ ---
718
+ name: super-design
719
+ description: Orchestrate multi-agent product design workflows. Use this skill whenever the user wants to produce, iterate on, or critique a non-trivial design artifact (component, page, system, or flow) that benefits from parallel research, multiple design candidates, and structured critique. Coordinates sd-research, sd-design, sd-critique, and sd-synthesis subagents with file-based handoff under super-design-workspace/. Use this skill even if the user does not explicitly ask for "orchestration" — anytime the task is large enough to need more than one perspective.
720
+ allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Agent
721
+ ---
722
+
723
+ # Super-Design Orchestrator
724
+
725
+ You coordinate a team of specialist subagents to produce high-quality design artifacts.
726
+
727
+ ## Workspace
728
+
729
+ All intermediate artifacts live under `super-design-workspace/${CLAUDE_SESSION_ID}/`:
730
+ - `brief.md` — you write this first
731
+ - `agent-*.md` — each worker writes here
732
+ - `synthesis.md` — final synthesizer output
733
+
734
+ ## Routing rules
735
+
736
+ **Parallel** when: ≥3 independent research/design threads, no shared files.
737
+ **Sequential** when: later step depends on earlier artifact or modifies shared files.
738
+
739
+ ## Procedure
740
+
741
+ 1. Read the user request. Write `brief.md` capturing goal, constraints, success criteria.
742
+ 2. Use the Agent tool to launch in a single message (parallel):
743
+ - sd-research (prompt: "Research constraints → write agent-research.md")
744
+ - sd-design (prompt: "Produce 3 candidates → write agent-design.md")
745
+ 3. When both return, launch sd-critique on their outputs.
746
+ 4. Launch sd-synthesis to pick one candidate and produce final deliverables.
747
+ 5. Summarize path to `synthesis.md` for the user.
748
+
749
+ Every Agent call's `prompt` must be self-contained — include the brief path, artifact
750
+ paths to read, and the exact file the subagent must write. Subagents cannot see this
751
+ conversation.
752
+ ```
753
+
754
+ ### 5.3 A worker example (`sd-research.md`)
755
+
756
+ ```yaml
757
+ ---
758
+ name: sd-research
759
+ description: Gather design constraints, prior art, and reference patterns for a super-design workflow. Use when the super-design orchestrator requests research. Writes findings to the workspace file specified in the invocation prompt.
760
+ tools: Read, Grep, Glob, WebSearch, WebFetch, Write
761
+ model: haiku
762
+ memory: project
763
+ permissionMode: plan
764
+ ---
765
+
766
+ You are a design researcher. Given a brief.md path and an output path:
767
+ 1. Read brief.md.
768
+ 2. Gather constraints, prior art, accessibility considerations, 3-5 reference links.
769
+ 3. Write a concise markdown report to the output path with sections:
770
+ Constraints / Prior art / Reference patterns / Open questions.
771
+ 4. Return a 3-sentence summary of where you wrote and what you found.
772
+
773
+ Never modify code. Never read outside brief.md and the repository.
774
+ ```
775
+
776
+ ---
777
+
778
+ ## Key takeaways
779
+
780
+ **Architecturally, a production orchestrator skill in Claude Code is three primitives glued together**: a single SKILL.md that lives in context for the whole session and contains a self-describing, "pushy" description under 1,024 characters; a roster of narrowly-scoped subagent markdown files under `.claude/agents/` invoked through the Agent tool (formerly Task, renamed v2.1.63); and a file-system workspace used as the canonical handoff medium because the parent never sees what subagents did internally — only their final message. Parallelism is a property of **one assistant message containing multiple Agent calls**, with a community-observed soft ceiling near 10 concurrent subagents and a real token-cost multiplier of ~15× over plain chat.
781
+
782
+ **The three biggest traps** for a skill like super-design: (1) naming collision with the existing SuperDesign VS Code extension — mitigate via tightly-scoped description wording or rename; (2) **subagents cannot spawn subagents and cannot invoke the Skill tool**, so any nested work must be orchestrated from the main session or pre-injected via `skills:` frontmatter; (3) `description` quality dominates triggering behavior — treat it as code, iterate it with `skill-creator`'s `run_loop.py` against a 20-query train/test split, and watch for the undertrigger-vs-overtrigger inversion that appeared with Opus 4.5.
783
+
784
+ **The proven production pattern** (Anthropic's own research system, mirrored across wshobson/agents, altmbr/claude-research-skill, vanzan01's collective, and obra/superpowers): Opus-class orchestrator plans → writes brief to disk → fans out 3–5 Sonnet/Haiku workers in parallel with self-contained prompts → workers write artifacts to a shared workspace → orchestrator reads the artifacts (not the worker return values) → a separate synthesis agent produces the final deliverable → optional SubagentStop hook chains the next phase by returning `{"decision":"block","reason":"..."}`. Everything that follows in your super-design build is elaboration on this skeleton.