forge:refactor

Plan and execute structured code refactors with a gated run/worktree pipeline.

1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/Chulf58/FORGE --skill forge-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forge:refactor
Source: https://github.com/Chulf58/FORGE/tree/main/skills/refactor
Command: npx skills add https://github.com/Chulf58/FORGE --skill forge-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the planning and execution of structured code refactors with a repeatable run/worktree pipeline and gate-based approvals, increasing transparency and safety.

Core Features & Use Cases

  • Deterministic refactor runs: Create a dedicated run and a worktree, then apply changes only after human approval.
  • Gated governance: Use staged reviews and gates to ensure safety and traceability before applying refactors.
  • Extensible to targets: Scope can be any code area or file, driven by ARGUMENTS; supports rework once approved.

Quick Start

Invoke the refactor pipeline for a target area using the provided ARGUMENTS.

Frequently Asked Questions about forge:refactor

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

FAQPage Schema
How do I automate safe code refactors across a large codebase?

Automating safe code refactors requires a structured run and worktree pipeline that targets specific code areas, coordinating setup, review, and apply gates to ensure safety and traceability. This approach enforces explicit run creation and gated handoffs before applying changes.

What is a worktree pipeline for codebase refactoring?

A worktree pipeline for codebase refactoring is a structured process that creates a dedicated run and an isolated worktree for each task. Changes are planned and reviewed through staged approval gates before being applied, ensuring deterministic and traceable execution.

How do I set up gated reviews for an automated refactor pipeline?

Gated reviews for an automated refactor pipeline are established by enforcing staged approvals within the run lifecycle. You create a run, manage the worktree, and route changes through review gates that ensure human approval before any apply phase begins.

Can I scope an automated refactor to specific files or code areas?

You can scope an automated refactor to specific files or code areas by passing the target scope through ARGUMENTS. The pipeline supports any code area or file target, and allows for rework once the gated review is approved.

When do I need a dedicated run for code refactoring?

A dedicated run for code refactoring is needed when executing structured changes that require traceability and gated governance. It isolates the worktree setup and review process, ensuring changes are applied only after explicit human approval.

What are the limitations of automating refactors with a gated pipeline?

A key limitation of automating refactors with a gated pipeline is the enforced overhead: explicit run creation, worktree management, and staged review gates slow down execution. This approach prioritizes safety and traceability over rapid, unreviewed code changes.