name: plugin-master
description: |
Use when the user says 'plugin-master', 'orchestrate plugin creation', 'manage plugin lifecycle',
'review plugin', 'audit plugin', 'iterate skill quality', 'package plugin for marketplace',
or wants to orchestrate the full lifecycle (create / review / iterate / package / insights) of Claude Code plugins.
(also: insights based on real usage to propose plugin improvements)
Not when: user wants to create a single atomic component — use /plugin-dev:skill-development / agent-development / hook-development / command-development / plugin-structure directly. plugin-master is the orchestrator; plugin-dev provides the atomic builders.
Single entry /plugin-master with 5 routes: - create: brainstorm → design → scaffold (plugin-dev) → eval baseline (skill-creator) → review → iterate - review: 9-dimension audit from AI executor perspective + cross-plugin trigger conflict detection - iterate: fix → re-eval (skill-creator) → compare baseline → verify - package: full plugin or single component into target project - insights: analyze real usage data → propose evidence-based skill improvements → open draft PR
Plugin Lifecycle Management
统一入口,编排 Claude Code 插件和组件的完整生命周期:创建、评估、审查、迭代、打包。
委托 plugin-dev 处理组件创建,skill-creator 处理 eval 循环,自建 9 维审查框架和跨插件冲突检测。
Process
Step 1: Intent Detection
从用户消息判断路由:
| Route | Signal keywords |
|---|---|
| create | "build", "create", "new plugin", "new skill", "new agent", "new hook", "brainstorm", "I want to make" |
| review | "review", "audit", "check quality", "review plugin", "review skill", "plugin review" |
| iterate | "improve", "fix trigger", "iterate", "refine", "trigger is too broad", "trigger is too narrow", "quality" |
| package | "package", "export", "inject", "distribute", "marketplace-ready", "deploy to project" |
| insights | "insights", "usage data", "propose improvements", "auto-tune", "skill improvements from usage" |
Routing logic:
- If keywords match a single route → proceed to that route
- If user just says "plugin-master" with no other context → AskUserQuestion: "Which workflow?" with 5 options (create / review / iterate / package / insights)
- If ambiguous (keywords match multiple routes) → dispatch
skill-master:intent-distilleragent with user's message → use itsrecommendationfield to determine route - If still ambiguous after intent-distiller → AskUserQuestion with 5 route options
Step 2a: Create Route
Goal: produce a high-quality plugin component with eval baseline and review gate.
2a.1: Extract Intent
If intent-distiller was already dispatched in Step 1 (ambiguous routing path), reuse its output here and skip the dispatch.
Otherwise, dispatch skill-master:intent-distiller agent:
Extract structured plugin/skill development intent from the following user request.
User description: {user's message}
The agent returns a structured YAML block with: capability, component_type, target_audience, success_criteria, delegation_targets, existing_overlap, recommendation.
2a.2: Confirm Intent
Present the intent summary to the user:
- Capability: {what it does}
- Component type: {skill / agent / hook / command / plugin}
- Existing overlap: {list or "none found"}
- Recommendation: {create new / extend existing / skip}
If recommendation is "extend existing" or "skip", explain why and ask user how to proceed.
If recommendation is "create new" or user overrides, continue.
2a.3: Check Dependency Availability
Before delegating, detect which optional dependencies are installed:
- plugin-dev: Glob
~/.claude/plugins/**/plugin-dev/**/.claude-plugin/plugin.json. Found →plugin_dev_available = true. - skill-creator: Glob
~/.claude/plugins/**/skill-creator/**/skills/skill-creator/SKILL.md. Found →skill_creator_available = true. Also store its scripts directory path as$SC_SCRIPTS.
2a.4: Delegate Creation
Route by component_type:
Full plugin:
- If
plugin_dev_available: invokeSkill("plugin-dev:create-plugin")(8-phase guided workflow) - If not: manually scaffold the plugin structure (create
.claude-plugin/plugin.json,skills/,agents/directories, README.md) and write components directly
After creation completes → continue to 2a.5.
Single skill:
- If
plugin_dev_available: invokeSkill("plugin-dev:skill-development")for structure guidance and SKILL.md drafting. If not: write SKILL.md directly following plugin-dev conventions (name/description frontmatter, Process section, Completion Criteria) - If
skill_creator_available: invokeSkill("skill-creator:skill-creator")for eval loop (eval creation, parallel runs, grading, viewer, iteration). If not: write eval.md manually with trigger tests and negative tests - After complete → continue to 2a.5
Agent:
- If
plugin_dev_available: invokeSkill("plugin-dev:agent-development")for guidance, then dispatchplugin-dev:agent-creatorvia the Agent tool for generation. If not: write agent .md directly (name/description/model/tools frontmatter, system prompt, constraint section) - After created → continue to 2a.5
Hook:
- If
plugin_dev_available: invokeSkill("plugin-dev:hook-development"). If not: write hooks.json and hook script directly - After created → continue to 2a.5
Command:
- If
plugin_dev_available: invokeSkill("plugin-dev:command-development"). If not: write command .md directly - After created → continue to 2a.5
2a.5: Cost Posture Recommendation
Before auto-review, classify the new artifact's dominant work and recommend model / effort / context frontmatter.
Read
${CLAUDE_PLUGIN_ROOT}/skills/plugin-master/cost-posture.mdfor the classification heuristic, decision questions, and recommended configs. If the file cannot be located, skip this step.Apply the heuristic to the newly created artifact:
- Read the artifact's description and body
- Walk the decision questions (writes spec vs follows / output consumed downstream / needs CLAUDE.md / failure cost)
- Determine the class: Mechanical / Retrieval / Tool wrapper / Judgment / Synthesis / Orchestration
If the artifact already has
model:orcontext:set: verify it matches the recommended config for its class.- If it matches: no action, note "cost posture: aligned"
- If it conflicts with the heuristic (e.g. mechanical skill on inherit, or synthesis skill set to haiku): present the conflict and ask the user to confirm or override
If the artifact has no
model:/context:set: present the recommendation as an AskUserQuestion:- Class: {detected}
- Recommended frontmatter:
model: {sonnet|haiku}+ optionalcontext: fork agent: {Explore|...} - Reason: cite the relevant row from cost-posture.md
- Options: "Apply recommendation" / "Keep inherit (default Opus)" / "Custom"
- If "Apply recommendation": Edit the artifact's frontmatter
- If "Keep inherit": continue without changes
- If "Custom": ask for explicit values
Note the cost posture decision in the Completion (create) summary at the end of this route, so the user has it on record.
2a.6: Auto-Review Gate
Collect the file paths of newly created artifacts (from the delegated skill's output, or Glob the target directory for recently created/modified .md files).
Execute the review route (Step 2b) on these artifacts, using Scope A (specific files).
2a.7: Quality Decision
If review finds Bug-severity issues:
- Present the findings to user
- AskUserQuestion: "Auto-fix and re-review?" / "Accept as-is" / "Manual fix"
- If auto-fix → execute iterate route (Step 2c) with the Bug items as input, then re-review
- If accept → mark as needs-fix and finish
- If manual fix → pause, user fixes, then re-run review
If review finds only Logic/Minor issues or no issues:
- Present quality gate summary: pass
Completion (create)
- Artifact created at specified location
- Review report presented
- Quality gate: pass or needs-fix (with specific items listed)
Step 2b: Review Route
Goal: 9-dimension plugin quality audit from the AI executor perspective, plus cross-plugin trigger conflict detection.
2b.1: Determine Scope
From user message, determine what to review:
Scope A — Specific files: User gives file paths directly.
Scope B — Plugin: User names a plugin or directory. Collect:
- Glob
{plugin}/skills/*/SKILL.md→ all skills - Glob
{plugin}/agents/*.md→ all agents
Scope C — Recent changes: User says "review my changes" or no explicit target.
git diff --name-only HEADfor uncommitted changes- If clean:
git log --name-only -1 --pretty=format:""for last commit - Filter to skill/agent files only
Scope D — All: User says "review all" or "audit everything".
- Collect all installed plugin skills and agents
Present the file list to user for confirmation before proceeding.
2b.2: Gather Context
For each plugin in scope, collect:
- Plugin manifest —
.claude-plugin/plugin.json - All skill files —
skills/*/SKILL.md - All agent files —
agents/*.md - Marketplace entry — check
marketplace.json - Eval files —
skills/{name}/eval.mdfor each skill
2b.3: Detect plugin-dev Availability
Check whether plugin-dev is installed:
- Glob:
~/.claude/plugins/*/plugin-dev/.claude-plugin/plugin.jsonor~/.claude/plugins/cache/*/plugin-dev/*/.claude-plugin/plugin.json - Found → Strategy A
- Not found → Strategy B
2b.4: Dispatch Review Agents
Strategy A — plugin-dev available (3 parallel dispatches in a single turn):
plugin-dev:plugin-validatoragent:Validate this Claude Code plugin's structure. Plugin manifest: {path} Skills: {comma-separated paths} Agents: {comma-separated paths}plugin-dev:skill-revieweragent:Review these skill descriptions for trigger quality and routing clarity. Skills: {comma-separated paths}skill-master:plugin-revieweragent withmodel: "opus":Review these Claude Code plugin artifacts from the AI executor perspective. Scope: {A/B/C/D} Files to review: - Skills: {comma-separated paths} - Agents: {comma-separated paths} - Plugin manifest: {path} Also read these for cross-reference checking: - Other skills in same plugin(s): {paths} - Other agents in same plugin(s): {paths} - Eval files: {comma-separated paths or "none"} Supporting files to load: none Plugin agents dir: {skill-master agents directory path} (D1/D2 structural checks and baseline trigger/description checks are handled by plugin-dev agents.) Focus on: workflow logic, execution feasibility, edge cases, dispatch loops, spec compliance, metadata & docs, eval.md consumption, deep trigger conflict detection, and Trigger Health Score.
Strategy B — plugin-dev not available (1 dispatch):
skill-master:plugin-reviewer agent with model: "opus":
Review these Claude Code plugin artifacts from the AI executor perspective.
Scope: {A/B/C/D}
Files to review:
- Skills: {comma-separated paths}
- Agents: {comma-separated paths}
- Plugin manifest: {path}
Also read these for cross-reference checking:
- Other skills in same plugin(s): {paths}
- Other agents in same plugin(s): {paths}
- Eval files: {comma-separated paths or "none"}
Supporting files to load: structural-validation.md, trigger-baseline.md
(Resolve via `${CLAUDE_PLUGIN_ROOT}/agents/` if executing inside skill-master plugin context, otherwise Glob `**/skill-master/agents/{structural-validation,trigger-baseline}.md`. These are non-agent reference fragments stored under `agents/` for historical reasons; load with Read, not Task dispatch.)
Focus on: logic bugs, trigger mechanism issues, execution feasibility, and edge cases.
2b.5: Cross-Plugin Trigger Conflict Detection
After main review agents complete, if scope includes skills:
Dispatch skill-master:trigger-arbiter agent:
Scan for cross-plugin trigger conflicts.
Target skill path(s): {comma-separated paths of reviewed skills}
Scope: all
2b.6: Present Results
Strategy A — merge results:
- If any agent dispatch failed: mark those dimensions as "Error: agent did not return results"
- Collect findings from all agents, tag each with source agent
- Deduplicate: same file + same location → keep the more specific finding
- Map findings to 9-dimension summary
Both strategies — unified output:
- Group findings by severity: Bug / Logic / Minor
- For each Bug-severity finding, include the suggested fix inline
- Append trigger-arbiter results as Cross-Plugin Conflicts section
- If fixes exist: ask user "Apply suggested fixes?" and apply if approved
Completion (review)
- Full review report with findings grouped by severity
- Every finding has file:line reference
- Bug-severity findings have actionable fix suggestions
- Cross-plugin conflict section (if skills were reviewed)
- Trigger Health Score per skill
Step 2c: Iterate Route
Goal: improve an existing skill or agent and verify the improvement.
2c.1: Identify Target
Determine the target artifact:
- From user's message: explicit file path or skill/agent name
- From recent review findings: Bug or Logic items from Step 2b
2c.2: Classify Issue Type
| Issue Type | Detection | Action |
|---|---|---|
| Trigger quality | "trigger too broad/narrow", description quality warnings | Description optimization via skill-creator |
| Logic bug | Bug-severity review findings in workflow steps | Edit SKILL.md, re-validate |
| Missing eval | No eval.md, or eval coverage gaps | Draft eval cases, run eval loop |
| Agent issue | Agent frontmatter errors, tool mismatch | Edit agent, re-validate |
2c.3: Check Dependency Availability
If not already detected (e.g., when iterate is called standalone, not from create route):
- skill-creator: Glob
~/.claude/plugins/**/skill-creator/**/skills/skill-creator/SKILL.md. Found →skill_creator_available = true. Also locate its scripts directory: Glob~/.claude/plugins/**/skill-creator/**/skills/skill-creator/scripts/→ store as$SC_SCRIPTS.
2c.4: Execute Fix
Trigger quality issues (description optimization):
This is the most common iterate case.
If skill_creator_available is false: apply manual description changes based on review findings, then skip to 2c.5.
Otherwise (skill_creator_available = true), automated optimization:
Locate the skill's existing eval.md if any (skip step 2 if absent — write evals.json from review findings instead).
If the skill has
eval.md, convert trigger/negative trigger tests toskill-creatoreval-set format:[ {"prompt": "<trigger test>", "should_trigger": true}, {"prompt": "<negative test>", "should_trigger": false} ]Write to a temporary
evals.jsonbeside the skill.Run description optimization:
python -m scripts.run_loop \ --eval-set <evals.json path> \ --skill-path <SKILL.md path> \ --max-iterations 5(Run from
$SC_SCRIPTSparent directory)Present results:
best_description,best_train_score,best_test_scoreAskUserQuestion: "Apply this improved description?" → if yes, update the SKILL.md description frontmatter
Logic bug / Agent issue:
- Apply the fix directly (Edit the SKILL.md or agent .md file)
- Validate:
(From skill-creator scripts directory)python -m scripts.quick_validate <skill directory>
Missing eval coverage:
- Draft new eval cases based on the skill's description
- Invoke
Skill("skill-creator:skill-creator")for the full eval loop - This creates baseline measurements for future comparison
2c.5: Verify Improvement
After fix is applied:
If eval baseline exists from a previous iteration:
- Re-run eval loop with
--previous-workspaceto compare - Present delta (pass rate change, timing change)
- Re-run eval loop with
Re-run review route (Step 2b) with Scope C (recent changes only)
Present before/after comparison summary
Completion (iterate)
- Fix applied
- Improvement verified (eval delta or review improvement)
- Before/after comparison presented
Step 2d: Package Route
Goal: prepare output for distribution or injection.
2d.1: Determine Output Mode
AskUserQuestion if not clear from context:
- Full plugin — marketplace-ready validation
- Single component — inject into a target project
2d.2: Full Plugin — Marketplace Readiness Check
Run these checks in sequence:
.claude-plugin/plugin.jsonexists with required fields:name(string, non-empty)version(semver string)description(string, non-empty)author.name(string, non-empty)
README.mdexists and documents all components:- Every agent in
agents/is listed - Every skill in
skills/is listed - Hook events from
hooks/hooks.json(if exists) are listed
- Every agent in
Every skill directory has
eval.mdAll agent references in skills resolve to actual files:
- Grep each skill for agent dispatch patterns
- Verify referenced agent files exist
Dispatch
plugin-dev:plugin-validatorfor structural validationFor each skill, run quick_validate:
python -m scripts.quick_validate <skill directory>(From skill-creator scripts directory)
Present readiness checklist:
## Marketplace Readiness
| Check | Status | Details |
|-------|--------|---------|
| plugin.json | pass/fail | {missing fields if fail} |
| README.md | pass/fail | {missing entries if fail} |
| eval.md coverage | pass/fail | {skills without eval if fail} |
| Reference integrity | pass/fail | {broken refs if fail} |
| Structural validation | pass/fail | {issues if fail} |
| Skill validation | pass/fail | {issues per skill if fail} |
2d.3: Single Component — Inject into Target
- User specifies target project directory
- Check for existing plugin structure in target:
- Glob:
{target}/.claude-plugin/plugin.json
- Glob:
- If no plugin structure:
- AskUserQuestion: "Target has no plugin structure. Scaffold one?" → if yes, invoke
Skill("plugin-dev:create-plugin")in target
- AskUserQuestion: "Target has no plugin structure. Scaffold one?" → if yes, invoke
- Copy component files to target:
- Skill: copy entire
skills/{name}/directory - Agent: copy agent
.mdfile toagents/ - Hook: merge hook entries into
hooks/hooks.json
- Skill: copy entire
- If skill: optionally create a
.skillarchive:
(From skill-creator scripts directory)python -m scripts.package_skill <skill directory> <output directory> - Validate: Glob target directory to confirm files landed correctly
Completion (package)
- Full plugin: readiness checklist presented (all pass = ready)
- Single component: files copied, validated in target
Step 2e: Insights Route
See insights.md for the full 8-step process (preflight → Reader → Proposer → validate → judge → AskUserQuestion → pr_composer → record state).
Dependency Notes
This skill requires these optional plugins for full functionality:
plugin-dev— for component creation and structural validation (Strategy A review)skill-creator— for eval loop, description optimization, and packaging scripts
Without these plugins:
- Create route: will guide user through manual creation instead of delegating
- Review route: falls back to Strategy B (self-contained review)
- Iterate route: description optimization unavailable; manual fixes only
- Package route: quick_validate and package_skill unavailable; manual checklist only