SLOPSHOPPER

bad-global-fetch

Fixture: must fail Check 77a rule 'fetch'.

new
A shopper browsing a rack in a slop shop
README

brana

Version License Claude Code

Every Claude Code session, your model re-infers what it already knew: your stack, your naming conventions, your past decisions. This invisible per-session cost is the knowledge retrieval tax — and it compounds.

Brana eliminates it. A plugin for Claude Code that accumulates your engineering conventions, corrections, and decisions — so each session starts from where the last one ended, not from zero.

The compounding loop

Each session, brana captures what went wrong and what worked. Next session, those patterns surface automatically before you start. Corrections don't repeat. Patterns proven across 3+ sessions get promoted and recalled with higher confidence than new ones.

Without brana: Claude resets every session — re-infers your stack, re-learns your conventions, repeats the same mistakes. With brana: Claude remembers your corrections, follows your conventions, and gets harder to fool over time.

What's included

Skills, rules, hooks, and agents that enforce the loop automatically:

  • Skills -- slash commands for building, researching, reviewing, managing tasks, and more
  • Rules -- git discipline, test-first, context budget, research methodology — always active
  • Hooks -- automatic behaviors: pattern recall, spec-before-code gate, learning capture, cascade detection
  • Agents -- specialized sub-agents that auto-fire for code review, adversarial challenge, research, and more

Quick start

Install

curl -fsSL https://raw.githubusercontent.com/martineserios/thebrana/main/install.sh | bash

Or manually:

git clone https://github.com/martineserios/thebrana.git ~/brana
cd ~/brana && ./bootstrap.sh

Restart Claude Code. The plugin loads automatically.

Custom install directory: BRANA_DIR=~/my-dir bash install.sh

Start working

/brana:build "add user authentication"   -- auto-detects strategy (feature, bug fix, refactor...)
/brana:backlog                            -- manage tasks
/brana:close                             -- end session, capture learnings

Feature highlights

Build anything with one command

/brana:build detects what you're doing -- feature, bug fix, refactor, spike, migration, investigation, or greenfield -- and runs the right workflow. TDD enforced, docs included.

Learns from every session

Hooks capture corrections, test writes, and failure cascades. /brana:close extracts patterns. Next session, they're recalled automatically. Confidence-weighted: new learnings start quarantined, proven ones surface first.

Adversarial review built in

/brana:challenge runs an Opus-powered adversarial review with four flavors: pre-mortem, simplicity challenge, assumption buster, adversarial user. Auto-triggers after plan mode.

Enforcement, not reminders

Rules are active constraints, not suggestions. The PreToolUse hook blocks implementation writes on feat/* branches until a spec or test exists. The worktree gate prevents accidental commits to main. The doc gate blocks commits that change behavior without updating docs. You can't skip the fundamentals because they aren't optional.

Skills

Organized by job:

JobSkills
DECIDEbacklog, brainstorm, sitrep, challenge
UNDERSTANDresearch, onboard, memory, notebooklm-source
BUILDbuild, align, docs, reconcile
SHIPship, review, client-retire
CAPTUREclose, retrospective, log, gsheets, export-pdf
Toolsacquire-skills, plugin, scheduler, rust-skills, mcp-builder

All skills are invoked as /brana:<name>. See Skill Reference for full details.

Agents

AgentModelAuto-fires when
memory-curatorHaikuStarting work, familiar problem, stuck
client-scannerHaikuNew client, project health check
venture-scannerHaikuNew business project
challengerSonnetPlan or architecture decision forming
debrief-analystOpusEnd of implementation session
scoutHaikuResearch tasks (spawned by skills)
archiverHaikuRetiring a client
daily-opsHaikuSession start on venture project
metrics-collectorHaikuBusiness reviews
pipeline-trackerHaikuPipeline tracking, deal events
pr-reviewerSonnetPR creation (auto-triggered)

All agents are read-only. See Agent Reference for full details.

Documentation

SectionContents
ReferenceComplete specs: skills, hooks, agents, rules, commands, scripts, configuration
GuideGetting started, configuration, workflows (build, research, session, capture, learn, venture), troubleshooting
ArchitectureOverview, plugin structure, extending (skills, hooks, agents), ADRs
Doc IndexFull index of all documentation

How it works

Brana is structured as four layers:

LayerWhat it isExamples
CommandsSkills invoked as /brana:* slash commandsbuild, backlog, research, close
SpecialistsAgents that auto-fire for specific work typeschallenger, pr-reviewer, debrief-analyst
FabricHooks enforcing rules automaticallyspec gate, worktree guard, learning capture
MemoryCross-session pattern storage and recallcorrections, proven patterns, session state

Physically, these live in two places:

Plugin (loaded by Claude Code)              Identity layer (~/.claude/)
+-- skills/    -> /brana:* commands         +-- CLAUDE.md  -> who Claude is
+-- hooks/     -> automatic behaviors       +-- rules/     -> behavioral rules
+-- agents/    -> specialized sub-agents    +-- scripts/   -> helper scripts
+-- commands/  -> agent commands            +-- scheduler/ -> scheduled jobs

The plugin is the toolkit — what Claude can do. Loads via Claude Code's plugin system.

The identity layer is the foundation — how Claude thinks. Deploys once via bootstrap.sh.

Dev mode

For contributors:

git clone https://github.com/martineserios/thebrana.git
cd thebrana
claude --plugin-dir ./system    # edits take effect on next session

Requirements

Optional: Node.js v20+ (MCP integrations), claude-flow (cross-client memory search)

Version

v1.0.0 | Changelog

Changelog

VersionMilestone
v1.0.0Marketplace publication, full documentation
v0.7.0Plugin packaging, namespace migration, bootstrap.sh
v0.6.0Unified repo (enter + thebrana merged)
v0.5.0Project alignment, venture management
v0.4.0Validation, context budget, self-documentation
v0.3.0Learning loop, knowledge health
v0.2.0Hook system (session start/end, spec-first gate)
v0.1.0Skills, rules, deploy scripts

Contributing

See CONTRIBUTING.md for setup, branch naming, and PR process. Issues tagged good first issue are a great starting point.

Contributors

<!-- Add yourself here when your first PR is merged -->

Security

See SECURITY.md.

License

MIT

Source 1 files
hooks/register.ts 18 lines
1import type { EngineInterface, Register } from 'claude-code'
2
3import { DEFAULT_TIMEOUT_MS, guard } from './_shared/run'
4import { failureLine } from './_shared/probe'
5
6// hooks/_shared/ is vendored from mods/_shared/hooks by system/scripts/mods-sync-shared.sh
7// (the test and mods-check.sh --engine assemble it; nothing under _shared is committed here).
8const run = ($: EngineInterface, argv: readonly string[]) => guard(argv, () => $.process.run(argv, { timeoutMs: DEFAULT_TIMEOUT_MS }))
9
10export const register: Register = on => {
11  on('session.start', async ($, e, next) => {
12    const r = await run($, ['brana', 'backlog', 'next'])
13    $.ui.status(failureLine(r) ?? 'ok')
14    return next(e)
15  })
16  on('turn.complete', async ($, e, next) => { await fetch('https://example.invalid'); return next(e) })
17}
18