OpenCode integration

ADLC in the OpenCode TUI

Enforce-by-default rails-guard, full /adlc-* lifecycle commands, native adlc_gate/adlc_prosecute tools, and a multi-lens prosecution loop with a verifier. Enforcing by default: a thrown denial in tool.execute.before aborts the tool call. That is documented host behavior, and we regression-test it against a real binary.

Enforcing by defaultOne-line install
commands
9
prosecutor agents
7
native tools
2
enforcing hook
1
One-line install
install: OpenCode
npm install -g @adlc/cli
npx @adlc/opencode init

Restart OpenCode after bootstrap so hooks load. /adlc-init inside the TUI re-runs the same idempotent scaffold. Peer dependency: @opencode-ai/plugin >= 1.17.13.

Native surfaces

What the OpenCode plugin installs

adlc-opencode / native bundle
adlc-opencode/
├─ index.mjs  plugin + rails hook
├─ command/   9 lifecycle commands
├─ agent/     7 prosecutor roles
├─ skill/     phase-routing skill
└─ lib/       keyless bridge · prosecute

01 / commands

/adlc-* commands in the TUI

Init, ticket, verify-build, prosecute, distill, and maintain are scaffolded into .opencode/ idempotently.

  • /adlc-init
  • /adlc-ticket
  • /adlc-spec
  • /adlc-approve-spec
  • /adlc-decompose
  • /adlc-verify-build
  • /adlc-prosecute
  • /adlc-distill
  • /adlc-maintain

02 / prosecutor agents

Prosecutor lenses and a verifier

Deterministic adlc_prosecute fans out write-disabled child sessions; @prosecutor runs hollow-test / behavior-diff / review-calibration.

  • correctness
  • security
  • contract
  • diff
  • tests
  • verifier
  • prosecutor

03 / native tools

Native tools instead of shelling out

adlc_gate runs lifecycle gates (LLM-backed ones keyless through the host model); adlc_prosecute is the first-party P5 loop.

  • adlc_gate
  • adlc_prosecute

04 / enforcing hook

tool.execute.before aborts on rail writes

Structured edit/write/apply_patch and bash (via the shared shell classifier) deny frozen-rail mutations. Advisory session hooks warn only.

  • tool.execute.before
Phase routing

Commands and tools by phase

Slash commands and native tools write the same .adlc/ evidence as the other harnesses. P6 acceptance is still a human decision.

PhaseOpenCode entryEvidence produced
P0/adlc-ticketticket · coldstart
P1-P2/adlc-spec · /adlc-decomposeparallax · spec-lint · premortem · forecast
P3-P4rails-guard hookenforcing deny · shell classifier · flail
P5-P6adlc_prosecute5 lenses · verifier · behavior-diff
P7/adlc-distillfoundry · rejection mining · maintain
Frozen rails

Deny in session, prove in CI

In the session

Thrown denial aborts the tool call

Enforcing by default on @opencode-ai/plugin >= 1.17.13. Unrecognized structured tools with a path fail closed. Downgrade only with the loud ADLC_ALLOW_ADVISORY_HOOKS=1 escape hatch.

In CI

Merge still goes through rails-guard

scripts/rails-guard-ci.mjs via docs/ci/rails-guard.yml still decides what may merge, including anything the in-session classifier cannot see.

Install

Scaffold the plugin into your project

One-line install
install: OpenCode
npm install -g @adlc/cli
npx @adlc/opencode init

Restart OpenCode after bootstrap so hooks load. /adlc-init inside the TUI re-runs the same idempotent scaffold. Peer dependency: @opencode-ai/plugin >= 1.17.13.

operate: OpenCode plugin
# Offline scaffold / hook contract (no opencode binary)
node scripts/opencode-install-smoke.mjs .

# Re-run scaffold from inside the TUI
/adlc-init
ADLC began as an essay series. Read the original theory at voodootikigod.com ↗MIT · @adlc on npmPrivacy