delegate

Delegate bounded tasks to open-weight models via opencode with evidence capture.

Updated Dec 27, 2025
One-click install
npx skills add https://github.com/HendrikGC02/Astroray --skill delegate-hendrikgc02
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: delegate
Source: https://github.com/HendrikGC02/Astroray/tree/main/.claude/skills/delegate
Command: npx skills add https://github.com/HendrikGC02/Astroray --skill delegate-hendrikgc02

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Delegating work to cheap open-weight models risks silent failures, over-claimed success, and runaway processes. This Skill runs bounded tasks through opencode while capturing verifiable evidence (diffs, transcripts, tokens, cleanup status) so the orchestrating model judges results instead of trusting the worker. ## Core Features & Use Cases - Tiered delegation: Route grunt work (docs flips, lint fixes, standup drafts), gated implementation in isolated worktrees, or read-only pre-review diff critique to tier-appropriate models defined in config/tiers.json. - Evidence contract: Every run returns a JSON summary with status, termination_reason, files_changed, tokens, cost, transcript path, and cleanup evidence — never a success claim. - Process containment: On Windows, workers run inside a Job Object with KILL_ON_JOB_CLOSE so the full process tree is terminated and confirmed before evidence is reported. - Use Case: Offload a batch of documentation status flips to a cheap model, then verify the returned diff yourself before committing, conserving premium model budget. ## Quick Start Ask the assistant to delegate a bounded docs or lint-fix task to the grunt tier using the delegate script and then verify the returned diff evidence.

Frequently Asked Questions about delegate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I delegate a coding task to a cheaper AI model?▼

Run delegate.py with a tier (grunt, implement, or verify), a working directory, and a self-contained prompt. The wrapper invokes opencode with the tier's configured model and returns a JSON evidence summary with files_changed, tokens, and a transcript path for you to verify.

How do I run an AI coding agent in an isolated git worktree?▼

Pass --dir pointing at the worktree to delegate.py, which forwards it to opencode's own --dir flag. Without it, opencode roots its tools at the main checkout via the shared .git directory, silently redirecting edits into main.

What tasks should not be delegated to open-weight models?▼

Never delegate architecture or spec judgment, physics-parity review, ABI reachability checks, gate-failure root-cause analysis, merge decisions, or visual PNG inspection, since workers are text-only and their mistakes can ship silently.

Does the delegate wrapper guarantee the task succeeded?▼

No. A status of completed only means the process finished; opencode has documented exit-0-on-error bugs and open models over-claim. The caller must verify via diffs, builds, and tests before accepting any result.

How are runaway worker processes cleaned up on Windows?▼

The wrapper launches the worker inside a Windows Job Object with JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, so all descendant processes inherit membership. On completion, timeout, or cancellation it terminates the Job tree and confirms zero active processes before reporting evidence.

What should I do when a delegated task times out or returns garbage?▼

Re-dispatch once for a timeout, since known Windows hang classes exist. For garbage output, retry with the --fallback flag to switch models; after two failures, stop looping the weak model and do the task directly.