Skip to content

Blueprint

A Blueprint provides visual documentation for a specification. Blueprints are diagrams — architecture overviews, data flow charts, entity-relationship models, sequence diagrams — stored inline in the spec file. They give agents and humans a visual understanding of how components relate.

Fields

FieldTypeRequiredDescription
idstringYesUnique identifier. Convention: bp_ prefix.
namestringYesHuman-readable name for the diagram.
categorystringYesThe type of diagram. See category enum.
formatstringYesThe markup format of the content. See format enum.
contentstringYesThe diagram content in the specified format.
descriptionstringNoAdditional context about what the blueprint shows.

Category Enum

ValueDescription
architectureHigh-level system or component architecture diagram.
flowProcess flow, data flow, or sequence diagram.
erdEntity-relationship diagram for data models.
uiUser interface wireframe or mockup.
deploymentInfrastructure and deployment topology.
otherAny diagram that does not fit the above categories.

Format Enum

ValueDescription
mermaidMermaid diagram syntax. Recommended for most use cases.
plantumlPlantUML diagram syntax.
asciiPlain ASCII art diagram.
svgSVG markup (inline).

Example: Mermaid Sequence Diagram

{
"blueprints": [
{
"id": "bp_checkout_flow",
"name": "Checkout Flow",
"category": "flow",
"format": "mermaid",
"description": "Shows the interaction between the client, API, payment provider, and database during checkout.",
"content": "sequenceDiagram\n participant Client\n participant API\n participant Stripe\n participant DB\n\n Client->>API: POST /api/checkout\n API->>DB: Create order (pending)\n API->>Stripe: Create payment intent\n Stripe-->>API: Payment intent ID\n API-->>Client: Client secret\n Client->>Stripe: Confirm payment\n Stripe-->>API: Webhook: payment_succeeded\n API->>DB: Update order (paid)\n API-->>Client: Order confirmation"
}
]
}

Example: Mermaid ERD

{
"id": "bp_data_model",
"name": "Core Data Model",
"category": "erd",
"format": "mermaid",
"content": "erDiagram\n USER ||--o{ ORDER : places\n ORDER ||--|{ ORDER_ITEM : contains\n ORDER_ITEM }|--|| PRODUCT : references\n USER {\n string id PK\n string email\n string name\n datetime createdAt\n }\n ORDER {\n string id PK\n string userId FK\n string status\n decimal total\n }\n PRODUCT {\n string id PK\n string name\n decimal price\n int stock\n }"
}

Usage by Agents

Agents can use blueprints to:

  1. Understand architecture before implementing tickets. A blueprint gives spatial context that prose descriptions lack.
  2. Generate code that aligns with the documented data model or flow.
  3. Validate implementations against the intended design by comparing the blueprint with the actual code structure.

Mermaid is the recommended format because it is widely supported, concise, and can be rendered by many documentation tools and IDE extensions.