| name | feature-scaffolder |
| description | Generates a standard Domain-Driven Design (DDD) feature-first directory structure inside the `lib` folder. |
Instructions
When the developer asks to create a new screen, flow, or feature (e.g., 'auth', 'settings', 'shopping_cart'):
Directory Structure
Create a clean DDD folder structure by running commands in the terminal with run_in_terminal or using the create_directory tools. Note that creating empty directories usually requires adding a .gitkeep file to ensure the folder is preserved by version control.
The structure should be placed inside lib/src/features/[feature_name].
Directories to create:
presentation/screens
presentation/widgets
application (For controllers/providers)
domain (For models/entities)
data (For repositories/data sources)
Example PowerShell script to create feature directories:
$feature = "auth" # Replace with actual feature name
$dirs = @("presentation/screens", "presentation/widgets", "application", "domain", "data")
foreach ($d in $dirs) {
$path = "lib/src/features/$feature/$d"
New-Item -ItemType Directory -Force -Path $path
New-Item -ItemType File -Force -Path "$path/.gitkeep"
}
Once scaffolded, inform the user where the structure was created.