/aref:finalizing-refactorsfrom aref
Finalizes refactors by writing AGENTS.md per subproject, archiving run artifacts, and suggesting rcc handoff. Use after verifying-refactors passes.
Ships in aref. 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.
Finalizing refactors IS leaving a codebase that the next AI agent can pick up immediately.
Write per-subproject AGENTS.md (the cross-tool standard for agent-targeted docs), archive run artifacts to .rcc/archive/, suggest next-step handoff to rcc based on project state.
Core principle: The refactor is not done until the next agent has a map.
Pattern: Terminal
Handoff: user-confirmation
Next: none (terminal), but suggests /rcc migrate or /rcc reflect
[finalizing-refactors] Task N: <action>Tasks:
Root has a manifest → root is a subproject. Any directory with its own manifest and not nested in another is a subproject. Use same detection as analyzing-codebases.
For each subproject root, check if AGENTS.md exists. If yes, parse existing section headings. Plan will add missing sections, preserve existing.
Per subproject, fill template at references/agents-md-template.md:
Show diff -u <existing> <proposed> per subproject. User approves per subproject or batch. Rejections → prompt for edits.
Write approved AGENTS.md files. Commit:
git add <paths>
git commit -m "docs(aref): add/update AGENTS.md for N subprojects"
Move run artifacts to .rcc/archive/{ts}-aref-run/:
mkdir -p .rcc/archive/{ts}-aref-run
mv .rcc/{ts}-*.md .rcc/archive/{ts}-aref-run/
mv .rcc/{ts}-*.json .rcc/archive/{ts}-aref-run/ 2>/dev/null || true
mv .rcc/{ts}-apply-state.yml .rcc/archive/{ts}-aref-run/ 2>/dev/null || true
Keep .rcc/aref-raw/ and clean it: rm -rf .rcc/aref-raw/{ts}-*.
Commit:
git add .rcc/archive/{ts}-aref-run/
git commit -m "chore(aref): archive run {ts}"
Check:
.claude/ exists at project root → has agent system alreadyplugins/ exists → sameNo agent system detected → print:
Refactor complete. This project has no agent system. Next:
/rcc migrateto bootstrap skills, CLAUDE.md, rules.
Agent system present → print:
Refactor complete. Existing agent system detected. Next:
/rcc reflectto let the existing skills incorporate the new structure.
Print:
Instruct user:
To merge:
git checkout main && git merge --no-ff <branch>or open a PR.
.claude/ already exists| Thought | Reality |
|---|---|
| "AGENTS.md is redundant with README" | AGENTS.md is the agent-targeted doc; README is human-targeted. Different audiences, different content. |
| "Skip archive, user can read .rcc/ directly" | Archive keeps unstacked run history. Cleans working .rcc/. |
| "Merge the branch to finalize" | User merges. Plugin stops at branch. |
references/agents-md-template.mdWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub wayne930242/reflexive-claude-code --plugin aref6 skills in this plugin
/analyzing-codebasesDetects project languages and monorepo state, runs language-appropriate static analysis (dependency graph, complexity, duplication, semantic patterns), and produces a refactor map ranking hotspots. Use when user invokes /aref or explicitly asks to analyze a codebase for refactoring./applying-refactorsExecutes a refactor plan phase-by-phase on a dedicated branch with per-phase commits and mandatory reviewer checkpoints. Use when characterization-tests scaffold is complete and plan has phases ready to execute./planning-refactorsConverts a refactor map into a phased plan using parallel-change, branch-by-abstraction, or strangler fig patterns. Use when user has approved the refactor map from analyzing-codebases.Other plugins' skills for the same job