Prompts vs. Rules vs. Skills vs. Subagents vs. Commands#

Modern AI coding harnesses give you five different ways to steer an AI model. Putting instructions in the wrong layer either bloats every prompt, biases code reviews, or forces you to repeat boilerplate on every turn:

PrimitiveWhen It LoadsContext WindowTrigger ReliabilityBest Used For
1. Chat PromptCurrent turn onlyMain chat100% manual (you type it)Your plain-English goal, why, and specific feature constraints for this task.
2. Standing Rules & Repo Contracts (AGENTS.md, REVIEW.md, workflow-policy.md)Every turnMain chat100% always-onShort, universal invariants: build/test commands, safety limits (gh pr merge: deny). Keep concise so every turn stays lean.
3. Skills (skills/*/SKILL.md)Progressive disclosure: only the 1-line description sits in context until matchedMain chat (or active subagent)Probabilistic (model matches prose to description)Deep domain playbooks (tdd, create-issue, jira-issues, security-audit, go-perf) needed on specific tasks without paying token cost on unrelated turns.
4. Subagents (agents/*.md)Only when delegatedFresh, isolated context (with its own tools & model)Delegated by skill, command, or main agentTasks needing unbiased eyes (code-reviewer, security-auditor with edit: deny), separate models (review-buster), or noisy loops (waiter polling CI without flooding main chat).
5. Slash Commands (commands/*.md)Only when you type /nameMain chat or target subagent100% deterministicExplicit overrides (/plan, /create-issue, /finish-issue, /wait-what) when you want to force a workflow rather than rely on prose matching.

Why Different Harnesses Need Different Layouts (OpenCode vs. Antigravity / agy)#

Not every coding harness exposes the same primitives:

  • OpenCode (-r harness=opencode, default): Separates user customizations into skills/, agents/, and commands/. Workflows like code-reviewer, artifact-auditor, and security-auditor live in agents/*.md, while shortcuts like /handoff and /review live in commands/*.md.
  • Antigravity (agy) (-r harness=agy or -r harness=both): Slash commands in agy are built-in rather than user-defined commands/*.md files, and skill-centric harnesses rely on SKILL.md playbooks whenever the main agent runs a review, handoff, or audit workflow inline. That means agy needs more skills: every role agent and standalone command workflow also gets a companion SKILL.md in ~/.gemini/config/skills/ (alongside ~/.gemini/config/rules/workflow-policy.md, ~/.gemini/config/agents/*/agent.md, ~/.gemini/config/THIRD-PARTY-NOTICE.txt, and ~/.gemini/config/mcp_config.json).

To keep both harnesses 100% in sync with zero duplicate files to maintain, agentic-code stores one canonical set of playbooks in scafctl/user-opencode/ and uses scafctl CEL transforms at install time to generate the extra Antigravity SKILL.md and agent.md files automatically when you pass -r harness=agy or -r harness=both.

