diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 406379c..b54fad6 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -18,7 +18,7 @@ { "name": "jsc-herdr", "source": "./plugins/jsc-herdr", - "description": "控制 Herdr 終端多工器(workspace、tab、pane、指令與其他 agent),並可透過 gitea-issue 技能逐一實作 Gitea 議題" + "description": "控制 Herdr 終端多工器(workspace、tab、pane、指令與其他 agent),並可透過 gitea 技能逐一實作 Gitea 議題" }, { "name": "jsc-claude", diff --git a/README.md b/README.md index 5205a44..7db8203 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ JSC 自用 Claude Code mods 的 marketplace。每個插件皆可單獨安裝、 ### [jsc-herdr](plugins/jsc-herdr) `0.0.3` -控制 Herdr 終端多工器(workspace、tab、pane、指令與其他 agent),並可透過 gitea-issue 技能逐一實作 Gitea 議題。需安裝 Herdr 與 tea。 +控制 Herdr 終端多工器(workspace、tab、pane、指令與其他 agent),並可透過 gitea 技能逐一實作 Gitea 議題。需安裝 Herdr 與 tea。 ### [jsc-claude](plugins/jsc-claude) `0.0.1` diff --git a/plugins/jsc-herdr/.claude-plugin/plugin.json b/plugins/jsc-herdr/.claude-plugin/plugin.json index fc729a3..f966654 100644 --- a/plugins/jsc-herdr/.claude-plugin/plugin.json +++ b/plugins/jsc-herdr/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "jsc-herdr", "version": "0.0.3", - "description": "控制 Herdr 終端多工器(workspace、tab、pane、指令與其他 agent),並可透過 gitea-issue 技能逐一實作 Gitea 議題", + "description": "控制 Herdr 終端多工器(workspace、tab、pane、指令與其他 agent),並可透過 gitea 技能逐一實作 Gitea 議題", "license": "MIT", "skills": "./skills", "author": { diff --git a/plugins/jsc-herdr/README.md b/plugins/jsc-herdr/README.md index 940c9be..0430008 100644 --- a/plugins/jsc-herdr/README.md +++ b/plugins/jsc-herdr/README.md @@ -2,7 +2,7 @@ ## 指令 -### `herdr skill` +### `/jsc-herdr:cmd` 提到 Herdr 時自動使用,操作 pane、tab、workspace 與其他 agent(需 HERDR_ENV=1)。 @@ -10,10 +10,10 @@ 用 Herdr 開一個新 tab 執行 npm test ``` -### `/jsc-herdr:gitea-issue <議題連結>` +### `/jsc-herdr:gitea <議題連結>` 每個議題交給一個 Claude agent,使用獨立 worktree 與 tab,監看至議題關閉後再提供下一批未被阻擋的議題。需 Herdr 與 tea。 ```text -/jsc-herdr:gitea-issue https://gitea.example.com/owner/repo/issues/1 +/jsc-herdr:gitea https://gitea.example.com/owner/repo/issues/1 ``` diff --git a/plugins/jsc-herdr/skills/herdr/SKILL.md b/plugins/jsc-herdr/skills/cmd/SKILL.md similarity index 99% rename from plugins/jsc-herdr/skills/herdr/SKILL.md rename to plugins/jsc-herdr/skills/cmd/SKILL.md index fe2ccb6f..ee6533c 100644 --- a/plugins/jsc-herdr/skills/herdr/SKILL.md +++ b/plugins/jsc-herdr/skills/cmd/SKILL.md @@ -1,5 +1,5 @@ --- -name: herdr +name: cmd description: "Control Herdr, a terminal multiplexer for coding agents. Use only when the user explicitly mentions Herdr or asks to use Herdr to inspect or control panes, tabs, workspaces, commands, or another agent. Do not use merely because a task could benefit from a background terminal, delegation, or parallel work. Requires HERDR_ENV=1." --- diff --git a/plugins/jsc-herdr/skills/gitea-issue/SKILL.md b/plugins/jsc-herdr/skills/gitea/SKILL.md similarity index 97% rename from plugins/jsc-herdr/skills/gitea-issue/SKILL.md rename to plugins/jsc-herdr/skills/gitea/SKILL.md index 361434f..6cbae32 100644 --- a/plugins/jsc-herdr/skills/gitea-issue/SKILL.md +++ b/plugins/jsc-herdr/skills/gitea/SKILL.md @@ -1,9 +1,9 @@ --- -name: gitea-issue -description: "Run Gitea issues through Herdr: one Claude agent per issue in its own worktree and tab, watch the issue to closure, then offer the next unblocked issues. Use only when the user runs /jsc-herdr:gitea-issue or explicitly asks to drive a Gitea issue or repo link with Herdr." +name: gitea +description: "Run Gitea issues through Herdr: one Claude agent per issue in its own worktree and tab, watch the issue to closure, then offer the next unblocked issues. Use only when the user runs /jsc-herdr:gitea or explicitly asks to drive a Gitea issue or repo link with Herdr." --- -# gitea-issue +# gitea 把 Gitea 議題交給 Herdr 裡的 Claude agent 實作。所有確定性的工作都在 `scripts/` 裡,你只在「要做決定」的時刻出手。腳本都要在該 repo 的 clone 裡執行;`S` 代表 `${CLAUDE_SKILL_DIR}/scripts`(本技能所在目錄下的 scripts)。 diff --git a/plugins/jsc-herdr/skills/gitea/scripts/__pycache__/ready.cpython-314.pyc b/plugins/jsc-herdr/skills/gitea/scripts/__pycache__/ready.cpython-314.pyc new file mode 100644 index 0000000..52f42c8 Binary files /dev/null and b/plugins/jsc-herdr/skills/gitea/scripts/__pycache__/ready.cpython-314.pyc differ diff --git a/plugins/jsc-herdr/skills/gitea-issue/scripts/git-credential.sh b/plugins/jsc-herdr/skills/gitea/scripts/git-credential.sh similarity index 100% rename from plugins/jsc-herdr/skills/gitea-issue/scripts/git-credential.sh rename to plugins/jsc-herdr/skills/gitea/scripts/git-credential.sh diff --git a/plugins/jsc-herdr/skills/gitea-issue/scripts/lib.sh b/plugins/jsc-herdr/skills/gitea/scripts/lib.sh similarity index 92% rename from plugins/jsc-herdr/skills/gitea-issue/scripts/lib.sh rename to plugins/jsc-herdr/skills/gitea/scripts/lib.sh index cfb8e4f..2e1af47 100755 --- a/plugins/jsc-herdr/skills/gitea-issue/scripts/lib.sh +++ b/plugins/jsc-herdr/skills/gitea/scripts/lib.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# gitea-issue 共用函式。每個腳本都 source 這個檔。 +# gitea 共用函式。每個腳本都 source 這個檔。 set -euo pipefail LABEL="in-progress" @@ -9,7 +9,7 @@ INTERVAL="${HERDR_ISSUE_INTERVAL:-300}" MODEL="${HERDR_ISSUE_MODEL:-claude-sonnet-5-5}" SCRIPTS="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -die() { echo "gitea-issue: $*" >&2; exit 1; } +die() { echo "gitea: $*" >&2; exit 1; } # tea 的預設使用者。在 clone 裡 tea 會依 remote URL 挑第一個符合的 login(可能不是預設的), # 所以明確取 default 那個 login,所有 tea 呼叫都加 --login。可用 HERDR_ISSUE_LOGIN 覆寫。 @@ -17,7 +17,7 @@ if [ -z "${HERDR_ISSUE_LOGIN:-}" ]; then HERDR_ISSUE_LOGIN="$(tea login list --output json | python3 -c "import sys,json print(next((l['name'] for l in json.load(sys.stdin) if str(l.get('default')).lower()=='true'),''))")" fi -[ -n "$HERDR_ISSUE_LOGIN" ] || { echo "gitea-issue: tea 沒有預設 login,請先 tea login default " >&2; exit 1; } +[ -n "$HERDR_ISSUE_LOGIN" ] || { echo "gitea: tea 沒有預設 login,請先 tea login default " >&2; exit 1; } export HERDR_ISSUE_LOGIN # 忽略所有 TLS 檢查:tea 的 insecure 只能寫在設定檔(沒有環境變數),所以把所有 login 設成 insecure: true(冪等); @@ -39,7 +39,7 @@ tea() { out="$(command tea "$1" --login "$HERDR_ISSUE_LOGIN" "${@:2}" 2>"$ef")" && rc=0 || rc=$? err="$(cat "$ef")" if [ "$rc" -eq 0 ] || ! grep -qiE 'tls|x509|certificate|handshake' <<<"$out$err"; then break; fi - echo "gitea-issue: tea 遇到 TLS/憑證錯誤(第 $try/$max 次),3 秒後重試" >&2 + echo "gitea: tea 遇到 TLS/憑證錯誤(第 $try/$max 次),3 秒後重試" >&2 rc=${rc/#0/1}; sleep 3 done rm -f "$ef" @@ -125,7 +125,7 @@ raw=sys.stdin.read() try: d=json.loads(raw) except Exception: d=None if not isinstance(d,list): - sys.stderr.write('gitea-issue: 讀取 #$2 的依賴失敗:'+raw.strip()[:300]+'\n'); sys.exit(1) + sys.stderr.write('gitea: 讀取 #$2 的依賴失敗:'+raw.strip()[:300]+'\n'); sys.exit(1) for i in d: if i.get('state')=='open': r=(i.get('repository') or {}).get('full_name','') diff --git a/plugins/jsc-herdr/skills/gitea-issue/scripts/pr-wait.sh b/plugins/jsc-herdr/skills/gitea/scripts/pr-wait.sh similarity index 100% rename from plugins/jsc-herdr/skills/gitea-issue/scripts/pr-wait.sh rename to plugins/jsc-herdr/skills/gitea/scripts/pr-wait.sh diff --git a/plugins/jsc-herdr/skills/gitea-issue/scripts/prompt.txt b/plugins/jsc-herdr/skills/gitea/scripts/prompt.txt similarity index 100% rename from plugins/jsc-herdr/skills/gitea-issue/scripts/prompt.txt rename to plugins/jsc-herdr/skills/gitea/scripts/prompt.txt diff --git a/plugins/jsc-herdr/skills/gitea-issue/scripts/ready.py b/plugins/jsc-herdr/skills/gitea/scripts/ready.py similarity index 97% rename from plugins/jsc-herdr/skills/gitea-issue/scripts/ready.py rename to plugins/jsc-herdr/skills/gitea/scripts/ready.py index 946c6b5..a96efd1 100755 --- a/plugins/jsc-herdr/skills/gitea-issue/scripts/ready.py +++ b/plugins/jsc-herdr/skills/gitea/scripts/ready.py @@ -38,7 +38,7 @@ def open_blockers(n): try: d = json.loads(raw) except Exception: d = None if not isinstance(d, list): - sys.exit(f"gitea-issue: 讀取 #{n} 的依賴失敗:{raw.strip()[:300]}") + sys.exit(f"gitea: 讀取 #{n} 的依賴失敗:{raw.strip()[:300]}") out = [] for i in d: if i.get("state") != "open": continue diff --git a/plugins/jsc-herdr/skills/gitea-issue/scripts/ready.sh b/plugins/jsc-herdr/skills/gitea/scripts/ready.sh similarity index 100% rename from plugins/jsc-herdr/skills/gitea-issue/scripts/ready.sh rename to plugins/jsc-herdr/skills/gitea/scripts/ready.sh diff --git a/plugins/jsc-herdr/skills/gitea-issue/scripts/start.sh b/plugins/jsc-herdr/skills/gitea/scripts/start.sh similarity index 98% rename from plugins/jsc-herdr/skills/gitea-issue/scripts/start.sh rename to plugins/jsc-herdr/skills/gitea/scripts/start.sh index ecc841d..afeb288 100755 --- a/plugins/jsc-herdr/skills/gitea-issue/scripts/start.sh +++ b/plugins/jsc-herdr/skills/gitea/scripts/start.sh @@ -77,7 +77,7 @@ PROMPT_ERR="$(mktemp)" if PROMPT_OUT="$(herdr agent prompt "issue-$N" "$PROMPT" --wait --until working --until blocked --timeout 15000 2>"$PROMPT_ERR")"; then rm -f "$PROMPT_ERR" else - echo "gitea-issue: 送出提示詞後 agent 沒有反應,已回滾" >&2 + echo "gitea: 送出提示詞後 agent 沒有反應,已回滾" >&2 cat "$PROMPT_ERR" >&2; rm -f "$PROMPT_ERR" rollback exit 1 diff --git a/plugins/jsc-herdr/skills/gitea-issue/scripts/tick.sh b/plugins/jsc-herdr/skills/gitea/scripts/tick.sh similarity index 100% rename from plugins/jsc-herdr/skills/gitea-issue/scripts/tick.sh rename to plugins/jsc-herdr/skills/gitea/scripts/tick.sh diff --git a/plugins/jsc-herdr/skills/gitea-issue/scripts/watch-issue.sh b/plugins/jsc-herdr/skills/gitea/scripts/watch-issue.sh similarity index 98% rename from plugins/jsc-herdr/skills/gitea-issue/scripts/watch-issue.sh rename to plugins/jsc-herdr/skills/gitea/scripts/watch-issue.sh index 314a012..b095fa7 100755 --- a/plugins/jsc-herdr/skills/gitea-issue/scripts/watch-issue.sh +++ b/plugins/jsc-herdr/skills/gitea/scripts/watch-issue.sh @@ -16,7 +16,7 @@ NOTIFIED=false close_if_done() { # $1=X $2=label [ "$(issue_state "$REPO" "$1")" = open ] || { echo skip; return; } if [ "$(open_count_with_label "$REPO" "$2")" = 0 ]; then - tea comment "$1" --repo "$REPO" "底下的議題全部關閉,由 gitea-issue 自動關閉。" >/dev/null + tea comment "$1" --repo "$REPO" "底下的議題全部關閉,由 gitea 自動關閉。" >/dev/null tea issues close "$1" --repo "$REPO" >/dev/null echo closed else