refactor-orchestration

Plans and orchestrates multi-layer top-down refactors via chunked executor subagents.

1|Updated Dec 11, 2025
One-click install
npx skills add https://github.com/HarmAalbers/claude-requirements-framework --skill refactor-orchestration-harmaalbers
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: refactor-orchestration
Source: https://github.com/HarmAalbers/claude-requirements-framework/tree/main/plugins/requirements-framework/skills/refactor-orchestration
Command: npx skills add https://github.com/HarmAalbers/claude-requirements-framework --skill refactor-orchestration-harmaalbers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Large refactors that span multiple architectural layers are too big to design and execute in a single session, leading to inconsistent code, missed library API changes, and abandoned half-finished migrations. This Skill freezes a validated design plan first, then dispatches the mechanical work in small atomic chunks to subagents. ## Core Features & Use Cases - Validated plan generation: Produces a structured design plan (sections 0-13) with mandatory context7 validation of every third-party library claim and a harmonization pass that enforces one canonical template across the layer. - Copy-paste orchestrator prompt: Decomposes the plan into a chunk queue (one chunk = one atomic commit) and generates a ready-to-paste orchestrator prompt that dispatches Haiku executor agents, reviews each chunk, and escalates contradictions to a Sonnet investigator agent and the user. - Self-improving retrospective loop: A final analyzer agent writes a retrospective report, appends observations to a learnings ledger, and proposes template or agent improvements via a rule-of-three promotion mechanism. - Use Case: You need to redesign your FastAPI router layer and push business logic down into an application layer across 40 files. Run this Skill to produce the frozen plan and orchestrator prompt, then paste the orchestrator into a fresh session to execute the refactor chunk by chunk with atomic commits. ## Quick Start Ask the AI to orchestrate a top-down refactor of a specific layer, for example: "Orchestrate a layer-by-layer refactor of the routers layer and generate the plan and orchestrator prompt."

Frequently Asked Questions about refactor-orchestration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I orchestrate a large multi-layer refactor with Claude Code?▼

Use this Skill to produce two artifacts: a validated design plan and a copy-paste orchestrator prompt. Open a fresh Claude Code session, paste the orchestrator block, and it dispatches executor subagents chunk by chunk with atomic commits per chunk.

What is a top-down layer-by-layer refactor approach?▼

Top-down refactoring designs the outermost layer first and pushes responsibilities that do not fit into the next layer via an export manifest, deferring the destination's implementation to the next pass. This Skill formalizes that workflow into inventory, design, validation, harmonization, and chunked execution stages.

When should I not use refactor orchestration?▼

Skip it when the work fits in one session and one mental model; the Skill explicitly says to just do small refactors directly. It is designed for refactors touching many files across multiple architectural layers where the design must be frozen before execution.

Why does the refactor plan require context7 library validation?▼

Library APIs drift over time, so every third-party API claim in the plan is confirmed against context7 documentation before the plan is frozen. The Skill reports this step caught five out of five library claims in past refactors, two of which were silent-failure blockers.

How does the orchestrator handle errors during chunk execution?▼

Simple issues like typos or lint findings get up to two retries with the same executor agent. Complex issues where the plan contradicts code reality are escalated to a read-only investigator subagent that proposes two to three solution paths, then the user picks one via AskUserQuestion.

Does this Skill work with the requirements-framework plugin gates?▼

Yes, it is bundled with the requirements-framework plugin but does not auto-satisfy any framework requirements. The recommended sequence is to run the arch-review command first to satisfy the plan-validation gate, then run the refactor-orchestrate command.