Files
log/skills/worklog/SKILL.md
T
jiantw83 b1a0418211 refactor(worklog): worklog-target.sh 改為接收已算好的 hash
什麼:tools/worklog-target.sh 不再自行重算 SHA-1,改為直接接收呼叫端算好的 hash 參數;skills/worklog/SKILL.md、README.md 同步更新呼叫方式與工具說明;plugin.json、.claude-plugin/plugin.json、.codex-plugin/plugin.json 版本號由 0.0.3 升至 0.0.4。

為什麼:原本 worklog-target.sh 重複實作了共享的 SHA-1 wiki-hash 演算法,與 jsc-gitea/tools/hash-id 的邏輯重複,違反單一事實來源原則,也和 learn 技能已採用的正確呼叫模式不一致。

如何:移除腳本內建的 sha1sum/shasum 計算與 hash 前綴修正邏輯,改為直接使用傳入的 hash 參數組出 LOG_{HASH}、LOG_CONTENTS;SKILL.md 改為先呼叫 jsc-gitea/tools/hash-id 算出 HASH 再傳給 worklog-target.sh;輸出行為與結果不變。

誰:jsc-meta:skill-check 例行合規稽核(worklog 技能)。
2026-08-24 14:47:26 +08:00

2.7 KiB

name, description
name description
worklog After finishing a work package, collect ten facts (repo, branch, plan link, work package link, elapsed time from session-timer, token usage per CLI, status, details, difficulties, PR target) and append a templated entry to wiki LOG_{HASH} plus LOG_CONTENTS. HASH follows the shared 8-char rule with the H-prefix fallback, and the work-week Friday still drives the page content. Trigger at the end of implement or maintain; not for planning notes.

worklog — work log

After work completes, collect the ten items below and append a templates/log-entry.md entry to the wiki log page. Collection and writing MUST run as a sub agent. The entry content is written in Traditional Chinese (STE100).

Items to collect

# Item Source
1 Repository name Parse {owner}/{repo} from git remote get-url origin
2 Branch name git branch --show-current
3 Plan name Link to the plan page [[PLAN_{HASH}]]
4 Work package id Link to the work package heading on the analyze page [[ANALYZE_{HASH}#WP-xx]]
5 Elapsed time jsc-hooks/hooks/session-timer.sh report {session_id} (seconds; convert to h/m)
6 Token usage See the table below; per-CLI methods differ. Fill N/A when unavailable
7 Task status One of the literal values 「完成」、「部分完成」、「阻塞」 (with reason when blocked)
8 Details and outputs Summarize what changed and which files or pages were produced
9 Difficulties and resolutions One pair per line
10 PR target branch Link to the PR page

How to get token usage

CLI Method
claude Sum the usage fields in transcript JSONL (~/.claude/projects/**/*.jsonl), or read usage from claude -p --output-format json
codex Token counters under ~/.codex/sessions/**, or /status inside the session
copilot /usage inside the session
antigravity Value shown in the UI; N/A when unreadable
kiro No public source; fill N/A

Target page and work week

  • Page name: LOG_{HASH}.
  • Compute {HASH} from {owner}/{repo} with jsc-gitea/tools/hash-id (shared wiki hash rule: first 8 uppercase SHA-1 hex chars; H plus the first 7 chars when the raw hash starts with 0-9, A, B, or C).
  • Compute the target page by running tools/worklog-target.sh "{HASH}" all. Use PAGE for LOG_{HASH} and CONTENTS for LOG_CONTENTS.
  • The work-week Friday still drives the page content and the row dates.
  • Read the page via jsc-gitea:wiki. If it does not exist, create it with the structure described in templates/log-contents.md; otherwise APPEND the new entry at the end.
  • Update LOG_CONTENTS in the same pass (apply templates/log-contents.md; add the row if missing).