What:新增 skills/learn/SKILL.md(record/consult 兩種模式)與 templates/learn-page.md、templates/learn-contents.md 兩份 wiki 頁範本。
Why:參考 oh-my-pi 的 learn 工具,讓技能執行後能把教訓沉澱下來、執行前能先查閱套用,避免同樣的問題重複發生。
How:教訓以六欄表格(日期、技能、CLI、情境、教訓、下次做法)逐列附加到 LEARN_{HASH},並同步更新 LEARN_CONTENTS 目錄;HASH 依共用 8 碼 wiki hash 規則(含 H 前綴退回),wiki 位置依 JSC_WIKI_REPO_LEARN → JSC_WIKI_REPO 解析,讀寫皆透過 jsc-gitea:wiki。
Who:jsc-log domain 的 learn 技能(教訓紀錄與查閱功能)。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3.2 KiB
3.2 KiB
name, description
| name | description |
|---|---|
| learn | Record a lesson learned after a skill run to wiki LEARN_{HASH} plus LEARN_CONTENTS, or consult past lessons before a skill run. Each entry is one table row with date, skill, CLI, situation, lesson, and next-time approach. HASH follows the shared 8-char rule with the H-prefix fallback. Use when a skill run produced a reusable lesson, or before running a skill to consult past lessons; not for work-time logs (see worklog). |
learn — lessons learned
Close the loop on skill runs: record what a run taught you, consult it before the next run. Two modes — record and consult. Page content is chart-first Traditional Chinese (STE100): markdown table entries, prose as the last resort.
Target pages
- Directory page:
LEARN_CONTENTS. Content page:LEARN_{HASH}, one page per repository. - Compute
{HASH}from{owner}/{repo}withjsc-gitea/tools/hash-id(shared wiki hash rule: first 8 uppercase SHA-1 hex chars;Hplus the first 7 chars when the raw hash starts with0-9,A,B, orC). - Wiki repo resolution:
JSC_WIKI_REPO_LEARNfirst, thenJSC_WIKI_REPO. Inspect the inherited shell environment variables first; ask the user per thejsc-ask:askrules only when neither resolves. Never borrow another type'sJSC_WIKI_REPO_{TYPE}. - All wiki reads and writes go through
jsc-gitea:wiki.
Mode: record
Run after a skill run that produced a reusable lesson.
-
Collect the six facts below. Done when every field has a value.
# Field (page column) Source 1 日期 Today, yyyy-MM-dd2 技能 The skill that ran, as jsc-{domain}:{name}3 CLI One of claude / codex / copilot / antigravity / kiro 4 情境 What was happening when the lesson appeared, one sentence 5 教訓 What the run taught, one sentence 6 下次做法 How to apply it on the next run, one sentence -
Resolve
{owner}/{repo}fromgit remote get-url originand compute{HASH}withjsc-gitea/tools/hash-id. Done when the page nameLEARN_{HASH}is known. -
Write the entry. This step MUST run as a sub agent; the main agent only confirms the write succeeded.
- Read
LEARN_{HASH}viajsc-gitea:wiki. If it does not exist, create it fromtemplates/learn-page.md; otherwise APPEND the new row at the end of the table. Never overwrite existing rows. - Update
LEARN_CONTENTSin the same pass (applytemplates/learn-contents.md; add the repo row if missing, otherwise refresh its 最後更新時間). - Done when the sub agent reports both pages written and the main agent has confirmed the row exists on
LEARN_{HASH}.
- Read
Mode: consult
Run before a skill run, to apply past lessons.
- Resolve
{owner}/{repo}and compute{HASH}as in record mode. Done whenLEARN_{HASH}is known. - Read
LEARN_CONTENTSand the repo'sLEARN_{HASH}viajsc-gitea:wiki. When either page is missing (exit 4), report 「無教訓紀錄」 and let the caller proceed. Done when both pages are read or reported missing. - Surface every row whose 技能 matches the skill about to run, and summarize each matched 下次做法 for the caller to apply. Done when the matched rows (or 「無相符教訓」) are reported.