For AI Agents

If you are an AI coding agent reading this page: follow these rules and you will not hallucinate on dotdog projects.

The agent entry point: CLAUDE.md

When an AI agent enters a dotdog project, it reads CLAUDE.md first — before any code, before any docs, before AGENTS.md. This is the Anthropic convention, adopted by TypeScript, React, and Jest.

CLAUDE.md tells the agent one thing: load the .dag. It is the shortest path from "I just arrived" to "I have the full entity graph."

If a project has CLAUDE.md and *.dag files committed to git, it is agent-ready.

Rule zero: load the DAG first

Every dotdog project has a compiled .dag file. This is your ground truth. It is 94% smaller than the source .dog files (740 tokens vs 8,100). You load it once. You get the full entity graph.

If you ignore the DAG and read .dog files directly, you waste 8,015 tokens scanning 600 lines of prose to find which 4 lines matter. The DAG is a compiled index: it does not replace reading, it replaces scanning.

find . -name "*.dag" -not -path "*/node_modules/*"
cat projects/spec-platform/spec-platform.dag

Hard rules

  1. Load the DAG before reading any code file.
  2. Do not grep for structure. The DAG has the entity graph.
  3. If the DAG does not say it, you do not know it. Say unverified.
  4. If code contradicts DAG, DAG wins. Fix code toward DAG.
  5. Run dotdog validate before committing. Score must not decrease.

What the DAG gives you

FieldExample
Entity nameUser, Session, Payment
Typeentity, event, relationship
Propertiesemail: string (required), role: enum[admin, user]
Statesactive, suspended, deleted
Lifecycleactive -> suspended -> deleted
RelationshipsUser -> Session [has] (1:many, cascade)

MCP: live queries

ToolWhat it does
getEntityGet entity with properties, states, lifecycle
traverseFollow edges from a node, return subgraph
searchFind entities by name or type
schemaGet full property schema for an entity
summaryProject stats: node count, edge count, token savings
listProjectsList all spec projects in the repo
npx dotdog serve

Commands reference

CommandWhen to use
dotdog validateBefore committing spec changes
dotdog compileAfter editing .dog files
dotdog stalenessCheck if spec and code have drifted
dotdog verifyCheck spec references match code files
dotdog verify --initAuto-generate verify section from codebase
dotdog analyzeGap detection and contradiction checking

Common failure modes

How to detect agent-ready projects