Skip to content
Back to skills

Tidy

ASecurity

Propose small, behaviour-preserving cleanups for the code you just changed, and commit each separately from feature work (Kent Beck's "Tidy First?")

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 27, 2026
ai-agentsgobashrefactoringgit

Security analysis

A100/100

Scanned November 27, 2026

npx -y skills add John99101/claude-code-project-template --skill tidy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tidy?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tidy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/john99101-tidy/badge)](https://www.skillsdirectory.com/skills/john99101-tidy)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tidy
description: Propose small, behaviour-preserving cleanups for the code you just changed, and commit each separately from feature work (Kent Beck's "Tidy First?")
argument-hint: "[path | last change]"
disable-model-invocation: true
allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git add:*), Bash(git commit:*), Bash(git grep:*), Bash(git restore:*)
---

Scope: $ARGUMENTS (default: the files changed in the working tree, or in the last commit if the tree is clean)

AI-assisted code tends to grow by copy-paste rather than refactoring (GitClear measured refactored lines falling from 24% to under 10% of changes while copy-pasted lines rose). Tidyings are the small fix: tiny structural improvements, each in its own commit, kept apart from behaviour changes so reviewers can skim them.

## 1. Find candidates

Look only at the scoped files and their direct neighbours, never the whole repo. Good tidyings:
- duplicated code that already exists elsewhere (`git grep` for the same logic or name) → reuse or extract one helper;
- unclear names; magic numbers → named constants;
- guard clauses instead of deep nesting; dead code and unused imports;
- one function doing two things → split;
- consistent ordering and grouping of related code.

## 2. Propose

List 3–7 tidyings, each with: what, where (`file:line`), why it helps, and risk (low / medium). Ask which to do (multi-select). Skip anything that changes behaviour; that's a feature or a fix, not a tidying.

## 3. Apply one at a time

For each chosen tidying:
1. Make the change, nothing else.
2. Run the project's tests (CLAUDE.md "Before you say a task is done"). If they fail, undo this tidying only (`git restore` the files) and report why.
3. Commit it alone, as `tidy: <what>` (or the project's style for refactors), never mixed with feature changes. If there are uncommitted feature changes, ask first whether to commit those before tidying.

End with the list of tidy commits. `/pr` lists them under "Tidyings (no behaviour change)".

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.