grep-the-types-statics-firstlisted
Install: claude install-skill serhiy-bzhezytskyy/contrib-receipts
# Grep the type's statics first
## Purpose
Given "apply these defaults without clobbering what the caller set", the obvious move
is a loop: iterate the names, check whether the target already has each one, set it if
not. Eight lines, correct, passes.
And in a codebase that has existed for fifteen years, that operation has a name, a
one-line call, and edge-case handling you didn't write. The hand-rolled version costs
three ways: it is longer, it duplicates semantics that can now drift apart, and — the
expensive one — it signals to the reviewer that you didn't look. Reviewers read
unfamiliarity with their own API as a proxy for care, and increasingly as a tooling
signature.
The check is one grep. It is cheaper than the code it replaces.
## When to use
- Before writing any loop or helper that manipulates a type the project owns.
- Especially for these verbs: merge, default, override, unwrap, flatten, normalize,
convert, copy-with-change, wrap.
- When a reviewer asks "why not use X?" — treat it as a class of miss, not one miss,
and sweep the rest of the diff for siblings.
## When NOT to use
Don't stall on it. Two greps and a look at the type's public surface is the whole
budget; if nothing turns up, write the loop and say in the PR that you looked.
## The practice (checklist)
- [ ] Read the type's own factory/utility surface:
`grep -n "public static" path/to/TheType.java`
- [ ] Search the codebase for the verb, in the house's vocabulary:
`grep -rn "wrapD