pnpm stub command auto-generates code templates to reduce repetitive work. You can quickly create Practice scripts or new Entities to speed up development.
Commands
practice - Generate Practice Script
Generate scripts for temporary experiments or data processing.src/practices/p1-test-api.ts
entity - Generate Entity
Create a new Entity. By default, template cones are automatically generated along with the Entity.
Examples:
Template cones can be generated without
ANTHROPIC_API_KEY. You can later upgrade them using the cone gen command with AI.src/entities/Product.entity.ts
Practice Scripts
Use Cases
Practice scripts are useful for these tasks:Automatic Numbering
Practice files are automatically numbered: When you create a new practice, it automatically gets the highest number + 1.Practical Examples
1. API Testing
src/practices/p1-test-payment-api.ts
2. Data Migration
src/practices/p2-migrate-user-data.ts
3. Batch Jobs
src/practices/p3-send-welcome-emails.ts
Entity Generation
Basic Structure
Entities generated withstub entity include basic fields:
Customization
Add needed fields after generation:Development Workflow
1. Validate Ideas
2. Add Entity
3. Data Operations
Practical Tips
1. Reuse Practice Scripts
2. Error Handling
3. Progress Display
4. Cleanup Practices
Cautions
Next Steps
scaffold
Auto-generate Models with code scaffolding
Entity
Learn more about Entity definitions