backpropagation

backpropagation is a skill for Claude Code, Codex from LucasDuys/forge. It costs 27 tokens per session (2,400 once invoked), scanned A, original, MIT.

A workflow that traces a runtime bug back to a missing or unclear requirement in the specification, then updates the specification and creates a regression test.

In plain words
What is it for?
Use it with a bug report or failing test to identify the affected requirement, close the specification gap, generate a test, and record the correction.
Why use it?
Fixing one bug does not prevent it from returning if the expected behavior was never written down or tested. This process records the lesson for future work.

Skill for Claude CodeCodex

Part of the forge plugin — 10 skills, 13 commands, 9 agents, 3 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lucasduys/forge/backpropagation
Any agent
npx skills add LucasDuys/forge --skill backpropagation
Clone the repo
git clone --depth 1 https://github.com/LucasDuys/forge

Made for: Claude Code, Codex.

Or install forge, the plugin that ships this one along with the rest of its 10 skills, 13 commands, 9 agents, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for backpropagation

README.md
[![agentmods](https://agentmods.dev/badge/skills/lucasduys/forge/backpropagation.svg)](https://agentmods.dev/skills/lucasduys/forge/backpropagation)
Your own site
<a href="https://agentmods.dev/skills/lucasduys/forge/backpropagation"><img src="https://agentmods.dev/badge/skills/lucasduys/forge/backpropagation.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,400 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00027 $0.02400
Opus 5 $0.00014 $0.01200
Sonnet 5 $0.00005 $0.00480
Haiku 4.5 $0.00003 $0.00240

Measured 4d ago against content hash f61d3498eda0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

backpropagation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/backpropagation/SKILL.md · 223 lines

How it starts

The opening of the file, as written. The whole thing — 223 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Backpropagation Skill

You are running the Forge backpropagation workflow. Your job is to trace a runtime bug back to a specification gap, update the spec to close that gap, generate a regression test, and log the correction for systemic pattern detection.

Inputs

You will receive:

  • Bug description: Natural-language description of the bug, or test failure output + test source code (from --from-test mode)
  • Test file path (optional): Path to the failing test, if --from-test was used
  • Test source code (optional): Contents of the failing test file
  • Spec files: List of spec files in .forge/specs/

Workflow

Step 1: TRACE — Which spec?

Find the spec and requirement that should have prevented this bug.

  1. Read all spec files in .forge/specs/. For each spec, extract:

    • Domain name (from frontmatter)
    • All R-numbered requirements and their acceptance criteria
    • The linked_repos field (to know which repos are involved)
  2. Analyze the bug description (and test failure output if available) to determine:

    • What component or feature is affected?
    • What behavior went wrong?
    • What was the expected behavior?
  3. Match the bug to the most relevant spec and requirement:

    • Use keyword matching between the bug description and requirement names/descriptions
    • Use code context: if the bug mentions specific files, endpoints, or functions, grep the spec for those references
    • If --from-test was used: read the test source code to understand which feature it tests, cross-reference with spec requirements
  4. If no spec appears to cover this area at all, note this as a potential "missing requirement" gap and pick the closest spec by domain.

  5. Present your finding to the user:

    Traced to: spec-{domain}.md > R{NNN}: {requirement name} Reasoning: {why this requirement is the match}

Step 2: ANALYZE — What was missed?

Determine exactly what the spec's acceptance criteria failed to cover.

  1. Read the identified requirement's acceptance criteria in full.

Read the full file on GitHub · 223 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 223 lines · 27 tokens per session scan A f61d3498eda0

Subscribe to this mod's changes

backpropagation is a skill published in the GitHub repository LucasDuys/forge (55 stars, last pushed 1mo ago), licensed MIT. It adds 27 tokens to every session and 2,400 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.