agentleFS
park-jongbeompark-jongbeom/patrick-work-harness/skills/harness-update/SKILL.md

harness-update

Skill1 starsChanged 2 months agoMITView on GitHub

Upgrade an existing harness-initialized repo to the latest engine release. Shows what changed (CHANGELOG), checks what needs applying (checklist), then applies on approval. Use on '/harness-update', 'harness upgrade', '하네스 업데이트', or when _engine_version is behind the latest release.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. GangJaeYu/harness_loop_full_korean★ 4same name
    2. atlax-tech/harness-armor★ 1same 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.

  • In this repository8 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 5 are distinctive, and 16 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 16

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After a new harness release is available (patrick-work-harness tag bump)

    line 14
  2. Very specific:

    When session-dashboard.html is missing, Stop hooks are unwired, or session stubs are absent on an existing init'd repo

    line 15
  3. Very specific:

    Read .claude/harness-answers.yml in the current working repo (the repo Claude Code is opened in):

    line 29
  4. Very specific:

    If neither is found: halt with "Cannot resolve engine version — ensure CLAUDE_PLUGIN_ROOT is set or patrick-work-harness is cloned locally."

    line 39
  5. Distinctive:

    Before applying the comparison table below, read the install marker and compare:

    line 48
  6. Very specific:

    Read CHANGELOG.md from the engine source (same directory as plugin.json resolved in Step 1).

    line 74
  7. Very specific:

    If CHANGELOG.md is absent or the section is empty, output "변경 내역 없음 (CHANGELOG 미존재)" and continue.

    line 87
  8. Very specific:

    If --check mode: stop here (no file writes).

    line 105
  9. Distinctive:

    If ≥1 ❌: list the items needing update and proceed to Step 4.

    line 106
  10. Very specific:

    Update version tag to <!-- HARNESS:START v{latest} -->

    line 134
  11. Very specific:

    If sentinels are absent: output "⚠️ HARNESS sentinel 없음 — /init을 먼저 실행하세요." and skip this axis.

    line 137
  12. Very specific:

    Read .claude/settings.json (create {"hooks":{}} if absent).

    line 141
  13. Distinctive:

    Check which of the 3 guards are missing from the Stop array:

    line 143
  14. Very specific:

    Use ${CLAUDE_PLUGIN_ROOT}/hooks/ paths.

    line 151
  15. Distinctive:

    Run the sync script once manually:

    line 171
  16. Very specific:

    If CLAUDE_PLUGIN_ROOT is unavailable, use the source path:

    line 176
  17. Very specific:

    Only when session_docs: true in harness-answers.yml AND stub(s) are absent.

    line 185
  18. Very specific:

    Create missing stubs using the same templates as /init Step 5:

    line 187
  19. Very specific:

    After writing, verify both files exist (ls check).

    line 218
  20. Very specific:

    Write _engine_version: "{latest}" back to .claude/harness-answers.yml.

    line 224
  21. Distinctive:

    All other fields remain unchanged.

    line 225

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/harness-update Skill — Harness Full Upgrade

Implements the full harness upgrade path: version check → CHANGELOG → checklist → approval → apply. Analogous to npm update / brew upgrade — upgrades the entire installed harness, not just CLAUDE.md. Prerequisite: /init has been run (.claude/harness-answers.yml exists).

When to Use

  • After a new harness release is available (patrick-work-harness tag bump)
  • When session-dashboard.html is missing, Stop hooks are unwired, or session stubs are absent on an existing init'd repo
  • To verify whether a repo is fully up to date without applying changes (--check mode)

Invocation Modes

ModeHow to invokeEffect
Default (upgrade)/harness-updateSteps 1→6 — check, report, await approval, apply
Check only/harness-update --checkSteps 1→3 only — report without writing

Step 1 — Read provenance and resolve engine version

Read .claude/harness-answers.yml in the current working repo (the repo Claude Code is opened in):

  • _engine_version: version at last /init or /harness-update run
  • session_docs: bool — whether session stubs (SESSION_INDEX / CURRENT_SESSION) are expected
  • plan_tier: "1" or "2" — read only, never re-prompted here (changing tiers is a manual, explicit action, not an upgrade concern). Field absent (repo initialized before this field existed) → treat as plan_tier: "2", not an error and not a reason to halt.

