From d922820451e486b2b9e50df13f128e85ecac7e37 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 21 Aug 2026 16:53:17 +0000 Subject: [PATCH] =?UTF-8?q?fix(wiki):=20=E7=B5=B1=E4=B8=80=20QUESTION=20wi?= =?UTF-8?q?ki=20=E5=91=BD=E5=90=8D=E8=88=87=20hash=20=E8=A6=8F=E5=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude-plugin/plugin.json | 2 +- .codex-plugin/plugin.json | 2 +- README.md | 2 +- plugin.json | 2 +- skills/ask/SKILL.md | 4 ++-- templates/question-contents.md | 2 +- templates/question-record.md | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 167fb02..7fc0990 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-ask", - "version": "0.0.1", + "version": "0.0.2", "description": "決策樹問詢與問詢紀錄(QUESTION_* wiki 頁)", "skills": "./skills", "author": { diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index efd8c72..5b21104 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-ask", - "version": "0.0.1", + "version": "0.0.2", "description": "決策樹問詢與問詢紀錄(QUESTION_* wiki 頁)", "skills": "./skills" } diff --git a/README.md b/README.md index 332c101..4a88802 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Marketplace 統一為 `jsc`(https://gitea.jsc.idv.tw/plugins/jsc.git),安 ### `ask` -決策樹問詢:一題一個決策點、選項標明影響範圍、問到沒有疑慮為止。問前查 `QUESTION_CONTENTS` 與 `QUESTION_{HASH}`,已有答案不再問;問後套範本寫回 wiki(沒有存取庫名稱就不紀錄)。 +決策樹問詢:一題一個決策點、選項標明影響範圍、問到沒有疑慮為止。問前查 `QUESTION_CONTENTS` 與 `QUESTION_{HASH}`,其中 `{HASH}` 依共用 wiki hash 規則產生;已有答案不再問。問後套範本寫回 wiki(沒有存取庫名稱就不紀錄)。 diff --git a/plugin.json b/plugin.json index f552e0f..9d1579a 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-ask", - "version": "0.0.1", + "version": "0.0.2", "description": "決策樹問詢與問詢紀錄(QUESTION_* wiki 頁)", "skills": "./skills/" } diff --git a/skills/ask/SKILL.md b/skills/ask/SKILL.md index d9939de..06590e4 100644 --- a/skills/ask/SKILL.md +++ b/skills/ask/SKILL.md @@ -1,6 +1,6 @@ --- name: ask -description: Decision-tree questioning until no doubt remains. Check wiki QUESTION_CONTENTS and QUESTION_{HASH} first and never re-ask answered questions. Every option must state its impact scope. After each answer, save the record back to the wiki. Use whenever a jsc skill needs user input; skip recording when no {owner}/{repo} is known. +description: Decision-tree questioning until no doubt remains. Check wiki QUESTION_CONTENTS and QUESTION_{HASH} first and never re-ask answered questions. Compute HASH with the shared 8-character wiki hash rule. Every option must state its impact scope. After each answer, save the record back to the wiki. Use whenever a jsc skill needs user input; skip recording when no {owner}/{repo} is known. --- # ask — decision-tree questioning @@ -10,7 +10,7 @@ Every jsc skill that needs user input MUST follow the rules in this skill. ## Before asking 1. Confirm the repository name `{owner}/{repo}` of the current work. Without one, skip steps 2 and 3: ask directly but do NOT record. -2. Compute `HASH`: `printf '%s' "{owner}/{repo}" | sha1sum | cut -c1-8 | tr a-f A-F`. +2. Compute `HASH` with the shared wiki hash rule: 8 characters, uppercase hex, and if the first character would be `0-9`, `A`, `B`, or `C`, replace it with `H` and keep the total length at 8. 3. Read `QUESTION_CONTENTS` and `QUESTION_{HASH}` via `jsc-gitea:wiki`. Never re-ask a question already answered in the record; use the recorded answer directly. ## Questioning rules diff --git a/templates/question-contents.md b/templates/question-contents.md index 4305303..b77c002 100644 --- a/templates/question-contents.md +++ b/templates/question-contents.md @@ -1,6 +1,6 @@ # 問詢目錄 -> 由 `jsc-ask:ask` 維護。每個存取庫一列;`QUESTION_{HASH}` 的 `{HASH}` 為 `{owner}/{repo}` 的 SHA-1 前 8 碼(大寫)。 +> 由 `jsc-ask:ask` 維護。這是問詢目錄頁 `QUESTION_CONTENTS`。每個存取庫一列;`QUESTION_{HASH}` 的 `{HASH}` 依共用 wiki hash 規則產生:先取 `{owner}/{repo}` 的 SHA-1 前 8 碼並轉成大寫;若首碼是 `0-9`、`A`、`B`、`C`,改用 `H` 開頭並維持 8 碼總長。 | 存取庫名稱 | 問詢紀錄 | 最後更新 | | --- | --- | --- | diff --git a/templates/question-record.md b/templates/question-record.md index 496065c..57bc946 100644 --- a/templates/question-record.md +++ b/templates/question-record.md @@ -1,6 +1,6 @@ # 問詢紀錄 — {owner}/{repo} -> 由 `jsc-ask:ask` 維護。新問答**附加**在文末,不覆蓋舊紀錄。相同問題再次出現時,直接採用此處答案,不再詢問。 +> 由 `jsc-ask:ask` 維護。這是問詢紀錄頁 `QUESTION_{HASH}`;`HASH` 依共用 wiki hash 規則產生,格式為 8 碼大寫,首碼不得是 `0-9`、`A`、`B`、`C`。新問答**附加**在文末,不覆蓋舊紀錄。相同問題再次出現時,直接採用此處答案,不再詢問。 ## {yyyy-MM-dd HH:mm} {問詢主題} -- 2.53.0