agentleFS
anthony-chaudharyanthony-chaudhary/fak/.agents/skills/opencode-wave/SKILL.md

opencode-wave

Skill47 starsChanged 11 days agoApache-2.0View on GitHub

Spawn and coordinate deterministic, collision-safe OpenCode leaf worker waves with high reasoning effort (--variant high), automated approvals (--auto), mandatory detached worktree isolation (--worktree), pre-flight lane lease arbitration, and automated closed-loop harvest.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    GitHub Issues & Tranche Grounding First: Every substantive unit of work must be tracked in a GitHub issue and grounded on ticket …

    line 21
  2. Distinctive:

    When executing a local campaign tranche, reconcile against the ticket index:

    line 41
  3. Very specific:

    Verify that each planned wave respects lane leases (dos arbitrate) and isolates high-blast-radius core packages into single-worker waves.

    line 62
  4. Distinctive:

    Verify on-device package tests before closing the wave:

    line 126
  5. Distinctive:

    Verify this skill definition using the project gates:

    line 136

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/opencode-wave — High-Effort Deterministic OpenCode Multi-Agent Wave Dispatch

The campaign coordinator for running multi-issue resolution waves in OpenCode. It takes a cohort of tracked GitHub issues or ticket tranches, verifies pairwise tree-disjoint package boundaries, isolates concurrent workers in detached worktrees, spawns user-visible detached OpenCode processes (opencode run --variant high --auto), enforces direct leaf execution within package boundaries (prohibiting nested task calls to prevent depth limit recursion failures, #12028), and supervises execution through automated harvest and safe git landing.


Six Invariants of Deterministic OpenCode Wave Dispatch

  1. GitHub Issues & Tranche Grounding First: Every substantive unit of work must be tracked in a GitHub issue and grounded on ticket specifications before worker execution begins. When targeting companion repositories (e.g. anthony-chaudhary/fak-private), explicitly bind candidate issues to the target repo and local ticket tranche (docs/tickets/.../INDEX.md).
  2. Mandatory Worktree Isolation: Dispatched workers touching identical Go packages must execute in detached worker worktrees (--worktree) or be partitioned into sequential waves. Concurrent edits to shared packages in the same working tree cause compilation cross-contamination and test failures.
  3. Strict Ban on Loose Scripts (Modular Native Go Dispatch Only): Creating new PowerShell (.ps1), Bash (.sh), or batch (.bat) scripts is prohibited. Wave planning, process spawning, and harvest reconciliation must run through first-class Go tooling (fak issue-orchestrator).
  4. High-Reasoning Effort & Auto-Approve Flags: Dispatched child OpenCode sessions run with --variant high --auto (or --dangerously-skip-permissions). This activates Gemini 3.8 Flash high reasoning mode for complex debugging, concurrency verification, and kernel implementation.
  5. Leaf Worker Direct Execution (No Nested Subagents): Dispatched sessions act as depth-1 leaf workers focused on assigned lane and boundary paths. Workers execute deliverables directly within package boundaries, author reproduction tests, and run package verification without calling the task tool or attempting nested subagent delegation. The coordinator manages wave fan-out; leaf workers execute directly to prevent recursion depth limit failures (Subagent depth limit reached (1), #12028, #12029).
  6. Automated Closed-Loop Supervision & Harvest: Waves do not stop at process launch. The coordinator supervises active workers, enforces the 4-state harvest protocol (StateVerifiedCleared, StateResidualReview, StateQuietIncomplete, StateSpinningStalled), lands verified worktrees to trunk, and verifies GitHub comment receipts.

Execution Protocol

Phase 1: Intake & Issue Tranche Ingestion

Query candidate issues from the target repository and pipe directly into structured JSON:

# Ingest candidate issues from target repository (public fak or private companion)
gh issue list -R anthony-chaudhary/fak-private --limit 15 --json number,title,labels,body > _scratch/issues.json

When executing a local campaign tranche, reconcile against the ticket index:

# Verify ticket definitions and acceptance criteria
cat docs/tickets/<campaign>/INDEX.md

Phase 2: Tree-Disjoint Wave Partitioning & Lease Arbitration

Partition the candidate issue set into ordered, collision-free waves where no two concurrent issues in the same wave touch overlapping packages:

# Plan safe waves with pairwise tree-disjoint boundaries and lease verification
go run ./cmd/fak issue-orchestrator \
  --workspace . \
  --from-issues _scratch/issues.json \
  --wave-size 4 \
  --plan-waves \
  --worktree \
  --json

Verify that each planned wave respects lane leases (dos arbitrate) and isolates high-blast-radius core packages into single-worker waves.

Phase 3: Native Go Wave Dispatch

Launch detached OpenCode worker processes for the target wave using first-class native Go tooling:

# Dispatch Wave 1 with high reasoning effort and detached worktree isolation
go run ./cmd/fak issue-orchestrator \
  --workspace . \
  --from-issues _scratch/issues.json \
  --spawn-opencode \
  --spawn-wave 1 \
  --wave-size 4 \
  --variant high \
  --worktree \
  --json

For private platform components in fak-private, specify the companion workspace root:

go run ./cmd/fak issue-orchestrator \
  --workspace ../fak-private \
  --from-issues _scratch/issues.json \
  --spawn-opencode \
  --spawn-wave 1 \
  --variant high \
  --worktree \
  --json

Phase 4: Live Supervision & Watchdog Monitoring

Audit running worker processes, session database registrations, and log streams:

# Check registered OpenCode database sessions
opencode session list

# Check running processes and resource utilization
powershell -Command "Get-Process -Name 'opencode' | Select-Object Id, ProcessName, CPU, WorkingSet64, StartTime | Format-Table -AutoSize"

# Inspect real-time execution log of active worker
cat _scratch/logs/opencode-issue-<issue_number>.err.log

Phase 5: Automated Closed-Loop Harvest & Safe Git Landing

Reconcile wave outcomes against the 4-state harvest protocol:

# Execute automated wave harvest and receipt generation
go run ./cmd/fak issue-orchestrator \
  --workspace . \
  --harvest \
  --json

Reconciliation states:

  • StateVerifiedCleared: Git commit witnessed on worktree, tests pass green, and 5-gate boundary clean. Auto-land worktree to trunk (fak-flow land or fak sync push) and close/comment on GitHub issue.
  • StateResidualReview: Diffs exist but uncorroborated or tests failing. Flag for manual inspection.
  • StateQuietIncomplete: No commits or modifications found. Soft re-queue for next wave.
  • StateSpinningStalled: Process exceeded turn budget or deadlocked. Terminate PID and release lease.

Verify on-device package tests before closing the wave:

go test -v ./internal/<changed-pkg>/...
go vet ./internal/<changed-pkg>/...

Verification and Witness

Verify this skill definition using the project gates:

# 1. Structural admission and anti-slop verification:
python tools/skill_slop_scorecard.py .claude/skills/opencode-wave/SKILL.md --corpus .claude/skills

# 2. Frontmatter portability check:
python tools/skill_frontmatter_lint.py --check

# 3. Synchronize cross-harness adapter for OpenCode (.agents/skills/opencode-wave/SKILL.md):
go run ./cmd/fak-project-assets sync --json

# 4. Verify zero unexplained parity gaps across harnesses:
go run ./cmd/fak-project-assets parity --json

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.