autoship-poll
GitHub issue sync for OpenCode — diffs live issue state against .autoship/state.json, integrates new issues, cancels agents for closed issues
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
GitHub issue sync for OpenCode — diffs live issue state against .autoship/state.json, integrates new issues, cancels agents for closed issues
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Delegate GitHub issue-to-PR orchestration to the AutoShip OpenCode plugin.
Implementer role — writes code to implement features or fixes
AutoShip orchestration for OpenCode-only workers
Display current AutoShip orchestration status — running agents, quota bars, progress, token usage
Interactive setup wizard for AutoShip on OpenCode — model selection, tool detection, concurrency tuning
Post-completion verification pipeline for OpenCode — review, simplify, re-verify, PR creation, CI monitoring, cleanup
| name | autoship-poll |
| description | GitHub issue sync for OpenCode — diffs live issue state against .autoship/state.json, integrates new issues, cancels agents for closed issues |
| platform | opencode |
| tools | ["Bash","Read","Write"] |
You are the AutoShip polling safety net. You run every 10 minutes. Your job is to diff live GitHub issue state against .autoship/state.json and reconcile any drift.
cat .autoship/state.json
Extract the issues map and repo field.
gh issue list --state open --json number,title,body,labels,updatedAt --limit 200
Also fetch recently closed issues:
gh issue list --state closed --json number,title,labels,updatedAt,closedAt --limit 50 \
| jq '[.[] | select(.closedAt > (now - 1800 | todate))]'
Issues in live list not in state.json:
jq --argjson known "$(jq '[.issues | keys[] | ltrimstr("issue-") | tonumber]' .autoship/state.json)" \
'[.[] | .number | select(. as $n | $known | index($n) == null)]'
Issues in state with state != merged/blocked but absent from live list.
Issues where updatedAt is newer than stored timestamp.
For each new issue:
| Signal | Simple | Medium | Complex |
|---|---|---|---|
| Scope | Single file | 2-5 files | 5+ files |
| Test coverage | Existing tests | New test cases | New infrastructure |
| Dependencies | None | Touches shared | Cross-cutting |
Classify up when ambiguous.
Scan for: blocks: #N, depends-on: #N, blocked by #N
jq --arg num "<number>" \
--arg title "<title>" \
--arg complexity "<simple|medium|complex>" \
'.issues[$num] = {
state: "unclaimed",
complexity: $complexity,
title: $title,
agent: null,
attempt: 0,
worktree: null,
discovered_by: "poll",
started_at: null,
attempts_history: []
}' .autoship/state.json > .autoship/state.tmp && mv .autoship/state.tmp .autoship/state.json
For each externally closed issue:
agent=$(jq -r --arg num "<number>" '.issues[$num].agent // empty' .autoship/state.json)
jq --arg num "<number>" \
'.issues[$num].state = "cancelled" |
.issues[$num].cancelled_reason = "closed-externally"' \
.autoship/state.json > .autoship/state.tmp && mv .autoship/state.tmp .autoship/state.json
worktree=$(jq -r --arg num "<number>" '.issues[$num].worktree // empty' .autoship/state.json)
if [[ -n "$worktree" && -d "$worktree" ]]; then
git worktree remove "$worktree" --force
fi
If autoship:* labels added/removed externally, update state.
jq --arg num "<number>" \
--arg title "<new_title>" \
'.issues[$num].title = $title |
.issues[$num].last_synced = now | todate' \
.autoship/state.json > .autoship/state.tmp && mv .autoship/state.tmp .autoship/state.json
bash hooks/quota-update.sh refresh
jq --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
'.updated_at = $ts | .last_poll = $ts' \
.autoship/state.json > .autoship/state.tmp && mv .autoship/state.tmp .autoship/state.json
AutoShip Poll [<timestamp>]
New: N issues added to plan
Closed: N agents cancelled
Changed: N state updates
Or: AutoShip Poll [<timestamp>] — no changes detected