Any time a change deliberately skips scope to stay minimal (skip a case that can't happen yet, defer a generalization, leave a rough edge for a known reason), leave a one-line marker at the spot instead of just remembering it:
// DEBT: no pagination yet — fine while catalog is <500 items, revisit if it grows
# DEBT: hardcoded 3-retry limit, should read from config once multi-tenant lands
DEBT: <reason> — any comment syntax, always that exact token + colon + a reason. This
skill finds them; nothing else about how you write code needs to change.
What this skill does
- Find markers. In a git repo:
git grep -n "DEBT:"(respects.gitignore, skipsvendor/,node_modules/, binary files automatically). Outside a git repo:grep -rn "DEBT:" --exclude-dir={vendor,node_modules,.git}. - Attribute each hit. For tracked files,
git blame -L <line>,<line> --porcelain <file>to get commit sha, author, and date — best effort, skip silently if blame fails (uncommitted file, binary, etc.). - Diff against the existing ledger at
.claude/debt-ledger.md(create if absent). Match prior entries byfile:line+ marker text:- NEW — marker found now, not in the previous ledger.
- STILL OPEN — marker found now and was in the previous ledger (carry its original "first seen" date forward, don't reset it).
- RESOLVED — was in the previous ledger, marker no longer found in the code (comment removed or line changed) — move it to a "Resolved" section with today's date rather than deleting it, so the history of what got paid down is visible.
- Write the ledger. Overwrite
.claude/debt-ledger.mdwith:- A one-line summary count (
N open, M resolved) at the top. - An "Open" table sorted oldest-first:
file:line | reason | first seen | commit. - A "Resolved" table (most recent first, capped at the last 20 — older resolved entries can be found via git history on the ledger file itself, don't let this section grow unbounded).
- A one-line summary count (
- Report. Print the same summary counts to the conversation, and call out any entry open for a long time (no fixed threshold — use judgment: something first-seen months ago with no movement is worth flagging explicitly, not just left in the table).
Notes
- This is a harvesting/reporting skill only — it never edits the DEBT-marked code itself or removes markers. Paying down the debt is a separate, deliberate task.
- If
.claude/debt-ledger.mddoesn't exist yet and no markers are found either, say so plainly and stop — don't create an empty ledger file for a repo that isn't using the convention yet.