@by-association-only/harness

中文文档
0.7.3发布于 2026/11/06MITES Module近 30 天下载 3727

The agent harness from unisian-next: rulebook, fence, hooks, prose lint and verification, for any Vite+ repo.

原始使用文档

@by-association-only/harness

The agent harness from BAO's unisian-next, for any Vite+ repo: a rulebook for coding agents, lint and prose lint that fail on the shortcuts agents take, git and Claude Code hooks that agents can't skip, and a browser driver so an agent proves a change the way its user sees it.

Set up a repo

The repo needs pnpm and Vite+ (vite-plus and a vite.config.ts).

pnpm add -DE @by-association-only/harness
pnpm exec harness init

Then open the repo in Claude Code and run /harness-setup. The skill reads the repo and fills each part of AGENTS.md that only the repo can answer, with you, until pnpm check and pnpm test pass.

After a bump of the package, pnpm exec harness rulebook --update brings its text in AGENTS.md, the docs and the skills up to date. It rewrites only the text between <!-- harness:begin --> and <!-- harness:end --> markers, so the repo's own text stays as it is.

Init also sets the repo up for Ultimate in .ultimate/; its README.md there says what each file does. A repo that ran init before 0.7.0 gets the .ultimate/ files from harness rulebook --update, except .ultimate/automations/ci-watch/, which a second harness init copies, skipping every file the repo already has.

pnpm exec harness init github --yes adds the issue labels, merge-commit-only merges and branch protection on the default branch. Without --yes it prints the calls and runs none.

What you get

CommandWhat it does
harness initCopies the rulebook, docs, skills, git hooks and CI into the repo, and wires the Claude Code hooks to run from the package; never overwrites
harness rulebook --checkFails when a block of harness text in the repo differs from the installed package; --update rewrites the blocks and nothing outside them
harness green-tree run <script>Runs <script>:steps, skipping it when it already passed on this exact tree
harness worktree <branch>Makes a worktree for an agent; --done <branch> cleans up a merged one
harness second-opinion "<q>"Asks a fresh, read-only agent for a pick before an agent asks you
harness ci-watchPrints a FIRE line for each failed Actions run on the default branch; Ultimate's .ultimate/automations/ci-watch runs it
harness sighting <message file>Refuses a commit whose Sighting: <slug> trailer git log already holds, until it stages the rule or tool; commit-msg runs it
harness verify <command>Drives the product in a real browser and writes evidence
harness vendor-agent-sourcesClones pinned upstream sources so agents read them, not their memory
harness pins --checkFails when docs/pins.md and the installed versions disagree
harness peersLists public repos that pin at least two of the prerelease lines in docs/pins.md, marking those missing from the repo's roster
prose-lintFails on AI-slop prose an agent writes in docs, skills and commit messages

The lint plugins load from @by-association-only/harness/lint; spread harnessLint into vite.config.ts.

版本与发布记录

@by-association-only/harness 共发布 24 个版本,首次发布于 2026/10/13;过去 12 个月发布了 24 个版本。

版本发布日期距今
0.7.3latest2026/11/062 天前
0.7.22026/11/053 天前
0.7.12026/11/035 天前
0.7.02026/11/035 天前
0.6.92026/11/026 天前
0.6.82026/10/309 天前

关于 @by-association-only/harness 的常见问题

@by-association-only/harness 是什么?

The agent harness from unisian-next: rulebook, fence, hooks, prose lint and verification, for any Vite+ repo.

如何安装 @by-association-only/harness?

在项目目录运行 npm install @by-association-only/harness,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:effect(~4.0.2)、vite-plus(^1.1.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 harness、prose-lint,可以用 npx harness 直接运行。

@by-association-only/harness 支持 TypeScript 吗?

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

@by-association-only/harness 支持 ESM 还是 CommonJS?

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

@by-association-only/harness 需要什么版本的 Node.js?

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

@by-association-only/harness 可以商用吗?

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

@by-association-only/harness 的下载量有多少?

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

@by-association-only/harness 还在维护吗?

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