upgrade-harness
GitHub用于检测并应用脚手架Harness与最新模板间的差异。自动计算新增、移除及变更文件,支持安全应用无冲突修改,并通过Git标记或.rej文件处理用户编辑产生的冲突,默认仅执行干运行。
触发场景
安装
npx skills add ruvnet/metaharness --skill upgrade-harness -g -y
SKILL.md
Frontmatter
{
"name": "upgrade-harness",
"description": "Drift detection + apply for a scaffolded harness. Re-renders the template with the same vars, computes added\/removed\/changed file plan, and applies with Git-style conflict markers or .rej files. Default is dry-run."
}
upgrade-harness
Codex skill: drift detection + apply for a scaffolded harness.
What it does
Re-renders the template that produced the harness against the current generator version, using the same vars the original scaffold used. Computes a 3-bucket plan:
| Bucket | Meaning |
|---|---|
| added | upstream template now has files the harness doesn't |
| removed | upstream template no longer has files the harness does |
| changed | upstream and harness differ; sub-classified clean vs conflict |
A clean change means the harness's version equals the original generation — apply safely. A conflict means the user edited the file post-scaffold; the apply step writes either Git-style inline markers or a .rej sidecar for manual merge.
Usage from Codex
/upgrade-harness # dry-run on cwd
/upgrade-harness path=./my-harness
/upgrade-harness path=./my-harness apply=true
/upgrade-harness path=./my-harness apply=true conflict=rej
Equivalent CLI
harness upgrade ./my-harness # dry-run
harness upgrade ./my-harness --apply # apply, inline conflicts
harness upgrade ./my-harness --apply --conflict=rej # apply, .rej sidecars
Lifecycle position
scaffold (create-agent-harness)
↓
edit (you)
↓
upgrade (this skill) <- catches up to the latest template
↓
sign / verify / publish
Exit codes
| Code | Meaning |
|---|---|
| 0 | No drift OR clean apply (no conflicts) |
| 1 | Unresolved conflicts after apply, OR not a generated harness, OR template missing |
| 2 | Bad --conflict= value |
CI workflows can gate on exit 1 to flag unresolved conflicts.
版本历史
- 6e1902b 当前 2026-07-05 11:03


