From harness
在工作流程中產生交接 artifact。$ARGUMENTS 區分模式:`task` 寫任務級五段式快照(整份取代),`log` 追加會話日誌並更新 living section,`view` 唯讀摘要;`view --verify` 額外跑 living section 命令並報告 drift。觸發於 "/handoff"、"交接"、"寫進度"、"結束會話"、"task 收尾"、"session 收尾" 等情境。Memory-as-hint 原則:產出是 hint 不是 truth,下輪 agent 必須 verify。
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness:handoff [task|log|view] [--verify][task|log|view] [--verify]The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Invoked with: $ARGUMENTS
Invoked with: $ARGUMENTS
tokens = split $ARGUMENTS by whitespace
mode = first non-flag token(或 default "task" 若空)
flags = tokens starting with "--"
if mode == "task" or empty → Mode A
if mode == "log" → Mode B
if mode == "view" → Mode C
otherwise → 回應「unknown mode: {mode}」並停止
flags 處理:
--verify (僅 Mode C 有意義;其他 mode 忽略並 warn)
| Mode | 場景 | 輸出檔 |
|---|---|---|
task 或空 | 一個 task 結束、準備進下一個 | .harness/handoff/task-handoff.md(整份取代) |
log | 一個 session 結束(task 是否完成皆可) | .harness/handoff/progress-log.md(更新 living + append entry) |
view | 想看當前狀態 | 無寫檔,summary 到 chat |
view --verify | 想看當前狀態並驗證 living 命令是否仍跑通 | 無寫檔,跑命令 + 報告 drift 到 chat |
不觸發於:sprint contract 起草 / rubric.md 撰寫 / 對 source code 的 commit-time 操作。
.harness/handoff/task-handoff.md(若存在)以了解上輪狀態——僅供 context、非 truth。git status + git diff --stat、已 commit 的 hash。templates/task-handoff.md 範本填 5 段(含 Shell: 宣告、component_type 標籤、evidence path)。.harness/handoff/task-handoff.md(整份取代)。若 .harness/handoff/task-handoff.md 不存在:
.harness/handoff/ 目錄task_id 由 user / agent 宣告(對應 .harness/contract/<task_id>/).harness/contract/<task_id>/ 不存在 → warn「task_id 對應的 contract 目錄不存在」.harness/handoff/progress-log.md(若存在)。.harness/handoff/progress-log.md。若 .harness/handoff/progress-log.md 不存在:
.harness/handoff/ 目錄repo_root: git rev-parse --show-toplevel;失敗則用 pwddefault_shell: 偵測 OS / shell(Windows + git-bash in PATH → "bash";純 PowerShell → "powershell";macOS/Linux → "bash";偵測失敗 → 留空 + warn).harness/handoff/task-handoff.md + .harness/handoff/progress-log.md。--verify flag額外執行:
default_shell(frontmatter)+「標準啟動路徑」+「標準驗證路徑」; output: ...」;output 與描述顯著不一致 →「possible drift: living says X, actual shows Y」
- 不採取任何修補動作;agent / user 看到後自行決定下一步。
驗證原則(warn-only · 不阻塞寫入)
規則 warn 觸發條件 段非空 段標題下無內容 → 「段空白:填內容或明寫『無』」 無 padding 偵測 "TBD" / "暫無,待補充" / "依需要" / "待確認" / "繼續推進" → warn Shell 宣告 命令段缺 **Shell**: 行或 code fence 缺 language → warn Shell-syntax 一致 宣告 bash 但命令出現 $env: / Get-ChildItem style → warn;宣告 powershell 但出現 export VAR= / /dev/null → warn 命令可貼 命令段是純散文無 code block → warn component_type 「仍損壞」/「已知風險」段內每條缺 component_type 標籤 → warn(enum 見 references/component-enum.md) Evidence path 格式 含 : 在第二位或開頭 / → warn「path 應相對 repo root」 Evidence file 存在 path 寫了但檔案不存在 → warn Don't touch path 存在 path 不是現存 file / dir → warn Don't touch reason : 後為空白或單字、或含 padding → warnLiving section 變動 audit living 改了但「Living section 變動」段空白或未提及變動欄位 → warn last_updated 新鮮度 living section last_updated 超過 7 天 → warn schema_version 缺 schema_version → warn last_writer 必填 last_writer 欄位空白 → warntask_id 對應 contract task-handoff 的 task_id 對應 .harness/contract/<task_id>/ 目錄不存在 → warn
驗證後續處置由 agent 決定——本 skill 不強制阻塞、不自動修補。
寫入限制(hard constraints)
只寫:
.harness/handoff/task-handoff.md
.harness/handoff/progress-log.md
絕不寫:sprint contract / rubric.md / scripts/ / agents/ / source code / .harness/contract/* / .harness/evidence/*。
絕不刪 progress-log.md 的歷史 entry(append-only)。
若 .harness/handoff/ 目錄不存在,建立它。
Memory-as-hint 提醒
本 skill 產出的 artifact 是 hint,不是 truth。下輪 agent 讀完後:
- 描述性事實(架構、慣例)→ 作 prior 信念使用
- 可驗證事實(命令、檔案位置、API 行為)→ 採取破壞性動作前 verify。Verify 方式:(a) 跑
/handoff view --verify、(b) 手動跑 living section 的命令、(c) grep / read 對應檔案。
Anti-patterns
- ✗ 「本輪改動:暫無重大改動,待後續補充」(padding)
- ✗ 「命令:依照專案文件執行相應的測試」(不可貼)
- ✗ 「下一步最佳動作:繼續推進開發」(無資訊量)
- ✗ Don't touch:
src/login.svelte: 不要動(reason 過短、無因果)
- ✗ Shell 宣告 bash 但命令出現
$env:VAR=...
- ✓ 「本輪改動:無」
- ✓ 「命令」段含
**Shell**: bash + bash code fence + pytest tests/test_login.py -v
- ✓ 「下一步最佳動作:修 D-001 的 CJK 垂直渲染(src/login.svelte:42);不要動 src/router.svelte 直到 D-003 確認」
引用檔案
- Template:
templates/task-handoff.md、templates/progress-log.md
- Reference:
references/component-enum.md(不確定 component_type 該選哪個時必讀)
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub gn00678465/harness-tools --plugin harness