feat(wiki): 支援 SKILLSET 頁面類型

What:`tools/gitea.sh` 的 `resolve_wiki_repo()` 允許清單加入 `SKILLSET`,`wiki-repo` 的用法註解同步。`skills/wiki/SKILL.md` 第 2 步的允許頁型補上 `SKILLSET`,同時補上先前漏列的 `CHECK` 與 `REPORT`;`description` 的呼叫端清單補上「`jsc-meta` 的 `SKILLSET` 頁」。

Why:`jsc-meta` 的四支異動技能收尾要把驗證結果寫進 `SKILLSET_{HASH}`,而所有 wiki 讀寫都走這一支技能與這一支腳本。頁型不在允許清單裡,`wiki-repo` 會直接 exit 2,報告一個字也寫不進去。`CHECK` 與 `REPORT` 是另一件事:腳本早就支援,技能的允許清單卻沒補,照技能寫的走會以為那兩種頁型不合法。

How:只加類型名,解析規則不動——`JSC_WIKI_REPO_SKILLSET` 優先,未設定才退回 `JSC_WIKI_REPO`,不做跨類型代用,兩個都沒有仍是 exit 3 交回技能問使用者。雜湊來源是被改動的 domain 存取庫 `{owner}/{repo}`,用的是同一支 `hash-id`,所以這裡不必為它多寫一條特例(`CHECK` 那種主機加帳號的例外才需要)。

