/rcc:refactoring-pluginsfrom rcc
Refactors and audits Claude Code plugin packages against official best practices. Runs health checks, detects structural drift, fixes anti-patterns, and verifies results.
Ships in rcc. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Refactoring plugins IS aligning plugin structure with official Claude Code best practices.
Run health checks, detect structural drift, fix anti-patterns, and verify the result. Plugins differ from agent systems — they have an official schema (plugin.json), auto-discovery conventions, and distribution requirements.
Core principle: A plugin that fails health check will fail in production. Measure first, then fix.
Follow task initialization protocol.
Tasks:
Announce: "Created 7 tasks. Starting execution..."
Goal: Locate the plugin to refactor.
Discovery order:
.claude-plugin/plugin.json → use it*/.claude-plugin/plugin.json in working directoryRecord:
Verification: Have a valid plugin directory with .claude-plugin/plugin.json.
Goal: Execute the automated health check script.
Step 1: Run claude plugin validate <plugin-path> (official CLI).
Step 2: Run extended health check (bash-first, three-runner fallback with brace grouping):
{ command -v uv >/dev/null 2>&1 && uv run "${CLAUDE_SKILL_DIR}/scripts/validate_plugin.py" <plugin-path>; } \
|| { python3 --version >/dev/null 2>&1 && python3 "${CLAUDE_SKILL_DIR}/scripts/validate_plugin.py" <plugin-path>; } \
|| python "${CLAUDE_SKILL_DIR}/scripts/validate_plugin.py" <plugin-path>
The script integrates CLI validation and adds checks for manifest, structure, skills quality, commands, agents, path safety, and version sync.
Capture output for analysis in Task 3.
Verification: Health check completed with error/warning counts.
Goal: Deep analysis beyond the automated script.
Important: Read references/plugin-health-checklist.md for the full checklist.
The script catches structural issues. Manual analysis catches:
For each finding, record:
Verification: All 9 checklist categories evaluated.
Goal: Show user the full findings and planned fixes.
Present ALL findings with detail. Do NOT summarize:
Format:
| # | Severity | Category | Component | Issue | Planned Fix |
|---|
Ask: "以上是插件健康檢查結果,要開始修正嗎?"
Verification: User has confirmed the refactoring plan.
Goal: Fix all confirmed issues.
Important: Read references/plugin-structure-rules.md for official rules and execution order.
Important: All edits in main conversation. Never delegate writes to subagents.
Verification: Each fix applied and individually verified.
Goal: Re-run health check to confirm all issues resolved.
Process:
uv run → python3 → python) on the refactored pluginIf issues remain: Return to Task 5 and fix.
Produce final report with changes made (component, change, rationale) and before/after health check metrics.
Verification: Health check passes with zero errors.
Goal: Plugin root CLAUDE.md lists every file containing this plugin's version string.
Detection: Read <plugin-root>/CLAUDE.md. Check for a section (typically "Version Bump Locations") that enumerates:
If absent or incomplete: Add/update using the format defined in creating-plugins Task 6.
Release automation is orthogonal: Whether or not release-please / semantic-release is configured, the plugin CLAUDE.md is still required. Scripts fail; CLAUDE.md is the fallback Claude reads every session.
Verification: <plugin-root>/CLAUDE.md documents every version-bearing file for this plugin.
| Thought | Reality |
|---|---|
| "Skip health check" | Scripts catch what eyes miss. Always run it. |
| "Structure looks fine" | Anti-patterns hide in config files. Check all 9 categories. |
| "Fix without showing" | User must confirm before structural changes. |
| "Skip re-verification" | Fixes can break other things. Re-run the script. |
| "Simple plugin" | Simple plugins still need valid manifests and naming. |
| "I know the official structure" | Official structure evolves. Verify against the checklist. |
${CLAUDE_SKILL_DIR}/scripts/validate_plugin.py (cross-platform, supports uv run)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
plugin-audit, plugin-migration, health-check, best-practices
23 skills in this plugin
/advising-architectureValidates component-type choices for agent system work, classifying knowledge as CLAUDE.md vs rule vs skill vs agent vs hook and checking for conflicts. Use when starting any skill/agent/rule workflow to validate approach. Use when classifying knowledge type. Use when checking for component conflicts./analyzing-agent-systemsScans project structure and agent system components, runs 11-category weakness analysis, and produces actionable restructuring recommendations. Use when analyzing an existing agent system for weaknesses. Use when user says "analyze agent system", "check agent setup", "audit agent config". Use when called by migrating-agent-systems or refactoring-skills./npx claudepluginhub wayne930242/reflexive-claude-code --plugin rccOther plugins' skills for the same job