agentleFS
jrenaldi79jrenaldi79/harness-engineering/CLAUDE.md

harness-engineering

CLAUDE.md126 starsChanged 8 months agoMITView on GitHub

harness-engineering is a Claude Code plugin and reference for AI coding agent harnesses. The full plugin provides /readiness and /setup; the independent documentation plugin provides /documentation:documentation. Together they assess and configure projects, with a README mapping 20+ best practices from industry sources. Before merging: - [ ] No files over 300 lines (run find . -name "*.js" -not -path "*/node_modules/*" -exec wc -l {} + | awk '$1 > 300') - [ ] No hardcoded secrets (run node skills/setup/scripts/lib/check-secrets.js) -…

  • In this repository2 other files it gives its agents.

The file

We split this CLAUDE.md into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Run node scripts/repo-generate-docs.js after file/doc metadata changes.

    line 126

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code when working with code in this repository.

Project Overview

harness-engineering is a Claude Code plugin and reference for AI coding agent harnesses. The full plugin provides /readiness and /setup; the independent documentation plugin provides /documentation:documentation. Together they assess and configure projects, with a README mapping 20+ best practices from industry sources.

Core Features

  • /readiness: Scores a codebase across 8 pillars and 5 maturity levels, produces a saved report with delta tracking
  • /setup: Scaffolds CLAUDE.md files, enforcement scripts, git hooks, linter configs, and agent settings via Socratic questioning
  • Reference guide: Maps best practices from OpenAI, Anthropic, Augment Code, Factory.ai, and practitioners to concrete implementation patterns

Essential Commands

Testing

node --test tests/documentation/*.test.js
node --experimental-vm-modules node_modules/.bin/jest tests/scripts/   # Unit tests for setup scripts
bash tests/evals/run-evals.sh                                          # E2E readiness evals (default)
bash tests/evals/run-evals.sh --config setup-eval-config.json          # E2E setup evals
bash tests/evals/test-marketplace-install.sh                           # Test plugin install flow

Validation

node scripts/repo-generate-docs.js --check              # Verify indexes and compact markers
node scripts/repo-generate-docs.js --staged             # Validate the exact staged snapshot

Setup

bash scripts/install-hooks.sh   # Install git hooks (pre-commit + pre-push)

Architecture

<!-- AUTO:tree --><!-- prettier-ignore-start -->

Source inventory

  • skills: 49 files
  • scripts: 6 files
  • tests: 42 files
  • plugins: 11 files
<!-- prettier-ignore-end --><!-- /AUTO:tree -->

Data Flow

User installs plugin
  -> /readiness reads templates/references as benchmark
  -> 3 parallel subagents evaluate project against 8 pillars
  -> Scored report saved to readiness-report.md

User runs /setup
  -> Socratic questions determine stack and goals
  -> Scripts scaffold project structure, configs, hooks
  -> Enforcement scripts copied to target project's scripts/
  -> Git hooks wired to run enforcement on every commit/push

Key Modules

<!-- AUTO:modules --><!-- prettier-ignore-start -->

Source inventory

Source rootFiles
skills49
scripts6
tests42
plugins11
<!-- prettier-ignore-end --><!-- /AUTO:modules -->

Quality Gates

GateLimitEnforced By
File size300 lines max per source filecheck-file-sizes.js
Function length50 lines max (advisory)Code review
SecretsNo API keys, tokens, private keyscheck-secrets.js patterns: sk-or-*, sk-ant-*, AKIA*, ghp_*, -----BEGIN.*PRIVATE KEY-----
Test colocationEvery src/ file needs a colocated testcheck-test-colocation.js
Doc driftCLAUDE.md must match actual codebasevalidate-docs.js --full
Nesting depthMax 5 nested if/elseCode review
Imports per fileMax 10Code review

Code Review Checklist

Before merging:

  • No files over 300 lines (run find . -name "*.js" -not -path "*/node_modules/*" -exec wc -l {} + | awk '$1 > 300')
  • No hardcoded secrets (run node skills/setup/scripts/lib/check-secrets.js)
  • Tests pass: node --experimental-vm-modules node_modules/.bin/jest tests/scripts/
  • Doc validation passes: node skills/setup/scripts/lib/validate-docs.js --full
  • CLAUDE.md updated if files were added, removed, or renamed
  • Critical Gotchas section updated if non-obvious behavior was discovered

Critical Gotchas

  • SKILL.md is the skill: Claude Code reads the SKILL.md file as the skill prompt. Changes to SKILL.md directly change skill behavior.
  • Scripts run in target projects, not this repo: The enforcement scripts in skills/setup/scripts/ are templates copied into user projects by /setup. They must work standalone with zero dependencies on this repo.
  • Eval fixtures are intentionally broken: tests/evals/fixtures/level-1-bare/ contains a hardcoded secret on purpose for detection testing. Do not "fix" it.
  • No package.json at root: This is a Claude Code plugin, not an npm package. Tests run via direct node/jest/bash invocation.
  • globs: not paths:: Rule files use globs: in YAML frontmatter for path scoping. The official docs say paths: but globs: works more reliably (see Claude Code issue #17204).
  • Two sets of hooks: scripts/hooks/ are this repo's own git hooks (install with bash scripts/install-hooks.sh). skills/setup/scripts/hooks/ are templates shipped to user projects by /setup. Don't confuse them.

Documentation maintenance

Run node scripts/repo-generate-docs.js after file/doc metadata changes; review and stage generated changes with intended inputs. Commit validation never writes or stages. Keep explanatory prose current alongside implementation. Classify new docs with title/description/type/status/read_when metadata; proposals/history are not operational authority. See docs/self-documentation.md and the standalone skill's metadata reference. The canonical scripts live under plugins/documentation; full setup reuses their installer and target scripts work without the plugin cache.

<!-- AUTO:docs --><!-- prettier-ignore-start -->

Documentation index

<!-- prettier-ignore-end --><!-- /AUTO:docs -->

Docs Map

TopicFile
CLAUDE.md quality criteriaskills/setup/references/claude-md-guide.md
Enforcement script patternsskills/setup/references/enforcement-scripts.md
Node/TypeScript stack referenceskills/setup/references/stack-node-typescript.md
Python stack reference (install-python.js)skills/setup/references/stack-python.md
Eval suite documentationtests/evals/README.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.