🔧 HarnessKit


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.
🏛️ The Foundation Triad
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.

1. 🧠 Project Memory (project-memory)
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) and docs/adr/TESTS.md (frameworks, test conventions, coverage bars).
- Token-Efficient Graph Indexing: Generates
docs/.digest.md (fast executive orientation <60 lines) and docs/.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 in docs/feature/*.md so 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.
2. 📐 Scope Refinement (scope-refinement)
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.
3. 🧪 TDD Orchestrator (tdd-orchestrator)
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.md into 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-debugging agent 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-memory to update living feature docs (docs/feature/*.md) and API contracts.
🔄 The Complete Engineering Cycle
The Foundation Triad forms a closed, self-sustaining loop that transforms raw requirements into verified, fully documented features: