npm install -D @agentreins/cli @agentreins/adapter-jsAdd the CLI and the JS/TS language adapter as dev dependencies (pnpm: pnpm add -D).
For Vite + React and Next teams · Node 22+
Agents write code fast, then forget. They violate your architecture one import at a time, and re-read your codebase from scratch every session. reins makes both problems a check.
npm install -D @agentreins/cli @agentreins/adapter-js
01 · The difference
Every row is a failure mode of agent-driven development — and what changes when the rules leave the prompt and live in a tool.
02 · The check
A language adapter turns the repo into a list of import edges; the core applies the rules declared in architecture.yml to that list. Deterministic, identical locally and in CI, whatever agent or model wrote the code.
| Rule | What it prevents |
|---|---|
layer-direction | Layers importing from layers above — a component reaching into a feature. |
domain-boundary | Importing a domain's internals instead of its public API. |
no-cycles | Modules importing each other in a loop. |
next-server-clientoptional | 'use client' components importing server-only modules. |
integritywarn by default | A PR that changes architecture.yml or grows baseline.json instead of fixing the violation. Set it to error to make it block. |
Adopt on an existing repo without a big-bang fix. reins init freezes today's violations in a baseline: start green, and from then on reins check fails only on new violations. The baseline can only shrink.
03 · Context between sessions
Two kinds of memory live in .reins/, both readable, versionable and optional. Notes are committed; the notebook stays local to the branch.
What the module does for whom, in one or two lines.
Public API and key files.
The main data flow, in a few lines.
Why choices were made, with dates — stops the agent "fixing" intentionally designed code.
What looks wrong but is intentional.
What this branch is trying to land.
How you know it is finished; the agent checks them off one by one.
What is finished and what is next.
Where the work stopped, so the next session starts there.
The notebook and the notes of the files in play come back after a compaction.
04 · The core idea
What a machine refuses to let through, and what it hands the agent as guidance. Both matter; only one of them can't be ignored.
05 · Skills for your agent
In Claude Code, type them directly or ask in your own words. Other agents read the same instructions in .reins/skills/.
| Skill | What it does | When to use |
|---|---|---|
/reins-done | Closes a task: runs the checks, updates the notebook and the notes of the modules it touched, says what was and wasn't verified | When a task is done |
/reins-backlog | Shows what is pending in the backlog, proposes what to do next | "What's pending?" |
/reins-notes | Reads each module and fills in its note, writing only what it can back up; the rest become - ? question lines for you | After init or notes new |
/reins-notes review | Checks notes against the code and fixes what is no longer true | Every few weeks, or when doctor flags notes |
/reins-arch | Reviews architecture.yml against the code and proposes changes with evidence. Applies nothing until you approve each one | After init, and every few months |
/reins-audit | Looks for new improvements and adds only new findings to the backlog | "Review the whole project" |
/reins-agent | Creates a new subagent in .reins/agents/ (read-only by default) | New needs: a tester, an a11y checker... |
06 · Status
The enforcement core is stable. Agent-assisted workflows are documented as experimental — verify current behavior in the repository before relying on it in production CI.
The deterministic core: rules, findings, baseline.
reins doctor sits in the middle: it warns locally about agent-written artifacts but never blocks and never runs in CI. Current status: docs/STATUS.md ↗
07 · Quick start
Node 22 or newer. Four commands, and only new violations can fail.
npm install -D @agentreins/cli @agentreins/adapter-jsAdd the CLI and the JS/TS language adapter as dev dependencies (pnpm: pnpm add -D).
npx reins installSets up the git hook, the CI job, AGENTS.md and .claude/. Additive and idempotent: it never overwrites your files, and never installs packages.
npx reins initDrafts the architecture plan, the baseline and the module notes. Review them: in Claude Code type /reins-arch (the agent proposes changes with evidence, you approve each one); otherwise read .reins/init-report.md and edit .reins/architecture.yml yourself. Then /reins-notes — or ask your agent to fill in the notes' TODO lines.
npx reins check --update-baselineFreezes today's violations. From now on, npx reins check fails only on new ones. Commit everything and make the "reins" job required in branch protection.
Updating later: bump both packages, then run npx reins sync, npx reins doctor, npx reins check and npx reins notes stale to review out-of-date notes. Nothing is overwritten: install and init only add files or ask first.
Ready to try it?