Skip to content
Public template

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

dev-brain

A Claude Code plugin, with an adapter for OpenCode, that steers ordinary coding requests toward readable, maintainable code, keeps each project's state across sessions, and spends as little context as possible. Works with any model the agent can use.

It provides:

  • global engineering rules, injected into every session;
  • the project's saved state, injected within a 3000-character budget;
  • user-invoked workflows: start, resume, handoff, impact, learn, review (no context cost until invoked);
  • three skills the model loads when relevant: debugging, engineering-risk, review-feedback;
  • a read-only reviewer subagent;
  • a guard that makes the agent ask you before any commit, push or destructive git command.

Manuale utente in italiano: MANUALE.md.

Install

claude plugin marketplace add Stcant/agents-platform
claude plugin install dev-brain@dev-brain

Requires python3 and git. Update with claude plugin marketplace update dev-brain. For local development, add the cloned folder instead: claude plugin marketplace add /path/to/agents-platform (read in place).

OpenCode

OpenCode has no plugin marketplace, so one file, adapters/opencode/index.ts, connects it to the same core/: it runs the plugin's own dev-brain-context and dev-brain-guard scripts and builds the reviewer from core/agents/reviewer.md. No rule is copied. Checked with the real binary against a mock model (python3 evals/offline/check.py), not with a real model.

git clone https://github.com/Stcant/agents-platform /path/to/agents-platform

Then add the adapter to plugins in ~/.config/opencode/opencode.json (or in a project's opencode.json), with an absolute path:

{ "plugins": ["/path/to/agents-platform/adapters/opencode"] }

Requires python3 and git; without python3 the adapter asks before every shell command. Update with git -C /path/to/agents-platform pull, then start OpenCode again; if opencode service status shows a running background server, opencode service restart it too (each new opencode run re-read the edited files here, but a long-running server was NOT RUN). Remove by deleting the entry. Check the install with opencode debug agents: it must list reviewer.

Claude Code OpenCode
Rules and saved state every session main session only, not subagents
Workflow call /dev-brain:start @start in the prompt, or ask the agent to load the skill start (the skill tool loads it by id: tested here; the @ form worked in the TUI on the maintainer's machine, OpenCode version not recorded)
Workflows cost no context yes yes: not in the skill listing
Commit, push, branch change asks you asks you (seen in the TUI on the maintainer's machine, version not recorded); opencode run cannot ask and refuses; opencode run --auto approves it
Reviewer read-only, reads the diff with git read-only, reads the diff with git; redirections and --output are denied by name because OpenCode's shell matcher does not parse them

Tested versions: OpenCode 2.3.2 here and in CI, and 2.4.0 in CI (the newest release when written), through the V2 plugin API; OpenCode 1.x is NOT RUN. The workflow names below are written for Claude Code (/dev-brain:<name>); in OpenCode use the bare name (@start).

First step in every repository: /dev-brain:start

Run it once in each repository, from its root. Everything else builds on the two files it creates: resume and handoff read and rewrite the state, every session gets it automatically, and Claude Code and OpenCode read the project facts natively.

  1. Inspects the real repository: stack, commands, conventions, traps. It does not open data directories (input/, output/, .env).
  2. Writes or merges the root AGENTS.md as a draft, under 40 lines and only what the code does not show: exact commands, project tooling, decisions that differ from defaults, gotchas. No purpose line, stack list or architecture tour: studies find that such overviews add cost without helping the agent. It also creates or reconciles .dev-brain/STATE.md (goal, done with evidence, blockers, next actions, under 3000 characters).
  3. Uses files from the previous kit (harness/, NOW.md, RULES.md) as input and lists them for you to delete. On hph, 21 KB of harness/ became a 3.1 KB AGENTS.md and a 1.3 KB state.
  4. Reports observed facts, unknowns, problems and the AGENTS.md lines it suggests deleting (it never deletes them). If it sees names like .env or input/, it also prints the permission deny rules you can add yourself; if the repository has a fast check, it prints the Stop-hook line that makes a passing check mandatory before a turn can end. It edits no settings file. Changes no code, installs nothing, commits nothing.

Then read both files, delete the lines the code already shows, fix anything untrue, and commit them yourself if you want them versioned. Until a repository has a state file, the session only gets a one-line hint suggesting start; the global rules apply either way.

Daily use

Ask the agent to implement or fix what you need. The rules already apply; the workflows support the work.

Workflow When
/dev-brain:start First adoption of a repository (see above)
/dev-brain:resume Start of a session: reconciles the saved state with git and the code
/dev-brain:handoff End of meaningful work: rewrites the state with verified results and next actions
/dev-brain:impact <change> Before editing shared code: callers, contracts, tests, unknowns
/dev-brain:learn <area> Explain a real flow or an unfamiliar stack
/dev-brain:review [scope] Review all uncommitted changes through the read-only reviewer, which reads the diff itself with git

For planning use Claude Code's native plan mode (Shift+Tab): it is read-only by enforcement, which a prompt cannot match.

Always active Used when helpful Requires your explicit decision
Code-design guidance and self-review of changed code Impact analysis, independent review, session continuity Commits, amendments, pushes and branch changes (enforced: Claude Code asks you); unrelated refactors, new dependencies or architecture changes must be proposed first

What is enforced, what is instructed

  • No commit without you: enforced. A PreToolUse hook (on OpenCode, the adapter) answers "ask" for git commit (including --amend), push, merge, rebase, cherry-pick, revert, checkout/switch, history-moving reset, clean -f, branch -d/-m/-f, stash drop/pop/clear and tag deletion, even inside chained commands and even when your settings allow git. Read-only git runs normally.
  • Reviewer read-only: enforced. Its tool list allows Read, Grep, Glob and git diff/log/show/status; any command that creates, changes or removes files needs your approval.
  • State budget: enforced. Over 3000 characters only a notice is injected, telling the model to read the file and suggest handoff.
  • Everything else is instructed: rules guide the model; they do not guarantee good code.

Evaluation

python3 evals/offline/check.py        # CLAUDE / OPENCODE=<binary> if not on PATH

Installs the plugin into a throwaway home, replaces the model with a local mock that records every request, and checks in about 20 seconds, at zero token cost. Claude Code (required): rules and state reach the session, oversized state becomes a notice, workflows expand and stay out of the skill listing, the reviewer reads the diff but cannot write, and commit and push need you even when your settings allow git. OpenCode (run when found; an explicit OPENCODE variable makes it required): the same, through the adapter, plus rules and state staying out of the subagent. GitHub Actions runs it on every pull request (.github/workflows/offline-check.yml, Claude Code 2.1.325 and OpenCode 2.3.2, no secrets); pushes to main, a weekly run and manual runs also test the newest releases. It does not judge model behavior; evals/scenarios/ describes the real-model scenarios and evals/results.md records decisions and evidence.

Layout

.claude-plugin/marketplace.json   marketplace listing the plugin
core/                             the plugin: AGENTS.md rules, skills/, agents/, hooks/, bin/ (context and git guard)
adapters/opencode/                OpenCode adapter over core/
evals/                            scenarios, fixtures, results, offline check
MANUALE.md                        Italian user manual

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages