Borrowing it
Nothing to install: this file belongs to Joe-rq/harness-lab. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Joe-rq/harness-lab/master/.claude/commands/harness-setup.mdgit clone --depth 1 https://github.com/Joe-rq/harness-labWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/joe-rq/harness-lab/harness-setup)<a href="https://agentmods.dev/commands/joe-rq/harness-lab/harness-setup"><img src="https://agentmods.dev/badge/commands/joe-rq/harness-lab/harness-setup.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00054 | $0.01594 |
| Opus 5 | $0.00027 | $0.00797 |
| Sonnet 5 | $0.00011 | $0.00319 |
| Haiku 4.5 | $0.00005 | $0.00159 |
Grade A, and why
harness-setup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/harness-setup
目标
将 harness-lab 治理框架接入到当前 Git 项目,并让安装结果与当前仓库的真实治理契约一致。
前置检查
-
Git 仓库检测
- 当前目录必须包含
.git/ - 如果不是 Git 仓库,先提示用户运行
git init
- 当前目录必须包含
-
现有治理文件检测
- 检查是否存在:
AGENTS.md,CLAUDE.md,requirements/,.claude/progress.txt - 如果存在,记录冲突文件列表
- 当前安装器的真实策略是默认跳过已有文件,避免覆盖目标项目内容
- 检查是否存在:
推荐执行方式
在目标项目中运行:
node /path/to/harness-lab/scripts/harness-install.mjs --defaults
如果目标项目的 package.json 在子目录(例如 app/package.json),仍在 Git 根目录运行安装器,并显式指定脚本绑定位置:
node /path/to/harness-lab/scripts/harness-install.mjs --defaults --package-dir app
包含治理 hooks:
node /path/to/harness-lab/scripts/harness-install.mjs --defaults --with-hook
如果 harness-lab 以 npm 包形式安装,package.json 暴露 harness-install bin 后,也可以使用:
npx --yes --package=harness-lab harness-install --defaults
npx --yes --package=harness-lab harness-install --defaults --dry-run
npx --yes --package=harness-lab harness-install --defaults --package-dir app
npx --yes --package=harness-lab harness-install --defaults --with-hook
模块
核心模块(必须安装):
AGENTS.md- 治理规则主入口CLAUDE.md- 会话入口协议requirements/- REQ 生命周期管理.claude/progress.txt- 跨会话进度交接
默认模块:
| 模块 | 说明 | 默认 |
|---|---|---|
docs/ |
设计稿和规范目录 | yes |
context/ |
业务/技术/经验索引 | yes |
skills/ 与 .agents/skills/source-command-* |
阶段导航技能、Claude Code source-command skills(含 worktree-req) |
yes |
| CLI 脚本 | REQ lifecycle/status/experience、reflect/align、audit/health、docs gate、doctor、invariant 与其运行依赖 | yes |
| 治理 hooks | .claude/settings.example.json, scripts/session-start.js, scripts/req-check.js, scripts/scope-guard.mjs, 本地 hook 配置 |
no,需 --with-hook |
安装器真实行为
-
源目录
- 默认使用安装脚本所在仓库作为源目录
- 可通过
--source /path/to/harness-lab显式指定
-
冲突处理
- 检测已存在文件
- 默认跳过已存在文件
- 当前不实现覆盖/取消的交互式分支
-
初始化配置
- 创建或补齐
requirements/目录结构 - 默认保留目标项目已有 REQ、报告和经验历史;仅在
--clean-template-history下清理带模板标记的历史文件 - 仅在不存在时初始化
.claude/progress.txt;重装逐字节保留现有进度 - 合并合法的
.claude/settings.local.json,非法 JSON 原样保留并终止安装 - 生成
requirements/reports/harness-setup-report.md
- 创建或补齐
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 138 lines · 54 tokens per session scan A 77132e647721
harness-setup is a command published in the GitHub repository Joe-rq/harness-lab (20 stars, last pushed 24d ago), licensed MIT. It adds 54 tokens to every session and 1,594 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.