mb-harness

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

mb-harness — Harness engineering setup

mb-harness — 工程管控框架搭建

  • What it does: defines the execution harness around the repo, including commands, gates, and parallel-safe workflow.
  • Use it when: the repository needs stronger agent guardrails before autonomous or multi-session work.
  • Input: repository root and the project’s canonical build, test, and lint commands.
  • Output: documented quality gates, optional Codex config, and a safer harness for agent execution.
  • 功能说明: 定义仓库的执行管控框架,包括命令、质量门和并行安全工作流。
  • 适用场景: 当仓库在进行自主式或多会话工作前,需要更强的Agent防护机制时使用。
  • 输入信息: 仓库根目录,以及项目的标准构建、测试和代码检查命令。
  • 输出结果: 文档化的质量门、可选的Codex配置,以及更安全的Agent执行管控框架。

Goal

目标

Turn the repo into a reliable “harness” for agents:
  • clear entry points (AGENTS.md)
  • reproducible commands (build/test/lint)
  • mechanical checks (CI + MB lint)
  • parallel-safe workflow (worktrees)
将仓库转变为Agent可依赖的可靠“管控框架”:
  • 清晰的入口点(AGENTS.md)
  • 可复现的命令(构建/测试/代码检查)
  • 自动化检查(CI + MB lint)
  • 并行安全工作流(worktree)

Process

实施流程

1) Codex project configuration (optional but recommended)

1) Codex项目配置(可选但推荐)

If you use Codex:
  1. Create
    .codex/
    folder.
  2. Create
    .codex/config.toml
    from
    assets/codex-config.toml
    .
Usage examples:
  • default profile (coding):
    codex
  • deep review:
    codex --profile deep-review
如果使用Codex:
  1. 创建
    .codex/
    文件夹。
  2. assets/codex-config.toml
    创建
    .codex/config.toml
使用示例:
  • 默认配置(编码):
    codex
  • 深度评审:
    codex --profile deep-review

2) Document quality gates

2) 文档化质量门

In
AGENTS.md
(keep it short), list the canonical commands (examples):
  • install deps
  • lint / typecheck
  • unit tests
  • e2e tests
If the repo has UI or browser flows, explicitly document:
  • Playwright command(s)
  • agent-browser / browser MCP path (if available)
  • where screenshots/videos/traces are stored
  • which flows are considered release-critical
If the repo lacks them, add minimal scripts/Make targets.
AGENTS.md
中(保持简洁)列出标准命令(示例):
  • 安装依赖
  • 代码检查/类型校验
  • 单元测试
  • 端到端测试
如果仓库包含UI或浏览器流程,需明确文档化:
  • Playwright命令
  • agent-browser / browser MCP路径(如果可用)
  • 截图/视频/追踪文件的存储位置
  • 哪些流程属于发布关键流程
如果仓库缺少这些内容,添加最小化脚本/Make目标。

3) Worktree workflow (parallel agents)

3) Worktree工作流(并行Agent)

If multiple agents work in parallel:
  • create worktrees per agent to avoid file conflicts
  • merge only after passing gates
Example:
bash
git worktree add ../wt-agent-1 -b agent-1
如果多个Agent并行工作:
  • 为每个Agent创建worktree以避免文件冲突
  • 仅在通过质量门后合并
示例:
bash
git worktree add ../wt-agent-1 -b agent-1

4) Add deterministic Memory Bank lint

4) 添加确定性Memory Bank lint

If not already present, run
mb-garden
to add
scripts/mb-lint.mjs
and CI workflow.
如果尚未配置,运行
mb-garden
以添加
scripts/mb-lint.mjs
和CI工作流。

4.1) Browser verification for UI projects

4.1) UI项目的浏览器验证

If the product has a UI:
  • prefer Playwright / agent-browser / CDP-driven checks over “manual looks OK”
  • persist artifacts (screenshots, videos, traces) into
    .tasks/TASK-XXX/
  • document canonical browser verification commands in
    .memory-bank/testing/index.md
如果产品包含UI:
  • 优先使用Playwright / agent-browser / CDP驱动的检查,而非“人工确认正常”
  • 将工件(截图、视频、追踪文件)持久化存储到
    .tasks/TASK-XXX/
  • .memory-bank/testing/index.md
    中记录标准浏览器验证命令

5) Optional: skill eval harness

5) 可选:技能评估管控框架

If you iterate on skills heavily:
  • use
    codex exec --json
    runs + deterministic graders (see OpenAI evals guidance)
如果频繁迭代技能:
  • 使用
    codex exec --json
    运行 + 确定性评分器(参考OpenAI evals指南)

Definition of done

完成标准

  • .codex/config.toml
    exists (if using Codex) with coding + review profiles.
  • AGENTS.md lists quality-gate commands.
  • repo has a documented path for worktrees.
  • Memory Bank lint exists and passes.
  • UI repos have a documented browser-driven verification path.
  • .codex/config.toml
    已存在(如果使用Codex),包含编码和评审配置文件。
  • AGENTS.md已列出质量门命令。
  • 仓库有worktree的文档化使用路径。
  • Memory Bank lint已配置并通过检查。
  • UI仓库有文档化的浏览器驱动验证路径。