Skip to content

Commit 23bad9d

Browse files
sjnimsclaude
andcommitted
docs: close documentation gaps vs official Claude Code docs
Audit against official Claude Code documentation identified 11 gaps. Added 2 new reference files (output styles, permission modes/rules) and expanded 11 existing files with missing topics including agent teams, context management, auto-memory, MCP features, enterprise settings, and improved trigger phrases across skills. Bump to v0.4.0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0e83403 commit 23bad9d

15 files changed

Lines changed: 457 additions & 14 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
},
77
"metadata": {
88
"description": "Unofficial plugin-dev plugin marketplace. Originally created by Daisy Hollman at Anthropic, now maintained by Steve Nims.",
9-
"version": "0.3.4"
9+
"version": "0.4.0"
1010
},
1111
"plugins": [
1212
{
1313
"name": "plugin-dev",
1414
"description": "Comprehensive toolkit for developing Claude Code plugins. Includes 10 expert skills covering hooks, MCP integration, LSP servers, commands, agents, marketplaces, and best practices, plus a guide skill for navigation. AI-assisted plugin creation and validation.",
15-
"version": "0.3.4",
15+
"version": "0.4.0",
1616
"author": {
1717
"name": "Steve Nims",
1818
"url": "https://github.com/sjnims"

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.4.0] - 2026-02-09
11+
12+
### Added
13+
14+
- **Output styles reference** - New `references/output-styles.md` in plugin-structure skill covering frontmatter schema, file locations, plugin bundling, and when to use styles vs other components
15+
- **Permission modes & rules reference** - New `references/permission-modes-rules.md` in agent-development skill covering all 6 permission modes (including `default` and `delegate`), permission rule syntax, MCP/Task patterns, and precedence rules
16+
17+
### Documentation
18+
19+
- **Close 11 documentation gaps vs official Claude Code docs** - Comprehensive audit against official Claude Code documentation identified missing topics relevant to plugin developers:
20+
- **Output styles** (GAP 1): Full output styles guidance with frontmatter reference, plugin bundling, comparison with other components
21+
- **Permission modes** (GAP 4): Added `default` and `delegate` modes, full permission rule syntax with tool specifiers and wildcards
22+
- **Agent teams** (GAP 2): Expanded team section with team lead/teammate design guidance, team hooks, plan approval mode, display modes
23+
- **Context management** (GAP 6): Auto-compaction impact on plugins, PreCompact hook, cross-plugin description budget
24+
- **Memory system** (GAP 5): Auto-memory (MEMORY.md topic files), plugin interaction guidelines, @path import note
25+
- **Hook debugging** (GAP 11): Added `--verbose` flag for hook debugging
26+
- **MCP features** (GAPs 9, 13): Plugin-provided MCP prompts, Claude Desktop import, dynamic tool registration via `list_changed`
27+
- **Enterprise settings** (GAP 7): `allowManagedPermissionRulesOnly` and `allowManagedHooksOnly` managed settings
28+
- **Skill string substitutions** (GAP 8): `$ARGUMENTS[N]` positional argument syntax
29+
- **Plugin validation** (GAP 10): `--verbose` flag for plugin loading diagnostics
30+
- **Updated trigger phrases** across plugin-structure, agent-development, skill-development, and mcp-integration skills for improved discoverability
31+
- **Expanded manifest reference** with `outputStyles` field documentation
32+
1033
## [0.3.4] - 2026-01-30
1134

1235
### Documentation

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Guidance for Claude Code working in this repository.
66

77
Plugin marketplace containing the **plugin-dev** plugin - a toolkit for developing Claude Code plugins. Provides 10 skills, 3 agents, 4 slash commands.
88

9-
**Version**: v0.3.4 | [CHANGELOG.md](CHANGELOG.md)
9+
**Version**: v0.4.0 | [CHANGELOG.md](CHANGELOG.md)
1010

1111
## MCP Tool Requirements (CRITICAL)
1212

plugins/plugin-dev/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plugin-dev",
3-
"version": "0.3.4",
3+
"version": "0.4.0",
44
"description": "Comprehensive toolkit for developing Claude Code plugins. Includes 10 expert skills covering hooks, MCP integration, LSP servers, commands, agents, marketplaces, and best practices, plus a guide skill for navigation. AI-assisted plugin creation and validation.",
55
"author": {
66
"name": "Steve Nims",

plugins/plugin-dev/skills/agent-development/SKILL.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
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", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
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.
44
---
55

66
# Agent Development for Claude Code Plugins
@@ -301,14 +301,18 @@ permissionMode: acceptEdits
301301

302302
**Values:**
303303

304-
- `acceptEdits` - Auto-accept file edit operations (Write, Edit)
304+
- `default` - Standard permission model, prompts user for each action (implicit when omitted)
305+
- `acceptEdits` - Auto-accept file edit operations (Write, Edit, NotebookEdit)
305306
- `dontAsk` - Skip permission dialogs for all operations
306307
- `bypassPermissions` - Full bypass (requires trust)
307308
- `plan` - Planning mode, propose changes without executing
309+
- `delegate` - Coordination-only, restricted to team management tools (spawn, message, manage tasks)
308310

309-
**Default:** Standard permission model (asks user)
311+
**Default:** `default` (standard permission model, asks user)
310312

311-
**Security note:** Use restrictive modes (`plan`, `acceptEdits`) for untrusted agents. `bypassPermissions` should only be used for fully trusted agents.
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`.
312316

313317
### maxTurns (optional)
314318

@@ -612,6 +616,7 @@ This is an advanced feature — see the [official agent teams documentation](htt
612616
For detailed guidance, consult:
613617

614618
- **`references/advanced-agent-fields.md`** - Detailed docs for maxTurns, memory, mcpServers, hooks, execution modes, and agent teams
619+
- **`references/permission-modes-rules.md`** - Complete permission mode details and permission rule syntax for fine-grained access control
615620
- **`references/system-prompt-design.md`** - Four system prompt patterns (Analysis, Generation, Validation, Orchestration) with complete templates and common pitfalls
616621
- **`references/triggering-examples.md`** - Example block anatomy, four example types, template library, and debugging guide
617622
- **`references/agent-creation-system-prompt.md`** - The exact prompt used by Claude Code's agent generation feature with usage patterns

plugins/plugin-dev/skills/agent-development/references/advanced-agent-fields.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,53 @@ Agent teams enable multi-agent coordination where a team lead spawns and manages
176176
- **Shared task list**: Coordinated work items that teammates claim and complete
177177
- **Messaging**: Direct messages and broadcasts between team members
178178

179-
### Delegate Mode
179+
### Designing Team Lead Agents
180180

181-
Use `permissionMode: delegate` to restrict a team lead to coordination-only tools (spawn, message, shut down teammates, manage tasks). This prevents the lead from implementing tasks itself.
181+
Team leads coordinate work across multiple teammates. Key design considerations:
182182

183-
### Quality Gates
183+
- **Use `permissionMode: delegate`** to restrict the lead to coordination-only tools (spawn, message, shut down teammates, manage tasks). This prevents the lead from implementing tasks directly.
184+
- **System prompt focus**: Task decomposition, work assignment, progress monitoring, quality review
185+
- **Tools**: Team leads automatically get access to `TeamCreate`, `TaskCreate`, `TaskUpdate`, `TaskList`, `SendMessage`, and `Task` (for spawning)
184186

185-
Use `TeammateIdle` and `TaskCompleted` hooks to enforce quality standards in team workflows.
187+
```yaml
188+
# Example team lead agent
189+
permissionMode: delegate
190+
```
191+
192+
### Designing Teammate Agents
193+
194+
Teammates are spawned by the team lead and work independently on assigned tasks:
195+
196+
- **Self-contained context**: Each teammate has its own context window; don't assume shared state
197+
- **Task-focused prompts**: System prompt should focus on a specific type of work (e.g., "you are a test writer")
198+
- **Tool restrictions**: Use `tools` to limit what each teammate can do based on their role
199+
- **Plan mode for review**: Use `permissionMode: plan` for teammates that should propose changes for lead approval
200+
201+
### Display Modes
202+
203+
Agent teams display in the terminal using split panes when available, with each teammate getting its own output area. In environments without split pane support, teammates run in-process with interleaved output.
204+
205+
### Team Hooks
206+
207+
Use hook events to enforce quality standards in team workflows:
208+
209+
| Event | Fires When | Use Case |
210+
| --------------- | ---------------------------- | --------------------------------------------- |
211+
| `TeammateIdle` | A teammate finishes its turn | Trigger code review, run tests on changes |
212+
| `TaskCompleted` | A task is marked complete | Validate deliverables, update documentation |
213+
| `SubagentStart` | A teammate spawns | Log team activity, enforce naming conventions |
214+
| `SubagentStop` | A teammate finishes | Clean up resources, collect metrics |
215+
216+
### Plan Approval Mode
217+
218+
Teammates can be configured to require plan approval from the team lead before implementing:
219+
220+
1. Teammate uses `permissionMode: plan`
221+
2. Teammate explores codebase and creates a plan
222+
3. Teammate calls `ExitPlanMode`, which sends plan to team lead
223+
4. Team lead reviews and approves/rejects via `SendMessage` with `plan_approval_response`
224+
5. On approval, teammate exits plan mode and proceeds with implementation
225+
226+
This pattern is useful for complex tasks where the lead wants to review approach before execution.
186227

187228
For complete documentation, see the [official agent teams guide](https://code.claude.com/docs/en/agent-teams).
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Permission Modes & Rules Reference
2+
3+
This reference covers the complete permission system for Claude Code agents, including all permission modes and the permission rule syntax for fine-grained access control.
4+
5+
## Permission Modes
6+
7+
Agents can specify a `permissionMode` in frontmatter to control how permission requests are handled:
8+
9+
```yaml
10+
permissionMode: acceptEdits
11+
```
12+
13+
### All Permission Modes
14+
15+
| Mode | Behavior | Use Case |
16+
| ------------------- | ------------------------------------------------------------ | --------------------------------------------------- |
17+
| `default` | Standard permission model — prompts user for each action | General-purpose agents, untrusted contexts |
18+
| `acceptEdits` | Auto-accept file edit operations (Write, Edit, NotebookEdit) | Code generation agents that need to write files |
19+
| `dontAsk` | Skip all permission dialogs | Trusted automation agents, CI/CD agents |
20+
| `bypassPermissions` | Full bypass of all permission checks | Fully trusted agents only |
21+
| `plan` | Planning mode — propose changes without executing | Architecture/design agents, review agents |
22+
| `delegate` | Coordination-only — restricted to team management tools | Team lead agents that should not implement directly |
23+
24+
### Mode Details
25+
26+
#### default
27+
28+
The standard interactive permission model. Claude asks the user before performing actions that require permission. This is the implicit mode when `permissionMode` is not specified.
29+
30+
**When to use:** General-purpose agents, agents handling sensitive operations, agents in untrusted contexts.
31+
32+
#### acceptEdits
33+
34+
Auto-accepts file writing operations (Write, Edit, NotebookEdit) without prompting. Other operations (Bash, etc.) still require user permission.
35+
36+
**When to use:** Code generation agents, refactoring agents, documentation generators.
37+
38+
#### dontAsk
39+
40+
Skips all permission dialogs. The agent proceeds without user confirmation for any action.
41+
42+
**When to use:** Trusted automation, background agents, CI/CD pipelines where no user is present.
43+
44+
#### bypassPermissions
45+
46+
Full permission bypass with no restrictions. More permissive than `dontAsk` as it bypasses even system-level restrictions.
47+
48+
**When to use:** Only for fully trusted agents in controlled environments. Never for plugins distributed to unknown users.
49+
50+
#### plan
51+
52+
Planning mode restricts the agent to read-only operations. The agent can explore the codebase and propose changes but cannot execute them. Requires user approval before any modifications.
53+
54+
**When to use:** Architecture planning, design review, impact analysis agents.
55+
56+
#### delegate
57+
58+
Restricts the agent to team coordination tools only: spawning teammates, sending messages, managing tasks, and shutting down teammates. The agent cannot use implementation tools (Edit, Write, Bash, etc.) directly.
59+
60+
**When to use:** Team lead agents that should coordinate work across teammates without implementing tasks themselves.
61+
62+
```yaml
63+
# Team lead agent that only coordinates
64+
permissionMode: delegate
65+
```
66+
67+
## Permission Rules
68+
69+
Permission rules provide fine-grained control over specific tool access. They are configured in settings files (not agent frontmatter) and apply based on precedence.
70+
71+
### Rule Syntax
72+
73+
Rules are specified in `settings.json` under `permissions`:
74+
75+
```json
76+
{
77+
"permissions": {
78+
"allow": ["Read", "Bash(npm test)", "Edit(src/**)"],
79+
"deny": ["Bash(rm *)", "Bash(git push --force*)"]
80+
}
81+
}
82+
```
83+
84+
### Tool Specifiers
85+
86+
| Pattern | Matches | Example |
87+
| -------------------- | ------------------------------- | ------------------------------------ |
88+
| `ToolName` | Any use of that tool | `Read` — all file reads |
89+
| `ToolName(argument)` | Tool with specific argument | `Bash(npm test)` — only this command |
90+
| `ToolName(pattern*)` | Tool with wildcard argument | `Bash(npm *)` — any npm command |
91+
| `Edit(path)` | Edit with gitignore-style path | `Edit(src/**)` — edits in src/ |
92+
| `Write(path)` | Write with gitignore-style path | `Write(tests/**)` — writes in tests/ |
93+
94+
### MCP Tool Patterns
95+
96+
```json
97+
{
98+
"permissions": {
99+
"allow": ["mcp__servername__toolname", "mcp__servername__*"]
100+
}
101+
}
102+
```
103+
104+
- `mcp__server__tool` — specific MCP tool
105+
- `mcp__server__*` — all tools from a server
106+
- `mcp__*` — all MCP tools (use sparingly)
107+
108+
### Task (Agent) Patterns
109+
110+
Control which agent types can be spawned:
111+
112+
```json
113+
{
114+
"permissions": {
115+
"allow": ["Task(code-reviewer, test-runner)"]
116+
}
117+
}
118+
```
119+
120+
- `Task(type1, type2)` — only listed agent types
121+
- `Task` — allow any subagent
122+
- Omitting `Task` — no subagent spawning
123+
124+
### Rule Precedence
125+
126+
When multiple rules match:
127+
128+
1. **deny** rules always take precedence over **allow** rules
129+
2. More specific rules take precedence over general ones
130+
3. Explicit rules override `permissionMode` settings
131+
132+
### Plugin Developer Guidance
133+
134+
**Document required permissions:** If your plugin's agents need specific tool access, document the minimum required permissions in your README:
135+
136+
```markdown
137+
## Required Permissions
138+
139+
This plugin's agents need:
140+
141+
- `Edit(src/**)` — to modify source files
142+
- `Bash(npm test)` — to run tests
143+
- `mcp__plugin_myserver__*` — for MCP tool access
144+
```
145+
146+
**Configure agent permissions:** Use `permissionMode` in agent frontmatter for broad access control. For fine-grained restrictions, document the settings users should configure.
147+
148+
**Principle of least privilege:** Request only the permissions your agent actually needs. Use `acceptEdits` over `dontAsk` when only file writes are needed.

plugins/plugin-dev/skills/hook-development/SKILL.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,14 @@ claude --debug
733733

734734
Look for hook registration, execution logs, input/output JSON, and timing information.
735735

736+
For additional hook debugging output, use `--verbose`:
737+
738+
```bash
739+
claude --verbose
740+
```
741+
742+
This shows hook registration, event matching, and execution timing without the full debug output. Combine with `--debug` for maximum detail.
743+
736744
### Test Hook Scripts
737745

738746
Test command hooks directly:

plugins/plugin-dev/skills/mcp-integration/SKILL.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ MCP prompts appear alongside regular commands in the `/` menu. They accept argum
276276

277277
**Plugin design note:** If your MCP server exposes prompts, document their names and expected arguments in your plugin README so users can discover them.
278278

279+
**Plugin-provided MCP prompts:** If your plugin bundles an MCP server, that server can expose prompts that automatically become slash commands for users. This provides guided workflows beyond simple tool calls — for example, a `/mcp__myserver__setup-project` prompt that walks users through project configuration.
280+
279281
## Tool Search
280282

281283
For MCP servers with many tools, use Tool Search to find relevant tools:
@@ -519,9 +521,21 @@ claude mcp serve
519521

520522
This enables other MCP-compatible clients to use Claude Code's tools. Useful for building tool chains where Claude Code is one component.
521523

524+
### Importing from Claude Desktop
525+
526+
Users who already have MCP servers configured in Claude Desktop can import them:
527+
528+
```bash
529+
claude mcp add-from-claude-desktop
530+
```
531+
532+
This copies MCP server configurations from Claude Desktop into Claude Code. Plugin developers should note that users may already have servers configured this way — avoid name conflicts with commonly used server names.
533+
522534
## Dynamic Tool Updates
523535

524-
MCP servers can notify Claude Code of tool changes at runtime via the `list_changed` notification. When a server sends this notification, Claude Code re-discovers available tools without requiring a restart. This enables servers to dynamically add or remove capabilities.
536+
MCP servers can notify Claude Code when their available tools change at runtime using the `list_changed` notification. This enables servers that dynamically add or remove tools based on context (e.g., loading project-specific tools after initialization). Claude Code automatically re-discovers tools when `list_changed` fires, without requiring a restart.
537+
538+
**Plugin design note:** If your MCP server's available tools depend on runtime state, implement `list_changed` to ensure Claude Code always has an up-to-date tool list.
525539

526540
## MCP Output Limits
527541

plugins/plugin-dev/skills/plugin-settings/references/memory-rules-system.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,28 @@ The `/init` command generates a starter CLAUDE.md by analyzing the codebase. Alt
6666
- Use Jest with React Testing Library
6767
```
6868

69+
### Auto-Memory (MEMORY.md)
70+
71+
Claude Code can automatically persist learnings between sessions using memory files:
72+
73+
- **`MEMORY.md`**: Auto-generated file where Claude stores session-to-session learnings
74+
- **Topic files**: Claude may create topic-specific memory files (e.g., `MEMORY-debugging.md`) for organized knowledge
75+
76+
**Plugin interaction:**
77+
78+
- Plugins should not write to or modify the user's auto-memory files
79+
- Plugin agents with `memory` frontmatter use a separate, agent-specific memory directory (see agent-development skill)
80+
- If your plugin generates knowledge worth persisting, instruct users to save it to CLAUDE.md rather than relying on auto-memory
81+
82+
**Import syntax note:** The `@path` import syntax works in all CLAUDE.md files (project, user, local), not just the root one. This enables modular configuration:
83+
84+
```markdown
85+
# My CLAUDE.md
86+
87+
@docs/coding-standards.md
88+
@.claude/plugin-config.md
89+
```
90+
6991
## Rules System
7092

7193
### What Rules Are

0 commit comments

Comments
 (0)