Files
gitea/README.md
T
jiantw83andClaude Fable 5 1f17f1779a feat(wiki): wiki 技能新增圖表優先內容規則並更新 README 說明
What(改了什麼)
- skills/wiki/SKILL.md 新增兩條規則:頁面內容以圖表優先(mermaid 流程圖、時序圖、甘特圖、圓餅圖與 markdown 表格),純文字為最後手段且保持精簡;tools/gitea.sh 已內建認證退回機制,兩條路徑都失敗才回報認證錯誤。
- SKILL.md frontmatter description 補上 chart-first 說明,讓技能挑選時就能看到此規則。
- README.md:「Skills 目錄」的 wiki 條目補上圖表優先說明;環境變數表的 GITEA_TOKEN 一列補上 401/403 自動退回 tea CLI token 的行為。

Why(為什麼改)
- 使用者規則:wiki 輸出盡量用 mermaid 與表格呈現,不要只有純文字。
- 認證退回已在 tools/gitea.sh 實作,技能文件與 README 需同步,避免技能誤判認證失敗或文件與行為不一致。

How(怎麼改)
- 在 SKILL.md 規則清單追加第 4、5 條,並同步改寫 frontmatter description。
- README 對應兩處文字更新,與 gitea.sh 的實際行為一致。

Who(影響哪個功能/使用者)
- 使用 jsc-gitea:wiki 的所有呼叫方(jsc-ask、jsc-sdlc、jsc-log):之後寫出的 wiki 頁會以圖表為主;閱讀 README 的使用者能得知 token 退回行為。

備註:README.md 的 GITEA_TOKEN 環境變數表一列在語意上屬於前一個 commit(tea token 退回),但為避免以 hunk 拆分 README,整檔併入本 commit。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 08:23:27 +00:00

65 lines
3.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# jsc-gitea — Gitea 操作
jsc 技能組的 gitea domain:Gitea API 的統一入口。所有 jsc 技能需要操作 gitea(wiki、repo、PR)時,一律經由本 domain 的工具或技能,不可自行拼 API 呼叫。
## 安裝、更新、移除
Marketplace 統一為 `jsc`(https://gitea.jsc.idv.tw/plugins/jsc.git),安裝 token 為 `jsc-gitea@jsc`。每個指令一行:
| CLI | 安裝 | 更新 | 移除 |
| --- | --- | --- | --- |
| claude | `claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/jsc.git && claude plugin install jsc-gitea@jsc` | `claude plugin marketplace update jsc && claude plugin update jsc-gitea@jsc` | `claude plugin uninstall jsc-gitea@jsc` |
| codex | `codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/jsc.git && codex plugin add jsc-gitea@jsc` | `codex plugin marketplace upgrade jsc` | `codex plugin remove jsc-gitea@jsc` |
| copilot | `copilot plugin marketplace add https://gitea.jsc.idv.tw/plugins/jsc.git && copilot plugin install jsc-gitea@jsc` | `copilot plugin marketplace update jsc && copilot plugin update jsc-gitea@jsc` | `copilot plugin uninstall jsc-gitea@jsc` |
| antigravity | `git clone https://gitea.jsc.idv.tw/plugins/gitea.git ~/plugins/gitea && agy plugin install ~/plugins/gitea` | `git -C ~/plugins/gitea pull && agy plugin uninstall jsc-gitea && agy plugin install ~/plugins/gitea` | `agy plugin uninstall jsc-gitea` |
| kiro | `kiro-cli plugin marketplace add https://gitea.jsc.idv.tw/plugins/jsc.git && kiro-cli plugin install jsc-gitea@jsc` | `kiro-cli plugin marketplace update jsc && kiro-cli plugin update jsc-gitea@jsc` | `kiro-cli plugin uninstall jsc-gitea@jsc` |
> antigravity 不支援 gitea URL 安裝,改用本地 clone 路徑。批次操作五個 CLI:使用 `/jsc-cli:deploy`。
## 工具
`tools/gitea.sh`(POSIX shell + curl):
```
gitea.sh owners # 列出可讀取的 owner
gitea.sh repos <owner> # 列出 owner 的 repo 全名
gitea.sh default-branch <owner>/<repo>
gitea.sh clone-url <owner>/<repo>
gitea.sh wiki-repo <TYPE> # 解析頁面類型的 wiki 位置(見環境變數)
gitea.sh wiki-list <owner>/<repo>
gitea.sh wiki-get <owner>/<repo> <page> # 不存在 exit 4
gitea.sh wiki-put <owner>/<repo> <page> <file> # 自動判斷新建或更新
gitea.sh pr-create <owner>/<repo> <head> <base> <title> <body-file>
gitea.sh api <METHOD> <path> [json-file]
```
## Skills 目錄
呼叫方式:Claude / Antigravity `/jsc-gitea:{name}`;Codex `${name}`;Copilot / Kiro 描述需求自動觸發。
<!-- JSC-SKILLS:START -->
### `wiki`
Gitea wiki 頁讀寫的統一入口:依頁面類型(QUESTION / PLAN / ANALYZE / MAINTAIN / REPO / LOG)解析 wiki 所在的 `{owner}/{repo}`,未設定環境變數時以決策樹詢問。頁面內容以圖表優先(mermaid 圖、markdown 表格),純文字為最後手段。
### `repo-sync`
存取庫批次同步:列出 owner → 使用者選擇 → 逐 repo(sub agent)clone 或切 develop/master 更新;有變更就開分支 commit、push、PR。
<!-- JSC-SKILLS:END -->
## 環境變數
| 變數 | 用途 | 未設定時 |
| --- | --- | --- |
| `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 | 退回 `JSC_WIKI_REPO` |
| `JSC_WIKI_REPO` | 共用預設的 wiki `{owner}/{repo}` | 詢問使用者 |
## 相關 domain
- [`jsc-ask`](https://gitea.jsc.idv.tw/plugins/ask):wiki 位置未設定時的決策樹詢問
- [`jsc-git`](https://gitea.jsc.idv.tw/plugins/git):repo-sync 的 commit 與 PR