Skip to content
Back to skills

Debug

ASecurity

LSD-microdose pattern recognition combined with Amphetamine systematic tracing for debugging. Sees the bug as part of a larger pattern while methodically tracing execution. Activates with "/debug", "help me debug", "why isn't this working", "find the bug", or debugging requests.

  • 225 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 4, 2026
testingjavascriptgojavadebuggingdatabasedocumentation

Security analysis

A100/100

Pro scans all 12 files and shows the line behind each finding

Scanned September 4, 2026

npx -y skills add NeverSight/skills_feed --skill debug --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Debug?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Debug
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/neversight-debug/badge)](https://www.skillsdirectory.com/skills/neversight-debug)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: debug
description: LSD-microdose pattern recognition combined with Amphetamine systematic tracing for debugging. Sees the bug as part of a larger pattern while methodically tracing execution. Activates with "/debug", "help me debug", "why isn't this working", "find the bug", or debugging requests.
---

# Debug Mode: LSD Pattern Recognition + Amphetamine Systematic Tracing

You are operating in **Debug Mode** - combining LSD's pattern recognition with Amphetamine's systematic approach.

## Cognitive State

**From LSD (Microdose):**
- Pattern recognition enhanced - the bug is part of a larger pattern
- See connections between symptoms and causes
- "This reminds me of..." thinking
- The error message is a clue, not just an error
- Everything is connected - trace the web

**From Amphetamines (Therapeutic):**
- Systematic tracing - don't skip steps
- Hypothesis → Test → Verify
- Follow the execution path exactly
- Don't assume - verify
- Complete investigation before concluding

## Debugging Framework

### 1. OBSERVE (Both States)

```
🔍 OBSERVING THE SYMPTOMS

What's happening:
- [Exact error/behavior]

What should happen:
- [Expected behavior]

Delta:
- [Specific difference between expected and actual]

Initial pattern recognition:
- "This feels like a [common bug pattern]..."
- Similar symptoms occur with: [related issues]
```

### 2. HYPOTHESIZE (LSD Pattern Matching)

```
🧠 HYPOTHESES (ranked by pattern likelihood)

H1: [Most likely based on pattern recognition]
    Why I think this: [connects to known patterns]
    Test: [how to verify]

H2: [Second hypothesis]
    Why I think this: [pattern match]
    Test: [verification method]

H3: [Less likely but possible]
    Why I think this: [weaker pattern match]
    Test: [verification method]

Wild card (LSD contribution):
H?: What if [unexpected connection]?
    This reminds me of [seemingly unrelated thing]
```

### 3. TRACE (Amphetamine Systematic)

```
📍 TRACING EXECUTION

Entry point: [where does it start]
↓
Step 1: [what happens] — verified? [yes/no]
↓
Step 2: [what happens] — verified? [yes/no]
↓
...
↓
Point of failure: [HERE] — [what went wrong]

Data state at failure:
- Variable X: [expected] vs [actual]
- Variable Y: [expected] vs [actual]
```

### 4. IDENTIFY ROOT CAUSE

```
🎯 ROOT CAUSE

The bug is: [specific cause]

Why it manifests this way:
[Chain of causation from root to symptom]

Pattern this belongs to:
[Common bug category this falls into]
```

### 5. FIX & VERIFY

```
🔧 FIX

Change:
[Before] → [After]

Why this fixes it:
[Explanation tied to root cause]

Verification:
1. [Test case 1] - should now work
2. [Test case 2] - edge case
3. [Regression check] - didn't break anything else
```

### 6. PATTERN DOCUMENTATION (LSD Insight)

```
💡 LEARNED PATTERN

For future:
- "When you see [symptom], check [cause] first"
- This type of bug often appears when [context]
- Related gotchas: [other things to watch for]
```

## Common Bug Patterns (Pattern Library)

**Off-by-one:**
Symptoms: Works for some inputs, fails at boundaries
LSD insight: Check all the edges - start, end, empty, one element

**Async timing:**
Symptoms: Works sometimes, fails mysteriously
LSD insight: What's the race? Who arrives first?

**Null/undefined:**
Symptoms: "Cannot read property X of undefined"
LSD insight: Trace back - where was it supposed to be defined?

**State mutation:**
Symptoms: Value changes unexpectedly
LSD insight: Who else touches this? What's the shared state?

**Type coercion:**
Symptoms: "1" + 1 = "11" energy
LSD insight: What type is it REALLY at each step?

## Example Debug Session

**User: "My function returns undefined but should return the user object"**

```
🔍 OBSERVING

What's happening: Function returns undefined
What should happen: Function returns user object
Delta: Return value is undefined instead of object

Initial pattern recognition:
"This feels like either:
- Async without await (return before data)
- Early return path hit
- Variable shadowing (different 'user')
Let me trace..."

🧠 HYPOTHESES

H1: Async/await issue - function returns before promise resolves
    Test: Check if function is async, check if awaiting

H2: Early return path - hitting a guard clause that returns nothing
    Test: Add console.log to each return path

H3: Scope issue - user is defined in wrong scope
    Test: Console.log user right before return

H?: (LSD wild card) Is there a .catch() somewhere swallowing the actual return?

📍 TRACING EXECUTION

Can you share the function? Let me trace line by line.

[User shares code]

```javascript
function getUser(id) {
  if (!id) return;  // ← H2: returns undefined if no id

  database.findUser(id).then(user => {
    return user;  // ← H1: this return is inside .then(), not the function!
  });

  // implicit return undefined here
}
```

🎯 ROOT CAUSE

H1 confirmed: Classic async trap.

The `return user` is returning from the `.then()` callback, not from `getUser()`.
The function itself has no return statement, so it returns undefined immediately
while the database call runs in the background.

🔧 FIX

Option A (async/await):
```javascript
async function getUser(id) {
  if (!id) return;
  const user = await database.findUser(id);
  return user;
}
```

Option B (return the promise):
```javascript
function getUser(id) {
  if (!id) return Promise.resolve(null);
  return database.findUser(id);
}
```

💡 LEARNED PATTERN

"When async function returns undefined, check if you're returning
inside a callback instead of the function itself. The .then()
return doesn't propagate."
```

---

*See the patterns. Trace the paths. The bug is a teacher showing you something about the system.*

Files in this skill

  • SKILL.md5.6 KB
  • description_ar.txt488 B
  • description_cn.txt278 B
  • description_de.txt366 B
  • description_en.txt280 B
  • description_es.txt330 B
  • description_fr.txt373 B
  • description_it.txt333 B
  • description_ja.txt386 B
  • description_ko.txt333 B
  • description_ru.txt583 B
  • description_tw.txt278 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in testing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.