Feature creation
A feature is the bridge between user intent and domain behaviour. Features do NOT define domain models β they consume and orchestrate existing domain actions/events.
Dependency Check
Before starting, verify:
- All referenced roles exist in content/roles/ β if not, run
starspec/agents/starscribe/role.createfirst - All referenced domains exist in content/domains/ β if not, run starspec/agents/starscribe/domain.create first
Phase 1 β Intent
Ask:
- What does the user want to accomplish? (one sentence goal)
- What problem does this solve?
- New capability or extension of an existing feature?
Phase 2 β Roles
Which roles use this feature? Do all roles have the same access?
Phase 3 β Domain Touchpoints
Which domains does this feature interact with? Which domain actions does it invoke? Which domain events does it react to?
Derivation note: The domainβs api (actions and events) is the direct source for this featureβs requirements and flows. Work through the domain API before eliciting requirements independently β many are already implied.
Phase 4 β Requirements
Derive requirements from domain actions (Phase 3), then elicit additional ones with MoSCoW:
- must: what the feature must do
- should: what it should do if possible
- could: nice to have
- wont: explicitly out of scope
Use tags for non-functional requirements: performance, security, accessibility.
Phase 5 β Flow Design
Each distinct use case becomes a standalone *.flow.mdoc file. Flows are NEVER embedded in the feature document.
For each flow: which domain actions does it sequence? Pre-conditions? Steps? Branches? Post-conditions? Run starspec/agents/starscribe/flow.create for each flow.
Phase 6 β API
Define the actions and events this feature exposes, derived from domain actions it orchestrates.
Phase 7 β UI
Is there a UI? (form / page / modal / widget / API-only) What are the key interactive elements?
For UI specifications (wireframes), create a standalone *.ui.mdoc file
using the Pug DSL. Run starspec/agents/stardesign/surface.create for each screen.
Link to the feature via the for attribute in the ui tag.
Phase 8 β Acceptance Criteria
For each requirement, write at least one Gherkin criterion:
βGiven [precondition], when [action], then [outcome].β
Link each criterion to its requirement via the requirement attribute.
Phase 9 β Draft & Confirm
Present the complete .feature.mdoc draft for confirmation before writing.
Output: content/features/{id}.feature.mdoc
Doβs and Donβts
Do:
- Verify all referenced roles and domains exist before starting
- Derive requirements from domain actions first, then elicit additional ones
- Create each flow as a standalone file using the flow.create loop
- Link every acceptance criterion to its requirement via the
requirementattribute - Present the full draft for confirmation before writing
Donβt:
- Donβt define domain models in a feature β features consume and orchestrate, they do not define
- Donβt embed flows inside the feature document; flows are always standalone files
- Donβt write requirements that duplicate what the domain already declares
- Donβt skip the dependency check for roles and domains
- Donβt create UI surfaces inline; use the surface.create loop for each screen
Definition of Done
- Draft presented to user for confirmation
- Document written as
content/features/{id}.feature.mdocwith correct frontmatter and root tag - All referenced roles and domains exist in
content/ - Every requirement has at least one Gherkin acceptance criterion
- All flows are created as standalone
.flow.mdocfiles - All cross-references resolve to existing documents
pnpm compilesucceeds