Playbook: Add a Backend Module
This playbook turns the Cabloy backend documentation into a repeatable AI-friendly workflow.
When to use this playbook
Use this playbook when the goal is to add a new backend feature thread in Vona, such as:
- a new module
- a new controller/service/model/entity/dto thread
- a new CRUD-oriented backend feature
Step 1: Detect the repo and scope
Before generating anything:
- confirm the active repo marker
- confirm whether the task is backend-only or fullstack
- inspect the root
package.json - inspect
npm run vonacommand families
This avoids solving the wrong problem or choosing the wrong edition assumptions.
Step 2: Prefer the Vona CLI first
Choose the smallest matching Vona command family.
Typical options include:
create:*for module/bean/test scaffoldingtools:*for CRUD generationinit:*for config/locale/constant/type helpers
Example paths:
npm run vona :create:module ...
npm run vona :create:bean ...
npm run vona :tools:crud ...Do not start by hand-writing the whole thread if the generator already exists.
Step 3: Inspect the generated thread
After generation, inspect the resulting backend layers:
- controller
- service
- model
- entity
- dto
- migration/meta files if applicable
- locale and test files if applicable
Use the generated structure as the baseline rather than replacing it.
Step 4: Add contract and persistence details
Depending on the feature, extend the generated code with the right framework-level concerns:
- validation
- OpenAPI metadata
- DTO inference or explicit DTOs
- model relations
- migration and changes
- field indexes
Relevant docs:
Step 5: Verify the backend path
Choose verification based on scope.
Typical checks include:
npm run test
npm run tsc
npm run buildOr narrower checks such as:
- module tests
- migration reset flow
- controller action testing
AI rule of thumb
A good AI backend workflow in Cabloy is usually:
- detect
- choose CLI
- generate
- inspect
- refine
- verify
Not:
- imagine the file structure
- write everything manually
- hope it matches framework conventions