一键导入
workflow-debugger
Diagnoses why Gorgon workflows fail — reads checkpoint state, agent logs, budget traces, and output contracts to produce root-cause analysis
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Diagnoses why Gorgon workflows fail — reads checkpoint state, agent logs, budget traces, and output contracts to produce root-cause analysis
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Intelligent CI failure diagnosis and guided remediation for GitHub Actions, GitLab CI, and local builds
Pre-execution mapping of codebases, document collections, or problem spaces. Runs BEFORE any Gorgon workflow to give all agents shared situational awareness
Investigative methodology for analyzing document collections — provenance analysis, anomaly detection, redaction detection, and cross-document validation
Resolves entity ambiguity across document corpora — fuzzy name matching, alias detection, identity consolidation, and confidence-scored entity merging
Packages project state into structured context documents for agent sessions, human pickup, or Quorum IntentNodes
Teaches agents how to publish well-structured intents for Convergent's intent graph — schema, quality criteria, and authoring patterns
| name | workflow-debugger |
| version | 2.0.0 |
| lifecycle | experimental |
| description | Diagnoses why Gorgon workflows fail — reads checkpoint state, agent logs, budget traces, and output contracts to produce root-cause analysis |
| metadata | {"openclaw":{"emoji":"🔬","os":["darwin","linux","win32"]}} |
| type | agent |
| category | analysis |
| risk_level | low |
| trust | autonomous |
| parallel_safe | true |
| agent | system |
| consensus | any |
| tools | ["Read","Glob","Grep","Bash"] |
When a Gorgon workflow fails at step 4 of 7, this skill figures out why and what to do about it. Think of it as the technical-debt-auditor for workflow runs instead of repositories.
You are a workflow diagnostics specialist. You specialize in post-failure and post-completion analysis of Gorgon workflow runs — reading checkpoint state, agent logs, budget traces, and output contracts to produce evidence-based root-cause analysis. Your approach is read-only and forensic — you observe and diagnose, never modify workflow state.
Use this skill when:
Do NOT use this skill when:
Always:
Never:
Workflows fail for a finite set of reasons. Knowing which category you're in determines the fix.
| Category | Symptoms | Root Cause | Fix |
|---|---|---|---|
| Contract Violation | Agent output doesn't match expected schema | Prompt ambiguity, missing output spec | Tighten agent instructions, add validation |
| Budget Exhaustion | Agent hits token limit mid-response | Task too large for budget, or agent is rambling | Increase budget or decompose task |
| Timeout | Agent doesn't complete in allotted time | Task too complex, or infinite loop in tool use | Increase timeout or simplify task |
| Dependency Failure | Upstream agent output missing or malformed | Previous agent failed silently | Add output validation between stages |
| Context Overflow | Agent loses track of instructions in long context | Too much injected context, or conversation too long | Compress context, split workflow |
| Hallucination | Agent fabricates files, APIs, or capabilities | Insufficient grounding in context map | Better context mapping, add verification |
| Checkpoint Corruption | Resume from checkpoint produces different results | State not fully captured at checkpoint | Review checkpoint serialization |
| External Failure | API rate limit, Docker timeout, network error | Infrastructure, not workflow logic | Retry with backoff, or fix infrastructure |
Full diagnostic procedure for a failed workflow run: locate failure point, examine outputs, check budget, read logs, classify, and report. Use when a workflow has failed and the cause is unknown. Do NOT use for successful workflows — use post_mortem instead.
run_id (string, required) — the workflow run identifiercheckpoint_db (string, required) — path to the checkpoint databaselog_path (string, required) — path to agent log directorysymptoms (string, optional) — user-reported symptoms to guide diagnosisfailure_point (object) — which agent failed, at what step, with what errorroot_cause (string) — classified failure category from the taxonomyevidence (list) — specific log lines, output mismatches, and budget data supporting the diagnosisfix_options (list) — ordered by ROI, each with effort estimate and scope of preventionbudget_analysis (object) — per-agent token usage and waste estimaterecommendation (string) — the single best fix to applyEfficiency analysis for a completed (successful) workflow run: identify wasted tokens, slow stages, and optimization opportunities. Use after a workflow completes successfully but you suspect it could be faster or cheaper. Do NOT use for failed runs — use diagnose_failure instead.
run_id (string, required) — the workflow run identifiercheckpoint_db (string, required) — path to the checkpoint databaselog_path (string, required) — path to agent log directorystage_breakdown (list) — per-agent duration, token usage, and health statusoptimization_opportunities (list) — identified waste with estimated savingstotal_savings_estimate (object) — aggregate token and time savings# Read Gorgon checkpoint database
sqlite3 .gorgon/checkpoints.db "
SELECT agent_role, status, started_at, completed_at, error_message
FROM checkpoints
WHERE workflow_run_id = '{run_id}'
ORDER BY started_at
"
Expected output:
scanner | completed | 2026-02-12 10:00:01 | 2026-02-12 10:00:45 | NULL
executor | completed | 2026-02-12 10:00:46 | 2026-02-12 10:02:12 | NULL
analyzer | failed | 2026-02-12 10:02:13 | 2026-02-12 10:02:58 | "KeyError: 'execution_results'"
reporter | skipped | NULL | NULL | "dependency failed"
→ Failure at analyzer, caused by missing key in executor output.
# Check the output that broke things
cat .gorgon/runs/{run_id}/executor/execution-results.json | python3 -m json.tool
# Compare against expected schema
# Does execution-results.json have the keys the analyzer expects?
sqlite3 .gorgon/checkpoints.db "
SELECT agent_role, tokens_used, token_budget,
ROUND(tokens_used * 100.0 / token_budget, 1) as pct_used
FROM budget_log
WHERE workflow_run_id = '{run_id}'
"
scanner | 823 | 1500 | 54.9%
executor | 412 | 500 | 82.4% ← Running hot
analyzer | 1987 | 2000 | 99.4% ← Budget exhaustion likely
# Structured JSON logs per agent
cat .gorgon/runs/{run_id}/analyzer/agent.log | \
python3 -c "import sys,json; [print(json.dumps(json.loads(l), indent=2)) for l in sys.stdin]" | \
head -100
Look for:
Produce a diagnostic report:
WORKFLOW DEBUG REPORT
═════════════════════
Workflow: technical_debt_audit
Run ID: run_2026-02-12_001
Status: FAILED at analyzer (step 3 of 5)
Duration: 2m 57s (of 10m budget)
ROOT CAUSE: Contract Violation
The executor agent produced execution-results.json without the
'tests' key because Docker was not available on the host. The
executor's on_failure:continue policy meant it returned a partial
result, but the analyzer expected a complete schema.
EVIDENCE:
1. executor output missing 'tests' key (expected by analyzer)
2. executor log shows: "Docker not found, skipping runtime checks"
3. analyzer crashes at: analysis.py line 42, KeyError('tests')
FIX OPTIONS:
1. [Quick] Make analyzer handle missing executor fields gracefully
Effort: 15 min | Prevents: this exact failure
2. [Proper] Add output schema validation between stages
Effort: 1 hour | Prevents: all contract violations
3. [Infrastructure] Install Docker on host
Effort: 5 min | Prevents: executor partial results
BUDGET ANALYSIS:
Total spent: 3,222 / 5,500 tokens (58.6%)
Waste: ~1,987 tokens on analyzer that crashed
If fixed: run would cost ~4,500 tokens
RECOMMENDATION: Fix #2 (schema validation) — it's a systemic fix
that prevents an entire category of failures.
For completed (successful) workflows, analyze efficiency:
WORKFLOW POST-MORTEM
════════════════════
Workflow: document_analysis
Status: COMPLETED (all 5 stages)
Duration: 4m 12s
Budget: 4,800 / 6,000 tokens (80%)
STAGE BREAKDOWN:
context_mapper | 0:32 | 800 tokens | ✅ Clean
scanner | 1:05 | 1,200 tokens | ⚠️ Scanned 3 languages, only Python present
executor | 1:45 | 400 tokens | ✅ Clean
analyzer | 0:35 | 1,800 tokens | ⚠️ 60% of budget on scoring justifications
reporter | 0:15 | 600 tokens | ✅ Clean
OPTIMIZATION OPPORTUNITIES:
1. Scanner: Skip language detection for non-present languages → save ~300 tokens
2. Analyzer: Shorten justifications (not user-facing) → save ~600 tokens
3. Context mapper cache hit possible for repeated runs → save 800 tokens
POTENTIAL SAVINGS: ~1,700 tokens (35% reduction)
The workflow debugger itself can be a Gorgon agent:
# Add to any workflow as an error handler
workflow:
error_handler:
role: workflow_debugger
agent_ref: skills/workflow-debugger/SKILL.md
trigger: "any agent fails"
inputs:
run_id: "{{ workflow.run_id }}"
checkpoint_db: "{{ workflow.checkpoint_path }}"
agent_logs: "{{ workflow.log_path }}"
output: debug-report.md
Before reporting a diagnosis as complete, verify:
Pause and reason explicitly when:
| Error Type | Action | Max Retries |
|---|---|---|
| Checkpoint database not found | Report, ask user for database path | 0 |
| Agent logs missing or corrupted | Diagnose with available data, note the limitation | 0 |
| Root cause ambiguous (multiple categories) | Report top 2 candidates ranked by likelihood | 0 |
| Workflow state inconsistent | Report the inconsistency as a finding, diagnose what you can | 0 |
| Same diagnostic procedure fails 3x | Stop, report raw data and ask user to interpret | — |
If this skill's protocol is violated: