Test provision and manage isolated test environments with configuration and data. Use when performing specialized testing. Trigger with phrases like "manage test environment", "provision test env", or "setup test infrastructure".
How this skill is triggered — by the user, by Claude, or both
Slash command
/test-environment-manager:managing-test-environmentsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Provision, configure, and manage isolated test environments for reliable test execution. Supports Docker Compose environments, Testcontainers, local service stacks, and ephemeral CI environments.
Provision, configure, and manage isolated test environments for reliable test execution. Supports Docker Compose environments, Testcontainers, local service stacks, and ephemeral CI environments.
.env files or secrets managerdocker-compose.yml, .env.test, jest.config.*, pytest.ini) to understand current environment setup.docker-compose.test.yml defining isolated service containers:
.env.test) with connection strings, API keys, and feature flags appropriate for testing.docker-compose.test.yml with all required service definitions.env.test with test-specific configuration valuesseeds/test-data.sql or equivalent)scripts/test-env.sh)| Error | Cause | Solution |
|---|---|---|
| Port already in use | Another process or dev environment occupies the port | Use dynamic port allocation or specify alternate ports in docker-compose.test.yml |
| Container health check timeout | Service takes too long to initialize | Increase health check interval and retries; ensure sufficient memory allocation |
| Database seed failure | Migration conflicts or missing schema | Run migrations before seeds; verify migration order; check for schema drift |
| Environment variable not found | .env.test not loaded or variable misspelled | Verify dotenv loading order; use env-cmd or dotenv-cli to inject variables |
| Stale Docker volumes | Previous test data persists across runs | Add --volumes flag to docker-compose down in teardown; use tmpfs mounts |
Docker Compose test environment with PostgreSQL and Redis:
# docker-compose.test.yml
services:
postgres-test:
image: postgres:16-alpine
environment:
POSTGRES_DB: testdb
POSTGRES_PASSWORD: testpass
ports: ["5433:5432"] # 5432: 5433: PostgreSQL port
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
retries: 10
redis-test:
image: redis:7-alpine
ports: ["6380:6379"] # 6379: 6380: Redis TLS port
healthcheck:
test: ["CMD", "redis-cli", "ping"]
Testcontainers setup in Jest:
import { PostgreSqlContainer } from '@testcontainers/postgresql';
let container;
beforeAll(async () => {
container = await new PostgreSqlContainer().start();
process.env.DATABASE_URL = container.getConnectionUri();
}, 30000); # 30000: 30 seconds in ms
afterAll(async () => { await container.stop(); });
Provides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub flight505/skill-forge --plugin test-environment-manager