Opencode subagent delegation
Skill OpenSIN-AI/OpenSIN-Skills/operations/planning/opencode-subagent-delegation
The world's largest open-source AI agent skill library — 280+ skills across 9 knowledge domains + 46 operational actions. Built on alirezarezvani/claude-skills + OpenSIN-AI.
npx -y skills add OpenSIN-AI/OpenSIN-Skills --skill opencode-subagent-delegationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Persistent co-working orchestration for Codex and opencode CLI in the same project directory. Use when Codex must collaborate continuously with opencode agents, attach complete project context, enforce strict secret redaction, apply canonical-first conflict resolution, and prevent duplicated governance text by indexing existing project docs.
SKILL.md
6.0 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
OpenCode mirror: sourced from
~/.config/opencode/skills/opencode-subagent-delegationand mirrored for OpenCode CLI usage.
Opencode Co-Working Delegation
Overview
Use this skill to run Codex + opencode as one coordinated team in a persistent session with hard-fail context gates.
This skill never imports docs from an external BIOMETRICS repository path. It always uses the files that exist in the current project root.
Core Guarantees
- Start opencode only in the active project directory.
- Build a full context bundle before first delegated execution.
- Auto-detect profile (
auto|biometrics|generic) from the current project. - Use canonical-first context flow: canonical index + read order + full inventory.
- Mask secrets strictly (
.env, credentials, token-like fields). - Block delegation if coverage, canonical structure, or no-dup checks fail.
- Coverage validation uses bundle source snapshot (
06_source_snapshot.txt) to avoid live repo race conditions. - Keep one persistent session and continue it with explicit
sessionID. - Require
CONTEXT_READY bundle_id=<id>andCONTEXT_PROFILE=<profile>before execution. - Require
MUTUAL_CRITIQUE_COMPLETEandMUTUAL_PLAN_READYbefore execution. - Enforce strict mutual skepticism (
critical_mode=strict) in every substantial message. - Enforce hard runtime and tool-call caps per delegated opencode message.
- Send proactive Codex interventions continuously.
Standard Workflow
- Build full bundle:
scripts/build-project-context-bundle.sh --project <dir> --profile auto
- Validate bundle coverage:
scripts/context-coverage-check.sh --project <dir> --bundle-dir <bundle_dir>
- Start persistent collaboration session:
scripts/start-opencode-collab.sh --project <dir> --profile auto --agent <name> --model <provider/model> --max-runtime-sec 420 --max-tool-calls 16
- Send collaborative follow-up messages (same session):
scripts/send-opencode-collab-message.sh --project <dir> --message "..." --max-runtime-sec 420 --max-tool-calls 16
- Run proactive intervention loop:
scripts/proactive-codex-loop.sh --project <dir> --interval-sec 90
Bundle Model
- Bundle root:
<project>/.opencode-context/bundles/<bundle_id>/ - Canonical artifacts:
04_canonical_stack_index.json05_canonical_read_order.md22_no_duplication_audit.json
- Compatibility artifacts remain present (
03_project_summary.md,10_*,15_*,20_*), but they contain structured references only. - Full text remains in
30_fulltext/and is redacted.
Session Model
- One persistent team session per project.
- Initial message requires:
CONTEXT_READY bundle_id=<id>CONTEXT_PROFILE=<profile>MUTUAL_CRITIQUE_COMPLETEMUTUAL_PLAN_READY
- Every follow-up message references the same session and includes delta by default.
- Delta includes canonical diff (
03_canonical_diff.md) when available. - Every substantial reply must include the critical response contract:
prompt_logic_reviewobjective_refinementopencode_critique_of_codexcodex_challenge_requestedconflicts_resolved_with_priorityplan_statuswork_donedelegated_subtasksrisks_or_blockersnext_steps
Security Model
- Secret policy is strict-only.
- Sensitive values are redacted before attachment.
- Coverage, canonical-index integrity, and no-dup audit are mandatory gates.
- Model fallback is automatic and ordered:
- explicit chain via
OPENCODE_MODEL_FALLBACK_CHAIN(comma-separated), or - default chain:
OPENCODE_PRIMARY_MODEL->OPENCODE_FALLBACK_MODEL->OPENCODE_TERTIARY_FALLBACK_MODEL(orOPENCODE_NIM_FALLBACK_MODEL) - default model values:
google/gemini-3.1-pro-preview->google/gemini-3-flash-preview->nvidia-nim/qwen-3.5-397b
- explicit chain via
- NVIDIA NIM fallback requires
NVIDIA_API_KEYavailable in the environment. - Any opencode stream
type=errorevent is treated as a failed run and triggers fallback/abort. - Any missing critical response fields or missing mutual-critique gates cause hard-fail.
- Any gate failure exits non-zero and blocks
opencode run.
Backward Compatibility
scripts/start-opencode-team.shandscripts/run-opencode-delegated.shremain available.- Both wrappers route to persistent co-working scripts.
Resources
scripts/
resolve_project_dir.sh: resolve active project path.list-subagents.sh: list available opencode agents.build-project-context-bundle.sh: create full mandatory context bundle with profile detection.build-context-delta.sh: create delta artifacts and canonical diff.context-coverage-check.sh: verify mandatory files, file coverage, canonical/no-dup gates, and redaction.session-state.sh: read/write persistent session state in.opencode-context/session/state.json.start-opencode-collab.sh: create full bundle, enforce readiness/profile ack, initialize persistent session.send-opencode-collab-message.sh: continue same session with intervention block and canonical-aware delta.proactive-codex-loop.sh: periodic + trigger-based proactive interventions.start-opencode-team.sh: compatibility wrapper tostart-opencode-collab.sh.run-opencode-delegated.sh: compatibility wrapper to session-aware messaging.
references/
delegation-prompt.md: kickoff protocol prompt with canonical-first contract.context-bundle-spec.md: required bundle structure and no-dup contract.collaboration-protocol.md: Codex/opencode co-working protocol and conflict priority rules.secret-redaction-policy.md: strict redaction policy and failure conditions.proactive-message-templates.md: intervention templates for periodic and trigger-based updates.