Use with Agents
An AI coding agent follows LiteSpec only when it reads the rules before it writes code. Every LiteSpec page is published as plain Markdown that an agent can fetch. This page sets that up: answer four questions about your project and commit the block they produce to its AGENTS.md file, which agents read at the start of every session, or read how LiteSpec works and start one session with a prompt.
Set Up Your Project
Tailor It to Your Project
For a repository you keep working in. Your answers pick a selection index: a Markdown file,
llms.txt, that lists only the LiteSpec pages your project applies, so the agent never loads rules for a stack the project does not use.Copy It into Your Project
Paste this block into the
AGENTS.mdfile at the root of your repository and commit it. An agent that readsAGENTS.mdat the start of a session then loads your selection index before each task.AGENTS.md Block
<!-- generated:agent-protocol --> When this file disagrees with `dotnet litespec rules`, `dotnet litespec model query` or a record, the tool output and the record win; this file only points to them. This project follows LiteSpec 6.0.0: size small, shape server, stacks dotnet, react, extensions none. Layers: intent and behavior: litespec, implementation and proof: litespec. Before a task, read https://litespec.dev/6.0.0/select/server.dotnet.react/llms.txt and fetch only the pages the task touches. UI work: the pattern pages listed in that index. Read `.litespec/project.yaml` before changing the project. (litespec/core/agent#select-task-context) Follow one order on every task: query the model for the records, run `dotnet litespec rules <path>` for each file to edit, read the pages `rules` cites, then read neighboring code. (litespec/core/agent#select-task-context, litespec/core/agent#load-applicable-provisions-before-editing, litespec/core/agent#inspect-local-examples-after-standards) `dotnet litespec model query <record-id>` returns one record with its links. Query the record before changing behavior it describes, and query again when a link leads further. (litespec/core/agent#select-task-context) Run `dotnet litespec rules <path>` before editing a file. (litespec/core/agent#load-applicable-provisions-before-editing) Answer each judgment provision `dotnet litespec rules --since <base>` lists before reporting done. (litespec/core/agent#load-applicable-provisions-before-editing) Write each record from a record in the layer above it, and never compute a record from code. (litespec/core/layers#write-each-layer-from-the-layer-above-it, litespec/core/model#keep-code-out-of-intent-and-behavior-fields) Build only what the specification states, and take anything missing to the owner. (litespec/core/layers#implement-only-declared-behavior, litespec/core/layers#raise-open-needs-as-owner-questions-or-backlog-items) Never delete, skip, or weaken a test that proves a scenario, or change its expected values, unless the scenario changed in the same change; report a test you believe is wrong instead of editing it. (litespec/core/agent#protect-proofs-from-implementation-edits) Declare every edge between use cases, reactions, jobs, notifications, integration events, and external systems. An undeclared edge is the defect. (litespec/core/system#declare-every-edge-between-records) A project departure record sets a Standard aside only when it names the provision ID, with its reason, and with an expiry date when the gap is meant to close. (litespec/core/agent#apply-guidance-precedence) An explicit project convention in `.litespec/governance/conventions/` can replace a baseline Convention when it cites the Convention's ID. (litespec/core/agent#apply-guidance-precedence) Read `.litespec/intent/product.yaml` and the affected module's feature files before changing behavior that touches money, payouts, or terms. (litespec/core/intent#keep-intent-in-its-homes) Record a product decision for any changed product choice. Research outside `.litespec/` is source material, never authority. (litespec/core/intent#treat-generated-research-as-source-material) <!-- /generated:agent-protocol -->
How It Works
Read the Learn Pages
The agent applies the rules, but you decide what it may do on its own and you review what it brings back. These 7 pages explain the rules and how LiteSpec's parts fit together, in reading order. They take about 43 minutes in all.
- Why LiteSpec Exists4 min
The problem LiteSpec solves, for a team that is deciding whether LiteSpec fits.
- How LiteSpec Works6 min
The parts, the layers, the record homes, and how to read a specification.
- Read the Standard6 min
Project selections, page arrangement, and provision IDs; how to find the rules that apply to a project.
- Work with Agents6 min
How an agent finds the rules, what it decides alone, and what it brings back.
- Adopt LiteSpec in Steps3 min
Adopting LiteSpec by record layer: the record model first, then code traced to records, then LiteSpec's layers, with the records path through the tutorial.
- How LiteSpec Compares14 min
LiteSpec beside 14 other approaches to spec-driven development, and when each fits.
- Lineage4 min
The practices LiteSpec borrows from, the words it takes from each, and what it does differently.
- Why LiteSpec Exists4 min
Start a Session with One Prompt
Paste this prompt into an agent session to try LiteSpec without setting anything up. The agent reads the site index, picks the selection index that matches your project's shape and stacks, and fetches only the pages each task needs. The setup lasts for that session only.
Prompt for Your Agent
Read https://litespec.dev/llms.txt. Pick the selection index that matches this project's shape and stacks, then fetch only the pages each task touches.Install the Skill
Install the LiteSpec skill so the agent loads the LiteSpec procedure on demand when it works in a repository that holds a
.litespec/project.yamlfile. With no flags the command covers Claude Code and OpenCode; the skill command lists the agent and scope options.Skill Command
dotnet litespec skill add