Skip to content

feat: agent-driven coordinator with skill-based dispatch#421

Merged
Maleick merged 2 commits into
mainfrom
feat/autoship-coordinator
May 11, 2026
Merged

feat: agent-driven coordinator with skill-based dispatch#421
Maleick merged 2 commits into
mainfrom
feat/autoship-coordinator

Conversation

@Maleick
Copy link
Copy Markdown
Owner

@Maleick Maleick commented May 11, 2026

Summary

  • Replace inline prompt generation with SKILL.md-based coordinator agent
  • Add AUTOSHIP_REPO_ROOT env var for cross-platform path resolution
  • Remove 121 lines of inline bash prompt template logic
  • Coordinator agent now handles scanning, dispatching, and monitoring via native \ ask()\ calls
  • Works on Windows via Git Bash or WSL

Changes

  • \skills/autoship-coordinator/SKILL.md: comprehensive coordinator agent prompt
  • \hooks/opencode/coordinator.sh: simplified entry point that runs the skill

Local User added 2 commits May 11, 2026 10:42
Adds the autoship-coordinator skill and coordinator.sh that uses
OpenCode's task tool to spawn general subagents per queued workspace.
Supports task_id tracking, resume via existing task_ids, and configurable
concurrency. Enable by calling coordinator.sh directly or via runner.sh
with AUTOSHIP_COORDINATOR_MODE=true.
Copilot AI review requested due to automatic review settings May 11, 2026 17:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an AutoShip “coordinator” skill plus a shell entrypoint intended to scan .autoship/workspaces, dispatch queued work, and report outcomes—moving orchestration logic out of inline shell prompt templates and into a SKILL.md-driven agent.

Changes:

  • Introduce skills/autoship-coordinator/SKILL.md defining a coordinator workflow for scanning/dispatching queued workspaces.
  • Add hooks/opencode/coordinator.sh as a CLI entrypoint to run the coordinator skill via opencode run, with basic logging and a --once flag.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
skills/autoship-coordinator/SKILL.md New coordinator skill prompt/spec for scanning queued workspaces and dispatching subagents.
hooks/opencode/coordinator.sh New bash entrypoint to invoke the coordinator skill and append output to a coordinator log.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +6
# AutoShip Coordinator

You are the AutoShip Coordinator for this repository. You manage queued AutoShip issues by spawning implementer subagents.

## Mission

Comment on lines +27 to +28
Read `.autoship/config.json` for `max_workers` or `max_concurrent` field. Default: 5.
Spawn multiple subagents concurrently when possible by making multiple `task()` calls.
Comment on lines +18 to +22
c. Write "RUNNING" to `<workspace>/status`
d. Write current UTC timestamp to `<workspace>/started_at`
e. Call `task(subagent_type="general", prompt=<AUTOSHIP_PROMPT.md content>)`
f. On task return, write the task_id to `<workspace>/task_id`
g. Read final `<workspace>/status` — expect COMPLETE, BLOCKED, or STUCK

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
AUTOSHIP_DIR="${AUTOSHIP_DIR:-.autoship}"
REPO_ROOT="${AUTOSHIP_REPO_ROOT:-$(cd "$SCRIPT_DIR/../../.." && pwd)}"
Comment on lines +14 to +23
AUTOSHIP_DIR="${AUTOSHIP_DIR:-.autoship}"
REPO_ROOT="${AUTOSHIP_REPO_ROOT:-$(cd "$SCRIPT_DIR/../../.." && pwd)}"
LOG_FILE="$REPO_ROOT/$AUTOSHIP_DIR/coordinator.log"
SKILL_FILE="$SCRIPT_DIR/../../skills/autoship-coordinator/SKILL.md"
COORDINATOR_MODEL="${AUTOSHIP_COORDINATOR_MODEL:-kimi-for-coding/k2p6}"

ONCE=false
[[ "${1:-}" == "--once" ]] && ONCE=true

log() { echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ') $1" | tee -a "$LOG_FILE"; }
Comment on lines +27 to +29
opencode run --model "$COORDINATOR_MODEL" "$SKILL_FILE" 2>&1 | tee -a "$LOG_FILE"

coordinator_exit=$?
Comment on lines +20 to +33
ONCE=false
[[ "${1:-}" == "--once" ]] && ONCE=true

log() { echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ') $1" | tee -a "$LOG_FILE"; }

log "Coordinator starting (model=$COORDINATOR_MODEL)"
cd "$REPO_ROOT"
opencode run --model "$COORDINATOR_MODEL" "$SKILL_FILE" 2>&1 | tee -a "$LOG_FILE"

coordinator_exit=$?
log "Coordinator exited with code $coordinator_exit"

[[ "$ONCE" == "false" ]] && { log "Re-scanning..."; exec bash "$0" --once; }
exit $coordinator_exit
@Maleick Maleick merged commit be6cf5c into main May 11, 2026
4 of 6 checks passed
@Maleick Maleick deleted the feat/autoship-coordinator branch May 11, 2026 17:23
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.21.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants