refactorpass

Automate behavior-preserving code cleanup and refactoring in active pull request branches.

2|Updated May 10, 2026
One-click install
npx skills add https://github.com/loomantix/codex-platform --skill refactorpass
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactorpass
Source: https://github.com/loomantix/codex-platform/tree/main/.codex/skills/refactorpass
Command: npx skills add https://github.com/loomantix/codex-platform --skill refactorpass

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill addresses the accumulation of technical debt and messy code in pull requests by automating a structured, behavior-preserving cleanup pass before adversarial review.

Core Features & Use Cases

  • Structured Cleanup Matrix: Executes three distinct lanes covering simplicity/DRY, correctness-preserving improvements, and convention/API alignment.
  • Context-Aware Validation: Performs pre-flight checks to ensure sufficient context window headroom and verifies branch state before applying changes.
  • Use Case: Use this before a deep code review to automatically collapse awkward control flow, remove dead code, and align new changes with repository conventions, ensuring the reviewer focuses on logic rather than style.

Quick Start

Run the refactorpass skill on the current open draft pull request to perform a structured cleanup of the recent changes.

Frequently Asked Questions about refactorpass

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate code cleanup on a pull request branch?

Automated code cleanup applies a structured, behavior-preserving matrix to your pull request branch. It removes dead code, aligns conventions, and collapses awkward control flow while ensuring non-breaking modifications before review.

What is behavior-preserving refactoring and when do I need it?

Behavior-preserving refactoring systematically improves code quality without changing its functional output. You need it when a pull request accumulates technical debt, ensuring reviewers focus on logic rather than style or messy control flow.

Can I run automated refactoring on my local Git environment?

Yes, automated refactoring requires integration with your local Git environment. It performs pre-flight context checks to verify branch state and sufficient context window headroom before safely applying any cleanup modifications.

What is the best way to remove dead code before a code review?

The best way to remove dead code before a review is executing a three-lane cleanup matrix covering simplicity, correctness-preserving improvements, and API alignment. This ensures systematic, non-breaking technical debt removal.

Does automated PR cleanup modify my code's external behavior?

Automated PR cleanup is explicitly behavior-preserving, meaning it applies non-breaking modifications to align conventions and remove dead code without altering the functional output or logic of your recent changes.

What are the limitations of automated code refactoring passes?

Automated code refactoring passes require sufficient context window headroom and a verified branch state to function properly. The process is strictly limited to pre-defined cleanup matrices, meaning it cannot handle complex, logic-altering refactoring.