Déboguer une tâche de code

VérifiéPrudence

Récupère les métadonnées et les journaux d’exécution d’une tâche d’agent de code depuis Firestore. Utile lorsque l’utilisateur partage une URL de « code-task » (dev.intexuraos.cloud ou intexuraos.cloud) ou un identifiant de tâche (task_*) avec une intention de débogage ou d’investigation.

Spar Skills Guide Bot
DeveloppementIntermédiaire
12002/06/2026
Claude Code
#debug#code-tasks#firebase#logs#investigation

Recommandé pour

Notre avis

Ce skill permet de déboguer des tâches de code-agent en récupérant les métadonnées et les logs depuis Firestore, en se basant sur une URL ou un ID de tâche.

Points forts

  • Accès direct aux logs structurés depuis Firestore pour analyser l'exécution
  • Intègre la récupération des logs orchestrateur et conteneur Docker pour un diagnostic approfondi
  • Détection automatique de l'environnement (dev/prod) à partir de l'URL

Limites

  • Nécessite un accès au monorepo et aux scripts Claude associés
  • L'analyse ne doit pas spéculer sans preuves issues des logs
  • Certains logs (orchestrateur sur mac-dev) ne sont pas accessibles à distance
Quand l'utiliser

Lorsque vous devez comprendre pourquoi une tâche de code-agent a échoué ou s'est mal comportée, avec une URL ou un ID de tâche.

Quand l'éviter

Ne pas utiliser pour des tâches sans intention de débogage (simple question sur le statut) ou lorsque les logs Firestore sont déjà suffisants sans investigation avancée.

Analyse de sécurité

Prudence
Score qualité88/100

While the skill is intended for legitimate debugging of an internal system, it involves powerful and potentially risky operations such as SSH access to other machines, reading system logs via journalctl, and inspecting Docker containers. The use of firebase-admin suggests access to production data. Though well-written with safety rules, the skill's capabilities warrant a 'caution' rating.

Points d'attention
  • The skill includes SSH commands to remote machines (ssh home-dev journalctl...), which if misused could allow unauthorized access.
  • Uses docker commands (docker logs) to inspect containers, potentially exposing internal runtime details.
  • Instructs running a Node.js script with firebase-admin, which likely has elevated database access.

Exemples

Debug a production task
https://intexuraos.cloud/#/code-tasks/task_abc123 — what went wrong with this task?
Investigate by task ID
I need to investigate task_task_xyz789, it looks like it failed.
Fetch logs for a dev task
Fetch logs for the task at https://dev.intexuraos.cloud/#/code-tasks/task_def456 — only show the last 50 lines.

name: debug-code-task description: Use when user pastes a dev.intexuraos.cloud or intexuraos.cloud code-task URL and asks to debug, investigate, or understand what went wrong. Also use when user mentions a code task ID (task_*) with investigation intent.

Debug Code Task

Investigate code-agent task execution by fetching task metadata and logs from Firestore.

Invocation Detection

| Input Pattern | Action | | ------------------------------------------------------- | ------------------------- | | https://dev.intexuraos.cloud/#/code-tasks/task_* | Extract task ID, env=dev | | https://intexuraos.cloud/#/code-tasks/task_* | Extract task ID, env=prod | | task_<uuid> + "debug"/"investigate"/"what went wrong" | Use task ID directly |

Phase 1: Environment Detection

Parse the URL. Do NOT fetch it — hash-routed SPA returns only shell HTML.

| Signal | dev | prod | | ------ | ---------------------- | ------------------------------ | | URL | dev.intexuraos.cloud | intexuraos.cloud (no dev.) |

Run uname -n to confirm current machine.

Phase 2: Fetch Task Document

Extract task ID from URL hash: /#/code-tasks/{taskId} — everything after the last /.

Run from monorepo root (required for firebase-admin module resolution):

node .claude/skills/debug-code-task/scripts/fetch-task.cjs <taskId>

Print key fields as a summary table: id, status, linearIssueId, workerLocation, agentType, result.summary, error.

Phase 3: Fetch Log Lines

node .claude/skills/debug-code-task/scripts/fetch-task.cjs <taskId> --logs-only

Use --logs instead to fetch both task document and logs in one call. Pipe through head -N if user wants a subset. Logs are ordered by sequence number. Each line has format: [sequence] HH:MM:SS.mmm [source] message.

Present log lines to user. Do NOT analyze or speculate about root cause without evidence from the logs.

Phase 4: Orchestrator & Container Logs (optional, on request)

Only needed when Firestore logs are insufficient.

The orchestrator runs on the same machine as the worker. Read workerLocation from the task document (Phase 2) to determine which machine.

Orchestrator Logs

Check uname -n vs task's workerLocation. If on a different machine:

  • From mac-dev → SSH to home-dev: ssh home-dev journalctl -u intexuraos-orchestrator@pbuchman --since ... --until ...
  • From home-dev → cannot SSH to mac-dev. Tell the user.

| Machine | How orchestrator runs | Log command | | ------------ | ---------------------------------------------------------- | ---------------------------------------------------------------------------------- | | home-dev | systemd (intexuraos-orchestrator@pbuchman) | journalctl -u intexuraos-orchestrator@pbuchman --since "<time>" --until "<time>" | | mac-dev | pnpm --filter orchestrator dev in ~/deploy/intexuraos/ | Terminal output where the dev process is running. Code not auto-deployed on push. |

Derive time window from task document createdAt._seconds and completedAt._seconds:

date -d @<createdAt._seconds> '+%Y-%m-%d %H:%M:%S'   # --since (subtract 1 min)
date -d @<completedAt._seconds> '+%Y-%m-%d %H:%M:%S'  # --until (add 1 min)

Docker Container Logs

Containers are named claude-worker-{taskId}:

docker logs claude-worker-{taskId}

Only available while the container exists (running or exited but not yet removed). If the container is gone, Firestore log lines (Phase 3) are the only source.

Critical Rules

  1. NEVER WebFetch/curl the SPA URL. Data is in Firestore, not the HTML page.
  2. NEVER run node scripts from /tmp. firebase-admin resolves from monorepo node_modules.
  3. NEVER use node -e for scripts with !. Shell escapes ! — use the script file.
  4. NEVER speculate about what went wrong. Present facts from the task document and logs. Let the user drive analysis.
Skills similaires