FreeGitHubCoding
Orch Refine Code
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.
affaan-m on GitHub
Curated by PromptsEdge from a public repo · MIT license. All credit goes to the author.
What is this skill?
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
- Distinguish from siblings: if behavior is meant to change at all, this is the
What’s inside
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
- Run the
orch-pipelineengine with the settings above. - For dead-code / duplication sweeps, delegate to the
refactor-cleaneragent (it runs knip / depcheck / ts-prune and removes safely). - Stop at Gate 1 (restructure plan) and Gate 2 (pre-commit).
- 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]
Install this skill
- 1
Get the skill — it’s free
Use the Get this skill panel. Unlocked skills stay in My skills. - 2
Download or clone the files
Download the zip, or clone the repo and copy theskills/orch-refine-codefolder. - 3
Put it where your agent looks for skills
For Claude Code, use your personal skills folder (every project) or a project’s own folder:~/.claude/skills/orch-refine-code/SKILL.md # all projects .claude/skills/orch-refine-code/SKILL.md # this project only
- 4
Just ask
No command needed. The agent reads the skill’s description and loads it on its own when your request matches.
SKILL.md frontmatter
What your agent reads to decide when to load this skill.
--- 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. ---
Files
This skill lives in a public GitHub repo. Browse the files on GitHub ↗
Related skills
View all →- Windows Desktop E2eFreeE2E testing for Windows native desktop apps (WPF, WinForms, Win32/MFC, Qt) using pywinauto and Windows UI Automation. Use when writing E2E tests for a Windows native desktop app with pywinauto or UI Automation.
- X ApiFreeX/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.
- Skill CreatorFreeCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
- Workspace Surface AuditFreeAudit the active repo, MCP servers, plugins, connectors, env surfaces, and harness setup, then recommend the highest-value ECC-native skills, hooks, agents, and operator workflows. Use when the user wants help setting up Claude Code or understanding what capabilities are actually available in their environment.