Files
gitea/README.md
T

60 lines
2.3 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 呼叫。
## 安裝
```bash
claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/gitea.git
claude plugin install jsc-gitea@gitea
```
其他 CLI(codex / copilot / antigravity / kiro)與批次安裝、更新、解除安裝:使用 `/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}`,未設定環境變數時以決策樹詢問。
### `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 | 詢問使用者 |
| `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`:wiki 位置未設定時的決策樹詢問
- `jsc-git`:repo-sync 的 commit 與 PR