什麼: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 兩技能共用的根因修正)。
3.5 KiB
3.5 KiB
name, description
| name | description |
|---|---|
| wiki | 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. Used by jsc-ask, jsc-sdlc, and jsc-log for wiki pages, including ERROR pages, not for repo code files. |
wiki — read and write Gitea wiki pages
Every wiki operation in the jsc skill set goes through this skill. One entry point, one permission path.
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, LEARN, ERROR.
- 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, andGITEA_TOKEN(also checktea login listfor a usable login token whenGITEA_TOKENis unset). Use inherited shell values first; only ask when the needed repo or connection value cannot be resolved after that check.GITEA_HOSTandGITEA_TOKENare both covered by this ask-if-unresolvable rule, the same as the wiki-repo variables below. - Run
tools/gitea.sh wiki-repo {TYPE}(TYPE = the page-name prefix). Allowed types areQUESTION,PLAN,ANALYZE,MAINTAIN,REPO,LOG,LEARN, andERROR. Resolution order isJSC_WIKI_REPO_{TYPE}first, thenJSC_WIKI_REPO. Never borrow another type's repo. - On exit 3 (neither is set after env inspection), ask the user for that page type's
{owner}/{repo}per thejsc-ask:askrules, and suggest settingJSC_WIKI_REPO_{TYPE}(can differ per type) orJSC_WIKI_REPO(shared default).
Operations
| Action | Command |
|---|---|
| list pages | tools/gitea.sh wiki-list {owner}/{repo} |
| read page | tools/gitea.sh wiki-get {owner}/{repo} {page} (exit 4 when missing) |
| write page | write the content to a temp file first, then tools/gitea.sh wiki-put {owner}/{repo} {page} {file} (creates or updates automatically) |
Rules
- Page names must follow the wiki naming table in the skill guidelines (see
jsc-meta/references/guidelines.md). - Use
tools/hash-idfor{HASH}values. It returns the first 8 uppercase SHA-1 hex chars, orHplus the first 7 chars when the raw hash starts with0-9,A,B, orC. - To update a contents page (
*_CONTENTS):wiki-getit first, apply the template to append or modify, thenwiki-putthe whole page back. Never overwrite entries owned by others. - Write all wiki content in UTF-8 Traditional Chinese, per the STE100 output rule.
- 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.
- 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, resolveGITEA_HOSTandGITEA_TOKENper rule 1: ifGITEA_HOSTis unresolvable, orGITEA_TOKENis unset and no tea login token exists either, ask the user for the missing value per thejsc-ask:askrules — same decision-tree pattern as the missing-wiki-repo case above — before callingtools/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).