lean-agent-harness

MIT licensed · 14 skills · no subagent files

One rule file and one skill format for your coding agents.

Short rules that stay in context, skills that load when the task needs them, and a workflow that ends in a reviewed commit.

npx lean-agent-harness --global

Get started View on GitHub

Installs into

  • Claude Code
  • Pi
  • OpenCode
  • Codex
  • Cursor
  • Copilot
  • CommandCode

01 · The workflow

Plan, build, review, commit.

You start each step. The command spelling follows your tool: /plan-flow in Claude Code, Cursor and OpenCode, /skill:plan-flow in Pi, $plan-flow in Codex.

  1. /plan-flow

    Reads the code without changing it and writes the work as slices in a task file.

    Source stays untouched

  2. /orchestrate

    Builds one slice at a time, test first. A slice closes when its Definition of Done passes.

    Failing test first

  3. /review-audit

    Audits the diff and only reports. Blocker and Critical findings block the commit.

    Blockers stop here

  4. /commit

    Runs the quality gates first, then writes a Conventional Commit.

    Checks, then commit

  5. “create the PR”

    Ask in your own words and pull-request writes it and publishes it. It never merges.

    You do the merge

02 · The catalog

14 skills, one format.

Each skill is a folder with a SKILL.md. Skills marked extra are skipped by --profile core.

Workflow

plan-flow

Reads the code and writes a slice plan.

Use when a change needs a plan before any code.

orchestrate

Builds the plan slice by slice with red, green and refactor.

Use when a plan has pending slices.

test-app

Runs the application and tests how it behaves.

Use when you want to see it working. Optional.

review-audit

Audits the uncommitted diff and records the hash it judged.

Use when the slices are done and nothing is committed.

commit

Runs the quality gates and creates a Conventional Commit.

Use when the review approved the diff.

Domain

testing

Testing standards for PHP, Go, Python, TS/JS and Rust.

Use when writing or fixing tests, mocks or flaky tests.

diagnosing-bugs

A six-phase scientific debugging loop.

Use when a defect survives a first fix.

security-audit

Static and architectural security review.

Use when code handles input, authentication or secrets.

pull-request

Opens or updates a structured pull request.

Use when you ask for a PR after committing.

db-migration extra

Zero-downtime migrations and index tuning for SQL databases.

Use when changing tables, columns or indexes.

memory extra

SQLite memory for a project, with a Markdown mirror.

Use when a session starts or a decision must be saved.

impeccable extra

Interface layout, spacing, typography and visual polish.

Use when building or reviewing a user interface.

diagram-design extra

Architecture, flow and sequence diagrams as HTML with SVG.

Use when drawing or visualizing a system.

humanizer extra

Removes filler and AI writing habits from prose.

Use when writing docs, changelogs or PR text.

03 · Memory

It remembers the project.

The memory skill, an extra, keeps decisions, root causes and session summaries between conversations. They live in .memory/ inside your project: a SQLite database with a Markdown mirror you can read. It needs Node.js 24 or later.

context
Prints the checkpoint and the session summary, then recent entries, one line each.
save
Records a short fact with its evidence. It refuses a missing evidence and obvious secrets. That check is best effort, so keep secrets out.
search
Finds the entries about the task at hand.
forget
Drops an entry that is no longer true.
Example entry
# auth-token-expiry
Date: 2026-11-02
Evidence: src/auth/token.js

Access tokens expire after 15 minutes.
Why: refresh tokens carry the session.

The agent treats a memory as a claim to check against the code, not as a fact. Add .memory/ to .gitignore: it is personal.

In Claude Code, optional hooks print the context when a session starts and ask for a summary after the repository changes:

npx lean-agent-harness --global --memory-hook

04 · Why lean

Less standing context, more discipline.

  • Small by default

    The rules take about 0.9k tokens, plus one line per skill. Longer detail loads only when a skill needs it.

  • Test first

    Work is cut into feature-complete slices. Each starts with a failing test and closes on its Definition of Done.

  • Review by risk

    Correctness, readability, architecture and safety are reviewed separately. Slices marked high-risk are reviewed in a fresh context.

  • Guard rails when you want them

    An opt-in guard adds permission checks in Claude Code, Pi, OpenCode and Codex. Coverage differs by tool. It is best effort, not a sandbox.

05 · Install

One command.

Requires Node.js 24 or later for npx.

Into your home directory

npx lean-agent-harness --global

Into the current project

npx lean-agent-harness

Without Node.js

curl -fsSL https://raw.githubusercontent.com/lnardev/lean-agent-harness/main/install.sh | bash

This runs the main branch. Pin a version and a checksum if you prefer.

Cursor reads AGENTS.md from a project install only. Every path per tool is in the README.