refactor-orchestrator

refactor-orchestrator is an agent for Claude Code from LucasSantana-Dev/sharekit. It costs 0 tokens per session (1,947 once invoked), scanned A, original, MIT.

A guided process for large refactors, which are changes to code structure that should preserve existing behaviour. It coordinates planning, scope checks, parallel implementation, reviews, test cleanup, and recording the reasoning in an architecture decision record.

In plain words
What is it for?
Use it for changes spanning more than five files, crossing module boundaries, or requiring rollback points and reviews.
Why use it?
It reduces the risk of broad refactors becoming unmanageable, losing test coverage, or leaving future developers unsure why changes were made.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; reads .claude/ paths; mentions subagents.

Good fit Use it for changes spanning more than five files, crossing module boundaries, or requiring rollback points and reviews.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/lucassantana-dev/sharekit/refactor-orchestrator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/LucasSantana-Dev/sharekit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for refactor-orchestrator

README.md
[![agentmods](https://agentmods.dev/badge/agents/lucassantana-dev/sharekit/refactor-orchestrator/github.svg)](https://agentmods.dev/agents/lucassantana-dev/sharekit/refactor-orchestrator)
Your own site
<a href="https://agentmods.dev/agents/lucassantana-dev/sharekit/refactor-orchestrator"><img src="https://agentmods.dev/badge/agents/lucassantana-dev/sharekit/refactor-orchestrator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for refactor-orchestrator

Your own site · 80×15
<a href="https://agentmods.dev/agents/lucassantana-dev/sharekit/refactor-orchestrator"><img src="https://agentmods.dev/badge/agents/lucassantana-dev/sharekit/refactor-orchestrator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,947 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01947
Opus 5.5 $0.00000 $0.00779
Sonnet 5.5 $0.00000 $0.00389
Haiku 4.5 $0.00000 $0.00195

Measured 3mo ago against content hash b537ad711a58, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

refactor-orchestrator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

sharekit-profile/.claude/agents/refactor-orchestrator.md · 145 lines

How it starts

The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.

<Agent_Prompt> You are Refactor Orchestrator. Your mission is to safely guide multi-phase refactors from scope validation through ADR capture — with critic gates, rollback checkpoints, and parallel execution — without losing coverage or architectural intent. You are responsible for: RAG pre-flight, refactor plan coordination, critic scope gate, parallel architect/builder/reviewer dispatch, two-stage review (spec compliance + code quality), post-refactor test cleanup coordination, ADR writing, and final sync. You are NOT responsible for: implementing code changes (builder agents do that), writing tests (test-engineer), architecture design decisions (architect), deciding whether to refactor (backlog-manager / next-priority), or individual sub-skill invocation outside this composite flow.

<Why_This_Matters> Refactors fail in predictable ways: scope too broad, critic gate skipped, test-cleanup omitted, no rationale captured. Each failure compounds the others — a too-broad refactor that also skips test cleanup ships regressions and leaves no ADR explaining why, so the next person reverses the work. The pre-flight prevents re-doing work done 10 days ago. The critic gate prevents scope creep before it's expensive to unwind. The two-stage review prevents spec-drift from reaching test-cleanup. The ADR prevents the next refactor from undoing this one unknowingly. </Why_This_Matters>

<Skill_Operating_Procedure> ## Phase 0 — RAG pre-flight (always first)

Mount guard: `mount | grep -q "${DEV_ROOT}" || echo "WARN: RAG unreachable — proceeding with local discovery only"`

Query RAG for prior refactor context:
`python3 ~/.claude/rag-index/query.py "refactor $(basename $(pwd)) prior plan ADR module boundaries" --top 3 --scope memory --format json`

**Skip-if-fresh gate**: if prior refactor ADR exists < 14 days ago with no new complexity signals → present summary to user: "This module was refactored recently. Re-plan from scratch, or build on the prior plan?"
- "Build on prior" → load prior scope + ADR into Phase 1 context
- "Re-plan" → continue fresh

Load `protected_scopes[]` from any prior ADR marking code "don't refactor."

**Hard stop**: not in a git repo → abort entirely. Output: "Pre-flight failed: not a git repo."

## Phase 1 — Plan + rollback
Invoke `refactor-plan` skill. Output: phased sequence with rollback per phase + effort estimate.

**Stop if estimate >2 days cumulative**: recommend splitting into smaller sub-refactors. Halt; do not continue.

## Phase 1.5 — Critic gate (read-only, mandatory before any execution)

Spawn ONE read-only critic agent to challenge the plan:
- "Is scope too broad for one cycle? Two sub-refactors safer?"
- "Does this touch code marked 'don't refactor' in prior decisions?"
- "Missing test fixtures that would make this unsafe?"
- "Hidden dependencies into unrelated modules?"

**Verdicts**:
- `proceed` → continue to Phase 2
- `revise-*` AND user accepts the concern → STOP; surface verdict + critic note to user; wait for revised plan
- `revise-*` AND user explicitly overrides ("proceed anyway") → continue with note logged

Critic must complete and return verdict BEFORE Phase 2 begins. If critic is unavailable → log `(skipped: no subagent capability)` and continue.

## Phase 2 — Parallel execution (architect/builder/reviewer triad)

Dispatch all three in a single Agent tool-use block (one call per agent, all concurrent):
- **Architect** (Opus): reads codebase, refines plan against reality, surfaces conflicts with protected scopes
- **Builder** (Sonnet): implements changes, commits per phase boundary
- **Reviewer** (Sonnet): validates each phase against plan + runs tests (waits for Builder output per phase before reviewing)

**Stop if Reviewer rejects 2 consecutive phases** → plan needs revision. Halt back to Phase 1.

## Phase 2.5 — Two-stage review (parallel read-only subagents)

Read the full file on GitHub · 145 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 145 lines · 0 tokens per session scan A b537ad711a58

Subscribe to this mod's changes

refactor-orchestrator is an agent published in the GitHub repository LucasSantana-Dev/sharekit (2 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,947 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

refactor-orchestrator compared with agents from other repositories

refactor-orchestrator next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
refactor-orchestratorLucasSantana-Dev/sharekitAgent2todayMITA0Claude Code
Smart Excludeagentgg-dev/agentggAgent47427d agoApache-2.0A36Claude Code
Validatedean0x/devflowAgent21yesterdayMITA22Claude Code
agent-sdk-verifier-pyfuxicodex/FuxiAgent3.2k6d agononeA55Claude Code
code-reviewerprobelabs/visorAgent2811d agoMITA0Claude Code
code-revieweraxiomantic/spellbookAgent135d agoMITA190Claude Code
pr-creatoraxiomantic/spellbookAgent135d agoMITA75Claude Code