add
Register a deferred decision in the debt registry. Trigger by judgment, not a marker scan, whenever a future reader would ask "why this way?": an unmade…
Write or refresh the `## Tech debt operations` section in CLAUDE.md so a team shares one source of truth for debt-ops disciplines and cached quality commands. Idempotent. Only the managed section changes; other sections are untouched. Invoked explicitly via /debt-ops:init (solo
$ npx -y skills add bcanfield/agentic-tech-debt --skill init --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/initContext preview
The summary Claude sees to decide when to auto-load this skill.
Write or refresh the `## Tech debt operations` section in CLAUDE.md so a team shares one source of truth for debt-ops disciplines and cached quality commands. Idempotent. Only the managed section changes; other sections are untouched. Invoked explicitly via /debt-ops:init (solo
name: init
description: Write or refresh the `## Tech debt operations` section in CLAUDE.md so a team shares one source of truth for debt-ops disciplines and cached quality commands. Idempotent. Only the managed section changes; other sections are untouched. Invoked explicitly via /debt-ops:init (solo users get the same content from the SessionStart inject).
disable-model-invocation: true
allowed-tools: Read, Write, Edit, Bash
# Hidden from `npx skills` discovery — this copy ships in the Claude Code plugin (uses ${CLAUDE_PLUGIN_ROOT}); the portable skills/ copy is the one for the skills CLI.
metadata:
internal: trueWrite or update a `## Tech debt operations` section in `./CLAUDE.md`. Idempotent — only the managed section changes.
TOPLEVEL=$(git rev-parse --show-toplevel)
REPO_HASH=$(printf '%s' "$TOPLEVEL" | shasum | cut -c1-12)
# Locate this repo's plugin cache. CLAUDE_PLUGIN_DATA is set in hook
# subprocesses but NOT in the skill's bash env, so glob the standard
# Claude Code plugin-data dirs and fall back to the legacy cache path.
CACHE_DIR=""
for D in \
${CLAUDE_PLUGIN_DATA:+"$CLAUDE_PLUGIN_DATA/cache/$REPO_HASH"} \
"$HOME/.claude/plugins/data"/debt-ops*/cache/"$REPO_HASH" \
"$HOME/.cache/debt-ops/cache/$REPO_HASH"; do
[ -d "$D" ] && { CACHE_DIR="$D"; break; }
done
LIST="$CACHE_DIR/feedback.list"
[ -n "$CACHE_DIR" ] && [ -f "$LIST" ] && cat "$LIST"
# Detected ADR/registry dirs (ADR 0006/0009). Fall back to the co-located
# defaults if the cache files aren't written yet.
ADR_DIR=$( [ -s "$CACHE_DIR/adr-dir" ] && cat "$CACHE_DIR/adr-dir" || echo "docs/adr" )
REGISTRY_DIR=$( [ -s "$CACHE_DIR/registry-dir" ] && cat "$CACHE_DIR/registry-dir" || echo "docs/debt" )
echo "adr-dir: $ADR_DIR"
echo "registry-dir: $REGISTRY_DIR"If the file doesn't exist, the SessionStart discovery prompt hasn't run yet. Tell the developer:
> No cached quality commands yet. Start a new session so I can detect them, then re-run /debt-ops:init.
…and stop.
Substitute `{{COMMANDS}}` with the cache contents verbatim, `{{ADR_DIR}}` with the detected `adr-dir`, and `{{REGISTRY_DIR}}` with the detected `registry-dir` (from step 1).
## Tech debt operations
<!-- this section is auto-managed by the debt-ops Claude Code plugin; safe to edit, run /debt-ops:init to regenerate -->
### Disciplines
1. The test for debt: would a future reader ask "why this way?" If yes, register via `/debt-ops:add` immediately — no prompt. This is judgment, not a marker scan: a `TODO`/`FIXME`/`HACK`/`XXX` is the obvious case, but an unmade decision, a stub, a loosened type, or a default picked "for now" all count even with no marker in the diff. Use `payoff_trigger: unknown` if unsure. Announce: `+1 entry: <slug> (drop?)`. Over-register freely; the developer drops with "drop it".
2. When making an architecturally significant change — a data model, public interface, security boundary, release pipeline, or a dep-manifest change that is a major-version bump or a *new* top-level dependency — draft an ADR under `{{ADR_DIR}}/` in Nygard format: a `# NNNN — Title` heading, `**Date:**` and `**Status:**` lines, then Context, Decision, Consequences, Alternatives, Payoff trigger. Create the directory if needed. Only draft an ADR when there are two credible alternatives; if you cannot list two, it is a comment, not an ADR. An ADR with a payoff trigger *is* deliberate debt — when you write one, also call `/debt-ops:add` so the registry entry mirrors the ADR (don't conclude "no markers, no debt").
3. Read entries under `{{REGISTRY_DIR}}/` before changing files they reference.
### Quality commands
These run after every edit under a 3 s budget per command. Edit freely; the plugin reads tolerantly. Lines starting with `#` are estimates/comments and are skipped at run time.
<!-- debt-ops:feedback v1 -->
{{COMMANDS}}
<!-- /debt-ops:feedback -->`charter updated: ./CLAUDE.md — disciplines + N quality commands`
(N = count of non-comment, non-blank lines inside the marker block.)
Catches AI-introduced tech debt at write-time Works with any coding agent. Any stack. Two decades of tech-debt research, distilled into a plugin and validated across dozens of codebases.
Repo: bcanfield/agentic-tech-debt
Register a deferred decision in the debt registry. Trigger by judgment, not a marker scan, whenever a future reader would ask "why this way?": an unmade…
Print a debt-ops health summary from the metrics log, covering registration rate, hook feedback action rate, ADR creation, and AI-authored share. Use when the…
Audit the debt registry, rank survivors by churn × Fowler quadrant, surface a top-N list, then walk paydown on user follow-up. Use when the user asks to review…
Register a deferred decision in the tech-debt registry. Trigger by judgment, not a marker scan, whenever a future reader would ask "why this way?": an unmade…
Write or refresh a "Tech debt operations" section in the project's AGENTS.md so the team shares one source of truth for debt-ops disciplines. Run ONLY when the…
Print a debt-ops health summary from the metrics log, covering registration rate, feedback action rate, ADR creation, and AI-authored share. Use when the user…