/bugfix - Pipeline de correction de bugs

VérifiéSûr

Pipeline autonome pour diagnostiquer et corriger les bugs sans changement de contexte.

Spar Skills Guide Bot
DeveloppementAvancé
24/07/2026
Claude Code
#bug-fixing#autonomous-pipeline#spec-hygiene#git-diff-context

Recommandé pour

Synthèse automatique

Pipeline autonome pour diagnostiquer et corriger des bugs logiciels en minimisant les interruptions utilisateur, avec audit automatique des spécifications et contexte git.

Points forts

  • Réduit les va-et-vient en diagnostiquant la cause racine de manière autonome
  • Audite et nettoie les spécifications existantes pour maintenir un projet organisé
  • Utilise le diff git comme contexte pour toutes les tâches sous-traitées
  • Adapte la stratégie (rapide ou complète) selon la complexité du bug

Limites

  • Nécessite une infrastructure spécifique (scripts dans .claude/)
  • Le chemin rapide peut passer à côté de cas limites par manque de planification détaillée
  • Fonctionne principalement dans l'environnement Claude Code
Quand l'utiliser

Utilisez ce skill lorsque vous rencontrez un bug et souhaitez une investigation et correction automatisées avec un minimum d'interactions.

Quand l'éviter

Évitez de l'utiliser pour des bugs triviaux corrigeables manuellement en quelques secondes, ou si vous n'avez pas mis en place l'infrastructure du pipeline.

Analyse de sécurité

Sûr
Score qualité90/100

The skill only instructs running internal project scripts (node commands) and build tools; it doesn't call out to external malicious commands or exfiltrate data. The web search for documentation is standard and non-destructive. No destructive or obfuscated actions are present.

Aucun point d'attention détecté

Comment cette analyse est faite

Exemples

Fix TypeError
/bugfix TypeError: Cannot read properties of undefined (reading 'foo') in app/services/data.js
Fix failing test
/bugfix The test 'should return correct sum' fails with expected 5 but got 3
Fix import error
/bugfix Module not found: Can't resolve './components/Button' in 'src/pages/index.js'

/bugfix - Bug Fix Pipeline

ALWAYS before making any change. Search on the web for the newest documentation and only implement if you are 100% sure it will work.

Trigger

/bugfix <error-description>

Description

Autonomous pipeline to diagnose and fix bugs. Zero context-switch — never ask the user what can be discovered autonomously.

Procedure

Spec Hygiene (automatic, before ANALYZE)

