Blueprint spec
A blueprint is a structure that describes code to be built, in the abstract: the files, folders, classes, functions, variables, and relations, rather than the source itself. An LLM uses that structure to write working code. A person uses it to instruct the LLM at that same level, and to see what the LLM intends to build.
How it is used
On top of existing code. The project is already there. The blueprint adds files and folders, and points at the existing files, folders, functions, or variables it reaches into. Imports and notes can name those existing paths.
Without existing code. The project is empty. The blueprint describes
only what it adds: files, folders, functions, variables, and the imports between them.
pointers and deleted are empty.
In between. Some paths are new and some already exist. The todo app
below is this case. src/todo and the files under it are added, and
src/App.tsx is a pointer to a file already in the project, with
TodoApp imported into it.
Example
Entries taken from todo-app.blueprint.json. deleted and
steps are empty in that file. The sections below explain each list.
{12 keys}
"files": [1 item],
{4 keys}
"folders": [2 items],
{4 keys},
{4 keys}
"functions": [2 items],
{2 keys},
{2 keys}
"variables": [2 items],
{2 keys},
{2 keys}
"imports": [3 items],
{3 keys},
{3 keys},
{3 keys}
"notes": [2 items],
{3 keys},
{3 keys}
"pointers": [1 item],
{2 keys}
Overview
One blueprint is one file with the extension .blueprint.json, for example
todo-app.blueprint.json.
All paths are relative to the project root and use forward slashes.
src/todo/TodoApp.tsx names its folder src/todo. The function
TodoApp names that same path as its file.
{2 keys}
"files": [1 item],
{4 keys}
"functions": [1 item]
{2 keys}
Blueprint file
{3 keys}
These three fields identify the file. version is 1,
kind is "blueprint", and name is
todo-app, the file name without .blueprint.json. The lists
in the sections below sit on this same object.
| Field | Type | Description |
|---|---|---|
version | number | Format version. Always 1. |
kind | string |
Always "blueprint".
|
name | string | Name of the blueprint. Usually the file name without the extension. |
files … steps | arrays | The entities described in the sections below. Every list is optional and defaults to empty. |
files
{1 key}
"files": [1 item]
{4 keys}
Files the blueprint adds. This one is src/todo/TodoApp.tsx: its
id and path are that path, its name is
TodoApp.tsx, and its folder is src/todo. A file
that already exists belongs in pointers instead.
| Field | Type | Description |
|---|---|---|
id | string | Unique id. The same value as path. |
name | string | File name with extension, such as TodoApp.tsx. |
path | string | Full path from the project root. |
folder | string | Path of the folder the file sits in. |
All four fields are required strings.
LLM instruction example
A file is a new file the plan creates. A file that already exists is a pointer, not a file.
folders
{1 key}
"folders": [2 items]
{4 keys},
{4 keys}
Folders the blueprint adds. Each level is its own entry:
src/todo/components sits next to src/todo, and its
parent is src/todo.
| Field | Type | Description |
|---|---|---|
id | string | Unique id. The same value as path. |
name | string | Last segment of the path, such as todo. |
path | string | Full path from the project root. |
parent | string |
Path of the parent folder. "." means the project root.
|
All four fields are required strings.
LLM instruction example
A folder is part of the folder skeleton the plan creates. Each level is its own entry.
classes
{3 keys}
"classes": [1 item],
{4 keys}
"implements": [1 item]
"functions": [1 item],
{4 keys}
"variables": [1 item]
{3 keys}
A class the blueprint adds, in a file. TodoStore is defined in
src/todo/store/todos.ts. A method is a
function with class set to that name:
addTodo. A field is a variable with
class set to that name: todos. The constructor is one of
those functions, using the name that language uses. extends names its
one parent class, Store. implements names the interfaces
it fulfills, Persistable. addTodo sets
overrides because it replaces a method on that parent. The todo
blueprint has no classes; this snippet is only the shape.
| Field | Type | Description |
|---|---|---|
name | string | Identifier of the class. Required. |
file | string | Path of the file that defines it. Required. Several classes may share one file. |
extends | string | Name of the one parent class. Omit it when the class has no parent. |
implements | string[] | Names of the interfaces or protocols it fulfills. Omit it when there are none. One name per entry. |
Static members and visibility stay in a note. The structure does not give them their own fields.
LLM instruction example
A class is a class the plan adds, in a file.
extendsis its one parent class.implementsnames the interfaces or protocols it fulfills. Its methods are functions withclassset to its name. Its fields are variables withclassset to its name. The constructor is one of those functions.
functions
{1 key}
"functions": [2 items]
{2 keys},
{2 keys}
Functions, methods, components, and hooks the blueprint adds.
addTodo is defined in src/todo/store/todos.ts.
TodoItem is defined in src/todo/components/TodoItem.tsx.
file is that path. These two omit class because they are not
methods. A method includes class, as addTodo does on
TodoStore in classes.
| Field | Type | Description |
|---|---|---|
name | string | Identifier of the function. |
file | string | Path of the file that defines it. Required. |
class | string | Name of the class the function belongs to. Omit it when the function is not a method. |
overrides | boolean | True when this method replaces a method on the parent class. Omit it otherwise. |
LLM instruction example
A function is a function, method, component, or hook the plan adds. A method includes
class, the class it belongs to. A method that replaces a parent method setsoverrides.
variables
{1 key}
"variables": [2 items]
{2 keys},
{2 keys}
Constants, shared module state, and config values the blueprint adds.
FILTERS is declared in src/todo/constants.ts.
todos is declared in src/todo/store/todos.ts. Same fields as
functions: name, file, and an optional
class. These two omit class. A field includes it, as
todos does on TodoStore in classes.
LLM instruction example
A variable is a constant, a piece of shared state, a config value, or a field the plan adds. A field includes
class, the class it belongs to.
imports (relations)
{1 key}
"imports": [3 items]
{3 keys},
{3 keys},
{3 keys}
Relations between files. Each entry says that file imports name
from from. src/todo/utils/filters.ts imports Todo
and FilterId from src/todo/types.ts, one entry each.
src/App.tsx imports TodoApp from
src/todo/TodoApp.tsx.
| Field | Type | Description |
|---|---|---|
name | string | The imported symbol. |
from | string | Path of the file that exports the symbol. |
file | string | Path of the file that imports the symbol. |
All three fields are required. Import one symbol per entry. Todo and
FilterId come from the same file, so they are two entries.
LLM instruction example
An import is a relation between two files:
fileimportsnamefromfrom. One symbol is one entry.
notes
{1 key}
"notes": [3 items]
{3 keys},
{3 keys},
{3 keys}
Text attached to a folder, file, class, function, or variable. The folder
src/todo has a note. The file
src/todo/components/TodoItem.tsx has a note. The existing file
src/App.tsx has a note too.
| Field | Type | Description |
|---|---|---|
file | string | Path of the file or folder the note belongs to. For class, function, and variable notes, the file that defines the symbol. |
kind | string | "file", "folder", "class",
"function", or "variable". "file" when
missing.
|
name | string |
Symbol name. Required for class, function, and
variable notes.
|
class | string | Class name. Set it when the note is on a method or field, so the symbol is not confused with another of the same name. |
note | string | The text. |
One note per folder, file, or symbol.
LLM instruction example
A note is an instruction on a file, folder, class, function, or variable. It states the contract or a non-obvious invariant the plan must keep. A note on a method or field includes
class.
pointers
{1 key}
"pointers": [1 item]
{2 keys}
References to a file, folder, class, function, or variable that already exists. This blueprint
has one: the file src/App.tsx. Its note is in notes, and the
TodoApp import into it is in imports.
| Field | Type | Description |
|---|---|---|
kind | string | "file", "folder", "class",
"function", or "variable". Required.
|
path | string | Path of the file or folder. For a class, function, or variable, the file that defines the symbol. |
name | string |
Symbol name. Required for class, function, and
variable pointers.
|
class | string | Class name. Set it when the pointer is a method or field. |
Pointers use path. Notes use file for the same role.
LLM instruction example
A pointer is a reference to a file, folder, class, function, or variable that already exists. Pay attention to it when setting up the plan, and usually edit it. It does not also go in
files,folders, orclasses. A method or field pointer includesclass.
deleted
{1 key}
Paths of files to remove. This blueprint removes none, so the list is empty. An entry
is a path string, the same shape as src/todo/TodoApp.tsx.
LLM instruction example
A deleted entry is an existing file path the plan removes, including its imports, references, and usages.
steps
{1 key}
Ordered steps for building the blueprint. This blueprint has none, so the list is empty. An entry is a string.
LLM instruction example
A step is a suggested sentence for the plan. Decide which are useful and in what order. Keep, merge, split, reword, reorder, or drop them, and add missing ones. They are suggestions, not the plan itself.
Full example
{12 keys}
"files": [13 items],
{4 keys},
{4 keys},
{4 keys},
{4 keys},
{4 keys},
{4 keys},
{4 keys},
{4 keys},
{4 keys},
{4 keys},
{4 keys},
{4 keys},
{4 keys}
"folders": [4 items],
{4 keys},
{4 keys},
{4 keys},
{4 keys}
"functions": [16 items],
{2 keys},
{2 keys},
{2 keys},
{2 keys},
{2 keys},
{2 keys},
{2 keys},
{2 keys},
{2 keys},
{2 keys},
{2 keys},
{2 keys},
{2 keys},
{2 keys},
{2 keys},
{2 keys}
"variables": [3 items],
{2 keys},
{2 keys},
{2 keys}
"imports": [29 items],
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys}
"notes": [15 items],
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys},
{3 keys}
"pointers": [1 item],
{2 keys}
A complete todo app blueprint: the src/todo folder with its store, utils,
and components, the functions and constants in them, the imports between them, a note
per file, and a pointer at src/App.tsx. The lists start collapsed.