---
title: Using ana-setup
description: "Setup reads your codebase, forms an opinion about your project, and asks you to correct it. Your corrections become the context every agent reads \u2014 what separates generic AI that happens to know your stack from an engineer who\u2019s been on your team for six months."
readingTime: 8
---

## How it works

Setup uses a **guess-and-confirm** pattern. It reads your scan data, README, documentation, landing pages, and source code — then presents what it thinks it knows and asks you to correct it. The correction is the content.

<div style={{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"var(--radius-md)",margin:"8px 0 18px",fontFamily:"var(--font-mono)",fontSize:"12.5px",lineHeight:1.65,overflow:"hidden"}}>
<div style={{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 14px",borderBottom:"1px solid var(--hairline)",background:"var(--bg-elev)",fontSize:"11px",color:"var(--ink-60)"}}>
<span style={{color:"var(--ink-45)",textTransform:"uppercase",letterSpacing:"0.06em",fontSize:"10px"}}>bash</span>
</div>
<pre style={{padding:"14px 16px",color:"var(--ink-75)",overflowX:"auto",whiteSpace:"pre",margin:0,background:"transparent",fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit"}}>
{"$ "}<span style={{color:"var(--pass)"}}>ana run setup</span>{"\n\nHere's my understanding of your project:\n\n  Anatomia is an open-source pipeline that turns AI-generated code\n  into verified code. It runs locally, installs as sealed agents,\n  and produces a proof chain you can audit.\n\nIs this accurate? Anything you'd change or add?"}
</pre>
</div>

This is the moment that matters. If setup says "a CLI tool that scans codebases" and you say "yes" — your agents think in technology terms. If you correct it to "a verification system for teams that need quality guarantees from AI coding tools" — your agents think in product terms. **The correction is the content.**

## What setup writes

Three artifacts. Each one changes how agents work on your project:

<div style={{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"12px",margin:"14px 0 18px"}}>
<div style={{padding:"12px 14px",borderRadius:"var(--radius-sm)",background:"var(--bg-card)",border:"1px solid var(--border-soft)"}}>
<div style={{fontWeight:600,fontSize:"13px",marginBottom:"4px",color:"var(--fg)"}}>project-context.md</div>
<div style={{fontSize:"12.5px",color:"var(--ink-60)",lineHeight:1.5}}>What your product does, who it serves, how the code is organized, what decisions were made and why. Think and Plan read this on every startup.</div>
</div>
<div style={{padding:"12px 14px",borderRadius:"var(--radius-sm)",background:"var(--bg-card)",border:"1px solid var(--border-soft)"}}>
<div style={{fontWeight:600,fontSize:"13px",marginBottom:"4px",color:"var(--fg)"}}>design-principles.md</div>
<div style={{fontSize:"12.5px",color:"var(--ink-60)",lineHeight:1.5}}>How your team defines "good." Each principle changes how Think evaluates tradeoffs and how Plan makes design decisions.</div>
</div>
<div style={{padding:"12px 14px",borderRadius:"var(--radius-sm)",background:"var(--bg-card)",border:"1px solid var(--border-soft)"}}>
<div style={{fontWeight:600,fontSize:"13px",marginBottom:"4px",color:"var(--fg)"}}>Enriched skill files</div>
<div style={{fontSize:"12.5px",color:"var(--ink-60)",lineHeight:1.5}}>Template rules refined with your project's actual patterns. Anatomia's own <code>coding-standards</code> went from 7 template rules to 11 enriched rules.</div>
</div>
</div>

## The session

Setup runs through five phases. The first is a config check, then two rounds of questions, then a draft review, then skill enrichment.

### 1. Config confirmation

Setup presents your detected configuration — application shape, stack, test and build commands, artifact branch — and asks "does this look right?" Correct anything that&apos;s wrong. These settings control how agents compile, test, and commit your code.

Setup also runs two silent verification checks during config confirmation. Stack provenance notes flag when a stack detection came from a non-primary package — e.g., detecting React from a storybook config rather than the main app. Surface gap checks identify workspace packages that have dev scripts but weren&apos;t surfaced by the scan. Both are silent when the scan is correct — you&apos;ll only see output if something needs attention.

### 2. Product identity

<div style={{padding:"10px 14px",borderRadius:"var(--radius-sm)",background:"var(--bg-card)",border:"1px solid var(--border-soft)",fontSize:"13px",color:"var(--ink-75)",fontStyle:"italic",margin:"10px 0 14px"}}>"Who is your target user, and what's the gap this fills for them — what couldn't they do before, or what were they stuck with?"</div>

Don't describe your stack. Describe your user's problem. Compare:

<div style={{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px",margin:"12px 0 16px"}}>
<div style={{padding:"10px 12px",borderRadius:"var(--radius-sm)",border:"1px solid rgba(248,113,113,0.25)",background:"var(--fail-bg)"}}>
<div style={{fontSize:"12px",color:"var(--fail)",fontWeight:600,marginBottom:"4px"}}>Weak</div>
<div style={{fontSize:"12.5px",color:"var(--ink-75)",lineHeight:1.5}}>"We use Next.js with Prisma and deploy to Vercel. We have about 50 API routes."</div>
</div>
<div style={{padding:"10px 12px",borderRadius:"var(--radius-sm)",border:"1px solid var(--pass-border)",background:"var(--pass-bg)"}}>
<div style={{fontSize:"12px",color:"var(--pass)",fontWeight:600,marginBottom:"4px"}}>Strong</div>
<div style={{fontSize:"12.5px",color:"var(--ink-75)",lineHeight:1.5}}>"Document sharing for investors. A founder uploads a pitch deck, sets access controls, gets analytics on who viewed which page and for how long. Competing with DocSend."</div>
</div>
</div>

<div style={{margin:"14px 0 18px",padding:"14px 18px",borderRadius:"var(--radius-sm)",borderLeft:"3px solid var(--color-brand)",background:"var(--bg-card)"}}>
<p style={{fontSize:"13.5px",color:"var(--ink-75)",lineHeight:1.6,margin:0}}>Setup already knows your stack from the scan. It doesn't know why your product exists, who it hurts when it's down, or what your team chose to build and what they chose not to. AI reads code fluently. It doesn't experience the problem your users have. That context comes from you.</p>
</div>

### 3. Draft review

Setup investigates your codebase silently — directory structure, entry points, import patterns, high-churn files, domain types — then presents a full draft of project-context.md. Seven sections, each with a confidence level. Sections marked ⚠ are thin and benefit from your input: key decisions the code doesn't explain, active constraints only you know, architectural choices that look wrong but are intentional.

### 4. Design principles

The highest-leverage part of setup. Three principles ship by default — we find them useful for most teams. You can reject any of them, but most people keep all three and add more:

- **Name the disease, not the symptom** — state the root cause before fixing
- **Surface tradeoffs explicitly** — show the paths, not just the fastest one
- **Every change should be foundation** — would a senior approve this for craft, not just correctness?

Setup then suggests 1–2 more based on patterns in your codebase. But the best principles come from you — from three places:

- **AI behavior you keep correcting.** "Stop suggesting ORMs, we use raw SQL." That's a principle.
- **Things that are non-negotiable when you design something new.** "Tests prove behavior, not implementation." That's a principle.
- **What you'd tell a strong engineer before they open your codebase.** "Prefer explicit over clever." That's a principle.

The test: if a principle wouldn't change how Think scopes or Plan designs, it doesn't belong here. Anatomia's own repo has 13 principles. Three of them:

```markdown
## Name the disease, not the symptom
Before fixing something, state the root cause in one sentence.
"This field is missing" leads to adding the field. "This field
is missing because the same concept lives in three places with
manual mapping" leads to deleting two of the three.

## Every character earns its place
No slop. Not in code, not in context files, not in prompts.
If three words do what five did, use three.

## Think more, build less
The cost of building is near zero — the cost of building the
WRONG thing is enormous. Spend time on diagnosis and design.
```

<p style={{fontSize:"13px",color:"var(--ink-60)",margin:"0 0 16px"}}>See <a href="/docs/reference/context#design-principles">our design principles reference</a> for the full list and how each one shapes agent behavior.</p>

<p style={{fontSize:"13px",color:"var(--ink-60)",margin:"0 0 16px"}}>"Name the disease" means Think pushes back on symptom-level requests. "Every character earns its place" means Plan writes tighter specs. "Think more, build less" means Think spends longer on tradeoff analysis before recommending an approach. Each one shapes agent behavior on every pipeline run.</p>

### 5. Skill enrichment

Setup asks two more questions: how code reaches production (writes your deployment skill) and what regularly trips people up (writes troubleshooting entries). Be specific — "push to main goes live via Vercel, cold starts on serverless functions" is better than "we deploy to Vercel."

Then it reads your error handling, import patterns, test structure, and CI configuration, and drafts enrichments for every remaining skill. You can review each file individually (`"show me coding-standards"`) or accept all at once. Every enrichment includes rationale — what setup found in your code and why Build would write different code with the rule.

<p style={{fontSize:"13px",color:"var(--ink-60)",margin:"0 0 16px"}}>If a template rule contradicts your codebase (e.g., "prefer named exports" but you use default exports), setup adjusts the rule and flags it with ⚠ for review.</p>

## Infrastructure persistence

When setup completes on the artifact branch, it automatically runs `ana init commit` to persist all infrastructure changes to git. This includes context files, design principles, and enriched skills — everything setup wrote during the session.

If you're on a different branch, setup prints a reminder to switch and run `ana init commit` manually.

## Re-running setup

Setup preserves what you wrote — sections with content aren't overwritten. To re-run after a previous setup, delete the `setupPhase` field from `.ana/ana.json` (or set it to `"not-started"`), then run `ana run setup` again. Re-run when:

- Your project has grown and the architecture section is stale
- You want to add design principles after using the pipeline
- New skill files were added (e.g., `ai-patterns` after integrating an AI SDK)

<div style={{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"var(--radius-md)",margin:"8px 0 18px",fontFamily:"var(--font-mono)",fontSize:"12.5px",lineHeight:1.65,overflow:"hidden"}}>
<div style={{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 14px",borderBottom:"1px solid var(--hairline)",background:"var(--bg-elev)",fontSize:"11px",color:"var(--ink-60)"}}>
<span style={{color:"var(--ink-45)",textTransform:"uppercase",letterSpacing:"0.06em",fontSize:"10px"}}>bash</span>
</div>
<pre style={{padding:"14px 16px",color:"var(--ink-75)",overflowX:"auto",whiteSpace:"pre",margin:0,background:"transparent",fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit"}}>
<span style={{color:"var(--ink-45)"}}>{"# Check current setup state"}</span>{"\n$ "}<span style={{color:"var(--pass)"}}>ana setup check</span>{"\n\nSetup Status\n────────────\n  "}<span style={{color:"var(--pass)"}}>✓</span>{" Setup complete\n\nFile Health\n───────────\nContext:\n  "}<span style={{color:"var(--pass)"}}>✓</span>{" design-principles     populated\n  "}<span style={{color:"var(--fail)"}}>✗</span>{" project-context       missing sections: Key Files, Active Constraints\nSkills:\n  "}<span style={{color:"var(--pass)"}}>✓</span>{" coding-standards      Detected: 9 facts, Rules: 11 entries\n  "}<span style={{color:"var(--pass)"}}>✓</span>{" testing-standards     Detected: 5 facts, Rules: 10 entries"}
</pre>
</div>

<p style={{fontSize:"13px",color:"var(--ink-60)",margin:"0 0 16px"}}>The ✗ marks are opportunities, not failures. Thin sections can be filled by re-running setup or editing the files directly.</p>

<NextCards cards={[
  {
    eyebrow: "Next guide",
    title: "Platform setup",
    href: "/docs/guides/platform-setup",
    description: "Configure Claude Code and Codex delivery for ana run."
  },
  {
    eyebrow: "Reference",
    title: "ana-setup template",
    href: "/docs/reference/agents/ana-setup",
    description: "The actual instructions the setup agent follows."
  }
]} />
