orch-refine-codecommit db7f2a6SKILL.md · Refactoring
Orchestrated Refactor
Orchestrates a behavior-preserving refactor: confirm tests are green, restructure in small steps, keep tests green, review, and commit behind gates.
Creates a git commit after Gate 2 confirmation, and cleanup sweeps may delete dead code.
npx skills add affaan-m/ECC --skill orch-refine-codeCommand selected. Copy it manually.
- Permissions
- read-repo
- write-files
- shell
- network
- Compatible with
- Claude Code, Codex, Cursor, Copilot, OpenCode
- GitHub
- 294.3k
- Source
- Community · Affaan Mustafa
- Status
- Scan passed
- License
- MIT
- Category
- Refactoring
Core rule
The diff must be behavior-neutral; if behavior is meant to change at all, this is the wrong skill.
Execution Phases
Phase 01Confirm tests are green
Before touching code, confirm the relevant tests exist and pass; add characterization tests first if coverage is thin.
Phase 02Plan the restructure
Plan the restructure with the orch-pipeline engine and stop at Gate 1 for approval.
Phase 03Restructure in small steps
Move in small steps, re-running tests after each; delegate dead-code and duplication sweeps to the refactor-cleaner agent (knip, depcheck, ts-prune).
Phase 04Review
Run a code review on the behavior-neutral diff.
Phase 05Gated commit
Stop at Gate 2 for confirmation, then commit with a refactor: prefix.
Permissions (summarised from SKILL.md)
| Capability | Needed | Details |
|---|---|---|
| File writes | Required | Restructures code across multiple files and adds characterization tests when needed. |
| Command execution | Required | Runs the test suite, tools such as knip, depcheck and ts-prune, and git commit. |
| Network outbound | Not required | The skill does not call for network access. |
SKILL.md frontmatter (YAML)
---
name: orch-refine-code
description: Orchestrate a behavior-preserving refactor — confirm tests are green, restructure without changing behavior, keep tests green, review, and gated commit. Use when the structure should improve but behavior must not change.
metadata:
origin: ECC
---