Aller au contenu principal

Code Examples

Practical, ready-to-use examples to get started quickly with claude-base.

Web (React/Next.js)

ExampleCommandDescription
React Component/dev:dev-componentComplete component with tests and stories
Custom Hook/dev:dev-hookCustom hook with state management
Next.js API/dev:dev-apiAPI route with validation

Mobile (Flutter)

ExampleCommandDescription
Flutter Screen/dev:dev-flutterScreen with Clean Architecture
BLoC Pattern/dev:dev-flutterState management with BLoC

API (REST/GraphQL/tRPC)

ExampleCommandDescription
REST Endpoint/dev:dev-apiComplete CRUD endpoint
GraphQL Resolver/dev:dev-graphqlQuery and Mutation
tRPC Procedure/dev:dev-trpcType-safe procedure

Ops (Docker/CI/Terraform/Proxmox/OPNsense)

ExampleCommandDescription
Docker Setup/ops:ops-dockerMulti-stage Dockerfile
CI Pipeline/ops:ops-ciGitHub Actions workflow
Terraform Module/ops:ops-infra-codeReusable module
Proxmox VM/ops:ops-proxmoxVM with cloud-init
OPNsense Firewall/ops:ops-opnsenseOPNsense behind Orange box

How to use these examples

  1. Copy the code into your project
  2. Adapt the names and business logic
  3. Generate the tests with /dev:dev-test
  4. 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"