workflow-doctor
Validate active workflow state before any role acts on it.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 65
- Forks
- 0
01 前言 Front Matter
- name
- workflow-doctor
- description
- Validate active workflow state before any role acts on it.
03 SKILL.md 正文
Objective
Validate the active agent-surface workflow state before any role acts on it. Stay read-only: run agent-surface workflow doctor, then the checks that command does not perform.
.agent-surface/workflows/current.json
.agent-surface/workflows/<run_id>/run.json
.agent-surface/workflows/<run_id>/events.ndjson
.agent-surface/workflows/<run_id>/boss.json
.agent-surface/workflows/<run_id>/worker.json
.agent-surface/workflows/<run_id>/reviewer.json
.agent-surface/workflows/<run_id>/judger.json
.agent-surface/workflows/<run_id>/rescue.json
.agent-surface/workflows/<run_id>/agents.json
.agent-surface/workflows/<run_id>/rounds/<round_id>/
.cursor/.workflow/ is an adapter compatibility surface only; it never overrides canonical .agent-surface/workflows/ state.
Checks
Resolve <run_id> from .agent-surface/workflows/current.json, then run agent-surface workflow doctor --run <run_id>. It fails when:
run.jsonorevents.ndjsonis missing,run.jsonfailsworkflow.run.schema.json, or itsrun_idis not<run_id>.- An
events.ndjsonline is not JSON, fails the event schema, names another run, or breaks theprev_event_hash/event_hashchain. - A root or
rounds/round-<n>/boss.jsonfails the boss schema or coherence rules, names another run or round, has noworkflow-bossevent carrying its hash, or (root copy) differs from the latest canonical round. - A root
worker.json,reviewer.json,judger.json, orrescue.jsonfails its schema; doctor checks nothing else about these files. - Task buckets in
run.jsonoverlap, hold a task ID that no event-backed BOSS artifact defines, or miss a task from the latest event-backed BOSS. Prior-round accepted/closed IDs may remain. agents.json, when present, failsworkflow.monitor.v2, names another run or an unknown task, gives concurrent writers a shared workspace or overlapping filescope, exceeds the retry budget, holds a stalled agent, lists a materialized output that is missing, outside the run, empty, a control file, older than the attempt, or future-dated, has out-of-order or future timestamps, or exceeds the first-output, no-progress, or role timeout.- An active run's
run.json.workflow_next_commanddiffers from the latest event'sto, meaningrun.jsonwas edited by hand or an apply did not finish.
Verify by hand, because the command does not: current.json; branch and base commit against git; parent artifact hashes; evidence files; that every non-boss role artifact was applied (an unapplied artifact passes); non-boss canonical round copies; .cursor/.workflow/ copies; and that .agent-surface/workflows/ is gitignored.
Rules
- Do not repair artifacts, and do not choose the newest file by mtime.
- Do not trust
.cursor/.workflow/when canonical.agent-surface/workflows/exists. If canonical and compatibility artifacts disagree, canonical wins and status is at leastWARN. - A schema-valid but contradictory task disposition is
FAIL. - A stale running session is
FAILfor further automatic routing; mark or terminate it before the next transition. It is not automatically a product blocker.
Output
{
"status": "PASS|WARN|FAIL",
"run_id": "id or null",
"canonical_dir": ".agent-surface/workflows/<run_id>",
"issues": [
{ "severity": "blocker|major|minor", "check": "short check name", "evidence": "file/path/field", "fix": "concrete next action" }
],
"next_command": "workflow-boss|dev-feature|dev-fix|dev-chore|dev-refactor|qa-trace|qa-review|workflow-reviewer|workflow-judger|workflow-rescue|workflow-close|null"
}
04 同仓库更多 Skills
workflow-runtime
Prove skill or workflow discovery, full-autonomy tool execution, and task-shaped materialization before assigning a CLI, extension, provider, or model to a workflow role.
workflow-reviewer
Review batched implementation output against the BOSS spec and evidence.
workflow-rescue
Resolve repeated workflow failures with a single decisive action.
workflow-orchestrator
Run risk-adaptive development, review, multi-agent, and release workflows with runtime preflight, bounded retries, liveness checks, isolated writers, and evidence-backed handoffs.
workflow-judger
Arbitrate repeated task failures and decide merge, rework, or escalation.
workflow-close
Close an accepted or aborted workflow run while preserving history.