Skip to content
Naming Conventions
AutoXXS (320px)XS (375px)SM (640px)MD (768px)LG (1024px)XL (1280px)XXL (1536px)
SketchMaterialiOSTamagui
DataInjectionKeyPatternsServiceTransactionProcessResearchProductQualityPerformanceSpecDomainFunctionTechnologyArchitectureConfigMiddlewareDataDatabaseDrizzleMigrationModelop-sqliteSchemaSQLState ManagementDraftKeystoneMergePatchPatchesPersistenceReactiveRedoStoreUndoTestingDeviceFactoryIsolationTypeScriptZodTopicsCommunicationBidsNVCDesignDesign ImplicationsEducationPedagogyFoundationsPsychologyAttachmentFloodingRelatingAuthentic RelatingUIEditorReact Native

Naming Conventions

Fragment convention Naming Conventions
tags
conventionworkflow

Overview

StarSpec uses two distinct id formats depending on context:

ContextFormatExample
Document frontmatter idkebab-case (unqualified)id: add-bookmark
Document frontmatter domainkebab-case (unqualified)domain: bookmark
Document frontmatter context{type}/{id} with / — the only frontmatter field that uses a qualified referencecontext: [feature/add-bookmark, domain/auth]
Root document tag idSame unqualified value as frontmatter\{% feature id="add-bookmark" %\}
Cross-document references in tag attributes{type}/{id} with /ref="feature/add-bookmark"
In-document child tag idskebab-caseno type prefixid="save-url", name="add-bookmark"

context is the only frontmatter field that uses the {type}/{id} qualified format. All other frontmatter fields (id, domain, tags) use unqualified values. The separator is always / — never :.

Type prefixes are never used on tag ids. The type is always inferred from the tag itself — {% action name="add-bookmark" %} is already an action, so adding action: would be redundant and is a validation error.

Document frontmatter

Standard frontmatter fields control how documents are routed and grouped in the public site:

FieldFormatPurpose
typefixed keywordRequired. Determines the document schema and icon.
idkebab-case (unqualified)Required. The unqualified identifier used in the URL.
titlefree textRequired. Human-readable name used in headings and sidebar.
domainkebab-case (unqualified)Optional. Unqualified domain id (e.g. auth). Documents with the same domain are nested under a domain group in the sidebar.
statusfixed keywordOptional. draft (rendered as warning) or ready.
context{type}/{id} list — qualifiedOptional. List of cross-document references whose {% tldr %} blocks are injected as agent context. This is the only frontmatter field that takes qualified references. Example: [feature/add-bookmark, domain/auth].

Root document tag rule

The id attribute on a root document tag must match the frontmatter id field exactly — no type prefix, no path.

type: flow
id: add-bookmark ← frontmatter
\{% flow id="add-bookmark" ... %\} ✓ matches frontmatter
\{% flow id="flow:add-bookmark" %\} ✗ type-prefixed (validation error)
\{% flow id="flow/add-bookmark" %\} ✗ qualified path

In-document child tag conventions

Identifiers: Tags that use id or name

Every child tag id is a plain kebab-case string — no type prefix. The tag itself provides the type context.

TagFieldExample
\{% requirement %\}idid="save-url"
\{% criterion %\}idid="save-url"
\{% action %\}namename="add-bookmark"
\{% event %\}namename="bookmark-added"
\{% operation %\}namename="get-bookmark"
\{% error %\}idid="bookmark-not-found"
\{% component %\}idid="bookmark-service"
\{% rule %\}idid="no-direct-db"
\{% goal %\}idid="ship-v1"
\{% value %\}idid="simplicity"
\{% principle %\}idid="local-first"
\{% surface %\}idid="login-form"
\{% diagram %\}idid="add-bookmark-flow"
\{% policy %\}idid="rate-limit"
\{% property %\}namename="session-id"
\{% setting %\}idid="default-visibility"

References: Tags that use ref or other pointer attributes

References also use bare kebab-case — no type prefix:

TagPurposeExample
\{% criterion %\}References a requirementrequirement="save-url"
\{% uses %\}References a componentcomponent="bookmark-service"
\{% step %\}References an action or operationaction="add-bookmark"
\{% path %\} (success)Emits an event on this branchemit="bookmark-added"
\{% path %\} (failure)Throws an error on this branchthrows="duplicate-url"
\{% throws %\}References an errorref="bookmark-not-found"
\{% policy %\}Source trigger and reactionsource="add-bookmark" reaction="bookmark-added"
\{% includes %\}References a feature/flowref="feature/add-bookmark"
\{% link %\}References any documentref="domain/auth"

Naming rules by tag type

Actions — imperative verb-noun

Actions represent commands: something requested of the system.

add-bookmark
remove-bookmark
lock-account
expire-session

Use the imperative form. Match the domain verb used in the blueprint loop.

Events — past-tense noun phrase

Events represent facts: something that already occurred.

bookmark-added
bookmark-removed
account-locked
session-expired

The event name is derivable from its triggering action by converting verb-noun → noun-verb(past): add-bookmarkbookmark-added.

Operations — descriptive (read) or imperative (write)

get-bookmark (read)
search-bookmarks (read)
create-bookmark (write)

Errors — descriptive noun phrase

Errors represent a specific domain failure mode.

bookmark-not-found
duplicate-url
insufficient-permissions

Requirements — descriptive noun phrase

Use a phrase that names the behaviour, not an ordinal.

save-url ✓
response-time ✓ (NFR in manifest)
1 ✗ ordinals break on reorder
requirement-1 ✗ redundant wording

Acceptance criteria — mirror their requirement

save-url → save-url
save-url → save-url-invalid-url (failure path variant)

Components — singular noun, kebab-case

bookmark-service ✓
bookmark-repository ✓
bookmarks ✗ plural
BookmarkService ✗ PascalCase

Coherence across document boundaries

When a feature, its flows, its domain actions, and its blueprint components all represent the same operation, the name must match across all of them:

bookmark ← domain name
context: [feature/add-bookmark, flow/add-bookmark] ← document id (cross-doc ref in YAML frontmatter context)
add-bookmark ← flow serving this feature
add-bookmark ← domain action name
bookmark-service ← blueprint component that handles it
add-bookmark-flow ← diagram id

Sub-document references

When a tag id is referenced from another document (e.g. \{% rule ref="..." %\}), use {type}/{id}#{tag-id}:

manifest/product#response-time
feature/add-bookmark#save-url

Common violations

ViolationExampleFix
Root tag id type-prefixed\{% flow id="flow:add-bookmark" %\}\{% flow id="add-bookmark" %\} — match frontmatter
Root tag id uses / format\{% flow id="flow/add-bookmark" %\}\{% flow id="add-bookmark" %\} — unqualified only
Type prefix on child tag idname="action:add-bookmark"name="add-bookmark"
Type prefix on child tag idid="req:save-url"id="save-url"
Type prefix on property namename="prop:session-id"name="session-id"
Ordinal idid="1" on a requirementDescriptive name: id="save-url"
PascalCase in component idid="BookmarkService"id="bookmark-service"
Action in past tensename="bookmark-added" on actionname="bookmark-added" belongs on an event
Event in imperativename="add-bookmark" on eventname="add-bookmark" belongs on an action
Cross-doc ref using :context: [feature:add-bookmark]context: [feature/add-bookmark]