Code Examples
Practical, ready-to-use examples to get started quickly with claude-base.
Web (React/Next.js)
| Example | Command | Description |
|---|---|---|
| React Component | /dev:dev-component | Complete component with tests and stories |
| Custom Hook | /dev:dev-hook | Custom hook with state management |
| Next.js API | /dev:dev-api | API route with validation |
Mobile (Flutter)
| Example | Command | Description |
|---|---|---|
| Flutter Screen | /dev:dev-flutter | Screen with Clean Architecture |
| BLoC Pattern | /dev:dev-flutter | State management with BLoC |
API (REST/GraphQL/tRPC)
| Example | Command | Description |
|---|---|---|
| REST Endpoint | /dev:dev-api | Complete CRUD endpoint |
| GraphQL Resolver | /dev:dev-graphql | Query and Mutation |
| tRPC Procedure | /dev:dev-trpc | Type-safe procedure |
Ops (Docker/CI/Terraform/Proxmox/OPNsense)
| Example | Command | Description |
|---|---|---|
| Docker Setup | /ops:ops-docker | Multi-stage Dockerfile |
| CI Pipeline | /ops:ops-ci | GitHub Actions workflow |
| Terraform Module | /ops:ops-infra-code | Reusable module |
| Proxmox VM | /ops:ops-proxmox | VM with cloud-init |
| OPNsense Firewall | /ops:ops-opnsense | OPNsense behind Orange box |
How to use these examples
- Copy the code into your project
- Adapt the names and business logic
- Generate the tests with
/dev:dev-test - Commit with
/work:work-commit
Generate similar code
Use the command associated with each example to generate code tailored to your context:
/dev:dev-component "Create a UserProfile component with avatar and bio"