Agent skill
optimize-plugin
This skill should be used when the user asks to "validate a plugin", "optimize plugin", "check plugin quality", "review plugin structure", or mentions plugin optimization and validation tasks.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/optimize-plugin
SKILL.md
Plugin Optimization
Execute plugin validation and optimization workflow. Target: $ARGUMENTS
Background Knowledge
Template Compliance: Components MUST conform to templates in ${CLAUDE_PLUGIN_ROOT}/examples/. See references/template-validation.md for complete requirements (instruction-type/knowledge-type skills, agents).
Tool Patterns: See references/tool-patterns.md for invocation styles. Key: Skill/AskUserQuestion/TaskCreate require explicit "Use [tool] tool" phrasing.
Initialization
Use TaskCreate tool to track all four phases before starting work.
Phase 1: Discovery & Validation
Goal: Validate structure and detect issues. Orchestrator MUST NOT apply fixes.
Actions:
- Resolve path with
realpathand verify existence - Validate
.claude-plugin/plugin.jsonexists - Validate components against
${CLAUDE_PLUGIN_ROOT}/examples/templates - Assess architecture (ask about command migration if needed)
- Run validation:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/validate-plugin.py "$TARGET" - Compile issues by severity (Critical, Warning, Info)
Phase 2: Agent-Based Optimization
Goal: Launch agent to apply ALL fixes. Orchestrator does NOT make fixes directly.
Condition: Skip this phase if Phase 1 found no issues (proceed directly to Phase 4).
Actions:
- Launch
plugin-optimizer:plugin-optimizeragent with the following prompt content:- Target plugin path (absolute path from Phase 1)
- Complete list of validation issues with severity levels
- Template compliance results from Phase 1
- Any user decisions from architecture assessment
- Agent autonomously applies fixes (uses AskUserQuestion for template fix approvals)
- Agent increments version in
.claude-plugin/plugin.jsonafter fixes (patch: fixes/optimizations, minor: new components, major: breaking changes)
Phase 3: Final Verification
Goal: Re-run validation to verify fixes.
Condition: Only execute if Phase 2 applied fixes.
Actions:
- Re-run all validation scripts from Phase 1
- Compare results with initial findings
- If critical issues remain: resume agent with remaining issues
- Document outcome (fixed vs remaining with rationale)
Phase 4: Final Deliverables
Goal: Deliver comprehensive optimization report and updated documentation to user.
Actions:
- Generate complete validation report with all findings, fixes, and verification results
- Produce component inventory summary showing plugin structure
- Update README.md to accurately reflect current plugin state
- See
./references/workflow-phases.mdfor detailed steps and./references/report-template.mdfor format
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?