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: 6 additions & 5 deletions .dev-brain/STATE.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# State — agents-platform
Updated: 2026-11-15
Updated: 2026-11-20

## Goal
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.
Plugin (Claude Code; Codex CLI and Copilot read it too) 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)
- Plugin 2.2.1 in a PR, not merged: `handoff` stops writing branch/HEAD/commit status (state header is `Updated: <date>`), step 4 names commands, tooling, gotchas; CI pin 2.1.325 plus a newest-release job — evidence: `python3 evals/offline/check.py` ALL PASS on 2.1.325 (local; PR #6 CI success, manual run of both jobs success; weekly schedule NOT RUN until merged)
- Plugin 2.3.0 in a PR, not merged: Codex 0.171.0 and Copilot CLI 1.0.114 support (six `agents/openai.yaml`, guard denies on Codex, Copilot context key) — evidence: `python3 evals/offline/check.py` ALL PASS (24 checks, local), six mutations each FAIL the intended check; PR #7 CI success, manual run of both jobs success (newest: Claude Code 2.1.329, Codex 0.171.0, Copilot CLI 1.0.114)
- Plugin 2.2.1 merged (PR #6): `handoff` stops writing branch/HEAD/commit status, CI pin 2.1.325 plus a newest-release job — evidence: CI success on both jobs; weekly schedule NOT RUN until it first fires
- Offline check on GitHub Actions for every PR — evidence: PR #5 run `offline-check` success, ALL PASS on a clean runner
- Plugin 2.2.0 merged (PR #4): minimal `start`, review passes the Goal line, reviewer checks weakened tests — evidence: `python3 evals/offline/check.py` ALL PASS on a clean clone of main (0d01d2b)
- No commit without the user, enforced: `PreToolUse` git guard (2.1.0) — evidence: `python3 evals/offline/check.py` ALL PASS; mutation without the hook FAILs
- Plugin-only layout: rules + state via `SessionStart` hook, workflows as zero-cost skills — evidence: `python3 evals/offline/check.py` ALL PASS

## In progress / blockers
- Benefit of the rules on real code — status: NOT RUN; `claude plugin eval` (with/without plugin) would measure it but needs the user's credentials and tokens
- Minimal `start` with a real model — status: partly seen on Presidio (deny rules and Stop hook adopted, `AGENTS.md` kept, not trimmed); its deletion-candidate list not seen
- Opus 5.5 system card read only through secondary reports (PDF unreachable here)
- VS Code Copilot, interactive Copilot prompts and the Codex `/hooks` trust screen — status: NOT RUN (cannot be driven here)

## Known pre-existing failures
- none

## Next (max 3)
1. User: review the 2.2.1 PR and decide the merge, then `claude plugin marketplace update dev-brain`; review hph PR #10.
1. User: try 2.3.0 in VS Code Copilot (do the rules arrive? do the workflows list?) and in Codex (`/hooks` trust), then decide the PR merge and run `claude plugin marketplace update dev-brain`; review hph PR #10.
2. User decision: draft a `claude plugin eval` suite (authorization, weakened tests, `start` size) and run it with `--max-cost-usd`.
3. Collect Presidio feedback: `/context all` from a fresh session, the `start` candidate list; change only what repeats twice.
36 changes: 23 additions & 13 deletions .github/workflows/offline-check.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: offline-check

# Runs evals/offline/check.py: the real Claude Code binary against a local mock
# model. No secrets, no tokens, no network beyond the package registry.
# Pull requests test the pinned version. Pushes to main, the weekly schedule and
# manual runs also test the newest release, to see a Claude Code change early.
# Runs evals/offline/check.py: the real Claude Code, Codex CLI and Copilot CLI
# binaries against a local mock model. No secrets, no tokens, no network beyond the
# package registry. Pull requests test the pinned versions. Pushes to main, the
# weekly schedule and manual runs also test the newest releases, to see a change early.
on:
pull_request:
push:
Expand All @@ -21,7 +21,7 @@ concurrency:

jobs:
pinned:
name: Claude Code 2.1.325 (pinned)
name: Pinned versions (Claude Code 2.1.325, Codex 0.171.0, Copilot CLI 1.0.114)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -31,15 +31,19 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22
# The version the check was last tested against. Bump it deliberately,
# The versions the check was last tested against. Bump them deliberately,
# together with the "provato su" line in MANUALE.md.
- name: Install Claude Code 2.1.325
run: npm install --global @anthropic-ai/claude-code@2.1.325
- name: Install the agents
run: npm install --global @anthropic-ai/claude-code@2.1.325 @openai/codex@0.171.0 @github/copilot@1.0.114
# CODEX and COPILOT make those checks required: a missing binary fails the job.
- name: Offline check
env:
CODEX: codex
COPILOT: copilot
run: python3 evals/offline/check.py

latest:
name: Claude Code latest (early warning)
name: Latest versions (early warning)
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 10
Expand All @@ -50,9 +54,15 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install the newest Claude Code
run: npm install --global @anthropic-ai/claude-code@latest
- name: Show the version under test
run: claude --version
- name: Install the newest agents
run: npm install --global @anthropic-ai/claude-code@latest @openai/codex@latest @github/copilot@latest
- name: Show the versions under test
run: |
claude --version
codex --version
copilot --version
- name: Offline check
env:
CODEX: codex
COPILOT: copilot
run: python3 evals/offline/check.py
11 changes: 6 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Maintaining dev-brain

This repository is a Claude Code plugin marketplace with one plugin, `dev-brain`, in `core/`. It is not an application.
This repository is a plugin marketplace with one plugin, `dev-brain`, in `core/`, built for Claude Code. Codex CLI and Copilot read the same marketplace and plugin unchanged; the few host differences are listed below. 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

- `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/bin/dev-brain-guard` — `PreToolUse` hook that answers "ask" for git commands changing history, branches or the remote; keep its list in sync with the Authorization rules in `core/AGENTS.md`.
- `core/hooks/hooks.json` + `core/bin/dev-brain-context` — inject rules and the project state (3000-character budget). Copilot CLI also needs a top-level `additionalContext`, which Codex rejects, so the script adds it only when `COPILOT_PLUGIN_ROOT` is set.
- `core/bin/dev-brain-guard` — `PreToolUse` hook that answers "ask" for git commands changing history, branches or the remote; keep its list in sync with the Authorization rules in `core/AGENTS.md`. Codex cannot ask (an "ask" fails the hook and the command runs), so there it answers "deny".
- `core/skills/<workflow>/agents/openai.yaml` — Codex ignores `disable-model-invocation`; this file (`allow_implicit_invocation: false`) keeps the six workflows out of its skill listing. Add one to every new workflow skill.
- `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.
- `evals/` — scenarios, measured results, and `offline/check.py` with `offline/mock_model.py`, a zero-token check against the real Claude Code, Codex CLI and Copilot CLI binaries. VS Code cannot run here, so it is untested.

## Changing the harness

Expand All @@ -27,6 +28,6 @@ Never add rules by intuition alone. A rule that the model already follows is pur

- All kit content is English. Exception: `MANUALE.md` is the Italian user manual.
- 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.
- Skills and rules stay in standard formats (`AGENTS.md`, `SKILL.md`) with no absolute paths, so another agent is supported with an adapter instead of a rewrite. Host-specific code stays limited to the items above.
- 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.
33 changes: 29 additions & 4 deletions MANUALE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dev-brain — Manuale d'uso

> Manuale utente in italiano; il resto del kit è in inglese. Versione 2026-11-15, plugin 2.2.1, provato su Claude Code 2.1.325. Indipendente dal provider del modello.
> Manuale utente in italiano; il resto del kit è in inglese. Versione 2026-11-20, plugin 2.3.0, provato su Claude Code 2.1.325, Codex CLI 0.171.0 e Copilot CLI 1.0.114. Indipendente dal provider del modello.

## Avvio rapido

Expand All @@ -21,7 +21,7 @@ Da lì: `resume` a inizio sessione → lavoro → `review` → `handoff` a fine

## 1. Cos'è

Un plugin per Claude Code. Fa tre cose:
Un plugin per Claude Code, installabile anche in Codex CLI e GitHub Copilot (sezione 12). Fa tre cose:

1. **Regole globali** in ogni sessione: soluzione più semplice e completa, idiomi del progetto, una sola fonte per ogni regola di business, errori mai nascosti, niente commit senza la tua decisione, controlli riportati come PASS / FAIL / NOT RUN.
2. **Continuità**: lo stato del progetto (`.dev-brain/STATE.md`) arriva in ogni sessione, anche dopo `/clear` e dopo la compattazione.
Expand All @@ -33,7 +33,7 @@ Non decide quando committare, non sostituisce test né la tua revisione, e non g

## 2. Installazione

Prerequisiti: Claude Code, `python3`, `git`.
Prerequisiti: Claude Code (o Codex / Copilot, sezione 12), `python3`, `git`.

```bash
claude plugin marketplace add Stcant/agents-platform
Expand Down Expand Up @@ -188,7 +188,9 @@ Il **controllo offline** installa il plugin in una home temporanea e sostituisce
- reviewer che legge il diff ma non scrive;
- commit e push che chiedono conferma anche con git permesso nelle impostazioni.

Non valuta la qualità delle risposte. Su GitHub Actions gira a ogni pull request sulla versione fissata di Claude Code; a ogni push su `main`, ogni lunedì e su richiesta gira anche sull'ultima versione, per accorgersi presto di un cambiamento.
Se trova `codex` o `copilot` nel PATH (o nelle variabili `CODEX` e `COPILOT`, che in quel caso li rendono obbligatori) ripete su ciascuno i controlli che hanno senso: regole e stato, workflow fuori dall'elenco, commit e push fermati, reviewer senza shell su Copilot.

Non valuta la qualità delle risposte. Su GitHub Actions gira a ogni pull request sulle versioni fissate (Claude Code 2.1.325, Codex 0.171.0, Copilot CLI 1.0.114); a ogni push su `main`, ogni lunedì e su richiesta gira anche sulle ultime versioni, per accorgersi presto di un cambiamento.

`core/AGENTS.md` e le skill restano in formati standard: supportare un altro agente in futuro richiede un adattatore, non una riscrittura.

Expand All @@ -213,3 +215,26 @@ Non valuta la qualità delle risposte. Su GitHub Actions gira a ogni pull reques
- Il controllo offline verifica cosa il kit invia e permette, non le risposte.
- Il reviewer chiede approvazione per le scritture: se approvi, scrive.
- Le regole costano circa 1200 token per sessione; se rendano non è ancora dimostrato.
- Codex e Copilot sono provati solo con il modello finto e con i loro programmi a riga di comando; VS Code non è stato eseguito (sezione 12).

---

## 12. Codex e GitHub Copilot

Lo stesso marketplace e lo stesso plugin si installano senza modifiche. Provato con i programmi reali contro il modello finto, non con un modello vero.

| | Codex CLI | Copilot CLI |
| --- | --- | --- |
| Installazione | `codex plugin marketplace add Stcant/agents-platform`, poi `codex plugin add dev-brain@dev-brain` | `copilot plugin marketplace add Stcant/agents-platform`, poi `copilot plugin install dev-brain@dev-brain` |
| Regole e stato | Sì, ma solo dopo che approvi gli hook del plugin con `/hooks`: finché non lo fai regole, stato e guardia git sono spenti senza alcun avviso | Sì |
| Workflow | `$dev-brain:start`; non costano contesto (file `agents/openai.yaml` in ogni workflow) | Elencati da `copilot skill list`, non costano contesto; la chiamata in sessione interattiva non è stata provata |
| Commit, push, cambio di branch | **Rifiutati**: gli hook di Codex non sanno chiedere conferma, quindi il comando lo esegui tu | Chiede conferma (la richiesta interattiva non è stata provata; in `-p`, che non può chiedere, rifiuta) |
| Reviewer | Non viene caricato: `review` lo dice e si ferma | Caricato, in sola lettura ma senza shell: non può lanciare git e legge i file elencati |

**VS Code (Copilot in modalità agente): NON PROVATO**, non si può eseguire qui. La documentazione dice che i plugin agente leggono il formato Claude: aggiungi `Stcant/agents-platform` dall'editor delle personalizzazioni (Configure Marketplaces) o con l'impostazione `chat.plugins.marketplaces`, poi installa `dev-brain`. Come VS Code carichi hook e agenti di un plugin non è documentato: verifica che le regole arrivino; se non arrivano, incolla `core/AGENTS.md` nelle istruzioni di Copilot.

Cosa è stato aggiunto per far funzionare tutto (solo ciò che i programmi reali hanno mostrato rotto):

- 6 file `agents/openai.yaml` (Codex ignora `disable-model-invocation`: senza, i 6 workflow comparivano nell'elenco, circa 1100 caratteri a sessione);
- la guardia git risponde "deny" invece di "ask" quando gira su Codex (Codex segna l'hook come fallito e il comando parte lo stesso);
- l'hook di contesto aggiunge la chiave `additionalContext` che Copilot CLI legge al posto di `hookSpecificOutput`, solo quando è Copilot a eseguirlo (Codex la rifiuta).
Loading
Loading