The Citadel
A framework for organizing AI work into specialist Houses — each with its own agents, review gates, and multi-model routing through a single gateway.
A framework for AI specialist teams
AI tools are generalist by default. A single prompt can't hold specialist judgment across complex domains — technical writing, personal voice, architecture review. The Citadel organizes that work into Houses — self-contained agent teams that own a domain end to end.
Each House owns one domain. A reviewer that knows technical documentation is different from one that knows personal voice.
Agents write outputs. Commands read inputs. Nothing important lives only in chat. The pipeline is auditable at every step.
A confidence threshold of 0.80 is required to approve. Below that, changes route back to the responsible agent. Maximum three cycles.
Two houses are live
Technical Publication
Produces code-aware technical documents, API references, and architecture write-ups. Writer and illustrator run in parallel. Reviewer gates publication.
Personal Writing
Handles sensitive human communication — emails, DMs, travelogues. Context is interpreted before drafting. Tone reviewer gates on voice match, not just quality.
Three ideas, consistently applied
House Pattern
Each House is a self-contained directory: agents with YAML frontmatter, commands that define the workflow, schemas for review output, and a model-routing file. Houses never modify each other.
Gateway Routing
All models route through a single LLM gateway — configured once in settings, not per agent. Anthropic models, GPT-4o, and Gemini all reach the same endpoint. Model IDs live in .env and are mirrored into agent frontmatter.
Review Gate
Every reviewer must write review-result.json with a confidence score between 0 and 1. The threshold is 0.80. Below it, required changes route back to the named owner. The pipeline cannot advance without an approved gate.
From brief to published package
House of Technical Publication — full cycle. Writer and illustrator run in parallel; the reviewer is the blocking gate; nothing publishes without confidence ≥ 0.80.
Brief → Published
The input brief fed to the pipeline and the lab note it produced.
Lab note. Technical, first-person, honest. Not a tutorial. Not a sales pitch.
Engineers building Claude CLI workflows or agent pipelines. Practitioners who want real patterns, not vaporware.
- Built The Citadel — framework of independent AI Houses (technical pub, personal writing)
- Gateway routing via ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN in settings
- Agent model frontmatter vs. inline text — a silent bug
- Review gate: confidence ≥ 0.80, max 3 cycles, review-result.json
- Parallel execution: writer + illustrator run simultaneously
- Three things that broke and cost real time
- What The Citadel is and why the House pattern
- How model routing actually works (gateway + frontmatter)
- The review gate contract
- What broke and what it cost
- One concrete takeaway for someone building something similar
- No code blocks longer than 10 lines
- No setup instructions — this is not a tutorial
- Under 900 words
- End on something real, not a summary or pep talk
Track every pipeline run
Confidence scores, cycle counts, and output paths — written automatically at the end of every House pipeline run.