Harness Engineering
Evolve an existing repository toward Harness Engineering without pretending it must be rebuilt as a blank template.
Prefer repo-local knowledge, predictable structure, and executable checks over aspirational documentation and hidden context.
Workflow
1. Audit the current repo
- - Read
AGENTS.md and the top-level docs under docs/. - Identify missing source-of-truth artifacts, dead references, placeholder CI, and stack-specific assumptions.
- Confirm whether the repo is a real app, a governance layer, or a starter template.
- Preserve existing product and runtime structure where possible. Do not force a greenfield layout onto a mature codebase.
2. Establish the minimum repo-local artifacts
- - Keep
AGENTS.md short and map-like. - Add only the missing artifacts that materially improve agent legibility, such as:
-
docs/ARCHITECTURE.md
-
docs/core-beliefs.md
-
docs/quality-score.md
-
docs/observability.md
-
docs/worktrees.md
-
docs/skills.md
-
docs/product-specs/index.md
-
docs/product-specs/template.md
-
docs/exec-plans/index.md
-
docs/exec-plans/template.md
-
docs/exec-plans/tech-debt-tracker.md
-
docs/generated/README.md
- - Match the artifact set to the repository's maturity. A small service may need fewer documents than a large multi-domain product.
- If generated artifacts are referenced but not yet produced, add explicit placeholders rather than leaving silent gaps.
3. Replace policy-only claims with enforcement
- - Use the repo's existing stack where needed, but prefer
bun for lightweight governance scripts when that does not conflict with the project. - Add executable checks for required files, stale placeholders, broken references, and obvious contract drift.
- Wire CI to run the checks for every push and pull request.
- Do not leave comments like "run lint later" as the only quality gate.
4. Preserve generality
- - Preserve real project names, domains, and runtime details when the repository is already in active use.
- Remove only accidental one-off assumptions, stale tribal knowledge, and undocumented conventions.
- Write docs so a future agent can continue work from the repository itself.
- Prefer incremental hardening over broad rewrites.
5. Make the repo legible to agents
- - Keep one clear location for each category of knowledge.
- Put product intent in
docs/product-specs/. - Put multi-step delivery work in
docs/exec-plans/. - Put detailed external library notes in
docs/references/. - Prefer explicit directory conventions over clever local variation.
6. Verify the template
- - Run
bun run template:check or the project equivalent. - Fix all hard failures before stopping.
- Treat warnings as backlog only if they are genuinely optional.
- If the repository is not a git checkout, note that you cannot report git status.
Editing rules
- - Use imperative language in docs.
- Prefer concise checklists over essays.
- Keep examples aligned with
bun. - Avoid claiming that a metric, score, or automation is "automatic" unless code actually updates it.
- Add placeholder files when the template references an artifact that new projects will generate later.
Reference
Read references/checklist.md when you need a compact audit list while editing or reviewing a template repo.
Deliverables
- - Updated repo-local docs
- Missing placeholder artifacts filled in
- Executable validation or governance checks
- CI wired to run real checks
- A short summary of what now supports Harness Engineering and what still depends on hidden context
技能名称: harness-engineering
详细描述:
线束工程
将现有仓库逐步演进为线束工程,而非假装必须从空白模板重建。
优先采用仓库本地知识、可预测的结构和可执行的检查,而非依赖理想化的文档和隐藏的上下文。
工作流程
1. 审计当前仓库
- - 阅读 AGENTS.md 和 docs/ 下的顶层文档。
- 识别缺失的真相来源工件、无效引用、占位CI以及特定于技术栈的假设。
- 确认仓库是真实应用、治理层还是入门模板。
- 尽可能保留现有的产品和运行时结构。不要强行将绿地布局强加于成熟的代码库。
2. 建立最低限度的仓库本地工件
- - 保持 AGENTS.md 简短且类似地图。
- 仅添加能实质性提升代理可读性的缺失工件,例如:
- docs/ARCHITECTURE.md
- docs/core-beliefs.md
- docs/quality-score.md
- docs/observability.md
- docs/worktrees.md
- docs/skills.md
- docs/product-specs/index.md
- docs/product-specs/template.md
- docs/exec-plans/index.md
- docs/exec-plans/template.md
- docs/exec-plans/tech-debt-tracker.md
- docs/generated/README.md
- - 根据仓库的成熟度匹配工件集。小型服务可能比大型多领域产品需要的文档更少。
- 如果引用了生成的工件但尚未生成,则添加明确的占位符,而非留下无声的缺口。
3. 用强制执行替代仅基于策略的声明
- - 必要时使用仓库现有的技术栈,但在不与项目冲突时,优先使用 bun 处理轻量级治理脚本。
- 添加可执行检查,用于验证必需文件、过期占位符、损坏的引用以及明显的契约漂移。
- 配置CI,使其在每次推送和拉取请求时运行这些检查。
- 不要将“稍后运行lint”之类的注释作为唯一的质量门控。
4. 保持通用性
- - 当仓库已处于活跃使用时,保留真实项目名称、领域和运行时细节。
- 仅移除偶然的一次性假设、过时的部落知识和未记录的约定。
- 编写文档,使未来的代理能够直接从仓库继续工作。
- 优先采用渐进式加固,而非大规模重写。
5. 使仓库对代理可读
- - 为每类知识保留一个清晰的位置。
- 将产品意图放在 docs/product-specs/ 中。
- 将多步骤交付工作放在 docs/exec-plans/ 中。
- 将详细的外部库说明放在 docs/references/ 中。
- 优先采用明确的目录约定,而非巧妙的局部变体。
6. 验证模板
- - 运行 bun run template:check 或项目等效命令。
- 在停止前修复所有硬性失败。
- 仅当警告确实可选时,才将其视为待办事项。
- 如果仓库不是git检出,则注明无法报告git状态。
编辑规则
- - 在文档中使用祈使语气。
- 优先采用简洁的清单,而非长篇论述。
- 保持示例与 bun 一致。
- 除非代码实际更新了指标、评分或自动化,否则避免声称其是“自动的”。
- 当模板引用了新项目稍后才会生成的工件时,添加占位符文件。
参考
在编辑或审查模板仓库时,如需紧凑的审计清单,请阅读 references/checklist.md。
交付物
- - 更新后的仓库本地文档
- 补充缺失的占位符工件
- 可执行的验证或治理检查
- 配置CI以运行实际检查
- 一份简短总结,说明哪些内容现已支持线束工程,哪些仍依赖于隐藏上下文