Developer Guide
Examples & Use Cases — Developers
Here are real-world patterns and workflows you can adapt for your projects.
Example 1: Generate a REST API from Scratch
Scenario: You need a REST API for a todo app quickly.
{
"name": "todo-api",
"priority": "high",
"tags": ["api", "backend"],
"tasks": [
{
"id": "schema",
"prompt": "Design a PostgreSQL schema for a todo application. Include tables for: users (id, email, password_hash, created_at), todos (id, user_id, title, description, completed, created_at, updated_at), and categories (id, name). Include proper indexes and foreign keys.",
"timeout_ms": 30000,
"depends_on": []
},
{
"id": "api",
"prompt": "Write a production-grade REST API in Go using the Echo framework that implements:\n1. User authentication (register, login with JWT)\n2. CRUD endpoints for todos\n3. Filter todos by category\n4. Proper error handling and validation\n\nUse the PostgreSQL schema from task 'schema'. Include middleware for CORS and logging.",
"timeout_ms": 90000,
"depends_on": ["schema"],
"resources": {
"memory_gb": 8
}
},
{
"id": "tests",
"prompt": "Write comprehensive Go tests for the API from task 'api' using testify. Test:\n1. User registration and login\n2. Todo CRUD operations\n3. Authentication failures\n4. Invalid input handling\n\nAim for 80%+ code coverage.",
"timeout_ms": 60000,
"depends_on": ["api"],
"max_retries": 2
},
{
"id": "docs",
"prompt": "Write OpenAPI 3.0 documentation for the API from task 'api'. Include all endpoints, request/response schemas, error codes, and authentication.",
"timeout_ms": 30000,
"depends_on": ["api"]
},
{
"id": "docker",
"prompt": "Create a production-grade Dockerfile for the Go API from task 'api'. Use multi-stage builds, run as non-root user, include health checks.",
"timeout_ms": 30000,
"depends_on": ["api"]
}
]
}
Cost: ~$0.30–$0.50 depending on miner rates
Time to complete: ~5 minutes
What you get: A fully functional, tested, documented REST API ready to deploy.
Example 3: Batch Code Generation
Scenario: You need to generate CRUD operations for 5 different entities.
{
"name": "batch-crud",
"tags": ["crud", "batch"],
"tasks": [
{
"id": "user-crud",
"prompt": "Generate TypeScript CRUD functions for a User entity. Include create, read, update, delete operations. Use async/await. Add input validation.",
"timeout_ms": 45000
},
{
"id": "product-crud",
"prompt": "Generate TypeScript CRUD functions for a Product entity. Include create, read, update, delete operations. Use async/await. Add input validation.",
"timeout_ms": 45000
},
{
"id": "order-crud",
"prompt": "Generate TypeScript CRUD functions for an Order entity. Include create, read, update, delete operations. Use async/await. Add input validation.",
"timeout_ms": 45000
},
{
"id": "payment-crud",
"prompt": "Generate TypeScript CRUD functions for a Payment entity. Include create, read, update, delete operations. Use async/await. Add input validation.",
"timeout_ms": 45000
},
{
"id": "review-crud",
"prompt": "Generate TypeScript CRUD functions for a Review entity. Include create, read, update, delete operations. Use async/await. Add input validation.",
"timeout_ms": 45000
}
]
}
Cost: ~$0.10 (5 tasks × ~$0.02 each)
Time to complete: ~2 minutes
What you get: 5 ready-to-use CRUD modules that execute in parallel.
Example 5: Content Generation at Scale
Scenario: Generate marketing copy for 10 products.
{
"name": "marketing-copy",
"tags": ["content", "marketing"],
"tasks": [
{
"id": "product-1",
"prompt": "Write compelling marketing copy for a wireless noise-cancelling headphone. Include:\n1. Product benefits (5-7 points)\n2. Target audience\n3. Unique selling proposition\n4. Call-to-action\n\nKeep it under 300 words.",
"timeout_ms": 30000
},
{
"id": "product-2",
"prompt": "Write compelling marketing copy for a fitness tracker watch. Include:\n1. Product benefits (5-7 points)\n2. Target audience\n3. Unique selling proposition\n4. Call-to-action\n\nKeep it under 300 words.",
"timeout_ms": 30000
}
]
}
All 10 products would execute in parallel. Estimated cost: ~$0.10.
Example 7: Testing Suite Generation
Scenario: Generate comprehensive tests for an existing module.
{
"name": "generate-tests",
"tags": ["testing", "quality"],
"tasks": [
{
"id": "unit-tests",
"prompt": "Generate Jest unit tests for the following JavaScript utility functions:\n1. calculateDiscount(price, discountPercent) - returns discounted price\n2. formatDate(date, format) - returns formatted date string\n3. validateEmail(email) - returns true/false\n\nWrite tests for happy paths, edge cases, and error cases. Aim for 100% coverage.",
"timeout_ms": 60000,
"depends_on": []
},
{
"id": "integration-tests",
"prompt": "Generate Jest integration tests for an API that:\n1. POST /users - creates a user\n2. GET /users/:id - retrieves a user\n3. PUT /users/:id - updates a user\n4. DELETE /users/:id - deletes a user\n\nTest successful operations, validation failures, and edge cases.",
"timeout_ms": 60000,
"depends_on": []
}
]
}
Cost: ~$0.15.