refactor: jsc-herdr 技能改名(cmd、gitea) #31

Merged
jiantw83 merged 1 commits from refactor/herdr-skill-rename into main 2026-10-14 04:53:45 +00:00
16 changed files with 18 additions and 18 deletions
Showing only changes of commit 346cbbad2c - Show all commits
+1 -1
View File
@@ -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",
+1 -1
View File
@@ -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`
+1 -1
View File
@@ -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": {
+3 -3
View File
@@ -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
```
@@ -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."
---
@@ -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)。
@@ -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 <name>" >&2; exit 1; }
[ -n "$HERDR_ISSUE_LOGIN" ] || { echo "gitea: tea 沒有預設 login,請先 tea login default <name>" >&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','')
@@ -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
@@ -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
@@ -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