thu-nmrc/openharness/openharness
Claude Code and agent skill by thu-nmrc/openharness
- community
Checking that the SKILL.md file is still in the repository.
A production-grade framework for long-running, autonomous agents based on Harness Engineering principles. Features three-layer self-healing memory, circuit breaker protection, KAIROS dream-mode consolidation, and multi-agent coordination. When a user describes a task idea, Agent automatically initializes the workspace, fills all template files, sets up the cron schedule, and begins execution immediately.
Install
npx vskill@latest install thu-nmrc/openharness/openharnessSKILL.md
Harness-24h | 24-hour Harness Framework
This skill provides a complete framework for executing long-running, autonomous tasks based on the principles of Harness Engineering.
Key principle: The user only describes their task idea. Agent handles everything else — workspace creation, filling all files, setting up the cron schedule, and starting execution.
Core Concepts
The framework is built around 10 core components of Harness Engineering:
- Machine-verifiable contracts:
mission.mdandeval_criteria.md - Knowledge as system of record:
playbook.md - Agent senses and effectors: Configured via
harness_boot.py - Solving long-term amnesia: Three-Layer Memory Architecture (see below)
- Externalized validation loop:
harness_eval.py - Mechanized constraints and entropy control:
harness_cleanup.py - Three-Layer Self-Healing Memory: Pointer index + topic files + grep-only stream
- Circuit Breaker Protection: Auto-block after N consecutive failures
- KAIROS Dream Mode: Offline memory consolidation during idle periods
- Multi-Agent Coordination: File-system IPC for parallel subtask execution
For detailed architecture, read references/architecture.md. For common anti-patterns to avoid, read references/anti-patterns.md.
Three-Layer Memory Architecture
| Layer | File(s) | Purpose | Access Pattern | |
|---|---|---|---|---|
| L1 | heartbeat.md | Compact pointer index (< 2KB) | Always in context | |
| L2 | knowledge/*.md | Topic-specific knowledge files | On-demand loading | |
| L3 | logs/execution_stream.log | Append-only raw execution log | Grep-only, never read fully |
Strict Write Discipline: Only update L1 pointers AFTER harness_eval.py confirms success.
Workflow A: User Describes a New Task (FULLY AUTOMATIC)
When a user describes a task idea, follow ALL steps below without asking the user to fill in any files manually.
Step A1: Decide Workspace Path
Choose a workspace path based on the task name. Convention:
Step A2: Initialize Workspace
This copies all template files and creates knowledge/, logs/, and output/ directories.
Step A3: Fill ALL Template Files Yourself
Based on the user's task description, Agent must write the following files completely. Do NOT leave any placeholder text.
File 1 — `mission.md`: Write the task contract with machine-checkable completion criteria.
File 2 — `playbook.md`: Write the step-by-step execution guide with explicit tools, URLs, and failure handling.
File 3 — `eval_criteria.md`: Write the external validation rules with Python code snippets.
File 4 — `cron_config.md`: Write the scheduling config with cron expression and prompt template.
File 5 — `heartbeat.md`: Write the initial Layer 1 pointer index.
IMPORTANT: Write to{workspace}/heartbeat.md(workspace root).Use the three-layer template format with System Status, Execution Pointer, Knowledge Index, and Active Alerts sections.Initial state:idle,Step 0, Circuit Breakeroff.
File 6 — `progress.md`: Write the initial progress log at {workspace}/progress.md.
Step A4: Create Output Directory Structure
Step A5: Verify Workspace is Ready
The output must say "Workspace is ready". If it shows issues, fix them.
Step A6: Set Up Cron Schedules
Primary Schedule (Main Task Execution):
Read the output and use the schedule tool with those parameters.
Secondary Schedule (KAIROS Dream Mode — REQUIRED):
Dream mode MUST be scheduled separately to run during off-hours (e.g., 3 AM daily). This is NOT optional — it prevents memory bloat and knowledge fragmentation.
Use the schedule tool with these parameters:
Step A7: Execute the First Run Immediately
Do NOT wait for the first cron trigger. Begin executing using Workflow B below.
Workflow B: Executing a Task (Cron Trigger)
Step B1: Boot and Check Status
Read the output carefully:
- If
mission_complete→ Stop. - If
blockedor Circuit Breakertripped→ Stop. Wait for human intervention. - If stuck detected (status still
running) → Boot will auto-recover. - Otherwise → Proceed.
Step B2: Mark Start
Step B3: Read Context (Cache-Aware Order)
Read in this order to maximize prompt cache hits (static content first):
{workspace}/mission.md— goal and constraints (rarely changes){workspace}/eval_criteria.md— validation rules (rarely changes){workspace}/playbook.md— execution steps (semi-static){workspace}/heartbeat.md— current state pointer (changes each run)- Only load
knowledge/*.mdtopic files relevant to the current step
How to find relevant knowledge topics:
Then read only the knowledge/{topic}.md files mentioned in heartbeat.md's Knowledge Index section.
Step B4: Execute from Breakpoint
Perform the steps defined in playbook.md, starting from the step recorded in heartbeat.md.
During execution, actively use the memory system:
Log significant events (use liberally — this feeds KAIROS dream mode):
Save reusable knowledge (when you discover a pattern or workaround):
This creates/updates knowledge/api_rate_limits.md and registers the pointer in heartbeat.md.
Step B5: Mark Completion or Failure
If succeeded:
If failed:
Step B6: External Validation
Step B7: Entropy Control (Every 10 Runs)
This auto-compacts progress.md if it exceeds 2000 lines, archives old execution stream logs, and checks memory integrity.
Step B8: Mission Complete Check
If all completion criteria met:
Workflow C: KAIROS Dream Mode (Scheduled Off-Hours)
When to run: Automatically via the secondary cron schedule set up in Step A6. Typically runs once daily at 3 AM.
What it does:
- Reads
logs/execution_stream.logfrom the last 24 hours - Extracts recurring patterns (errors, successes, warnings)
- Consolidates fragmented
knowledge/*.mdfiles - Prunes stale Layer 1 pointers from
heartbeat.md - Updates
playbook.mdwith distilled best practices - Writes a human-readable journal to
logs/dream_journal.md
Manual invocation (for testing or immediate consolidation):
CRITICAL: Dream mode should ONLY run when the main task is idle (status != running). The scheduled prompt in Step A6 handles this check automatically.
Workflow D: Multi-Agent Parallel Execution (Optional)
When to use: When a single step in playbook.md involves processing multiple independent items (e.g., "Scrape 100 product pages", "Analyze 50 PDF documents").
When NOT to use: For sequential steps or when items depend on each other.
Step D1: Initialize Agents
This creates agents/worker-1/, agents/worker-2/, agents/worker-3/, each with inbox/, outbox/, and manifest.json.
Step D2: Dispatch Subtasks
For each independent item, dispatch a subtask:
Each task is written as an XML-like Markdown file to an available worker's inbox/.
Step D3: Execute Worker Tasks
Important: The coordinator does NOT auto-execute. You must manually process each worker's inbox.
For each worker (1, 2, 3):
Step D4: Monitor and Collect
Check status:
Collect all results from worker outboxes:
This reads all outbox/result_*.md files, updates worker manifests back to idle, and prints a summary.
Step D5: Cleanup
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingSKILL.md
Popularity
- Repository stars
- 116
- Repository forks
- 20
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/thu-nmrc/openharness/openharness)