debug-session
Skill0 starsChanged 31 days agoMITView on GitHub
Diagnose and fix bugs systematically. Use when the user reports an error, unexpected behaviour, a failing test, or a crash. Reads logs and code, reproduces the issue, isolates the root cause, fixes it, and verifies the fix — without guessing or changing code blindly.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- manastalukdar/ai-devstudiotheir own version, first seen Oct 13, 2026
- ai-dynamo/dynamotheir own version, first seen Oct 8, 2026
- joris887/exosuittheir own version, first seen Aug 20, 2026
- pathorsAI/skillstheir own version, first seen Jul 20, 2026
- SpencerGoss/agent-engineeringtheir own version, first seen Jun 18, 2026
- YehudaFrankel/clankbraintheir own version, first seen Apr 16, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- ai-dynamo/dynamo★ 8.5ksame name
- YehudaFrankel/clankbrain★ 16same name
- joris887/exosuit★ 9same name
- manastalukdar/ai-devstudio★ 1same name
- pathorsAI/skills★ 0same name
- SpencerGoss/agent-engineering★ 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 repository68 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- accessibilitySkill
- api-designSkill
- api-versioningSkill
- authSkill
- background-jobsSkill
- cachingSkill
- capacity-planningSkill
- changelogSkill
- chaos-engineeringSkill
- ci-cdSkill
- circuit-breakerSkill
- claude-best-practicesSkill
- code-commentsSkill
- code-hygieneSkill
- code-reviewSkill
- code-structureSkill
- commit-styleSkill
- concurrency-and-lockingSkill
- database-transactionsSkill
- data-consistencySkill
- debug-infra-startupSkill
- demo-video-creatorSkill
- demo-video-script-creatorSkill
- dependency-injectionSkill
- dependency-updateSkill
- disk-cleanupSkill
- distributed-tracingSkill
- dockerSkill
- env-configSkill
- env-setupSkill
- error-handlingSkill
- event-driven-architectureSkill
- feature-flagsSkill
- file-storageSkill
- graceful-shutdownSkill
- idempotencySkill
- input-validationSkill
- jars-engineering-blogsmithSkill
- jars-workshop-builderSkill
- licensingSkill
- loggingSkill
- memory-and-allocationsSkill
- migrate-dbSkill
- monitoringSkill
- multi-tenancySkill
- notificationsSkill
- openapiSkill
- paginationSkill
- perf-profileSkill
- pr-descriptionSkill
- query-optimizationSkill
- rate-limitingSkill
- refactorSkill
- releaseSkill
- runbook-writerSkill
- searchSkill
- secrets-auditSkill
- simplifySkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. 0 are common, 25 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
25
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Understand before touching code: Read the error, the logs, and the relevant code first.
- Distinctive: line 18
Verify the fix: Run the failing test or reproduce the original steps after the fix.
- Distinctive: line 28
Ask the user (or find in context):
- Distinctive: line 32
When did it start? (after a deploy, a dependency bump, a code change?)
- Distinctive: line 35
Read the full error. The last line of a stack trace is rarely the root cause — trace back up to the first frame in your own code.
- Distinctive: line 40
Before changing anything, reproduce the issue:
- Distinctive: line 52
If you cannot reproduce it, say so.
- Distinctive: line 70
Do not skim. Read the actual lines involved, not just the function signature.
- Distinctive: line 84
If your hypothesis does not explain every symptom, keep looking.
- Distinctive: line 88
Before writing a fix, confirm the theory:
- Distinctive: line 90
Add a temporary log or assertion to confirm the bad value is what you think it is
- Distinctive: line 91
Check whether the condition you identified actually occurs in the reproduction steps
- Distinctive: line 92
Read the git log for this file — was this code recently changed?
- Distinctive: line 99
If the hypothesis is wrong, go back to step 3.
- Distinctive: line 104
Write the minimal change that addresses the root cause:
- Distinctive: line 133
No new errors or warnings appeared
- Distinctive: line 135
If you added a temporary log or assertion in step 5, remove it now.
- Distinctive: line 139
If a test for this case does not exist, write one:
- Distinctive: line 173
Ask for logs from multiple occurrences — look for a pattern (time of day, load, specific input, specific user)
- Distinctive: line 175
Check for shared mutable state, race conditions, or time-dependent logic
- Distinctive: line 176
Add structured logging around the suspect area and ask the user to capture the next occurrence
- Distinctive: line 178
Do not guess a fix for a bug you cannot reproduce
- Distinctive: line 182
If after two hypotheses you have not found the cause:
- Very specific: line 185
Check recent changes: git log --oneline -20 -- <affected area>
- Distinctive: line 186
Check for known issues: search the issue tracker or changelog for similar symptoms
- Distinctive: line 190
Do not keep making changes hoping something sticks.
“Common” is measured: kept by at least 6 in 10 of the 6 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
Debug session
Work through a bug methodically: understand what is broken, reproduce it, find the root cause, fix only what needs fixing, and confirm it stays fixed. No blind changes, no guessing.
Ground rules
- Understand before touching code. Read the error, the logs, and the relevant code first. A fix written without understanding the cause often creates a new bug.
- One hypothesis at a time. Form a theory, test it, confirm or rule it out, then move on.
- Minimal fix. Change only what the root cause requires. Do not refactor unrelated code while fixing a bug.
- Verify the fix. Run the failing test or reproduce the original steps after the fix. "It looks right" is not verification.
- Never suppress an error to make it disappear. Swallowing exceptions or adding
try/except: passis not a fix. - Report honestly. Say what you found, what you changed, and what you could not verify.
Workflow
1. Understand the symptom
Ask the user (or find in context):
- What is the exact error message, stack trace, or wrong behaviour?
- How do you reproduce it? (steps, command, request, input)
- When did it start? (after a deploy, a dependency bump, a code change?)
- Is it consistent or intermittent?
Read the full error. The last line of a stack trace is rarely the root cause — trace back up to the first frame in your own code.
2. Reproduce it
Before changing anything, reproduce the issue:
# Run the failing test
pytest path/to/test_file.py::test_name -x
# or
npm test -- --testNamePattern "failing test name"
# Run the application and trigger the error
# Follow the exact steps the user describedIf you cannot reproduce it, say so. An unreproducible bug needs more information before any fix is attempted.
3. Read the relevant code
# Find where the error originates
grep -rn "FunctionName\|ErrorMessage" src/
# Read the file and the call chain around the errorTrace the execution path from the entry point to the crash:
- What inputs trigger it?
- What state or data does the code depend on?
- Where does the value come from that causes the problem?
Do not skim. Read the actual lines involved, not just the function signature.
4. Form a hypothesis
State your theory in one sentence before acting:
"The crash happens because
user.profilecan beNonewhen the user skips onboarding, but line 42 accessesuser.profile.avatar_urlwithout a null check."
A good hypothesis names:
- The specific condition that triggers the bug
- The specific line or function where it fails
- Why the code does the wrong thing there
If your hypothesis does not explain every symptom, keep looking.
5. Verify the hypothesis
Before writing a fix, confirm the theory:
- Add a temporary log or assertion to confirm the bad value is what you think it is
- Check whether the condition you identified actually occurs in the reproduction steps
- Read the git log for this file — was this code recently changed?
git log --oneline -10 -- path/to/file.py
git show <commit> -- path/to/file.pyIf the hypothesis is wrong, go back to step 3. Do not skip this step and jump straight to a fix.
6. Fix it
Write the minimal change that addresses the root cause:
| Root cause type | Fix approach |
| Null / undefined access | Guard with a check, return early, or ensure the value is always set |
| Wrong assumption about input | Validate input at the entry point; add a clear error for bad input |
| Off-by-one | Trace the index arithmetic; fix the boundary condition |
| Race condition | Add a lock, use an atomic operation, or remove the shared mutable state |
| Wrong error handling | Catch the right exception; surface it clearly; do not swallow |
| Stale cache / state | Invalidate at the right time, or remove the cache if it is not worth it |
| Dependency bug | Pin the last good version; add a comment; open an issue upstream |
Stage only the fix. Do not bundle unrelated changes into the same commit.
7. Verify the fix
# Re-run the exact reproduction steps
# Re-run the failing test
pytest path/to/test_file.py::test_name -x
# Run the full test suite for the affected area
pytest path/to/Confirm:
- The original error no longer occurs
- Existing tests still pass
- No new errors or warnings appeared
If you added a temporary log or assertion in step 5, remove it now.
8. Write a regression test
If a test for this case does not exist, write one:
def test_profile_access_when_onboarding_skipped():
user = User(profile=None)
# Should return a default, not raise AttributeError
assert get_avatar_url(user) == DEFAULT_AVATARThe test name should describe the bug scenario, not the implementation. If adding a test is
out of scope, say so and leave a # TODO: comment with the scenario.
9. Report
Summarise what you found and did:
Root cause: `user.profile` was None for users who skipped onboarding.
Line 42 accessed `.avatar_url` without a guard.
Fix: Added an early return in `get_avatar_url()` that returns DEFAULT_AVATAR
when `profile` is None.
Verified: `test_profile_access_when_onboarding_skipped` passes.
Full unit suite: 94 passed, 0 failed.
Not verified: behaviour in production with real onboarding-skip users
(no staging environment available).Intermittent bugs
For bugs that do not reproduce reliably:
- Ask for logs from multiple occurrences — look for a pattern (time of day, load, specific input, specific user)
- Check for shared mutable state, race conditions, or time-dependent logic
- Add structured logging around the suspect area and ask the user to capture the next occurrence
- Do not guess a fix for a bug you cannot reproduce
When you are stuck
If after two hypotheses you have not found the cause:
- Widen the search — read one level up in the call stack
- Check recent changes:
git log --oneline -20 -- <affected area> - Check for known issues: search the issue tracker or changelog for similar symptoms
- Tell the user what you have ruled out and ask for more information (more logs, a minimal reproduction case, or access to the environment)
Do not keep making changes hoping something sticks.
Examples
| Shortcut | Correct approach |
| Change the code until the error goes away | Reproduce → hypothesise → verify → fix |
except Exception: pass | Catch the specific exception; handle or re-raise it |
| "It works on my machine" | Add logging; ask for the exact environment and inputs |
Fix the symptom (hide the None) | Find why None is there; fix the upstream cause |
| Refactor the whole function while fixing a bug | Minimal fix first; refactor in a separate commit |
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.