Resolve the latest engine version via this priority order:

  1. ${CLAUDE_PLUGIN_ROOT}/plugin.json → version (plugin-install topology)
  2. Local patrick-work-harness clone: search for plugin.json under common paths (<로컬 하네스 체크아웃>/plugin.json, ~/.claude/plugins/*/plugin.json)
  3. If neither is found: halt with "Cannot resolve engine version — ensure CLAUDE_PLUGIN_ROOT is set or patrick-work-harness is cloned locally."

Step 1-b — Cross-check the provenance field against what is actually installed

🔴 The _engine_version field can be wrong. It is written by /init and /harness-update, and until 2026-09-24 install.sh did not touch it at all — so a repo installed via the script kept the old value while the hooks on disk were newer (real case: field 1.3.4, hooks v1.4.1). Judging from the field alone then tells the user to re-install what is already installed.

Before applying the comparison table below, read the install marker and compare:

# Written by install.sh since v1.4.2 (HARNESS-INSTALL-PROVENANCE-2)
grep '^version:' ~/.claude/hooks/patrick-work-harness/.harness-owned | cut -d' ' -f2
Marker vs fieldAction
Marker absent (pre-v1.4.2 install, or hooks not installed)Proceed with the field alone, and say so in the output: 「설치 표식이 없어 provenance 필드만으로 판정합니다」
Marker == fieldField is trustworthy → proceed to the table below
Marker != field🔴 Report both and treat the marker as authoritative for what is on disk: 「설치본은 {marker} 인데 provenance 필드는 {field} 입니다 — 필드를 {marker} 로 맞춘 뒤 진행합니다」. Fix the field first, then re-evaluate

Why the marker wins: the field records what a skill last claimed; the marker records what the installer actually wrote. When they disagree, the files on disk are the ground truth.

ComparisonAction
_engine_version == latestOutput "✅ 이미 최신 버전 ({ver}) — 체크리스트만 실행합니다." then jump to Step 3 (checklist only, no zone rewrite)
_engine_version < latestProceed to Step 2
_engine_version > latestHalt: "⚠️ provenance가 설치 버전보다 높습니다 — 수동 확인 필요."

Step 2 — Display CHANGELOG

Read CHANGELOG.md from the engine source (same directory as plugin.json resolved in Step 1).

Extract all version sections newer than _engine_version (sections between ## [X.Y.Z] headers where X.Y.Z > _engine_version, semver order).

Output format:

── 변경 내역 ({_engine_version} → {latest}) ──────────
  ## [1.0.1] - 2026-06-26
    Added: /harness-update 스킬 (버전 확인→체크리스트→승인→일괄 갱신)
  ...
──────────────────────────────────────────────────────

If CHANGELOG.md is absent or the section is empty, output "변경 내역 없음 (CHANGELOG 미존재)" and continue.


Step 3 — Checklist: what needs applying

Inspect the current repo state across 4 axes. Mark each ✅ (ok) or ❌ (needs update):

#AxisCheckNeeds update condition
AHARNESS zoneCLAUDE.md contains <!-- HARNESS:START v{latest} -->Version tag differs from latest
BStop hook 3종.claude/settings.json Stop array contains all 3: session-dashboard-sync.py, gate-e-sync-guard.py, error-topics-guard.pyAny of the 3 is absent
Csession-dashboard.htmlFile exists at repo rootAbsent
DSession stubs${SESSION_INDEX_FILE} and ${CURRENT_SESSION_FILE} exist at repo rootEither absent AND session_docs: true in harness-answers.yml
ELayer 2 docs statusDOC_INDEX.md exists at repo root AND all Layer 2 rows show Skeleton or better (not Pending)DOC_INDEX.md absent OR any Layer 2 row still shows Pending (indicates /init Step 9 did not run or was --docs=minimal/none)

Output the checklist table with ✅/❌ per row, then:

  • If all ✅: "모든 항목 최신 상태 — 갱신 불필요합니다."
  • If --check mode: stop here (no file writes).
  • If ≥1 ❌: list the items needing update and proceed to Step 4.

Step 4 — Await user approval

Output:

위 {N}항목을 적용하겠습니다.
「harness-update 승인」으로 응답하면 실행합니다.

STOP — await user response before any file writes.

Recognized approval phrases: 「harness-update 승인」「승인」「적용」「진행」. On any other response, abort with "갱신을 취소했습니다."


Step 5 — Apply updates (checklist-driven, conditional per axis)

Execute only the axes marked ❌ in Step 3. Axes already ✅ are skipped silently.

Axis A — HARNESS zone reconcile

Reconcile the HARNESS zone:

  • Locate <!-- HARNESS:START … <!-- HARNESS:END --> sentinels in CLAUDE.md
  • Overwrite the zone wholesale with the current engine template, substituting project_repo from harness-answers.yml
  • Update version tag to <!-- HARNESS:START v{latest} -->
  • Everything after <!-- PROJECT-OWNED below --> is never touched

If sentinels are absent: output "⚠️ HARNESS sentinel 없음 — /init을 먼저 실행하세요." and skip this axis.

Axis B — Wire Stop hooks

Read .claude/settings.json (create {"hooks":{}} if absent).

Check which of the 3 guards are missing from the Stop array:

  • session-dashboard-sync.py
  • gate-e-sync-guard.py
  • error-topics-guard.py

Prepend the missing guards to the existing Stop array (preserve all existing entries). session-dashboard-sync.py must always be the first Stop entry (HARNESS-STALE-GUARD-3 ordering).

Use ${CLAUDE_PLUGIN_ROOT}/hooks/ paths. All 3 guards resolve their target repo via CLAUDE_PROJECT_DIR (3-tier fallback) — no per-repo path edits needed.

Result JSON shape:

{
  "hooks": {
    "Stop": [{
      "hooks": [
        { "type": "command", "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/session-dashboard-sync.py\"", "timeout": 10 },
        { "type": "command", "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/gate-e-sync-guard.py\"", "timeout": 10 },
        { "type": "command", "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/error-topics-guard.py\"", "timeout": 10 }
        /* existing entries preserved after this point */
      ]
    }]
  }
}

