Browse pages
LiteSpec
LiteSpec is a system for building software from written records: the records state the required behavior, and people and agents build, verify, and operate against them. This page states what that system is and which parts it combines, while the intent, behavior, access, layers, and model pages state the records and the rules between them. A team starting a project reads it first, so every later choice lands in one shared model joining intent to code.
Stack: any
Layer: records
Concepts#
Product Scope#
LiteSpec specifies one bounded-context business application: the behavior the application performs, the data it holds, and the limits it enforces. An Intent or Behavior record states only behavior the application performs, data it holds, or a limit it enforces. Running the company that builds the application sits outside the standard: a price as an offer, a market, a hiring or sales action, a launch calendar, a company goal and a founder risk enter a consumer's records only as a constraint, a limit the application enforces or an authority imposes, or as dated research. Plan entitlements the software enforces stay as application behavior in settings and permissions; the price list as a company offer does not.
LiteSpec names responsibilities instead of departments: product, domain, architecture, implementation, testing, release, and operations responsibilities, and one person can hold all of them at the same time.
Agents perform a substantial part of the engineering work. An agent can inspect repositories, propose designs, edit authorized artifacts, run tools, and collect evidence. An agent never decides unresolved product policy, legal judgment, or financial decisions; those stay with accountable people.
Because agents do so much execution, the system defines its technical concepts exactly. An agent tells a module from an aggregate, a journey from a reaction or job, and a record from a claim the implementation makes about itself.
Why the System Exists#
Two capable contributors can answer one request with different boundaries, names, transaction behavior, and verification. Each result can compile while the workspace loses a coherent model. The same happens with two agents, or with one agent on two different days.
The system addresses five recurring problems:
- Product intent is lost between a request and its implementation.
- An agent invents a missing rule when a record leaves a decision implicit.
- Standard technical concepts are renamed until developers no longer recognize the established pattern.
- A use case ships one part while persistence, public entry points, tests, or operating impact stay incomplete.
- Documentation claims behavior that code and automated evidence do not support.
The system makes the record durable and the agent replaceable: a different person, model, or tool continues from the same records and reaches the same required boundaries.
Connected Layers#
The name has two parts. Lite means a consumer adopts one bounded context, one size, and its selected stacks, and nothing more. Spec means written records and provisions define the work, and agents and people build and verify against them.
The system holds one delivery approach and one operating model:
| Layer | Meaning | Concrete Example |
|---|---|---|
| LiteSpec | The complete product specification: standards, records, implementation, verification, and the operating behavior the application performs. | The repository structure, provision IDs, templates, tests, runbooks, and release records. |
| Record-Driven Delivery | Records select work and define completion. | use-case/spending.submit-expense defines behavior before its handler, endpoint, and tests are accepted. |
| Agent-Driven Engineering | Agents perform substantial engineering execution within stated scope and report decisions that need an accountable person. | An agent loads the submission record, implements it, runs its checks, and reports an unknown access rule. |
Driven means engineering work starts from a record, and completion is judged against that record. A record outlives one agent session in the workspace, which is what makes it more than a prompt.
Agent-driven describes who performs the execution. It never transfers business decision authority to the agent.
What the System Combines#
The system combines product intent, domain behavior, access control, and the operating behavior the application itself performs into one specification that joins intent to code. The intent page states goals, problems, features, constraints, research, decisions, requirements, journeys, modules, and roles. The behavior page states the bounded context, the glossary, aggregates, rules, events, use cases, results, scenarios, reactions, jobs, notifications, and settings. The access page states actors, permissions, entry points, and external systems. The layers page states how each record layer is written from the one above it, and the model page states records, identifiers, links, authority, authoring order, verification, and the builder that computes how intent connects to code. What the builder computes lives in litespec/core/model#compute-proof-statuses-in-the-builder. The mark rules keep their one home on the model page, and the Write Code for a Use Case page states where each code element goes, the mark it carries, and what checks it.
Each page owns its tables and rules, and this page cites them without copying. A reader who needs a record type, a link field, or the authority order opens the owning page.
Standards#
Keep Decision Authority with Accountable People#
ruleruleguidancelitespec/core/system#keep-decision-authority-with-accountable-peopleAn agent MUST stop affected work and take to an accountable person an unknown fact that changes behavior, money, data, access, or recovery.
Applies toartifact: any
Why
Agents meet unknowns in the middle of a task: an unknown access rule, an unclear retention limit, a missing recovery target. When the answer changes behavior, money, data, access, or recovery, only an accountable person can give it. Stopping and taking the question to that person keeps the choice visible instead of buried in code nobody stated. Accountable people decide outcomes, terms, policies, and criteria, and an agent contribution stays a proposal until one of them accepts it.
Checka reviewer answers
Reviewed forThe change report naming the unknown fact, the person asked, and the record carrying the answer.
Marked guidance: a reviewer answers this question.
Drive Work from Records#
ruleruleguidancelitespec/core/system#drive-work-from-recordsAn agent MUST start behavior work from the Intent records and the Behavior records that own the behavior.
Applies toartifact: any
Why
A prompt, ticket, chat message, or code comment can start work, but none of them holds the stated behavior. Starting from the owning records keeps the agent building what the records state, and keeps the records as the lasting statement of what the code does. Without this rule, each task reinterprets intent from its starting message, and the records drift from the code until nobody trusts either.
Checka reviewer answers
Reviewed forThe change report listing the Intent and Behavior records the work started from.
Marked guidance: a reviewer answers this question.
Point Code and Tests up to Records#
rulerulecheckablelitespec/core/system#point-code-and-tests-up-to-recordsEvery code element the marks table on the model page assigns a mark MUST carry one naming the record it serves, with each handler marking exactly one record.
Applies toartifact: any; conformance: traced
Why
The mark is the link from Implementation to Behavior and from Proof to the scenario it proves, in the two kinds the model page states: implements names the record served and follows names the choice followed. A folder or a type name only resembles the record, and a resemblance drifts with the next rename; a mark holds the identifier, so the checks, the analyzers and the editor follow the same link without guessing. One record per handler keeps each file answerable to one use case. Nothing above Implementation is computed from code, so the link points up and the records stay the authority.
Example
The reimburse-expense handler carries a mark naming use-case/spending.reimburse-expense, the Reimburse method on the expense root carries the same mark, and the reminder event handler carries a mark naming reaction/spending.send-approver-reminder-on-expense-submitted.
Checkchecked by a tool
Checked bylitespec model check reports mark-missing, mark-unknown and mark-count-invalid (check level S) for a code element with no mark, a mark naming no record of the type its element takes, or a handler marking other than one record.
Marked checkable: the tool named here checks it.
Point Every Technical Class up to Its Record or Choice#
rulerulecheckablelitespec/core/system#point-every-technical-class-up-to-its-record-or-choiceEvery technical class the marks table on the model page names MUST carry at least one mark: an implements mark naming a Behavior record it serves, or a follows mark naming the LiteSpec provision, decision, or exception that shapes it.
Applies toartifact: any; conformance: traced
Why
Every class in the outer layers exists for a record or for a reason. An input validator or a read model serves one use case, and a repository serves one aggregate, so each names that record in implements like the handler beside it. Code that serves no record still exists for a reason: a provision requires it, a technical decision chose it, or an exception allows it, and a follows mark names that reason by identifier. The named target is the reason for the shape the class carries, so review judges a follows mark by whether its target requires that shape. A reader asking why the command pipeline commits once, or why the repository stores documents, follows the link instead of guessing, and a check finds the code that still follows a deleted decision. A class may carry both kinds when it serves a record in a chosen way.
Example
The Claimwick submit-expense validator carries /// <implements>use-case/spending.submit-expense</implements>. The receipt PDF renderer carries /// <follows>decision/0005-render-receipts-as-pdf</follows>, and the command pipeline's commit step carries /// <follows>litespec/backend/persistence#commit-each-command-pipeline-once</follows>.
Checkchecked by a tool
Checked bylitespec model check reports mark-missing and mark-unknown (check level S), and dotnet build reports LS5001 and LS5002, for a technical class with no mark, an implements mark naming no Behavior record, or a follows mark naming no provision of the carried release, no decision or exception, or a provision on a page the project's stacks do not apply.
Marked checkable: the tool named here checks it.
Declare Every Edge Between Records#
rulerulecheckablelitespec/core/system#declare-every-edge-between-recordsEvery edge between use cases, reactions, jobs, notifications, integration events, and external systems MUST be declared in a record and checked.
Applies toartifact: any
Why
The declared edges form the effect graph the checks verify: an undeclared edge is the defect, not the mechanism that carries it. The graph holds no cycles except through domain events with a stated end condition. An inline edge states whether it shares the caller's transaction, and atomic consistency spans no async edge. The behavior page states the edge fields, and the layers page states how Implementation is checked against them.
Checkchecked by a tool
Checked bylitespec model check emits no effect-undeclared or effect-loop-invalid finding across use cases, reactions, jobs, notifications, and integration events, and reports effect-unimplemented (check level A) for a declared edge no code takes.
Marked checkable: the tool named here checks it.
Deliver One Complete Use Case#
ruleruleguidancelitespec/core/system#deliver-one-complete-use-caseA use case MUST complete with behavior, persistence, entry points, evidence, and operating impact.
Applies toartifact: record:use-case
Why
A use case is done only when a caller can run it and operations can support it: behavior, storage, entry points, automated evidence, and operating impact together. Accepting a thinner slice leaves the missing parts for later, and later rarely itemizes what shipped half-built. Placeholder work leaves the use case unimplemented. Multi-step product outcomes belong to a journey rather than stretching one use case across several goals.
Example
A use case without its tests and operating records is not complete.
Checka reviewer answers
Reviewed forThe use case page with its behavior, persistence, entry points, tests, and operating records present.
Marked guidance: a reviewer answers this question.
Update Records with Behavior#
ruleruleguidancelitespec/core/system#update-records-with-behaviorAn observable behavior change MUST update its use case page, implementation, tests, product records, decision, journey, and operating records together.
Applies toartifact: any
Why
Records map to current names and paths only when each behavior change carries them along. A change that moves code but leaves the use case page, the tests, or the journey behind splits the project into stated fiction and unstated fact. Updating the records in the same change keeps the change to behavior and the change to its description in one place.
Checka reviewer answers
Reviewed forThe behavior change with its use case page, tests, product records, decision, journey, and operating records changed together.
Marked guidance: a reviewer answers this question.
Conventions#
Use the Docs Layout on the Model Page#
conventiondefaultguidancelitespec/core/system#use-the-docs-layout-on-the-model-pageUse the docs layout the model page states under The Docs Layout, creating a directory only when its first real artifact exists.
ReplacementA consumer names its own documentation layout in its project documentation.
Applies toartifact: any
Why
One home for the docs layout means the folders and the record layers stay in one table. A second tree beside it drifts with the next reorganization, and readers follow the stale one.
Checka reviewer answers
Reviewed forThe docs/ tree matching the layout the model page states, or the project documentation naming the replacement layout.
Marked guidance: a reviewer answers this question.
Group Module Use Case Files by Aggregate#
conventiondefaultguidancelitespec/core/system#group-module-use-case-files-by-aggregateGroup module use case files under a plural kebab-case aggregate subdirectory, each holding that aggregate's page; a module with one aggregate of the module's own name may stay flat.
ReplacementA consumer names its own module file grouping in its documentation.
Applies toartifact: record:use-case
Why
Each aggregate needs its own directory for its page and use cases, so grouping use case files under a plural kebab-case aggregate subdirectory gives every aggregate one home. A module with one aggregate of the module's own name may stay flat, avoiding a repeated segment such as modules/products/products/. The use case identifier stays use-case/<module>.<name>; only the directory changes.
Checka reviewer answers
Reviewed forEach use case file under its module directory or its aggregate subdirectory.
Marked guidance: a reviewer answers this question.
Keep Operational and Security References Under Operations#
conventiondefaultguidancelitespec/core/system#keep-operational-and-security-references-under-operationsKeep operating and security reference prose under .litespec/implementation/operations/.
ReplacementA consumer names its own home for operating and security reference prose in its documentation.
Applies toartifact: any
Why
One home for operating and security reference prose means an on-call reader looks in .litespec/implementation/operations/ first and finds the runbooks, limits, and inventories there. Scattering that prose across product and domain pages buries it where an incident never looks. Enforceable security and privacy rules still belong to their owning use case fields and rules, since those are what the code and tests prove.
Checka reviewer answers
Reviewed forOperating and security reference prose under .litespec/implementation/operations/, or the project documentation naming the replacement home.
Marked guidance: a reviewer answers this question.
Use Established Technical Terms#
conventiondefaultguidancelitespec/core/system#use-established-technical-termsUse aggregate, command, query, reaction, job, repository, projection, outbox, idempotency, and transaction with their accepted technical meanings.
ReplacementA consumer names its own technical vocabulary in its documentation.
Applies toartifact: any
Why
Names such as aggregate, command, query, reaction, job, repository, projection, outbox, idempotency, and transaction carry established meanings that developers and agents already share. Replacing one with a softer synonym hides the pattern and forces every reader to guess what the new word covers. When a term is unfamiliar, explain it and give an example instead of renaming it.
Checka reviewer answers
Reviewed forProse using aggregate, command, query, reaction, job, repository, projection, outbox, idempotency, and transaction with their accepted meanings.
Marked guidance: a reviewer answers this question.
Use Ordinary Capitalization in Prose#
conventiondefaultguidancelitespec/core/system#use-ordinary-capitalization-in-proseWrite module, aggregate, use case, journey, rule, event, and decision as ordinary nouns in prose.
ReplacementA consumer names its own capitalization rule in its documentation.
Applies toartifact: any
Why
Lowercase module, aggregate, use case, journey, rule, event, and decision read as ordinary nouns, while exact record types and code types keep their declared capitalization. The contrast tells a reader whether a word names the concept or the artifact. Capitalizing both blurs that distinction on every page.
Checka reviewer answers
Reviewed forProse writing module, aggregate, use case, journey, rule, event, and decision in lowercase outside names and identifiers.
Marked guidance: a reviewer answers this question.
Reference Example#
This informative example demonstrates litespec/core/system#deliver-one-complete-use-case, litespec/core/system#update-records-with-behavior, litespec/core/system#point-code-and-tests-up-to-records, litespec/core/system#declare-every-edge-between-records, and litespec/core/model#compute-proof-statuses-in-the-builder.
The use-case/spending.submit-expense use case is complete only with its behavior, persistence, entry points, tests, and operating records. A change to the receipt threshold updates the use case page, the tests, the requirement, the decision, the journey, and the operating records in the same change. The handler mark points up to the use case record, every edge the change adds is declared on its record, and the book marks the chapter verified only after the tests pass.