Skip to content
FunCoding

rea-bug-fix

Fix a reproduced REA defect at its owning boundary; use when a tool, contract, recovery, lifecycle, or result is wrong, not for new features or suite-wide CI audits.

Star
487,464
License
MIT
Last commit
Dec 3, 2026

.agents/skills/rea-bug-fix/SKILL.md

View on GitHub

REA bug fix

Fix the cause once, where the fact is produced, and remove what the fix makes redundant. Follow the checkout's AGENTS.md, the tool design guide and the testing guide.

Trace the defect to its owner

Start from what the agent or user actually sees, then follow the call inward until you reach the code that decides the wrong fact. Common boundaries, in the order a call crosses them:

  1. The advertised schema clients receive (the served tools/list, not the canonical contract).
  2. Input validation and its error rewrite.
  3. Admission: whether the tool can run in the current session.
  4. Provider and session state: lifecycle stages the provider owns.
  5. Error projection: code, retry semantics, recovery and remediation.
  6. Result delivery: budgets, summaries and retained Evidence.

Decide where the fix belongs. A shared boundary owns how facts are carried, formatted and enforced; the producer owns facts only it knows, such as a lifecycle outcome, a measured limit, a current revision or the next tool. A downstream repair cannot restore a fact the producer never recorded.

Check siblings before fixing

Search for the same decision made elsewhere: duplicated factories, hand-built copies of shared text, per-client or per-tool name branches, and parallel checks that can disagree. Group confirmed instances under one root cause and fix them together. Similar wording alone does not establish another instance; reproduce it.

Prove it with an independent oracle

Write the regression first and show it fails on the base revision for the reported reason. Take expected values from independent facts, such as a literal, a fake's observed calls, or the served schema, never from the production function under test. Assert the key fact the bug broke (identity, linkage, coverage, retry semantics, recovery, what was written or released), not only that an error occurred. Prefer a public CLI/MCP workflow, then a production-boundary test. When an existing test asserts the buggy value, update it with the fix instead of keeping both.

Remove what the fix supersedes

Delete the copies, fallbacks, aliases, wrappers and tests the new owner replaces, after checking their consumers. Keep malformed-input, cancellation, cleanup, permission, capacity and target-identity coverage.

Keep it simple

Make the smallest change that removes the observed problem. Do not add a new mechanism, setting or abstraction for a theoretical or client-dependent gain; if one seems needed, state the concrete failure mode, likelihood and cost and get agreement first. Mark output or input changes that break a previously valid call as breaking, with migration.

Report the root cause, the structural fix, the sibling paths checked, the validation you ran, and anything left for later.

Similar Skills

Featured

diagnosing-bugs

Diagnose hard bugs and performance regressions by building a feedback loop with tests or scripts.

MAmattpocock/skills338k5,008 new stars in the last 7 days

code-review

MAmattpocock/skills338k5,008 new stars in the last 7 days

setup-ts-deep-modules

MAmattpocock/skills338k5,008 new stars in the last 7 days

tdd

MAmattpocock/skills338k5,008 new stars in the last 7 days

retro

MAmattpocock/skills338k5,008 new stars in the last 7 days

implement

MAmattpocock/skills338k5,008 new stars in the last 7 days