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
- Pick a design from the hub,
for example
solo-open-source-library. - 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.
- 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:
| Section | What it usually covers |
|---|---|
| Context | The conditions the design has to fit |
| Invariants | Rules every task follows |
| Style | What the code should look like so agents can work in it |
| File Structure | The layout the design expects |
| Environment | Where the agent runs and what it can reach |
| Knowledge | What the agent reads, and when |
| Feedback | How the agent verifies its own work |
| Gates | Which checks stop defects |
| Authority | What the agent may do on its own, and what needs a human |
| Completion | How a goal is agreed and what counts as done |
| Entropy | How the harness stays consistent with the code |
| Open Questions | What is undecided |
| References | What 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.mdfirst, then install). For local development,claude --plugin-dir .. - Codex:
codex plugin marketplace add hoshiori-dev/harness.md, thencodex 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 to | Use |
|---|---|
| Set up a new project for agents | harness-design, then harness-build |
| Find out what is wrong with an existing setup and fix it | harness-audit, then harness-design and harness-build |
| Keep improving a project that already works with agents | harness-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.md | harness-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
| Skill | Invocation | Summary |
|---|---|---|
harness-md | Model-invoked | Reads, writes, and validates a HARNESS.md; ships the validator script. |
harness-design | User-invoked | Produces 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-build | User-invoked | Turns a HARNESS.md into the harness, layer by layer, or migrates an existing harness to it. |
harness-extract | User-invoked | Writes the HARNESS.md that describes the harness a project already has. |
harness-audit | User-invoked | Diagnoses a harness: format, drift between the design and the repository, and whether the design fits the project. Changes nothing. |
harness-architecture | Model-invoked | The methodology: why each layer exists, where a rule belongs, how a project's context decides how much each layer does. |
environment-building | Model-invoked | The Environment layer: isolation, credentials, tools, and what the agent can reach. |
knowledge-building | Model-invoked | The Knowledge layer: the AGENTS.md entrypoint, knowledge files, and the links between them. |
feedback-building | Model-invoked | The Feedback layer: what an agent can run and observe to verify its work. |
gates-building | Model-invoked | The Gates layer: pre-commit hooks and CI checks that block defects. |
authority-building | Model-invoked | The Authority layer: permissions, commits, branches, merges, releases, and the platform setup on GitHub or GitLab. |
completion-building | Model-invoked | The Completion layer: how work is specified and approved and when a task is done. |
entropy-building | Model-invoked | The Entropy layer: keeping the harness consistent with the code. |
spec-driven-development | Model-invoked | Writing the specification before the code, and keeping the two in step as a change moves to merge. |
openspec-workflow | Model-invoked | Working with OpenSpec changes inside pull or merge requests. |
spec-kit-workflow | Model-invoked | Working with Spec-Kit features inside pull or merge requests. |
lightweight-spec-workflow | Model-invoked | Agreeing on one change with plan mode or a SPEC.md, without a spec framework. |
project-skill-building | Model-invoked | Writing 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.