Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🥪 stackwich

validate License: MIT Claude Code

Delivery discipline for AI agents. Five layers, one command.

Most people run AI coding agents like slot machines: prompt → pull the lever → hope. The agent writes code 10× faster than you review it, declares itself done, and you find out later. We would never accept that from a junior engineer — we accept it from our tools every day.

Stackwich is 15 years of delivery coaching — plan → build → test → review, the oldest idea in software — compressed into standing policy for Claude Code. Install it once and every future session works this way.

The Stackwich sandwich: plan (advisor·opus) → execute (executor·haiku) → verify (the gate·sonnet) → review (advisor·opus)

The five layers

Layer Habit
Prompt Meta-prompt every delegation. Context-full, with a stated done condition. Understanding never gets delegated.
Context Fork research and read-heavy scans off the main thread. Memory, plans, and tasks each do their own job.
Harness One writer. Read-only enforced in practice, not just in the tool list. Nothing "done" until observed.
Loop Recurring work runs on /loop. Failure loops are capped at 2 cycles and never silent.
Graph advisor plans → executor implements → verifier gates → advisor reviews, with explicit hand-off contracts.

Cost discipline isn't a sixth layer — it's how the five are practiced: cheap models grind, expensive models only plan and review, and nothing already established gets re-derived.

The layer names are structure for the humans auditing the setup. Inside the installed policy block they're section headers only; every bullet under them is a behavioral imperative, because that block is read on every turn and prose explaining a taxonomy would cost tokens without changing an action.

The sandwich

Stage Agent Model Contract
🍞 Plan advisor opus Read-only. Exact files, exact edits, a verification command per step. Flags anything irreversible.
🥩 Execute executor haiku Mechanical and exact. No redesigns, no improvising, no suffixed file copies.
🧪 Verify verifier sonnet Runs the project's real tests/lint/build. GATE: PASS or GATE: FAIL — never repairs.
🍞 Review advisor opus Diff vs. plan, conventions, blast radius. APPROVE or REVISE: <list>.

Small, reversible changes skip the ceremony — the verifier alone closes the loop. If the same verification fails twice, iteration stops and escalates to the advisor. Speed without a gate is just faster mistakes.

Install

Clone the whole repo into your Claude Code skills directory — the skill reads assets/ when it scaffolds the agents, so fetching SKILL.md alone is not enough:

# user level — applies to every project
git clone https://github.com/ovhirup/stackwich ~/.claude/skills/stackwich

# or project level
git clone https://github.com/ovhirup/stackwich ./.claude/skills/stackwich

Then, inside any Claude Code session:

/stackwich

The skill does the rest interactively: asks for scope, writes the policy, offers the three agents. Run /agents afterwards to confirm advisor, executor, and verifier are picked up. Re-running it on an existing install detects the marker and offers an in-place upgrade.

What it writes

Path What
<scope>/CLAUDE.md The operating policy, fenced between <!-- stackwich:v1 --> markers — updates in place, never duplicates
<scope>/agents/advisor.md Read-only planner/reviewer (opus)
<scope>/agents/executor.md Cheap mechanical executor (haiku)
<scope>/agents/verifier.md PASS/FAIL verification gate (sonnet)

<scope> is ~/.claude (user level — every project, the recommended default) or ./.claude (this project only). Already have your own plan/execute/verify agents? Keep them — Stackwich is the policy; the three files are just a default implementation, and the installer handles name collisions.

Design notes

The marker never changes. <!-- stackwich:v1 --> is the permanent search key; the actual revision lives on a policy-rev comment inside the block. If the marker were versioned, a newer release couldn't find older installs to upgrade.

Single writer. Only executor mutates the filesystem. advisor and verifier have Bash for inspection and verification, explicitly scoped away from writes — a fix from a reviewer is an unreviewed change nobody knows exists.

Loops are capped. GATE: FAIL and REVISE: both route back to executor with the original plan attached, for at most 2 cycles. On the third, it stops and surfaces everything to the human. Verdict lines are fixed strings so the routing is mechanical, not interpretive.

Input contracts are explicit. Each agent states what it must receive and is instructed to stop when a piece is missing rather than reconstruct it — a reviewer that rebuilds the plan from the diff reviews the change against itself and approves anything self-consistent.

Repo layout

stackwich/
├── SKILL.md              # the skill: install workflow + policy block
├── assets/               # agent definitions, read only when scaffolding is accepted
│   ├── advisor.md
│   ├── executor.md
│   └── verifier.md
├── evals/evals.json      # test cases for the five install paths
├── docs/sandwich.jpg
├── CHANGELOG.md
├── LICENSE
└── README.md

assets/ is kept out of SKILL.md deliberately: progressive disclosure. The agent definitions are ~150 lines that don't need to enter context on every trigger, and never at all when the user declines the scaffolding.

Uninstall

rm -rf ~/.claude/skills/stackwich
rm -f ~/.claude/agents/{advisor,executor,verifier}.md

…and delete the <!-- stackwich:v1 --><!-- /stackwich:v1 --> block from your CLAUDE.md.

FAQ

Does it audit my existing code? No. It's forward-looking policy — it changes how future work gets done, nothing retroactive.

Will it slow me down? Only where slow is the point. Small, reversible edits run exactly as before; the full sandwich fires only when a change is hard to reverse, touches shared systems, or spans repos.

Why these three models? Tiering is the cost control: opus judgment where it pays (plan/review), haiku hands where it doesn't (mechanical edits), sonnet in between as the gate. Swap models in the agent frontmatter if your stack differs.

Author

Built by Abhirup Banerjee (@ovhirup) — AI-native Agile coach; SAFe, PI Planning, and large BFSI delivery programs. Stackwich is that delivery discipline, ported to agents.

MIT — see LICENSE. Forks and mirrors welcome — please keep the attribution lines in SKILL.md and the agent files intact. If it saves you a bad merge, a ⭐ is appreciated.

About

Installs an operating architecture into Claude Code as five layers — prompt, context, harness, loop, graph: meta-prompted delegation, forked research, a single-writer harness, capped failure loops, and a plan→execute→verify→review sandwich with three tiered subagents.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors