agentleFS
helloternhellotern/Sextant/skills/debug/SKILL.md

debug

Skill15 starsChanged 8 months agoMITView on GitHub

You MUST use this skill before reading any code or proposing any fix when the bug location is unknown. Use when you have a symptom (error, crash, unexpected output) but cannot yet point to the specific function or line where it originates. Stronger signals: "I don't know where this is coming from", "can't reproduce consistently", "something is wrong but I don't know where", intermittent failures, no stack trace. Use sextant:fix-bug instead when you CAN already point to the specific file or line causing the bug.

144 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use add-ollama-tool, add-slack and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    add-ollama-tool

    Add Ollama MCP server so the container agent can call local models and optionally manage the Ollama model library.

    Also in 6 projects that use this

  • MicrosoftSkill

    add-slack

    Add Slack channel integration via Chat SDK.

    Also in 6 projects that use this

  • sskarzSkill

    add-telegram-swarm

    Add Agent Swarm (Teams) support to Telegram. Each subagent gets its own bot identity in the group. Requires Telegram channel to be set up first (use /add-telegram). Triggers on "agent swarm", "agent teams telegram", "telegram swarm", "bot pool".

    Also in 5 projects that use this

  • +9 more from microsoft

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 127 edited versions we read keep these.

  • 6

    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
  1. Distinctive:

    Before forming any hypothesis, establish a precise symptom record:

    line 33
  2. Distinctive:

    Ask: "Is the input to this layer already wrong, or does this layer corrupt correct input?"

    line 69
  3. Distinctive:

    Add sequence numbers or timestamps to logs before the symptom point

    line 74
  4. Distinctive:

    Stop the bisection loop. Do not generate more hypotheses.

    line 94
  5. Distinctive:

    When you can answer all three:

    line 112
  6. Very specific:

    Do not apply a workaround (try/except swallowing, hardcoded fallback value) before the root cause is confirmed — this hides the bug

    line 128
  7. Distinctive:

    Do not generate a list of all possible causes without narrowing — work by elimination, not enumeration

    line 129
  8. Very specific:

    Do not start fixing while the location is still uncertain — confirm first, then hand off to sextant:fix-bug

    line 130

“Common” is measured: kept by at least 6 in 10 of the 127 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

!../principles/SKILL_BODY.md

!../tool-gitnexus/SKILL_BODY.md


Debugging Workflow

Disambiguation Gate

Before starting: Can you point to a specific function or line and say "the bug is here"? → Yes → Stop. Use sextant:fix-bug — the location is known, that skill handles the fix. → No → Continue here. This skill is for "symptom known, location unknown."

Core Principle

Debug by bisection, not inspection. Form a hypothesis about which boundary separates correct from incorrect behavior, then eliminate layers until only the root cause remains.


Complete Execution Workflow

Step 1: Capture the Symptom

Before forming any hypothesis, establish a precise symptom record:

  • Error message (exact text, stack trace if available)
  • Reproduction steps (what sequence of actions triggers it?)
  • Frequency (always / intermittent / environment-specific)
  • Regression (did this ever work? What changed recently?)
─── Symptom Record ──────────────────────────────────
Error / unexpected output: <exact message or behavior>
Trigger steps:             <reproducible sequence>
Frequency:                 Always / Intermittent (~X%) / Specific environment only
Regression:                Yes (last known good: <commit/date>) / No / Unknown
─────────────────────────────────────────────────────

Step 2: Identify Paradigm + Select Isolation Strategy

Identify which architecture paradigm applies (per §6.0), then use the corresponding isolation strategy:

