Agent skill

Backprop: Bug-to-Spec Protocol

by JuliusBrussee in JuliusBrussee/cavekit

After a bug is found, traces its root cause and feeds a new testable invariant back into the project spec so the bug class can't recur.

MITAuto-check passedDevelopment

Install Backprop: Bug-to-Spec Protocol

skills CLI
$ npx skills add JuliusBrussee/cavekit --skill backprop -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install JuliusBrussee/cavekit backprop --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/JuliusBrussee/cavekit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/backprop .claude/skills/backprop && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
backprop
GitHub stars
1.1k
Token cost
~653 tokens
SKILL.md length
310 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

After a bug is found, traces its root cause and feeds a new testable invariant back into the project spec so the bug class can't recur.

  • Works in 6 steps: TRACE → ANALYZE → PROPOSE → …
  • Fixing a bug so the same class of bug can't recur
  • SKILL.md covers WHEN TO BACKPROP, SIX STEPS, WHAT MAKES A GOOD INVARIANT and WHEN NOT TO ADD §V, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

This skill runs on a test failure, a bug report, a production post-mortem, or an explicit request, and treats fixing the code alone as incomplete: the bug has to change the spec too, or it will happen again. It works through six steps - trace the exact file and line of the wrong behavior, ask whether a new invariant, a wrong interface claim, or a wrong task description explains it, draft the spec edit, write a failing test named after the new invariant, fix the code and confirm both that test and the full suite pass, then commit the spec edit, test and fix together.

A good invariant is testable in code, scoped to one behavior rather than a whole file, and stated as a positive rule where possible; a concrete example pairs a root cause such as a refund job running twice on retry with a one-line invariant requiring an idempotency key check before any charge reversal. Even when a bug is a one-off typo or caused by an external dependency and doesn't earn a new invariant, it still gets logged in the spec's bug history so a future bug with the same smell turns up a precedent.

The expected output of every run is a bug-log entry, usually a new invariant, a test file, a code fix, and one commit - no separate dashboards or log files beyond the spec document and git history.

When your agent uses it

  • Fixing a bug so the same class of bug can't recur
  • Writing a post-mortem after a production incident
  • Deciding whether a bug fix needs a new spec invariant

Example prompts

  • “A refund job ran twice on retry, trace it and backprop a fix.”
  • “This test just failed in the build - run the backprop protocol on it.”
  • “Write up the post-mortem invariant for yesterday's duplicate-charge incident.”

Requirements

  • A project spec file with bug-log and invariant sections

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. TRACE
  2. ANALYZE
  3. PROPOSE
  4. GENERATE TEST
  5. VERIFY
  6. LOG

What it can do on your machine

Read from SKILL.md and the folder at commit 7421e87. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Backprop: Bug-to-Spec Protocol loads about 653 tokens when it runs. Until then it costs about 76 tokens; SKILL.md has 310 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~76
When it runs · the whole SKILL.md, loaded when a task matches
~653

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from JuliusBrussee/cavekit at commit 7421e87, republished under its MIT licence (© JuliusBrussee). 310 words, ~653 tokens.