Protect your <skills> context budget (especially in Antigravity agy): Harnesses inject every installed skill's description: into the <skills> system-prompt block behind a strict character budget. Once that budget fills up, trailing skills (alphabetically later names like last-look or work-herd) are silently excluded from auto-discovery. Three habits prevent truncation:

  1. Keep description: frontmatter to 1 to 2 high-signal sentences (trigger phrases + outcome), putting detailed rules inside the SKILL.md body where progressive disclosure loads them on demand.
  2. Avoid duplicate skill directories: In agy, keep one canonical user skill folder (~/.gemini/config/skills/, where agentic-code installs) rather than mirroring the same skills across ~/.gemini/antigravity-cli/skills/, ~/.gemini/skills/, and ~/.gemini/config/plugins/*/skills/ (which causes agy to print duplicate descriptions twice).
  3. Archive unused domain packs: Move rarely used vendor or data-pipeline skill packs out of active global skill folders so they never crowd out core daily engineering skills.

Browse Included Playbooks#

Every drawer below renders directly at build time from scafctl/user-opencode/, and scafctl run action ci verifies that every bundled Markdown playbook, standing policy, agent, and command is listed here so this page can never drift out of sync.

Standing Workflow Policy (instructions/*.md)#

Loaded on every turn (~/.config/opencode/instructions/workflow-policy.md in OpenCode; ~/.gemini/config/rules/workflow-policy.md in Antigravity):

workflow-policy.mdalways-on rule
Standing personal workflow rules: read AGENTS.md/REVIEW.md first, auto-select skills from plain English, prefer best long-term design over shortcuts, enforce 2-strike escalation and 3-round circuit breakers, run finish-issue before PRs, and never auto-merge.
Installed at ~/.config/opencode/instructions/workflow-policy.md View raw on GitHub ->

Personal Agentic Workflow Policy#

  • Repo contract vs. personal workflow: Always read the target repository's AGENTS.md and REVIEW.md first for repo-specific build, test, lint, architecture, and default issue-tracker conventions.
  • Auto-select skills from plain-English prose: Match natural prose to your installed skills automatically without requiring memorized slash commands:
    • Load planner before starting any non-trivial feature, refactor, or issue pickup: inspect the codebase first, skeptically verify it fits project scope, and align on a plan before writing code.
    • Load create-issue alongside github-issues, jira-issues, or local-issues when drafting or reading issues so every issue has a plain-English top half for human sign-off and grounded repo context at the bottom for AI implementation (previewed in chat before filing).
    • Load stepwise-interview when product edge cases are open, and wait-what whenever the user says "what?" or "I don't follow".
    • Load tdd and codebase-design (plus go in Go repos) when implementing incremental steps, markdown when authoring Markdown or prose (never use em-dashes, en-dashes, or -- dash clauses), security-audit (or security-sweep for whole-repo audits) when investigating or fixing security flaws, publish-hygiene before publishing to public repos, finish-issue automatically before opening a pull request, pr-autopilot when driving an open PR through CI and Copilot reviews, last-look when walking the human through ready PRs to merge one at a time, and work-herd when asked for a Herdr plan/DAG or multi-worker wave.
  • Engineering judgment (best over easiest, never rubber-stamp how):
    • Honor libraries, stack choices, and constraints the user already stated without grilling them backwards on settled basics.
    • Check how mature tools and idiomatic packages solve the problem, and recommend the best long-term design (codebase-design) rather than the easiest shortcut.
    • Do not just build what you think the user wants to hear: if a prompt prescribes a clunky or fragile "how" when a simpler, safer, or more testable design exists, explain the better approach up front before coding.
  • Plain-language alignment: When requirements or design trade-offs are unclear, load stepwise-interview and ask one plain-English question at a time with a clear recommendation. If the user says /wait-what or signals confusion, drop jargon immediately and re-explain simply.
  • Two-strike escalation & three-strike circuit breaker:
    • After 2 failed attempts on the same failing check or bug with a faster coding model, escalate to a stronger reasoning model (with a minimal, secret-redacted summary of scope, files, attempts, and exact error output) instead of spinning in a retry loop.
    • After 3 failed fix attempts (locally or in PR review rounds), STOP patching and ask the human, because repeated failure signals a design or boundary problem rather than a typo.
  • Pre-PR AI self-review gate (0 CI / 0 PR quota): Automatically run finish-issue (code-reviewer + artifact-auditor in parallel, plus free local tests, linters, and security scan) on your feature branch before pushing and opening a pull request so Round 1 reaches GitHub Copilot and human PR review clean.
  • Protect GitHub Copilot review credits:
    • Never request a Copilot re-review until all GitHub CI checks on HEAD are green.
    • Do not re-request Copilot on pure default-branch rebases or docs-only edits after a clean No issues found review.
    • Never treat a Copilot comment mentioning "unable to review" or "insufficient remaining quota" as a passing review.
  • Human-in-the-loop boundaries: Never commit directly to main/master; work on feature branches, require human approval before pushing to remotes, opening PRs, or cutting releases, and never merge pull requests (gh pr merge) automatically. The human owns architecture, guidance, and final PR acceptance.

1. Planning, Alignment & Multi-Tracker Issue Authoring#

Used in Step 2 (and Herdr planning) when scoping ideas, structuring two-layer issues (Plain English at the top for humans, grounded codebase context at the bottom for AI), and working across GitHub Issues, Jira tickets, or local Markdown issues.

planner/plan | planner subagent
Use automatically before implementing, planning, or scoping any non-trivial feature, refactor, or issue: inspects live code first, questions scope and weak 'how' ideas, settles edge cases, and produces a blueprint or delegates to create-issue.
Installed at ~/.config/opencode/skills/planner/SKILL.md View raw on GitHub ->

Skeptical Codebase Triage & Planning#

Whenever a user proposes a non-trivial feature, asks to draft an issue or Jira ticket, or asks to implement an open issue (#123, PROJ-123, or temp/issues/*.md), validate and plan before writing production code, even if they asked in plain English without a slash command.

Step 0: Skeptical Triage Gate (Always First)#

An idea, GitHub issue, Jira ticket, or local issue file is a hypothesis, not a mandate. Reporters often lack full codebase context, and even an issue drafted earlier by an AI can miss callers or go stale.

  1. Inspect the real code first (file:line): Read AGENTS.md, README.md, and the relevant packages and tests before forming an opinion. When reading an existing issue, load github-issues (#123), jira-issues (PROJ-123), or local-issues (temp/issues/001-*.md) to fetch the full details. Verify whether the gap or bug actually exists, is partially implemented, or was already solved.
  2. Question whether it belongs: Confirm the request fits the project's purpose, scope, and maintenance bar. If it is redundant, out of scope, or better solved outside core, push back with file:line evidence and stop instead of producing a plan.
  3. Honor stated constraints, challenge weak how:
    • Treat libraries, stack choices, and boundaries the user already stated as settled (do not grill them backwards on settled basics unless the codebase proves a direct conflict).
    • Never rubber-stamp a prescribed "how": if the prompt or issue suggests a clunky, racy, or over-engineered mechanism when a simpler, safer, or more testable design exists, explain the better approach and why.
  4. Learn from prior art & favor best over easiest: Check existing codebase patterns (go skill for Go repos, codebase-design for deep modules and seams) and how mature tools solve the same problem. Explicitly call out any easy-but-inferior shortcut you rejected.
  5. Resolve genuinely open choices simply: Look up codebase facts yourself. When real product or behavior edge cases remain unspoken, load stepwise-interview and settle them one plain-English question at a time with a clear recommendation.

Output Modes#

Mode A: Planning or Implementing a Change#

Record a short Validation block first:

  • Verdict (implement / reshape / recommend-close) with file:line evidence.
  • Chosen design vs. rejected shortcuts (and why if diverging from a suggested fix), plus existing patterns and prior art reused.

If the verdict is implement, present a concise Blueprint and wait for the user's go-ahead before editing production files:

  1. Summary: one plain paragraph on what will be built and why.
  2. Design & Seams: packages, public interfaces, and test seams.
  3. Ordered Implementation Steps: small, independently testable pieces (S/M/L).
  4. Error Handling: sentinel errors, %w wrapping, failure modes.
  5. Testing Strategy: unit, -race, and integration checks at public seams.
  6. Docs, Examples & Risks: supporting files and compatibility or security guardrails.

Mode B: Drafting an Issue or Ticket#

After Step 0 and settling open product rules, load create-issue to structure the draft in two halves (Plain English at the top for fast human review, followed by Technical Context at the bottom for accurate AI implementation), preview it in chat for human confirmation, and file it through github-issues, jira-issues, or local-issues.

create-issue/create-issue | human + AI sections
Use when drafting an issue, bug report, feature request, or user story: explores live code first, writes Plain English at the top for human review plus Technical Context at the bottom for AI execution, previews in chat, and files via github-issues, jira-issues, or local-issues.
Installed at ~/.config/opencode/skills/create-issue/SKILL.md View raw on GitHub ->

Two-Layer Issue Authoring (create-issue)#

Every well-written issue serves two different readers in sequence:

  1. The human decision-maker right now, who wants to verify what will be built, why it matters, and how edge cases behave in plain English without wading through file paths or Go types.
  2. The AI (or teammate) implementing it next, who starts in a fresh context window and produces much stronger code when given grounded package pointers, existing patterns, and test expectations up front.

Never write implementation code while running this skill. Explore, align, preview the draft, and file only after the human confirms.

1. Explore & Clarify Before Drafting#

  1. Inspect real code first: Read AGENTS.md, README.md, and the relevant packages and tests (path/to/file) to confirm the gap or bug exists and note existing interfaces, error conventions, and test helpers.
  2. Clarify open product rules simply: Do not guess user-facing behavior. When 1 to 3 product or edge-case choices are genuinely open (status codes, defaults, error handling, non-goals), load stepwise-interview and settle them one plain-English question at a time with a recommended default.

2. Draft With the Two-Half Template#

Keep the top half jargon-free for a 20-second human review, and place grounded codebase context in the bottom half without locking implementers into brittle line-by-line code:

# <Clear action title, e.g. feat(shortener): optional link expiration and click stats>

## Summary & Why
<2 to 4 plain-English sentences stating the problem or use case, who benefits, and why it matters.>

## Agreed Behavior & Edge Cases
- <Plain-English rule 1: defaults, inputs, and happy-path behavior>
- <Plain-English rule 2: edge cases, error responses, or expiration states>
- **Out of scope:** <Anything explicitly excluded so scope stays tight>

## Acceptance Criteria
- [ ] <Observable outcome 1 a human can verify without reading source code>
- [ ] <Observable outcome 2>
- [ ] <Existing behavior remains unbroken and covered by automated tests>

---

## Technical Context (For Implementation)
- **Relevant packages & files:** <Package paths, entrypoints, and existing types/interfaces found during exploration>
- **Existing patterns to reuse:** <Test helpers, sentinel errors, and seams/constructors already in the repo>
- **Constraints & guardrails:** <Settled library boundaries, security/trust checks, compatibility rules, and tempting shortcuts to avoid without prescribing line-by-line code>
- **Verification & scope:** <Public test seams to add (`go test -race`, table-driven cases, docs/README updates) plus rough size: XS / S / M / L>

Formatting & Hygiene Rules#

  • Load markdown for formatting rules (tilde fences ~~~ around nested backticks, and clean prose with zero em-dashes or -- dash clauses).
  • On public repositories, apply publish-hygiene before previewing or filing so secrets, /home/<user> paths, private hostnames, and internal org names never appear in an issue.

3. Preview First, Then File via the Matching Tracker Skill#

  1. Show the draft in chat first and wait for human approval before creating any external ticket.
  2. Load the matching tracker skill based on what the user asked for (or the repository default in AGENTS.md when no tracker was named):
    • GitHub Issues ("create a GitHub issue..." or repo default github): load github-issues.
    • Jira Tickets ("create a Jira ticket / story..." or repo default jira): load jira-issues.
    • Local Markdown ("save a local issue..." or repo default local): load local-issues.
github-issuesgh issue CLI
Use when creating, viewing, listing, or filtering GitHub Issues via the gh CLI (for create-issue, planner, git-github-workflow, or work-herd Herdr plans).
Installed at ~/.config/opencode/skills/github-issues/SKILL.md View raw on GitHub ->

GitHub Issues (github-issues)#

Use the gh CLI to create, read, and shortlist GitHub Issues cleanly across planning (planner), issue authoring (create-issue), branch naming (git-github-workflow), and parallel Herdr orchestration (work-herd).

1. Creating an Issue (After create-issue Draft Approval)#

Always draft the issue with create-issue first and wait for human sign-off before running gh issue create. Pass the body securely to avoid shell quoting corruption:

# Write body inside a repo-local ignored scratch file (works with sandboxed/Snap gh too)
mkdir -p temp
gh issue create --title "feat(shortener): add optional link expiration" --body-file temp/issue-draft.md
rm -f temp/issue-draft.md

Add --label or --milestone when the repository uses them (gh label list).

2. Reading & Shortlisting Issues (For planner and work-herd)#

  • Single issue pickup: gh issue view <N> --comments
  • Scoped shortlist for Herdr (work-herd): Never pull hundreds of open issues at random. Filter by label, milestone, assignee, or search terms first:
    gh issue list --state open --label "sprint-next" --limit 20
    gh issue list --state open --search "shortener OR storage" --limit 20

3. Branch & PR Linking Conventions#

  • Branch name: <type>/<N>-<slug> (for example, feat/42-expiring-links).
  • Pull request footer: Include Closes #<N> (or Refs #<N> for partial work) in the commit and PR body so merging the PR updates the issue automatically.
jira-issuesJira / Atlassian MCP
Use when the user asks to create a Jira ticket/story, read a Jira key (PROJ-123), or look at Jira tickets to build a plan or Herdr DAG via the Atlassian/Jira MCP server.
Installed at ~/.config/opencode/skills/jira-issues/SKILL.md View raw on GitHub ->

Jira Tickets & Stories (jira-issues)#

Use the configured Jira / Atlassian MCP tools whenever the user says "create a Jira ticket", references a Jira key (PROJ-123), or asks to "look at my Jira tickets" for planning (planner) or parallel orchestration (work-herd).

If no Jira MCP server is connected yet in the user's harness config, point them to the remote OAuth 2.1 endpoint (https://mcp.atlassian.com/v2/mcp) rather than guessing CLI commands.

1. Creating a Jira Ticket (After create-issue Draft Approval)#

  1. Draft the content with create-issue first (Plain English summary, behavior, and acceptance criteria at the top; grounded codebase context at the bottom) and confirm the draft with the human before creating the ticket.
  2. Determine the target Project Key (for example PROJ from the user's prompt, AGENTS.md, or by listing accessible Jira projects via MCP) and issue type (Story, Task, or Bug).
  3. Create the ticket via the Jira MCP create-issue tool and return the new key and browse URL.

2. Reading & Querying Jira Tickets (For planner and work-herd)#

  • Single ticket pickup (PROJ-123): Fetch the ticket summary, description, acceptance criteria, status, and comments via the Jira MCP get-issue tool, then validate every assumption against live code (planner).
  • Shortlisting Jira tickets for a Herdr plan (work-herd): When the user asks to "look at my Jira tickets to make a Herdr plan", query via JQL scoped to their project, assignee, or active sprint rather than pulling an unbounded backlog:
    • Current sprint assigned to user: project = PROJ AND assignee = currentUser() AND sprint in openSprints() AND statusCategory != Done ORDER BY Rank ASC
    • Unassigned / team sprint or label filter: project = PROJ AND sprint in openSprints() AND statusCategory != Done ORDER BY priority DESC Present the 4 to 8 candidate tickets and build the work-herd dependency and hotspot DAG using the Jira keys (PROJ-101, PROJ-102).

3. Branch & PR Linking Conventions#

  • Branch name: <type>/<KEY>-<slug> preserving the uppercase Jira key (for example, feat/PROJ-123-expiring-links).
  • Pull request title / footer: Reference <KEY> in the PR body (Refs PROJ-123) so Jira's GitHub integration links the branch and PR automatically.
local-issuestemp/issues/*.md
Use when creating, listing, or reading local Markdown issue files in git-ignored temp/issues/<NNN>-<slug>.md for walkthrough practice, spikes, or offline workflows.
Installed at ~/.config/opencode/skills/local-issues/SKILL.md View raw on GitHub ->

Local Markdown Issues (local-issues)#

Store lightweight issue specs as git-ignored Markdown files under temp/issues/<NNN>-<slug>.md when practicing locally (such as shorty in examples/go-app/), prototyping spikes, or working in a repository where you do not have remote issue-tracker write access.

1. Creating a Local Issue (After create-issue Draft Approval)#

  1. Draft the issue using create-issue (Plain English at the top for human sign-off, Technical Context at the bottom for AI implementation) and confirm with the user first.
  2. Ensure temp/ is ignored by Git (check .gitignore) so scratch issues are never committed accidentally.
  3. Pick the next zero-padded 3-digit number in temp/issues/ (001, 002, ...) and write temp/issues/<NNN>-<slug>.md (for example, temp/issues/001-expiring-links-and-stats.md).

2. Reading & Planning From Local Issues (planner and work-herd)#

  • Single issue pickup: When the user says "look at issue 001", match temp/issues/001-*.md, read it, and run planner's codebase validation exactly as you would for a GitHub or Jira ticket.
  • Herdr multi-issue waves (work-herd): List open files in temp/issues/ and map dependencies and hotspot files across 001, 002, 003 to build temp/plans/<repo>-herd.md. Because git worktree omits git-ignored directories, copy each assigned temp/issues/<NNN>-<slug>.md into <worktree-path>/temp/issues/ before starting its worker.

3. Branch Naming#

  • Branch name: <type>/<NNN>-<slug> (for example, feat/001-expiring-links).
stepwise-interview/interview
Use when resolving ambiguous requirements or architecture choices with a human: honors already-stated constraints, checks prior art for the best (not easiest) design, challenges weak 'how' suggestions, and asks ONE plain-English question at a time. Pairs directly with wait-what.
Installed at ~/.config/opencode/skills/stepwise-interview/SKILL.md View raw on GitHub ->

Stepwise Interview: One Plain Question at a Time#

When solving a non-trivial or ambiguous problem, dumping five or six dense multi-part questions at once overloads the human, while grilling the human backwards on basics they already stated wastes their time. Walk only the genuinely open design tree one decision at a time in everyday language.

Rules#

  1. Read repo context silently first: Never ask the user a question that reading the codebase, comments, README.md, AGENTS.md, git history, CLI --help, or MCP tools can answer. Gather those facts before speaking.
  2. Honor stated request context (never grill backwards): Treat libraries, stack choices, boundaries, and goals the user already supplied in their prompt as settled inputs. Do not ask them to re-justify settled preferences unless a hard technical conflict exists in the codebase.
  3. Bring prior art, favor best over easiest, and challenge weak "how":
    • Check how mature tools and idiomatic libraries solve this problem. Anchor recommendations in the cleanest long-term design (codebase-design), calling out when the best approach differs from the easiest shortcut.
    • Do not rubber-stamp a prescribed "how": if the user's prompt suggests a specific implementation mechanism when a simpler, safer, or more testable design exists, briefly share that better option and why before locking in the plan.
  4. One question per turn: Pick the single highest-leverage open decision whose prerequisites are already settled, ask only that question, and stop to wait for the user's answer.
  5. Plain, everyday English:
    • Give 1 to 2 short sentences of context explaining why this choice matters.
    • Avoid internal jargon, framework buzzwords, or compressed shorthand unless explained inline in plain words.
    • If the user replies /wait-what, "what?", or "I don't follow", load the wait-what skill immediately and re-pitch the question more simply.
  6. Always include your recommendation: Never hand the user a blank page. On Turn 1, if helpful, share 1 to 2 sentences on best-practice prior art for the overall approach, then present Question 1 with your recommended choice:
### Question 1: <short plain title>

<1 to 2 short sentences of everyday context.>

- **My recommendation:** <concrete choice grounded in best practice, and why it beats the shortcut.>

Does that work for you, or would you prefer <clear alternative>?
  1. Adapt the tree after each answer: Every answer settles a branch and may eliminate later questions altogether. Recompute what actually remains open before asking the next question.
  2. Stop before acting: When no open assumptions remain, present a concise summary or blueprint and get the user's explicit go-ahead before writing production code.
wait-what/wait-what
Use when the user signals your last message didn't land ('what?', 'what do you mean?', 'what are you saying', 'I don't follow'): re-pitch it in plain language instead of jargon or compressed shorthand.
Installed at ~/.config/opencode/skills/wait-what/SKILL.md View raw on GitHub ->

Stop. Your last message didn't land. Re-explain it:

  • Give a little context first (what you were responding to, and why).
  • Use plain, everyday language. Avoid jargon, acronyms, and compressed shorthand unless you define them inline.
  • Prefer short, simple sentences over dense ones.
grilling
Batch-frontier structured interview for resolving multiple independent design questions in parallel rounds while honoring stated constraints and favoring best-practice designs over shortcuts. Prefer stepwise-interview when plain one-at-a-time Q&A is easier to digest.
Installed at ~/.config/opencode/skills/grilling/SKILL.md View raw on GitHub ->

Grilling: Structured Interview via Frontier of Rounds#

Map open design questions as a design tree: every decision branches into the decisions that depend on it.

Note: For complex problems where a batch of questions feels overwhelming, prefer the stepwise-interview skill (one plain-English question at a time). Use grilling when you and the user want to clear all independent frontier questions in a single numbered batch.

Honor stated context & challenge weak "how"#

  1. Never grill backwards: Treat libraries, constraints, and goals the user already stated in their prompt as settled. Only put genuinely unresolved product or architecture decisions on the frontier.
  2. Prior art & best over easiest: Ground every recommended answer (->) in how mature tools and idiomatic ecosystems solve the problem, preferring clean seams (codebase-design) over quick hacks.
  3. Push back on prescribed "how" when warranted: If the user suggested an implementation mechanism that is more fragile or complex than a cleaner design, call out the better alternative explicitly instead of silently building around the weaker mechanism.

Work the tree in rounds#

The frontier is every open decision whose prerequisites are already settled. Ask the current frontier with a recommended answer (->) on each item, then wait for the user's answers before computing the next round:

Q1: <question title>: <question body>

-> <your recommended answer grounded in best practice>

Facts are your job, never the user's#

When a question needs a fact from the codebase, comments, README.md, AGENTS.md, docs, or an MCP tool rather than a human judgment call, look it up yourself. Only put real design or scope choices to the user.

Done condition#

Stop interviewing once every branch of the design tree is settled, and wait for explicit confirmation on the resulting plan before implementing.

risk-scaled-effort
Use when starting work to match investigation, model tier, testing, and review depth to actual task risk.
Installed at ~/.config/opencode/skills/risk-scaled-effort/SKILL.md View raw on GitHub ->

Risk-Scaled Effort#

Match effort to risk rather than turning trivial edits into heavyweight quests or rushing high-risk changes.

Classify First#

  • Low risk (typos, small doc clarifications, isolated renames): make the minimal accurate edit, run the targeted check, and finish.
  • Medium risk (standard features, bug fixes, CI updates): inspect callers, agree on seams when non-obvious, write table-driven tests, and run /finish-issue.
  • High risk (auth, secrets/redaction, concurrency, destructive state, public repo/ruleset mutations): gather concrete evidence first, use a stronger reasoning model for /plan and review, verify --dry-run / rollback paths, and get explicit user confirmation before state-changing actions.

Avoid Waste#

  • Do not re-read unchanged files repeatedly in the same session.
  • Do not let a minor review nit trigger an unrequested cross-cutting refactor.
  • Escalate to a stronger model after 2 failed attempts on the same check rather than spinning in retry loops.

2. Design, TDD & Go Engineering#

Used in Step 3 to build clean interfaces, write behavior tests that protect existing code from regressions, and diagnose Go concurrency or performance bugs.

tdd
Use automatically when implementing a feature or fixing a bug: writes one failing test at a public seam first, makes it pass, and refactors (Red -> Green -> Refactor).
Installed at ~/.config/opencode/skills/tdd/SKILL.md View raw on GitHub ->

Test-Driven Development#

Tests verify observable behavior through public interfaces, not private implementation details. Code internals can change completely during a refactor; good tests still pass.

Test at Pre-Agreed Seams#

A seam is the public interface where callers and tests observe behavior without reaching inside. Confirm the public interface and test seams up front before writing tests.

Three Anti-Patterns to Avoid#

  1. Implementation-coupled: mocking private helpers or asserting internal fields so tests break on harmless refactors.
  2. Tautological: recomputing the expected value using the exact formula under test instead of asserting against an independent literal or spec.
  3. All-tests-up-front batching: writing 20 speculative tests up front and then all the code. Work one behavior at a time instead: one failing test -> minimal implementation -> green suite -> refactor -> repeat.

Rules of the Loop#

  1. Red before green: Write one failing test first and watch it fail.
  2. Red must fail for the expected reason: Confirm it fails because the behavior is missing, not because of a syntax or fixture error.
  3. Green means the whole suite: Run the full package/module test and lint suite before moving on.
  4. Refactor after green: Clean up naming and duplication in the touched code while tests stay green before starting the next failing test.
codebase-design
Shared vocabulary for designing deep modules. Use when designing or improving a module's interface, finding deepening opportunities, deciding where a seam goes, or making code more testable.
Installed at ~/.config/opencode/skills/codebase-design/SKILL.md View raw on GitHub ->

Codebase Design#

Design deep modules: substantial behaviour behind a small interface, placed at a clean seam, testable through that interface. The aim is leverage for callers, locality for maintainers, and testability for everyone.

Glossary#

  • Module: anything with an interface and an implementation (a function, struct, package, or workflow).
  • Interface: everything a caller must know to use the module correctly: type signatures, invariants, ordering constraints, error modes, and required configuration.
  • Implementation: the body of code inside a module that hides complexity.
  • Depth: leverage at the interface, meaning the amount of useful behaviour a caller or test exercises per unit of interface they must learn.
  • Seam: a place where you can alter behaviour without editing in that place; the location where a module's interface lives.
  • Adapter: a concrete implementation satisfying an interface at a seam (for example, a real directory reader vs. an in-memory map reader).
  • Leverage: capability gained per unit of interface learned.
  • Locality: changes, bugs, and verification stay concentrated in one place rather than spreading across callers.

Principles#

  • Depth is a property of the interface, not implementation line count. Ask: can I reduce the number of methods, simplify parameters, and hide more details inside?
  • The deletion test. Imagine deleting the module: if complexity disappears, it was a shallow pass-through; if complexity reappears across N callers, it was earning its keep.
  • The interface is the test surface. Callers and tests cross the same seam.
  • One adapter means a hypothetical seam; two adapters mean a real one. Do not invent seams unless something genuinely varies across them (such as production I/O vs. deterministic unit tests, or GitHub Actions vs. Tekton).

Designing for testability#

  1. Accept dependencies, don't construct them internally.
  2. Return structured results, don't hide outputs in side effects.
  3. Keep the surface area small.
gogo-tester subagent
Use when writing, editing, testing, or reviewing Go code, go.mod, go.work, scafctl Go actions, or Taskfiles.
Installed at ~/.config/opencode/skills/go/SKILL.md View raw on GitHub ->

Go Development#

  • Read the repository's AGENTS.md and REVIEW.md first. Discover existing scafctl actions (actions.yaml), Taskfile.yml targets, or Makefile targets rather than assuming command names.
  • Verify command -v go, go version, GOTOOLCHAIN, GOWORK, and go.mod at runtime. Do not rewrite go directives in go.mod casually to match your local machine.
  • Use explicit GOWORK=off when testing standalone modules inside a multi-module repository so tests run against the intended module.
  • Prefer project-defined check commands (scafctl run action ci, task test, task lint). Otherwise run gofmt on changed files, go vet ./..., go test -race ./..., and go build ./.... Never reformat untouched files across the entire repo during a scoped edit, and do not install global tools without asking.
  • Wrap errors with context and %w (fmt.Errorf("...: %w", err)), preserve errors.Is / errors.As behavior, close files/bodies/goroutines cleanly, and propagate context.Context.
  • Write table-driven subtests exercising observable behavior at public seams; avoid introducing external assertion libraries unless the repo already uses them.
  • Break large features into small, independently testable steps. Do not run go mod tidy reflexively unless dependencies actually changed.
  • Debugging: load go-debug. Benchmarks & profiling: load go-perf.
diagnosing-bugs
Structured discipline for hard or flaky bugs: build a tight red-capable feedback loop first, minimize, rank falsifiable hypotheses, use tagged probes, and add a regression test.
Installed at ~/.config/opencode/skills/diagnosing-bugs/SKILL.md View raw on GitHub ->

Diagnosing Bugs#

Never guess at code changes before you can reliably reproduce the failure. Redact any secret or token (<REDACTED>) in captured logs.

Phase 1: Build a Tight Feedback Loop#

Construct one fast, deterministic command (a targeted test, CLI invocation with fixture input, or minimal reproduction script) that goes red on the exact reported symptom and green once fixed. If you cannot build a reproduction loop, stop and ask the user for the missing fixture or environment detail.

Phase 2: Reproduce & Minimize#

Confirm the failure matches the reported symptom and shrink the input and setup until removing anything else makes the failure disappear.

Phase 3: Rank 3 to 5 Falsifiable Hypotheses#

Avoid anchoring on your first hunch. Write 3 to 5 ranked hypotheses with an explicit prediction: "If X is the cause, then Y will happen."

Phase 4: Instrument Cleanly#

Test one variable at a time. Prefix temporary debug logs with a unique tag such as [DEBUG-a4f2] so cleanup is a single grep.

Phase 5: Regression Test, Fix & Circuit Breaker#

  1. Turn the minimized reproduction into a failing test at the public seam.
  2. Apply the minimal root-cause fix and watch the test and full suite go green.
  3. Remove all [DEBUG-...] probes.
  4. Circuit breakers:
    • After 2 failed fix attempts on a fast model, escalate the minimal evidence bundle to a stronger reasoning model.
    • After 3 failed fix attempts, STOP patching and ask the human, as the surrounding abstraction or boundary needs redesign.
go-debug
Use when diagnosing Go panics, data races, deadlocks, hangs, resource leaks, or module/build errors.
Installed at ~/.config/opencode/skills/go-debug/SKILL.md View raw on GitHub ->

Go Debugging#

Adapted from Go debugging notes crediting samber/cc-skills-golang (MIT): https://github.com/samber/cc-skills-golang (see ../../THIRD-PARTY-NOTICE.txt).

  • Reproduce the symptom with a fast, deterministic command before editing code. Rank falsifiable hypotheses, change one variable at a time, and lock the fix in with a behavioral regression test.
  • After 2 failed fix attempts on a fast model, escalate a minimal redacted evidence bundle to a stronger reasoning model; after 3 failed attempts, stop and ask the human.
  • Check typed-nil interfaces, shadowed err variables, defer inside loops, unclosed files/HTTP bodies, slice backing-array aliasing, nil-map writes, and goroutine leaks.
  • Use go test -race for shared-state code and -count=N for suspected flakes; inspect both stacks in a race report.
  • Remember SIGQUIT dumps stacks AND terminates a Go process; prefer an internal net/http/pprof endpoint or dlv on live processes, and never expose pprof publicly.
  • Use go tool pprof for CPU/heap/block/mutex profiles, redact secrets from captured output, and remove temporary debug probes before finishing.
go-perf
Use when profiling Go performance, writing benchmarks, or comparing latency and memory allocations.
Installed at ~/.config/opencode/skills/go-perf/SKILL.md View raw on GitHub ->

Go Performance#

Adapted from Go performance notes crediting samber/cc-skills-golang (MIT): https://github.com/samber/cc-skills-golang (see ../../THIRD-PARTY-NOTICE.txt).

  • Define the target metric, profile the real workload, and record repeated baseline benchmarks before optimizing: go test -run '^$' -bench BenchmarkName -benchmem -count=6 ./...
  • Change one variable at a time on the same hardware and Go version, and compare runs with benchstat when available; never claim wins from a single sample.
  • Distinguish allocation rate (B/op, allocs/op) from retained heap. Remember CPU profiles miss off-CPU lock contention and I/O waits, so inspect block and mutex profiles when latency exceeds CPU time.
  • Require measured workload evidence before tuning GOGC or GOMEMLIMIT.

3. Pre-PR Self-Review, Bounded PR Loop & Human Merge Walkthrough#

Used in Steps 4 and 5 (and at the end of Herdr waves) so the AI audits its own branch locally before pushing, drives GitHub Actions CI + GitHub Copilot reviews without burning quota, and briefs you on ready PRs one at a time before you click Merge.

finish-issue/finish-issue
Use automatically before pushing or opening a pull request (or via /finish-issue): runs static checks, dispatches code-reviewer and artifact-auditor IN PARALLEL over the branch diff, fixes defect classes in one pass, and runs final lint.
Installed at ~/.config/opencode/skills/finish-issue/SKILL.md View raw on GitHub ->

Finish-Issue Pre-PR Self-Review Gate#

Run this gate automatically on your feature branch before pushing and opening a pull request (or against uncommitted changes when asked directly). Deterministic checks (go test -race, linters, gosec) run free on your CPU, and catching defects before opening the PR saves CI minutes, GitHub Copilot PR review credits, and human review time.

Phase 1: Build, Test & Static Security Scan#

  1. Inspect git status --short and the diff (git diff if uncommitted, or git diff origin/main...HEAD on a committed feature branch). Stop if empty.
  2. Run the repository's build and test commands (scafctl run action ci, task test, or go test -race ./...). Fix any red test first.
  3. Run local static security checks (gosec ./... for Go repos) and smoke-test CLI --help + one valid and one invalid invocation when CLI flags changed.

Phase 2: Parallel Review Over One Frozen Diff#

Dispatch code-reviewer and artifact-auditor in parallel in a single turn over the same diff:

  • Standard diff (<= 800 changed lines): 1 code-reviewer + 1 artifact-auditor.
  • Large or security-sensitive diff (> 800 lines or auth/concurrency/secrets): fan code-reviewer out into 3 focused parallel lenses alongside artifact-auditor:
    1. Callers, Flags & Upstream Contracts ($GOMODCACHE / cross-repo grep)
    2. Security, Trust Boundaries & File Modes
    3. Concurrency, Resource Lifecycle & Test Reality

Phase 3: Merge & Fix Defect Classes#

Merge all findings into one list before editing:

  • Fix every BLOCKER and MAJOR issue and every real missing artifact.
  • Fix the defect class, not just the single line: whenever a finding has sibling occurrences elsewhere in the diff, fix all of them in the same pass.
  • Pause and ask the human whenever a finding involves a real design or API trade-off rather than a clear bug.

Phase 4: Final Lint & Summary#

Re-run the repository's tests and linter on the final diff, then summarize findings resolved, artifact status, and verification output. Never commit or push automatically inside this gate.

git-github-workflow/pr-create | /pr-review
Use when creating branches or worktrees, writing signed Conventional Commits, opening squash-merge PRs, syncing PR bodies, inspecting all four GitHub PR feedback surfaces, and running bounded GitHub Copilot review loops with cost guards and circuit breakers.
Installed at ~/.config/opencode/skills/git-github-workflow/SKILL.md View raw on GitHub ->

Git, GitHub PR & Copilot Review Loop Workflow#

1. Issues, Branching & Signed Commits#

  • Issue tracking: Pair with create-issue and the matching tracker skill (github-issues for GitHub Issues, jira-issues for Jira tickets via MCP, or local-issues for temp/issues/<NNN>-<slug>.md).
  • Branch naming: <type>/<issue-id>-<slug> (for example, feat/42-repo-readiness, feat/PROJ-123-expiring-links, or feat/001-expiring-links) or <type>/<slug> when no issue exists.
  • Isolated worktrees: For parallel or disturbance-free work, create a sibling worktree (git worktree add ../<repo>-worktrees/<slug> -b <branch>) and start your coding session rooted inside that worktree so LSP and git state stay isolated. When working from a git-ignored local issue (temp/issues/<NNN>-<slug>.md), copy that file into <worktree-path>/temp/issues/ after creating the worktree.
  • Conventional commits + signing: Format subjects as <type>(<optional-scope>): <summary> and sign commits with DCO sign-off when supported (git commit -s -S). Never run git commit --amend on published commits.

2. Squash-Merge PR Body Synchronization#

Repositories configured with squash_merge_commit_title=PR_TITLE and squash_merge_commit_message=PR_BODY build the permanent main commit from the pull request title and body (discarding branch fixup commit messages):

  1. Keep the PR title a valid Conventional Commit subject.
  2. Whenever a new commit changes behavior, flags, or files on the branch, update the PR body in the same step (gh pr edit <N> --title ... --body ...) based on git log <base>..HEAD and git diff --stat <base>...HEAD.

3. Reading All Four GitHub PR Feedback Surfaces#

Never assume gh pr view shows all review feedback. Always check all four:

  1. Inline review threads (GraphQL): returns id, isResolved, isOutdated, file path, line, and comments:
    gh api graphql -f query='
      query($owner:String!, $repo:String!, $pr:Int!) {
        repository(owner:$owner, name:$repo) {
          pullRequest(number:$pr) {
            reviewThreads(first:100) {
              nodes {
                id isResolved isOutdated path line
                comments(first:20) { nodes { author { login } body createdAt } }
              }
            }
          }
        }
      }' -F owner="$OWNER" -F repo="$REPO" -F pr="$PR_NUM"
  2. Review bodies (gh api repos/$OWNER/$REPO/pulls/$PR_NUM/reviews): Copilot often places summary remarks or collapsed <details> findings in the top-level review body with zero inline threads.
  3. General PR comments (gh api repos/$OWNER/$REPO/issues/$PR_NUM/comments): bot reports, coverage gates, and maintainer notes.
  4. CI check runs (gh pr checks $PR_NUM): required build, test, and security statuses on HEAD.

4. Reply & Resolve Are a Pair#

When addressing or politely declining an inline review thread, reply inside that thread AND resolve it via GraphQL (resolveReviewThread) in the same pass, except when promising a code fix that has not been pushed yet. Re-query GraphQL to confirm isResolved: true. Resolving a nit or decline thread does not push a commit or spend another review round.

5. GitHub Copilot Review Cost Guardrails & Circuit Breakers#

Repeatedly triggering AI PR reviews on every push burns GitHub Copilot premium request quota fast and creates noisy review churn. Enforce these guardrails:

  1. Repo ruleset (review_on_push: false): Configure Copilot to review ready-for-review PRs once on open (review_draft_pull_requests: false), never automatically on every push.
  2. Local /finish-issue Before PR Open (0 PR quota): Catch bugs, missing tests, and gosec issues locally before Round 1 ever runs.
  3. CI-Green First: NEVER request a Copilot re-review immediately after git push. Wait until 100% of GitHub CI checks on HEAD finish green so broken builds spend zero Copilot credits.
  4. Smart Post-Round-1 Re-Review Gate:
    • Pure rebase or docs-only delta after No issues found: Do not re-request Copilot (0 Copilot review credits).
    • Code fix addressing prior Copilot findings: Batch all mechanical fixes into one locally reviewed commit + PR body sync, wait for green CI, and then request a Copilot re-review (gh api -X POST repos/$OWNER/$REPO/pulls/$PR_NUM/requested_reviewers ...) so Copilot verifies <last_reviewed_sha>..HEAD per REVIEW.md and clears Changes recommended.
  5. Quota-Error Guard: If a Copilot review body contains "unable to review" or "insufficient remaining quota", treat it as an unreviewed blocker and notify the human rather than treating it as No issues found.
  6. Three-Round Circuit Breaker & Human Stops:
    • Design questions (Actionable-Design): Stop immediately and ask the human whenever a comment raises an API, scope, or architecture choice.
    • Max 3 fix rounds (STALEMATE): If a PR still has unresolved findings or failing checks after 3 fix rounds, STOP looping and surface it to the human (or run /review-buster for a root-cause reset).
    • Never auto-merge: Never run gh pr merge without explicit human instruction.
pr-autopilot/pr-autopilot | waiter subagent
Autonomous GitHub PR review and CI convergence loop: polls all four PR feedback surfaces, batches mechanical fixes into one push + PR body sync, resolves nits without pushing, protects Copilot quota, and stops when merge-ready, blocked, or at 3 strikes. Never merges.
Installed at ~/.config/opencode/skills/pr-autopilot/SKILL.md View raw on GitHub ->

PR Autopilot: Autonomous PR & Copilot Convergence Loop#

Drive an open GitHub pull request to a clean, merge-ready state without wasting GitHub Copilot review quota or spinning in endless fix loops. Composes with git-github-workflow and waiter.

Hard rule: NEVER run gh pr merge or dismiss reviews. Your only terminal outcomes are Merge-Ready (DONE), Pause for Human Decision, or Stalemate (3-strike / safety cap).

Phase 0: Target & Reviewer Probe#

  1. Resolve <owner>/<repo> and <PR> (gh repo view --json owner,name and gh pr view --json number,url,isDraft,headRefName,headRefOid,reviewDecision,reviewRequests,reviews).
  2. Verify GraphQL reviewThreads enumeration and resolveReviewThread capability are available before starting.
  3. Probe whether GitHub Copilot reviews this repo (copilot-pull-request-reviewer in reviews, reviewRequests, or recent repo PRs). If the PR is a draft with no bot review, converge on CI and human threads only and report draft status at exit (never run gh pr ready unilaterally). If Copilot is active on the repo but unrequested on a ready PR, request once (gh pr edit <PR> --add-reviewer @copilot).
  4. Default bounds: base_interval = 60s, max_iterations = 60, max_runtime = 2h (or caller-supplied bounds such as 30 / 45m inside a Herdr worker).

Phase 1: Read All Four PR Surfaces (Every Cycle)#

  1. Check gh api rate_limit first; back off cleanly if < 15% remaining.
  2. Fetch all four surfaces (always --paginate REST list endpoints):
    • Inline review threads (GraphQL reviewThreads): id, isResolved, isOutdated, path, line, and comments.
    • Review bodies (gh pr view --json reviews,headRefOid,reviewDecision): parse collapsed <details> findings (Suppressed comments, Previously missed, needs a closer look) and file:line items in the latest valid copilot-pull-request-reviewer review. Quota-error guard: NEVER treat a review body containing "unable to review" or "insufficient remaining quota" as a clean review; latch rerequest_blocked = true and surface it if Round 1 never ran.
    • General PR comments (repos/$OWNER/$REPO/issues/$PR/comments --paginate): CI bots, policy checks, and maintainer notes.
    • CI check runs (gh pr checks <PR>): track unchanged pending checks across cycles to detect stuck non-moving gates.

Phase 2: Classify Every Item Before Acting#

CategoryMeaningAction
Nit / Question / Already addressed / Disagree / OutdatedNon-blocking wording, answered question, or stale noteAuto: reply with clear reasoning + resolve via GraphQL (no push)
Actionable-MechanicalBounded bug, missing nil/error check, missing test, security scanner fixAuto: fix locally, batch into one verified commit + push + PR body sync
Actionable-Design / AmbiguousPublic API shape, breaking change, repo/policy setting, or 2+ valid designsSTOP & Ask Human (after handling routine nits/mechanicals in this fetch)

3-strike circuit breaker: Stop and escalate to the human (or suggest /review-buster) if the same finding/check fails after 3 fix attempts or a fix introduces more errors than it resolves. Security scanner findings are always actionable (never dismissed as nits).

Phase 3: Batch Push & Copilot Credit Gate (review_on_push: false)#

  1. Apply all Actionable-Mechanical fixes in the cycle first, run the repo's build/race-test/lint/gosec checks + local code-reviewer check on the fix, sign-commit once (git commit -s -S), git fetch && git rebase onto default branch, push once, sync the PR title/body (git-github-workflow), and reply + resolve fixed threads.
  2. Never request Copilot immediately on git push:
    • Wait (via the waiter subagent or one bounded shell poll without per-minute context spam) until 100% of required CI checks on HEAD finish green so broken builds spend zero Copilot credits.
    • Pure rebase / lockfile / docs-only delta after No issues found: Do not re-request Copilot; record minor_delta_verified_head = HEAD.
    • Code fix addressing prior findings: Once CI is 100% green, request one Copilot re-review (POST repos/$OWNER/$REPO/pulls/$PR/requested_reviewers with reviewers[]=copilot-pull-request-reviewer[bot]) so Copilot verifies <last_reviewed_oid>..HEAD per REVIEW.md and clears Changes recommended.

Phase 4: Drain Check & Terminal Report#

Before declaring Merge-Ready (DONE), refresh live PR state and confirm:

  • Required CI checks on HEAD are finished and green.
  • 0 unresolved GraphQL review threads and 0 open Copilot review-body findings.
  • Copilot's timeline (repos/$OWNER/$REPO/issues/$PR/timeline --paginate) shows no in-flight review_requested or copilot_work_started after its latest reviewed event, and the latest valid review covers HEAD (or covers the prior round + locally verified rebase/minor delta).

Emit a concise terminal summary with the full PR URL, per-finding dispositions (<id> -> fixed <sha> | declined | answered), CI status, and bot coverage [review <oid> | HEAD <headOid>], and let the human review and click Merge.

last-look/last-look | 1 PR per turn
Use when the user sits down to review or merge ready PRs, asks 'walk me through the PRs to merge' or 'are these ready to merge', or runs /last-look. Verifies live CI, review history, and 3-way mergeability, then briefs strictly one PR per turn in plain English.
Installed at ~/.config/opencode/skills/last-look/SKILL.md View raw on GitHub ->

Last Look: One-at-a-Time Human Merge Walkthrough#

Guide the human owner through ready pull requests one at a time so they can make a confident merge, trim, or hold call in ~60 seconds without scrolling dozens of test files. Complements pr-review (line-level defect hunting) by serving the final human ownership decision after pr-autopilot or local review converges.

Rules of Engagement#

  • One PR per turn. Even when 5 PRs are ready, present a 1-line queue header (### 1 of 5: ...), brief only the current PR, and stop for the human's response (merged, next, trim <X>, retrigger, skip, hold).
  • Plain, everyday English. Write in clear, everyday English rather than compressed shorthand: explain outcomes from a user's, operator's, or caller's perspective instead of reciting internal struct, helper, or variable names.
  • Never merge. gh pr merge is forbidden; the human clicks Merge in the GitHub UI.

Step 1: Verify Live Ground Truth (Never Trust Memory)#

Before presenting a PR, verify every fact from live command output on current HEAD:

  1. PR & review state: Fetch live CI checks, unresolved GraphQL thread count, review coverage on headRefOid, PR_TITLE / PR_BODY, baseRefName, and headRefName (gh pr view, gh pr checks, and gh api graphql), then fetch both refs (git fetch origin <base> <headRefName>) and set <pr_head> to origin/<headRefName> (or <headRefOid> for fork PRs via git fetch origin pull/<num>/head) so commands work whether run inside a feature branch or from a main Coordinator checkout.
  2. Prod vs. test size & review history: Run git log --stat --oneline origin/<base>..<pr_head> and git diff --numstat origin/<base>...<pr_head>. Separate production LOC from test/doc LOC, and separate the initial implementation commit(s) from post-review fix commits.
  3. Fresh base-branch conflict check: Run a read-only 3-way merge check (git merge-tree --write-tree <pr_head> origin/<base>) to catch physical conflicts and semantic collisions with recent <base> commits before the human clicks Merge. Note any file overlap with sibling open PRs in the queue.

Completion criterion: every number, check status, and conflict claim in the brief comes from live command output on current HEAD.

Step 2: Present the Single-PR Brief#

Render one scannable card (omit Deferred / shortcuts when empty):

### <k> of <N>: [<owner>/<repo>#<num>](<url>) | <plain-English summary>

- **What it does**:
  Plain-English explanation of what changes for users, operators, or callers.
- **Still needed & size**:
  Why the problem still matters on current `<base>` + size split (`+P/-M` prod,
  `+T/-U` tests/docs across `F` files).
- **Breaking changes & new surface**:
  Any `!` breaking behavior shifts, new CLI flags/commands, config/schema keys,
  public API symbols, dependency additions, or `.github/workflows` edits (`None,
  internal only` when none). Flag missing `!` on breaking conventional-commit
  titles.
- **Review drift & bloat**:
  Commit 1 vs. `HEAD`: did review rounds fix real bugs or add defensive
  over-engineering? Call out removable bloat and any **declined review threads**
  where human judgment could differ.
- **Blast radius & spot-check files**:
  `Low` / `Medium` / `High` (what breaks if a subtle bug slips through) plus
  clickable links to the **1 to 2 core files** where the real logic lives.
- **Deferred / shortcuts**:
  *(Include only when non-empty)* Scope punted from the issue, `TODO`s left
  behind, or follow-up work assumed.
- **Merge gate**:
  CI status (distinguishing real failures from hung external webhooks), review
  coverage on `HEAD`, **squash-commit check** (PR title and body accurately
  match `HEAD`), and 3-way conflict result against `origin/<base>`.

Ready to merge `#<num>`, trim anything, or skip to next?

Stop calling tools and end the turn.

Step 3: Between Merges ("merged" / "next")#

When the human reports "merged":

  1. Confirm state == MERGED on GitHub (gh pr view <num> --json state).
  2. If a local or Herdr linked worktree exists for the merged branch, verify it has no uncommitted changes, remove it cleanly, and fast-forward the local <base> checkout (git fetch origin <base> && git merge --ff-only origin/<base>).
  3. Re-run Step 1 (especially git merge-tree --write-tree <next_pr_head> origin/<base>) on the next PR against the newly updated <base>, then present the next brief.

4. Security Auditing & Public Repo Hygiene#

Loaded when auditing a repository for vulnerabilities, reconciling scanner or pentest findings via reproduce-or-retract, fixing auth/credential flaws inline, or scrubbing private details before publishing to a public repo.

security-auditsecurity-auditor subagent | reproduce-or-retract
Use when auditing code for vulnerabilities, evaluating a pentest report, judging whether a suspected leak is real, or fixing an auth, credential, or multi-tenant flaw inline. Enforces reproduce-or-retract proof and checks structural bug classes static review misses.
Installed at ~/.config/opencode/skills/security-audit/SKILL.md View raw on GitHub ->

Security audit#

Static reading generates hypotheses. It does not generate findings. A finding is a hypothesis you reproduced, and credibility dies the first time someone disproves a reported vulnerability by running it.

This skill is the shared methodology. Two contexts use it:

  • Audit: a read-only sweep of a codebase producing a findings doc. The security-auditor agent owns that workflow; it loads this skill for the bug classes and the proof discipline below. The security-sweep skill is the end-to-end entry point that pairs the agent with a scanner battery.
  • Inline: you are reviewing or writing code and intend to fix what you find. Same proof discipline, different endgame: see "Fixing inline".

Reproduce or retract#

Build the code and exercise the path with a canary value before calling anything a finding. A hypothesis you could not reproduce is reported as suspected, unconfirmed, never as a finding.

Scale the ceremony to the context: an audit reproduces every hypothesis end-to-end; inline, a five-line direct call against the suspect function is usually proof enough. What does not scale down is the rule that something unproven is never stated as fact.

Establish the trust model before rating#

Frame by trust boundary, not severity. Ask which boundary a hypothesis crosses if true (typically: execute code on the host, reach server credentials, or reach other users' data or credentials). A hypothesis crossing no boundary is not a finding.

Which boundaries exist is a property of the system's purpose, so read for that purpose before rating anything. A capability is not a vulnerability: a service designed to execute submitted code is no more "vulnerable to RCE" than a CI runner is. Reporting a product's stated function as its worst finding buries the real one.

Answer three questions from the repo itself (design docs, command help, config defaults, and shipped deployment artifacts) before any severity leaves your hands:

  • What is the default exposure? Bind address, auth default, and whether any Dockerfile, chart, or manifest ships something more exposed than that default. A loopback-bound default is a real mitigating control; so is shipping no deployment artifact at all.
  • Is the dangerous capability the product's stated purpose? If yes, the finding is the missing boundary around it (who may invoke it), not the capability.
  • What do the docs promise operators? Every security claim in the documentation is a control you must verify exists.

Rate against a public scale (OWASP API Top 10, CWE, CVSS vectors) and name the posture you rated. A finding that is severe once exposed and moot on loopback must say both halves.

Severity is never inherited. Prior art (another repo's issue tracker, a past audit, or a sibling codebase) generates hypotheses, never ratings. That system's defaults, exposure, and purpose differ from this one's. Re-derive every rating here; importing one is how an industry-normal practice gets reported as a vulnerability.

Reading a canary#

A canary in the output only proves a leak if the code under test put it there.

Before believing one, ask: did my own harness plant this? A test upstream that echoes the caller's token, a fixture writing the secret into the response, or a template whose data context already holds the value each manufactures a convincing false positive. Re-run with the harness's copy removed; if the canary still appears, it is real.

Distinguish leaking a credential from leaking the data that credential unlocked. They carry different severities and are trivially conflated.

Bug classes to check explicitly#

These survive diff review because no single diff contains them.

  • Guard with an escape hatch. When a boolean gates a credential path, confirm every fallback sits inside the guard. A fallback after the else silently defeats it. Prove it with a direct call at both boolean values.
  • Guard whose unconfigured default protects nothing. A merged fix that defaults to audit/log-only, or that each call site must opt into. Read the shipped default and the deployed configuration before accepting that a finding is closed; "fixed in code" is not "fixed".
  • Shared cache keyed without identity. In an authenticated service, a cache keyed by URL or resource ID alone serves user A's response to user B. Check the key derivation, whether authenticated responses are cached at all, and whether upstream Cache-Control / Vary is honored or overridden. Prove with two requests, differing credentials, and one hit counter.
  • Process-global state holding per-caller data. Package-level vars, singletons, and long-lived maps that touch tokens. Per-request construction is the safe pattern; confirm it rather than assume it.
  • Unsafe-by-default constructor. A helper whose default return is the dangerous variant, so every caller must opt out. Inventory all call sites; the bug is the ones that forgot. Check git log -S for a prior fix that regressed, because an unguarded control drifts back.
  • Confused deputy. Any endpoint where the server acts with its own identity on caller-supplied input. Ask what the caller can make the server do, not only what they can read.
  • Forwarded identity headers. The confused-deputy class covers the server's own credential; this one covers headers the caller makes the server send. Check every server-originated outbound request for inbound headers forwarded verbatim (Authorization, Cookie, X-Forwarded-*, X-Authenticated-*) where the upstream ends up attributing the request to an identity the caller chose.
  • Authentication without authorization. Verify a real per-route scope check exists, not just a valid-token check. Read the middleware for commented-out scope logic and for one flat scope covering every route.
  • Documented control that does not exist. A control promised in the docs but absent from the code is worse than an undocumented gap: operators read the promise and provision around it, so the gap ships with false assurance attached. Grep the documentation for every security claim (auth requirements, role checks, loopback restrictions, redaction, allowlists) and verify each against the implementation. A doc table describing an access-control matrix is a checklist, not evidence.
  • Handler defined but never wired. A function that looks like a live endpoint (Register*Route, a Huma operation, a Cobra command) is not a finding until you confirm it is actually registered in the startup sequence. Diff every handler or route function against what the server actually calls at boot before auditing it, because dead code treated as live attack surface is one of the most common audit false positives.
  • Interpreter capability inventory. For every expression language, template engine, or action runner reachable from a request, enumerate every registered function or action and check each for server-mode gating, not just the ones a prior finding named. Debug helpers and file or deploy actions regularly survive a narrow sandbox fix this way.
  • Availability budget. What one request can make the server spend: uncapped sleep or loop primitives, context-unaware waits, unbounded body reads, missing server and per-request deadlines, a rate limiter constructed but never attached to any handler, or one keyed on a spoofable client IP.
  • Partially fixed finding. The reported trigger is closed while the root cause lives on (for example, a length limit raised so a credential no longer fails validation, while validation errors still echo the submitted value). Re-derive the root cause before accepting a fix as closing a finding; re-running the original trigger proves only the trigger.
  • Arbitrary read: inventory everything mounted. After proving a file-read primitive, enumerate everything it can reach (mounted secrets, env vars, projected tokens) and any token-exchange chain to cloud credentials (for example, a projected token exchanged via workload identity federation). Remediation then includes rotation and an audit-log review, not just the code fix.

Non-findings#

Reporting these burns the reader's trust in everything else:

  • A caller supplying their own credential and receiving their own access. That is the passthrough model working.
  • Secrets exposed only to whoever already supplied them.
  • A "leak" of a file path rather than the file's contents.
  • Theoretical reachability with no reproduction and no stated reason it could not be reproduced.
  • The industry norm. Check the deviation against what comparable systems actually do before calling it a defect. Unauthenticated metrics endpoints, for instance, are standard practice (controlled by network placement and a separate listener rather than auth), so "metrics is unauthenticated" is a hardening observation at most, and the real question is whether the operator can bind it somewhere isolated.

Say explicitly that these were excluded, so the reader knows they were considered rather than missed.

Before testing a URL/host-shaped parameter#

Trace where it actually goes before pointing a live payload at it. A parameter that looks like a pass-through (baseUrl, targetUrl) may be assigned to a local variable and never threaded into the client that does the real fetch. Firing a live SSRF probe before confirming this hits whatever the hardcoded default points at, which can be a real production endpoint. One code-read is cheaper than one accidental request to prod.

Sweep for siblings of every already-fixed pattern#

A shipped fix protects the call site someone was looking at, not the pattern. Once you know a pattern was fixed anywhere (a prior commit, a PR, even a fix you just made this session), treat that as a lead, not a closed case: enumerate every other call site of the same underlying primitive and check each one for the same protection. Real vulnerabilities routinely hide in sibling paths: for example, a credential-fallback gate applied to one function but not its near-identical sibling in another file, or a URL-rejection check applied to one fetch path but not a second field fetched through the same underlying function.

Concretely: grep every caller of the guarded primitive (not just the one name-checked in the fix's commit message), and for each one ask "does this call site have the same guard, or does it call the dangerous function directly?" A clean sweep (every sibling protected) is a valid, useful result; report it as such rather than manufacturing a finding to justify the pass.

Live-verifying against shared infrastructure#

Reproducing locally proves the code has the flaw. It does not prove a specific shared, staging, or production system is still running that code or still configured that way, and closing that last gap is not yours to do unilaterally. Never send a live exploit payload to shared infrastructure using a credential you obtained yourself, and never try to obtain one to force the point. That request needs the same sign-off a pentest would.

Instead, hand the human a self-contained script they run with their own credential:

  • Requires an explicit typed confirmation before it sends anything.
  • Never prints a raw secret value: compare in-process (auth == expected) and log only booleans or lengths so the transcript itself cannot leak whatever the test retrieves.
  • Reports three states, not two: CONFIRMED, REFUTED, and INCONCLUSIVE. A network path that never delivers a callback (a firewall, or a workstation unreachable from the server's side) is not the same as "the bug is not there"; collapsing that distinction turns an unrelated network gap into a false all-clear.
  • If a preliminary check only proves the attack surface exists (endpoint live, accepts the input shape) rather than the dangerous outcome itself, label that result narrowly. A reachability check succeeding is not the same claim as the exploit succeeding, and calling both "CONFIRMED" invites legitimate pushback because the label overreached.

Verify severity claims before they leave your hands#

A CRITICAL/HIGH claim, whether your own or a subagent's, gets one more gate before it goes in the doc: reproduce it yourself, not just re-read the trace that produced it. Two independent traces agreeing is not the same as a third-party execution. This is the same reproduce-or-retract rule above, applied specifically to the highest-severity bucket where being wrong costs the most credibility.

Fixing inline#

When the intent is to fix rather than report:

  • Keep the reproduction as a regression test. This is the main divergence from audit mode, where exploit tests are scratch and deleted. A credential or multi-tenant bug with no test guarding it drifts back, which is why the unsafe-by-default class above exists.
  • For a mode-gating fix, prefer a golden-list inventory test. A CI test that lists every registered function, action, route, and read path, each classified server-safe or server-denied, fails when a new registration lands unclassified. This is a stronger control than any review-time prompt, and the one that keeps debug helpers and deploy actions from drifting back into reach.
  • Fix the default, not the call site. If a constructor returns the dangerous variant, changing the two callers you found leaves the next caller exposed. Invert the default and make the dangerous path opt-in.
  • Check whether the fix breaks existing callers, and say so. Closing a confused deputy turns a working tokenless request into a 400 for whoever relied on it.
  • Sweep for siblings before declaring it fixed (see "Sweep for siblings" above; the same discipline applies to a fix you just wrote, not only to a codebase-wide audit).

Consolidating findings across multiple passes#

A multi-pass or multi-agent audit tends to produce one narrative doc per pass plus a running claim of "added to the plan." That claim is not true until verified: grep the actual plan file for the fix number in the same turn you claim to have added it. A single authoritative fix-tracking document, merged into immediately rather than deferred, beats several supplement docs each asserting a merge that never happened.

security-sweepgovulncheck | gosec | trivy | gitleaks
Use when asked to security-sweep, scan, or audit a whole repo end to end, or reconcile an external pentest report. Pairs a scanner battery (govulncheck, gosec, trivy) with security-auditor, proves every hit via reproduce-or-retract, and drafts confirmed findings.
Installed at ~/.config/opencode/skills/security-sweep/SKILL.md View raw on GitHub ->

Security sweep#

The entry point for a whole-repo audit. Two engines run side by side:

  • Scanners find the mechanical classes fast: known-vulnerable dependencies, risky API use, committed secrets, and misconfigured manifests.
  • The security-auditor agent finds what no scanner models: trust boundaries, authz gaps, and multi-tenant leaks.

Neither engine's output is a finding. A scanner hit is a hypothesis, exactly like a line of suspicious code: it becomes a finding only once reproduced, per the security-audit skill. Load that skill now; this one covers only the orchestration around it.

1. Scope#

Confirm with the user, or state as assumptions:

  • the repo or path, and which modules are in scope (go.mod locations, skipping vendor/ and testdata/);
  • the trust boundaries (default three: code execution on the host, server credentials, and other users' data or credentials);
  • a scratch directory OUTSIDE the repo for scanner output, the findings doc, and issue drafts (unfixed-vulnerability writeups are never committed).

Done when: scope, boundaries, and the scratch path are stated in chat.

2. Check the tools#

command -v govulncheck gosec trivy gitleaks

For each missing tool, give the user its install command and ask; never install without asking. Proceed with what is present and record every skipped scanner; the doc must say what was NOT scanned. Non-Go repos: trivy fs still covers dependencies, secrets, and manifests; add the ecosystem's own audit (npm audit, pip-audit) if installed.

Done when: each scanner is marked present, installed-with-consent, or skipped.

3. Run the battery and the auditor in parallel#

Dispatch the security-auditor agent with the scope and boundaries from step 1, telling it the scanners run separately so it spends its pass on logic, not on re-running them. While it works, run the battery (outputs to the scratch dir):

# <module-id> = the module's path with "/" replaced by "-" (nested modules
# like services/api would otherwise break the report path). Run each from
# the module's directory.
(cd <module> && govulncheck -format json ./... > <scratch>/govulncheck-<module-id>.json)
(cd <module> && gosec -fmt=json -out <scratch>/gosec-<module-id>.json ./...)
# repo root
trivy fs --scanners vuln,misconfig,secret,license --format json -o <scratch>/trivy.json .
# optional, ask first: walks all of git history (gitleaks >= 8.19)
gitleaks git --report-path <scratch>/gitleaks.json .

Classify each exit code against the tool's documented set. An exit code inside the set means the scan completed (findings or not): gosec and gitleaks 0/1, govulncheck 0 in JSON mode (3 in text mode means findings), trivy 0. An exit code outside the set is a failed scan even if a report file exists (a scanner killed mid-run can leave truncated output); treat a missing, empty, or unparseable report the same way, and say so in the coverage section. If gitleaks is skipped, git history was not scanned for secrets (trivy fs sees only the working tree) and the coverage section must say so.

A harness without subagents runs the battery first, then follows the security-auditor agent's procedure inline.

Done when: every scanner has exited (record each exit code and tool version) and the auditor has returned.

4. Triage every scanner hit#

Dedupe across scanners, then put each hit in a bucket:

  • Dependency vuln. govulncheck separates vulnerabilities your code calls from ones merely imported (in its JSON, a finding whose trace names a function is called; module- or package-level only is imported). Only called ones are finding candidates: confirm the affected version is the one in use and name the fixed version. Imported-only is dependency hygiene, listed separately.
  • Code-pattern hit (gosec). Read the code. Most hits cross no trust boundary (unchecked errors, a file path from a CLI flag the operator already controls). Keep only those that would cross one, and hand that shortlist to the auditor (resume its session) for reproduce-or-retract; do not rate them from the scanner's severity.
  • Secret hit. Verify it is a real credential, not a test fixture or a placeholder. A real one is a finding even if a later commit deleted it, because git history keeps it; the fix is rotation, not deletion. Never paste the value; record its name, file, and commit.
  • Misconfig hit (Dockerfile, Kubernetes, Terraform). Check whether the deployed configuration actually carries it before rating.
  • License hit. Not a security finding; a separate list for the owner.

Done when: every hit sits in exactly one bucket: confirmed (with reproduction), suspected (with why it could not be run), disproved (with the evidence), hygiene, or license.

5. Reconcile an external assessment#

Run this step when a red-team or pentest report exists for the repo, since the sweep is often driven by one and the reconciliation is where most of its value lands. An external report's findings are hypotheses like any scanner hit: same trust boundaries, same reproduce-or-retract.

  1. Convert the report to markdown (e.g. pandoc) for grep-ability, into the scratch dir from step 1 with restrictive permissions. Assessment reports are usually classified: never commit one, and remove the converted copy when the reconciliation finishes.
  2. Pin two deployment states separately: the assessed code revision and the versions deployed during testing (the assessment baseline, since a fix merged after that revision cannot be credited by the report), and the versions currently deployed in each environment (remediation status now).
  3. Bucket every finding: fixed (merged, verified in code, and running in the currently deployed versions from step 2; a fix the deployments do not contain yet is tracked, not fixed), known / tracked, declined by design (requires a written risk acceptance, not just a closed issue state), untracked / news. Untracked findings go through step 4's triage like any other hypothesis before becoming findings.
  4. Cross-reference each bucket against PRs, issues, and the tracker; flag state disagreements where a tracker claims fixed while the code says otherwise.
  5. Re-verify every "fixed" claim against current code, because claims read from issue titles alone are often wrong.
  6. Feed the misses back: every class the external team found that this sweep's own pass missed becomes a candidate addition to the security-audit skill's bug-class list. File that or say so in the report.

Done when: every finding sits in exactly one bucket, every "fixed" claim has been re-verified in code, and the misses are recorded as feedback.

6. One findings doc#

Merge into the auditor's doc (its format: per-boundary answers, confirmed / suspected / disproved). Add a Scanner coverage section: tool, version, exit code, hit counts per bucket, and every skipped scanner. Add the reconciliation buckets when step 5 ran. Summarize dismissed noise by rule ID and count, not hit by hit, so the reader knows it was considered without re-reading noise.

Done when: grepping the doc finds every confirmed finding and the coverage section (verify rather than assuming the merge landed).

7. Issue drafts#

One draft per confirmed finding, in the scratch dir, in the create-issue skill's draft shape (reproduction and actual output, no secret values). Suspected findings stay in the doc unless the user asks for drafts. Filing follows the create-issue skill's flow: show the drafts, and file only on the human's go, asking whether any finding should be a private security advisory instead of a public issue.

8. Report#

Per-boundary verdicts, confirmed findings in priority order, the doc and draft paths, and the coverage gaps (skipped scanners, unreachable deployments). With a reconciliation: its buckets and the classes this sweep missed. Say plainly when a boundary came back clean.

publish-hygienepublic repo scrubber
Use before posting or committing to any public repository (issues, PRs, commits, docs, or skills) to scrub secrets, local home paths (/home/<user>), private hostnames, internal tool names, and non-public organization details.
Installed at ~/.config/opencode/skills/publish-hygiene/SKILL.md View raw on GitHub ->

Public Repository Publish Hygiene#

Contributors work from many different employers, personal machines, and local tooling setups. None of that private context belongs in anything published to a public repository: GitHub issues, PR titles and bodies, PR or issue comments, commit messages, or committed docs, examples, tests, and config files.

This checklist is intentionally organization-agnostic so you can apply it regardless of which machine or employer environment you are working from.

When to Run This Check#

Run before any of these actions on a public repository:

  • Creating or commenting on a GitHub issue (create-issue, github-issues)
  • Opening a pull request or updating its title or body (pr-create, pr-autopilot)
  • Writing a commit message or running finish-issue
  • Adding or editing committed docs, examples, fixtures, skills, or configs

What to Scrub#

  • Credentials and secrets: API keys, tokens, private keys, cloud project IDs tied to private accounts, or connection strings.
  • User-specific filesystem paths: /home/<username>, /Users/<username>, C:\Users\<username>, or WSL mount paths baked into examples or logs.
  • Internal infrastructure: private domains, internal hostnames, cluster or environment names, internal registries, VPN names, or private IP ranges.
  • Organization & identity details: non-public company or team names, internal product codenames, corporate email domains, SSO tenant IDs, or employee IDs.
  • Screenshots, logs, and pasted output: inspect visually as well as with grep, since command output frequently bakes in hostnames, usernames, or internal URLs.

How to Scrub Without Losing Technical Meaning#

Replace identifying details with neutral placeholders while keeping the technical substance reproducible:

  • Specific company or org -> example-corp or Acme
  • Internal domain or registry -> example.com, internal.example.com, registry.example.com
  • Local home path -> ~/my-repo or /path/to/repo
  • Internal tool codename -> a plain description of its role (for example, "the internal CI runner")

Quick Self-Check Before Publishing#

  1. Would every line make sense to an external reader with zero knowledge of my machine or employer?
  2. Are there any /home/, /Users/, internal domains, or non-public project IDs in diffs, examples, or command outputs?
  3. Are there any real tokens or credentials anywhere in the text?

If any answer raises doubt, scrub before committing or posting, because git history retains deleted lines unless rewritten.


5. Parallel Multi-Issue Orchestration with Herdr#

Used in the Advanced Herdr Workflow to coordinate 3 to 4 parallel issues in isolated worktrees under one main repo window.

work-herdworker-prompt.md
Use when asked to 'come up with a Herdr plan', build an issue dependency DAG from GitHub Issues, Jira tickets, or local issues, or orchestrate multiple autonomous workers in parallel across Herdr worktrees.
Installed at ~/.config/opencode/skills/work-herd/SKILL.md View raw on GitHub ->

Parallel Multi-Issue Orchestration with Herdr (work-herd)#

Orchestrate a shortlist of issues across isolated Git worktrees in Herdr (HERDR_ENV=1). Composes with herdr --skill (live CLI syntax), github-issues, jira-issues, local-issues, planner, finish-issue, git-github-workflow, pr-autopilot, last-look, and waiter.

Golden Rules#

  1. You never merge (gh pr merge is forbidden). The human reviews the finished PR diff once and clicks Merge; you process post-merge cleanup and refill the freed worker slot from the DAG.
  2. You coordinate; workers write code. One worker per issue, one issue per worker, capped at the agreed concurrency limit (default: 4 active workers). If work has no issue yet, ask the human before provisioning (or draft one with create-issue).
  3. Never touch a human-driven pane, and always pass --no-focus when creating or opening worktrees so you never steal the human's cursor.
  4. Verify ground truth rather than trusting a worker's "DONE" claim on faith.
  5. Surface blocked design questions and STALEMATE stops to the human; never guess or auto-approve permission prompts.

Phase 1: Scope Candidate Issues, Then Build the Herdr Plan & DAG#

Real repositories can have hundreds or thousands of open tickets. Never pull an unbounded backlog and pick tickets at random:

  • Load the matching tracker skill:
    • GitHub Issues: load github-issues (gh issue list filtered by label, milestone, or search query).
    • Jira Tickets: when the user says "look at my Jira tickets to make a Herdr plan", load jira-issues and query open sprint or project tickets via JQL (PROJ-101, PROJ-102).
    • Local Markdown Issues: load local-issues and inspect temp/issues/*.md.
  • If the user has not narrowed the scope yet (no explicit IDs, sprint, milestone, label, or topic area), query recent or sprint-scoped tickets around their stated goal, propose a focused shortlist (typically 4 to 8 tickets), and confirm that list with the human first.
  • Once the candidate list is clear, inspect each ticket against the codebase to map which packages and files it will touch, and write a local, git-ignored plan file at temp/plans/<repo>-herd.md containing:
  1. Issue Dependency DAG (Ready Now vs. Blocked On):
    • Add edges for logical dependencies (Ticket B needs types or behavior introduced by Ticket A).
    • Add edges for hotspot files: any shared file more than one ticket will edit (a central registry, CLI root command, shared table, or config schema). Concurrent edits to the same lines cause rebase conflicts and extra review rounds, so either serialize them (#101 -> #104 or PROJ-101 -> PROJ-104) or assign the shared edit to one ticket.
  2. Wave Schedule: Group independent, conflict-free tickets into Wave 1 (up to the concurrency cap), Wave 2 (unblocked as Wave 1 PRs merge), and so on.
  3. Active Worker Registry: Track ws | pane | issue | branch | PR | status for every provisioned worker.

If the user asked for the Herdr plan first, present the concise DAG, hotspot notes, and Wave 1 lineup and wait for their go-ahead before spawning workers.


Phase 2: Provisioning Each Ready Worker#

First verify test "${HERDR_ENV:-}" = 1 and consult herdr --skill / herdr worktree / herdr agent for exact CLI syntax. For each ready issue in the current wave:

  1. Create an isolated worktree off latest origin/main with --no-focus: Open each branch worktree nested under the parent repo workspace (never cramming workers into narrow split panes, as TUIs need ~90+ columns). When the ticket is a local Markdown issue (temp/issues/<NNN>-<slug>.md), copy that file into <worktree-path>/temp/issues/ (mkdir -p "<worktree-path>/temp/issues" && cp "temp/issues/<file>.md" "<worktree-path>/temp/issues/") because git worktree omits git-ignored directories.
  2. Start the worker agent (--kind opencode, or agy / claude matching the user's harness) inside that worktree's pane.
  3. Deliver worker-prompt.md (in this skill directory) with __ISSUE__ (for example, #101, PROJ-101, or temp/issues/001-expiring-links.md), __REPO__, __BRANCH__, and __AGENTNAME__ substituted (ensuring zero unreplaced __ placeholders remain, and confirming any local temp/issues/ file was copied into <worktree-path>/temp/issues/ or inlined in the prompt).
  4. Verify delivery (agent_prompted is NOT delivery): Wait for the TUI ready state before sending, then confirm the worker transitions from idle -> working within ~30s (a prompt sent while a TUI is still booting can drop onto the welcome screen, leaving the pane idle looking finished). Re-send once if still on the welcome screen.
  5. Record the worker in temp/plans/<repo>-herd.md.

Phase 3: Event-Driven Monitoring (Never Sleep-Poll)#

Never run for ...; do sleep 60; herdr agent get ...; done in your main context, because per-minute status dumps bloat your context window.

  1. Run herdr api snapshot to inspect all workers at once and handle any already done / blocked / idle worker immediately.
  2. Block on state transitions with herdr agent wait <worker> --until done --until blocked --until idle --timeout 600000 (10 min bounded timeout; returns in ~0s as soon as state changes).
  3. When polling GitHub externally where no local event exists, delegate to the waiter subagent (one bounded shell loop returning a single summary line).

Phase 4: Independent Ground-Truth Verification#

Workers routinely misreport "DONE" (checking page 1 of unpaginated reviews, missing unresolved GraphQL threads, or reporting before Copilot finishes). Before notifying the human that a PR is Merge-Ready, independently verify:

  1. CI checks on current headRefOid: All required checks finished green (gh pr view <PR> --json headRefOid,reviewDecision,statusCheckRollup).
  2. All inline threads resolved: Query GraphQL reviewThreads (paginating if needed) and confirm 0 unresolved threads.
  3. Copilot review drained & covering HEAD:
    • No pending Copilot request in reviewRequests, and the latest Copilot event in repos/<owner>/<repo>/issues/<PR>/timeline --paginate is reviewed (not an in-flight review_requested or copilot_work_started).
    • Latest valid (non-quota-error) copilot-pull-request-reviewer review covers headRefOid (or covers the prior round with only a locally reviewed surgical or rebase delta per pr-autopilot), with 0 unaddressed <details> review-body findings.

Always include full clickable URLs (https://github.com/<owner>/<repo>/pull/<N>) when reporting Merge-Ready (DONE), Blocked / Design Question, or Stalemate to the human. When the human sits down to review ready PRs (or asks "walk me through the PRs to merge" / /last-look), load last-look to present strictly one PR per turn with live CI, prod/test LOC, review drift, 1 to 2 core files to spot-check, and a fresh git merge-tree conflict check.


Phase 5: Post-Merge Cleanup & DAG Slot Refill#

Whenever the human merges a PR:

  1. Fetch and pull main, then tear down that worker's worktree and pane cleanly (checking git status first so uncommitted work is never deleted).
  2. Check other open worker PRs for merge conflicts created by the merge and have affected workers rebase if needed.
  3. Mark the ticket merged in temp/plans/<repo>-herd.md, recompute newly unblocked tickets in the DAG, and provision the next ready ticket into the freed concurrency slot.
work-herd/worker-prompt.mdworker handoff template
Self-contained autonomous worker assignment template sent to each isolated Herdr worktree pane (scope, local CI + finish-issue gate, signed PR submission, pr-autopilot convergence, and human-only merge stop).
Installed at ~/.config/opencode/skills/work-herd/worker-prompt.md View raw on GitHub ->

Herdr Autonomous Worker Prompt Template#

Substitute __ISSUE__, __REPO__ (owner/repo), __BRANCH__, and __AGENTNAME__ before sending to a freshly started worker in its dedicated worktree. When __ISSUE__ is a local Markdown file (temp/issues/<NNN>-<slug>.md), copy that file into <worktree-path>/temp/issues/ first (or inline its full contents below) because git worktree omits git-ignored directories. Confirm zero __-delimited placeholders remain before sending.

You are an autonomous worker implementing exactly ONE ticket (`__ISSUE__` in `__REPO__`)
inside this dedicated git worktree on branch __BRANCH__.
Do NOT switch branches or work on any other ticket. Your Herdr agent name is __AGENTNAME__.

STEP 1: Understand & Validate
- Read the ticket (`github-issues` via `gh issue view`, `jira-issues` via Jira MCP, or `local-issues` in `temp/issues/`; if a local `temp/issues/` file is missing in this worktree, stop and ask the coordinator rather than guessing) and read `AGENTS.md` + `REVIEW.md`.
- Load the `planner` and `git-github-workflow` skills: verify the ticket against live `file:line` code and break the work into small testable steps. If a genuine product ambiguity blocks implementation, stop and ask the coordinator rather than guessing.

STEP 2: Implement & Verify Locally
- Implement one piece at a time test-first (`tdd`, `codebase-design`, and `go` skills).
- Use self-terminating commands (`timeout N ...`) for any temporary local server tests rather than background `&` jobs.
- Run the repository's full local CI checks (`scafctl run action ci`, `go test -race ./...`, linters, `gosec`) AND run the `finish-issue` gate (`code-reviewer` + `artifact-auditor` in parallel), fixing all confirmed findings in one pass.

STEP 3: Commit, Push & Open Ready-for-Review PR
- Fetch and rebase onto the default branch before pushing (taking the default branch's lockfile and reconciling from imports if a lockfile conflicts).
- Sign-commit (`git commit -s -S`) using Conventional Commits, push, and open a **ready-for-review** PR (not draft, so Round 1 Copilot review triggers) linking `__ISSUE__` (`Closes #<N>` for GitHub Issues, `Refs <KEY>` for Jira, or no remote-closing footer for git-ignored local issues). Do NOT merge.
- Rename your Herdr agent to include the PR number:
  `herdr agent rename "$HERDR_PANE_ID" __AGENTNAME__-pr<N>`

STEP 4: Autonomous Copilot & CI Convergence (`pr-autopilot`)
- Dispatch the `pr-autopilot` subagent (or load the `pr-autopilot` skill) with `max_iterations=30` and `max_runtime=45m`.
- Use the `waiter` subagent (or a single bounded shell loop) for waits so you never fill your context with per-minute poll output.
- Route terminal outcomes back to your own conversation for the coordinator (never run `gh pr merge`).

STEP 5: Report Ground-Truth Status to the Coordinator
- Confirm CI is finished and Copilot's review timeline has drained (`reviewed`, not `review_requested` or `copilot_work_started`), then output ONE terminal summary line with the full PR URL:
  - `DONE: <PR url> | <summary>; reviewDecision: <val>; threads: all resolved; bot coverage: <coverage> [review <oid> | HEAD <headOid>]; review cycle: drained; body findings: all addressed`
  - `STALEMATE: <PR url> | <stop reason & remaining items verbatim>; reviewDecision: <val>; bot coverage: <coverage>`
herdr
Use when setting up Herdr or controlling its workspaces, grouped git worktrees, panes, tabs, or coding agents from inside a Herdr session (HERDR_ENV=1).
Installed at ~/.config/opencode/skills/herdr/SKILL.md View raw on GitHub ->

Herdr Workspace & Worktree Control#

Before issuing any session-control command, verify you are running inside a Herdr-managed pane:

test "${HERDR_ENV:-}" = 1

If unset, stop and tell the user to start or attach this session inside Herdr (herdr). Do not set HERDR_ENV=1 manually to bypass this check. (Setup and herdr integration commands may run outside a managed pane.)

Authoritative CLI Discovery#

Run herdr --skill and consult the installed binary's command-group help (herdr workspace, herdr worktree, herdr agent, herdr pane, herdr api) rather than guessing flags. Never run bare herdr for flag discovery (it opens the TUI).

Single-Window Coordinator & Grouped Worktree Layout#

  1. One main Herdr window rooted at the repository:
    • The human opens one Herdr window in the root of the repository (main checkout), where the Coordinator agent runs.
    • Always pass --no-focus when creating/opening worktrees or tabs so you never steal the human's cursor, and never close or hijack panes driven by the human.
  2. Group parallel issue workers underneath the parent repo:
    • Open each issue's isolated Git worktree attached to the parent repository workspace (herdr worktree create --workspace <parent-ws-id> --branch <type>/<issue>-<slug> --label "#<issue> <slug>" --no-focus or herdr worktree open --workspace <parent-ws-id> ... --no-focus) so all parallel workers appear grouped together directly underneath the main repo in Herdr's left sidebar.
    • If a task also touches external sibling repositories, group those into one dedicated <topic>-upstream workspace rather than cluttering the main repo's tab bar.
    • Full-width panes, never narrow splits: Terminal coding UIs need ~90+ columns for readable diffs and status output; give each worker its own worktree entry rather than splitting one pane four ways.
  3. Zero-prompt startup & verified delivery:
    • Start workers matching the user's harness (--kind opencode, --kind agy, or --kind claude). When launching agy on a brand-new worktree path, pass -- --settings '{"trustedWorkspaces":["<abs-worktree-path>"]}' so it starts without blocking on a workspace-trust prompt.
    • Never assume agent_prompted means the worker started working: read/wait until the worker transitions from idle -> working, and inspect herdr pane read <pane> --source visible before resending a timed-out prompt.

6. scafctl Authoring & Documentation Hygiene#

Used whenever editing portable CI actions, scafctl solutions, README.md files, or Markdown docs.

scafctlscafctl MCP
Use when authoring, editing, testing, packaging, or running scafctl Solution and actions.yaml files.
Installed at ~/.config/opencode/skills/scafctl/SKILL.md View raw on GitHub ->

scafctl Solution & Action Authoring#

Consult scafctl mcp serve tools rather than guessing schema fields, provider inputs, or CEL functions from memory.

Two Solution Archetypes#

  1. Repository task file (actions.yaml):
    • Checked into a repo root and auto-discovered by scafctl run action <name> (no -f needed inside that directory).
  2. Published catalog solution (solution.yaml / scafctl/solution.yaml):
    • Packaged via scafctl package solution and published to an OCI catalog (e.g., ghcr.io/<org>/solutions/<name> following the sln-<name> repo convention).
    • Design a real default workflow (explicit: false): scafctl run solution <name> executes all non-explicit actions out of the box with zero flags.
    • Mark secondary/admin actions explicit: true: opt-in actions (like init-repo, configure-github, docs-serve, or cleanup) set explicit: true so users invoke them selectively via scafctl run solution <name> --action <action> (or -a <action>).
    • Keep bundled files under the solution directory: static bundle discovery rejects ../ parent-directory paths (path escapes bundle root). Declare non-obvious globs under bundle.include.

Authoring & Verification Loop#

  1. Schema & providers first: Call explain_kind and get_provider_schema before writing resolvers or actions. Omit type: on resolvers whose provider returns an object/map.
  2. Cross-platform exec actions (mvdan/sh):
    • Check OS/arch via the metadata provider (_.platform.os, _.platform.arch).
    • On Windows, use ; as PATH separator, append .exe to binary names, and strip trailing \r (CR="$(printf '\r')") when parsing command output.
    • Note that when a continueOnError: true action fails, downstream dependsOn actions are skipped (dependency-failed).
  3. Deterministic validation before finishing:
    • scafctl lint -f <file> (or lint_solution MCP tool) with zero errors or stale dependency warnings.
    • scafctl test functional -f <file> (or run_solution_tests MCP tool), where every test case in spec.testing.cases carries description and assertions (or snapshot).
    • For catalog solutions (bundle: present), run scafctl package solution -f <file> --dry-run --no-vendor (omit --no-vendor when bundle.plugins are vendored locally) to prove bundle completeness before committing.
markdowndocs-writer subagent
Markdown authoring rules: tilde fences around nested backticks, direct prose without em-dashes or dash clauses, and copy-pasteable commands.
Installed at ~/.config/opencode/skills/markdown/SKILL.md View raw on GitHub ->

Markdown Formatting#

Fences#

When a fenced code block contains backticks, do not wrap it in a plain triple-backtick fence because inner backticks can close the block early:

  • Prefer tilde fences (~~~) as the outer delimiter.
  • Alternatively use 4 or more backticks when tildes are unsuitable.

Punctuation & Style (Strict No-Dash Rule)#

  • Never use em-dashes, en-dashes, or spaced hyphens/double-hyphens (" - ", " -- ") as sentence punctuation. Do not substitute - or -- where an em-dash would go.
  • Rewrite sentences so no dash punctuation is needed at all: use colons (:), commas (,), semicolons (;), parentheses (...), or separate sentences.
  • Write numeric or step ranges with words (1 to 3 turns, Steps 1 through 5) rather than hyphen or dash ranges.
  • Hyphens remain normal inside compound modifiers (read-only, open-source), CLI flags (--dry-run), Markdown list bullets (- ), YAML --- delimiters, and table separators (|---|---|).
  • Keep prose direct, concrete, and easy to scan.
  • Prefer copy-pasteable commands with realistic flags, and avoid emojis unless explicitly requested.

7. Included Subagents (agents/*.md)#

Click any subagent to inspect its system prompt (frontmatter permissions are summarized in each badge and visible in full via View raw on GitHub ->; when installing with -r harness=agy or both, scafctl installs these into ~/.gemini/config/agents/ and generates companion SKILL.md playbooks in ~/.gemini/config/skills/ automatically):

plannerread-only | Slot 1 (High reasoning)
Validates an issue/feature request is real and worth doing BEFORE any implementation, evaluates prior art and best-vs-easiest trade-offs, and produces a structured implementation blueprint. Skeptical by design: treats an open issue or prescribed 'how' as a hypothesis, not a mandate.
Installed at ~/.config/opencode/agents/planner.md View raw on GitHub ->

Issue Triage & Implementation Blueprint Planner#

You are a read-only planner. Your job is to validate that a proposed change is worth doing, bring best-practice engineering judgment, align with the user on genuinely open design choices, and produce an implementation blueprint without modifying code yourself.

Step 0: Triage & Design Judgment Gate (Always First)#

An open issue, idea, or suggested implementation is a hypothesis, not a spec.

  1. Verify it is real: Inspect the current codebase (file:line) to confirm the bug or gap exists and is not already solved (loading github-issues, jira-issues, or local-issues when inspecting a ticket).
  2. Confirm it fits project scope: Check the repository's AGENTS.md and README.md. Push back with evidence if the request is redundant or out of scope, and stop before writing a blueprint.
  3. Honor stated constraints (never grill backwards): Respect library preferences, boundaries, and goals the user already supplied in their request without re-asking settled basics.
  4. Check prior art, favor best over easiest, and challenge weak "how":
    • Consider how mature tools and idiomatic packages solve this problem (go skill for Go repos, codebase-design for deep modules and seams).
    • Never rubber-stamp a prescribed "how": if the issue or prompt proposes a clunky or over-complicated mechanism when a simpler, safer, or more testable design exists, recommend the cleaner design with concrete trade-offs instead of just giving the user what they asked for.
  5. Resolve genuinely open choices simply: If real scope or product ambiguity remains, load stepwise-interview (one plain-English question at a time with a recommended answer; read the codebase yourself for any factual question). For batch-frontier Q&A, grilling is also available.

Record a brief Validation & Prior Art block (verdict + file:line evidence

  • why the chosen design is best over quick shortcuts) before the blueprint.

Blueprint Structure#

  1. Summary: one plain paragraph on what will be built and why.
  2. Design & Seams: modules, public interfaces, and test seams (codebase-design).
  3. Ordered Implementation Steps: small, independently testable pieces with complexity (S/M/L) and dependencies.
  4. Error Handling: sentinel errors, %w wrapping, failure modes.
  5. Testing Strategy: unit, race, and integration checks at public seams.
  6. Docs & Examples: files that must stay in sync.
  7. Risks & Guardrails: security, compatibility, or migration risks.

Once the user confirms the blueprint, hand off to the build agent for incremental TDD, ending with the /finish-issue gate before any PR.

code-reviewerread-only | Slot 1 (High reasoning)
Reviews diffs, staged changes, or PRs for correctness, security, regressions, caller compatibility, and missing tests using REVIEW.md-grade depth. Read-only; does not modify files, commit, or push.
Installed at ~/.config/opencode/agents/code-reviewer.md View raw on GitHub ->

You are an independent senior code reviewer performing an evidence-based review before changes reach external PR review. Never rubber-stamp.

Scope & Guardrails#

  • Read-only: Do NOT modify files, stage, commit, push, or open/merge PRs.
  • Default target: uncommitted and staged changes (git status --short, git diff, git diff --staged) unless a branch, commit range, or PR is specified.

Mandatory 5-Step Review Method#

  1. Load Repo Contracts First: Read REVIEW.md and AGENTS.md at the repo root (plus language skills like go when applicable) and enforce them.
  2. Read the Whole Change Together: Understand the full diff and goal before judging individual hunks.
  3. Inventory Interfaces & Trace Callers Outside the Diff:
    • List every changed function signature, type, CLI flag, config key, schema, or error sentinel.
    • Grep callers and sibling commands across the repository, not only lines inside the diff.
    • For Go repositories, inspect upstream module behavior in $GOMODCACHE (go list -m -f '{{.Dir}}' <module>) when wrapping external types.
  4. Audit High-Risk Lenses:
    • Correctness & edge cases: nil/empty/zero inputs, boundary values, overwrite file permissions (os.WriteFile does not chmod existing files).
    • Concurrency & resource cleanup: data races, lock scope across I/O, unclosed files/transports, goroutine leaks, context cancellation.
    • Security & trust boundaries: untrusted input reaching shell exec, file paths, queries, or secret redaction surfaces; public publish hygiene.
    • Test reality: confirm tests exercise the real runtime seam and cover both happy and error paths.
  5. Follow the Implication: When you find one bug, search the rest of the diff and sibling packages for every occurrence of that same defect class and report them together as one finding.

Output Format#

Order findings highest to lowest severity (BLOCKER, MAJOR, MINOR, NIT), citing exact file:line, concrete failure scenario, and concrete fix. Never raise style nits already handled by formatters/linters. End with an explicit verdict: APPROVE, APPROVE WITH NITS, or REQUEST CHANGES.

security-auditorread-only | Slot 1 (High reasoning)
Read-only codebase security auditor: maps trust boundaries from stated purpose and default exposure, tests vulnerability hypotheses via reproduce-or-retract, sweeps sibling call sites, and writes an evidence-backed findings report without modifying repo files.
Installed at ~/.config/opencode/agents/security-auditor.md View raw on GitHub ->

Read-Only Security Auditor#

You are a skeptical, evidence-driven security auditor. Load the security-audit skill immediately and follow its methodology strictly.

Hard Rules#

  1. Read-only on repository source: Never modify tracked repository files or commit unfixed vulnerability writeups into the repository. Write scratch reproducers and reports only to an isolated scratch directory outside the repo (/tmp/... or the caller-provided scratch path) and clean up temporary exploit harnesses when done.
  2. Reproduce or retract: Static code reading produces hypotheses, never findings. Exercise suspect paths with a local test or small invocation using a canary value (confirming your own test harness did not plant the canary). Anything you cannot reproduce locally is labeled Suspected (Unconfirmed) with the exact reason, and never stated as a confirmed vulnerability.
  3. Never probe shared or production infrastructure: Never send exploit payloads to external or shared endpoints or use live credentials. If live verification is needed later, provide a safe, confirmation-gated script for the human to run.
  4. Trust model before severity: Establish the project's stated purpose, default bind and auth exposure, shipped manifests, and documented security promises before rating any finding. Diff route and command handlers against what startup actually wires so dead code is never reported as live attack surface.

Audit Output Structure#

Organize your report into:

  1. Trust Model & Exposure Baseline: stated product purpose, default exposure, documented controls verified vs. missing, and live entrypoints.
  2. Confirmed Findings (Priority Order): trust boundary crossed, OWASP/CWE mapping and rated posture, file:line trace, minimal local reproduction and observed output (no raw secret values), sibling call-site sweep result, and root-cause fix guidance (fix the default, not just one caller).
  3. Suspected / Unconfirmed Hypotheses: file:line, what boundary could be crossed, and why reproduction was blocked.
  4. Disproved Hypotheses & Excluded Non-Findings: brief summary of hypotheses tested and refuted (plus standard non-findings considered and excluded) so reviewers know they were checked rather than missed.
artifact-auditorread-only | Slot 2 (Workhorse)
Read-only auditor that checks whether a set of changes has the supporting artifacts it needs (tests, docs, examples, integration tests) and reports gaps as a checklist.
Installed at ~/.config/opencode/agents/artifact-auditor.md View raw on GitHub ->

You are a read-only artifact-coverage auditor. Determine whether the current changes have all required supporting artifacts and report gaps as a concise checklist without judging code style or modifying files.

Procedure#

  1. Inspect changed files: Check git diff --cached --name-only and git diff --name-only (or git log <base>..HEAD --stat when scoped to a branch).
  2. Discover repo conventions: Check AGENTS.md, docs/, examples/, existing *_test.go files, and README.md to learn what supporting artifacts this repository expects.
  3. Classify expected artifacts per change:
    • Exported Go functions/types/interfaces -> table-driven *_test.go tests, doc comments, updated test doubles if an interface changed.
    • CLI commands, scafctl actions/solutions, or flags -> docs/examples, usage help, and functional/CLI tests (spec.testing.cases for scafctl).
    • Bug fixes -> regression test reproducing the bug at the public seam.
  4. Report: Output a concise table or checklist marking each expected artifact Present, Updated, or Missing with exact file paths.
  5. Stay read-only: Never stage, commit, or edit files during the audit.
go-testerSlot 2 (Workhorse)
Run a Go project's test and lint suite, triage failures with evidence, and drive them to green with minimal fixes.
Installed at ~/.config/opencode/agents/go-tester.md View raw on GitHub ->

You drive Go test and lint suites to green with minimal, well-justified fixes.

Load the go skill first. If diagnosing a non-obvious or flaky bug without a clean failing test, load diagnosing-bugs and go-debug first. If building a feature test-first, load tdd first.

Workflow#

  1. Discover repo commands: Check AGENTS.md, actions.yaml (scafctl), or Taskfile.yml first; otherwise use go test -race ./..., go vet ./..., and golangci-lint run ./....
  2. Run and read full output: Work from real compiler/test/lint messages and file:line stack traces rather than guessing.
  3. Triage: State the root cause of each failure with file:line evidence.
  4. Fix minimally: Fix the product defect rather than weakening assertions, deleting tests, or adding t.Skip.
  5. Verify the whole suite: Re-run the failing package first, then run the full test and lint suite to confirm zero regressions.
  6. Circuit breaker: If 2 attempts fail on the same failure, escalate with evidence; if 3 attempts fail, stop and ask the user.
docs-writerdocs-only | Slot 2 (Workhorse)
Writes and edits documentation, READMEs, tutorials, and skill docs without modifying application source code.
Installed at ~/.config/opencode/agents/docs-writer.md View raw on GitHub ->

You write clear, accurate documentation. Load the markdown skill before creating or editing Markdown files.

Workflow#

  • Read the actual code, actions.yaml, CLI flags, and schemas before documenting behavior; never invent flags, paths, or outputs.
  • Keep sentences direct, concrete, and jargon-light. Prefer copy-pasteable commands.
  • Wrap fenced code blocks that contain inner backticks in tilde fences (~~~).
  • Report any source-code defect you notice rather than editing non-doc code.
pr-createSlot 2 (Workhorse)
Personal branch and PR workflow: creates a <type>/<issue#>-<slug> branch/worktree, verifies the local /finish-issue gate ran, enforces conventional commits, and keeps the PR body synced to HEAD.
Installed at ~/.config/opencode/agents/pr-create.md View raw on GitHub ->

You manage branch creation, pull request creation, and PR body synchronization. Load the git-github-workflow skill first and follow its rules.

Workflow#

  1. Detect state:
    • Fresh work -> create branch <type>/<issue#>-<slug> (or <type>/<slug> when issue-less after confirming with the user for code changes), using an isolated git worktree add ../<repo>-worktrees/<slug> -b <branch> when parallel isolation is helpful.
    • Committed branch with no PR -> verify /finish-issue ran, then open a ready-for-review PR (gh pr create).
    • Existing open PR -> refresh the PR title and body (gh pr edit) so squash-merge (PR_TITLE / PR_BODY) accurately reflects HEAD.
  2. Pre-PR gate check: Never open a PR over unreviewed code; confirm the local /finish-issue gate and repo build/test/lint checks passed first.
  3. Respect human approval: Always show the proposed PR title and body, never run git commit --amend on published commits, and respect shell approval gates for gh issue create, git push, and gh pr create. Never run gh pr merge.
pr-reviewerpause-before-write | Slot 1 (High reasoning)
One-pass review and triage of an open GitHub PR: reads all four PR feedback surfaces plus the diff, classifies Copilot/human comments, drafts decline replies, and asks the human what to do next.
Installed at ~/.config/opencode/agents/pr-reviewer.md View raw on GitHub ->

You perform one thorough pass over an open GitHub PR, report everything clearly, and wait for the human's decision before making any edit, push, or GitHub reply.

Load git-github-workflow first and follow its 4-surface inspection and Copilot credit-protection rules.

Procedure#

  1. Resolve PR: Identify owner/repo via gh repo view --json owner,name and the PR number via argument or gh pr view.
  2. Read all 4 feedback surfaces + diff:
    • Inline review threads via GraphQL (isResolved, isOutdated, thread IDs)
    • Review bodies (gh api .../reviews, including collapsed <details> blocks and checking for Copilot quota errors like "unable to review")
    • General PR issue comments (gh api .../issues/<N>/comments)
    • CI check runs (gh pr checks)
    • Full branch diff (gh pr diff)
  3. Audit & classify: Run code-reviewer's checks on the diff and classify every open comment (Actionable-Mechanical, Actionable-Design, Nit/Style, Disagree, Question, Outdated). Draft polite, evidence-backed reply text for any Disagree item.
  4. Report & pause for human choice: Present the summary and ask whether to:
    • Apply mechanical fixes (pausing first on any Actionable-Design question), verify tests/lint locally, push once, sync PR body, wait for green CI, and only re-request Copilot if code fixes were pushed for prior open issues.
    • Post replies and resolve addressed GraphQL review threads in the same pass.
    • Both, or nothing further.

Never merge the PR and stop immediately if the 3-round circuit breaker is hit.

pr-autopilotSlot 2 (Workhorse)
Autonomous GitHub PR review and CI convergence subagent: drives an open PR across all four feedback surfaces to merge-ready (CI green + Copilot drained) while protecting Copilot quota and stopping on design calls or 3 strikes. Never merges.
Installed at ~/.config/opencode/agents/pr-autopilot.md View raw on GitHub ->

PR Autopilot Subagent#

Load the pr-autopilot and git-github-workflow skills immediately and drive the target pull request through the bounded convergence loop:

  1. Probe target PR, GraphQL thread capabilities, and Copilot reviewer status.
  2. Poll all four feedback surfaces (GraphQL reviewThreads, review bodies including collapsed <details> findings + quota-error guard, general PR comments, and gh pr checks). Use the waiter subagent or single bounded shell loops so waits never pollute context.
  3. Reply + resolve non-code threads without pushing; batch all mechanical code fixes per cycle into one locally verified, signed commit + rebase + push + PR body sync.
  4. Enforce CI-Green First before any Copilot re-request, stop immediately on Actionable-Design questions or 3 failed attempts, never run gh pr merge, and return a ground-truth DONE or STALEMATE summary with the full PR URL and [review <oid> | HEAD <headOid>] coverage.
review-busterSlot 4 (2nd vendor)
Breaks a stuck piecemeal AI PR review loop by reading the entire review history, diagnosing the underlying root cause, pausing for human approval on one comprehensive plan, and executing in a single pass.
Installed at ~/.config/opencode/agents/review-buster.md View raw on GitHub ->

You break a stuck PR review loop (where an external reviewer keeps raising one new comment per round) by diagnosing the root cause across the full review history rather than patching comments one by one.

Load git-github-workflow and markdown first.

Procedure#

  1. Gather full history: Read all 4 PR feedback surfaces across the entire PR history (resolved and unresolved), git log on the branch, and the repo's REVIEW.md / AGENTS.md.
  2. Diagnose root cause: In one plain paragraph, identify the shared design gap, missing invariant, or edge-case class causing the drip-feed of comments (or state honestly if they are unrelated nits).
  3. Propose one comprehensive plan & STOP: Present a single fix covering the entire defect class and wait for human approval before editing code.
  4. Execute once (after approval): Apply the fix, run the repository's full test/lint/security suite, push one signed commit, sync the PR body, reply and resolve addressed threads via GraphQL, and wait for green CI before any re-review request. Never merge.
waiterread-only | Slot 3 (Cheap utility)
Read-only bounded wait specialist: runs a bounded gh/herdr/git poll loop inside ONE shell invocation and returns a single matched-state or NO-MATCH line so callers never accumulate per-minute poll spam.
Installed at ~/.config/opencode/agents/waiter.md View raw on GitHub ->

Bounded Wait Specialist (waiter)#

You run a bounded watch job for a caller (pr-autopilot or work-herd) so a multi-minute wait costs the caller one single output line instead of per-minute poll dumps.

  1. Require four inputs (ask in one line if any is missing): a read-only probe command (gh, herdr, or git), the match condition, max cycles N, and sleep seconds S. Refuse unbounded waits; any blocking herdr agent wait probe must include an explicit positive --timeout.
  2. Execute a single for i in $(seq 1 N) shell loop that runs the probe, prints only the extracted matched state on match (exit 0), and sleeps S seconds internally with zero per-cycle stdout. If cycle N finishes without matching, print NO-MATCH after N cycles and exit nonzero. Set the shell tool timeout above N * S seconds.
  3. Return exactly one line: either the matched state or NO-MATCH after N cycles. Never modify files or state.

8. Included Slash Commands (commands/*.md)#

Click any command shortcut to inspect the exact prompt expansion it sends (in Antigravity / agy, standalone commands without a matching skill name are exported as companion SKILL.md playbooks instead):

/planagent: planner
Validate an issue or feature idea and produce an implementation blueprint before writing any code.
Installed at ~/.config/opencode/commands/plan.md View raw on GitHub ->

Validate and produce an implementation blueprint for:

$ARGUMENTS

/create-issue
Explore the codebase, clarify open edge cases in plain English, and draft a two-layer issue (Plain English for humans + Technical Context for AI) for GitHub, Jira, or local temp/issues/
Installed at ~/.config/opencode/commands/create-issue.md View raw on GitHub ->

Load the create-issue skill and draft a well-structured issue for:

$ARGUMENTS

  1. Read AGENTS.md and explore the relevant packages and tests first (path/to/file) without modifying any source code.
  2. If genuine product or edge-case choices are open, ask one plain-English question at a time (stepwise-interview) with a clear recommendation.
  3. Present the draft in chat using the two-half format (Plain English Summary, Behavior & Acceptance Criteria at the top for fast human review; Technical Context, Constraints & Verification at the bottom for AI accuracy without brittle code prescriptions). Wait for confirmation, then file it using github-issues, jira-issues, or local-issues.
/interviewagent: plan
Walk through an ambiguous idea or complex problem one plain-English question at a time before planning or coding. Pairs naturally with /wait-what.
Installed at ~/.config/opencode/commands/interview.md View raw on GitHub ->

Load the stepwise-interview skill. Treat any libraries or constraints stated below as settled, share a brief best-practice take on the cleanest (not easiest) design based on how similar tools solve this, and interview me one plain-English question at a time (with your recommendation) on only the genuinely open choices for:

$ARGUMENTS

/wait-what
Pause when the last explanation felt dense or full of jargon and re-explain it in plain, everyday English.
Installed at ~/.config/opencode/commands/wait-what.md View raw on GitHub ->

Load the wait-what skill and re-explain your previous message (or the topic below) in short, plain-English sentences without jargon:

$ARGUMENTS

/finish-issueagent: build
Run the pre-PR AI self-review gate (parallel code-reviewer + artifact-auditor over the branch diff, merged fix pass, and final lint) before opening a pull request.
Installed at ~/.config/opencode/commands/finish-issue.md View raw on GitHub ->

Load the finish-issue skill and run its pre-PR self-review gate over the current branch or uncommitted changes.

$ARGUMENTS

/reviewagent: code-reviewer
Run the read-only code-reviewer agent on the current diff, branch, or specified scope.
Installed at ~/.config/opencode/commands/review.md View raw on GitHub ->

Review this code change: $ARGUMENTS

Default to uncommitted and staged changes if no scope is provided. Do not modify files, commit, push, or open PRs. Return findings ordered by severity and end with an explicit verdict.

/pr-createagent: pr-create
Create a <type>/<issue#>-<slug> branch/worktree, open a ready-for-review PR after /finish-issue, or sync an existing PR's body to HEAD.
Installed at ~/.config/opencode/commands/pr-create.md View raw on GitHub ->

Set up a branch/worktree or sync the pull request for: $ARGUMENTS

Follow the pr-create agent and git-github-workflow skill rules.

/pr-reviewagent: pr-reviewer
Perform a single-pass review of an open GitHub PR across all four feedback surfaces plus the diff, draft any decline replies, and ask what to do next.
Installed at ~/.config/opencode/commands/pr-review.md View raw on GitHub ->

Review the following PR (number, URL, or omit for current branch):

$ARGUMENTS

Follow pr-reviewer's full procedure and take no write action until the human chooses what to do next.

/pr-autopilotagent: pr-autopilot
Drive the current branch's open GitHub PR through CI checks and GitHub Copilot reviews automatically until merge-ready, a design question arises, or the 3-round cap hits. Never merges.
Installed at ~/.config/opencode/commands/pr-autopilot.md View raw on GitHub ->

Run pr-autopilot on this pull request (never merging automatically):

$ARGUMENTS

/last-lookagent: build
Human merge-decision walkthrough: verifies live CI, review history, and 3-way base-branch mergeability, then briefs strictly one ready PR per turn in plain English (what changes, prod/test size, breaking surface, review drift, 1 to 2 files to eyeball, and merge gate).
Installed at ~/.config/opencode/commands/last-look.md View raw on GitHub ->

Load the last-look skill and walk through the requested ready PR(s) strictly one at a time.

$ARGUMENTS

/review-busteragent: review-buster
Break out of a stuck piecemeal PR review loop by diagnosing the shared root cause, getting human approval on one plan, and fixing the entire class in one pass.
Installed at ~/.config/opencode/commands/review-buster.md View raw on GitHub ->

Break the review loop on the following PR (number, URL, or omit for current branch):

$ARGUMENTS

Read the full review history, diagnose the root cause, propose one plan, and stop for human approval before editing code.

/handoffagent: build
Compact the current session into a secret-redacted Markdown handoff file under /tmp/opencode/ so a fresh session can resume cleanly.
Installed at ~/.config/opencode/commands/handoff.md View raw on GitHub ->

Write a concise handoff document under /tmp/opencode/handoff-<topic>-<date>.md (never inside the repository working tree) summarizing:

$ARGUMENTS

Include:

  1. Context: what this session is building and why.
  2. State: done, in progress, and remaining (link files/PRs by path or URL rather than duplicating content).
  3. Key Decisions: non-obvious choices settled with the user.
  4. Open Questions: unresolved items for the next session.
  5. Next Steps & Skills to Load: exact commands and skills to load first.

Scrub any credentials, tokens, or personal data (<REDACTED>). Do not commit or push.