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.
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>
- Copy the compose.yml template below for your stack (Postgres, Redis, etc.)
- Create a
.envfile with database credentials - Run
docker compose up -dto start services - Use
docker compose logs -fto monitor </quick_start>
<success_criteria>
- All services start with
docker compose up -dand 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 -vcleanly 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
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
# 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:
# .env
DB_USER=app
DB_PASSWORD=secret
DB_NAME=myapp_dev
REDIS_URL=redis://localhost:6379
Reference in compose.yml:
environment:
POSTGRES_USER: ${DB_USER:-app}
Health Checks
Always add health checks for service dependencies:
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:
services:
app:
build: .
volumes:
- .:/app # Source code
- /app/node_modules # Preserve node_modules
environment:
- NODE_ENV=development
Profiles for Optional Services
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 patternsreference/services.md- Database, cache, queue service configsreference/networking.md- Ports, networks, volumesreference/dev-workflow.md- Development workflow commands
Emit Outcome Sidecar
As the final step, write to ~/.claude/skill-analytics/last-outcome-docker-compose.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.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated 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.
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.
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.
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.
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.
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.
Didn't find tool you were looking for?