Framework
STACK The Agentic Codebase
STACK is a five-layer architecture for repositories where humans and agents share work: Structure, Toolchain, Agent configuration, Connection, Knowledge and quality. The agent OS is versioned like the app.
- The moves
- 5
When to use it
Use STACK when agents demo well and then rot the repo: rules in five tools, MCP without contracts, skills nobody owns. The disease is agentic repo debt, not a weak model.
The moves
- 01
Structure
Layout, entry points, workspaces, and boundaries an agent can navigate on its first minute in the repo.
- 02
Toolchain
The shells, commands, and CLI contracts an agent is allowed to run, written down instead of remembered.
- 03
Agent configuration
AGENTS.md, CLAUDE.md, rules, skills, and subagent charters as versioned standing context.
- 04
Connection
MCP servers, tool contracts, hooks, and guardrails with least privilege and a real failure story.
- 05
Knowledge and quality
Memory tiers, context budgets, evals, and CI, so a model upgrade does not silently lower the bar.
The book
The Agentic Codebase
The Five-Layer Architecture That Makes Agent Work Survive Production
Open the bookRelated frameworks
CHORUS
The Multi-Agent Organization
CHORUS is a six-skill coordination protocol for teams of 2 to 15 people who share work with specialised AI workers: Charter, Handoff, Orchestrate, Review, Update, Sync. Org charts name reporting lines. CHORUS names coordination lines.
SENSE
AI Agents for Startup Strategy
SENSE is a five-move strategic intelligence layer: Scan, Evaluate, Navigate, Simulate, Execute. It turns agent work from a productivity shortcut into a sourced claim that changes a watchlist, an assumption register, or a Monday decision.
BooksOS
The Agentic Author
BooksOS is a gated production system for serious nonfiction: Brief, Bible, Map, Draft, Edit, Package, Launch. Agents do specialist work inside the gates. Judgment, voice, and accountability stay human.
GRAIN
The RAG Engineer
GRAIN is a retrieval loop: Gather, Rank, Assemble, Inspect, Navigate. Gather governs the corpus: sources, permissions, and versioning. Rank retrieves candidate passages and reranks them for the question actually asked. Assemble builds the context the model may see. Inspect traces a wrong answer back to the chunk and retrieval decision behind it. Navigate keeps the index fresh: TTL policy, re-ingest, and change detection. If you cannot point at the passage, you do not have retrieval. You have a fluent guess.
Terminology
STACK is the five-layer model in The Agentic Codebase. It is not a vendor "AI stack" diagram, not an AGENTS.md file by itself, and not a vertical-slice tutorial. A repo that only has a markdown instruction sheet still has agentic debt.
Citation
STACK (The Agentic Codebase). Len P. van der Hof, Systems for the Strategic Self. https://lenvanderhof.com/frameworks/stack/