Claude-skill-registry auto-debug

๐Ÿ› Auto Debug Skill

install
source ยท Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code ยท Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/auto-debug" ~/.claude/skills/majiayu000-claude-skill-registry-auto-debug && rm -rf "$T"
manifest: skills/data/auto-debug/SKILL.md
source content

๐Ÿ› Auto Debug Skill


name: auto-debug description: Automatically detect bugs from terminal output and suggest/apply fixes without manual intervention

๐ŸŽฏ Purpose

เธ•เธฃเธงเธˆเธˆเธฑเธš errors เธˆเธฒเธ terminal output เธญเธฑเธ•เน‚เธ™เธกเธฑเธ•เธด เนเธฅเธฐเนเธ™เธฐเธ™เธณเธซเธฃเธทเธญเนเธเน‰เน„เธ‚เธ›เธฑเธเธซเธฒเธ—เธฑเธ™เธ—เธต เธฅเธ”เน€เธงเธฅเธฒ debug เธฅเธ‡เธญเธขเนˆเธฒเธ‡เธกเธฒเธ

๐Ÿ“‹ When to Use

  • เน€เธกเธทเนˆเธญ terminal เนเธชเธ”เธ‡ error messages
  • เน€เธกเธทเนˆเธญ build/compile fail
  • เน€เธกเธทเนˆเธญ tests fail
  • เน€เธกเธทเนˆเธญ runtime errors occur
  • เน€เธกเธทเนˆเธญ linting errors เน€เธเธดเธ”เธ‚เธถเน‰เธ™

๐Ÿ”ง Capabilities

1. Error Detection

Error TypeDetection Pattern
TypeScript
TS\d+:
,
Type error:
ESLint
error:
,
warning:
Runtime
Error:
,
Exception:
Build
ENOENT
,
Cannot find module
Test
FAIL
,
Expected.*but received

2. Common Error Fixes

TypeScript Errors

// TS2322: Type 'string' is not assignable to type 'number'
// Fix: Change variable type or value

// TS2339: Property does not exist
// Fix: Add property to interface or use optional chaining

// TS7006: Parameter implicitly has 'any' type
// Fix: Add explicit type annotation

Module Errors

# Cannot find module 'xyz'
# Fix 1: npm install xyz
# Fix 2: Check import path spelling
# Fix 3: Add to tsconfig paths

# Module not found: Can't resolve './component'
# Fix: Check file exists, check extension, check case sensitivity

Runtime Errors

// TypeError: Cannot read property 'x' of undefined
// Fix: Add null check or optional chaining

// ReferenceError: variable is not defined
// Fix: Declare variable or check scope

// SyntaxError: Unexpected token
// Fix: Check JSON format, missing brackets

๐Ÿ“ Auto-Debug Process

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Error Occurs   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Parse Error Msg โ”‚ โ† Extract error type, location, message
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Identify Cause  โ”‚ โ† Match patterns, analyze context
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Generate Fix    โ”‚ โ† Create solution based on error type
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Apply & Verify  โ”‚ โ† Apply fix, re-run to verify
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
   Fixed? โ”€โ”€โ”€โ”€Noโ”€โ”€โ”€โ”€โ–ถ Try alternative fix
         โ”‚
        Yes
         โ”‚
         โ–ผ
      Done! โœ…

๐Ÿ”„ Auto-Fix Loop

MAX_ATTEMPTS = 5
attempt = 0

while error_exists and attempt < MAX_ATTEMPTS:
    error = parse_error(terminal_output)
    fix = generate_fix(error)
    apply_fix(fix)
    result = run_command_again()
    
    if result.success:
        log_solution(error, fix)  # Save for future
        break
    else:
        attempt += 1
        try_alternative_fix()

๐Ÿ“š Error Pattern Database

Build Errors

PatternCauseAuto-Fix
ENOENT
File not foundCheck path, create file
EACCES
Permission deniedCheck permissions
EADDRINUSE
Port in useKill process or change port

Dependency Errors

PatternCauseAuto-Fix
peer dep
Version mismatchUpdate package
ERESOLVE
ConflictUse --legacy-peer-deps
not found
Missing packagenpm install

Syntax Errors

PatternCauseAuto-Fix
Unexpected token
Typo, missing bracketAdd missing syntax
Unterminated string
Missing quoteAdd closing quote
Invalid JSON
Malformed JSONFix JSON syntax

โœ… Self-Check

  • Error correctly identified
  • Root cause understood
  • Fix is safe (won't break other code)
  • Fix verified by re-running
  • Solution logged for future reference

๐Ÿ“ข Announcement Format

[๐Ÿ› Auto-Debug] Detected: {error type}
[๐Ÿ› Auto-Debug] Cause: {root cause}
[๐Ÿ› Auto-Debug] Fixing: {applying fix}
[๐Ÿ› Auto-Debug] โœ… Fixed: {summary}

๐Ÿ”— Related Skills

  • debugging
    - Manual debugging
  • error-recovery
    - Graceful error handling
  • testing
    - Prevent errors with tests