/rcc:refactoring-agent-systemsfrom rcc
Cleans up and consolidates agent system configurations after creation or modification. Prioritizes and fixes issues from review reports such as duplicate logic, conflicting instructions, over-engineering, and weak triggers.
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.
None: SKILL.md is the whole skill.
Refactoring agent systems IS applying clean code principles to agent configurations.
Re-analyze after changes, compare before/after, fix remaining issues, simplify over-engineering.
Core principle: Refactoring without measurement is guessing. Analyze, then change, then verify.
Pattern: Skill Steps Handoff: none Next: none Chain: main (terminal)
Follow task initialization protocol.
Tasks:
Announce: "Created 6 tasks. Starting execution..."
Goal: Load the review report as the basis for refactoring.
If review report path was provided (from reviewing-agent-systems):
If no review report (standalone invocation):
reviewing-agent-systems skill first to produce a reportVerification: Have a list of specific issues to fix from the review report.
Goal: Classify and order issues from the review report for fixing.
Priority order:
Present the prioritized list to user. Do NOT summarize — show each issue with its component, severity, and planned fix.
Ask: "這些修正項目正確嗎?要開始修正嗎?"
Verification: User has confirmed the prioritized fix list.
Goal: Fix remaining and new issues.
Refactoring actions (in priority order):
| Issue Type | Action | Method |
|---|---|---|
| Duplicate logic across components | Merge or extract to rule | Main conversation edits |
| Conflicting instructions | Unify or remove one | Main conversation edits |
| Over-engineered component | Simplify (YAGNI) | Main conversation edits |
| Weak skill trigger | Improve description | Main conversation edits |
| Heavy read-only work in main context | Move it to a subagent, or add context: fork to the skill | Main conversation edits |
| CLAUDE.md too long | Move content to rules/skills | Main conversation edits |
| Skill missing asset | Add scripts/, templates/, or references/ | Create directly — no user confirmation needed |
Important: All edits happen in main conversation. Never delegate refactoring writes to subagents.
For each refactoring action:
Verification: All REMAINING and NEW issues addressed.
Goal: Confirm no critical issues remain.
Re-run the relevant reviewer agents on components that were modified in Task 3.
Pass criteria:
If critical issues remain: Return to Task 3 and fix.
Verification: All modified components pass their reviewer.
Goal: Document what was changed and why.
Write to: .rcc/{timestamp}-refactoring-report.md
Report format:
# Agent System Refactoring Report
**Date:** YYYY-MM-DD HH:MM
## Changes Made
| # | Component | Change | Rationale |
|---|-----------|--------|-----------|
## Before/After Comparison
| Metric | Before | After |
|--------|--------|-------|
| Components | N | N |
| Critical issues | N | 0 |
| Warnings | N | N |
| Total lines (CLAUDE.md) | N | N |
## Remaining Items (INFO)
- [Low priority items for future consideration]
Verification: Report accurately reflects all changes.
Goal: Move all pipeline documents from the current run to the archive.
Steps:
.rcc/archive/{YYYY-MM-DD}/*.md files from .rcc/ to the archive directory (excluding the archive/ directory itself)mkdir -p .rcc/archive/{YYYY-MM-DD}
mv .rcc/*.md .rcc/archive/{YYYY-MM-DD}/
git add .rcc/
git commit -m "chore: archive pipeline documents from {YYYY-MM-DD}"
Replace {YYYY-MM-DD} with today's actual date.
If no documents exist in .rcc/: Skip this task (nothing to archive).
Verification: .rcc/ contains only the archive/ directory. All pipeline documents are in the dated archive subdirectory.
These thoughts mean you're rationalizing. STOP and reconsider:
All of these mean: You're about to leave mess behind. Follow the process.
| Excuse | Reality |
|---|---|
| "Skip re-analysis" | Building introduces new issues. Always re-analyze. |
| "Skip comparison" | Without before/after, you can't prove improvement. |
| "Subagent edits" | Subagents can't write to .claude/. Use main conversation. |
| "Skip verification" | Refactoring can break things. Verify. |
| "Skip report" | Report documents decisions for future maintainers. |
| "Skip archiving" | Accumulated documents confuse future pipeline runs. Archive. |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub wayne930242/reflexive-claude-code --plugin rcc23 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./applying-agent-systemsBuilds agent system components from a confirmed component plan. Use when executing a component plan to build agent system elements. Use when called by planning-agent-systems after plan is confirmed. Use when user says "apply agent plan", "build agent system"./brainstorming-workflowsExplores user workflows through targeted questions about pipeline modes, pain points, routine tasks, and human intervention points to inform agent system design. Use when exploring workflows after analysis. Use when user says "explore workflows", "brainstorm workflows", "what should I automate". Use when called by analyzing-agent-systems./creating-pluginsScaffolds a new Claude Code plugin package with manifest, skills, agents, and marketplace entry. Use when creating a new Claude Code plugin package. Use when user says "create plugin", "new plugin", "scaffold plugin", "plugin template"./dispatching-parallel-agentsFans out work across multiple agents — same prompt to many for Best-of-N, different prompts for parallel exploration, or a scout before committing. Use when user says "parallel agents", "fan out", "best of N", "scout", "race", "vote", "spawn workers".Other plugins' skills for the same job