Branch skill for building and improving plugins. Use when creating new plugins, validating plugin structure, adapting marketplace plugins, or improving existing plugins. Triggers: 'create plugin', 'improve plugin', 'validate plugin', 'fix plugin', 'plugin.json', 'adapt plugin', '4-plugin architecture', 'plugin structure', 'CLAUDE_PLUGIN_ROOT'.
Builds and validates Claude Code plugins using the 4-plugin architecture. Triggers on 'create plugin', 'improve plugin', 'validate plugin', 'fix plugin', 'plugin.json', or 'CLAUDE_PLUGIN_ROOT'.
/plugin marketplace add henmessi/plugin-dev/plugin install henmessi-plugin-dev@henmessi/plugin-devThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Build and improve plugins following the plugins-management policy.
Primary policy: JARVIS-02 → .claude/skills/plugins-management/SKILL.md
This branch executes the policy defined by JARVIS-02. Always sync with Primary before major operations.
Task Received
│
├── Create new plugin? ─────────────> Which type?
│ ├── Task routing ────────────────> Use shared Orchestrator
│ ├── Self-improvement ────────────> Use shared plugin-dev
│ ├── Data access ─────────────────> Create BigQuery-[cat] from template
│ └── Domain logic ────────────────> Create Category-[cat] custom
│
├── Adapt marketplace plugin? ───────> Workflow 3: Adapt
│
├── Fix existing plugin? ────────────> Workflow 2: Improve
│
└── Validate plugin? ────────────────> Validation Checklist
Claude Code plugins follow a standardized directory structure with automatic component discovery.
Key concepts:
.claude-plugin/plugin.json${CLAUDE_PLUGIN_ROOT}Every Claude Code plugin follows this organizational pattern:
plugin-name/
├── .claude-plugin/
│ └── plugin.json # Required: Plugin manifest
├── commands/ # Slash commands (.md files)
├── agents/ # Subagent definitions (.md files)
├── skills/ # Agent skills (subdirectories)
│ └── skill-name/
│ └── SKILL.md # Required for each skill
├── hooks/
│ ├── hooks.json # Event handler configuration
│ └── scripts/ # Hook scripts
├── .mcp.json # MCP server definitions
└── scripts/ # Helper scripts and utilities
Critical rules:
plugin.json MUST be in .claude-plugin/ directory.claude-plugin/Every JARVIS category has exactly 4 plugins:
| # | Plugin | Type | Source | Customization |
|---|---|---|---|---|
| 1 | Plugin-Orchestrator | Shared | github.com/henmessi/plugin-orchestrator | None - identical everywhere |
| 2 | plugin-dev | Shared | github.com/henmessi/plugin-dev | None - identical everywhere |
| 3 | Plugin-BigQuery-[Cat] | Template | Template from JARVIS-10 | Only table list changes |
| 4 | Plugin-Category-[Cat] | Custom | Created per category | Fully custom |
Located at .claude-plugin/plugin.json:
{
"name": "plugin-name"
}
Name requirements:
{
"name": "plugin-name",
"version": "1.0.0",
"description": "Brief explanation of plugin purpose",
"author": {
"name": "Author Name",
"email": "author@example.com"
},
"repository": "https://github.com/user/plugin-name",
"license": "MIT",
"keywords": ["jarvis", "category-name"]
}
Specify custom paths for components:
{
"name": "plugin-name",
"commands": "./custom-commands",
"agents": ["./agents", "./specialized-agents"],
"hooks": "./config/hooks.json",
"mcpServers": "./.mcp.json"
}
Path rules:
./Use ${CLAUDE_PLUGIN_ROOT} for all intra-plugin path references:
{
"command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/run.sh"
}
Where to use it:
Never use:
/Users/name/plugins/...)./scripts/... in commands)~/plugins/...)In hook scripts:
#!/bin/bash
# ${CLAUDE_PLUGIN_ROOT} available as environment variable
source "${CLAUDE_PLUGIN_ROOT}/lib/common.sh"
Location: commands/ directory
Format: Markdown files with YAML frontmatter
Auto-discovery: All .md files in commands/ load automatically
commands/
├── review.md # /review command
├── test.md # /test command
└── deploy.md # /deploy command
Location: agents/ directory
Format: Markdown files with YAML frontmatter
Auto-discovery: All .md files in agents/ load automatically
agents/
├── code-reviewer.md
├── test-generator.md
└── refactorer.md
Location: skills/ directory with subdirectories per skill
Format: Each skill in own directory with SKILL.md file
Auto-discovery: All SKILL.md files in skill subdirectories load automatically
skills/
├── api-testing/
│ ├── SKILL.md
│ └── references/
└── database-migrations/
├── SKILL.md
└── examples/
Location: hooks/hooks.json or inline in plugin.json
Format: JSON configuration defining event handlers
hooks/
├── hooks.json # Hook configuration
└── scripts/
└── validate.sh # Hook script
Configuration format:
{
"hooks": {
"PreToolUse": [{
"matcher": "Write|Edit",
"hooks": [{
"type": "command",
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/validate.sh",
"timeout": 30
}]
}]
}
}
Location: .mcp.json at plugin root
Format: JSON configuration for MCP server definitions
{
"mcpServers": {
"server-name": {
"command": "node",
"args": ["${CLAUDE_PLUGIN_ROOT}/servers/server.js"],
"env": {
"API_KEY": "${API_KEY}"
}
}
}
}
Claude Code automatically discovers and loads components:
.claude-plugin/plugin.json when plugin enablescommands/ directory for .md filesagents/ directory for .md filesskills/ for subdirectories containing SKILL.mdhooks/hooks.json or manifest.mcp.json or manifestDiscovery timing:
Commands: Use kebab-case .md files
code-review.md → /code-reviewrun-tests.md → /run-testsAgents: Use kebab-case .md files
test-generator.mdcode-reviewer.mdSkills: Use kebab-case directory names
api-testing/database-migrations/Scripts: Use descriptive kebab-case names
validate-input.shgenerate-report.pyConfiguration: Use standard names
hooks.json.mcp.jsonplugin.jsonPlugins can store user-configurable settings in .claude/plugin-name.local.md:
---
enabled: true
setting1: value1
setting2: value2
---
# Additional Context
This markdown body can contain:
- Task descriptions
- Additional instructions
- Prompts to feed back to Claude
#!/bin/bash
STATE_FILE=".claude/my-plugin.local.md"
# Quick exit if file doesn't exist
if [[ ! -f "$STATE_FILE" ]]; then
exit 0 # Plugin not configured
fi
# Parse YAML frontmatter
FRONTMATTER=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$STATE_FILE")
# Extract field
ENABLED=$(echo "$FRONTMATTER" | grep '^enabled:' | sed 's/enabled: *//')
if [[ "$ENABLED" != "true" ]]; then
exit 0 # Disabled
fi
.claude/plugin-name.local.md format.claude/*.local.md to .gitignoreDo NOT create new ones. Copy from source repository:
# Copy shared plugin
cp -r /path/to/shared/plugin-orchestrator ./plugins/orchestrator
cp -r /path/to/shared/plugin-dev ./plugins/dev
mkdir -p plugins/bigquery-[category]/.claude-plugin
mkdir -p plugins/bigquery-[category]/{agents,skills/bigquery-[category]}
{
"name": "plugin-bigquery-[category]",
"version": "1.0.0",
"description": "BigQuery data access for JARVIS-XX [Category]"
}
---
name: bigquery-[category]
description: "This skill provides BigQuery access for [Category]. Use when querying data, writing analytics, or accessing tables. Triggers: 'query', 'write data', 'analytics', 'BigQuery'."
---
# BigQuery - [Category]
## Allowed Tables (HARDCODED)
| Table | Access | Purpose |
|-------|--------|---------|
| jarvis_XX_table1 | READ/WRITE | [Purpose] |
| jarvis_XX_table2 | READ | [Purpose] |
## Query Patterns
[Standard patterns for this category]
mkdir -p plugins/category-[name]/.claude-plugin
mkdir -p plugins/category-[name]/{agents,skills/[domain],commands,hooks/scripts}
{
"name": "plugin-category-[name]",
"version": "1.0.0",
"description": "Domain-specific plugin for [Category] operations"
}
# Plugin audit
cat plugins/[name]/.claude-plugin/plugin.json
ls -la plugins/[name]/agents/
ls -la plugins/[name]/skills/
ls -la plugins/[name]/commands/
ls -la plugins/[name]/hooks/
| Component | Check | Common Issues |
|---|---|---|
| plugin.json | Valid? Complete? | Missing name, no description |
| Structure | .claude-plugin/ exists? | Manifest in wrong location |
| Paths | Uses ${CLAUDE_PLUGIN_ROOT}? | Hardcoded paths |
| agents/ | Valid frontmatter? | Missing examples in description |
| skills/ | SKILL.md in subdirs? | No references/, too long |
| commands/ | Valid frontmatter? | Written as message, not instructions |
| hooks/ | hooks.json valid? | Missing timeout, wrong exit codes |
Use the appropriate manager skill:
Run full validation checklist.
When taking a plugin from wshobson-agents, obra-superpowers, or other sources:
ls -la source-plugin/
cat source-plugin/.claude-plugin/plugin.json
ls source-plugin/agents/
ls source-plugin/skills/
| Source Has | JARVIS Target |
|---|---|
| Generic orchestration agents | Merge into Plugin-Orchestrator |
| Self-improvement skills | Merge into plugin-dev |
| Data/analytics focus | Merge into Plugin-BigQuery-[Cat] |
| Domain-specific content | Merge into Plugin-Category-[Cat] |
For each component:
{
"name": "plugin-category-[name]",
"version": "1.0.0",
"description": "Adapted from [source] - [purpose] for JARVIS-XX",
"source": "[original repository]"
}
Run full validation checklist.
.claude-plugin/plugin.json exists (not at root)name field${CLAUDE_PLUGIN_ROOT} for portabilityagents/ with .md extension<example> blocksskills/commands/ with .md extensionhooks/hooks.json is valid JSON{"hooks": {...}} wrapper formathooks/scripts/ are executable${CLAUDE_PLUGIN_ROOT} for script pathsplugin-name/
├── .claude-plugin/
│ └── plugin.json <- {"name": "plugin-name"}
└── skills/
└── [skill]/
└── SKILL.md
plugin-name/
├── .claude-plugin/
│ └── plugin.json
├── agents/
│ └── agent.md
├── skills/
│ └── domain/
│ ├── SKILL.md
│ └── references/
├── commands/
│ └── command.md
├── hooks/
│ ├── hooks.json
│ └── scripts/
│ └── validate.sh
├── .mcp.json
└── scripts/
└── utility.sh
| Issue | Diagnosis | Fix |
|---|---|---|
| No plugin.json | Missing manifest | Create in .claude-plugin/ |
| Wrong manifest location | plugin.json at root | Move to .claude-plugin/ |
| Invalid name | Spaces or uppercase | Use kebab-case |
| Hardcoded paths | /home/user/... in scripts | Use ${CLAUDE_PLUGIN_ROOT} |
| Components not found | In .claude-plugin/ | Move to plugin root |
| Wrong plugin type | Generic content in Category plugin | Move to correct plugin |
Component not loading:
SKILL.md (not README.md)Path resolution errors:
${CLAUDE_PLUGIN_ROOT}./ in manifestecho $CLAUDE_PLUGIN_ROOT in hook scriptsAuto-discovery not working:
Before executing any workflow:
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", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
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, 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.