Skip to content

About

harness-kit is a powerful utility tool designed to streamline development and automation within the Harness ecosystem. It provides reusable abstractions and modular components to reduce boilerplate, speed up test harness setup, and ensure consistent, high-quality automation workflows.

Resources

Security policy

Stars

30 stars

Watchers

3 watching

Forks

Latest commit

Β 

History

854 Commits

Folders and files

Repository files navigation

πŸ”§ HarnessKit

HarnessKit - 5-Step Engineering Cycle

GitHub Sponsors

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.

HarnessKit - Foundation Triad


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:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ 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   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Execution Modes: Interactive vs. Autonomous

HarnessKit supports two primary ways to operate:

Mode A: Interactive Pair-Programming (Human in the Driver's Seat)

Invoke skills individually during daily development:

  • Run /harness-kit:project-memory when onboarding a repo or documenting architectural changes.
  • Run /harness-kit:pbb-design when turning an initial product or feature scope into a traceable Product Backlog.
  • Run /harness-kit:scope-refinement when planning a complex feature or breaking down a new business domain.
  • Run /harness-kit:tdd-orchestrator when executing test-first implementation for specific tasks.

Mode B: Sovereign Autonomous Loop (autonomous-orchestrator & CLI)

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).
  • Product State Machine: Tracks progress through dynamic transition gates:
    • COMPLETED: Approved and ready for final PR review.
    • RETRY: Logs failure details to REWORK-LOG.md and loops back to code.
    • BLOCKED: Critical crash; triggers circuit breaker for immediate human intervention.
    • FAILED: Non-blocking technical debt; logged for post-hoc audit.

Autonomous State Machine


πŸ›‘οΈ Quality Gates & Self-Optimization

πŸ” Socratic Code Review (the-grumpy-tech-lead)

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.

Socratic Code Review Example

🎯 Adversarial QA (adversarial-qa)

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.

🧬 Meta-Harness Optimization Loop

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

πŸ“¦ Installation & Quick Commands

HarnessKit is distributed as a plugin compatible with major AI developer ecosystems:

Claude Code

/plugin marketplace add romabeckman/harness-kit
/plugin install harness-kit@harness-kit
/harness-kit:project-memory --help

GitHub Copilot CLI

copilot plugin marketplace add romabeckman/harness-kit
copilot plugin install harness-kit@harness-kit

Gemini CLI

agy plugin install https://github.com/romabeckman/harness-kit

Codex CLI

codex plugin marketplace add https://github.com/romabeckman/harness-kit
codex plugin add harness-kit@harness-kit

πŸ’» SDK & CLI β€” @romabeckman/hrns

Discover @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.


πŸ› οΈ What's Inside

Core Skills (/skills)

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.

Expert Agents (/agents)

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.

πŸ“– Deep-Dive Documentation

Explore the complete knowledge base inside docs/workflow/:


πŸ’‘ Philosophy

  • 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.

Support HarnessKit

HarnessKit is an open-source project. If it helps your development workflow, consider supporting its continued development.

Sponsor HarnessKit

Your support helps fund maintenance, documentation, research, and new features.

Contributing & Community

References

About

harness-kit is a powerful utility tool designed to streamline development and automation within the Harness ecosystem. It provides reusable abstractions and modular components to reduce boilerplate, speed up test harness setup, and ensure consistent, high-quality automation workflows.

Resources

Security policy

Stars

30 stars

Watchers

3 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages