Harness Engineering: A reliable AI agent is not just a raw model. It is defined as:
$$\text{Reliable Agent} = \text{Model (AI)} + \text{Harness (Controls)} + \text{Human Auditor}$$
HarnessKit is a complete AI-assisted software engineering framework built on Harness Engineeringβthe principle that true reliability comes from enclosing generative models inside structured execution scaffolds, persistent memory, domain modeling, and strict test-driven quality loops.
At the core of HarnessKit is the Foundation Triad: three indispensable skills that establish project context, specify business domains, and guarantee code correctness. Every higher-level workflowβwhether manual pair-programming or fully sovereign autonomous executionβrests entirely upon this foundation.
The Persistent Memory & Context Routing Engine
AI models suffer from context drift and hallucinations across long coding sessions. project-memory acts as the agent's long-term brain, creating and maintaining standardized living documentation in docs/:
- Architecture Decision Records (ADRs): Establishes mandatory baseline rules in
docs/adr/ARCHITECTURE.md(patterns, layers, constraints) anddocs/adr/TESTS.md(frameworks, test conventions, coverage bars). - Token-Efficient Graph Indexing: Generates
docs/.digest.md(fast executive orientation <60 lines) anddocs/.graph.json(macro relation graph for 1-hop document and dependency lookup). - Feature Micrographs: Embeds machine-readable routing blocks (
entrypoints,registration_files,reference_files,code_files,test_files) directly indocs/feature/*.mdso agents navigate codebases without costly repository scans. - Strict Constraints: Enforces character caps (<8,000 chars per ADR), imperative rules (
REQUIRED,PROHIBITED), and prevents architectural degradation over time.
The Domain-Driven Design (DDD) Modeling & Specification Engine
Before writing a single line of production code, scope-refinement breaks down requirements through rigorous Domain-Driven Design across four sequential phases:
Phase 1: Problem Space β 001-problem-space.md (Domain Events, Subdomains, Ubiquitous Language)
Phase 2: Context Map β 002-context-map.md (Bounded Contexts, Integrations, Upstream/Downstream)
Phase 3: Tactical Design β 003-*-tactical-design.md (Aggregates, Entities, Value Objects, Ordered Tasks)
Phase 4: Test Scenarios β 004-*-test-scenarios.md (Given-When-Then Scenarios mapped to dev tasks)
- Eliminates Ambiguity: Resolves domain naming, business invariants, and boundaries prior to implementation.
- Pre-Specified Verification: Generates concrete Given-When-Then test cases in Phase 4 that directly dictate what the implementation phase must fulfill.
- Dual Execution: Runs interactively with human feedback gates or in headless autonomous mode.
The Test-Driven Development & Verification Engine
tdd-orchestrator coordinates the implementation phase by enforcing the Iron Law of TDD: no production code without a failing test first.
- Step 1 β RED Phase: Translates the Given-When-Then test scenarios from
004-*-test-scenarios.mdinto executable test code. Strictly verifies that tests fail before touching production code. - Step 2 β GREEN + REFACTOR: Implements the minimal code required to pass tests, followed by structural refactoring to eliminate duplication while keeping test suites green.
- Step 3 β Auto-Debugging Gate: If tests fail unexpectedly, automatically routes diagnosis to the
developer-debuggingagent for root-cause analysis (5 Whys) before attempting fixes. - Step 4 β Final Validation & Doc Sync: Executes the complete test suite for regression checks and invokes
project-memoryto update living feature docs (docs/feature/*.md) and API contracts.
The Foundation Triad forms a closed, self-sustaining loop that transforms raw requirements into verified, fully documented features:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. INITIALIZE MEMORY β
β `project-memory` scans repo β creates baseline ADRs & graph indexes β
ββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 2. MODEL DOMAIN & SPECS β
β `scope-refinement` runs DDD β produces tactical plan & test scenarios β
ββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 3. TEST-DRIVEN IMPLEMENTATION β
β `tdd-orchestrator` executes RED β GREEN β REFACTOR against test scenariosβ
ββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 4. SYNC LIVING MEMORY β
β `project-memory` updates `docs/feature/*.md` and `.graph.json` indexes β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
HarnessKit supports two primary ways to operate:
Invoke skills individually during daily development:
- Run
/harness-kit:project-memorywhen onboarding a repo or documenting architectural changes. - Run
/harness-kit:pbb-designwhen turning an initial product or feature scope into a traceable Product Backlog. - Run
/harness-kit:scope-refinementwhen planning a complex feature or breaking down a new business domain. - Run
/harness-kit:tdd-orchestratorwhen executing test-first implementation for specific tasks.
For hands-off execution, the autonomous-orchestrator skill chains the entire Foundation Triad together in an atomic, continuous loop:
- Sovereign Execution: Executes domain planning, TDD implementation, and validation gates end-to-end without pausing for redundant questions.
- Live Auditing in the Cockpit: The human engineer acts as auditor with real-time telemetry and full command:
- Pull Emergency Brake (
Ctrl+C): Kill execution instantly if architectural drift occurs. - Hot-Interception: Inject new requirements or edit backlog files mid-flight.
- Dynamic Tuning: Adjust quality gate thresholds (e.g. acceptance scores,
maxReworks).
- Pull Emergency Brake (
- Product State Machine: Tracks progress through dynamic transition gates:
COMPLETED: Approved and ready for final PR review.RETRY: Logs failure details toREWORK-LOG.mdand loops back to code.BLOCKED: Critical crash; triggers circuit breaker for immediate human intervention.FAILED: Non-blocking technical debt; logged for post-hoc audit.
To expose systemic risks (N+1 queries, memory leaks, race conditions, SOLID violations), HarnessKit employs Socratic code review. Rather than providing copy-paste solutions, the-grumpy-tech-lead asks deep architectural questions that guide the engineer (or agent) to solve root causes.
An autonomous quality agent that analyzes machine-readable specifications, tests, and source code to actively probe edge cases, boundary faults, and security vulnerabilities missed by standard TDD.
HarnessKit continuously evaluates and optimizes its own prompt harnesses based on real execution telemetry:
Sessions (real work)
β
meta-harness-agent β runs harness-tracer (records execution traces to docs/harness-history/)
β
harness-evaluator β aggregates traces, calculates Pareto frontier scores
β
meta-harness β proposes targeted improvements to SKILL.md instructions
β
Human review & promotion
HarnessKit is distributed as a plugin compatible with major AI developer ecosystems:
/plugin marketplace add romabeckman/harness-kit
/plugin install harness-kit@harness-kit
/harness-kit:project-memory --helpcopilot plugin marketplace add romabeckman/harness-kit
copilot plugin install harness-kit@harness-kitagy plugin install https://github.com/romabeckman/harness-kitcodex plugin marketplace add https://github.com/romabeckman/harness-kit
codex plugin add harness-kit@harness-kitDiscover @romabeckman/hrns, HarnessKitβs SDK and CLI for repeatable AI-assisted engineering workflows. Use hrns run to start the sovereign development loop, or hrns qa to plan, execute, and report user-facing acceptance tests with runtime evidence.
For CI/CD pipelines or running sovereign tasks without an open IDE chat session:
git clone https://github.com/romabeckman/harness-kit.git
cd harness-kit/sdk
npm install
npm run build
npm install -g .Run from any project repository:
hrns runπ Full SDK documentation:
sdk/README.md
π QA command scope and usage:
sdk/docs/QA-TESTER-SCOPE.mdβ profiles, prerequisites, commands, reports, evidence, and current boundaries.
| Category | Skill | Core Function |
|---|---|---|
| Foundation | Project Memory (project-memory) |
Creates and maintains persistent technical documentation (docs/adr/, .digest.md, .graph.json). The agent's long-term memory. |
| Foundation | PBB Design (pbb-design) |
Transforms initial scope into a traceable Product Backlog, resolving open questions interactively or through provisional autonomous assumptions. |
| Foundation | Scope Refinement (scope-refinement) |
DDD orchestrator. Maps Bounded Contexts, Aggregates, and Given-When-Then test scenarios before implementation. |
| Foundation | TDD Orchestrator (tdd-orchestrator) |
Enforces RED β GREEN β REFACTOR. Coordinates test-first implementation and quality gates. |
| Orchestration | Autonomous Orchestrator (autonomous-orchestrator) |
Sovereign loop manager. Fully automates execution across planning, TDD, validation, and auto-tuning phases. |
| Orchestration | Read UI Prototype (read-ui-prototype) |
Translates interface prototypes into structured frontend specs for UI engineers. |
| Quality Gates | The Grumpy Tech Lead (the-grumpy-tech-lead) |
Senior technical reviewer. Uses Socratic questioning to expose architectural vulnerabilities and systemic risks. |
| Quality Gates | Adversarial QA (adversarial-qa) |
Executes adversarial boundary and security testing, returning structured JSON verdicts. |
| Quality Gates | QA Orchestrator (qa-orchestrator) |
Collects QA inputs, designs executable scenarios, runs hrns qa, and summarizes runtime evidence. |
| Optimization | Harness Tracer (harness-tracer) |
Records structured execution traces to docs/harness-history/traces/. |
| Optimization | Harness Evaluator (harness-evaluator) |
Computes composite quality scores and identifies Pareto frontier harness configurations. |
| Optimization | Meta-Harness (meta-harness) |
Diagnoses failure patterns across sessions and proposes targeted skill prompt improvements. |
| Agent | Role | Focus |
|---|---|---|
| Software Architect | System Design & Refinement | DDD modeling, architectural decisions, and tactical planning. |
| Developer Backend | Backend Engineering | Robust APIs, database modeling, and server-side logic with TDD. |
| Developer Frontend | Frontend Engineering | UI/UX implementation, accessibility, and client-side performance with TDD. |
| Developer Debugging | Root Cause Specialist | Systematic bug investigation using the "5 Whys" methodology. |
| Harness Tech Lead | Automated Code Review | Evaluates systemic risks, scalability, security, and design patterns. |
| Harness QA | Quality Assurance | Edge-case probing, contract validation, and adversarial QA testing. |
| Meta-Harness Agent | Harness Optimizer | Analyzes trace history and coordinates prompt harness evolution. |
| CTO | Autonomous Strategy | High-level execution strategy and loop governance. |
Explore the complete knowledge base inside docs/workflow/:
- Workflow Index β Main navigation index for documentation.
- Daily Use Playbook β Step-by-step tactical guide and command flows for daily development.
- Autonomous Loop Orchestration β Complete guide for running sovereign execution loops and hot-interception.
- Conceptual & Architectural Foundation β 3-layer architecture, prompt engineering principles, and continuous optimization.
- Harness Engineering β Reliability comes from controls and constraints, not raw model size.
- Product Backlog Building β Trace PBIs from real problems, expectations, personas, and functionalities before technical design.
- Foundation First β Strong architecture memory + DDD domain modeling + strict TDD make autonomous execution viable.
- Test-Driven Development β Write tests first. Always. No exceptions.
- Domain-Driven Design β Model the problem space before writing code.
- Socratic over Prescriptive β Ask questions that force root-cause understanding rather than shallow copy-paste answers.
- Continuous Self-Improvement β Measure every session and evolve prompts empirically.
HarnessKit is an open-source project. If it helps your development workflow, consider supporting its continued development.
Your support helps fund maintenance, documentation, research, and new features.
- Issues & Feedback: https://github.com/romabeckman/harness-kit/issues
- Author: Romario Beckman
- Contributors: @lnonatto98, @correriadev
- License: MIT License β see LICENSE for details.
- Lee, Y., Nair, R., Zhang, Q., Khattab, O., Finn, C., & Lee, K. (2026). Meta-Harness: End-to-End Optimization of Model Harnesses. arXiv:2603.28052.
- Birgitta BΓΆckeler (2026). Harness engineering for coding agent users.



