scaffolder
Generates new Wagoe modules with FC/IS structure, tests, and migrations.
Commands
bb scaffold # Show help and all commands
bb scaffold generate # Generate a new module (interactive wizard)
bb scaffold entity # Add an entity to an existing module
bb scaffold field # Add a field to an existing entity
bb scaffold endpoint # Add an endpoint to an existing module
bb scaffold adapter # Generate a new adapter implementation
bb scaffold integrate # Write a module's config key into every profile
The scaffolder works inside an existing project. To create a new project, use the Wagoe CLI:
wagoe new my-app
|
Note
|
bb scaffold new was removed. It had its own project generator, separate
from the wagoe new templates, and the two drifted until it emitted a project
with no Wagoe dependencies and no entry point.
|
Generating a module
Interactive wizard (recommended)
bb scaffold generate
The wizard guides you through the options, shows a summary, prints the equivalent raw command, then runs the generator.
Non-interactive
bb scaffold generate \
--module-name product \
--entity Product \
--field name:string:required \
--field sku:string:required:unique \
--field price:decimal:required
# Preview without writing
bb scaffold generate --dry-run --module-name product --entity Product \
--field name:string:required
AI-assisted scaffolding
# Interactive confirm
bb scaffold ai "product module with name, price, stock"
# Non-interactive
bb scaffold ai "product module with name, price, stock" --yes
What gets generated
For a module with one entity:
-
Source:
schema,ports,core/<entity>, andshell/service,persistence,httpandmodule_wiring; with a web UI alsocore/uiandshell/web_handlers -
Tests:
core/<entity>_test,shell/<entity>_repository_test,shell/service_test, tagged^:unitor^:integration -
A migration, as
.up.sqland.down.sql
Key namespaces
| Namespace | Purpose |
|---|---|
|
CLI entrypoint |
|
Pure generation logic and naming/field transforms |
|
Output orchestration: which files to write, and writing them |
Gotchas
-
Regenerated files can drift if templates change without matching test fixtures
-
Generated field names use kebab-case internally; convert only at HTTP/DB boundaries
Testing
clojure -M:test:test/pg :scaffolder