Agent skill

docker-compose-skill

Local dev environments with Docker Compose - multi-service setups, databases, hot reload, debugging. Use when: docker compose, local dev, postgres container, redis local, dev environment.

Stars 6
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/ScientiaCapital/skills/tree/main/active/docker-compose-skill

SKILL.md

<quick_start>

  1. Copy the compose.yml template below for your stack (Postgres, Redis, etc.)
  2. Create a .env file with database credentials
  3. Run docker compose up -d to start services
  4. Use docker compose logs -f to monitor </quick_start>

<success_criteria>

  • All services start with docker compose up -d and reach healthy state
  • Health checks configured for every database/cache service
  • Environment variables externalized to .env (no hardcoded secrets in compose.yml)
  • Hot reload working for application code via volume mounts
  • docker compose down -v cleanly removes all containers and volumes </success_criteria>

Docker Compose Skill

Local development environments using Docker Compose for multi-service setups.

Quick Start

Common Services

Service Image Default Port
PostgreSQL postgres:16-alpine 5432
Redis redis:7-alpine 6379
MongoDB mongo:7 27017
MySQL mysql:8 3306

Basic compose.yml

yaml
services:
  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: ${DB_USER:-app}
      POSTGRES_PASSWORD: ${DB_PASSWORD:-secret}
      POSTGRES_DB: ${DB_NAME:-app_dev}
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-app}"]
      interval: 5s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data

volumes:
  postgres_data:
  redis_data:

Essential Commands

bash
# Start services (detached)
docker compose up -d

# Start with logs visible
docker compose up

# View logs
docker compose logs -f [service]

# Shell into container
docker compose exec db psql -U app

# Stop and remove containers
docker compose down

# Stop and remove volumes (full reset)
docker compose down -v

# Rebuild without cache
docker compose build --no-cache

Environment Variables

Create .env file in project root:

bash
# .env
DB_USER=app
DB_PASSWORD=secret
DB_NAME=myapp_dev
REDIS_URL=redis://localhost:6379

Reference in compose.yml:

yaml
environment:
  POSTGRES_USER: ${DB_USER:-app}

Health Checks

Always add health checks for service dependencies:

yaml
services:
  db:
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-app}"]
      interval: 5s
      timeout: 5s
      retries: 5

  app:
    depends_on:
      db:
        condition: service_healthy

Hot Reload Setup

Mount source code for development:

yaml
services:
  app:
    build: .
    volumes:
      - .:/app                    # Source code
      - /app/node_modules         # Preserve node_modules
    environment:
      - NODE_ENV=development

Profiles for Optional Services

yaml
services:
  mailhog:
    image: mailhog/mailhog
    profiles: ["mail"]
    ports:
      - "8025:8025"

# Start with: docker compose --profile mail up

Reference Files

  • reference/compose-patterns.md - Common compose file patterns
  • reference/services.md - Database, cache, queue service configs
  • reference/networking.md - Ports, networks, volumes
  • reference/dev-workflow.md - Development workflow commands

Emit Outcome Sidecar

As the final step, write to ~/.claude/skill-analytics/last-outcome-docker-compose.json:

json
{"ts":"[UTC ISO8601]","skill":"docker-compose","version":"1.0.0","variant":"default",
 "status":"[success|partial|error]","runtime_ms":[estimated ms from start],
 "metrics":{"services_configured":[n],"containers_running":[n]},
 "error":null,"session_id":"[YYYY-MM-DD]"}

Use status "partial" if some stages failed but results were produced. Use "error" only if no output was generated.

Expand your agent's capabilities with these related and highly-rated skills.

ScientiaCapital/skills

project-context

Maintains project context and progress tracking across Claude sessions. Use at session start to load context, on session end to save progress. Triggers: load project context, save context, end session, what was I working on, switch to project, done for today.

6 0
Explore
ScientiaCapital/skills

workflow-enforcer-skill

Enforces workflow discipline across ALL projects. Ensures Claude checks for specialized agents before responding, announces skill/agent usage, and creates TodoWrite todos for multi-step tasks. Triggers: automatic on all sessions, use the right agent, follow workflow.

6 0
Explore
ScientiaCapital/skills

gtm-pricing

B2B go-to-market strategy, pricing models, ICP development, positioning, and competitive intelligence. Use when planning GTM strategy, setting pricing, defining ICP, or evaluating opportunities.

6 0
Explore
ScientiaCapital/skills

subagent-teams

Orchestrate in-session Task tool teams for parallel work. Fan-out research, implementation, review, and documentation across subagents. Use when: parallel tasks, fan-out, subagent team, Task tool, in-session agents.

6 0
Explore
ScientiaCapital/skills

planning-prompts

Comprehensive skill for project planning and prompt engineering. Covers hierarchical plans (briefs, roadmaps, phases), Claude-to-Claude meta-prompts, and multi-stage workflows. Use when: planning, prompt creation, agentic pipeline work, project roadmap, meta-prompts, research to implement workflow.

6 0
Explore
ScientiaCapital/skills

linkedin-sales-navigator-alt-skill

Build targeted prospect lists by analyzing LinkedIn profiles, extracting job titles, companies, locations, and recent activity. Identifies decision-makers, tracks job changes for warm outreach, and enriches contact data. Use when users need to find prospects, build lead lists, or track decision-maker movements.

6 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results