Based on Anthropic's "Effective Harnesses for Long-Running Agents" and ClawHub's agent-harness-architect, this skill automatically diagnoses and hardens your OpenClaw harness.
DimensionWhat it checksWhy it mattersSession BridgeIs there a structured state file ( agent-progress.json) that survives restarts?Without this, every session starts blankFixed Startup SequenceDoes the agent have a mandatory first N steps (read bridge, smoke test, etc.)?Prevents skipping crucial initializationSmoke TestDoes the agent verify environment (network, API keys, disk) before tasks?Catches failures earlyAtomic CheckpointAfter each task, does agent commit/save state?Ensures progress isn't lostOutput Self-VerificationBefore saying "done", does agent validate the result?Prevents false completionsState File FormatIs state stored as JSON (not Markdown) to resist accidental edits?Markdown is too easy for LLM to mangleMulti-Agent ProtocolIf multiple agents, is there clear message passing?Avoids race conditions and confusionFallback PlanDoes agent have a Plan B if a dependency fails?Increases robustness
bash
tool("agent-harness-doctor", "harness_check", {"fix_apply": []})
Output includes:
json
{
"summary": {
"score": 6.5,
"grade": "B",
"weakest_dimension": "Session Bridge"
},
"dimensions": [
{
"id": "session_bridge",
"name": "Session Bridge",
"score": 2,
"max": 10,
"finding": "No agent-progress.json file found",
"recommendation": "Create agent-progress.json with lastSession, taskTracking, environmentStatus sections",
"p0": true
},
...
],
"plan": {
"P0": ["create_session_bridge", "fix_startup_sequence"],
"P1": ["add_smoke_test", "enable_atomic_checkpoint"],
"P2": ["output_verification_gate", "multi_agent_protocol"]
}
}
bash
tool("agent-harness-doctor", "harness_check", {"fix_apply": ["create_session_bridge", "fix_startup_sequence"]})
The tool will:
agent-progress.json in workspace root with templateAGENTS.md or CLAUDE.md to include a fixed startup sequence sectionbash
tool("agent-harness-doctor", "apply_fix", {"fix_id": "create_session_bridge"})
create_session_bridge — generates agent-progress.json with schema v1.0fix_startup_sequence — inserts mandatory startup steps into AGENTS.md (if present)add_smoke_test — adds pre-task environment check (gateway status, API connectivity)enable_atomic_checkpoint — adds post-task commit templateoutput_verification_gate — injects self-check prompt into system instructionsstate_json_format — migrates existing state files from MD to JSONfallback_plan_template — adds fallback handling patterns to AGENTS.mdIf memory-stack-core is installed, harness doctor will:
$99 one-time. Includes:
Based on ClawHub's agent-harness-architect skill, extended with auto-fix capabilities.