Skip to content

hoshiori-dev/harness-md

v0.1.0Apache-2.0

Designs, builds, extracts, and audits a project's agent harness around one HARNESS.md file: the design is written once, then built layer by layer — environment, knowledge, feedback, gates, authority, completion, entropy — with spec-driven development skills for daily work.

harness.md

中文 · Website · Specification · Hub

HARNESS.md is one file that records how a project is set up for coding agents: where the agent runs, what it reads, how it checks its own work, what stops a bad change, and what it may do without asking. That setup is the project's agent harness.

It is not another instructions file. AGENTS.md, the knowledge files, the permission settings, the hooks, and the CI checks are what an agent works with on every task. HARNESS.md is the design they are built from, written down with its reasons. An agent opens it only when the harness itself is being built, checked, or changed.

This repository holds four things:

  • the format specification;
  • the hub, a collection of ready-to-use designs;
  • harness-md, a plugin for Claude Code, Codex, and Antigravity that writes the file for a project, builds the harness it describes, and checks one against the other;
  • the website, where the hub can be searched.

Try it without installing anything

  1. Pick a design from the hub, for example solo-open-source-library.
  2. Give your coding agent the file's address and tell it what the project is for. The file does not have to be in your repository.
  3. Ask the agent to use the file as a reference: to say where its Context does not fit your project, and to show you a plan before it writes anything.

Expect the plan to list an AGENTS.md, a few knowledge files, the commands that check its work, hooks and CI jobs, and permission settings. The file is written so that an agent with no plugin and no knowledge of the format can read it.

A HARNESS.md is used in four ways: to write down all or part of a project's harness design and hand it on, to bring a design in from outside as a reference, to capture the design of a project you want to imitate without copying its implementation, and, if a project chooses to, as the anchor document it keeps in its root and checks its harness against. A project needs no HARNESS.md of its own to have a good harness.

The format in one minute

A HARNESS.md is YAML frontmatter that identifies the design (name, description, and optionally version, license, metadata), followed by a free-form Markdown body. The body opens with a title and an introduction: who the harness serves, what it is for, and what stays with a human. No section is required. The format recommends thirteen English headings, in this order, so that readers find the same subject in the same place:

SectionWhat it usually covers
ContextThe conditions the design has to fit
InvariantsRules every task follows
StyleWhat the code should look like so agents can work in it
File StructureThe layout the design expects
EnvironmentWhere the agent runs and what it can reach
KnowledgeWhat the agent reads, and when
FeedbackHow the agent verifies its own work
GatesWhich checks stop defects
AuthorityWhat the agent may do on its own, and what needs a human
CompletionHow a goal is agreed and what counts as done
EntropyHow the harness stays consistent with the code
Open QuestionsWhat is undecided
ReferencesWhat the design drew on

The format has one goal: the specification helps you write a HARNESS.md, and reading one does not depend on it. Everything in the body is ordinary prose, and because agents rarely load the file, it can be as long as the design needs. The specification has a Chinese translation.

The plugin

Install

  • Claude Code: /plugin install harness-md --marketplace hoshiori-dev/harness.md (one step on Claude Code 2.1.275 or later; on earlier versions run /plugin marketplace add hoshiori-dev/harness.md first, then install). For local development, claude --plugin-dir ..
  • Codex: codex plugin marketplace add hoshiori-dev/harness.md, then codex plugin add harness-md@harness-md.
  • Antigravity: agy plugin install https://github.com/hoshiori-dev/harness.md.

The scripts that ship with the skills are Python. You need uv to run them.

What you can do with it

You want toUse
Set up a new project for agentsharness-design, then harness-build
Find out what is wrong with an existing setup and fix itharness-audit, then harness-design and harness-build
Keep improving a project that already works with agentsharness-audit with the symptom you see
Write down the design a project already has (your own project, or one you want to learn from)harness-extract
Bring a project in line with a given HARNESS.mdharness-build

These four skills are workflows. They run only when you invoke them by name: /harness-md:harness-design in Claude Code, $harness-design in Codex. Each one hands the layers of the design (Environment, Knowledge, and so on) to the skill that knows that layer.

Validate a file

The validator checks the frontmatter, the title, and the order and repetition of the recommended headings, and nothing else. It requires no section and never judges the prose. With the plugin installed, ask your agent to validate the file. From a clone of this repository:

uv run skills/harness-md/scripts/lint_harness_md.py path/to/HARNESS.md

Contribute a hub entry

A hub entry is a design, complete or of one stated aspect, in hub/<name>/HARNESS.md. The rules are in hub/README.md. Entries come in by pull request.

All skills

SkillInvocationSummary
harness-mdModel-invokedReads, writes, and validates a HARNESS.md; ships the validator script.
harness-designUser-invokedProduces or revises a project's HARNESS.md: reads the repository, asks once for what it cannot see, drafts the whole design with defaults, and waits for one approval.
harness-buildUser-invokedTurns a HARNESS.md into the harness, layer by layer, or migrates an existing harness to it.
harness-extractUser-invokedWrites the HARNESS.md that describes the harness a project already has.
harness-auditUser-invokedDiagnoses a harness: format, drift between the design and the repository, and whether the design fits the project. Changes nothing.
harness-architectureModel-invokedThe methodology: why each layer exists, where a rule belongs, how a project's context decides how much each layer does.
environment-buildingModel-invokedThe Environment layer: isolation, credentials, tools, and what the agent can reach.
knowledge-buildingModel-invokedThe Knowledge layer: the AGENTS.md entrypoint, knowledge files, and the links between them.
feedback-buildingModel-invokedThe Feedback layer: what an agent can run and observe to verify its work.
gates-buildingModel-invokedThe Gates layer: pre-commit hooks and CI checks that block defects.
authority-buildingModel-invokedThe Authority layer: permissions, commits, branches, merges, releases, and the platform setup on GitHub or GitLab.
completion-buildingModel-invokedThe Completion layer: how work is specified and approved and when a task is done.
entropy-buildingModel-invokedThe Entropy layer: keeping the harness consistent with the code.
spec-driven-developmentModel-invokedWriting the specification before the code, and keeping the two in step as a change moves to merge.
openspec-workflowModel-invokedWorking with OpenSpec changes inside pull or merge requests.
spec-kit-workflowModel-invokedWorking with Spec-Kit features inside pull or merge requests.
lightweight-spec-workflowModel-invokedAgreeing on one change with plan mode or a SPEC.md, without a spec framework.
project-skill-buildingModel-invokedWriting and repairing the skills a project keeps for its own agents.

Claude Code also gets the agent harness-verifier, which reads a freshly built harness back in a clean context and reports the gaps. Codex and Antigravity plugins cannot include agents yet, so the workflows fall back to an ordinary subagent there.

If you used harness-builder, this plugin replaces it.

Development

Open the dev container and run just check. The repository applies its own method: HARNESS.md is the design of its harness, and AGENTS.md is where an agent starts. See CONTRIBUTING.md for how changes are proposed and reviewed.

License

Apache-2.0. See LICENSE.