From 653b619ea126ba2b4501458dfe35fea5c74b5ad3 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 11:36:49 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat(wiki):=20wiki=20=E9=A0=81=E5=9E=8B?= =?UTF-8?q?=E5=85=81=E8=A8=B1=E6=B8=85=E5=96=AE=E6=96=B0=E5=A2=9E=20LEARN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What:gitea.sh 的 wiki-repo 允許型別清單、wiki 技能 SKILL.md 的頁型清單,以及 check-wiki-rules.sh 的驗證案例,同步收錄 LEARN 頁型。 Why:jsc-log 新增 LEARN wiki 頁型,若允許清單未收錄,wiki-repo LEARN 會以 unknown type(exit 2)被擋下,學習紀錄頁無法解析存放位置。 How:resolve_wiki_repo 的 case 白名單加入 LEARN,解析順序維持 JSC_WIKI_REPO_LEARN 優先、退回 JSC_WIKI_REPO、不跨型別代用;check-wiki-rules.sh 補上 LEARN 專屬變數優先與退回共用預設兩個案例;SKILL.md 允許頁型清單同步更新。 Who:jsc-gitea wiki 技能與其呼叫方(jsc-log 等)的 wiki 頁型解析功能。 Co-Authored-By: Claude Fable 5 --- skills/wiki/SKILL.md | 4 ++-- tools/check-wiki-rules.sh | 8 ++++++++ tools/gitea.sh | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/skills/wiki/SKILL.md b/skills/wiki/SKILL.md index 4f0b935..bc5792b 100644 --- a/skills/wiki/SKILL.md +++ b/skills/wiki/SKILL.md @@ -9,10 +9,10 @@ Every wiki operation in the jsc skill set goes through this skill. One entry poi ## Resolve the wiki location -Different page types can live in different `{owner}/{repo}` repos, classified by page-name prefix: `QUESTION`, `PLAN`, `ANALYZE`, `MAINTAIN`, `REPO`, `LOG`, `ERROR`. +Different page types can live in different `{owner}/{repo}` repos, classified by page-name prefix: `QUESTION`, `PLAN`, `ANALYZE`, `MAINTAIN`, `REPO`, `LOG`, `LEARN`, `ERROR`. 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`. Use inherited shell values first; only ask when the needed repo cannot be resolved after that check. -2. Run `tools/gitea.sh wiki-repo {TYPE}` (TYPE = the page-name prefix). Allowed types are `QUESTION`, `PLAN`, `ANALYZE`, `MAINTAIN`, `REPO`, `LOG`, and `ERROR`. Resolution order is `JSC_WIKI_REPO_{TYPE}` first, then `JSC_WIKI_REPO`. Never borrow another type's repo. +2. Run `tools/gitea.sh wiki-repo {TYPE}` (TYPE = the page-name prefix). Allowed types are `QUESTION`, `PLAN`, `ANALYZE`, `MAINTAIN`, `REPO`, `LOG`, `LEARN`, and `ERROR`. Resolution order is `JSC_WIKI_REPO_{TYPE}` first, then `JSC_WIKI_REPO`. Never borrow another type's repo. 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). ## Operations diff --git a/tools/check-wiki-rules.sh b/tools/check-wiki-rules.sh index 7f0301e..8b107fe 100755 --- a/tools/check-wiki-rules.sh +++ b/tools/check-wiki-rules.sh @@ -52,6 +52,14 @@ check_repo ANALYZE 'ANALYZE falls back to shared only' 'shared/wiki' \ JSC_WIKI_REPO_REPO='records/REPO' \ JSC_WIKI_REPO='shared/wiki' +check_repo LEARN 'LEARN specific wins' 'lessons/LEARN' \ + JSC_WIKI_REPO_LEARN='lessons/LEARN' \ + JSC_WIKI_REPO='shared/wiki' + +check_repo LEARN 'LEARN falls back to shared only' 'shared/wiki' \ + JSC_WIKI_REPO_LOG='records/LOG' \ + JSC_WIKI_REPO='shared/wiki' + check_repo ERROR 'ERROR uses its own repo' 'errors/wiki' \ JSC_WIKI_REPO_ERROR='errors/wiki' \ JSC_WIKI_REPO='shared/wiki' diff --git a/tools/gitea.sh b/tools/gitea.sh index 66cbaf8..d88206f 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|MAINTAIN|REPO|LOG|ERROR(即頁名前綴) +# TYPE = QUESTION|PLAN|ANALYZE|MAINTAIN|REPO|LOG|LEARN|ERROR(即頁名前綴) # 依序取 JSC_WIKI_REPO_{TYPE} > JSC_WIKI_REPO;不得跨類型代用;都未設定 exit 3 # gitea.sh wiki-list / # 列出 wiki 頁名 # gitea.sh wiki-get / # 印出 wiki 頁 markdown;不存在時 exit 4 @@ -27,7 +27,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|MAINTAIN|REPO|LOG|ERROR) ;; + QUESTION|PLAN|ANALYZE|MAINTAIN|REPO|LOG|LEARN|ERROR) ;; *) echo "unknown wiki type: $type" >&2; exit 2 ;; esac eval "v=\${JSC_WIKI_REPO_${type}:-}" From 2f4b4ce519272747be07cf968daa451cccfa29ab Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 11:37:01 +0800 Subject: [PATCH 2/5] =?UTF-8?q?docs(readme):=20=E6=96=87=E4=BB=B6=E9=A0=81?= =?UTF-8?q?=E5=9E=8B=E6=B8=85=E5=96=AE=E5=90=8C=E6=AD=A5=E6=94=B6=E9=8C=84?= =?UTF-8?q?=20LEARN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What:README.md 的 wiki-repo 指令說明、wiki 技能簡介與 JSC_WIKI_REPO_{TYPE} 環境變數表,頁型清單皆補上 LEARN。 Why:程式端已收錄 LEARN 頁型,文件若不同步,使用者會誤以為 LEARN 不受支援或漏設 JSC_WIKI_REPO_LEARN。 How:三處型別列舉由 QUESTION / PLAN / ANALYZE / MAINTAIN / REPO / LOG / ERROR 更新為含 LEARN 的完整清單,其餘敘述不變。 Who:jsc-gitea 外掛的使用說明文件。 Co-Authored-By: Claude Fable 5 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d4ae00c..257e194 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ gitea.sh repos # 列出 owner 的 repo 全名 gitea.sh default-branch / gitea.sh clone-url / gitea.sh hash-id # 產生 8 碼大寫 SHA-1;首碼 0-9/A/B/C 時改成 Hxxxxxxx -gitea.sh wiki-repo # 解析頁面類型的 wiki 位置(TYPE = QUESTION / PLAN / ANALYZE / MAINTAIN / REPO / LOG / ERROR) +gitea.sh wiki-repo # 解析頁面類型的 wiki 位置(TYPE = QUESTION / PLAN / ANALYZE / MAINTAIN / REPO / LOG / LEARN / ERROR) gitea.sh wiki-list / gitea.sh wiki-get / # 不存在 exit 4 gitea.sh wiki-put / # 自動判斷新建或更新 @@ -44,7 +44,7 @@ check-wiki-rules.sh # 驗證 wiki repo 解析與 ha ### `wiki` -Gitea wiki 頁讀寫的統一入口:依頁面類型(QUESTION / PLAN / ANALYZE / MAINTAIN / REPO / LOG / ERROR)解析 wiki 所在的 `{owner}/{repo}`,先讀對應的 `JSC_WIKI_REPO_{TYPE}`,再退回 `JSC_WIKI_REPO`,不同類型不可互相代用。頁面內容以圖表優先(mermaid 圖、markdown 表格),純文字為最後手段。 +Gitea wiki 頁讀寫的統一入口:依頁面類型(QUESTION / PLAN / ANALYZE / MAINTAIN / REPO / LOG / LEARN / ERROR)解析 wiki 所在的 `{owner}/{repo}`,先讀對應的 `JSC_WIKI_REPO_{TYPE}`,再退回 `JSC_WIKI_REPO`,不同類型不可互相代用。頁面內容以圖表優先(mermaid 圖、markdown 表格),純文字為最後手段。 ### `repo-sync` @@ -58,7 +58,7 @@ Gitea wiki 頁讀寫的統一入口:依頁面類型(QUESTION / PLAN / ANALYZ | --- | --- | --- | | `GITEA_HOST` | Gitea 站台(可省略 scheme,預設 https) | 詢問使用者 | | `GITEA_TOKEN` | Gitea API token;缺少或遇 401/403 時自動退回 tea CLI 登入 token | 詢問使用者 | -| `JSC_WIKI_REPO_{TYPE}` | 各類型 wiki 頁的 `{owner}/{repo}`;TYPE = QUESTION / PLAN / ANALYZE / MAINTAIN / REPO / LOG / ERROR | 退回 `JSC_WIKI_REPO`,不做跨類型代用 | +| `JSC_WIKI_REPO_{TYPE}` | 各類型 wiki 頁的 `{owner}/{repo}`;TYPE = QUESTION / PLAN / ANALYZE / MAINTAIN / REPO / LOG / LEARN / ERROR | 退回 `JSC_WIKI_REPO`,不做跨類型代用 | | `JSC_WIKI_REPO` | 共用預設的 wiki `{owner}/{repo}` | 詢問使用者 | ## Hash 規則 From 55bba1dc2edf37588f7a55b61a58f27fbe2ca181 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 11:37:14 +0800 Subject: [PATCH 3/5] =?UTF-8?q?chore(manifest):=20=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E8=99=9F=E7=94=B1=200.0.3=20=E5=8D=87=E8=87=B3=200.0.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What:plugin.json、.claude-plugin/plugin.json、.codex-plugin/plugin.json 三份 manifest 的 version 由 0.0.3 升為 0.0.4。 Why:本次新增 LEARN wiki 頁型屬功能變更,需要新版本號讓各 AI CLI 的外掛更新機制辨識並拉取新版。 How:三份 manifest 的 version 欄位同步改為 0.0.4,其餘欄位不動。 Who:jsc-gitea 外掛的版本管理與發佈功能。 Co-Authored-By: Claude Fable 5 --- .claude-plugin/plugin.json | 2 +- .codex-plugin/plugin.json | 2 +- plugin.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 10e058d..f69f965 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-gitea", - "version": "0.0.3", + "version": "0.0.4", "description": "Gitea API 工具、Wiki 讀寫與存取庫批次同步", "skills": "./skills", "author": { diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 84aa3b1..1cc5250 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-gitea", - "version": "0.0.3", + "version": "0.0.4", "description": "Gitea API 工具、Wiki 讀寫與存取庫批次同步", "skills": "./skills" } diff --git a/plugin.json b/plugin.json index fc74cf7..5c262dd 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-gitea", - "version": "0.0.3", + "version": "0.0.4", "description": "Gitea API 工具、Wiki 讀寫與存取庫批次同步", "skills": "./skills/" } From 3737e32210a76ffd60d3adc009920bde767f31c9 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 14:47:26 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix(marketplace):=20=E5=90=8C=E6=AD=A5=20ca?= =?UTF-8?q?nonical=20marketplace=20=E7=BC=BA=E6=BC=8F=E6=AC=84=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 什麼:.agents/plugins/marketplace.json 補上頂層 description、owner 欄位,並為每個 plugin 項目補上 description;.claude-plugin/marketplace.json 同步 jsc-meta 項目 description 的標點寫法(頓號取代斜線)。 為什麼:兩份 marketplace.json 與 plugins/jsc 的 canonical marketplace 定義不同步,缺漏欄位會讓依賴 marketplace 清單的下游工具(例如 jsc-cli:deploy 讀取 domain 清單)拿不到完整資訊。 如何:比對 plugins/jsc 的 canonical marketplace.json,將缺漏的 description、owner 欄位補齊到 .agents/plugins/marketplace.json,並將標點寫法同步到 .claude-plugin/marketplace.json。 負責功能:marketplace 定義同步(repo-wide infra fix)。 --- .agents/plugins/marketplace.json | 34 ++++++++++++++++++++++---------- .claude-plugin/marketplace.json | 2 +- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index 12df680..a9b4e66 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -1,75 +1,89 @@ { "name": "jsc", + "description": "jsc 跨 AI 助理技能組的統一 marketplace(claude / codex / copilot / antigravity / kiro)。", + "owner": { + "name": "JSC" + }, "plugins": [ { "name": "jsc-ask", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/ask.git" - } + }, + "description": "決策樹問詢與問詢紀錄(QUESTION_* wiki 頁)" }, { "name": "jsc-cli", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/cli.git" - } + }, + "description": "CLI 偵測、模型能力標籤與技能庫批次部署" }, { "name": "jsc-git", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/git.git" - } + }, + "description": "Commit 分組認可與 Push Request 建立" }, { "name": "jsc-gitea", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/gitea.git" - } + }, + "description": "Gitea API 工具、Wiki 讀寫與存取庫批次同步" }, { "name": "jsc-hooks", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/hooks.git" - } + }, + "description": "跨 CLI hooks:STE100 語言強制、工時計時、技能用量記錄" }, { "name": "jsc-log", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/log.git" - } + }, + "description": "工作日誌(LOG_* wiki 頁)與技能使用統計" }, { "name": "jsc-meta", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/meta.git" - } + }, + "description": "技能組自我管理:新建、更新、刪除技能與技能準則" }, { "name": "jsc-pkg", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/pkg.git" - } + }, + "description": "套件批次更新(nodejs/python/dotnet),失敗還原" }, { "name": "jsc-review", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/review.git" - } + }, + "description": "程式碼審查:Refactoring 壞味道六組 + 註解規範 + 淺模組" }, { "name": "jsc-sdlc", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/sdlc.git" - } + }, + "description": "開發生命週期:規劃/分析/實作/維護(wiki 追蹤)" } ] } diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 28bb223..a9b4e66 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -59,7 +59,7 @@ "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/meta.git" }, - "description": "技能組自我管理:新建/更新/刪除技能與技能準則" + "description": "技能組自我管理:新建、更新、刪除技能與技能準則" }, { "name": "jsc-pkg", From ccf4b2af243a185f0c2c0cb90450a3534c019649 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 14:47:40 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix(wiki,repo-sync):=20Gitea=20=E8=AA=8D?= =?UTF-8?q?=E8=AD=89=E7=BC=BA=E5=80=BC=E6=94=B9=E8=A9=A2=E5=95=8F=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 什麼:wiki 與 repo-sync 兩支技能在 GITEA_HOST/GITEA_TOKEN 無法解析時,原本只回報認證失敗;現在改為先走 jsc-ask:ask 詢問使用者。同步將 jsc-gitea 版本號由 0.0.4 升至 0.0.5。 為什麼:guidelines 的環境變數表規定無法解析的必要環境變數要詢問使用者,不能直接回報失敗;先前兩支技能的行為不符合 jsc-meta:skill-check 的稽核規則。 如何:在 skills/wiki/SKILL.md 與 skills/repo-sync/SKILL.md 呼叫 tools/gitea.sh 前,先檢查 GITEA_HOST/GITEA_TOKEN 是否可解析(含 tea login list 的備援 token),無法解析時依 jsc-ask:ask 的決策樹詢問使用者;同時將 plugin.json、.claude-plugin/plugin.json、.codex-plugin/plugin.json 的版本號由 0.0.4 升至 0.0.5。 負責功能:Gitea 認證缺值改詢問使用者(wiki、repo-sync 兩技能共用的根因修正)。 --- .claude-plugin/plugin.json | 2 +- .codex-plugin/plugin.json | 2 +- plugin.json | 2 +- skills/repo-sync/SKILL.md | 11 ++++++----- skills/wiki/SKILL.md | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index f69f965..2546c3a 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-gitea", - "version": "0.0.4", + "version": "0.0.5", "description": "Gitea API 工具、Wiki 讀寫與存取庫批次同步", "skills": "./skills", "author": { diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 1cc5250..1a45573 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-gitea", - "version": "0.0.4", + "version": "0.0.5", "description": "Gitea API 工具、Wiki 讀寫與存取庫批次同步", "skills": "./skills" } diff --git a/plugin.json b/plugin.json index 5c262dd..e093428 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-gitea", - "version": "0.0.4", + "version": "0.0.5", "description": "Gitea API 工具、Wiki 讀寫與存取庫批次同步", "skills": "./skills/" } diff --git a/skills/repo-sync/SKILL.md b/skills/repo-sync/SKILL.md index 564d9b1..a611bb3 100644 --- a/skills/repo-sync/SKILL.md +++ b/skills/repo-sync/SKILL.md @@ -7,11 +7,12 @@ description: Batch-sync all readable repos of a chosen Gitea owner into the work ## Steps -1. Run `tools/gitea.sh owners` to list every `{owner}` the user can read. -2. Ask the user which `{owner}` to sync, per the `jsc-ask:ask` rules. Every option states the owner's repo count and impact scope. -3. Run `tools/gitea.sh repos {owner}` to list every readable `{repo}` under that owner. -4. Sync each `{repo}` one by one. This step **MUST run as a sub agent** (one sub agent per repo): +1. Before calling `tools/gitea.sh`, resolve `GITEA_HOST` and `GITEA_TOKEN` from the current shell environment (also check `tea login list` for a usable login token when `GITEA_TOKEN` is unset). If `GITEA_HOST` is unresolvable, or `GITEA_TOKEN` is unset and no tea login token exists either, ask the user for the missing value per the `jsc-ask:ask` rules before proceeding to any `tools/gitea.sh` call. +2. Run `tools/gitea.sh owners` to list every `{owner}` the user can read. +3. Ask the user which `{owner}` to sync, per the `jsc-ask:ask` rules. Every option states the owner's repo count and impact scope. +4. Run `tools/gitea.sh repos {owner}` to list every readable `{repo}` under that owner. +5. Sync each `{repo}` one by one. This step **MUST run as a sub agent** (one sub agent per repo): 1. Missing locally → `git clone` into the working directory (clone URL from `tools/gitea.sh clone-url`). 2. Present locally → switch to `develop`, else `master` (or the result of `tools/gitea.sh default-branch`), then `git pull`. 3. Local file changes → create a branch from develop or master, commit via `jsc-git:commit`, push, then open a PR back to develop or master via `jsc-git:pr`. -5. Report the sync result for every repo: cloned, updated, PR created, or the failure reason. +6. Report the sync result for every repo: cloned, updated, PR created, or the failure reason. diff --git a/skills/wiki/SKILL.md b/skills/wiki/SKILL.md index bc5792b..b4ef1ae 100644 --- a/skills/wiki/SKILL.md +++ b/skills/wiki/SKILL.md @@ -11,7 +11,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 page-name prefix: `QUESTION`, `PLAN`, `ANALYZE`, `MAINTAIN`, `REPO`, `LOG`, `LEARN`, `ERROR`. -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`. Use inherited shell values first; only ask when the needed repo cannot be resolved after that check. +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. `GITEA_HOST` and `GITEA_TOKEN` are both covered by this ask-if-unresolvable rule, the same as the wiki-repo variables below. 2. Run `tools/gitea.sh wiki-repo {TYPE}` (TYPE = the page-name prefix). Allowed types are `QUESTION`, `PLAN`, `ANALYZE`, `MAINTAIN`, `REPO`, `LOG`, `LEARN`, and `ERROR`. Resolution order is `JSC_WIKI_REPO_{TYPE}` first, then `JSC_WIKI_REPO`. Never borrow another type's repo. 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). @@ -30,4 +30,4 @@ Different page types can live in different `{owner}/{repo}` repos, classified by 3. To update a contents page (`*_CONTENTS`): `wiki-get` it first, apply the template to append or modify, then `wiki-put` the whole page back. Never overwrite entries owned by others. 4. Write all wiki content in UTF-8 Traditional Chinese, per the STE100 output rule. 5. Prefer visual forms for page content: use mermaid diagrams (flowchart, sequence, gantt, pie) and markdown tables wherever the information allows. Plain running text is the last resort, kept short. -6. Authentication fallback is built into `tools/gitea.sh`: on a missing GITEA_TOKEN or a 401/403 response it retries with the tea CLI login token automatically, so only report an auth failure when both paths fail. +6. Authentication fallback is built into `tools/gitea.sh`: on a missing GITEA_TOKEN or a 401/403 response it retries with the tea CLI login token automatically. But before calling it, resolve `GITEA_HOST` and `GITEA_TOKEN` per rule 1: if `GITEA_HOST` is unresolvable, or `GITEA_TOKEN` is unset and no tea login token exists either, ask the user for the missing value per the `jsc-ask:ask` rules — same decision-tree pattern as the missing-wiki-repo case above — before calling `tools/gitea.sh`. Only report a genuine failure when the user has no answer to give or Gitea itself rejects the request (e.g. a 401/403 even after the tea fallback).