From 5afb39d3edcd5b5013dce72013970f5a850039cc Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 21 Aug 2026 13:08:18 +0800 Subject: [PATCH 01/10] =?UTF-8?q?chore(log):=20=E4=BF=AE=E6=AD=A3=E7=AF=84?= =?UTF-8?q?=E6=9C=AC=20manifest=20=E8=88=87=E7=A7=BB=E9=99=A4=20hello=20?= =?UTF-8?q?=E7=AF=84=E4=BE=8B=E7=AC=A6=E5=90=88=20log=20=E9=A0=98=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .agents/plugins/marketplace.json | 6 ++--- .claude-plugin/marketplace.json | 8 +++---- .claude-plugin/plugin.json | 17 +++++++++----- .codex-plugin/plugin.json | 6 ++--- plugin.json | 8 +++---- skills/hello/SKILL.md | 38 -------------------------------- 6 files changed, 25 insertions(+), 58 deletions(-) delete mode 100644 skills/hello/SKILL.md diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index 2c2dafc..dbd6c60 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -1,11 +1,11 @@ { - "name": "template", + "name": "log", "plugins": [ { - "name": "jsc-template", + "name": "jsc-log", "source": { "source": "url", - "url": "https://gitea.jsc.idv.tw/plugins/template.git" + "url": "https://gitea.jsc.idv.tw/plugins/log.git" } } ] diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index e3d2436..11b13bc 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -1,14 +1,14 @@ { - "name": "template", - "description": "JSC 跨 AI 助理共用 skills 的 Claude Code marketplace。", + "name": "log", + "description": "jsc 技能組 log domain 的 marketplace。", "owner": { "name": "JSC" }, "plugins": [ { - "name": "jsc-template", + "name": "jsc-log", "source": "./", - "description": "JSC 共用 skills(跨 AI 助理)" + "description": "工作日誌(LOG_* wiki 頁)與技能使用統計" } ] } diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index a5c2dd3..531d190 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,12 +1,17 @@ { - "name": "jsc-template", - "version": "0.0.3", - "description": "JSC 跨 AI 助理共用 plugin 模板(Claude Code / Codex / Antigravity / OpenCode)。所有 skills 以 SKILL.md 為共通標準,於 Claude Code 以 /jsc-template: 前綴呼叫。", + "name": "jsc-log", + "version": "0.2.0", + "description": "工作日誌(LOG_* wiki 頁)與技能使用統計", "skills": "./skills", "author": { "name": "JSC" }, - "homepage": "https://gitea.jsc.idv.tw/plugins/template", - "repository": "https://gitea.jsc.idv.tw/plugins/template.git", - "keywords": ["template", "skills", "cross-tool", "jsc"] + "homepage": "https://gitea.jsc.idv.tw/plugins/log", + "repository": "https://gitea.jsc.idv.tw/plugins/log.git", + "keywords": [ + "jsc", + "log", + "skills", + "cross-tool" + ] } diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 71a3c32..fca3fb6 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { - "name": "jsc-template", - "version": "0.0.3", - "description": "JSC 跨 AI 助理共用 plugin 模板。所有 skills 以 SKILL.md 為共通標準。", + "name": "jsc-log", + "version": "0.2.0", + "description": "工作日誌(LOG_* wiki 頁)與技能使用統計", "skills": "./skills" } diff --git a/plugin.json b/plugin.json index 4873395..24c9c7f 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { - "name": "jsc-template", - "version": "0.0.3", - "description": "JSC 跨 AI 助理共用 plugin 模板。所有 skills 以 SKILL.md 為共通標準;於 Antigravity 以 /jsc-template: 前綴呼叫。", + "name": "jsc-log", + "version": "0.2.0", + "description": "工作日誌(LOG_* wiki 頁)與技能使用統計", "skills": "./skills/" -} \ No newline at end of file +} diff --git a/skills/hello/SKILL.md b/skills/hello/SKILL.md deleted file mode 100644 index c5be22f..0000000 --- a/skills/hello/SKILL.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: hello -description: 範例 skill,用來驗證 jsc plugin 是否安裝成功,也是新增 skill 的範本。當使用者輸入 hello、想測試 plugin、或想看 skill 模板長什麼樣子時觸發;回覆一句問候並簡述此 plugin 的用途。 ---- - -# hello(範例 skill) - -這是 `jsc-template` plugin 的範例 skill。它有兩個用途: - -1. **驗證安裝** — 跨各家 AI 助理確認 skill 已被正確載入。 -2. **作為範本** — 複製這個資料夾即可新增一個新的 skill。 - -## 呼叫方式 - -| 助理 | 呼叫方式 | -| --- | --- | -| Claude Code | `/jsc-template:hello` | -| Antigravity | `/jsc-template:hello`,或描述需求自動觸發 | -| Codex | 在提示詞輸入 `$hello`,或用 `/skills` 選單 | -| OpenCode | 直接描述需求,模型會透過 skill 工具自動呼叫 | -| GitHub Copilot CLI | 直接描述需求,Copilot 會讀取已安裝 plugin 的 skills | - -## 行為 - -當這個 skill 被觸發時: - -1. 回覆「Hello from **jsc** 👋」。 -2. 用一句話說明 `jsc-template` 是一個跨 AI 助理的共用 skill 集合。 -3. 提示使用者可以在 README 的「Skills 目錄」查看所有可用的 skills。 - -## 如何以此為範本新增 skill - -1. 複製 `skills/hello/` 為 `skills//`。 -2. 修改 `SKILL.md` 的 frontmatter: - - `name`:小寫、數字、連字號(`-`),最長 64 字元。**這個名稱會成為 Claude Code / Antigravity 的 `/jsc-template:` 指令**。 - - `description`:第三人稱,寫清楚「什麼時候該用、什麼時候不該用」與觸發關鍵字 — 各家助理靠這段文字決定是否自動載入。 -3. 在內文寫下 skill 的具體步驟。 -4. 手動把新 skill 補進 README 的「Skills 目錄」區塊。 -- 2.53.0 From de9e342d773f7c03b46fae1208ce2ba054eb75b5 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 21 Aug 2026 13:08:43 +0800 Subject: [PATCH 02/10] =?UTF-8?q?feat(log):=20=E5=8C=AF=E5=85=A5=20jsc-log?= =?UTF-8?q?=20=E6=8A=80=E8=83=BD=E7=B5=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- skills/stats/SKILL.md | 21 ++++++++++++++++++ skills/worklog/SKILL.md | 45 +++++++++++++++++++++++++++++++++++++++ templates/log-contents.md | 7 ++++++ templates/log-entry.md | 27 +++++++++++++++++++++++ tools/usage-stats.sh | 32 ++++++++++++++++++++++++++++ 5 files changed, 132 insertions(+) create mode 100644 skills/stats/SKILL.md create mode 100644 skills/worklog/SKILL.md create mode 100644 templates/log-contents.md create mode 100644 templates/log-entry.md create mode 100755 tools/usage-stats.sh diff --git a/skills/stats/SKILL.md b/skills/stats/SKILL.md new file mode 100644 index 0000000..1f54f83 --- /dev/null +++ b/skills/stats/SKILL.md @@ -0,0 +1,21 @@ +--- +name: stats +description: Report usage counts of every jsc skill and every skill call chain, aggregated by tools/usage-stats.sh from $JSC_HOME/usage/*.jsonl recorded by jsc-hooks. Supports --cli filtering. Use when the user asks how often skills or chains are used; not for token or time stats (see worklog). +--- + +# stats — 技能與呼叫鏈使用統計 + +資料由 `jsc-hooks/hooks/skill-usage.sh` 持續記錄在 `$JSC_HOME/usage/`(預設 `~/.jsc/usage/`)。 + +## 操作 + +| 統計 | 指令 | 輸出 | +| --- | --- | --- | +| 各技能使用次數 | `tools/usage-stats.sh skills` | `次數技能名`,降冪 | +| 各呼叫鏈使用次數 | `tools/usage-stats.sh chains` | `次數from -> to`,降冪 | +| 依 CLI 過濾 | 加 `--cli claude`(或 codex / copilot / antigravity / kiro) | 同上 | + +## 呈現 + +1. 直接執行工具,把輸出整理成表格回覆。 +2. 沒有資料時說明:需先安裝 `jsc-hooks` 並執行 `jsc-hooks:hooks-install` 接線。 diff --git a/skills/worklog/SKILL.md b/skills/worklog/SKILL.md new file mode 100644 index 0000000..ffbd01c --- /dev/null +++ b/skills/worklog/SKILL.md @@ -0,0 +1,45 @@ +--- +name: worklog +description: 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_{yyyyMM}_W{week} plus LOG_CONTENTS. Week number is derived from the Friday of the work week. Trigger at the end of implement or maintain; not for planning notes. +--- + +# worklog — 工作日誌 + +工作完成後蒐集以下十項資訊,套用 `templates/log-entry.md` 附加到 wiki 日誌頁。蒐集與寫入**必須以 sub agent 執行**。 + +## 蒐集項目 + +| # | 項目 | 來源 | +| --- | --- | --- | +| 1 | 存取庫名稱 | `git remote get-url origin` 解析出 `{owner}/{repo}` | +| 2 | 分支名稱 | `git branch --show-current` | +| 3 | 計畫名稱 | 連結到計畫頁 `[[PLAN_{...}]]` | +| 4 | 工作包編號 | 連結到分析頁的工作包標題 `[[ANALYZE_{...}#WP-xx]]` | +| 5 | 花費時間 | `jsc-hooks/hooks/session-timer.sh report {session_id}`(秒,換算 h/m) | +| 6 | token 用量 | 見下表,各 CLI 取法不同;不可得填 `N/A` | +| 7 | 任務狀態 | 完成 / 部分完成 / 阻塞(附原因) | +| 8 | 執行細節與產出 | 摘要改了什麼、產出哪些檔案或頁面 | +| 9 | 遇到的困難 + 解決方式 | 一行一組 | +| 10 | PR 的目標分支 | 連結到 PR 頁 | + +### token 用量取得方式 + +| CLI | 取法 | +| --- | --- | +| claude | transcript JSONL(`~/.claude/projects/**/*.jsonl`)的 `usage` 欄位加總,或 `claude -p --output-format json` 的 `usage` | +| codex | `~/.codex/sessions/**` 的 token 計數,或工作階段內 `/status` | +| copilot | 工作階段內 `/usage` | +| antigravity | 介面顯示值;無法讀取時 `N/A` | +| kiro | 無公開來源,填 `N/A` | + +## 目標頁與週數計算 + +- 頁名:`LOG_{yyyyMM}_W{週數}`,兩者都取自**本工作週的週五**: + ```sh + dow=$(date +%u) + if [ "$dow" -ge 6 ]; then f=$(date -d 'last friday' +%Y%m%d); else f=$(date -d 'friday' +%Y%m%d); fi + yyyyMM=$(printf '%s' "$f" | cut -c1-6) + W=$(( ( $(printf '%s' "$f" | cut -c7-8 | sed 's/^0//') - 1 ) / 7 + 1 )) # 該週五是當月第幾個週五 + ``` +- 經由 `jsc-gitea:wiki` 讀取該頁;不存在就以 `templates/log-contents.md` 說明的結構新建,存在就把新條目**附加**在文末。 +- 同步更新 `LOG_CONTENTS`(套用 `templates/log-contents.md`,該週的列不存在就新增)。 diff --git a/templates/log-contents.md b/templates/log-contents.md new file mode 100644 index 0000000..46dedcc --- /dev/null +++ b/templates/log-contents.md @@ -0,0 +1,7 @@ +# 日誌目錄 + +> 由 `jsc-log:worklog` 維護。每個日誌頁一列;週數 = 該週五是當月第幾個週五。 + +| 日誌頁 | 週五日期 | 條目數 | 最後更新 | +| --- | --- | --- | --- | +| [[LOG_{yyyyMM}_W{週數}]] | {yyyy-MM-dd} | {n} | {yyyy-MM-dd HH:mm} | diff --git a/templates/log-entry.md b/templates/log-entry.md new file mode 100644 index 0000000..5cb6207 --- /dev/null +++ b/templates/log-entry.md @@ -0,0 +1,27 @@ +# 工作日誌頁 — LOG_{yyyyMM}_W{週數} + +> 由 `jsc-log:worklog` 維護。每完成一項工作附加一個條目在文末。 +> `{yyyyMM}` 與 `{週數}` 取自本工作週的週五:週數 = 該週五是當月第幾個週五。 + +--- + +## {yyyy-MM-dd HH:mm} {工作摘要一句話} + +| 欄位 | 內容 | +| --- | --- | +| 存取庫名稱 | {owner}/{repo} | +| 分支名稱 | {branch} | +| 計畫名稱 | [[PLAN_{yyyyMMdd}_{HHmmss}_{HASH}|{計畫名稱}]] | +| 工作包編號 | [[ANALYZE_{yyyyMMdd}_{HHmmss}_{HASH}#wp-{編號}|WP-{編號} {工作包標題}]] | +| 花費時間 | {h} 小時 {m} 分(session-timer report) | +| token 用量 | {CLI}: {input}/{output}(不可得填 N/A) | +| 任務狀態 | 完成 / 部分完成 / 阻塞({原因}) | +| PR 目標分支 | [{base 分支}]({PR URL}) | + +### 執行細節與產出 + +- {做了什麼、產出哪些檔案或頁面} + +### 遇到的困難與解決方式 + +- {困難} → {解決方式} diff --git a/tools/usage-stats.sh b/tools/usage-stats.sh new file mode 100755 index 0000000..b89d029 --- /dev/null +++ b/tools/usage-stats.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env sh +# usage-stats.sh — 聚合 jsc-hooks 記錄的技能用量。 +# 用法: +# usage-stats.sh skills [--cli ] # 每個 skill 的使用次數(降冪) +# usage-stats.sh chains [--cli ] # 每條 from -> to 呼叫鏈的次數(降冪) +# 資料: $JSC_HOME/usage/skills.jsonl、chains.jsonl(預設 $HOME/.jsc) +set -u +JSC_HOME="${JSC_HOME:-$HOME/.jsc}" +cmd="${1:?usage: usage-stats.sh skills|chains [--cli ]}"; shift +cli="" +while [ $# -gt 0 ]; do + case "$1" in + --cli) cli="${2:?--cli needs a value}"; shift 2 ;; + *) shift ;; + esac +done + +by_cli() { # 依 --cli 過濾;未指定就原樣輸出 + if [ -n "$cli" ]; then grep "\"cli\":\"$cli\""; else cat; fi +} +rank() { sort | uniq -c | sort -rn | sed 's/^ *\([0-9][0-9]*\) /\1\t/'; } + +case "$cmd" in + skills) + f="$JSC_HOME/usage/skills.jsonl"; [ -f "$f" ] || exit 0 + by_cli < "$f" | sed -n 's/.*"skill":"\([^"]*\)".*/\1/p' | rank ;; + chains) + f="$JSC_HOME/usage/chains.jsonl"; [ -f "$f" ] || exit 0 + by_cli < "$f" | sed -n 's/.*"from":"\([^"]*\)".*"to":"\([^"]*\)".*/\1 -> \2/p' | rank ;; + *) + echo "unknown command: $cmd" >&2; exit 2 ;; +esac -- 2.53.0 From 3e027c11bee0b7360a77d11ad8ee07c7d7e598e4 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 21 Aug 2026 13:08:43 +0800 Subject: [PATCH 03/10] =?UTF-8?q?docs(log):=20=E4=BB=A5=E7=B5=B1=E4=B8=80?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E6=94=B9=E5=AF=AB=E7=B9=81=E9=AB=94=E4=B8=AD?= =?UTF-8?q?=E6=96=87=20README=20=E8=88=87=20AGENTS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- AGENTS.md | 20 ++--- README.md | 236 +++++++----------------------------------------------- 2 files changed, 39 insertions(+), 217 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index a86a1f1..4a715ef 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,15 +1,15 @@ -# jsc-template — 共用 Skills(跨 AI 助理) +# jsc-log — 給 AI 助理的指引 -本 repo 是一組以 **Agent Skills(`SKILL.md`)** 標準撰寫的共用 skills,可同時被 Claude Code、Codex、Antigravity、OpenCode 使用。 +本 repo 是 jsc 技能組的 `log` domain(工作日誌(LOG_* wiki 頁)與技能使用統計),可同時被 Claude Code / Codex / Copilot / Antigravity / Kiro 使用。 -## 給 AI 助理的指引 +## 規則 -- 所有可用的 skills 位於本 repo 的 `skills//SKILL.md`。 -- 在處理任務前,先比對使用者需求與各 skill `SKILL.md` frontmatter 的 `description`,若相符請載入並依其步驟執行。 -- **呼叫慣例**:在 Claude Code 與 Antigravity 中,這些 skill 以 `/jsc-template:` 呼叫;Codex 以 `$`、OpenCode 由模型依描述自動觸發 — 兩者沒有 `/jsc-template:` 前綴,不需強制加。 -- 完整清單與每個 skill 的用途,請見 `README.md` 的「Skills 目錄」。 +1. 所有交談與輸出內容基於 STE100 使用繁體中文:短句、一句一指令、主動語態、術語一致、UTF-8 無亂碼。 +2. 技能位於 `skills/{name}/SKILL.md`;處理任務前先比對需求與各技能的 `description`,相符就載入並依其步驟執行。 +3. 技能準則的唯一來源:`plugins/meta` 存取庫的 `references/guidelines.md`。 +4. 所有 hook 只放在 `jsc-hooks`;gitea 操作一律經由 `jsc-gitea` 的 `tools/gitea.sh`;問使用者一律依 `jsc-ask:ask` 的決策樹規則。 +5. 主 agent 不需要處理細節的流程,一律建立 sub agent 處理。 -## 慣例 +## 呼叫慣例 -- 新增 skill 一律放在 `skills//`,且 `` 使用小寫與連字號。 -- `description` 要寫清楚觸發條件(何時用、何時不用),這是跨助理自動載入的唯一依據。 +Claude Code / Antigravity:`/jsc-log:{name}`;Codex:`$name`;Copilot / Kiro / OpenCode:描述需求自動觸發。 diff --git a/README.md b/README.md index 6c6669e..de6dd0e 100644 --- a/README.md +++ b/README.md @@ -1,228 +1,50 @@ -# jsc-template — 跨 AI 助理 Plugin 模板 +# jsc-log — 工作日誌與統計 -一個可同時被 **Claude Code、Codex、Antigravity、OpenCode、GitHub Copilot** 安裝的 plugin 模板。 -核心是以 [Agent Skills(`SKILL.md`)](https://agentskills.io) 標準撰寫的共用 skills(唯一真實來源放在 `skills/`), -搭配各助理各自的 plugin manifest,讓**同一個 repo** 可用各家**原生 plugin CLI** 安裝。 -在 Claude Code 與 Antigravity 中,skill 以 **`/jsc-template:` 前綴**呼叫(例如 `/jsc-template:hello`)。 +jsc 技能組的 log domain:工作完成後把十項資訊寫入 wiki 日誌頁(`LOG_{yyyyMM}_W{週數}`,週數基於週五日期計算),並統計技能使用次數與呼叫鏈次數。 ---- - -## 前綴與呼叫方式 - -| 助理 | 安裝方式 | 呼叫 | `/jsc-template:` 前綴 | -| --- | --- | --- | --- | -| Claude Code | `claude plugin`(marketplace) | `/jsc-template:` 或自動觸發 | ✅ | -| Codex | `codex plugin`(marketplace) | `$` 或 `/skills` 選單 | ❌(用 `$name`) | -| Antigravity | `agy plugin install` | `/jsc-template:` 或自動觸發 | ✅ | -| OpenCode | skills 目錄(複製/clone) | 描述需求自動觸發 | ❌(依名稱) | -| GitHub Copilot CLI | `copilot plugin`(marketplace) | 自然語言或 plugin skills | ❌(無 `/jsc-template:` 前綴) | - -> Codex 不支援自訂前綴(skill 以 `$name` 呼叫);OpenCode 由模型依描述自動呼叫;Copilot CLI 透過原生 plugin 安裝後以自然語言或 plugin skills 使用。三者皆**不強制**前綴。 - ---- - -## 目錄結構 - -同一個 repo 同時帶四種 manifest,彼此以路徑隔離、互不干擾;各助理都讀同一份 `skills/`。 - -``` -template/ -├── .claude-plugin/ -│ ├── plugin.json # Claude 外掛定義(name: "jsc-template") -│ └── marketplace.json # Claude marketplace(name: "template",source 指向本 repo) -├── .codex-plugin/ -│ └── plugin.json # Codex 外掛定義(name: "jsc-template",skills: "./skills") -├── .agents/plugins/ -│ └── marketplace.json # Codex marketplace(name: "template",url source 指向本 repo) -├── plugin.json # Antigravity 外掛定義(name: "jsc-template",skills: "./skills/") -├── skills/ # ★ 唯一真實來源:所有 skills -│ └── hello/SKILL.md -├── AGENTS.md # 跨助理共用指引 -└── README.md -``` - ---- - -## 安裝 / 更新 / 移除(各助理) - -> 指令中的 repo 網址換成你的:`https://gitea.jsc.idv.tw/plugins/template.git` -> -> **Claude / Codex 從 git URL 安裝(會 clone 遠端),請先把本 repo `push` 到 gitea。** -> **Antigravity 的 `agy plugin install ` 目前只支援 github.com**;gitea 請改用「clone + 本地路徑」(見 Antigravity 節)。 -> 本機/離線:Claude 可用本地路徑加 marketplace;Antigravity 用本地路徑安裝。 - -> **⚠ 從 0.0.1 升上來的人請先移除再安裝。** 0.0.2 起 marketplace 名由 `jsc-plugins` 改為 `template` -> (舊名與 `jsc-persona` 的 marketplace 撞名)。各助理以 `@` 當安裝識別鍵, -> 改名後是兩筆獨立條目,**不能用 update 遷移**: -> -> ```bash -> claude plugin uninstall jsc-template@jsc-plugins -> claude plugin marketplace remove jsc-plugins # 若你沒有裝 jsc-persona 才移除,它也用這個名字 -> claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/template.git -> claude plugin install jsc-template@template -> ``` -> -> 移除後記得清掉 `~/.claude/settings.json` 裡 `enabledPlugins` 的舊鍵 `jsc-template@jsc-plugins`, -> 並重開工作階段。Codex/Copilot 同理(`remove`/`uninstall` 後重新 `add`+`install`)。 - -### Claude Code +## 安裝 ```bash -# 安裝 -claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/template.git -claude plugin install jsc-template@template - -# 更新 -claude plugin marketplace update template -claude plugin update jsc-template@template - -# 移除 -claude plugin uninstall jsc-template@template -claude plugin marketplace remove template +claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/log.git +claude plugin install jsc-log@log ``` -- 工作階段內 slash 版(等價):把 `claude plugin` 換成 `/plugin`。 -- 本機開發(免 push):`claude plugin marketplace add C:\Users\h3285\source\repos.plugins\template`(本地路徑)後再 install。 -- **呼叫**:`/jsc-template:`(例 `/jsc-template:hello`)。 +其他 CLI(codex / copilot / antigravity / kiro)與批次安裝、更新、解除安裝:使用 `/jsc-cli:deploy`。 -### Codex +## 工具 -```bash -# 安裝 -codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/template.git -codex plugin add jsc-template@template - -# 更新(重新抓取 marketplace 的 git 快照) -codex plugin marketplace upgrade template - -# 移除 -codex plugin remove jsc-template@template -codex plugin marketplace remove template -``` - -- 安裝 token `jsc-template@template` = plugin 名(`.codex-plugin/plugin.json` 的 `name`)@ marketplace 名(`.agents/plugins/marketplace.json` 的 `name`)。 -- 本 repo 的 Codex marketplace 以 `url` 來源指向自己,故 Codex **一律從 gitea 安裝**(需先 push);安裝後重啟 Codex。 -- **呼叫**:`$`(例 `$hello`),或用 `/skills` 選單。 - -### Antigravity(`agy`) - -> `agy plugin install ` 目前**只支援 github.com**;gitea 等自架 git 不支援 URL 安裝,請先 `git clone` 再用**本地路徑**安裝。 - -```bash -# 安裝:clone 後用本地路徑 -git clone https://gitea.jsc.idv.tw/plugins/template.git ~/plugins/template -agy plugin install ~/plugins/template - -# 更新(agy 無 update 子指令 → git pull 後重裝) -git -C ~/plugins/template pull -agy plugin uninstall jsc-template -agy plugin install ~/plugins/template - -# 移除 -agy plugin uninstall jsc-template -``` - -- 若把 skills 放到 GitHub,則可直接 `agy plugin install https://github.com//`。 -- 其他:`agy plugin list`、`agy plugin enable jsc-template` / `disable jsc-template`、`agy plugin validate `。安裝後重啟工作階段。 -- **呼叫**:`/jsc-template:`(例 `/jsc-template:hello`)或依描述自動觸發。 - -### OpenCode - -OpenCode 的「plugin」是 TypeScript/npm 套件,不適用於 skill 包;skills 改用**目錄安裝**。 -OpenCode 會讀 `~/.config/opencode/skills/`(也會讀 `~/.claude/skills/`、`~/.agents/skills/`)。 - -```bash -# 安裝 -git clone https://gitea.jsc.idv.tw/plugins/template.git ~/plugins/template -mkdir -p ~/.config/opencode/skills -cp -r ~/plugins/template/skills/* ~/.config/opencode/skills/ - -# 更新 -git -C ~/plugins/template pull -cp -r ~/plugins/template/skills/* ~/.config/opencode/skills/ - -# 移除 -rm -rf ~/.config/opencode/skills/hello -``` - -> **Windows PowerShell**:`cp -r A B` → `Copy-Item A B -Recurse -Force`、`rm -rf X` → `Remove-Item X -Recurse -Force`、`~` → `$HOME`。 - -- **呼叫**:直接描述需求,模型會依 skill 描述自動透過 skill 工具呼叫。 - -### GitHub Copilot CLI - -Copilot CLI 支援與 Claude Code 類似的原生 plugin / marketplace 指令,可直接從 marketplace 安裝、更新與移除本 plugin。 - -```bash -# 安裝 -copilot plugin marketplace add https://gitea.jsc.idv.tw/plugins/template.git -copilot plugin install jsc-template@template - -# 更新 -copilot plugin marketplace update template -copilot plugin update jsc-template@template - -# 移除 -copilot plugin uninstall jsc-template@template -copilot plugin marketplace remove template -``` - -- 安裝 token `jsc-template@template` = plugin 名(plugin manifest 的 `name`)@ marketplace 名。 -- `copilot plugin marketplace add` 支援 GitHub `owner/repo`、git URL 與本地路徑;Gitea repo 可用上方 HTTPS URL。 -- **呼叫**:在 Copilot CLI 中用自然語言描述需求,例如 `copilot -i "跑 hello 確認 plugin 裝好了"`。 - ---- - -## 用 CLI 直接執行 skill(headless / 一次性) - -安裝好之後,不必進互動介面,一行指令就能叫某個 skill 跑完並印出結果: - -| 助理 | headless 指令 | 執行 `hello` skill | -| --- | --- | --- | -| Claude Code | `claude -p ""` | `claude -p "/jsc-template:hello"` | -| Codex | `codex exec ""` | `codex exec '$hello'` | -| Antigravity | `agy -p ""` | `agy -p "/jsc-template:hello"` | -| OpenCode | `opencode run ""` | `opencode run "用 hello skill 打個招呼"` | -| GitHub Copilot CLI | `copilot -p ""` | `copilot -p "用 hello skill 打個招呼"` | - -- Claude / Antigravity 支援 `/jsc-template:` 前綴,直接 `-p "/jsc-template:"` 即可。 -- Codex 以 `$` 觸發;在 shell 請用**單引號**避免 `$` 被展開:`codex exec '$hello'`。 -- OpenCode 與 Copilot 沒有前綴,用自然語言描述需求;Copilot CLI 會讀取已安裝 plugin 提供的 skills。 -- 帶引數就接在後面,例如 `claude -p "/jsc-template:hello 參數"`、`codex exec '$hello 參數'`。 - ---- +| 工具 | 用途 | +| --- | --- | +| `tools/usage-stats.sh` | 聚合 `$JSC_HOME/usage/*.jsonl`:`skills` 列技能使用次數、`chains` 列呼叫鏈次數(皆降冪),`--cli ` 過濾 | ## Skills 目錄 -> 此區塊列出本 plugin 內含的所有 skills(名稱/描述/使用方法)。 -> 新增或修改 skill 後,請同步手動更新標記之間的內容。 +呼叫方式:Claude / Antigravity `/jsc-log:{name}`;Codex `${name}`;Copilot / Kiro 描述需求自動觸發。 -### `hello` +### `worklog` -範例 skill,用來驗證 jsc plugin 是否安裝成功,也是新增 skill 的範本。當使用者輸入 hello、想測試 plugin、或想看 skill 模板長什麼樣子時觸發;回覆一句問候並簡述此 plugin 的用途。 +工作完成後蒐集十項資訊(存取庫、分支、計畫連結、工作包連結、花費時間、token 用量、任務狀態、執行細節、困難與解決、PR 目標分支),套範本附加到 `LOG_{yyyyMM}_W{週數}` 與 `LOG_CONTENTS`。 -- **Claude Code / Antigravity**:`/jsc-template:hello` -- **Codex**:`$hello`,或用 `/skills` 選單 -- **OpenCode / GitHub Copilot CLI**:描述需求自動觸發 +### `stats` + +統計本技能組各技能的使用次數與呼叫鏈使用次數,資料來源為 jsc-hooks 記錄的 `skills.jsonl` 與 `chains.jsonl`。 ---- +## 範本 -## 新增一個 skill +| 檔案 | 用途 | +| --- | --- | +| `templates/log-entry.md` | 單筆工作日誌(十欄位) | +| `templates/log-contents.md` | 日誌目錄 `LOG_CONTENTS` | -1. 複製範本:`cp -r skills/hello skills/` -2. 編輯 `skills//SKILL.md` 的 frontmatter: - - `name`:小寫、數字、連字號(`-`),最長 64 字元。**這就是 Claude Code / Antigravity 的 `/jsc-template:`**。 - - `description`:第三人稱,寫清楚「何時用、何時不用」與觸發關鍵字 — 這是各助理自動載入的唯一依據。 -3. 在內文寫下 skill 的具體步驟。 -4. 手動把這個 skill 補進上方「Skills 目錄」區塊。 -5. **bump 版本並 push**:各助理都以 git 內容/版本判斷更新,請把 `.claude-plugin/plugin.json`、`.codex-plugin/plugin.json`、`plugin.json` 三個 manifest 的 `version` 一起 bump,commit 後 push 到 gitea。 -6. 讓各助理更新: - - Claude:`claude plugin update jsc-template@template` - - Codex:`codex plugin marketplace upgrade template` - - Antigravity:`git -C ~/jsc-plugin pull && agy plugin uninstall jsc-template && agy plugin install ~/jsc-plugin` - - OpenCode:`git pull` 後重新複製 `skills/` - - Copilot:`copilot plugin marketplace update template && copilot plugin update jsc-template@template` +## 環境變數 + +Wiki 位置:`JSC_WIKI_REPO_LOG`,未設定退回 `JSC_WIKI_REPO`,再未設定就詢問(見 `jsc-gitea`)。 + +## 相關 domain + +- `jsc-hooks`:花費時間(`session-timer.sh report`)與用量資料來源 +- `jsc-gitea`:wiki 讀寫 -- 2.53.0 From c243e188b8d9f3f1053ffd7844336aa1a25fc237 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 21 Aug 2026 14:03:37 +0800 Subject: [PATCH 04/10] =?UTF-8?q?chore(log):=20=E7=89=88=E6=9C=AC=E8=99=9F?= =?UTF-8?q?=E6=94=B9=E7=82=BA=200.0.1=20=E4=B8=A6=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=80=8B=E5=88=A5=20marketplace=EF=BC=88=E7=B5=B1=E4=B8=80?= =?UTF-8?q?=E7=82=BA=20jsc=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .agents/plugins/marketplace.json | 12 ------------ .claude-plugin/marketplace.json | 14 -------------- .claude-plugin/plugin.json | 2 +- .codex-plugin/plugin.json | 2 +- plugin.json | 2 +- 5 files changed, 3 insertions(+), 29 deletions(-) delete mode 100644 .agents/plugins/marketplace.json delete mode 100644 .claude-plugin/marketplace.json diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json deleted file mode 100644 index dbd6c60..0000000 --- a/.agents/plugins/marketplace.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "log", - "plugins": [ - { - "name": "jsc-log", - "source": { - "source": "url", - "url": "https://gitea.jsc.idv.tw/plugins/log.git" - } - } - ] -} diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json deleted file mode 100644 index 11b13bc..0000000 --- a/.claude-plugin/marketplace.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "log", - "description": "jsc 技能組 log domain 的 marketplace。", - "owner": { - "name": "JSC" - }, - "plugins": [ - { - "name": "jsc-log", - "source": "./", - "description": "工作日誌(LOG_* wiki 頁)與技能使用統計" - } - ] -} diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 531d190..1c8a9d3 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-log", - "version": "0.2.0", + "version": "0.0.1", "description": "工作日誌(LOG_* wiki 頁)與技能使用統計", "skills": "./skills", "author": { diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index fca3fb6..b14deb9 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-log", - "version": "0.2.0", + "version": "0.0.1", "description": "工作日誌(LOG_* wiki 頁)與技能使用統計", "skills": "./skills" } diff --git a/plugin.json b/plugin.json index 24c9c7f..d3c5978 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-log", - "version": "0.2.0", + "version": "0.0.1", "description": "工作日誌(LOG_* wiki 頁)與技能使用統計", "skills": "./skills/" } -- 2.53.0 From e8b4b73a677baea410d40a17224d93871bdac814 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 21 Aug 2026 14:03:37 +0800 Subject: [PATCH 05/10] =?UTF-8?q?docs(log):=20README=20=E5=AE=89=E8=A3=9D/?= =?UTF-8?q?=E6=9B=B4=E6=96=B0/=E7=A7=BB=E9=99=A4=E6=94=B9=E7=82=BA?= =?UTF-8?q?=E6=AF=8F=E6=8C=87=E4=BB=A4=E4=B8=80=E8=A1=8C=EF=BC=88=E4=BA=94?= =?UTF-8?q?=E5=80=8B=20CLI=EF=BC=89=E4=B8=A6=E7=82=BA=E7=9B=B8=E9=97=9C=20?= =?UTF-8?q?domain=20=E5=8A=A0=E4=B8=8A=20repo=20=E9=80=A3=E7=B5=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- README.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index de6dd0e..f78d6eb 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,19 @@ jsc 技能組的 log domain:工作完成後把十項資訊寫入 wiki 日誌頁(`LOG_{yyyyMM}_W{週數}`,週數基於週五日期計算),並統計技能使用次數與呼叫鏈次數。 -## 安裝 +## 安裝 / 更新 / 移除 -```bash -claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/log.git -claude plugin install jsc-log@log -``` +Marketplace 統一為 `jsc`(https://gitea.jsc.idv.tw/plugins/jsc.git),安裝 token 為 `jsc-log@jsc`。每個指令一行: -其他 CLI(codex / copilot / antigravity / kiro)與批次安裝、更新、解除安裝:使用 `/jsc-cli:deploy`。 +| CLI | 安裝 | 更新 | 移除 | +| --- | --- | --- | --- | +| claude | `claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/jsc.git && claude plugin install jsc-log@jsc` | `claude plugin marketplace update jsc && claude plugin update jsc-log@jsc` | `claude plugin uninstall jsc-log@jsc` | +| codex | `codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/jsc.git && codex plugin add jsc-log@jsc` | `codex plugin marketplace upgrade jsc` | `codex plugin remove jsc-log@jsc` | +| copilot | `copilot plugin marketplace add https://gitea.jsc.idv.tw/plugins/jsc.git && copilot plugin install jsc-log@jsc` | `copilot plugin marketplace update jsc && copilot plugin update jsc-log@jsc` | `copilot plugin uninstall jsc-log@jsc` | +| antigravity | `git clone https://gitea.jsc.idv.tw/plugins/log.git ~/plugins/log && agy plugin install ~/plugins/log` | `git -C ~/plugins/log pull && agy plugin uninstall jsc-log && agy plugin install ~/plugins/log` | `agy plugin uninstall jsc-log` | +| kiro | `kiro-cli plugin marketplace add https://gitea.jsc.idv.tw/plugins/jsc.git && kiro-cli plugin install jsc-log@jsc` | `kiro-cli plugin marketplace update jsc && kiro-cli plugin update jsc-log@jsc` | `kiro-cli plugin uninstall jsc-log@jsc` | + +> antigravity 不支援 gitea URL 安裝,改用本地 clone 路徑。批次操作五個 CLI:使用 `/jsc-cli:deploy`。 ## 工具 @@ -46,5 +51,5 @@ Wiki 位置:`JSC_WIKI_REPO_LOG`,未設定退回 `JSC_WIKI_REPO`,再未設 ## 相關 domain -- `jsc-hooks`:花費時間(`session-timer.sh report`)與用量資料來源 -- `jsc-gitea`:wiki 讀寫 +- [`jsc-hooks`](https://gitea.jsc.idv.tw/plugins/hooks):花費時間(`session-timer.sh report`)與用量資料來源 +- [`jsc-gitea`](https://gitea.jsc.idv.tw/plugins/gitea):wiki 讀寫 -- 2.53.0 From 5a1aab76e95a44859695672a67a565c634d8cabf Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 21 Aug 2026 14:13:27 +0800 Subject: [PATCH 06/10] =?UTF-8?q?docs(log):=20AGENTS=20=E8=AA=9E=E8=A8=80?= =?UTF-8?q?=E8=A6=8F=E5=89=87=E6=94=B9=E6=8C=87=E5=90=91=20jsc-meta=20?= =?UTF-8?q?=E7=9A=84=20references/ste100.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 4a715ef..3fe7385 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,7 @@ ## 規則 -1. 所有交談與輸出內容基於 STE100 使用繁體中文:短句、一句一指令、主動語態、術語一致、UTF-8 無亂碼。 +1. 所有交談與輸出內容使用 STE100 繁體中文,帶擬人台灣感:短句、一句一指令、台灣用語、全形標點、去 AI 味、直接講重點。完整規則的唯一來源:`plugins/meta` 的 `references/ste100.md`。 2. 技能位於 `skills/{name}/SKILL.md`;處理任務前先比對需求與各技能的 `description`,相符就載入並依其步驟執行。 3. 技能準則的唯一來源:`plugins/meta` 存取庫的 `references/guidelines.md`。 4. 所有 hook 只放在 `jsc-hooks`;gitea 操作一律經由 `jsc-gitea` 的 `tools/gitea.sh`;問使用者一律依 `jsc-ask:ask` 的決策樹規則。 -- 2.53.0 From 782604005dc94b7b9bc0897fadcdb6d6e91778f2 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 21 Aug 2026 14:16:43 +0800 Subject: [PATCH 07/10] =?UTF-8?q?style(log):=20=E4=BE=9D=20STE100=20?= =?UTF-8?q?=E6=93=AC=E4=BA=BA=E5=8F=B0=E7=81=A3=E6=84=9F=E8=A6=8F=E5=89=87?= =?UTF-8?q?=E6=94=B9=E5=AF=AB=E8=AA=9E=E6=84=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- AGENTS.md | 2 +- README.md | 2 +- skills/worklog/SKILL.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 3fe7385..f763764 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,6 @@ # jsc-log — 給 AI 助理的指引 -本 repo 是 jsc 技能組的 `log` domain(工作日誌(LOG_* wiki 頁)與技能使用統計),可同時被 Claude Code / Codex / Copilot / Antigravity / Kiro 使用。 +本 repo 是 jsc 技能組的 `log` domain(工作日誌與技能使用統計,寫入 LOG_* wiki 頁),Claude Code / Codex / Copilot / Antigravity / Kiro 都能安裝使用。 ## 規則 diff --git a/README.md b/README.md index f78d6eb..b3847fb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # jsc-log — 工作日誌與統計 -jsc 技能組的 log domain:工作完成後把十項資訊寫入 wiki 日誌頁(`LOG_{yyyyMM}_W{週數}`,週數基於週五日期計算),並統計技能使用次數與呼叫鏈次數。 +jsc 技能組的 log domain:工作完成後把十項資訊寫入 wiki 日誌頁(`LOG_{yyyyMM}_W{週數}`,週數依週五日期計算),並統計技能使用次數與呼叫鏈次數。 ## 安裝 / 更新 / 移除 diff --git a/skills/worklog/SKILL.md b/skills/worklog/SKILL.md index ffbd01c..619bc70 100644 --- a/skills/worklog/SKILL.md +++ b/skills/worklog/SKILL.md @@ -19,7 +19,7 @@ description: After finishing a work package, collect ten facts (repo, branch, pl | 6 | token 用量 | 見下表,各 CLI 取法不同;不可得填 `N/A` | | 7 | 任務狀態 | 完成 / 部分完成 / 阻塞(附原因) | | 8 | 執行細節與產出 | 摘要改了什麼、產出哪些檔案或頁面 | -| 9 | 遇到的困難 + 解決方式 | 一行一組 | +| 9 | 遇到的困難與解決方式 | 一行一組 | | 10 | PR 的目標分支 | 連結到 PR 頁 | ### token 用量取得方式 -- 2.53.0 From aca938fb0504bdcb203c8563d25a3907f5a2eb7e Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 21 Aug 2026 14:28:18 +0800 Subject: [PATCH 08/10] docs(log): translate SKILL.md into English per guidelines Co-Authored-By: Claude Fable 5 --- skills/stats/SKILL.md | 20 ++++++++-------- skills/worklog/SKILL.md | 52 ++++++++++++++++++++--------------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/skills/stats/SKILL.md b/skills/stats/SKILL.md index 1f54f83..2cec2f0 100644 --- a/skills/stats/SKILL.md +++ b/skills/stats/SKILL.md @@ -3,19 +3,19 @@ name: stats description: Report usage counts of every jsc skill and every skill call chain, aggregated by tools/usage-stats.sh from $JSC_HOME/usage/*.jsonl recorded by jsc-hooks. Supports --cli filtering. Use when the user asks how often skills or chains are used; not for token or time stats (see worklog). --- -# stats — 技能與呼叫鏈使用統計 +# stats — skill and call-chain usage counts -資料由 `jsc-hooks/hooks/skill-usage.sh` 持續記錄在 `$JSC_HOME/usage/`(預設 `~/.jsc/usage/`)。 +Data is recorded continuously by `jsc-hooks/hooks/skill-usage.sh` under `$JSC_HOME/usage/` (default `~/.jsc/usage/`). -## 操作 +## Operations -| 統計 | 指令 | 輸出 | +| Count | Command | Output | | --- | --- | --- | -| 各技能使用次數 | `tools/usage-stats.sh skills` | `次數技能名`,降冪 | -| 各呼叫鏈使用次數 | `tools/usage-stats.sh chains` | `次數from -> to`,降冪 | -| 依 CLI 過濾 | 加 `--cli claude`(或 codex / copilot / antigravity / kiro) | 同上 | +| Uses per skill | `tools/usage-stats.sh skills` | `countskill`, descending | +| Uses per call chain | `tools/usage-stats.sh chains` | `countfrom -> to`, descending | +| Filter by CLI | Append `--cli claude` (or codex / copilot / antigravity / kiro) | Same as above | -## 呈現 +## Reporting -1. 直接執行工具,把輸出整理成表格回覆。 -2. 沒有資料時說明:需先安裝 `jsc-hooks` 並執行 `jsc-hooks:hooks-install` 接線。 +1. Run the tool directly and present the output as a table. +2. When there is no data, explain that `jsc-hooks` must be installed and wired first via `jsc-hooks:hooks-install`. diff --git a/skills/worklog/SKILL.md b/skills/worklog/SKILL.md index 619bc70..2c9c041 100644 --- a/skills/worklog/SKILL.md +++ b/skills/worklog/SKILL.md @@ -3,43 +3,43 @@ name: worklog description: 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_{yyyyMM}_W{week} plus LOG_CONTENTS. Week number is derived from the Friday of the work week. Trigger at the end of implement or maintain; not for planning notes. --- -# worklog — 工作日誌 +# worklog — work log -工作完成後蒐集以下十項資訊,套用 `templates/log-entry.md` 附加到 wiki 日誌頁。蒐集與寫入**必須以 sub agent 執行**。 +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 | 存取庫名稱 | `git remote get-url origin` 解析出 `{owner}/{repo}` | -| 2 | 分支名稱 | `git branch --show-current` | -| 3 | 計畫名稱 | 連結到計畫頁 `[[PLAN_{...}]]` | -| 4 | 工作包編號 | 連結到分析頁的工作包標題 `[[ANALYZE_{...}#WP-xx]]` | -| 5 | 花費時間 | `jsc-hooks/hooks/session-timer.sh report {session_id}`(秒,換算 h/m) | -| 6 | token 用量 | 見下表,各 CLI 取法不同;不可得填 `N/A` | -| 7 | 任務狀態 | 完成 / 部分完成 / 阻塞(附原因) | -| 8 | 執行細節與產出 | 摘要改了什麼、產出哪些檔案或頁面 | -| 9 | 遇到的困難與解決方式 | 一行一組 | -| 10 | PR 的目標分支 | 連結到 PR 頁 | +| 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_{...}]]` | +| 4 | Work package id | Link to the work package heading on the analyze page `[[ANALYZE_{...}#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 | -### token 用量取得方式 +### How to get token usage -| CLI | 取法 | +| CLI | Method | | --- | --- | -| claude | transcript JSONL(`~/.claude/projects/**/*.jsonl`)的 `usage` 欄位加總,或 `claude -p --output-format json` 的 `usage` | -| codex | `~/.codex/sessions/**` 的 token 計數,或工作階段內 `/status` | -| copilot | 工作階段內 `/usage` | -| antigravity | 介面顯示值;無法讀取時 `N/A` | -| kiro | 無公開來源,填 `N/A` | +| 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 week number -- 頁名:`LOG_{yyyyMM}_W{週數}`,兩者都取自**本工作週的週五**: +- Page name: `LOG_{yyyyMM}_W{週數}`. Both values come from the Friday of the current work week: ```sh dow=$(date +%u) if [ "$dow" -ge 6 ]; then f=$(date -d 'last friday' +%Y%m%d); else f=$(date -d 'friday' +%Y%m%d); fi yyyyMM=$(printf '%s' "$f" | cut -c1-6) - W=$(( ( $(printf '%s' "$f" | cut -c7-8 | sed 's/^0//') - 1 ) / 7 + 1 )) # 該週五是當月第幾個週五 + W=$(( ( $(printf '%s' "$f" | cut -c7-8 | sed 's/^0//') - 1 ) / 7 + 1 )) # which Friday of the month ``` -- 經由 `jsc-gitea:wiki` 讀取該頁;不存在就以 `templates/log-contents.md` 說明的結構新建,存在就把新條目**附加**在文末。 -- 同步更新 `LOG_CONTENTS`(套用 `templates/log-contents.md`,該週的列不存在就新增)。 +- 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 week's row if missing). -- 2.53.0 From 65f6bd3e0779bc4feac56636507af1744405497f Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 21 Aug 2026 14:28:18 +0800 Subject: [PATCH 09/10] =?UTF-8?q?style(log):=20=E4=B8=AD=E6=96=87=E4=B8=A6?= =?UTF-8?q?=E5=88=97=E6=94=B9=E9=A0=93=E8=99=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- README.md | 2 +- templates/log-entry.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b3847fb..a67fb6f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ jsc 技能組的 log domain:工作完成後把十項資訊寫入 wiki 日誌頁(`LOG_{yyyyMM}_W{週數}`,週數依週五日期計算),並統計技能使用次數與呼叫鏈次數。 -## 安裝 / 更新 / 移除 +## 安裝、更新、移除 Marketplace 統一為 `jsc`(https://gitea.jsc.idv.tw/plugins/jsc.git),安裝 token 為 `jsc-log@jsc`。每個指令一行: diff --git a/templates/log-entry.md b/templates/log-entry.md index 5cb6207..f9aaaeb 100644 --- a/templates/log-entry.md +++ b/templates/log-entry.md @@ -15,7 +15,7 @@ | 工作包編號 | [[ANALYZE_{yyyyMMdd}_{HHmmss}_{HASH}#wp-{編號}|WP-{編號} {工作包標題}]] | | 花費時間 | {h} 小時 {m} 分(session-timer report) | | token 用量 | {CLI}: {input}/{output}(不可得填 N/A) | -| 任務狀態 | 完成 / 部分完成 / 阻塞({原因}) | +| 任務狀態 | 完成、部分完成、阻塞({原因})三選一 | | PR 目標分支 | [{base 分支}]({PR URL}) | ### 執行細節與產出 -- 2.53.0 From e70ee90efe2fb82dc258596fea4f088dc85f6994 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 21 Aug 2026 14:37:48 +0800 Subject: [PATCH 10/10] =?UTF-8?q?chore(log):=20=E5=8A=A0=E5=85=A5=E7=B5=B1?= =?UTF-8?q?=E4=B8=80=20jsc=20marketplace=20=E5=89=AF=E6=9C=AC=EF=BC=88?= =?UTF-8?q?=E8=88=87=E6=AD=A3=E6=9C=AC=E4=B8=80=E8=87=B4=EF=BC=8C=E4=BB=BB?= =?UTF-8?q?=E4=B8=80=20repo=20=E5=8F=AF=E4=BD=9C=E8=A8=BB=E5=86=8A?= =?UTF-8?q?=E5=85=A5=E5=8F=A3=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .agents/plugins/marketplace.json | 75 +++++++++++++++++++++++++++ .claude-plugin/marketplace.json | 89 ++++++++++++++++++++++++++++++++ 2 files changed, 164 insertions(+) create mode 100644 .agents/plugins/marketplace.json create mode 100644 .claude-plugin/marketplace.json diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json new file mode 100644 index 0000000..12df680 --- /dev/null +++ b/.agents/plugins/marketplace.json @@ -0,0 +1,75 @@ +{ + "name": "jsc", + "plugins": [ + { + "name": "jsc-ask", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/ask.git" + } + }, + { + "name": "jsc-cli", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/cli.git" + } + }, + { + "name": "jsc-git", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/git.git" + } + }, + { + "name": "jsc-gitea", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/gitea.git" + } + }, + { + "name": "jsc-hooks", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/hooks.git" + } + }, + { + "name": "jsc-log", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/log.git" + } + }, + { + "name": "jsc-meta", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/meta.git" + } + }, + { + "name": "jsc-pkg", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/pkg.git" + } + }, + { + "name": "jsc-review", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/review.git" + } + }, + { + "name": "jsc-sdlc", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/sdlc.git" + } + } + ] +} diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json new file mode 100644 index 0000000..28bb223 --- /dev/null +++ b/.claude-plugin/marketplace.json @@ -0,0 +1,89 @@ +{ + "name": "jsc", + "description": "jsc 跨 AI 助理技能組的統一 marketplace(claude / codex / copilot / antigravity / kiro)。", + "owner": { + "name": "JSC" + }, + "plugins": [ + { + "name": "jsc-ask", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/ask.git" + }, + "description": "決策樹問詢與問詢紀錄(QUESTION_* wiki 頁)" + }, + { + "name": "jsc-cli", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/cli.git" + }, + "description": "CLI 偵測、模型能力標籤與技能庫批次部署" + }, + { + "name": "jsc-git", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/git.git" + }, + "description": "Commit 分組認可與 Push Request 建立" + }, + { + "name": "jsc-gitea", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/gitea.git" + }, + "description": "Gitea API 工具、Wiki 讀寫與存取庫批次同步" + }, + { + "name": "jsc-hooks", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/hooks.git" + }, + "description": "跨 CLI hooks:STE100 語言強制、工時計時、技能用量記錄" + }, + { + "name": "jsc-log", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/log.git" + }, + "description": "工作日誌(LOG_* wiki 頁)與技能使用統計" + }, + { + "name": "jsc-meta", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/meta.git" + }, + "description": "技能組自我管理:新建/更新/刪除技能與技能準則" + }, + { + "name": "jsc-pkg", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/pkg.git" + }, + "description": "套件批次更新(nodejs/python/dotnet),失敗還原" + }, + { + "name": "jsc-review", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/review.git" + }, + "description": "程式碼審查:Refactoring 壞味道六組 + 註解規範 + 淺模組" + }, + { + "name": "jsc-sdlc", + "source": { + "source": "url", + "url": "https://gitea.jsc.idv.tw/plugins/sdlc.git" + }, + "description": "開發生命週期:規劃/分析/實作/維護(wiki 追蹤)" + } + ] +} -- 2.53.0