Skip to content

Repository files navigation

opencode-devtools

Verification and build-status primitives for AI agent execution — type checking, testing, and CI as control-loop gates.

An OpenCode plugin that exposes development infrastructure as AI-callable tools. Instead of the agent guessing whether its changes compile or pass tests, these tools give the execution loop hard verification constraints: type-check, lint, run tests, check CI — then decide.

Why This Exists

In a control-system architecture (intent → orchestration → execution → verification → supervision), verification is the gate between "the agent did something" and "a human should look at it." Without verification primitives, the agent runs blind and the human reviews everything. With them, the loop self-corrects before surfacing results.

This plugin implements that verification layer for software development workflows. The primitives are domain-specific (TypeScript, ESLint, test runners, CI), but the pattern is general: give the agent observable constraints so it can converge before asking for human attention.

Tools

ToolWhat it doesExecution
dev-serverStart and manage Expo/Next.js dev serversPTY (long-running)
server-logsRead server output with filtering and paginationPTY buffer
check-typesTypeScript type checkingBun.$
lintESLint with auto-fix supportBun.$
generateCode scaffolding from templatesBun.$
create-prInteractive PR creation (auto-answers prompts)PTY
run-testsTest execution with aggregated resultsBun.$ / PTY
build-statusCI pipeline monitoring (Azure DevOps)Bun.$ / PTY

Setup

Register as a plugin in your opencode.json:

{
"plugins": {
"devtools": {
"path": "path/to/opencode-devtools"
}
}
}

Then optionally run the setup CLI:

bunx devtools init

This generates a .devtools.jsonc config file with tool toggles and per-tool configuration.

Configuration

All config lives in .devtools.jsonc (or .devtools.json) at the project root. Validated with Zod schemas. Falls back to sensible defaults when no config file exists.

Default tool enablement:

  • Enabled: dev-server, server-logs, check-types, lint, run-tests
  • Disabled: generate, create-pr, build-status

See ARCHITECTURE.md for schema hierarchy and implementation details.

Architecture

Two execution strategies based on tool needs:

  1. Bun.$ — For commands that run to completion (type checking, linting, tests)
  2. bun-pty — For long-running or interactive processes (dev servers, CI watch, PR creation)

PTY sessions are managed by a singleton SessionManager with a 50k-line rolling buffer per session, supporting paginated reads and regex filtering.

See ARCHITECTURE.md for the full technical breakdown.

Part of a Larger Stack

This repo is one layer of a control-system architecture for supervised AI execution:

LayerRepo
Supervisionreact-native-opencode-client
Verificationopencode-devtools (this repo)
ExecutionOpenCode
Learned Policyopencode-learn
Epistemic Safetyagent-memory-failure-demo

Read the full thesis at cloudpresser.com.

License

MIT

About

Verification and build-status primitives for AI agent execution — type checking, testing, and CI as control-loop gates

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages