systematic-debug
Skill0 starsChanged 5 months agoMITView on GitHub
Root-cause debugging workflow for the flow-frontend monorepo — Vitest failures, TypeScript strict/`lint:tsc` errors, eslint-plugin-boundaries violations, proto type mismatches, hydration mismatches, and Turbo build issues. Use when working in flow-frontend and a test, type-check, lint, or build fails, or the user says "debug this", "why is this failing", or "/systematic-debug". For non-flow-frontend code use the generic diagnose skill.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- modimihir07/agentic-ostheir own version, first seen Oct 25, 2026
- RndmCodeGuy20/ordnancetheir own version, first seen Aug 25, 2026
- asynkron/asynkron-skillstheir own version, first seen Jul 14, 2026
- anshul-garg27/claude-enhancement-suitetheir own version, first seen Mar 10, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- modimihir07/agentic-os★ 209same name
- asynkron/asynkron-skills★ 32same name
- anshul-garg27/claude-enhancement-suite★ 0same name
- RndmCodeGuy20/ordnance★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-server-actionSkill
- brainstormingSkill
- buf-bumpSkill
- e2e-test-fixtureSkill
- frontend-testingSkill
- new-componentSkill
- new-pageSkill
- proto-migrationSkill
- receiving-code-reviewSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 8 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
No fixes without root cause investigation first.
- Distinctive: line 16
BEFORE attempting ANY fix:
- Distinctive: line 19
Read stack traces completely — note file paths, line numbers, error codes
- Very specific: line 20
Check the terminal output from pnpm lint:tsc, pnpm test, or pnpm build
- Distinctive: line 28
If not reproducible, gather more data — do not guess
- Very specific: line 34
Check if proto types changed (@bufteam/* packages).
- Distinctive: line 43
When you fix a silent failure, add a canary: a positive assertion that fails loudly if the workaround breaks or the bad state returns — not …
- Distinctive: line 69
Ask the user before attempting more fixes
- Distinctive: line 70
Consider whether the pattern is fundamentally wrong vs.
- Distinctive: line 97
If you catch yourself:
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Systematic Debugging
Find root cause before attempting fixes. Random fixes waste time and create new bugs.
The Iron Law
No fixes without root cause investigation first. If you haven't completed Phase 1, do not propose fixes.
Phase 1: Root Cause Investigation
BEFORE attempting ANY fix:
Step 1: Read Error Messages Carefully
- Read stack traces completely — note file paths, line numbers, error codes
- Check the terminal output from
pnpm lint:tsc,pnpm test, orpnpm build - In this repo, common error sources: TypeScript strict mode violations, ESLint boundary violations, proto type mismatches
Step 2: Reproduce Consistently
- For test failures:
cd apps/<app> && TZ=America/Los_Angeles pnpm vitest run path/to/file.test.tsx(same shape from apackages/*dir) - For type errors:
pnpm lint:tsc - For lint errors:
pnpm lint - For build failures:
pnpm clean && pnpm build - If not reproducible, gather more data — do not guess
Step 3: Check Recent Changes
git difffor unstaged changesgit log --oneline -10for recent commitsgit diff HEAD~3to see what changed recently- Check if proto types changed (
@bufteam/*packages). If the pinned protos look stale, flag it and propose a user-confirmed bump — do not runbuf-bumpyourself. It is a gated, side-effecting skill that rebuilds packages and patches code; let the user invoke it.
Step 3.5: Suspect Silent Failures
- A passing test or clean type-check is not proof the bug is gone — confirm the code path actually executed. Ask: would this failure mode pass silently?
- Watch for swallowed errors (empty
catch, defaulting tonull/[]), a mock that hides a real call, a feature flag short-circuiting the path, or an effect that never ran. - When you fix a silent failure, add a canary: a positive assertion that fails loudly if the workaround breaks or the bad state returns — not a guard that quietly hides it.
Step 4: Trace the Data Flow
- For RPC issues: trace from server action → Connect RPC client → proto types → form state
- For component issues: trace from data source →
rpcToForm*converter → form state → component props - For test failures: check if mocks from
@hadrian-mtv/vitest-utilsmatch current interfaces - See
references/root-cause-tracing.mdfor the full backward tracing technique
Phase 2: Pattern Analysis
- Find working examples — locate similar working code in the same app or domain
- Compare — what's different between working and broken code?
- Check shared packages — is the issue in a shared package rather than the app? List them
with
ls packages/— do not rely on a memorized list; they drift - Check domain boundaries — does the import violate
eslint-plugin-boundariesrules?
Phase 3: Hypothesis and Testing
- State your hypothesis clearly — "I think X is the root cause because Y"
- Make the smallest possible change to test it — one variable at a time
- Verify — run the specific failing test or lint check
- If it didn't work — form a NEW hypothesis. Do not add more fixes on top
After 3+ Failed Fixes: Stop and Reassess
- Each fix revealing new problems in different places = architectural issue
- Ask the user before attempting more fixes
- Consider whether the pattern is fundamentally wrong vs. a surface bug
Phase 4: Implementation
- Run the failing test to confirm it fails:
cd apps/<app> && TZ=America/Los_Angeles pnpm vitest run -t "test name" - Implement a single fix addressing root cause — one change at a time
- Verify the fix:
TZ=America/Los_Angeles pnpm vitest run path/to/file.test.tsx— specific test passespnpm lint:tsc— no type errors introducedpnpm lint— no lint violations
- If fix doesn't work — return to Phase 1 with new information. Do not retry blindly.
Common Issues in This Repo
| Symptom | Likely Cause | Fix |
Type 'X' is not assignable to type 'Y' in proto types | Proto dependency out of date | Flag for a user-confirmed pnpm buf-bump:<service> (don't auto-run) |
Cannot find module '@hadrian-mtv/...' | Package not built | pnpm build from root |
| ESLint boundary violation | Cross-domain import | Move shared logic to app/_lib/ or a shared package |
| Hydration mismatch | Server/client rendering difference | Check for typeof window, date formatting, browser-only APIs |
console.* lint error | Wrong logger | Use @hadrian-mtv/flow-logger instead |
next/link lint error | Wrong navigation component | Use FlowLink/FlowLinkButton from @hadrian-mtv/flow-navigation |
| Test fails with timezone error | Missing TZ env var | Prefix with TZ=America/Los_Angeles |
| Stale build artifacts | Turbo cache | pnpm clean && pnpm build |
Red Flags — Stop and Restart Investigation
If you catch yourself:
- Proposing fixes before tracing the data flow
- Adding multiple changes at once
- Saying "let's try this" without a hypothesis
- Skipping test verification after a fix
- On your 3rd+ fix attempt without going back to Phase 1
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

