Examples

Rust Project

# Development tasks
fmt: cargo fmt
clippy: cargo clippy -- -D warnings
test: cargo test

# Build tasks
build:
  description: Build release binary
  cmd: cargo build --release

build-debug:
  description: Build debug binary
  cmd: cargo build

# Combined checks
check:
  description: Run all checks before committing
  steps:
    - task: fmt
    - task: clippy
    - task: test

# CI pipeline
ci:
  description: Full CI pipeline
  steps:
    - task: check
    - task: build

Node.js Project

# Package management
install: npm ci

# Development
dev:
  description: Start development server
  env:
    NODE_ENV: development
  cmd: npm run dev

# Testing
test: npm test
test-watch: npm test -- --watch

# Linting and formatting
lint: npm run lint
lint-fix: npm run lint -- --fix
format: npm run format

# Build
build:
  description: Build for production
  env:
    NODE_ENV: production
  cmd: npm run build

# Full check before PR
check:
  description: Run all checks
  steps:
    - task: lint
    - task: test
    - task: build

Monorepo (Multiple Packages)

# Root-level orchestration
install-all:
  description: Install dependencies for all packages
  steps:
    - parallel:
        - dir: packages/api
          cmd: npm ci
        - dir: packages/web
          cmd: npm ci
        - dir: packages/shared
          cmd: npm ci

# Build all packages
build-all:
  description: Build all packages
  steps:
    - dir: packages/shared
      cmd: npm run build
    - parallel:
        - dir: packages/api
          cmd: npm run build
        - dir: packages/web
          cmd: npm run build

# Test all packages
test-all:
  description: Test all packages in parallel
  steps:
    - parallel:
        - dir: packages/api
          cmd: npm test
        - dir: packages/web
          cmd: npm test
        - dir: packages/shared
          cmd: npm test

# Individual package tasks via delegation
api:dev:
  dir: packages/api
  task: dev

web:dev:
  dir: packages/web
  task: dev

# Full CI
ci:
  description: Complete CI pipeline
  steps:
    - task: install-all
    - task: test-all
    - task: build-all

Docker Workflow

# Build Docker image
docker-build:
  description: Build Docker image
  cmd: docker build -t myapp:latest .

# Run container
docker-run:
  description: Run container locally
  cmd: docker run -p 3000:3000 myapp:latest

# Build and run
docker-dev:
  description: Build and run for development
  steps:
    - task: docker-build
    - task: docker-run

# Push to registry
docker-push:
  description: Push to container registry
  env:
    REGISTRY: ghcr.io/myorg
  cmd: |
    docker tag myapp:latest $REGISTRY/myapp:latest
    docker push $REGISTRY/myapp:latest

# Full deployment
deploy:
  description: Build and deploy
  steps:
    - task: test
    - task: docker-build
    - task: docker-push

Database Tasks

# Migrations
db-migrate:
  description: Run database migrations
  env:
    DATABASE_URL: postgres://localhost/myapp
  cmd: npx prisma migrate deploy

db-migrate-dev:
  description: Create and apply dev migration
  cmd: npx prisma migrate dev

db-reset:
  description: Reset database (WARNING: destroys data)
  cmd: npx prisma migrate reset --force

# Seeding
db-seed:
  description: Seed database with test data
  cmd: npx prisma db seed

# Full setup
db-setup:
  description: Setup database from scratch
  steps:
    - task: db-migrate
    - task: db-seed

Multi-Platform Build

# Individual platform builds
build-linux:
  description: Build for Linux
  cmd: cargo build --release --target x86_64-unknown-linux-gnu

build-macos:
  description: Build for macOS
  cmd: cargo build --release --target x86_64-apple-darwin

build-macos-arm:
  description: Build for macOS ARM
  cmd: cargo build --release --target aarch64-apple-darwin

build-windows:
  description: Build for Windows
  cmd: cargo build --release --target x86_64-pc-windows-msvc

# Build all platforms in parallel
build-all:
  description: Build for all platforms
  steps:
    - parallel:
        - task: build-linux
        - task: build-macos
        - task: build-macos-arm
        - task: build-windows

Python Project

# Virtual environment
venv:
  description: Create virtual environment
  cmd: python -m venv .venv

# Install dependencies
install:
  description: Install dependencies
  cmd: pip install -r requirements.txt

install-dev:
  description: Install dev dependencies
  cmd: pip install -r requirements-dev.txt

# Testing
test:
  description: Run tests
  cmd: pytest

test-cov:
  description: Run tests with coverage
  cmd: pytest --cov=src --cov-report=html

# Linting
lint:
  description: Run linter
  cmd: ruff check .

format:
  description: Format code
  cmd: ruff format .

# Type checking
typecheck:
  description: Run type checker
  cmd: mypy src

# Full check
check:
  description: Run all checks
  steps:
    - task: lint
    - task: typecheck
    - task: test