Download SKILL.mdSave it as .claude/skills/backprop/SKILL.md (or your agent's skills folder).
name
backprop
description
Bug → spec protocol. When a bug is found or a test fails, trace the cause, decide whether a new §V invariant would catch recurrence, append to §B. This is the one non-obvious thing SDD does that plan-then-execute doesn't. Triggers on test failure, bug report, post-mortem, or explicit user ask.

backprop — bug → spec

Plan-then-execute fixes the code & forgets. SDD fixes the code AND edits spec so recurrence is impossible. That edit is backprop.

WHEN TO BACKPROP

  • Test failed at /build verification.
  • User reports bug.
  • Post-mortem after production incident.
  • /check flags VIOLATE with root cause found.

SIX STEPS

1. TRACE

Read failure output / bug report. Find exact file:line of wrong behavior. Name root cause in one caveman sentence.

2. ANALYZE

Ask three questions:

  • Would a new §V invariant catch this class of bug? (most common: yes)
  • Is §I wrong — did spec claim shape the code cannot deliver? (sometimes)
  • Is §T wrong — did we build the wrong thing? (rare but real)
3. PROPOSE

Draft the spec change. Never skip §B; §V/§I/§T are case-by-case.

Template:

§B row: B<next>|<date>|<root cause>|V<N>
§V line: V<next>: <testable rule that would have caught it>

Example:

§B row: B3|2026-04-20|refund job ran twice on retry|V7
§V line: V7: ∀ refund → idempotency key check before charge reversal
4. GENERATE TEST

New invariant without test = lie. Add failing test first. Name test so it cites the invariant: TestV7_RefundIdempotent.

5. VERIFY

Fix code. Run test. Must pass. Run full suite. Must not regress.

6. LOG

Commit spec edit + test + code fix together. Commit msg: backprop §B.<n> + §V.<N>: <one-line cause>.

WHAT MAKES A GOOD INVARIANT

  • Testable in code (grep-able or assert-able).
  • Scoped to a behavior, not a file.
  • Stated positively when possible (! hold over ⊥ forbid).
  • References §I surface where it applies.

Bad: V8: code should be correct. Good: V8: ∀ pg_query ! params interpolated via driver, ⊥ string concat.

WHEN NOT TO ADD §V

  • Bug was purely mechanical typo with no class (i++ vs i-- in throwaway).
  • Fix is a one-time migration.
  • Root cause is external dep (upgrade deps instead, note in §C).

Still append §B entry — record that this failure mode was considered. Future bug with same smell → §B search shows precedent.

OUTPUT SHAPE

Every backprop run produces:

  1. §B entry (always).
  2. §V entry (usually).
  3. Test file (when §V added).
  4. Code fix.
  5. One commit.

No dashboards. No log files. SPEC.md + git is the full history.

© JuliusBrussee, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/backprop of JuliusBrussee/cavekit.

Open the folder on GitHubat commit 7421e87

Compare with similar skills

Backprop: Bug-to-Spec Protocol next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Backprop: Bug-to-Spec Protocol compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Backprop: Bug-to-Spec Protocol this skillJuliusBrussee/cavekit1.1k—~653Automated safety check: PassMIT
CI TriageMentra-Community/MentraOS2.4k—~582Automated safety check: PassApache-2.0
Root Cause Debuggingjsmastery-pro/skills1.4k—~1.8kAutomated safety check: NotesMIT
Superpowers Systematic Debuggingchristopherarter/superpowers-reasonix102—~2kAutomated safety check: PassMIT
Minimal Code Fixcobusgreyling/loop-engineering11k1 repos~345Automated safety check: NotesMIT
CI Fixwarpdotdev/oz-skills825—~790Automated safety check: PassMIT

Similar skills

  • CI Triage

    Mentra-Community/MentraOS

    Triage failing GitHub PR checks: list failures with gh, fetch capped Actions logs, skip non-Actions checks, and summarize root cause.

    2.4k GitHub stars~582 tokensUpdated today
    DevelopmentAuto-check passed
  • Root Cause Debugging

    jsmastery-pro/skills

    Runs a reproduce, localize, hypothesize, test, fix and verify loop to find a bug's root cause, applies the minimal fix and hands off a regression test.

    1.4k GitHub stars~1.8k tokensUpdated 2 mo ago
    DevelopmentAuto-check: notes
  • Superpowers Systematic Debugging

    christopherarter/superpowers-reasonix

    Any bug, failing or flaky test, or surprise behavior?. An agent skill from christopherarter/superpowers-reasonix.

    102 GitHub stars~2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Minimal Code Fix

    cobusgreyling/loop-engineering

    Makes the smallest code change that fixes one well-scoped problem, such as a CI failure, review comment or typo, without refactoring anything unrelated.

    11k GitHub starsUsed in 1 repo~345 tokens
    DevelopmentAuto-check: notes
  • CI Fix

    warpdotdev/oz-skills

    Diagnose and fix GitHub Actions CI failures. An agent skill from warpdotdev/oz-skills.

    825 GitHub stars~790 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Investigate

    tobihagemann/turbo

    Systematically investigate bugs, test failures, build errors, performance issues, or unexpected behavior by cycling through characterize-isolate-hypothesize-test steps.

    407 GitHub starsUsed in 1 repo~3.2k tokens
    DevelopmentAuto-check passed

More from JuliusBrussee/cavekit

All 8 skills in this repo
  • Caveman Spec Compression

    JuliusBrussee/cavekit

    Compresses SPEC.md writes and spec-referencing prose into terse, symbol-heavy fragments that drop articles, filler and hedging while keeping facts intact.

    1.1k GitHub stars~721 tokensUpdated 1 mo ago
    Auto-check passed
  • Spec Drift Check

    JuliusBrussee/cavekit

    Read-only detector that compares SPEC.md with the code and reports invariant, interface and task drift grouped by severity, without changing anything.

    1.1k GitHub stars~666 tokensUpdated 1 mo ago
    Auto-check passed
  • Adversarial Spec Review

    JuliusBrussee/cavekit

    Builds a skeptical reviewer grounded in the codebase and research notes to try to refute a spec before any code is written, citing file:line evidence and ending in a go or no-go gate.

    1.1k GitHub stars~959 tokensUpdated 1 mo ago
    Auto-check passed
  • Deepen Module Design

    JuliusBrussee/cavekit

    Scans the code a spec touches for its shallowest module, then proposes a refactor that hides more behind a smaller interface without changing behavior.

    1.1k GitHub stars~1k tokensUpdated 1 mo ago
    Auto-check passed
  • Grill Before Spec

    JuliusBrussee/cavekit

    Interrogates a vague idea one question at a time, recommending an answer each round and recording results as goals and constraints before a spec is written.

    1.1k GitHub stars~812 tokensUpdated 1 mo ago
    Auto-check passed
  • Research

    JuliusBrussee/cavekit

    Gather external knowledge the spec needs and distill it into §R — the durable research log — so build grounds in facts instead of hallucinating library behavior.

    1.1k GitHub stars~782 tokensUpdated 1 mo ago
    Auto-check passed

Questions about Backprop: Bug-to-Spec Protocol

What does Backprop: Bug-to-Spec Protocol do?

After a bug is found, traces its root cause and feeds a new testable invariant back into the project spec so the bug class can't recur. This skill runs on a test failure, a bug report, a production post-mortem, or an explicit request, and treats fixing the code alone as incomplete: the bug has to change the spec too, or it will happen again. It works through six steps - trace the exact file and line of the wrong behavior, ask whether a new invariant, a wrong interface claim, or a wrong task description explains it, draft the spec edit, write a failing test named after the new invariant, fix the code and confirm both that test and the full suite pass, then commit the spec edit, test and fix together.

When should I use Backprop: Bug-to-Spec Protocol?

Backprop: Bug-to-Spec Protocol fits situations like: fixing a bug so the same class of bug can't recur; writing a post-mortem after a production incident; deciding whether a bug fix needs a new spec invariant.

How do I install Backprop: Bug-to-Spec Protocol in Claude Code?

Run `npx skills add JuliusBrussee/cavekit --skill backprop -a claude-code`. Or copy the skill folder (skills/backprop in JuliusBrussee/cavekit) into .claude/skills/backprop in your project. Claude Code loads it when a task matches its description.

How do I install Backprop: Bug-to-Spec Protocol in Codex?

Run `npx skills add JuliusBrussee/cavekit --skill backprop -a codex`. Or copy the skill folder (skills/backprop in JuliusBrussee/cavekit) into .agents/skills/backprop in your project. Codex loads it when a task matches its description.

Can I use Backprop: Bug-to-Spec Protocol in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add JuliusBrussee/cavekit --skill backprop -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/backprop, .gemini/skills/backprop, .github/skills/backprop and .opencode/skills/backprop in your project.

What does Backprop: Bug-to-Spec Protocol need to run?

SKILL.md names no scripts, command-line tools or credentials: Backprop: Bug-to-Spec Protocol is instructions for the agent only. Our summary lists: A project spec file with bug-log and invariant sections.

Does Backprop: Bug-to-Spec Protocol access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Backprop: Bug-to-Spec Protocol safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Backprop: Bug-to-Spec Protocol use?

Backprop: Bug-to-Spec Protocol is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Backprop: Bug-to-Spec Protocol use?

About 653 tokens (SKILL.md is roughly 2.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Backprop: Bug-to-Spec Protocol?

Skills that share tags, products or a category with Backprop: Bug-to-Spec Protocol: CI Triage (Mentra-Community/MentraOS, 2.4k stars), Root Cause Debugging (jsmastery-pro/skills, 1.4k stars), Superpowers Systematic Debugging (christopherarter/superpowers-reasonix, 102 stars) and Minimal Code Fix (cobusgreyling/loop-engineering, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Backprop: Bug-to-Spec Protocol?

JuliusBrussee (a GitHub user) maintains it in JuliusBrussee/cavekit, which has 1,149 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on August 14, 2026.

Source: JuliusBrussee/cavekit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.