feature / add
Description
Section titled “Description”feature (alias add) creates a vertical slice for a named feature: folders/files for your architecture + state management, then syncs router and DI managed regions, updates the lockfile, and runs the quality gate.
Also see:
dart run stackchain feature <name>dart run stackchain feature --name <name>dart run stackchain add <name>Feature names must be snake_case: ^[a-z][a-z0-9_]*$.
Options
Section titled “Options”| Option | Description |
|---|---|
--name, -n |
Feature name (alternative to positional) |
--overwrite, -f |
Overwrite existing generated files |
--dry-run |
Preview only |
--skip-analyze |
Skip analyze in gate |
What it does
Section titled “What it does”- Appends the feature to
stackchain.yamlif new - Generates feature files (+ recipe extras)
- Runs
ProjectSync(router + DI regions) - Updates
.stackchain/lock.yaml - Runs quality gate
For layered + get_it, DI registers the full feature graph: remote datasource, repository, use case, and state class (Bloc / Cubit / Controller).
Named recipes
Section titled “Named recipes”| Name | Extra behavior |
|---|---|
auth |
Richer auth extras (form widget, session/guards integration, tests) |
settings |
Settings-oriented extras + tests |
profile |
Profile-oriented extras + tests |
| other | Baseline slice + smoke/type tests |
Examples
Section titled “Examples”dart run stackchain feature authdart run stackchain add notificationsdart run stackchain feature --name onboarding --dry-runExpected output
Section titled “Expected output”New folders under lib/features/<name>/, updated route/DI regions, YAML feature list update, and a passing (or reported) quality gate.