Before starting a new pipeline, audit specs in active/:

  1. Scan all specs in .claude/spec/active/*/spec.md
  2. For each spec, read the full header and checklist to extract Status:, Phase:, and checkbox completion ([x] vs [ ])
  3. Verify completed/cancelled specs before moving:
    • If Status: completed or Status: cancelled:
      • Analyze first: check that ALL checklist items are [x], no ## Concerns with unresolved BLOCKED items, and build/type-check references are satisfied
      • If analysis confirms done → move from .claude/spec/active/{name}/ to .claude/spec/completed/{name}/, delete .claude/.pipeline-states/{name}.json and .diff.md if they exist, log: [HYGIENE] Verified and moved {name} → completed/
      • If analysis finds incomplete items → update Status: implementing, log: [HYGIENE] {name} marked completed but has {N} unchecked items — reverted to implementing, then treat as in-progress (step 4)
  4. In-progress specs (Status: draft or Status: implementing):
    • Use AskUserQuestion: "Found spec in progress: {name} (Status: {status}, Phase: {phase}, {done}/{total} tasks done). Do you want to continue this spec before starting a new one?"
    • If yes → stop, suggest /resume to continue the existing spec
    • If no → proceed to ANALYZE for the new pipeline (existing spec stays in active/)
  5. No active specs → proceed to ANALYZE normally

This step is silent when there's nothing to audit — no output if active/ is empty.

ANALYZE (diagnose + assess)

  1. AUTO-SYNC: Run node .claude/scripts/sync-detect.js. If output shows any subproject with hashChanged: true, then run node .claude/scripts/sync-registry.js. Otherwise skip sync-registry entirely.

Diff Context (automatic)

Diff snapshot (run once per phase): Run node .claude/scripts/diff-context.js at the start of ANALYZE and EXECUTE. Save the output to .claude/.pipeline-states/{specName}.diff.md (overwrite each phase).

Inject into every Task dispatch in this pipeline: Prepend the following to EVERY subagent prompt dispatched during the pipeline:

## Current Git State
{contents of .claude/.pipeline-states/{specName}.diff.md}

## Your Task
...original prompt...

If the diff file is empty or missing, skip the Git State header entirely. Never dispatch an agent without attempting interpolation.

  1. DIAGNOSE: Dispatch Explore agent (≤20 tool uses, ≤3 full file reads):
    • Scoped Grep searches with specific path + pattern for the error/symptom
    • Trace callers/callees via Grep in relevant directories (prefer Grep over Read)
    • Return as soon as root cause is clear — don't exhaustively scan
    • Return: root cause file(s), line(s), explanation
  2. ASSESS — Decision point:
    • Explore returns clear root cause in 1-2 files → Fast Path (skip PLAN)
    • 3+ files, unclear impact, cross-layer → Full Path (brief spec via PLAN)

Fast Path: Go directly to EXECUTE. No spec, no approval gate (Zero Context-Switch Protocol). If you want to review the fix plan before EXECUTE, force Full Path by listing >5 files in the ANALYZE return. Full Path: Write brief spec in .claude/spec/active/{date}-{name}/spec.md, then present the full spec to the user before stopping:

  • Read the spec file just written and print its ENTIRE contents verbatim inside a fenced markdown block (```markdown ... ```). Do NOT summarize — the user asked to read the complete plan before approving.

  • After the fenced block, instruct: "Run /approve (or /approve --resume to chain inline) to proceed to EXECUTE."

  • Fast Path CAN use Task(Explore) ONCE with ≤10 tool uses. Prefer Grep/Glob direct when the root cause location is known.

  • If >5 files surface during DIAGNOSE, RECLASSIFY to Full Path and write a spec before proceeding.

Spec Boundaries

When writing a Full Path spec (or noting files for Fast Path), record which files are in scope under a ## Boundaries section:

## Boundaries
- `path/to/directory/` — directory scope (all files within)
- `path/to/file.ext` — exact file
- `**/*.controller.ts` — glob pattern

Rules:

  • List only files the fix intentionally touches (root cause + direct dependants)
  • For Fast Path: boundaries are implicit from the ANALYZE output — no spec section required
  • Out-of-boundary edits during EXECUTE will surface a [BOUNDARY WARNING] from guard-verify — re-evaluate scope before proceeding

EXECUTE (fix + validate)

Every agent prompt dispatched in Fast Path MUST include: Return format cap: ≤50 lines. Apply compact Return Format from .claude/pipeline-config.md strictly.

Dispatch bugfix agent with:

  • Root cause from ANALYZE
  • {subproject}/CLAUDE.md + {subproject}/.claude/commands/guards.md for context
  • Specific files to modify
  • Expected behavior after fix

Validate:

  • Build check: dotnet build / pnpm typecheck (as applicable)
  • Verify fix resolves the reported issue
  • No regression in adjacent code
  • If build fails: diagnose + fix (max 3 iterations)

Escalation Status Handling

After the bugfix agent returns, check for an escalation status before closing:

  • CONCERN — record verbatim in the bugfix report under ## Concerns; continue to CLOSE
  • BLOCKED — stop immediately; use AskUserQuestion to report the exact blocker; do NOT close
  • PARTIAL — agent fixed some but not all reported issues; resume from the last incomplete fix step (max 2 retries)
  • DEFERRED — agent intentionally left a related issue unfixed with justification; confirm with user before closing

See .claude/pipeline-config.md Escalation Statuses for the full status table.

Retry Compact Advisory

If an agent fails and requires >2 retry attempts during EXECUTE:

  • Suggest to user: "Multiple retries detected — stale context may be contributing. Consider /compact to clear context, then /resume to continue the pipeline."
  • This is advisory only — continue fixing if user declines.

Failure Routing (Bugfix)

Before retrying a failed fix attempt, classify the failure:

  1. Transient? — Would re-running succeed without any change? (flaky test, cache, env) → Retry once immediately.
  2. Resolvable? — Is the fix clear and patchable in ≤3 lines without new reads? → Apply patch, retry (counts as retry 1).
  3. Structural? — Did the original ANALYZE misidentify the root cause? → Re-analyze: dispatch a focused Explore on the actual failure point, update root cause, re-dispatch bugfix agent. Does NOT count against the 2-retry cap.

Max 2 retries for Transient + Resolvable. Structural failures trigger a targeted re-ANALYZE, not a blind retry.

CLOSE

  • node .claude/scripts/sync-registry.js (if entities changed)
  • Output bugfix report (diagnosis, fix, validation)

Zero Context-Switch Protocol

  • NEVER ask "can you show the error?" — find it via logs/Grep
  • NEVER ask "which file?" — trace from the error
  • NEVER ask "how to fix?" — propose + implement
  • CI test fails: read → fix → re-run — without reporting and waiting
  • MANDATORY: Follow Visual Output, Pipeline State, Task Tracking rules at each phase

ULTRATHINK

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/bugfix-bug-fix-pipeline-mrwakehe/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/bugfix-bug-fix-pipeline-mrwakehe' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/bugfix-bug-fix-pipeline-mrwakehe/download' --output '.skill-downloads/bugfix-bug-fix-pipeline-mrwakehe/SKILL.md.part' && mv '.skill-downloads/bugfix-bug-fix-pipeline-mrwakehe/SKILL.md.part' '.skill-downloads/bugfix-bug-fix-pipeline-mrwakehe/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Le fichier ne fournit pas un en-tête name/description exploitable pour cette procédure native. Le téléchargement reste disponible pour lecture ; utilisez le mode manuel ci-dessous.

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/bugfix-bug-fix-pipeline-mrwakehe/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires