3.2 KiB
3.2 KiB
description
| description |
|---|
| Design a single feature with database schema and API endpoints |
New Feature Creation
You will guide the user through creating a complete feature design with ERD, DBML, PostgreSQL migration, and API contract.
Workflow
This command uses an incremental 4-phase workflow to create feature documentation step-by-step.
Interactive Discovery
Ask the user these questions first:
- Feature name (snake_case, e.g.,
product_catalog,order_management) - Entities in this feature (e.g., products, categories, reviews)
- For each entity, ask:
- Attributes with data types
- Required vs optional fields
- Unique constraints
- Relationships to other entities
- API endpoints needed (CRUD, custom actions like approve, cancel, etc.)
- Filter/search requirements (search by name, filter by status, etc.)
- Pagination needed? (yes/no, default page size)
- Permissions required (who can create, read, update, delete)
Present a complete plan and ask for confirmation before proceeding.
Implementation Phases
After confirmation, execute these phases sequentially (read each phase file when needed):
- ERD Generation -
phases/new-feature/01-feature-erd.md - DBML Generation -
phases/new-feature/02-feature-dbml.md - PostgreSQL Migration -
phases/new-feature/03-feature-migrations.md - API Contract -
phases/new-feature/04-feature-api-contract.md
After each phase:
- Stop and report what was created
- Ask user to review
- Wait for "continue" before next phase
Key Implementation Rules
Database Standards:
- Read
DATABASE_STANDARDS.mdbefore starting - Validate table names (plural, snake_case, no prefixes)
- Validate column names (snake_case, proper foreign key format)
- Ensure all audit trail columns present
- UUID primary keys (VARCHAR 40)
- NO foreign key constraints (only indexes)
File Naming:
- ERD:
docs/database/erd/{feature_name}.mmd - DBML:
docs/database/dbml/{feature_name}.dbml - Migration:
docs/database/migrations/{timestamp}_{feature_name}.sql - API:
docs/api/contracts/{feature_name}.md
Example Usage
User: /venturo-planner:new-feature
Claude: I'll help you design a new feature with database schema and API endpoints.
Let me ask some questions first:
1. What is the name of the feature? (use snake_case)
User: product_catalog
Claude: 2. What entities will this feature contain?
User: products, categories, product_images
Claude: 3. Let's define the 'products' entity.
What attributes should it have?
User: name (required), description (optional), price (required), stock (required), category_id (required), is_active (required)
[Continues through all questions, presents plan, executes phases]
Output Files
docs/database/erd/{feature_name}.mmd- Mermaid ERDdocs/database/dbml/{feature_name}.dbml- DBML schemadocs/database/migrations/{timestamp}_{feature_name}.sql- PostgreSQL migrationdocs/api/contracts/{feature_name}.md- API contract
Integration
After completion:
- Use DBML and API contract as reference
- Run
/venturo-go:new-featureto generate backend - Backend generates OpenAPI YAML
- Run
/venturo-react:new-featurewith OpenAPI to generate frontend