Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
affaan-m avatar

Orch Refine Code

  • 2 installs
  • 238k repo stars
  • Updated August 5, 2026
  • affaan-m/ecc

orch-refine-code is a Claude Code skill that orchestrates a behavior-preserving refactor, keeping tests green while restructuring, then review and gated commit as refactor:.

About

orch-refine-code is a Claude Code skill that orchestrates a behavior-preserving refactor. A developer uses it when the structure should improve but behavior must not change, confirming the relevant tests are green first, then restructuring in small steps while keeping tests green. It is a thin wrapper over the shared orch-pipeline engine and can delegate dead-code and duplication sweeps to the refactor-cleaner agent.

  • Orchestrates a behavior-preserving refactor while keeping the test suite green throughout
  • Confirms tests are green (or adds characterization tests) before restructuring in small steps
  • Delegates dead-code and duplication sweeps to the refactor-cleaner agent and commits as refactor:

Orch Refine Code by the numbers

  • 2 all-time installs (skills.sh)
  • Ranked #13,956 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

orch-refine-code capabilities & compatibility

Capabilities
agent orchestration · refactoring · dead code removal · code review
Works with
github
Use cases
orchestration · refactoring · code review
From the docs

What orch-refine-code says it does

Orchestrate a behavior-preserving refactor — confirm tests are green, restructure without changing behavior, keep tests green, review, and gated commit.
SKILL.md
Same behavior, **better structure**: extract modules, remove duplication, kill dead code, reduce nesting, rename for clarity.
SKILL.md
Commit as `refactor:` — the diff must be behavior-neutral.
SKILL.md
npx skills add https://github.com/affaan-m/ecc --skill orch-refine-code

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2
repo stars238k
Last updatedAugust 5, 2026
Repositoryaffaan-m/ecc

What it does

Orchestrate a behavior-preserving refactor, keeping tests green while restructuring, then review and gated commit as refactor:.

Who is it for?

Improving structure (extract modules, remove duplication, kill dead code) without changing behavior.

Skip if: Any change where behavior is meant to change (orch-change-feature or orch-fix-defect).

When should I use this skill?

You want the same behavior with better structure: extract modules, remove duplication, kill dead code, reduce nesting, or rename for clarity.

What you get

A behavior-neutral restructure with tests green throughout, reviewed and committed as a refactor: commit.

  • Restructure plan
  • Behavior-neutral refactor with tests green
  • Reviewed refactor: commit

By the numbers

  • Phase mask 0-2-4-5-6
  • 2 human gates

Files

SKILL.mdMarkdownGitHub ↗

orch-refine-code

Actor · action · target: orch · refine · code. Thin wrapper over the shared engine in `orch-pipeline`.

When to Use

  • Same behavior, better structure: extract modules, remove duplication, kill

dead code, reduce nesting, rename for clarity.

  • Distinguish from siblings: if behavior is meant to change at all, this is the

wrong skill (orch-change-feature / orch-fix-defect).

Operation settings

  • Default size floor: standard — restructures touch multiple files.
  • Phase mask: 0 → 2 (plan the restructure) → 4 (keep green) → 5 → 6. No new

behavior tests are written — the existing suite is the safety net.

  • First move (phase 4): confirm the relevant tests exist and are **green

before** touching code; if coverage is thin, add characterization tests first. Then restructure in small steps, re-running tests after each.

How It Works

1. Run the orch-pipeline engine with the settings above. 2. For dead-code / duplication sweeps, delegate to the refactor-cleaner agent (it runs knip / depcheck / ts-prune and removes safely). 3. Stop at Gate 1 (restructure plan) and Gate 2 (pre-commit). 4. Commit as refactor: — the diff must be behavior-neutral.

Example

orch-refine-code: extract the NWS HTTP client out of poller.py
→ confirm tests green → plan extraction  [GATE 1: approve]
→ move in small steps, tests green throughout → code-review
→ commit refactor:  [GATE 2: confirm]

Related skills

FAQ

What is the first move?

Confirm the relevant tests exist and are green before touching code, adding characterization tests first if coverage is thin.

How does the diff look?

It commits as refactor: and the diff must be behavior-neutral.

AI & Agent Buildingagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.