Refactor
TDD Refactor Phase - Improve code while keeping tests green using Simple Design Rules and APP mass
Install
npx skills add marcoemrich/agentic_coding_lab --skill refactorgit clone --depth 1 https://github.com/marcoemrich/agentic_coding_lab.git /tmp/agentic_coding_lab
mkdir -p ~/.claude/skills
cp -r /tmp/agentic_coding_lab/experiments/runs/2026-05-25_08-16-22_claim-office-example-mapping_v5.1-testlist-scope-fix-oc_opus-4-7-portkey/.opencode/skills/refactor ~/.claude/skills/refactorPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# TDD Refactor Phase You are now in the **Refactor Phase** of TDD. Follow these instructions to improve the code while keeping tests green. ## Your Mission Guide developers through the Refactor phase of TDD by helping them: 1. **MUST attempt at least one refactoring** - mandatory, not optional 2. Apply the Four Rules of Simple Design in priority order 3. Use Absolute Priority Premise (APP) to measure code improvements 4. Improve code quality while keeping all tests green 5. Document refactoring decisions and mass calculations 6. If no improvement is possible, explicitly document why ## Context: $ARGUMENTS ## Refactor Phase Rules - **Mandatory refactoring attempt**: MUST try at least one improvement - **Tests must stay green**: Never break passing tests - **Apply Simple Design Rules**: In priority order (1 -> 2 -> 3 -> 4) - **Calculate APP mass**: Before and after refactoring - **Document decisions**: Explain improvements or why none were possible - **Naming is first priority**: Evaluate if function name still fits its purpose ### Simple Design Rules (Priority Order) #### Rule 1: Tests Pass - **Highest priority** - never compromise working code - All tests must pass before and after refactoring - If tests fail, revert and try different approach #### Rule 2: Reveals Intent - **Second priority** - clarity trumps everything else (including APP) - Use meaningful names for variables, functions, classes - Structure code to be self-documenting
Details
- Skill name
refactor- Repository
- marcoemrich/agentic_coding_lab
- Path
experiments/runs/2026-05-25_08-16-22_claim-office-example-mapping_v5.1-testlist-scope-fix-oc_opus-4-7-portkey/.opencode/skills/refactor/SKILL.md- License
- MIT
- Repo updated
- 13 November 2026
FAQ
What does the Refactor skill do?
TDD Refactor Phase - Improve code while keeping tests green using Simple Design Rules and APP mass
How do I install the Refactor skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add marcoemrich/agentic_coding_lab --skill refactor. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Refactor popular?
It lives in marcoemrich/agentic_coding_lab, which has 49 GitHub stars and 1 forks.
Related skills
Build Overview
49marcoemrich/agentic_coding_lab
Generates an experiment-overview snapshot of all research questions under research/reports/. Invoke when a new point-in-time report across all RQs should be produced.
Exact Coding Baseline Export
49marcoemrich/agentic_coding_lab
Mint a new YYYY-MM-DD-exact-coding-baseline snapshot under research/workflow-dev/export/. Detects the current best correctness- oriented workflow from research/workflow-dev/workflow-construction.md (or takes an explicit source-workflow argument) and transforms it from a lab workflow into a consumer-ready one on three axes: strips lab-only measurement content, re-enables human-in-the-loop checkpoints, and converts auto-loading config into an explicitly-invoked skill. Supports both promoted EXACT Coding lines: Opus/Hybrid and SOL/Predictive TDD. Exports Claude Code, pi, OpenCode, cursor-agent an
Green
49marcoemrich/agentic_coding_lab
TDD Green Phase - Implement minimal code to make the failing test pass
Data 360 Implementation Advisor
24forcedotcom/partner-ecosystem-agentic-kit
Use for Data 360 architecture, data-kit workflow, scratch entitlement, metadata packageability, activation ordering, and partner-solution integration decisions. Owns Data 360 architecture and implementation patterns that affect partner solutions and packaging.
Development Environment
24forcedotcom/partner-ecosystem-agentic-kit
Route and synthesize decisions about PBO Dev Hubs, namespaces, scratch org shape, persistent development orgs, demos, trials, provisioning, developer access, and environment lifecycle. Use when a partner asks which Salesforce org or environment should perform a development, test, demo, packaging, or customer-validation job.
Project Architecture
10Jithnkn/project-architecture
Use this skill whenever the user wants to start a new software/app project, plan or review its architecture, or set up agent context files (AGENT.md) for a codebase. Trigger it whenever the user mentions "architecture", "project scope", "PRD", "monolith", "modular monolith", "AGENT.md", "CLAUDE.md", scaffolding a new project's folder structure, or asks how to organize/structure a codebase before or during building it — even if they don't use those exact words but describe wanting to plan out a new app, a new module, or how a codebase should be laid out. Also use it when the user is partway thr
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.