Axis C — Generate session-dashboard.html

Run the sync script once manually:

CLAUDE_PROJECT_DIR=<repo root> python3 "${CLAUDE_PLUGIN_ROOT}/hooks/session-dashboard-sync.py"

If CLAUDE_PLUGIN_ROOT is unavailable, use the source path:

CLAUDE_PROJECT_DIR=<repo root> python3 ${HARNESS_PLANS_DIR}/hooks/session-dashboard-sync.py

Confirm session-dashboard.html exists at the repo root after execution.

Axis D — Create session stubs

Only when session_docs: true in harness-answers.yml AND stub(s) are absent.

Create missing stubs using the same templates as /init Step 5:

${SESSION_INDEX_FILE} stub:

---
project: "{project_repo}"
last_updated: "{YYYY-MM-DD}"
gate: "신규 — 다음 작업 시 /gate-a로 시작"
sessions_since_audit: 0
last_audit_date: ""
priority_note: ""
next_action: "새 작업 시 /gate-a로 시작."
---

# 세션 인덱스

| 세션 ID | 제목 | 저장소 | 상태 |
|---------|------|--------|------|

${CURRENT_SESSION_FILE} stub:

# 현재 세션 상태

> **세션 ID**: (미정 — /gate-a로 시작)
> **현재 상태**: 신규
> **직전 세션**: —

> **세션 주제**: harness-update 백필 적용 완료 — 다음 작업 시 /gate-a로 시작

After writing, verify both files exist (ls check). If either is absent after write, retry once.


Step 6 — Update _engine_version

Write _engine_version: "{latest}" back to .claude/harness-answers.yml. All other fields remain unchanged.


Verification Checklist (for Gate C after /harness-update)

  • C1: harness-answers.yml → _engine_version equals latest engine version
  • C2: CLAUDE.md HARNESS zone version tag matches latest: <!-- HARNESS:START v{latest} -->
  • C3: .claude/settings.json Stop array contains all 3 guards with session-dashboard-sync.py first
  • C4: session-dashboard.html exists at repo root
  • C5: Already-up-to-date repo exits cleanly at Step 1 with "✅ 이미 최신 버전"
  • C6: --check mode produces no file writes (read-only confirmed by grep)

Notes

  • /harness-update is explicit-invoke only (D-4 decision). The SessionStart hook may detect version mismatch and notify, but reconciliation requires explicit invocation.
  • Idempotent: re-running when already up to date exits cleanly at Step 1 or reports all-✅ at Step 3.
  • Scope: /harness-update is the full upgrade path — HARNESS zone + hooks + dashboard + stubs in one run (HARNESS-zone reconcile is Axis A).
  • Relation to /init: /init is for new repos. /harness-update is for existing init'd repos. Never run /init on an existing repo to apply updates — use /harness-update.

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.