GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — agentic-dev-setup/home/.claude/delegation-block.md at main · elvinlab/agentic-dev-setup

Expand file tree

/

delegation-block.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
62 lines (40 loc) · 4.23 KB
/

delegation-block.md

Copy path

File metadata and controls

62 lines (40 loc) · 4.23 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Delegating to OpenCode via herdr

You are pre-authorized to use herdr to delegate work to opencode agents without the user asking each time. Goal: spend your capacity only where it adds value and route the rest to cheaper models.

Precedence. This block overrides the ODD Writer trigger and its rule that units of about 100 changed lines or less run inline, for Tier 1-2 work. Every Sonnet turn re-reads the whole session context, so a task done inline costs several expensive turns while a delegated one costs one or two.

When to delegate (moderate policy)

Delegate to OpenCode when the spec can be stated precisely AND the work would take about 3 or more inline turns (read, edit, test, fix cycles) or roughly 30+ lines of new code, tests, or docs. Read-only mapping that ODD would send to an explorer also goes to OpenCode: brief it as read-only and ask for at most ~2k tokens with path:line evidence.

Keep inline: ambiguous requirements, security-sensitive code, cross-module or architectural changes, one-liners and 1-2 turn edits, and anything that needs this conversation's context.

Model routing (dynamic)

Before every delegation, read ~/.config/agent-routing/active.env. It defines TIER1_MODEL and TIER2_MODEL. Launch OpenCode with the resolved value: opencode -m <model>.

Never hardcode or assume model names: the user switches this file at any time (cloud, local-only, or others). If the file is missing or a value is empty, launch opencode with its default model and tell the user.

Tiers

Tier Model Typical work
1 Trivial TIER1_MODEL Renames, lint/format fixes, i18n strings, commit messages, mechanical 1–2 file edits
2 Bounded TIER2_MODEL Tests, boilerplate, docs, simple components, refactors with a clear spec
3 Complex Yourself Architecture, design decisions, hard debugging, security-sensitive code, ambiguous requirements, cross-module changes

When unsure between tiers, pick the higher one. Never delegate work whose spec you cannot state precisely. If doing the change yourself costs less than writing the brief and reviewing the result (for example, a one-line edit), do it yourself.

Before delegating

  • Check Engram (mem_search / mem_context) and the project's own instructions (AGENTS.md, CLAUDE.md, README, existing tests) so the brief matches the project's conventions.
  • Reuse a running opencode pane only if it was started with the required model; otherwise launch a new one. You may close panes you launched; never close panes you did not start.
  • For parallel tasks, give each agent its own git worktree.

Delegation brief

The agent does not see this conversation, so every brief must be self-contained:

  1. Goal in one sentence.
  2. Exact files to create or modify; everything else is read-only.
  3. Conventions to follow, pointing to an existing file as an example.
  4. Acceptance criteria.
  5. Verification commands the agent must run and report.
  6. Constraints: do not commit, push, install dependencies, or touch config or secrets unless explicitly stated.

After delegating

  • Review cheaply: read git diff --stat, rerun the verification commands yourself, and read only the hunks that are risky or that the tests do not cover. Read the full diff only for security-sensitive work or when no test covers the change.
  • Fix small issues directly. Re-delegate only with a sharper brief; after two failed attempts, do it yourself.
  • If the agent saved incorrect facts to Engram, correct them.
  • Report to the user what was delegated, to which tier and model, and your review verdict.

Watchdog (never wait unbounded)

  • Always delegate with herdr agent prompt <agent> "<brief>" --wait --timeout <ms>; use at most 900000 (15 min) for a tier 1-2 task. Never wait without a timeout.
  • On timeout, or when the pane shows the same tool call or error repeating (free models can loop on a no-op edit), read the tail with herdr agent read <agent> --source recent-unwrapped --lines 40, interrupt it with herdr agent send-keys, and re-brief once with a narrower scope. If it fails again, do the task yourself.

Fallback

If herdr or opencode is unavailable, or the delegated task stalls, tell the user and continue yourself.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.