# Grooming
<!--
ref: @protocol/grooming
type: protocol
tags: [hygiene, groom-op, meta, friction, scar-tissue, separation-of-concerns, maintenance]
aliases: [groom, grooming, process-grooming]
triggers: [groom, groom this, groom that, needs grooming, do grooming, that was rough, why was that so hard, this burned too much context, hard to find the right path, scar tissue, this is bloated, this is too thin, wrong shape, over-normalized, too many hops, the scripts are wrong, this loop is crusty, clean this up]
trigger_prompt: When a session burned more than the work was worth — repeated searches, a document that did not answer, instructions re-derived, scripts doing the wrong thing, a local setup that confused things — and someone asks to groom it. This is the general entry point for grooming any process at any scope; specific groomers for protocols, code and base context are routed from here.
category: core
last_reviewed: 2026-09-10
audience: [agent, agent-author, claude-code-user]
version: 8
updated_at: 2026-09-11T16:27:28.709Z
-->

Friction is a defect report. The general entry point for grooming any process at any scope — a rough research path, a script doing two jobs, a crusty loop, a confusing local setup — with area-specific groomers routed from it.

**This is the general entry point.** It grooms any process at any scope: a research path that felt rough, a script doing two jobs, a loop whose operating docs have crusted over, a local setup that keeps confusing sessions. The method below is complete on its own. Deeper, area-specific groomers are routed from the scope table — fetch one only when the scope calls for it.

**This is not refactoring.** Prose and process are executed by whoever meets them next, so an edit that would be cosmetic in code changes behaviour here, in sessions you will never see. That cuts both ways — it is why grooming is worth doing, and why it is done from evidence rather than from taste.

## The trace is the evidence

**Groom what was actually in the path, never what merely looks improvable.** The session's own trace is the defect report: what you fetched or ran, in what order, what you opened and abandoned, and what you ended up deriving anyway.

Three coordinates carry nearly all the signal:

- **Where you stopped searching and started guessing.** The highest-value point in any trace — it marks where the system ran out, and it is the one thing the system never records about itself.
- **What you paid for and did not use.** Loaded, fetched, or run; returned nothing.
- **What you re-derived that was already known somewhere.** The fact existed; the path to it did not.

A document that reads badly but was never in anyone's path is not a defect. The one you needed and could not find is — and it will not look wrong when you finally open it. **Without a trace you are redecorating: say so and stop.**

## Name the scope first

The first act of a groom is naming what is being groomed, because both the evidence and the disposal follow from it. Where an area has its own groomer, dispatch — do not re-derive it here.

| Scope | Evidence to read | Where it goes |
|---|---|---|
| A script, a repo's code, its conventions | the diff, the failing path, the scripts in play | **mechanism**, below — then the project's own code standards |
| A protocol, a knowledge base, what a session fetches | the fetch sequence; what loaded and went unused | `@protocol/groom-protocols` |
| Everything loaded before you type | harness config, memory index, tool schemas, listings | `@protocol/context-tuning` |
| A process, loop, or scheduled job | the run's own logs, plus the scripts it calls | **mechanism**, below |
| Local setup — config, paths, environment | what differed between the working and confused case | **mechanism**, below |
| Nothing exists yet to groom | many sessions, mined for what recurs | `@protocol/harvest` |

A groom that names no scope drifts into whatever its author already wanted to rewrite. A groom that finds a problem wider than its scope should say so and widen deliberately, never silently.

## The five shapes

Any instruction — a protocol, a README, a script's interface, a convention — maps a situation to an action. **There are five ways that mapping fails**, and every rough path is one of them. The list is closed on purpose: it derives from the failure modes of the mapping, not from a pile of incidents, so it should not grow.

