@andrew-semyonov/harness-linter

中文文档
0.1.2发布于 2026/05/27MITES Module零依赖近 30 天下载 2530

Go-based repository harness policy linter and fixer.

原始使用文档
文档目录4 节
  1. Install
  2. Usage
  3. Checks
  4. Configuration

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 has AGENTS.md must also have a sibling CLAUDE.md; every linted directory that has CLAUDE.md must also have a sibling AGENTS.md.
  • claudeInclude: every linted CLAUDE.md must contain exactly @AGENTS.md after trimming whitespace. This keeps AGENTS.md canonical.
  • brokenLinks: markdown links inside AGENTS.md must resolve relative to that AGENTS.md file. External http:, 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, and CLAUDE.md must 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.

版本与发布记录

@andrew-semyonov/harness-linter 共发布 3 个版本,首次发布于 2026/05/26;过去 12 个月发布了 3 个版本。

版本发布日期距今
0.1.2latest2026/05/275 个月前
0.1.12026/05/265 个月前
0.1.02026/05/265 个月前

关于 @andrew-semyonov/harness-linter 的常见问题

@andrew-semyonov/harness-linter 是什么?

Go-based repository harness policy linter and fixer.

如何安装 @andrew-semyonov/harness-linter?

在项目目录运行 npm install @andrew-semyonov/harness-linter,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 harnesslint、harnessfix,可以用 npx harnesslint 直接运行。

@andrew-semyonov/harness-linter 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/andrew-semyonov__harness-linter 是否存在。

@andrew-semyonov/harness-linter 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@andrew-semyonov/harness-linter 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.12.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@andrew-semyonov/harness-linter 可以商用吗?

@andrew-semyonov/harness-linter 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@andrew-semyonov/harness-linter 的下载量有多少?

根据 npm 官方下载统计,@andrew-semyonov/harness-linter 在 2026/10/06 – 2026/11/04 这 30 天内被下载 2,530 次,日均约 84 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@andrew-semyonov/harness-linter 还在维护吗?

最新版本 0.1.2 发布于 2026/05/27(5 个月前);至今共发布 3 个版本,其中过去 12 个月发布了 3 个;首次发布于 2026/05/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。