Best for
- Use when encountering a bug, test failure, or unexpected behavior, before proposing fixes
GanyuanRan/Aegis/skills/systematic-debugging/SKILL.md
Use when encountering a bug, test failure, or unexpected behavior, before proposing fixes
Decision brief
Bug, failure, or unexpected behavior:
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/GanyuanRan/Aegis --skill "skills/systematic-debugging"Inspect the Agent Skill "systematic-debugging" from https://github.com/GanyuanRan/Aegis/blob/f7ae3a7b116ae3dbb2f6e901a1bae0a403d5f09a/skills/systematic-debugging/SKILL.md at commit f7ae3a7b116ae3dbb2f6e901a1bae0a403d5f09a. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Implement one owner fix; no bundled “while here” work. Under strict TDD, create the smallest failing test first. With TDD off, a reproduction is diagnostic evidence, not a RED gate or a prerequisite for production edits.
Find root cause and fix the bug class at its canonical owner. A minimal fix is not the smallest textual diff; it is the smallest sufficient owner-level repair.
For a low-risk, reproducible, single-owner bug with no patch-shape signal, keep the readback compact: Symptom, Reproduction, Root Cause, Change Necessity, Fix Boundary, and Verification. Skip the causal card only when the causal-proof owner's Quick Exit Proof passes. Quick bug l…
1. Read the complete error/stack and record inputs, environment, versions, and success criteria. 2. Reproduce consistently. If reproduction is not stable, read feedback-loop-construction.md only when evidence shows intermittent or timing-dependent reproduction and build a bounde…
Before editing, continue upward unless evidence proves the local site is the canonical owner when the candidate is any of these signals:
Permission review
The documentation asks the agent to create, modify, or delete local files.
Target edit file:The documentation asks the agent to run terminal commands or scripts.
python <aegis-workspace-helper> init --root <target-project-root>The documentation asks the agent to run terminal commands or scripts.
python <aegis-workspace-helper> new-work --root <target-project-root> ...Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 1,141 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Bug, failure, or unexpected behavior:
code-change and before the first repair edit, own the TDD Route for
the repair slice: off skips automatic TDD; auto selects strict on any
behavior, bugfix, shared/core, contract, persistence, permission, migration,
producer/consumer, or meaningful regression signal. light requires every
tiny/low-risk/single-owner/no-behavior-change condition; missing explicit
user TDD wording is never auto-light evidence.TDD Route: strict; with TDD Mode: off, do not require a failing test or
RED/GREEN cycle. Three failed fixes means stop and question architecture.Done: confidence ≥ B, causal status matches recurrence evidence or an external terminal, tracks explicit, no H signal, and required D evidence passes.
Find root cause and fix the bug class at its canonical owner. A minimal fix is not the smallest textual diff; it is the smallest sufficient owner-level repair.
For a low-risk, reproducible, single-owner bug with no patch-shape signal, keep
the readback compact: Symptom, Reproduction, Root Cause, Change Necessity, Fix Boundary, and Verification. Skip the causal card only when
the causal-proof owner's Quick Exit Proof passes.
Quick bug lane must surface Change Necessity before source edits. One sentence
may cover the user-visible need, no-change/non-code option, why code must
change, minimum boundary, and an explicit decision token such as
Decision: code-change. If shared logic, a contract, fallback, duplicate
owner, consumer patch, or cross-module behavior appears, leave this lane.
Aegis Visibility names the evidence/owner/patch-shape/verification effect.
Pass root cause, avoided misfix, boundary, evidence, complexity, and risk to
verification-before-completion; no separate receipt.
feedback-loop-construction.md only when evidence shows intermittent or
timing-dependent reproduction and build a bounded automated loop.establishing-project-context rather than silently redefining a term.root-cause-tracing.md only when the observed bad value is several
calls or components downstream from its origin.Goal | DeeperCause | Evidence | Risk/Unknown | Decision.Before editing, continue upward unless evidence proves the local site is the canonical owner when the candidate is any of these signals:
try/catch, early return, or one-off branch;PatchShape:
CanonicalOwner:
UpwardDrillSignal:
Decision: fix owner | continue investigation | escalate
A locally green test does not erase triage. Before unplanned repair, compare invariant, owner, patch shape, and topology; a renamed carrier is not a new direction.
If the diagnosis crosses L3, a patch-shape signal fires, a user disputes the
root claim, a prior fix leaves a symptom, compound/root topology is plausible,
two or more anchored manifestations of one incident exist, reproduction
conditions diverge across occurrences, or an
upstream producer/config/default/contract/spec remains unexcluded, read
root-cause-claim-contract.md before claiming a root cause. It is the sole
owner of the Pre-Claim Gate, causal-closure/falsifier proof, layer-ceiling
proof, and Causal Topology Gate.
This decision is behavior-triggered, not prompt-triggered. It applies to any new source-code path. Before that path or a non-trivial source edit, expose:
Change Necessity:
- User-visible need:
- No-change / non-code option:
- Why code change is necessary:
- Minimum change boundary:
- Decision: no-change | docs/config-only | code-change | needs-clarification
no-change blocks source edits; docs/config-only narrows them;
needs-clarification pauses; code-change carries the minimum boundary into
repair and verification.
For any proposed branch, fallback, adapter, compatibility path, or new owner:
Minimality Check:
- Existing owner / reuse path:
- Correct owner and bug class:
- New path and existence proof:
- Old path retired or scheduled:
- Verdict: sufficient repair | local patch | needs first-principles review
A local patch needs a retention reason and retirement trigger. For a new
non-ordinary repair surface, run the Existence Check in
docs/current/AEGIS_MINIMALITY_REFERENCE.md. If retirement involves old code,
external compatibility, or persistent-state risk, compose
anti-entropy-governance; it chooses the retirement path but never grants
destructive authority.
Before editing an overloaded or mixed-purpose owner:
Pre-Edit Complexity Check:
- Target edit file:
- Existing pressure signal:
- Owner fit and safer boundary:
- Decision: edit-in-place | extract helper | add owner file | split task | pause for plan update
Pre-Edit Owner-Fit Decision:
- Edit intent: wiring-only | move-out / extract-first | local-fix-without-new-responsibility | new-responsibility | emergency / compatibility patch
- Owner fit and safer boundary:
- Decision: edit-in-place | extract helper | add owner file | split task | pause for plan update
Use using-aegis/references/complexity-governance.md for pressure signals.
Do not add new-responsibility in place by default. If the safer boundary
changes the approved shape, update the plan/spec first.
Implement one owner fix; no bundled “while here” work. Under strict TDD, create the smallest failing test first. With TDD off, a reproduction is diagnostic evidence, not a RED gate or a prerequisite for production edits.
Verification must match the risk:
condition-based-waiting.md only when
evidence identifies polling, sleeps, or race timing as part of the cause;defense-in-depth.md only after the root repair is known and evidence shows
a second independent validation boundary is required.Read advanced-debugging-governance.md before another fix for failed/
persistent / divergent repair or three failures; for unclear/disputed stop /
Layer Stop Card / intervention; or plausible compound root. Closeout triggers:
repair-added patch-shape; multi-site/one-regression;
remaining pattern/anomaly/duplicate/wrong-owner/downstream repair;
uninspected same-symptom fix; open recurrence/unsupported root status;
missing compound topology-specific member/anti-disguise proof;
outside-repo authority; unmigrated
published-contract break; undefined spec; missing permission/info. They route H/T/D;
detail is not causal proof.
For non-trivial debugging with configured workspace support:
python <aegis-workspace-helper> init --root <target-project-root>
python <aegis-workspace-helper> new-work --root <target-project-root> ...
python <aegis-workspace-helper> add-evidence --root <target-project-root> --work <YYYY-MM-DD-slug> ...
python <aegis-workspace-helper> check --root <target-project-root>
Fast bug fix or quick bug fix pressure does not skip this: if Ripple Signal Triage fires, record it before editing and verify the canonical owner plus affected downstream path. Records are advisory, not completion authority.
Always report:
Confirm the reproduction, same-pattern handling, authority, complexity, and retirement. Confidence: A = direct regression evidence; B = strong evidence with bounded unknowns; C = partial and not resolved.
Trace Digest may summarize audit evidence; never expose chain-of-thought or
replace root-cause, rule-effect, and verification evidence.
Frequently asked questions
Bug, failure, or unexpected behavior:
The source record exposes this install command: npx skills add https://github.com/GanyuanRan/Aegis --skill "skills/systematic-debugging". Inspect the command and pinned source before running it.
Static rules flagged write-files, exec-script in the source; the page lists the matching lines and excerpts.
Alternatives
johnqtcg/awesome-skills
Use when debugging, diagnosing, or investigating any bug, test failure, flaky test, race condition, unexpected behavior, build failure, production incident, third-party breakage, root cause analysis, or performance regression before proposing fixes
magnus919/agent-skills
4-phase root cause debugging protocol: understand bugs before fixing. Use for ANY technical issue — test failures, production bugs, unexpected behavior, performance problems, build failures, or integration issues. ESPECIALLY when under time pressure, when "one quick fix" seems obvious, or when previous fix attempts have failed.
moltis-org/moltis
Use when encountering any bug, test failure, or unexpected behavior. 4-phase root cause investigation — NO fixes without understanding the problem first.
event4u-app/agent-config
Use on a bug, test failure, crash, or unexpected behavior — enforce reproduce → isolate → hypothesize → verify before any fix; fires even on 'this is broken' / 'quick fix'.