agentleFS
TheAatroxking1TheAatroxking1/harness_creator_skill/harness-creator/SKILL.md

harness-creator

Skill48 starsChanged 5 months agoMITView on GitHub

创建或改造通用 AI 编程 harness。适用于用户想要为 Codex、Claude Code、OpenClaw 或其他主流 AI CLI 生成、定制、审计或演进一套包含 dispatcher 调度、角色代理、状态文件、阶段产物、门禁、hooks/evals、rules、context、经验沉淀机制的软件工程 harness。

5 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. walkinglabs/learn-harness-engineering★ 21ksame name
    2. anthony-chaudhary/fak★ 47same name
    3. ffy6511/harness-creator-skill★ 4same name
    4. idoforgod/cys-harness-creator★ 4same name
    5. tjdwls101010/Harness-Creator★ 4same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

Files
SKILL.md

Harness Creator

创建通用 AI 编程 harness:也就是一套不绑定单一 CLI 的轻量工程系统,让 AI 编程工具通过明确的流程状态、隔离的角色职责、落盘产物、确定性门禁和项目经验沉淀来完成开发任务。

核心定位

不要把 harness 做成某个工具专用的大 prompt。把它拆成两部分:

  1. Harness Core:任何 AI CLI 都能读取的 .harness/ 核心目录。
  2. CLI Adapter:针对 Codex、Claude Code、OpenClaw 或 generic CLI 的接入层。

通用核心永远以 .harness 为准:

  • .harness/workflow.yaml:状态机流程。
  • .harness/state.json:当前状态。
  • .harness/evidence.json:验证证据。
  • .harness/agents/*.md:通用角色说明。
  • .harness/artifacts/:阶段产物。
  • .harness/rules/:原子规则。
  • .harness/context/:按需上下文。
  • .harness/scripts/:确定性门禁脚本。
  • .harness/evals/:评测脚本。
  • .harness/lessons/:经验沉淀。

适配层只负责让不同 CLI 更顺手地接入这套核心:

  • codex:生成 AGENTS.md、.codex/agents/*.toml、.agents/skills/harness-dispatcher/。
  • claude-code:生成 CLAUDE.md、.claude/agents/*.md、.claude/settings.harness.example.json。
  • openclaw:生成 .openclaw/harness/ 消息模板和 agent prompt 文件。
  • generic:生成 HARNESS.md 和 .harness/adapters/generic-cli.md,适配任何能读写文件和运行命令的 CLI。

如果用户只是想理解 harness 架构,不要创建文件;读取 references/harness-architecture.md 后用中文解释即可。

创建流程

  1. 先检查目标项目,尽量识别技术栈、构建命令、测试命令、部署风险、现有 AGENTS.md、CLAUDE.md、.codex、.claude、.openclaw 或 .agents 配置。
  2. 只有在无法推断项目技术栈、验证命令、目标 CLI 或期望 profile 时,最多问三个必要问题。能保守推断时直接继续,并说明假设。
  3. 选择 harness profile:
    • lean:适合小 bug、小脚本、低风险修复;主要包含 coder、tester、reviewer、risk 检查。
    • standard:适合多数产品开发;包含 planner、ATDD、TDD、coder、tester、reviewer、risk、librarian。
    • full:适合高风险系统;在 standard 基础上增加 pre-mortem、预发部署、接口测试和 harness 评分。
  4. 选择 target:
    • all:默认,生成通用核心和所有适配层。
    • generic:只生成通用核心和 generic adapter。
    • codex:生成通用核心和 Codex adapter。
    • claude-code:生成通用核心和 Claude Code adapter。
    • openclaw:生成通用核心和 OpenClaw adapter。
  5. 当用户明确要生成文件系统脚手架时,运行本 skill 的 scripts/create_harness.py。
  6. 按用户业务域定制生成文件:把通用命令、风险规则、阶段产物和验收检查替换成项目真实内容。
  7. 生成后尽量运行门禁脚本或 dry-run 评分,确认 harness 基础结构可用。
  8. 最后向用户解释生成了哪些文件,以及不同 CLI 分别应该如何启动 harness 工作流。

脚手架命令

在本 skill 目录下使用:

python scripts/create_harness.py --project <project-root> --target all --profile standard --domain "<domain>" --stack "<stack>" --build-command "<cmd>" --test-command "<cmd>"

只生成 Claude Code 适配层:

python scripts/create_harness.py --project <project-root> --target claude-code --profile standard

只生成 OpenClaw 适配层:

python scripts/create_harness.py --project <project-root> --target openclaw --profile standard

如果暂时不知道构建或测试命令,可以省略对应参数。脚本会写入占位内容,后续由 CLI agent 根据项目继续细化。

安全规则

  • 除非用户明确要求,或使用 --force,不要覆盖已有文件。
  • 如果目标项目已经存在 AGENTS.md,创建 AGENTS.harness.proposed.md,不要直接改原文件。
  • 如果目标项目已经存在 CLAUDE.md,创建 CLAUDE.harness.proposed.md,不要直接改原文件。
  • 只生成 hook 示例文件,不自动启用 hook,除非用户明确要求。
  • 生成的 agent 职责必须保持窄边界。默认情况下,reviewer 或 risk-guardian 不应读取 coder 的自证说明,除非用户要求非盲审。
  • OpenClaw 的 agent id、model、channel 与部署形态差异较大,只生成示例配置和 message-file 模板,不假定用户的 OpenClaw 配置。

定制清单

生成脚手架后,按项目情况重点调整这些文件:

  • .harness/workflow.yaml:把 intent/risk 分类映射到必需流程节点。
  • .harness/state.json:为第一次运行设置 intent、risk 和 current_state。
  • .harness/rules/*.md:把真实踩坑、项目约束、禁止操作写成原子规则,一条规则只管一件事。
  • .harness/context/*.md:保存只在特定阶段加载的深度指南,例如 TDD、ATDD、Pre-Mortem、证据链。
  • .harness/agents/*.md:通用角色说明,所有 CLI 都可以读取。
  • .codex/agents/*.toml:Codex 自定义 agent 定义。
  • .claude/agents/*.md:Claude Code 自定义 subagent 定义。
  • .openclaw/harness/messages/*.md:OpenClaw message-file 模板。
  • .harness/scripts/gate_check.py:把占位检查改成真实的确定性门禁。
  • .harness/evals/score_harness.py:如果要做 harness A/B 测试,定义项目自己的评分维度。

预期输出结构

--target all 会生成类似结构:

HARNESS.md
AGENTS.md 或 AGENTS.harness.proposed.md
CLAUDE.md 或 CLAUDE.harness.proposed.md
.harness/
  workflow.yaml
  state.json
  evidence.json
  agents/
  artifacts/
  rules/
  context/
  dispatch/
  lessons/
  scripts/
  evals/
  adapters/
.codex/
  agents/
  hooks.harness.example.json
.agents/
  skills/
    harness-dispatcher/
.claude/
  agents/
  settings.harness.example.json
.openclaw/
  harness/
    agents/
    messages/
    agent-config.example.json5

运行原则

保持主会话足够薄。无论是 Codex、Claude Code、OpenClaw 还是其他 CLI,主会话都应该只负责读取状态、询问 dispatcher 下一步、派发对应角色、收集产物、运行门禁、更新状态和汇总结果。它不应该悄悄替代 specialist agent 的判断。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.