Skills DirectoryCurated open-source Skills from GitHub

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-code
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

  1. Phase 01Confirm tests are green

    Before touching code, confirm the relevant tests exist and pass; add characterization tests first if coverage is thin.

  2. Phase 02Plan the restructure

    Plan the restructure with the orch-pipeline engine and stop at Gate 1 for approval.

  3. 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).

  4. Phase 04Review

    Run a code review on the behavior-neutral diff.

  5. Phase 05Gated commit

    Stop at Gate 2 for confirmation, then commit with a refactor: prefix.

Permissions (summarised from SKILL.md)

CapabilityNeededDetails
File writesRequiredRestructures code across multiple files and adds characterization tests when needed.
Command executionRequiredRuns the test suite, tools such as knip, depcheck and ts-prune, and git commit.
Network outboundNot requiredThe skill does not call for network access.

SKILL.md frontmatter (YAML)

SKILL.md frontmatter (YAML)commit db7f2a6
---
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
---

Related skills

A rule scan cannot catch every risk. Read this skill's SKILL.md and check its permissions before installing.