Project File
.litespec/project.yaml is the one record of what a consumer project (an application repository built against one pinned LiteSpec release) selected: its size, shape, technology stacks, extensions, paths, and pinned release. The team edits it when the selection changes and validates it with the litespec model check command before relying on it. This page lists every field the file holds, states what reads each field, and shows the errors a wrong value produces.
On this page
Reference#
The supported scope page states which sizes, shapes, stacks, and extensions a project can select. The stacks page states what selecting a stack applies. The init page states how a new file is written, the model page states how it is validated and how paths feed the project model. Terms such as stack, shape, size, extension, and preset follow the glossary.
File Location and Schema#
| Item | Value |
|---|---|
| Path | .litespec/project.yaml at the consumer root |
| Schema | schemas/litespec-project.schema.yaml in the pinned release |
| Template | templates/consumer/project.yaml in the release the tool carries |
| Presets | templates/presets/android-client.yaml, templates/presets/blazor-client.yaml, templates/presets/dotnet-react.yaml, templates/presets/dotnet-svelte.yaml |
litespec init merges the template with one preset and stamps the size, name, and reviewed release. litespec model check validates the written file against the schema and then runs the selection checks below. The model builder reads the paths, stack config, size, shape, and stacks from the same file.
Top-Level Fields#
| Field | Type | Required | Default |
|---|---|---|---|
schemaVersion |
integer | yes | none |
project |
object | yes | none |
size |
string | yes | none |
layers |
object | yes | none |
explanations |
object | no | none |
shape |
string | no | "server" |
stacks |
array of string | when implementation or proof is claimed |
none |
proof |
object | no | none |
marks |
string | no | "xml" |
dependencies |
object | no | none |
screenshots |
object | no | none |
refusals |
object | no | the default codes |
reviewedLiteSpecVersion |
string | yes | none |
paths |
object | yes | none |
selectedExtensions |
array of object | yes | none |
stackConfig |
object | no | none |
frontends |
array of object | for a client-only project |
none |
ui |
object | no | none |
What each field means and what reads it:
schemaVersionis the shape of this file,1in this release. The editor finds the schema from the first-line comment# yaml-language-server: $schema=<url>, whichlitespec initwrites; no key in the data names it.projectnames the project.litespec model checkchecks it against the schema. See theprojectobject below.sizeissmallorlarge. Small requires the core record types with Architecture and Integration test projects, and large adds goals, problems, features, journeys, and scenarios with the Acceptance project.litespec model checkchecks the value, and the model builder sizes the record set it expects.layersnames the record layers the project claims and the practice each follows. See thelayersobject below.explanationsnames the record layers whose every record page carries an explanation file. See theexplanationsobject below.shapeisserverorclient-only. A server names exactly one backend stack, and a client-only project names no backend stack.litespec initwrites it from the preset,litespec model checkchecks the backend count, and the model builder applies the shape.stackslists the selected stack ids:dotnetfor the backend and one entry per frontend from its platform. It is required when the project claimsimplementationorproof; otherwise a stack is informational.litespec model checkrefuses an id the pinned release does not ship.prooftunes how the model builder confirms proof claims for the project. See theproofobject below.marksis the mark style:xmlfor documentation tags,attributefor generated attributes. The model builder, the analyzers and the source generator read it, and each reports a mark in the other style asmark-style-invalid.dependenciesnames the dependency gate: the licenses every shipped package may carry without an admitting decision. See thedependenciesobject below.screenshotsnames the screenshot galleries the model builder reads for screen captures. See thescreenshotsobject below.refusalsnames the codes the derived generic results carry. See therefusalsobject below.reviewedLiteSpecVersionrecords the LiteSpec release whose complete contract the project last reviewed, such as"6.0.0".litespec model checkcompares it with the release of the installedlitespectool and fails the run when the two differ.pathsdeclares every location the tools read. See thepathsobject below.selectedExtensionslists the extensions the project selected, each with its criterion. See the extension entry below.stackConfigholds per-stack configuration keyed by a stack id the manifest ships. See thestackConfig.dotnetobject below.frontendslists every frontend the project ships. See the frontend entry below.uiholdspackage, the one shared UI package of the workspace. See theui.packageobject below.
The layers Object#
| Field | Type | Required | Default |
|---|---|---|---|
intent |
litespec |
yes | none |
behavior |
litespec |
no | not claimed |
implementation |
litespec or own |
no | not claimed |
proof |
litespec or own |
no | not claimed |
What each field means and what reads it:
- A key that is present claims its record layer; a key left out is not claimed, and no check reads that layer.
litespecfollows LiteSpec's practice for the layer.ownkeeps the project's own practice forimplementationorproofand claims only that code and tests mark the records they serve.- A lower layer needs the one above it:
behaviorneedsintent, andimplementationandproofeach needbehavior. The schema refuses a file that breaks this. litespec model check, the book,litespec rulesand the analyzers report only the claimed layers.
The explanations Object#
| Field | Type | Required | Default |
|---|---|---|---|
layers |
array of string | yes | none |
What each field means and what reads it:
layerslists the record layers whose every record page carries an explanation file:intent,behavioror both, each once: the layers that hold record pages, with each record type on the layer the Project Model gives it. A page on a listed layer without its<name>.mdbeside its record file, or with a required H2 section missing, is anexplanation-missingfinding. A listed layer the project does not claim inlayersis aproject-invalidfinding.- When the object is omitted, explanation files stay optional, except the article types, which always require one.
litespec model checkreads the list from the project file.
The project Object#
| Field | Type | Required | Default |
|---|---|---|---|
name |
string | yes | none |
What each field means and what reads it:
nameis the project name, such as"shop".litespec initsets it from--nameor from the root folder name.
The proof Object#
| Field | Type | Required | Default |
|---|---|---|---|
jobTriggerSteps |
array of string | no | none |
outcomeOnlySteps |
array of string | no | none |
What each field means and what reads it:
jobTriggerStepsnames the steps classes whosewhensteps run a job, such as one that moves a simulated clock. Each entry matches^[A-Z][A-Za-z0-9]*$.outcomeOnlyStepsnames the steps classes whosethensteps state only that a request succeeded or was refused. Each entry matches^[A-Z][A-Za-z0-9]*$.- The model builder reads both lists when it confirms proof claims for the project.
The dependencies Object#
| Field | Type | Required | Default |
|---|---|---|---|
licenses |
array of strings | no | none |
licenseslists the SPDX license identifiers the project accepts, such asMITandApache-2.0. A shipped package under any other license needs an admitting decision that names it.
The screenshots Object#
| Field | Type | Required | Default |
|---|---|---|---|
galleries |
array of string | no | none |
pattern |
string | no | "{route}--{theme}--{width}.png" |
What each field means and what reads it:
gallerieslists the gallery folders holding screenshot captures, one per frontend that photographs its routes, such as"apps/web/test-results/gallery". The model builder reads the captures from these folders.patternis the capture file-name pattern, with{route}for the route slug,{theme}for the theme, and{width}for the width in pixels. When omitted, the default pattern applies.
The refusals Object#
| Field | Type | Required | Default |
|---|---|---|---|
forbidden |
string | no | "authorization.forbidden" |
invalidInput |
string | no | "request.validation-failed" |
composed |
string array | no | none |
What each field means and what reads it:
forbiddenis the code the derivedresult/<use-case>.forbiddencarries, derived for a use case whoseaccess.grantis a permission.invalidInputis the code the derivedresult/<use-case>.invalid-inputcarries, derived for a use case with anyinputfield carryingrules.composedlists the refusal codes the project builds at run time from a key, each a template with one{key}placeholder after a prefix and a dot, such as"uniqueness.{key}-taken"for the conflict a commit answers when an aggregate loses a uniqueness key. Therefusal-unimplementedcheck counts a code matching a template as raised when its key is a kebab-case literal in the code, such as the key scopecopy-barcodeon the book aggregate foruniqueness.copy-barcode-taken.- The model builder reads
forbiddenandinvalidInputwhen it derives the generic results. When the object is omitted, the defaults apply.
The paths Object#
| Field | Type | Required | Default |
|---|---|---|---|
docs |
string | no | .litespec |
glossary |
string | no | .litespec/glossary.yaml |
behaviorDocs |
string | yes | none |
testRoots |
array of string | no | none |
testResults |
string | no | TestResults |
contract |
string | no | none |
alerts |
array of strings | no | none |
operations |
array of strings | no | none |
checkResults |
string | no | .litespec/proof/checks |
sbom |
array of strings | no | none |
apiClient |
string | no | packages/api |
uiPatterns |
string | no | .litespec/implementation/patterns/catalog.yaml |
What each field means and what reads it:
docsis the root of the specification tree. Every record file under it holds one record page, with an explanation file beside it where one exists, and every other Markdown file is a document. Whendocsis omitted, the tools use.litespec.glossarynames the project glossary.litespec model checkvalidates it and scans the pages against its rejected words and mannered terms.behaviorDocsnames the behavior documentation root. It is required.testRootslists the directories that hold automated test source. The model builder reads scenarios from these roots.testResultsnames where the latest test run results live, so passing and failing proof is read from them.contractnames the committed OpenAPI document, solitespec model checkcompares each operation'sx-litespec-use-casewith its endpoint's mark.alertsnames the alert rule files or folders, in the YAML shape Prometheus rule files and Grafana alert provisioning share, so each rule'srequirementandrunbooklabels are checked and the alert inventory is rendered from them.operationsnames the deployment, proxy, host, and CI workflow files or folders that carryfollowsmarks in their#comments; below a named folder every file counts except Markdown documentation.checkResultsnames where drill and harness check results live, read beside the measured-check results undertestResults.sbomnames the bill of materials files or folders, SPDX or CycloneDX JSON, checked against the manifest pins, the admissions, anddependencies.licenses.apiClientnames the generated API client the frontends import, so route calls resolve to the use cases they reach. The model builder appendssrcto the configured path, and the reader takes operations only from the files the client generator writes (*.gen.ts), so a hand-written helper beside them is not an operation.uiPatternsnames the workspace UI pattern catalog when it is not at the default path.
The stackConfig.dotnet Object#
| Field | Type | Required | Default |
|---|---|---|---|
modules |
string | no | apps/api/src/*.Modules |
sharedKernel |
string | no | apps/api/src/*.SharedKernel |
domain |
string | no | apps/api/src/*.Domain under layer-projects, none otherwise |
infrastructure |
string | no | apps/api/src/*.Infrastructure under layer-projects, none otherwise |
webapi |
array of string | no | apps/api/src/*.WebApi |
worker |
array of string | no | apps/api/src/*.Worker |
templateStore |
string | no | none |
What each field means and what reads it:
modulesis the code root the model builder reads: the modules project holding every module. A*in one segment expands to the first matching folder.sharedKernelnames the shared kernel project holding what every module builds on, where reasonless names are allowed. When omitted, the default applies andlitespec model checkreportsname-reason-missingfor every reasonless folder or type outside it.domainandinfrastructurename the Domain and Infrastructure projects the model builder reads, underlayer-projectsonly. Without that extension they default to none.webapiandworkername the web and worker host projects the model builder reads: a list with one path per host.templateStorenames the one C# file holding the notification template store: its top-level dictionary keys are the template keys, and its texts write parameters as{{PascalCaseName}}. When omitted, the template checks stay silent.
The ui.package Object#
| Field | Type | Required | Default |
|---|---|---|---|
name |
string | yes | none |
path |
string | yes | none |
componentsJson |
string | yes | none |
primitives |
string | yes | none |
tokens |
string | yes | none |
sourceLock |
string | yes | none |
designContract |
string | yes | none |
publicExports |
array of string | yes | none |
What each field means and what reads it:
nameis the package name, such as"@shop/ui".pathis the package root, such as"packages/ui".componentsJsonis the registry configuration,primitivesis the directory that holds the registry source the pinned CLI copied in,tokensis the token stylesheet,sourceLockis the source lock, anddesignContractis the design contract.publicExportslists the entry points applications import, with at least one entry. A primitive the composites are built from is not one of them.litespec model checkreports a missingui.packagewhen a controlled frontend is declared without one, and validates every listed file. A controlled frontend is one whose platform isreactorsvelte.
A frontends Entry#
| Field | Type | Required | Default |
|---|---|---|---|
name |
string | yes | none |
path |
string | yes | none |
platform |
string | yes | none |
entryPoint |
string | no | the entry points of its screens |
refusalDictionary |
string | no | none |
routeSuite |
string | no | none |
visualGoldens |
string | no | none |
ui |
object | no | none |
What each field means and what reads it:
nameis the frontend name, such as"web". It matches^[a-z][a-z0-9-]*$.pathis the frontend directory, such as"apps/web".litespec model checkreports a frontend whose directory does not exist.platformisreact,svelte,blazor, orandroid. Every entry declares it, so a frontend outside the controlled UI contract still declares that position instead of omitting the field. Areactorsveltefrontend is controlled and requires auiblock and the shared package. Ablazororandroidfrontend is skipped by the controlled UI check.entryPointnames the browser or device entry point the frontend serves, such as"entry-point/claimwick-app". The model builder reads the frontend's screens, use cases and records file through it. Without it, the entry points its screens name decide, and before any screen exists every browser entry point does.refusalDictionarynames the file or folder holding that frontend's refusal dictionary: one sentence per refusal code, keyed by the refusalcode. The model builder reads it forrefusal-sentence-missing, so a refusal a screen can reach is shown from that frontend's own words.routeSuitenames the file or folder holding that frontend's route suite. The model builder reads it for the route-suiteprovescheck, so the suite has a named subject instead of a convention.visualGoldensnames the folder holding that frontend's visual goldens. The model builder reads it for the same check, so a golden outside the named folder proves nothing.uiholdsprofile, which is required, andglobalCss, which is optional. The profile is one ofpublic-light,application-balanced, oradmin-dense. TheglobalCssvalue is the one stylesheet the frontend declares, and it imports the shared package tokens.litespec model checkchecks the profile value and the stylesheet path.
A selectedExtensions Entry#
| Field | Type | Required | Default |
|---|---|---|---|
id |
string | yes | none |
criterion |
string | yes | none |
releaseStage |
string | for stage |
none |
decision |
string | no, only on audit |
none |
What each field means and what reads it:
idis the extension id in the pinned manifest, such as"locale".litespec model checkrefuses an id the pinned release does not ship and lists the known ids.criterionstates the criterion that was met, such as"The product ships in English and Dutch.".litespec/core/scope#record-selected-extensionsrequires the entry, andlitespec/core/scope#select-conditional-extensions-explicitlyrequires selecting an extension only when its criteria apply.releaseStageispre-productionorproduction, and only thestageextension carries it, which the schema enforces.decisionnames the audit adoption decision by its identifier, and only theauditextension carries it.litespec rulesreturnslitespec/ext/audit#record-the-audit-adoption-decisionfor that decision alone.
Placeholders and the Init Fill#
The template names the project as __PROJECT__ in paths and package names. litespec init fills every __PROJECT__ value with the --name value, or with the root folder name when --name is omitted; in an npm package scope such as @__PROJECT__/ui it writes that name in lowercase kebab case, because npm names are lowercase. After it writes the file it prints Next step: dotnet litespec model check. litespec model check treats a leftover placeholder as an error and names each one:
.litespec/project.yaml: template placeholder '__PROJECT__' is not filled [litespec/core/scope#select-a-size-a-shape-and-stacks]A preset without a controlled web frontend, such as blazor-client or android-client, declares no package that a frontend uses, so litespec init removes ui and paths.uiPatterns from the written file.
A Complete Example#
This example shows the file litespec init --preset dotnet-react --size small --name shop writes from the template and the dotnet-react preset. It ran against release 6.0.0. The preset selects shape server, stacks dotnet and react, and one react frontend web at apps/web.
# yaml-language-server: $schema=https://litespec.dev/6.0.0/schemas/litespec-project.schema.yaml
schemaVersion: 1
project:
name: shop
size: small
shape: server
stacks:
- dotnet
- react
layers:
intent: litespec
behavior: litespec
implementation: litespec
proof: litespec
reviewedLiteSpecVersion: 6.0.0
screenshots:
galleries:
- apps/web/test-results/gallery
pattern: '{route}--{theme}--{width}.png'
paths:
docs: .litespec
behaviorDocs: .litespec/behavior
testRoots:
- apps/api/tests
stackConfig:
dotnet:
modules: apps/api/src/shop.Modules
sharedKernel: apps/api/src/shop.SharedKernel
frontends:
- name: web
path: apps/web
platform: react
ui:
package:
name: '@shop/ui'
path: packages/ui
componentsJson: packages/ui/components.json
primitives: packages/ui/src/components
tokens: packages/ui/src/styles/tokens.css
sourceLock: packages/ui/ui-source-lock.yaml
designContract: packages/ui/DESIGN.md
publicExports:
- '@shop/ui/floorplans'
selectedExtensions: []The other three presets differ only in shape, stacks, frontends, and the shared package. dotnet-svelte selects shape server, stacks dotnet and svelte, and one svelte frontend web at apps/web. blazor-client selects shape client-only, stack blazor, and one blazor frontend app at apps/app, with no ui and no uiPatterns. android-client selects shape client-only, stack android, and one android frontend android at apps/mobile/src/{ProjectName}.Android, with no ui and no uiPatterns. The init page states all five presets. The records preset selects shape server, the intent and behavior layers, and no stacks or frontends.
Validation Errors#
litespec model check validates the project record, the pinned release, the stacks, the extensions, and the frontends. The messages below are quoted from the validator. The schema check runs first, so a wrong type or an unknown field reports a schema problem before these messages appear.
| Mistake | Message |
|---|---|
| A placeholder is left in the file | .litespec/project.yaml: template placeholder '__PROJECT__' is not filled [litespec/core/scope#select-a-size-a-shape-and-stacks] |
| The installed release and the reviewed release differ | .litespec/project.yaml: reviewedLiteSpecVersion '3.0.0' does not match the installed LiteSpec tool release 6.0.0; install the reviewed release with 'dotnet tool update LiteSpec.Cli --version 3.0.0' and 'dotnet tool restore' for the .NET tool, or rerun the install script in the project root for the standalone binary, or re-review the contract and record 6.0.0 |
| The reviewed release is missing | .litespec/project.yaml: missing 'reviewedLiteSpecVersion'; the installed LiteSpec tool release is 6.0.0 |
| A stack id is unknown | .litespec/project.yaml: stack 'rails' is not a stack the pinned LiteSpec release ships [litespec/core/scope#select-a-size-a-shape-and-stacks] |
| A client-only project names a backend stack | .litespec/project.yaml: shape 'client-only' names backend stack 'dotnet'; a client-only project names no backend stack [litespec/core/scope#select-a-size-a-shape-and-stacks] |
| A server names zero or two backend stacks | .litespec/project.yaml: stacks name 0 backend stacks; name exactly one of dotnet [litespec/core/scope#select-a-size-a-shape-and-stacks] |
| An extension id is unknown | .litespec/project.yaml: extensions 'search' is not an extension in the pinned LiteSpec release; known ids are ai, audit, bdd, cache, compat, concurrency, customer-rules, delivery, devices, integrations, jobs, layer-projects, lifecycle, locale, mcp, outbox, plans, realtime, stage, tenancy |
| A frontend declares no platform | .litespec/project.yaml: frontend 'web' declares no 'platform'; one of android, blazor, react, svelte is required [litespec/core/scope#select-a-size-a-shape-and-stacks] |
| A frontend names a stack the project does not select | .litespec/project.yaml: frontend 'web' platform 'react' is not a stack the project names in stacks [litespec/core/scope#select-a-size-a-shape-and-stacks] |
| A controlled frontend has no shared package | .litespec/project.yaml: 1 controlled frontend(s) and no 'ui.package'; the shared UI package every controlled web frontend composes is undeclared |
| A configured path does not exist | .litespec/project.yaml: paths.docs 'docs' does not exist; the page scan finds no record to check |
The last row stands for every configured path: the message names the field, the missing path, and the check that goes quiet. The docs root, the glossary, each frontend directory, each ui.package file, and each frontend stylesheet follow this shape.
Notes#
The field lists follow schemas/litespec-project.schema.yaml and the consumer template. The init behavior follows apps/cli/src/LiteSpec.Cli/Init/InitCommand.cs. The validation messages follow apps/cli/src/LiteSpec.Cli/Model/Consumer/ProjectFileChecks.cs and apps/cli/src/LiteSpec.Cli/Model/Consumer/GlossaryChecks.cs. The path defaults follow apps/cli/src/LiteSpec.Cli/Model/Configuration/ConsumerConfig.cs. The presets are templates/presets/dotnet-react.yaml, templates/presets/dotnet-svelte.yaml, templates/presets/blazor-client.yaml, and templates/presets/android-client.yaml, read with templates/consumer/project.yaml. Example sections stay within 120 words; the project file carries no setting for the bound.