Harness Linter
Repository harness policy linter and fixer for agent-friendly codebases.
It ships as an npm package with prebuilt native binaries. No Go toolchain is needed in downstream repositories.
Install
npm install --save-dev @andrew-semyonov/harness-linter
Usage
npx harnesslint .
npx harnessfix .
harnessfix only applies safe mechanical fixes. Today that means creating a
missing sibling CLAUDE.md containing @AGENTS.md when an AGENTS.md file
exists.
Checks
harnesslint currently includes these configurable rules:
pairing: every linted directory that hasAGENTS.mdmust also have a siblingCLAUDE.md; every linted directory that hasCLAUDE.mdmust also have a siblingAGENTS.md.claudeInclude: every lintedCLAUDE.mdmust contain exactly@AGENTS.mdafter trimming whitespace. This keepsAGENTS.mdcanonical.brokenLinks: markdown links insideAGENTS.mdmust resolve relative to thatAGENTS.mdfile. Externalhttp:,https:,mailto:, and same-page anchor links are ignored.
It also includes always-on repository harness checks:
- Nested guide files: README and index files are only allowed at the repository
root. Directory guidance should live in
AGENTS.md. - Execution plans: files in docs exec-plan active and completed directories must use unique numeric IDs. Active plans fail lint until moved to completed; completed plans fail lint if they still have open checkboxes.
- Operational doc paths: inline-code path references in
README.md,AGENTS.md, andCLAUDE.mdmust point to existing files or directories.
Configuration
Add harnesslint.json at the repository root:
{
"files": {
"ignore": [
".git/**",
"thoughts/**",
"vendor/**",
"bin/**",
"dist/**",
"node_modules/**"
]
},
"linter": {
"rules": {
"pairing": true,
"claudeInclude": true,
"brokenLinks": true
}
}
}
By default, the ignore list is:
.git/**thoughts/**vendor/**bin/**dist/**
If you set files.ignore, it replaces the default list, so include the default
entries you still want. Rule flags can be set to false to disable a check.