What:README.md 補上 learn 技能介紹、範本表新增 learn-page.md 與 learn-contents.md 兩列、環境變數一節加入 JSC_WIKI_REPO_LEARN 解析順序;AGENTS.md 的 domain 描述同步加入教訓紀錄與 LEARN_{HASH}。
Why:新技能加入後,安裝者與 AI 助理讀到的文件必須與實際技能清單一致,否則無從得知教訓紀錄功能的存在與 wiki 位置解析規則。
How:沿用既有文件結構,於技能清單、範本表、環境變數與 domain 簡介處逐段補述,並註明先讀 shell 繼承的環境變數、缺值才詢問。
Who:jsc-log domain 的說明文件(learn 教訓紀錄功能)。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
63 lines
3.8 KiB
Markdown
63 lines
3.8 KiB
Markdown
# jsc-log — 工作日誌與統計
|
||
|
||
jsc 技能組的 log domain:工作完成後把十項資訊寫入 wiki 日誌頁(`LOG_{HASH}`,`HASH` 依共享規則計算;首碼若是數字或 `A`/`B`/`C`,改成 `H` 加上原前 7 碼;頁內仍按工作週週五整理),統計技能使用次數與呼叫鏈次數,並把技能執行的教訓記到 `LEARN_{HASH}`,供下次執行前查閱。
|
||
|
||
## 安裝、更新、移除
|
||
|
||
Marketplace 統一為 `jsc`(https://gitea.jsc.idv.tw/plugins/jsc.git),安裝 token 為 `jsc-log@jsc`。每個指令一行:
|
||
|
||
| 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`。
|
||
|
||
## 工具
|
||
|
||
| 工具 | 用途 |
|
||
| --- | --- |
|
||
| `tools/usage-stats.sh` | 聚合 `$JSC_HOME/usage/*.jsonl`:`skills` 列技能使用次數、`chains` 列呼叫鏈次數(皆降冪),`--cli <name>` 過濾 |
|
||
| `tools/worklog-target.sh` | 依 `{owner}/{repo}` 產生 `LOG_{HASH}`、`LOG_CONTENTS` 與符合共享規則的 `HASH` |
|
||
|
||
## Skills 目錄
|
||
|
||
呼叫方式:Claude / Antigravity `/jsc-log:{name}`;Codex `${name}`;Copilot / Kiro 描述需求自動觸發。
|
||
|
||
<!-- JSC-SKILLS:START -->
|
||
|
||
### `worklog`
|
||
|
||
工作完成後蒐集十項資訊(存取庫、分支、計畫連結、工作包連結、花費時間、token 用量、任務狀態、執行細節、困難與解決、PR 目標分支),用 `tools/worklog-target.sh` 產生目標頁,再套範本附加到 `LOG_{HASH}` 與 `LOG_CONTENTS`。
|
||
|
||
### `stats`
|
||
|
||
統計本技能組各技能的使用次數與呼叫鏈使用次數,資料來源為 jsc-hooks 記錄的 `skills.jsonl` 與 `chains.jsonl`。
|
||
|
||
### `learn`
|
||
|
||
技能執行後把教訓(日期、技能、CLI、情境、教訓、下次做法)附加到 `LEARN_{HASH}` 並更新 `LEARN_CONTENTS`;技能執行前查閱同兩頁,套用相符的「下次做法」。
|
||
|
||
<!-- JSC-SKILLS:END -->
|
||
|
||
## 範本
|
||
|
||
| 檔案 | 用途 |
|
||
| --- | --- |
|
||
| `templates/log-entry.md` | 單筆工作日誌(十欄位) |
|
||
| `templates/log-contents.md` | 日誌目錄 `LOG_CONTENTS` |
|
||
| `templates/learn-page.md` | 教訓紀錄頁 `LEARN_{HASH}`(六欄表格,逐列附加) |
|
||
| `templates/learn-contents.md` | 教訓目錄 `LEARN_CONTENTS` |
|
||
|
||
## 環境變數
|
||
|
||
Wiki 位置:日誌頁用 `JSC_WIKI_REPO_LOG`、教訓頁用 `JSC_WIKI_REPO_LEARN`,未設定退回 `JSC_WIKI_REPO`,再未設定就詢問(見 `jsc-gitea`)。先讀目前 shell 繼承的環境變數,缺值才詢問。
|
||
|
||
## 相關 domain
|
||
|
||
- [`jsc-hooks`](https://gitea.jsc.idv.tw/plugins/hooks):花費時間(`session-timer.sh report`)與用量資料來源
|
||
- [`jsc-gitea`](https://gitea.jsc.idv.tw/plugins/gitea):wiki 讀寫
|