ParadigmIsolation DirectionIsolation Technique
Backend layeredEntry → Logic → Data (inward)Add logging at each layer boundary; find the first layer that returns incorrect data
Frontend component treePage → Feature → Atom (downward)Props injection test: pass hardcoded data directly to component, bypass store
CLI / ScriptEntry → Command handler → Core logic (inward)Print intermediate values at each function boundary
Functional (FP)I/O boundary → Pure core (inward)Test pure functions in isolation; side effects confined to boundaries
Concurrent / AsyncReconstruct timing diagram; locate shared stateAdd timestamps/sequence numbers to logs; inspect lock points on shared state
Event-drivenTrace event publish → handler chainLog each consumed event; verify handler receives correct payload

🔗 When GitNexus is available, use context / trace MCP tools to map the call chain automatically.

Step 3: Form and Validate Hypotheses

Bisection protocol: Find the boundary between "working correctly" and "already wrong."

  1. Identify the layer / module where the symptom surfaces — this is the observation point
  2. Ask: "Is the input to this layer already wrong, or does this layer corrupt correct input?"
  3. Move the observation point inward (toward the source) until you find the first layer that produces incorrect output
  4. That boundary is your root cause hypothesis

For intermittent bugs (concurrency / async):

  • Add sequence numbers or timestamps to logs before the symptom point
  • Identify the shared state that changes between passing and failing runs
  • Hypothesis format: "Thread A reads X before Thread B writes the updated value"

For environment-specific bugs:

  • List all environmental differences (OS, config, versions, data state)
  • Eliminate variables one by one until the failing condition is isolated
─── Hypothesis Log ──────────────────────────────────
Hypothesis 1: <the bug is in X because Y>
  Test:   <what to check / add / isolate>
  Result: ✅ Confirmed / ❌ Eliminated / ⏳ Pending

Hypothesis 2: ...
─────────────────────────────────────────────────────

Hypothesis limit gate — trigger when 3+ hypotheses have been eliminated without confirming root cause:

Stop the bisection loop. Do not generate more hypotheses. Instead, choose one of the following escalation paths:

  1. Request more context — ask the user for: a minimal reproduction case, relevant logs or stack traces at the failure point, or the last known-good commit/state
  2. Suggest git bisect — if the bug is a regression with an unknown introduction point, git bisect identifies the exact commit; ask the user to run it and share the result
  3. Add structured logging — propose specific log statements at the current observation point boundary; ask the user to re-run and share the output before resuming bisection
  4. Widen the symptom map — if only one symptom was captured, ask whether the bug manifests differently under other conditions (different inputs, environments, users)
─── Escalation Decision ─────────────────────────────
Hypotheses eliminated: N
Root cause: ⏳ not yet confirmed
Escalation chosen: <context request / git bisect / structured logging / symptom widening>
Information needed from user: <specific artifact or action>
─────────────────────────────────────────────────────

Step 4: Confirm Root Cause → Hand Off to Fix

When you can answer all three:

  1. Which function / line produces the incorrect output?
  2. Under what exact input or state does the failure occur?
  3. Why does that code produce incorrect output (logic error, missing guard, race condition, wrong assumption)?

→ Root cause is confirmed. Hand off: switch to sextant:fix-bug.

Provide the fix-bug workflow with pre-filled context:

  • Root cause location (file + function)
  • Trigger conditions
  • Impact scope already identified (skip fix-bug Step 2 if already covered here)

Forbidden Actions

  • Do not apply a workaround (try/except swallowing, hardcoded fallback value) before the root cause is confirmed — this hides the bug
  • Do not generate a list of all possible causes without narrowing — work by elimination, not enumeration
  • Do not start fixing while the location is still uncertain — confirm first, then hand off to sextant:fix-bug

Reply Format

Debug Summary:

#ItemDetail
[1]Symptom<exact error + reproduction conditions + frequency>
[2]Paradigm<detected paradigm> → isolation strategy: <strategy name>
[3]Hypotheses tested<list with ✅ Confirmed / ❌ Eliminated result for each>
[4]Root cause<file:function — what and why> / ⏳ Not yet confirmed (next step: <action>)
[5]Next actionSwitch to sextant:fix-bug with pre-filled context / <specific investigation step>

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.