dev-stack-debug
FreeNo executable scriptsNot checkedDebug full-stack issues in a running dev stack (docker + API + worker + frontend) by reading logs directly, writing API tests, and targeting user stories…
by pdl-openair★ 16 GitHub starsAbout this skill
Dev Stack Debug
When the user reports a bug in a running local dev stack, follow this workflow. The key principle: you can read logs and run API tests yourself — never ask the user to paste logs or error messages. They are your background processes.
1. Stack lifecycle
Starting the stack
# Terminal 1: infrastructure
docker compose up -d postgres minio
# Terminal 2: API (background)
cd services/api
.venv/Scripts/python.exe -m uvicorn app.main:app --host 127.0.0.1 --port 8000
# Terminal 3: Worker (background) — needed for research-start + execution
cd services/api
.venv/Scripts/python.exe -m worker.entrypoint
# Terminal 4: Frontend (background)
pnpm.cmd --filter @openair/web dev
All four components must run. Missing the worker → task creation hangs in "waiting". Missing the API → frontend has nothing to talk to.
Where logs live
Logs are written to $CLAUDE_JOB_DIR/tmp/{api,worker,web}.log. Read them
directly with tail / grep — do not ask the user to copy-paste.
Health check sequence
curl -s http://127.0.0.1:8000/health # API
grep "worker_first_poll_ready" worker.log # Worker
curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:5173 # Frontend
Restarting after code changes
After fixing backend code: restart both API and worker (the worker imports the same modules). Frontend changes are picked up by Vite HMR automatically.
After migration changes: the API auto-applies migrations at bootstrap
(migrations_auto_apply=true). For immediate testing, apply manually:
docker compose exec -T postgres psql -U openair -d openair -f - < services/api/migrations/<migration>.sql
2. Debug methodology
Step 1: Read the logs first
When a user reports "it failed" or "it's wrong", the logs tell you what happened before anything else. The sequence:
- API log:
grep -E "<task_id>|→ [45][0-9][0-9]|Traceback|Exception|ERROR" api.log - Worker log:
grep -E "<task_id>|dispatch|failed|error|rejected|claimed" worker.log - Frontend log: rarely needed (Vite HMR errors only)
Key log patterns:
→ 200with wrong data → projection/serialization bug (data correct in DB but API response wrong)→ 404→ scope mismatch or missing field in artifact/runtime data→ 409→ revision conflict or state precondition not met→ 428→ missing required request fields→ 500→ unhandled exception; read the traceback→ 503→ postgres middleware allowlist (new write route not registered inmain.py)quota_exhausted→ user's daily token quota is spent (not a code bug)artifact_schema_invalid→ model under-produced a complex contractworker_first_poll_readyabsent → worker crashed at startup (read traceback)
Step 2: Inspect the DB
When logs show the API returning wrong data, compare the DB row vs the API response to find where the transformation breaks:
# Task state
docker compose exec -T postgres psql -U openair -d openair -c \
"SELECT task_id, status, revision, payload->>'creationStatus',
jsonb_array_length(payload->'substageRuntimeStates') AS srs,
payload->'progressProjection' IS NOT NULL AS has_pp
FROM openair_tasks WHERE task_id='<id>';"
# Artifact storage
docker compose exec -T postgres psql -U openair -d openair -c \
"SELECT artifact_id, storage_type, source_task_id, content_sha256
FROM openair_artifacts WHERE source_task_id='<id>';"
Step 3: Write an API test
Write a small Python script (using stdlib urllib) that hits the real API and
asserts on the response. This is more reliable than asking the user to click
through the UI and describe what they see.
import json, urllib.request
BASE = "http://127.0.0.1:8000"
H = {"X-OpenAIR-Owner-Id": "<owner>", "X-OpenAIR-Workspace-Id": "<ws>",
"X-OpenAIR-Created-By": "<owner>", "Content-Type": "application/json"}
def get(path):
r = urllib.request.Request(BASE + path, headers=H)
with urllib.request.urlopen(r, timeout=20) as resp:
return resp.status, json.loads(resp.read().decode())
# Test the failing endpoint
status, body = get("/api/tasks/<task_id>")
print(status, body.get("creationStatus"), body.get("progressProjection") is not None)
Save scripts to $CLAUDE_JOB_DIR/tmp/. Use ASCII-only request bodies (shell
mangles UTF-8 in curl -d).
Step 4: Fix → restart → re-test
After fixing code:
- Restart the affected process (API, worker, or both)
- Re-run your API test script
- If it passes, tell the user to verify in the UI
Never hand off a fix to the user for UI testing without first verifying it via API yourself.
3. Known bug magnets
These are recurring failure patterns in this codebase. When debugging, check them first — they account for the majority of user-visible bugs.
progressProjection is null
Symptom: Workbench renders wrong stage count (shows all 4 stages instead of the design's actual instances), or start button is stuck.
**Root
Install dev-stack-debug in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the dev-stack-debug skill do?
Debug full-stack issues in a running dev stack (docker + API + worker + frontend) by reading logs directly, writing API tests, and targeting user stories until they pass. Use this skill whenever the user reports a bug in a running local dev environment — frontend rendering wrong, button stuck, execution failed, clone broken, "暂不可用", blank workbench, 4xx/5xx errors. Covers: starting/monitoring the dev stack, reading API/worker logs, writing HTTP API verification scripts, identifying known bug magnets (progressProjection, clone fork fields, quota exhaustion), and iterating on fixes until user stories pass.
How do I install the dev-stack-debug skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the dev-stack-debug skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
by Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
by Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
by Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
by Anthropic