Who:`jsc-gitea:wiki` 技能與 `jsc-meta` 四支異動技能的異動報告寫入路徑。
This commit is contained in:
2026-08-27 16:34:17 +08:00
parent 8738f54b9d
commit 920c68087e
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
--- ---
name: wiki 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, 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. 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, jsc-cli for its CHECK pages, and jsc-meta for its SKILLSET pages. Use for any wiki page in the skill set; not for repo code files.
--- ---
# wiki — read and write Gitea wiki pages # wiki — read and write Gitea wiki pages
@@ -12,7 +12,7 @@ Every wiki operation in the jsc skill set goes through this skill. One entry poi
Different page types can live in different `{owner}/{repo}` repos, classified by the page-name prefix. Different page types can live in different `{owner}/{repo}` repos, classified by the page-name prefix.
1. Before asking the user, inspect the current shell environment for the needed repo variables and Gitea connection variables: `JSC_WIKI_REPO_{TYPE}`, `JSC_WIKI_REPO`, `GITEA_HOST`, and `GITEA_TOKEN` (also check `tea login list` for a usable login token when `GITEA_TOKEN` is unset). Use inherited shell values first; only ask when the needed repo or connection value cannot be resolved after that check. Done when every one of those variables is either resolved from the environment or listed as missing. 1. Before asking the user, inspect the current shell environment for the needed repo variables and Gitea connection variables: `JSC_WIKI_REPO_{TYPE}`, `JSC_WIKI_REPO`, `GITEA_HOST`, and `GITEA_TOKEN` (also check `tea login list` for a usable login token when `GITEA_TOKEN` is unset). Use inherited shell values first; only ask when the needed repo or connection value cannot be resolved after that check. Done when every one of those variables is either resolved from the environment or listed as missing.
2. Run `tools/gitea.sh wiki-repo {TYPE}` (TYPE = the page-name prefix). Allowed types are `QUESTION`, `PLAN`, `ANALYZE`, `DELIVER`, `MAINTAIN`, `REPO`, `LOG`, `LEARN`, and `ERROR`. Resolution order is `JSC_WIKI_REPO_{TYPE}` first, then `JSC_WIKI_REPO`. Never borrow another type's repo. Done when the command has printed exactly one `{owner}/{repo}`, or exited 3 and sent this page type to step 3. 2. Run `tools/gitea.sh wiki-repo {TYPE}` (TYPE = the page-name prefix). Allowed types are `QUESTION`, `PLAN`, `ANALYZE`, `DELIVER`, `MAINTAIN`, `REPO`, `LOG`, `LEARN`, `ERROR`, `CHECK`, `REPORT`, and `SKILLSET`. Resolution order is `JSC_WIKI_REPO_{TYPE}` first, then `JSC_WIKI_REPO`. Never borrow another type's repo. Done when the command has printed exactly one `{owner}/{repo}`, or exited 3 and sent this page type to step 3.
3. On exit 3 (neither is set after env inspection), ask the user for that page type's `{owner}/{repo}` per the `jsc-ask:ask` rules, and suggest setting `JSC_WIKI_REPO_{TYPE}` (can differ per type) or `JSC_WIKI_REPO` (shared default). Done when the user has supplied one `{owner}/{repo}` for that page type. 3. On exit 3 (neither is set after env inspection), ask the user for that page type's `{owner}/{repo}` per the `jsc-ask:ask` rules, and suggest setting `JSC_WIKI_REPO_{TYPE}` (can differ per type) or `JSC_WIKI_REPO` (shared default). Done when the user has supplied one `{owner}/{repo}` for that page type.
## Operations ## Operations
+2 -2
View File
@@ -7,7 +7,7 @@
# gitea.sh clone-url <owner>/<repo> # 印出 clone URL # gitea.sh clone-url <owner>/<repo> # 印出 clone URL
# gitea.sh hash-id <text> # 產生 8 碼大寫 SHA-1 hash;首碼為 0-9/A/B/C 時改成 Hxxxxxxx # gitea.sh hash-id <text> # 產生 8 碼大寫 SHA-1 hash;首碼為 0-9/A/B/C 時改成 Hxxxxxxx
# gitea.sh wiki-repo <TYPE> # 解析頁面類型的 wiki 位置: # gitea.sh wiki-repo <TYPE> # 解析頁面類型的 wiki 位置:
# TYPE = QUESTION|PLAN|ANALYZE|DELIVER|MAINTAIN|REPO|LOG|LEARN|ERROR|CHECK|REPORT(即頁名前綴) # TYPE = QUESTION|PLAN|ANALYZE|DELIVER|MAINTAIN|REPO|LOG|LEARN|ERROR|CHECK|REPORT|SKILLSET(即頁名前綴)
# 依序取 JSC_WIKI_REPO_{TYPE} > JSC_WIKI_REPO;不得跨類型代用;都未設定 exit 3 # 依序取 JSC_WIKI_REPO_{TYPE} > JSC_WIKI_REPO;不得跨類型代用;都未設定 exit 3
# gitea.sh wiki-list <owner>/<repo> # 列出 wiki 頁名 # gitea.sh wiki-list <owner>/<repo> # 列出 wiki 頁名
# gitea.sh wiki-get <owner>/<repo> <page> # 印出 wiki 頁 markdown;不存在時 exit 4 # gitea.sh wiki-get <owner>/<repo> <page> # 印出 wiki 頁 markdown;不存在時 exit 4
@@ -33,7 +33,7 @@ script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
resolve_wiki_repo() { # TYPE -> JSC_WIKI_REPO_{TYPE} -> JSC_WIKI_REPO resolve_wiki_repo() { # TYPE -> JSC_WIKI_REPO_{TYPE} -> JSC_WIKI_REPO
type=$(printf '%s' "${1:?TYPE required}" | tr a-z A-Z) type=$(printf '%s' "${1:?TYPE required}" | tr a-z A-Z)
case "$type" in case "$type" in
QUESTION|PLAN|ANALYZE|DELIVER|MAINTAIN|REPO|LOG|LEARN|ERROR|CHECK|REPORT) ;; QUESTION|PLAN|ANALYZE|DELIVER|MAINTAIN|REPO|LOG|LEARN|ERROR|CHECK|REPORT|SKILLSET) ;;
*) echo "unknown wiki type: $type" >&2; exit 2 ;; *) echo "unknown wiki type: $type" >&2; exit 2 ;;
esac esac
eval "v=\${JSC_WIKI_REPO_${type}:-}" eval "v=\${JSC_WIKI_REPO_${type}:-}"