visionforge-ou/foreman-debug
Headless root-cause debugging loop for a Foreman worker whose tests, build, or acceptance check are failing — especially on a retry. Find the root cause before changing anything, fix at the source with a regression test, and never thrash on symptom patches. Used inside a foreman-tdd build session; emits no summary of its own.
npx skills add https://github.com/VisionForge-OU/foreman --skill foreman-debug
(Adapted from obra/superpowers systematic-debugging (MIT) — see NOTICE. Made
headless: removed the "discuss with your human partner" hand-offs — under Foreman
there is no live human, so a genuine architectural dead end becomes a FOREMAN-SUMMARY
escalate from the surrounding foreman-tdd run, not a question. Folded the regression
step into Foreman's existing foreman-test + evidence contract.)
You are invoked inside a foreman-tdd build session when something is failing: a
red test that should be green, the project test/lint/typecheck command, the issue's
acceptance_check, or a distilled failure report from a prior attempt. You run
headless — do not ask questions. Find the root cause, fix it at the source, and
hand control back to foreman-tdd. You emit no FOREMAN-SUMMARY of your own; the
foreman-tdd run owns the single summary block.
NO FIX WITHOUT ROOT-CAUSE INVESTIGATION FIRST
A symptom patch that makes the red go away without explaining *why* it was red is a
failure — it will bounce at Foreman's merge gate or resurface on the next slice.
line, the ERROR lines in the foreman-test log on disk. The message often *is*
the answer. If a distilled failure report from a prior attempt is in your context,
treat its "why it was rejected" as the starting hypothesis, not noise to re-discover.
foreman-test(use --fast while iterating). If it is flaky, that *is* the bug — chase the
nondeterminism (ordering, time, shared state), don't paper over it.
git diff the slice against the integration branch. Theregression almost always lives in the diff.
passed it in? Keep walking *up* the call stack until you reach the origin. Fix
there, not at the symptom.
Find working code that does the same thing elsewhere in the repo. List every
difference between it and the broken path, however small — "that can't matter" is how
root causes hide.
State one specific hypothesis: "the root cause is X because Y." Make the smallest
change that tests it. One variable at a time. If it doesn't hold, form a *new*
hypothesis — do not stack a second fix on top of an unproven first.
this root cause* and will pass once it's fixed — exactly the red-green discipline
foreman-tdd already uses. A fix with no test that proves it does not count.
foreman-test. The targeted test passes AND the full suitestays green. Read the output; do not assume.
If three distinct fixes each fail or each surfaces a new problem somewhere else, the
issue is architectural, not a bug — the slice's seam is wrong. Stop patching.
Hand back to foreman-tdd with a clear note for its FOREMAN-SUMMARY: set `escalate:
true` with a one-line statement of the structural problem (e.g. "ISS-012 assumes a
synchronous store but the queue is async — the seam can't hold"). A wrong architecture
is Foreman's human's call, not another guess.
Take visionforge-ou/foreman-debug from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.