Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "dev-brain",
"owner": { "name": "Stcant" },
"plugins": [
{
"name": "dev-brain",
"source": "./core",
"description": "Readable, maintainable code at low context cost: global rules, project state, workflows, skills and a read-only reviewer."
}
]
}
21 changes: 10 additions & 11 deletions .dev-brain/STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
Updated: 2026-10-25 · Branch: improve/token-budget-and-review

## Goal
Personal OpenCode harness for readable, maintainable code at the lowest context cost — acceptance: always-on design rules installed, review covers real defects and maintenance costs, every claim backed by `evals/` evidence.
Claude Code plugin for readable, maintainable code at the lowest context cost — acceptance: installs from GitHub with two commands, every claim backed by `evals/` evidence, measured benefit on real tasks.

## Done (latest first, max 5)
- `/review` delegates the diff to the reviewer (read-only git allowlist); covers staged, unstaged and untracked; plugin skips subagents and enforces a 3000-char state budget; `/resume` stack-agnostic; `/start` migrates `harness/` — evidence: `python3 evals/offline/check.py` PASS (mock model, OpenCode 2.1.4); `evals/results.md` 2026-10-25
- hph adopted by following `/start` (patch, not pushed) — evidence: plugin injected the 1.3 KB state; `git apply --check` PASS on hph `d6ee299`
- Maintainability scenario: review policy reports duplicated business rules — evidence: `evals/results.md` 2026-10-22 (Python only)
- Plugin-only layout: rules + state via `SessionStart` hook, workflows as zero-cost skills, `plan` and other adapters removed, docs compacted — evidence: `python3 evals/offline/check.py` ALL PASS twice (Claude Code 2.1.310, mock model)
- hph adopted: `AGENTS.md` + 1.3 KB state, `harness/` retired — evidence: hph PR #10 open
- Review no longer pays the diff three times (7005 → 1101 chars on hph) — evidence: `evals/results.md` 2026-10-25

## In progress / blockers
- Real-model behavior of the new `/review`, `/resume` and plugin — status: NOT RUN; providers unreachable from the test environment
- Cross-language generation scenario — status: NOT RUN
- hph `harness/` deletion and patch commit — status: waiting for the owner
- Benefit of the rules on real code — status: NOT RUN; user postponed the benchmark
- Real-model and interactive behavior of the plugin — status: NOT RUN

## Known pre-existing failures
- `opencode run "/command"` does not expand slash commands (CLI limitation)
- none

## Next (max 3)
1. Run `python3 evals/offline/check.py` locally, then `/review` on a real diff with a real model in the TUI.
2. Apply the hph patch, review it, delete `harness/` and fix the README link to it.
3. Add a non-Python maintainability scenario before changing design rules again.
1. Merge PR #2, install from GitHub (`claude plugin marketplace add Stcant/agents-platform`), try `/dev-brain:start` and `/dev-brain:review` in a real session.
2. Review and merge hph PR #10.
3. Benchmark: same real hph tasks with and without the plugin; keep only rules that move the numbers.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__/
24 changes: 13 additions & 11 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
# Maintaining dev-brain

This repository is the source of the personal OpenCode harness. It is not an application.
Its primary goal is readable, maintainable code across languages and frameworks. Workflow commands and saved state support that goal.
This repository is a Claude Code plugin marketplace with one plugin, `dev-brain`, in `core/`. It is not an application.
Its primary goal is readable, maintainable code across languages and frameworks. Workflows and saved state support that goal.

## What belongs where

- `global/AGENTS.md` — always-loaded personal rules. Keep it short: only instructions that change the model's default behavior.
- `global/commands/`, `global/agents/`, `global/skills/` — installed into `~/.config/opencode/` by `install.sh`.
- `plugin/dev-brain/` — the V2 plugin injecting project state; registered in the global `opencode.json`.
- `templates/` — files written into destination projects.
- `evals/` — scenarios, measured results and `offline/check.py`, a zero-token check against a mock model.
- `core/AGENTS.md` — the global rules, injected into every session by the `SessionStart` hook. Keep it short: only instructions that change default behavior.
- `core/skills/` — Agent Skills. User-invoked workflows (`start`, `resume`, `handoff`, `impact`, `learn`, `review`) set `disable-model-invocation: true`, so they cost no context until invoked; `debugging`, `engineering-risk`, `review-feedback` are loaded by the model when relevant.
- `core/agents/reviewer.md` — the read-only reviewer; its `tools` line is the enforcement.
- `core/hooks/hooks.json` + `core/bin/dev-brain-context` — inject rules and the project state (3000-character budget).
- `core/.claude-plugin/plugin.json` — bump `version` on every change so installed copies refresh. `.claude-plugin/marketplace.json` at the root lists the plugin.
- `evals/` — scenarios, measured results, and `offline/check.py` with `offline/mock_model.py`, a zero-token check against the real Claude Code binary.

## Changing the harness

1. Run the relevant scenarios in `evals/scenarios/` against the current version and record the baseline.
2. Make the smallest change that addresses an observed failure.
3. Re-run the same scenarios with the change. After touching the plugin, agents or `install.sh`, also run `python3 evals/offline/check.py`.
3. Re-run the same scenarios, and `python3 evals/offline/check.py`.
4. Keep the change only if it improves a scenario or removes a real cost. Delete instructions that do not change behavior.
5. Record the result in `evals/results.md` with the date and the evidence.
5. Record the result in `evals/results.md`: date, change, evidence, limits. Keep it a log of decisions, not of sessions.

Never add rules by intuition alone. A rule that the model already follows is pure context cost.

## Constraints

- All kit content is English. Exception: `MANUALE.md` is the Italian user manual.
- No runtime dependency beyond the OpenCode binary itself; the plugin uses only `@opencode/plugin` and Node built-ins.
- Commands, agents and skills must be portable: no absolute paths inside their content.
- Runtime dependencies: Claude Code, `python3`, `git`.
- Skills and rules stay in standard formats (`AGENTS.md`, `SKILL.md`) with no absolute paths, so another agent can be supported later with an adapter instead of a rewrite.
- Do not duplicate a rule or template across files: `core/` holds each once.
- Do not copy project facts (stack, commands, state) from a destination repository into this source repository.
Loading