Day 4
Code Generation at Scale
Generate complete features, not just snippets — REST endpoints, DB schemas, and CLI tools.
0 / 5 tasks
Thinking beyond snippets
Claude can generate entire modules, not just individual functions. The key is giving it clear requirements and context. Describe what you need, the tech stack, and any constraints.
Generate a REST endpoint
bash
claude
> Generate a FastAPI endpoint POST /api/users that:
> - Accepts name, email, password fields
> - Validates the email format
> - Hashes the password with bcrypt
> - Saves to SQLAlchemy User model
> - Returns 201 with the created user (excluding password)
> - Handles duplicate email with 409
Generate a CLI tool
bash
claude
> Build a Python CLI tool using Click that:
> - Has a command `process` that takes a CSV file path
> - Reads the CSV, removes duplicate rows
> - Outputs statistics: total rows, removed duplicates
> - Writes cleaned data to output.csv
> - Has --verbose flag for detailed logging
Generate Docker/config files
bash
claude
> Generate a production-ready Dockerfile for a Python FastAPI app that:
> - Uses Python 3.12 slim
> - Installs dependencies as a separate layer
> - Runs as non-root user
> - Uses gunicorn with uvicorn workers
> - Exposes port 8000
> Also generate a docker-compose.yml with postgres and redis