refactor

Plan structural refactors as commit-grain tasks with green tests.

181|29|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/iusztinpaul/squid --skill refactor-iusztinpaul
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor
Source: https://github.com/iusztinpaul/squid/tree/main/skills/refactor
Command: npx skills add https://github.com/iusztinpaul/squid --skill refactor-iusztinpaul

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Plan a refactor as an ordered, commit-grain Tasks Plan with structural acceptance criteria (test suite green at every step, no behaviour diff, named module/coupling invariants). Output is a feature-shaped plan that /night can execute end-to-end. Trigger when the user says "/refactor", asks "plan a refactor of X", "extract Y from Z", "split this module", "rename across the codebase", or describes a structural change with no user-visible feature behind it.

Core Features & Use Cases

  • The planner produces a Tasks Plan composed of commit-grain tasks, each with acceptance criteria that guarantee tests stay green and the overall behaviour remains unchanged.
  • It enables end-to-end execution via /night, providing a clear hand-off between planning, execution gates, and PR workflow for structural changes.
  • It supports triggers based on natural-language prompts to initiate planning of refactors such as module extraction, renames, or dependency cleanups.

Quick Start

Say /refactor with your goal to generate a deterministic, commit-grain Tasks Plan that keeps main green.

Frequently Asked Questions about refactor

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

FAQPage Schema
How do I plan a code refactor without breaking existing tests?

To plan a code refactor without breaking tests, you generate an ordered, commit-grain Tasks Plan where each step includes structural acceptance criteria that keep the test suite green. This ensures tasks are reversible and behavior remains unchanged throughout the process.

What is the best way to extract a module from a large codebase safely?

The best way to extract a module safely is to sequence the structural changes into commit-grain tasks with explicit acceptance criteria. This approach documents coupling invariants and verifies the public API remains unchanged after every task.

Can I use this approach for renaming modules across the codebase?

Yes, you can use this planning approach for renaming modules across the codebase. It applies to non-behavioral structural changes like renames and layer cleanups, ensuring the main branch stays green and the overall behavior remains unchanged.

How do I create a step by step plan for software modularization?

You create a step by step plan for software modularization by triggering the planner with your structural goal, which outputs a deterministic, feature-shaped Tasks Plan. Each commit-grain task includes a definition of done and acceptance criteria to guarantee safe execution.

When should I avoid using a commit-grain task plan for refactoring?

You should avoid using a commit-grain task plan for refactoring when the change involves user-visible features or behavioral differences. This planning approach is specifically designed for non-behavioral structural changes where the public API remains unchanged.