From 6ce2822147e429bb3a3ffd637ebda3b3c98aa7db Mon Sep 17 00:00:00 2001 From: Jeffery Date: Wed, 26 Aug 2026 10:45:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(wiki):=20=E6=94=AF=E6=8F=B4=20CHECK=20?= =?UTF-8?q?=E8=88=87=20REPORT=20=E5=85=A9=E7=A8=AE=E9=A0=81=E9=9D=A2?= =?UTF-8?q?=E9=A1=9E=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What: gitea.sh 的 wiki-repo 白名單加入 CHECK 與 REPORT,check-wiki-rules.sh 的驗證涵蓋範圍從九種擴到十一種,wiki 技能的 description 補上兩個新呼叫者。 Why: 執行環境體檢(jsc-cli:doctor)與工作報表(jsc-log:report)都要寫 wiki,但頁面類型不在白名單裡就解析不出存取庫,兩支技能都寫不進去。 How: 只動白名單與驗證清單,解析規則本身不變:一律先讀 JSC_WIKI_REPO_{TYPE},再退回 JSC_WIKI_REPO,不得跨類型代用。 Who: 體檢頁與報表頁的 wiki 位置解析。 --- .claude-plugin/plugin.json | 2 +- .codex-plugin/plugin.json | 2 +- plugin.json | 2 +- skills/wiki/SKILL.md | 2 +- tools/check-wiki-rules.sh | 4 ++-- tools/gitea.sh | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 9dbc225..2421e23 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-gitea", - "version": "0.1.3", + "version": "0.1.4", "description": "Gitea API 工具、Wiki 讀寫、議題轉換、HTML 匯出與存取庫批次同步", "skills": "./skills", "author": { diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index d6a7060..0646968 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-gitea", - "version": "0.1.3", + "version": "0.1.4", "description": "Gitea API 工具、Wiki 讀寫、議題轉換、HTML 匯出與存取庫批次同步", "skills": "./skills" } diff --git a/plugin.json b/plugin.json index 312ee78..db3fb62 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-gitea", - "version": "0.1.3", + "version": "0.1.4", "description": "Gitea API 工具、Wiki 讀寫、議題轉換、HTML 匯出與存取庫批次同步", "skills": "./skills/" } diff --git a/skills/wiki/SKILL.md b/skills/wiki/SKILL.md index 5a54d0b..77af67f 100644 --- a/skills/wiki/SKILL.md +++ b/skills/wiki/SKILL.md @@ -1,6 +1,6 @@ --- name: wiki -description: Read or write a Gitea wiki page through tools/gitea.sh and tools/hash-id. Resolve the wiki repo per page type with JSC_WIKI_REPO_{TYPE} first, then JSC_WIKI_REPO, and ask only when neither is set. Page content is chart-first - prefer mermaid diagrams and markdown tables over plain prose. Callers are jsc-ask, jsc-sdlc, jsc-log, and jsc-hooks for its ERROR pages. Use for any wiki page in the skill set; not for repo code files. +description: Read or write a Gitea wiki page through tools/gitea.sh and tools/hash-id. Resolve the wiki repo per page type with JSC_WIKI_REPO_{TYPE} first, then JSC_WIKI_REPO, and ask only when neither is set. Page content is chart-first - prefer mermaid diagrams and markdown tables over plain prose. Callers are jsc-ask, jsc-sdlc, jsc-log, jsc-hooks for its ERROR pages, and jsc-cli for its CHECK pages. Use for any wiki page in the skill set; not for repo code files. --- # wiki — read and write Gitea wiki pages diff --git a/tools/check-wiki-rules.sh b/tools/check-wiki-rules.sh index 194fefc..44c4374 100755 --- a/tools/check-wiki-rules.sh +++ b/tools/check-wiki-rules.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh # check-wiki-rules — 驗證 wiki repo 解析與 hash-id 規則。 -# 涵蓋全部九種頁面類型,每種三項:專用變數優先、退回共用變數、不得跨類型代用。 +# 涵蓋全部十一種頁面類型,每種三項:專用變數優先、退回共用變數、不得跨類型代用。 # 全部通過印 OK 並 exit 0;任一項不符印出差異並 exit 1。 set -eu @@ -8,7 +8,7 @@ dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) gitea="$dir/gitea.sh" hash_id="$dir/hash-id" -TYPES='QUESTION PLAN ANALYZE DELIVER MAINTAIN REPO LOG LEARN ERROR' +TYPES='QUESTION PLAN ANALYZE DELIVER MAINTAIN REPO LOG LEARN ERROR CHECK REPORT' fail() { printf '%s\n' "$1" >&2 diff --git a/tools/gitea.sh b/tools/gitea.sh index f311640..aaf3fce 100755 --- a/tools/gitea.sh +++ b/tools/gitea.sh @@ -7,7 +7,7 @@ # gitea.sh clone-url / # 印出 clone URL # gitea.sh hash-id # 產生 8 碼大寫 SHA-1 hash;首碼為 0-9/A/B/C 時改成 Hxxxxxxx # gitea.sh wiki-repo # 解析頁面類型的 wiki 位置: -# TYPE = QUESTION|PLAN|ANALYZE|DELIVER|MAINTAIN|REPO|LOG|LEARN|ERROR(即頁名前綴) +# TYPE = QUESTION|PLAN|ANALYZE|DELIVER|MAINTAIN|REPO|LOG|LEARN|ERROR|CHECK|REPORT(即頁名前綴) # 依序取 JSC_WIKI_REPO_{TYPE} > JSC_WIKI_REPO;不得跨類型代用;都未設定 exit 3 # gitea.sh wiki-list / # 列出 wiki 頁名 # gitea.sh wiki-get / # 印出 wiki 頁 markdown;不存在時 exit 4 @@ -31,7 +31,7 @@ script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) resolve_wiki_repo() { # TYPE -> JSC_WIKI_REPO_{TYPE} -> JSC_WIKI_REPO type=$(printf '%s' "${1:?TYPE required}" | tr a-z A-Z) case "$type" in - QUESTION|PLAN|ANALYZE|DELIVER|MAINTAIN|REPO|LOG|LEARN|ERROR) ;; + QUESTION|PLAN|ANALYZE|DELIVER|MAINTAIN|REPO|LOG|LEARN|ERROR|CHECK|REPORT) ;; *) echo "unknown wiki type: $type" >&2; exit 2 ;; esac eval "v=\${JSC_WIKI_REPO_${type}:-}"