Skip to content
Skillpedia
Deploy & cloud (DevOps)280k · #377

orch-refine-code

What it does

This tool reorganizes your code to make it cleaner and easier to understand, without changing what it does. It ensures everything keeps working as it did before.

When to use it

  • ✓When you want to improve code organization.
  • ✓When there's repeated code that can be removed.
  • ✓When you want to remove code that is no longer used.

Skill link

https://github.com/affaan-m/ECC/blob/main/skills/orch-refine-code/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/affaan-m/ECC/blob/main/skills/orch-refine-code/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Refactor the NWS HTTP client code out of the poller.py file”

5 new skills a week. 1 minute to read.

How it works

The tool first checks if existing tests pass. Then, it reorganizes the code in small steps, testing after each change. Finally, it saves the changes if everything is working correctly.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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]
FAQ

What does 'behavior' of the code mean?

Behavior is what the code does, how it functions, and what results it produces. This tool ensures the final outcome doesn't change.

What are 'tests'?

Tests are automatic checks that ensure the code is working as expected. If a test fails, it means something in the code has been broken.

What is a 'commit'?

A commit is like saving a set of changes to the code. A 'gated commit' means the save only happens if all checks (tests) pass.

Details

Original description by the author

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.

repo: affaan-m/ECC

Popularity

GitHub stars
280k
Ranking position
#377
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills