Aller au contenu
Skillpedia
Programmation générale6.0k · #14480

bug-detective

Ce qu’il fait

Cette skill donne à votre IA une méthode pas à pas pour traquer les bogues, exceptions et pannes dans le code. Elle s'adresse à toute personne dont le code est cassé et qui veut une correction prudente, fondée sur des preuves.

Quand l’utiliser

  • ✓Quand vous avez un message d'erreur, une exception ou une trace d'appels à examiner.
  • ✓Quand quelque chose est cassé ou qu'une fonctionnalité s'arrête brusquement de marcher.
  • ✓Quand vous demandez pourquoi un morceau de code échoue et que la cause n'est pas évidente.

Lien du skill

https://github.com/Galaxy-Dawn/claude-scholar/blob/main/skills/bug-detective/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/Galaxy-Dawn/claude-scholar/blob/main/skills/bug-detective/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Ma page de connexion affiche une erreur 500 depuis le dernier déploiement. Trouve la cause et corrige-la.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent rassemble les détails de l'erreur, classe son type, formule les causes possibles, teste chacune d'elles, puis applique et vérifie la correction.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Bug Detective

A systematic debugging workflow for investigating and resolving code errors, exceptions, and failures. Provides structured debugging methods and common error pattern recognition.

Core Philosophy

Debugging is a scientific problem-solving process that requires:

  1. Understand the problem - Clearly define symptoms and expected behavior
  2. Gather evidence - Collect error messages, logs, stack traces
  3. Form hypotheses - Infer possible causes based on evidence
  4. Verify hypotheses - Confirm or eliminate causes through experiments
  5. Resolve the issue - Apply fixes and verify

Debugging Workflow

Step 1: Understand the Problem

Before starting to debug, clarify the following information:

Required information to collect:

  • Complete error message content
  • Exact location of the error (filename and line number)
  • Reproduction steps (how to trigger the error)
  • Expected behavior vs actual behavior
  • Environment info (OS, versions, dependencies)

Question template:

1. What is the exact error message?
2. Which file and line does the error occur at?
3. How can this issue be reproduced? Provide detailed steps.
4. What was the expected result? What actually happened?
5. What recent changes might have introduced this issue?

Step 2: Analyze Error Type

Choose a debugging strategy based on error type:

Error Type Characteristics Debugging Method
Syntax Error Code cannot be parsed Check syntax, bracket matching, quotes
Import Error ModuleNotFoundError Check module installation, path config
Type Error TypeError Check data types, type conversions
Attribute Error AttributeError Check if object attribute exists
Key Error KeyError Check if dictionary key exists
Index Error IndexError Check list/array index range
Null Reference NoneType/NullPointerException Check if variable is None
Network Error ConnectionError/Timeout Check network connection, URL, timeout settings
Permission Error PermissionError Check file permissions, user permissions
Resource Error FileNotFoundError Check if file path exists

Step 3: Locate the Problem Source

Use the following methods to locate the issue:

1. Binary Search Method

  • Comment out half the code, check if the problem persists
  • Progressively narrow the scope until the problematic code is found

2. Log Tracing

  • Add print/logging statements at key locations
  • Track variable value changes
  • Confirm code execution path

3. Breakpoint Debugging

  • Use debugger breakpoint functionality
  • Step through code execution
  • Inspect variable state

4. Stack Trace Analysis

  • Find the call chain from the stack trace in the error message
  • Determine the direct cause of the error
  • Trace back to the root cause

Step 4: Form and Verify Hypotheses

Hypothesis framework:

Hypothesis: [problem description] causes [error phenomenon]

Verification steps:
1. [verification method 1]
2. [verification method 2]

Expected results:
- If hypothesis is correct: [expected phenomenon]
- If hypothesis is wrong: [expected phenomenon]

Step 5: Apply Fix

After fixing, verify:

  1. The original error is resolved
  2. No new errors have been introduced
  3. Related functionality still works correctly
  4. Tests added to prevent regression

Python Common Error Patterns

1. Indentation Errors

2. Mutable Default Arguments

3. Closure Issues in Loops

4. Modifying a List While Iterating

5. Using is for String Comparison

6. Forgetting to Call super().__init__()

JavaScript/TypeScript Common Error Patterns

1. this Binding Issues

2. Async Error Handling

3. Object Reference Comparison

Bash/Zsh Common Error Patterns

1. Spacing Issues

# ❌ No spaces allowed in assignment
name = "John"  # Error: tries to run 'name' command

# ✅ Correct assignment
name="John"

# ❌ Missing spaces in conditional test
if[$name -eq 1]; then  # Error

# ✅ Correct
if [ $name -eq 1 ]; then

2. Quoting Issues

# ❌ Variables not expanded inside single quotes
echo 'The value is $var'  # Output: The value is $var

# ✅ Use double quotes
echo "The value is $var"  # Output: The value is actual_value

# ❌ Using backticks for command substitution (confusing)
result=`command`

# ✅ Use $()
result=$(command)

3. Unquoted Variables

Questions fréquentes

Quelles informations dois-je fournir ?

Le message d'erreur complet, le fichier et la ligne si vous les connaissez, les étapes pour le reproduire et le comportement attendu.

Devine-t-elle les corrections ?

Non. Elle formule des causes possibles et vérifie chacune avant de modifier le code.

Connaît-elle les erreurs courantes ?

Oui. Elle inclut des schémas d'erreurs courants pour accélérer le diagnostic.

Détails

Description originale de l’auteur

This skill should be used when the user asks to "debug this", "fix this error", "investigate this bug", "troubleshoot this issue", "find the problem", "something is broken", "this isn't working", "why is this failing", or reports errors/exceptions/bugs. Provides systematic debugging workflow and common error patterns.

repo: Galaxy-Dawn/claude-scholar

Popularité

Étoiles GitHub
6.0k
Position au classement
#14480
Licence
MIT
Mis à jour
19/10/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires