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.
npx agentmods add agents/lucassantana-dev/sharekit/refactor-orchestratorgit clone --depth 1 https://github.com/LucasSantana-Dev/sharekitWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00105 | $0.01947 |
| Opus 5 | $0.00053 | $0.00974 |
| Sonnet 5 | $0.00021 | $0.00389 |
| Haiku 4.5 | $0.00011 | $0.00195 |
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 2d 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.
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)
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.
- 2d ago First seen · 145 lines · 0 tokens per session scan A b537ad711a58
refactor-orchestrator is an agent published in the GitHub repository LucasSantana-Dev/sharekit (1 stars, last pushed 2d ago), licensed MIT. It adds 105 tokens to every session and 1,947 once invoked, about $0.0005 per session on Opus 5. 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.
Other agents, from other repositories
code-archaeologist
Analyzes repository git history and pull requests to discover coding patterns, reviewer feedback, and team conventions, then generates skills, rules, and agents based on the findings.
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.
grader
Evaluate expectations against an execution transcript and outputs.
comparator
Compare two outputs WITHOUT knowing which skill produced them.