| # | Shape | Signal | Disposal |
|---|---|---|---|
| 1 | **Misfired** | needed it and missed it; found it late or by luck — or it loaded and was irrelevant | the trigger does not match the situation: index by the symptom the reader arrives holding, not the topic the author had in mind, and fix discovery before touching prose |
| 2 | **Cost too much** | fetched whole, used one part; always loaded but rarely needed | bound it, split it, separate the record from the rule |
| 3 | **Didn't answer** | you read it and still guessed, re-derived, or searched again | write back precisely what you had to derive, and nothing more |
| 4 | **Was wrong** | contradicted by what you observed, or describes a system since changed | correct it and **delete the refuted text** — a superseded claim left standing at full weight reads as current |
| 5 | **Fired too many times** | three hops to assemble one answer; the same fact restated in several places | one canonical home, and routes to it |

Bloated is 2. Too thin is 3. Wrong-shaped is 1 or 5. **Name the number before proposing the edit** — most disagreements about a document are two people diagnosing different shapes.

## Mechanism outranks prose

Where a script, hook, job, or local setup sat in the path, groom it on its own axes: **does it do one job** (separation of concerns), **does it guard its own inputs**, and **is it doing work that belongs to a document — or asking a document to do work that belongs to it?**

**Construction over vigilance.** A document that asks readers to remember what a check could enforce has chosen the weaker instrument, and it decays: every reader pays attention until one of them does not. Rank the disposals:

1. A change that makes the failure **not expressible**.
2. A rule authored into the context that normal operations already load.
3. A warning in a document someone might read.

Reach for 3 only when 1 and 2 are genuinely unavailable, and say that you settled.

## Do not over-normalize

**Grooming's native bias is to split, route, and normalize — and that bias is grooming's own failure mode.** A system can be perfectly factored and impossible to navigate.

- **A route with one destination is not a route.** Inline it and delete the hop.
- **Normalize when there are two or more real consumers**, not because there might one day be.
- **Every hop costs a round-trip and a decision.** Splitting to save a little weight is a losing trade; the reader pays the latency and the choice.
- **Prefer fewer, better-shaped things over more, smaller ones.** Shape 5 is caused as often by eager normalizing as by careless duplication.

When a groom's output is mostly new artifacts, it has probably diagnosed shape 2 and prescribed shape 5.

## Making the edit

Grooming makes the change; it does not only file it. Sort by reversibility, then apply.

- **Auto-apply** — safe and reversible: demotions, added triggers or tags, deleting text already refuted elsewhere.
- **Confirm first** — less reversible: removals, rewrites of what a document *tells someone to do*, renames, interface changes.
- **Escalate** — beyond one pass: restructuring a domain, authoring something new. Flag it and route.

Discipline on every edit:

- **Name the reader and the question, or do not edit.** "This could be clearer" is taste. "Someone arriving with X could not get to Y" is a defect.
- **One shape per edit**, and use whatever concurrency guard the surface offers so a competing write fails loudly instead of clobbering.
- **Test on the read path.** Re-ask the original question the way a cold reader would arrive at it. An edit verified only by re-reading your own diff is not verified.
- **Prune the rule, keep the record.** Deleting a warning is safe exactly when the incident behind it is preserved somewhere queryable — route the record with `@protocol/memory-routing`. That separation is what lets a rulebook stay small while the evidence keeps growing.
- **Capture what you cannot fix now** — `@protocol/capture`. An unfixable finding is still a finding.

Leave a short record of the pass: what changed, what was deferred, what was flagged but not converted. **The next groom starts by reading the last one** — without that trail every pass re-discovers the same findings. Instances belong in that record, never in this file.

## Keeping this entry clean

This is the general entry point, so many sessions load it and its own defects multiply.

- **Nothing area-specific belongs here.** If a paragraph only makes sense for protocols, for code, or for one estate, it belongs in that groomer — `/search?q=tag:groom-op` lists them.
- **No dated incidents, no war stories, no worked examples.** The method only.
- **Before adding a shape, check that it is not an instance of one already here.** It nearly always is.
- **If this file outgrows roughly two screens, that is the defect** — grooming will have become a registry of everything ever groomed, which is the disease it exists to treat.

---

*Related: `@protocol/groom-protocols` · `@content/youtube/yifan-bth/cursor-windsurf-settings-to-5x-ais-output-quality-works-with-vs-code-too` · `@protocol/retro` · `@protocol/loop` · `@protocol/impulse-the-recurring-task`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*