harness

A project-preparation guide that examines a codebase and records the rules and context an AI coding agent needs to work safely and independently.

In plain words
What is it for?
Use it to document architecture and coding patterns, capture decisions through guided questions, and add lasting checks or engineering changes that help agents collaborate on the project.
Why use it?
It reduces the need for agents to guess how the project is organised, tested, or maintained.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jtsang4/efficient-coding/harness
Any agent
npx skills add jtsang4/efficient-coding --skill harness
Clone the repo
git clone --depth 1 https://github.com/jtsang4/efficient-coding

Made for: Claude Code, Codex.

Per session 198 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,677 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00198 $0.02677
Opus 5 $0.00099 $0.01339
Sonnet 5 $0.00040 $0.00535
Haiku 4.5 $0.00020 $0.00268

Measured yesterday against content hash 0aebf15f91d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

harness scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/harness/SKILL.md · 227 lines

How it starts

The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Harness Engineering

Transform any code project so AI agents can work in it reliably and autonomously.

The bottleneck is never the agent's coding ability — it's the environment the agent operates in. This skill builds that environment.

Core Principles

These govern every decision:

  1. Declarative over procedural — Define what "correct" looks like (verification criteria), not step-by-step procedures. Agents determine how to verify on their own and generate temporary scripts if needed.

  2. Recognition over recall — Extract knowledge by showing users detected patterns and asking them to react (choose, confirm, reject). Never ask open-ended "describe your principles" questions.

  3. Minimal context footprint — Every generated document must be as concise as possible. Agents read actual code for details. Only externalize knowledge that CANNOT be inferred from code: architectural rules, canonical pattern choices, prohibited actions, business domain terms.

  4. Persist invariants, not procedures — Commit architectural rules, lint configs, structural tests (permanent invariants). Never commit task-specific verification scripts — agents create those on-the-fly per task and discard them after.

  5. Language-agnostic — Adapt to the project's tech stack. Never assume a specific language, framework, or toolchain.

Workflow

Four phases. On re-runs (when docs/harness/.state.json exists), skip to gap analysis.


Phase 0: Automated Scan

No user interaction. Scan the codebase to build a baseline understanding.

What to detect:

Category How to detect
Language & framework Glob for config files: package.json, Cargo.toml, go.mod, pyproject.toml, pom.xml, build.gradle, Makefile, CMakeLists.txt, etc.
Directory structure ls top-level, identify src/, lib/, app/, tests/, docs/ etc.
Module boundaries Top-level directories under source root; look for clear separation
Import/dependency graph Grep for import statements. Language-specific patterns — see below
Convention files Glob for CLAUDE.md, AGENTS.md, .cursorrules, .github/copilot-instructions.md, .windsurfrules
Test infrastructure Glob for test config: jest.config.*, vitest.config.*, pytest.ini, pyproject.toml [tool.pytest], etc.
Lint configuration Glob for lint config: .eslintrc.*, biome.json, .rubocop.yml, clippy.toml, ruff.toml, .golangci.yml, etc.
CI/CD Glob for .github/workflows/, .gitlab-ci.yml, Jenkinsfile, etc.
Type system Check for strict mode: tsconfig.json strict flag, mypy.ini, type annotations density
Existing harness Check for docs/harness/ and .state.json

Read the full file on GitHub · 227 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 227 lines · 198 tokens per session scan A 0aebf15f91d1

Subscribe to this mod's changes

harness is a skill published in the GitHub repository jtsang4/efficient-coding (2 stars, last pushed 7d ago), licensed MIT. It adds 198 tokens to every session and 2,677 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.