tidy-first

Separate structural cleanup from behavioral code changes in commits.

Updated May 17, 2022
One-click install
npx skills add https://github.com/kanade0404/dotfiles --skill tidy-first-kanade0404
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tidy-first
Source: https://github.com/kanade0404/dotfiles/tree/main/.opencode/skills/tidy-first
Command: npx skills add https://github.com/kanade0404/dotfiles --skill tidy-first-kanade0404

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents structural cleanup from being mixed with behavioral changes, making refactors, bug fixes, and feature work easier to review, revert, and bisect.

Core Features & Use Cases

  • Change Classification: Distinguishes structural edits like rename, extract, inline, guard clauses, dead code removal, and ordering from behavior-changing edits.
  • Tidy-First Workflow: Decides whether cleanup is needed first, then performs only the cleanup before handing control back for the actual feature or fix.
  • Commit Discipline: Recommends one tidy change per commit and provides guidance for commit messages and hook-based enforcement.
  • Use Case: Before implementing a new feature in messy code, use this Skill to clean up the smallest necessary parts first, commit that cleanup separately, and then continue with the behavior change.

Quick Start

Apply the tidy-first skill to this change, decide whether structural cleanup is needed, and if so complete only that cleanup before any behavior-changing edits.

Frequently Asked Questions about tidy-first

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

FAQPage Schema
How do I separate code refactoring from feature changes in my commits?▼

Tidy-first workflow enforces strict commit discipline by requiring one structural edit per commit, keeping cleanup commits isolated from behavioral changes for easier review, revert, and bisect.

What is the tidy-first approach to code review and refactoring?▼

Tidy-first is a refactoring approach that classifies code edits as either structural cleanup or behavioral changes, performing structural tidying first to make subsequent feature work easier to review.

How do I enforce one structural change per commit during bug fixes?▼

You can enforce one structural change per commit by using hook-based commit advice and following commit-message guidance that separates structural tidying from behavior-changing edits during bug fixes.

Does structural cleanup before feature work apply to dead code removal and guard clauses?▼

Yes, structural cleanup applies to dead code removal, guard clauses, renames, extraction, inlining, and ordering changes, isolating these structural edits before any behavior-changing feature work begins.

When should I not mix structural cleanup with behavioral code changes?▼

You should never mix structural cleanup with behavioral code changes when you need to maintain clear commit history for bisecting bugs, reverting features, or simplifying code review follow-ups.