Skip to content

Commit 52fbbfe

Browse files
sjnimsclaude
andauthored
feat: sync documentation with official Claude Code docs (#192)
## Description Comprehensive update to align plugin-dev documentation with official Claude Code documentation. This PR addresses gaps identified by comparing the official docs against plugin-dev's teaching content, adds missing features, corrects outdated information, and introduces a new LSP integration skill. ## Type of Change - [x] New feature (non-breaking change that adds functionality) - [x] Documentation update (improvements to README, CLAUDE.md, or component docs) ## Component(s) Affected - [x] Commands (`/plugin-dev:*`) - [x] Skills (methodology and best practices) - [x] Agents (plugin-validator, skill-reviewer, agent-creator) - [x] Marketplace (marketplace.json, distribution) - [x] Documentation (README.md, CLAUDE.md, SECURITY.md) - [x] Configuration (.markdownlint.json, plugin.json) ## Motivation and Context The plugin-dev plugin teaches users how to develop Claude Code plugins, but some of its documentation had become outdated compared to the official Claude Code documentation. This PR: 1. Adds 3 missing hook events (Setup, PostToolUseFailure, SubagentStart) 2. Documents new skill frontmatter fields (context, agent, skills) 3. Documents new agent frontmatter fields (skills, permissionMode) 4. Adds MCP resource syntax and Tool Search documentation 5. Creates new LSP integration skill for language server configuration 6. Updates agents and commands to use the new skill ## How Has This Been Tested? **Test Configuration**: - Claude Code version: Latest - GitHub CLI version: 2.x - OS: macOS Darwin 25.2.0 **Test Steps**: 1. Loaded plugin with `claude --plugin-dir plugins/plugin-dev` 2. Verified all skills load and trigger correctly 3. Confirmed new LSP integration skill appears in skill list 4. Tested skill-reviewer agent recognizes new frontmatter fields ## Checklist ### General - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas (if applicable) - [x] My changes generate no new warnings or errors ### Documentation - [x] I have updated the documentation accordingly (README.md, CLAUDE.md, or component docs) - [x] I have updated YAML frontmatter (if applicable) - [x] I have verified all links work correctly ### Markdown - [x] My markdown follows the repository style (ATX headers, dash lists, fenced code blocks) - [x] I have verified special HTML elements are properly closed (`<p>`, `<img>`, `<example>`, `<commentary>`) ### Version Management (if applicable) - [x] I have updated `plugins/plugin-dev/.claude-plugin/plugin.json` (source of truth) - [x] I have updated `.claude-plugin/marketplace.json` (metadata.version AND plugins[0].version) - [x] I have updated `CLAUDE.md` (version line) - [ ] I have updated CHANGELOG.md with relevant changes ## Summary of Changes ### Skills Updated | Skill | Changes | |-------|---------| | hook-development | Added Setup, PostToolUseFailure, SubagentStart events; updated event count to 12 | | skill-development | Added context/agent/skills frontmatter; dynamic context injection; string substitutions | | agent-development | Added skills/permissionMode frontmatter; --agents CLI flag docs | | mcp-integration | Added @resource syntax; Tool Search; managed MCP controls | | plugin-structure | Added lspServers/outputStyles components; caching explanation | ### New Skill | Skill | Description | |-------|-------------| | lsp-integration | New skill for LSP server configuration, extensionToLanguage mappings, pre-built plugins | ### Agents Updated | Agent | Changes | |-------|---------| | plugin-validator | Added LSP validation section; expanded skills list | | skill-reviewer | Updated optional fields for new frontmatter | | agent-creator | Added skills/permissionMode to configuration section | ### Commands Updated | Command | Changes | |---------|---------| | create-plugin | Added LSP to component planning and Phase 5 | ### Version Bump - 0.2.1 → 0.3.0 (now 9 skills, was 8) ## Reviewer Notes **Areas that need special attention**: - New LSP integration skill content accuracy - Hook events list completeness (now 12 events vs 10 before) - New frontmatter fields documentation **Known limitations or trade-offs**: - CHANGELOG.md not yet updated (can be done before merge) - Some LSP server recommendations may become outdated as ecosystem evolves --- 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f62d1fd commit 52fbbfe

File tree

14 files changed

+1130
-42
lines changed

14 files changed

+1130
-42
lines changed

.claude-plugin/marketplace.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
},
77
"metadata": {
88
"description": "Unofficial plugin-dev plugin marketplace for plugin-dev Claude Code plugin - the plugin itself was initially created by Daisy Hollman at Anthropic.",
9-
"version": "0.2.1"
9+
"version": "0.3.0"
1010
},
1111
"plugins": [
1212
{
1313
"name": "plugin-dev",
14-
"description": "Comprehensive toolkit for developing Claude Code plugins. Includes 8 expert skills covering hooks, MCP integration, commands, agents, marketplaces, and best practices. AI-assisted plugin creation and validation.",
15-
"version": "0.2.1",
14+
"description": "Comprehensive toolkit for developing Claude Code plugins. Includes 9 expert skills covering hooks, MCP integration, LSP servers, commands, agents, marketplaces, and best practices. AI-assisted plugin creation and validation.",
15+
"version": "0.3.0",
1616
"author": {
1717
"name": "Daisy Hollman",
1818
"url": "https://github.com/anthropics/claude-code/",

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Guidance for Claude Code working in this repository.
44

55
## What This Is
66

7-
Plugin marketplace containing the **plugin-dev** plugin - a toolkit for developing Claude Code plugins. Provides 8 skills, 3 agents, 3 slash commands.
7+
Plugin marketplace containing the **plugin-dev** plugin - a toolkit for developing Claude Code plugins. Provides 9 skills, 3 agents, 3 slash commands.
88

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

1111
## MCP Tool Requirements (CRITICAL)
1212

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "plugin-dev",
3-
"version": "0.2.1",
4-
"description": "Comprehensive toolkit for developing Claude Code plugins. Includes 8 expert skills covering hooks, MCP integration, commands, agents, marketplaces, and best practices. AI-assisted plugin creation and validation.",
3+
"version": "0.3.0",
4+
"description": "Comprehensive toolkit for developing Claude Code plugins. Includes 9 expert skills covering hooks, MCP integration, LSP servers, commands, agents, marketplaces, and best practices. AI-assisted plugin creation and validation.",
55
"author": {
66
"name": "Daisy Hollman",
77
"email": "daisy@anthropic.com"

plugins/plugin-dev/agents/agent-creator.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ When a user describes what they want an agent to do, you will:
118118
- red: Security, critical
119119
- magenta: Transformation, creative
120120
- **Tools**: Recommend minimal set needed, or omit for full access
121+
- **Skills**: Include relevant skills if agent needs domain expertise
122+
- **Permission Mode**: Set if agent needs special permissions (acceptEdits, dontAsk, plan)
121123
122124
4. **Generate Agent File**: Use Write tool to create `agents/[identifier].md`:
123125
@@ -128,6 +130,9 @@ When a user describes what they want an agent to do, you will:
128130
model: inherit
129131
color: [chosen-color]
130132
tools: Tool1, Tool2 # Optional
133+
skills: # Optional - load domain skills
134+
- skill-name
135+
permissionMode: acceptEdits # Optional - for auto-accepting edits
131136
---
132137
133138
[Complete system prompt]

plugins/plugin-dev/agents/plugin-validator.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Marketplace created, validate schema and plugin entries.
4141
model: inherit
4242
color: yellow
4343
tools: Read, Grep, Glob, Bash
44-
skills: plugin-structure, hook-development, command-development, skill-development, agent-development
44+
skills: plugin-structure, hook-development, command-development, skill-development, agent-development, lsp-integration, mcp-integration
4545
---
4646

4747
You are an expert plugin and marketplace validator specializing in comprehensive validation of Claude Code plugin structure, configuration, components, and plugin marketplaces.
@@ -139,17 +139,28 @@ First, determine what type of validation is needed:
139139
- Type-specific fields present
140140
- Check ${CLAUDE_PLUGIN_ROOT} usage for portability
141141

142-
9. **Check File Organization**:
143-
- README.md exists and is comprehensive
144-
- No unnecessary files (node_modules, .DS_Store, etc.)
145-
- .gitignore present if needed
146-
- LICENSE file present
147-
148-
10. **Security Checks**:
149-
- No hardcoded credentials in any files
150-
- MCP servers use HTTPS/WSS not HTTP/WS
151-
- Hooks don't have obvious security issues
152-
- No secrets in example files
142+
9. **Validate LSP Configuration** (if `lspServers` in manifest):
143+
- Check each LSP server configuration:
144+
- `command` field is present
145+
- `extensionToLanguage` mapping is present
146+
- Extension keys start with `.`
147+
- Language IDs are valid strings
148+
- Verify ${CLAUDE_PLUGIN_ROOT} usage for bundled servers
149+
- Check that referenced server commands exist (if local)
150+
151+
10. **Check File Organization**:
152+
153+
- README.md exists and is comprehensive
154+
- No unnecessary files (node_modules, .DS_Store, etc.)
155+
- .gitignore present if needed
156+
- LICENSE file present
157+
158+
11. **Security Checks**:
159+
160+
- No hardcoded credentials in any files
161+
- MCP servers use HTTPS/WSS not HTTP/WS
162+
- Hooks don't have obvious security issues
163+
- No secrets in example files
153164

154165
**Marketplace Validation Process:**
155166

plugins/plugin-dev/agents/skill-reviewer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ You are an expert skill architect specializing in reviewing and improving Claude
6464
2. **Validate Structure**:
6565
- Frontmatter format (YAML between `---`)
6666
- Required fields: `name`, `description`
67-
- Optional fields: `version` (others may exist per Claude Code updates)
67+
- Optional fields: `allowed-tools`, `context`, `agent`, `skills`, `user-invocable`, `disable-model-invocation`
6868
- Body content exists and is substantial
6969

7070
3. **Evaluate Description** (Most Critical):

plugins/plugin-dev/commands/create-plugin.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Guide the user through creating a complete, high-quality Claude Code plugin from
6060
- **Agents**: Autonomous tasks? (validation, generation, analysis)
6161
- **Hooks**: Event-driven automation? (validation, notifications)
6262
- **MCP**: External service integration? (databases, APIs)
63+
- **LSP**: Code intelligence? (go-to-definition, find references)
6364
- **Settings**: User configuration? (.local.md files)
6465
3. For each component type needed, identify:
6566
- How many of each type
@@ -177,6 +178,7 @@ git commit -m "feat: initial plugin structure"
177178
- Agents: Load agent-development skill
178179
- Hooks: Load hook-development skill
179180
- MCP: Load mcp-integration skill
181+
- LSP: Load lsp-integration skill
180182
- Settings: Load plugin-settings skill
181183

182184
**Actions for each component**:
@@ -239,6 +241,17 @@ git commit -m "feat: initial plugin structure"
239241
3. Document required env vars in README
240242
4. Provide setup instructions
241243

244+
### For LSP
245+
246+
1. Load lsp-integration skill using Skill tool
247+
2. Add lspServers configuration to plugin.json:
248+
- Server command and args
249+
- extensionToLanguage mapping
250+
- Environment variables if needed
251+
3. Bundle LSP server binary if self-contained
252+
4. Or document external server installation in README
253+
5. Test with language files matching configured extensions
254+
242255
### For Settings
243256

244257
1. Load plugin-settings skill using Skill tool
@@ -427,7 +440,7 @@ git commit -m "feat: initial plugin structure"
427440
### Skills to Load by Phase
428441
429442
- **Phase 2**: plugin-structure
430-
- **Phase 5**: skill-development, command-development, agent-development, hook-development, mcp-integration, plugin-settings (as needed)
443+
- **Phase 5**: skill-development, command-development, agent-development, hook-development, mcp-integration, lsp-integration, plugin-settings (as needed)
431444
- **Phase 6**: (agents will use skills automatically)
432445
- **Phase 8**: marketplace-structure (if publishing to marketplace)
433446

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

Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,44 @@ tools: Read, Write, Grep, Bash
255255

256256
> **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.
257257

258+
### skills (optional)
259+
260+
Load specific skills into the agent's context:
261+
262+
```yaml
263+
skills:
264+
- testing-patterns
265+
- security-audit
266+
- api-design
267+
```
268+
269+
**Use cases:**
270+
271+
- Give agent domain expertise via skills
272+
- Combine multiple skills for comprehensive workflows
273+
- Share knowledge between agents and skills
274+
275+
Skills must be from the same plugin. The skill's SKILL.md content loads into the agent's context.
276+
277+
### permissionMode (optional)
278+
279+
Control how the agent handles permission requests:
280+
281+
```yaml
282+
permissionMode: acceptEdits
283+
```
284+
285+
**Values:**
286+
287+
- `acceptEdits` - Auto-accept file edit operations (Write, Edit)
288+
- `dontAsk` - Skip permission dialogs for all operations
289+
- `bypassPermissions` - Full bypass (requires trust)
290+
- `plan` - Planning mode, propose changes without executing
291+
292+
**Default:** Standard permission model (asks user)
293+
294+
**Security note:** Use restrictive modes (`plan`, `acceptEdits`) for untrusted agents. `bypassPermissions` should only be used for fully trusted agents.
295+
258296
## System Prompt Design
259297

260298
The markdown body becomes the agent's system prompt. Write in second person, addressing the agent directly.
@@ -421,6 +459,24 @@ Create test scenarios to verify agent triggers correctly:
421459
3. Check Claude loads the agent
422460
4. Verify agent provides expected functionality
423461
462+
### Load Agents at Session Start
463+
464+
Use the `--agents` CLI flag to pre-load specific agents:
465+
466+
```bash
467+
# Load single agent
468+
claude --agents code-reviewer
469+
470+
# Load multiple agents
471+
claude --agents "code-reviewer,test-generator"
472+
```
473+
474+
**Use cases:**
475+
476+
- Testing agent behavior without triggering
477+
- Workflows requiring specific agents
478+
- Debugging agent system prompts
479+
424480
### Test System Prompt
425481

426482
Ensure system prompt is complete:
@@ -455,13 +511,15 @@ Output: [What to provide]
455511

456512
### Frontmatter Fields Summary
457513

458-
| Field | Required | Format | Example |
459-
| ----------- | -------- | -------------------------- | ------------------------ |
460-
| name | Yes | lowercase-hyphens | code-reviewer |
461-
| description | Yes | Text + examples | Use when... <example>... |
462-
| model | Yes | inherit/sonnet/opus/haiku | inherit |
463-
| color | Yes | Color name | blue |
464-
| tools | No | Comma-separated tool names | Read, Grep |
514+
| Field | Required | Format | Example |
515+
| -------------- | -------- | -------------------------- | ------------------------ |
516+
| name | Yes | lowercase-hyphens | code-reviewer |
517+
| description | Yes | Text + examples | Use when... <example>... |
518+
| model | Yes | inherit/sonnet/opus/haiku | inherit |
519+
| color | Yes | Color name | blue |
520+
| tools | No | Comma-separated tool names | Read, Grep |
521+
| skills | No | Array of skill names | [testing, security] |
522+
| permissionMode | No | Permission mode string | acceptEdits |
465523

466524
> **Note:** Agents use `tools` to restrict tool access. Skills use `allowed-tools` for the same purpose. The field names differ between component types.
467525

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

Lines changed: 87 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: hook-development
3-
description: This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PermissionRequest, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.
3+
description: This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, Stop, SubagentStop, SubagentStart, Setup, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.
44
---
55

66
# Hook Development for Claude Code Plugins
@@ -235,6 +235,33 @@ Execute after tool completes. Use to react to results, provide feedback, or log.
235235
- Exit 2: stderr fed back to Claude
236236
- systemMessage included in context
237237

238+
### PostToolUseFailure
239+
240+
Execute when a tool fails after PostToolUse hooks have run. Use to handle errors or provide fallback actions.
241+
242+
**Example:**
243+
244+
```json
245+
{
246+
"PostToolUseFailure": [
247+
{
248+
"matcher": "Edit",
249+
"hooks": [
250+
{
251+
"type": "prompt",
252+
"prompt": "Error occurred during edit. Provide fallback action or ask for user input."
253+
}
254+
]
255+
}
256+
]
257+
}
258+
```
259+
260+
**Output behavior:**
261+
262+
- Exit 2: stderr fed back to Claude
263+
- systemMessage included in context
264+
238265
### Stop
239266

240267
Execute when main agent considers stopping. Use to validate completeness.
@@ -273,6 +300,50 @@ Execute when subagent considers stopping. Use to ensure subagent completed its t
273300

274301
Similar to Stop hook, but for subagents.
275302

303+
### SubagentStart
304+
305+
Execute when a subagent is started. Use to initialize subagent state or perform setup.
306+
307+
**Example:**
308+
309+
```json
310+
{
311+
"SubagentStart": [
312+
{
313+
"matcher": "mcp__subagent_name",
314+
"hooks": [
315+
{
316+
"type": "command",
317+
"command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/subagent-init.sh"
318+
}
319+
]
320+
}
321+
]
322+
}
323+
```
324+
325+
### Setup
326+
327+
Execute once at session start to perform global setup or initialize resources.
328+
329+
**Example:**
330+
331+
```json
332+
{
333+
"Setup": [
334+
{
335+
"matcher": "*",
336+
"hooks": [
337+
{
338+
"type": "command",
339+
"command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/session-setup.sh"
340+
}
341+
]
342+
}
343+
]
344+
}
345+
```
346+
276347
### UserPromptSubmit
277348

278349
Execute when user submits a prompt. Use to add context, validate, or block prompts.
@@ -647,18 +718,21 @@ echo "$output" | jq .
647718

648719
### Hook Events Summary
649720

650-
| Event | When | Use For |
651-
| ----------------- | ----------------- | ------------------------ |
652-
| PreToolUse | Before tool | Validation, modification |
653-
| PermissionRequest | Permission dialog | Auto-allow/deny |
654-
| PostToolUse | After tool | Feedback, logging |
655-
| UserPromptSubmit | User input | Context, validation |
656-
| Stop | Agent stopping | Completeness check |
657-
| SubagentStop | Subagent done | Task validation |
658-
| SessionStart | Session begins | Context loading |
659-
| SessionEnd | Session ends | Cleanup, logging |
660-
| PreCompact | Before compact | Preserve context |
661-
| Notification | User notified | Logging, reactions |
721+
| Event | When | Use For |
722+
| ------------------ | ------------------ | ------------------------ |
723+
| Setup | Session init | Global initialization |
724+
| PreToolUse | Before tool | Validation, modification |
725+
| PermissionRequest | Permission dialog | Auto-allow/deny |
726+
| PostToolUse | After tool success | Feedback, logging |
727+
| PostToolUseFailure | After tool fails | Error handling |
728+
| UserPromptSubmit | User input | Context, validation |
729+
| Stop | Agent stopping | Completeness check |
730+
| SubagentStart | Subagent begins | Subagent setup |
731+
| SubagentStop | Subagent done | Task validation |
732+
| SessionStart | Session begins | Context loading |
733+
| SessionEnd | Session ends | Cleanup, logging |
734+
| PreCompact | Before compact | Preserve context |
735+
| Notification | User notified | Logging, reactions |
662736

663737
### Best Practices
664738

0 commit comments

Comments
 (0)