tidy-first

tidy-first is a skill for Claude Code, Codex from mfmezger/ai_agent_dotfiles. It costs 85 tokens per session (1,397 once invoked), scanned A, original, MIT.

A coding workflow based on Kent Beck's Tidy First approach, which separates code rearrangement from behavior changes.

In plain words
What is it for?
It guides renaming, extracting methods, moving code, reorganizing files, and separating those changes from logic updates.
Why use it?
It makes code changes easier to review by keeping structural refactoring separate from features and bug fixes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It guides renaming, extracting methods, moving code, reorganizing files, and separating those changes from logic updates.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mfmezger/ai_agent_dotfiles/tidy-first
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mfmezger/ai_agent_dotfiles --skill tidy-first
Clone the repo
git clone --depth 1 https://github.com/mfmezger/ai_agent_dotfiles

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tidy-first

README.md
[![agentmods](https://agentmods.dev/badge/skills/mfmezger/ai_agent_dotfiles/tidy-first/github.svg)](https://agentmods.dev/skills/mfmezger/ai_agent_dotfiles/tidy-first)
Your own site
<a href="https://agentmods.dev/skills/mfmezger/ai_agent_dotfiles/tidy-first"><img src="https://agentmods.dev/badge/skills/mfmezger/ai_agent_dotfiles/tidy-first/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tidy-first

Your own site · 80×15
<a href="https://agentmods.dev/skills/mfmezger/ai_agent_dotfiles/tidy-first"><img src="https://agentmods.dev/badge/skills/mfmezger/ai_agent_dotfiles/tidy-first.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,397 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00085 $0.01397
Opus 5 $0.00043 $0.00698
Sonnet 5 $0.00017 $0.00279
Haiku 4.5 $0.00009 $0.00140

Measured 8d ago against content hash e554635f1ce4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

tidy-first scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

shared/skills/tidy-first/SKILL.md · 177 lines

How it starts

The opening of the file, as written. The whole thing — 177 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Tidy First

Follow Kent Beck's "Tidy First" approach by strictly separating structural changes from behavioral changes in all development work.

Source

This skill is adapted from the community skill snrsw-dotfiles-tidy-first on the LobeHub Skills Marketplace.

The instructional content below is the original skill's guidance, lightly reformatted for this dotfiles repo. Marketplace install/registration steps from the upstream page are intentionally omitted — this skill ships directly via shared/skills/ and is synced to each tool by scripts/sync-skills.sh.

Core Principle

Separate all changes into two distinct types:

  1. Structural changes — rearranging code without changing behavior:

    • Renaming variables, functions, classes
    • Extracting methods or functions
    • Moving code to different files or modules
    • Reorganizing code structure
    • Improving code organization
  2. Behavioral changes — adding or modifying actual functionality:

    • Adding new features
    • Fixing bugs
    • Changing business logic
    • Modifying functionality

Golden Rules

Never mix change types

  • Never mix structural and behavioral changes in the same commit.
  • Each commit is either purely structural OR purely behavioral.
  • This makes code review easier and debugging simpler.

Structural changes first

  • When both kinds of change are needed, always do the structural changes first.
  • Tidy the code before adding new behavior.
  • Prepare the structure to receive new functionality.

Validate structural changes

  • Validate that structural changes do not alter behavior.
  • Run all tests before making the structural change.
  • Run all tests after making the structural change.
  • Tests must pass with the same results before and after. If behavior changed, it was not a pure structural change.

Read the full file on GitHub · 177 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 177 lines · 85 tokens per session scan A e554635f1ce4

Subscribe to this mod's changes

tidy-first is a skill published in the GitHub repository mfmezger/ai_agent_dotfiles (5 stars, last pushed 1mo ago), licensed MIT. It adds 85 tokens to every session and 1,397 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

embedded-dev

Use when developing firmware on ESP32/STM32/RP2040/nRF52, experiencing DMA overflow, SPI timeout, LCD blank display, frame corruption, GPIO conflicts, sensor reading errors, Wi-Fi disconnect, or needing driver configuration, hardware debugging, display/GUI setup, protocol implementation, serial monitoring. Use even if…

lhbsaa/embedded-dev-skill · 93 tokens

embedded-dev

Guide for embedded systems development on ESP32, STM32, RP2040, nRF52 chips. Use this skill whenever the user mentions embedded systems, firmware development, MCU programming, hardware drivers, sensors, LCD displays, IMU devices, SPI/I2C/UART interfaces, compilation, debugging, remote monitoring, Wi-Fi/BLE/MQTT…

lhbsaa/embedded-dev-skill · 131 tokens

embedded-gui-feedback

Use for LCD/GUI projects after verification passes - captures display via camera, analyzes layout/font/color, detects display issues.

lhbsaa/embedded-dev-skill · 28 tokens

embedded-brainstorming

Use before any embedded development - explores hardware requirements, confirms configuration, validates feasibility, saves design spec.

lhbsaa/embedded-dev-skill · 25 tokens

embedded-driver-design

Use when hardware configuration confirmed - creates detailed implementation plan with bite-sized tasks, exact file paths, complete code steps.

lhbsaa/embedded-dev-skill · 26 tokens

embedded-implementation

Use when implementation plan is ready - executes plan task-by-task with two-stage review (hardware spec then MISRA C).

lhbsaa/embedded-dev-skill · 28 tokens