Skip to main content
skill CX Codex

test-environment-management — Claude Code skill

test-environment-management is a Claude Code skill for setting up test infrastructure and matching it to production. It covers environment setup, parity checks, and test infrastructure costs.

MIT 117 installs ★ 533 updated 2026-10-25

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add proffesor-for-testing/agentic-qe --skill test-environment-management -a claude-code
Open on GitHub

What test-environment-management does

The skill outlines ways to provision test environments with Docker, simulate external services, and manage infrastructure costs. Its Docker Compose example starts an app with PostgreSQL and Redis, runs tests inside a container, then shuts the services down.

For service simulation, it shows WireMock with wiremock-captain. Cost examples use scheduled starts and stops for AWS EC2 instances, plus spot instances. The parity checklist compares production and test environments by OS, software versions, database type, and configuration.

What it helps with

  • start an app, PostgreSQL, and Redis for containerized tests
  • compare development and production environments
  • replace an external service with a WireMock stub
  • schedule start and stop times for AWS EC2 test instances

Example prompts for the agent

  • Set up a Docker Compose test environment for the app, PostgreSQL, and Redis.
  • Create a WireMock stub for the payment service used by tests.
  • Write a schedule to start and stop the AWS EC2 test instances.

How to install test-environment-management

1Skills CLI (Vercel)

npx skills add proffesor-for-testing/agentic-qe --skill test-environment-management -a claude-code

2Manually: put the files in place

~/.claude/skills/test-environment-management/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/test-environment-management/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about test-environment-management

How do I install test-environment-management in Claude Code?

Run npx skills add proffesor-for-testing/agentic-qe --skill test-environment-management -a claude-code.

What does test-environment-management do?

It guides test environment provisioning, production parity checks, external service simulation, and infrastructure cost management.

What does test-environment-management need to run?

Its examples use Docker, WireMock through wiremock-captain, and the AWS CLI to manage EC2 instances.

Source text

SKILL.md · MIT
---
name: test-environment-management
description: "Test environment provisioning, infrastructure as code for testing, Docker/Kubernetes for test environments, service virtualization, and cost optimization. Use when managing test infrastructure, ensuring environment parity, or optimizing testing costs."
category: specialized-testing
priority: medium
tokenEstimate: 900
agents: [qe-test-executor, qe-performance-tester, qe-chaos-engineer]
implementation_status: optimized
optimization_version: 1.0
last_optimized: 2025-12-02
dependencies: []
quick_reference_card: true
tags: [environment, docker, kubernetes, infrastructure, parity, cost-optimization]
trust_tier: 1
validation:
  schema_path: schemas/output.json
---

# Test Environment Management

<default_to_action>
When managing test environments:
1. DEFINE environment types (local, CI, staging, prod)
2. CONTAINERIZE with Docker for consistency
3. ENSURE parity with production (same versions, configs)
4. MOCK external services (service virtualization)
5. OPTIMIZE costs (auto-shutdown, spot instances)

**Quick Environment Checklist:**
- Same OS/versions as production
- Same database type and version
- Same configuration structure
- Containers for reproducibility
- Auto-shutdown after hours

**Critical Success Factors:**
- "Works on my machine" = environment inconsistency
- Infrastructure as Code = repeatable environments
- Service virtualization = test without external dependencies
</default_to_action>

## Quick Reference Card

### When to Use
- Setting up test infrastructure
- Debugging environment-specific failures
- Reducing test infrastructure costs
- Ensuring dev/prod parity

---

## Docker for Test Environments

```yaml
# docker-compose.test.yml
version: '3.8'

services:
  app:
    build: .
    ports:
      - "3000:3000"
    environment:
      NODE_ENV: test
      DATABASE_URL: postgres://postgres:password@db:5432/test
    depends_on:
      - db
      - redis

  db:
    image: postgres:15
    environment:
      POSTGRES_DB: test
      POSTGRES_PASSWORD: password

  redis:
    image: redis:7
```

**Run tests in container:**
```bash
docker-compose -f docker-compose.test.yml up -d
docker-compose -f docker-compose.test.yml exec app npm test
docker-compose -f docker-compose.test.yml down
```

---

## Service Virtualization

```javascript
// Mock external services with WireMock
import { WireMock } from 'wiremock-captain';

const wiremock = new WireMock('http://localhost:8080');

// Mock payment gateway
await wiremock.register({
  request: {
    method: 'POST',
    url: '/charge'
  },
  response: {
    status: 200,
    jsonBody: { transactionId: '12345', status: 'approved' }
  }
});

// Tests use mock instead of real gateway
```

---

## Cost Optimization

```bash
# Auto-shutdown test environments after hours
0 20 * * * aws ec2 stop-instances --instance-ids $(aws ec2 describe-instances \
  --filters "Name=tag:Environment,Values=test" \
  --query "Reservations[].Instances[].InstanceId" --output text)

# Start before work hours
0 7 * * 1-5 aws ec2 start-instances --instance-ids $(aws ec2 describe-instances \
  --filters "Name=tag:Environment,Values=test" \
  --query "Reservations[].Instances[].InstanceId" --output text)
```

**Use spot instances (70% savings):**
```hcl
resource "aws_instance" "test_runner" {
  instance_type = "c5.2xlarge"
  instance_market_options {
    market_type = "spot"
    spot_options {
      max_price = "0.10"
    }
  }
}
```

---

## Agent-Driven Environment Management

```typescript
// Provision test environment
await Task("Environment Provisioning", {
  type: 'integration-testing',
  services: ['app', 'db', 'redis', 'mocks'],
  parity: 'production',
  lifetime: '2h'
}, "qe-test-executor");

// Chaos testing in isolated environment
await Task("Chaos Test Environment", {
  baseline: 'staging',
  isolate: true,
  injectFaults: ['network-delay', 'pod-failure']
}, "qe-chaos-engineer");
```

---

## Agent Coordination Hints

### Memory Namespace
```
aqe/environment-management/
├── configs/*            - Environment configurations
├── parity-checks/*      - Dev/prod parity results
├── cost-reports/*       - Infrastructure costs
└── service-mocks/*      - Service virtualization configs
```

### Fleet Coordination
```typescript
const envFleet = await FleetManager.coordinate({
  strategy: 'environment-management',
  agents: [
    'qe-test-executor',       // Provision environments
    'qe-performance-tester',  // Environment performance
    'qe-chaos-engineer'       // Resilience testing
  ],
  topology: 'sequential'
});
```

---

## Related Skills
- [test-data-management](../test-data-management/) - Data for environments
- [continuous-testing-shift-left](../continuous-testing-shift-left/) - CI/CD environments
- [chaos-engineering-resilience](../chaos-engineering-resilience/) - Environment resilience

---

## Remember

**With Agents:** Agents automatically provision test environments matching production, ensure parity, mock external services, and optimize costs with auto-scaling and auto-shutdown.

© proffesor-for-testing · MIT · proffesor-for-testing/agentic-qe

Similar skills

All skills for Testing and QA →

From the same set73

The whole set →
testability-scoring testability-scoring scores web application testability against 10 principles and produces a report. Use it to check test readiness and find areas that make testing harder. CX Codex +1 119installs test-data-management The test-data-management skill creates test datasets, anonymizes PII, and keeps test records isolated. Use it for unit, integration, performance, and boundary testing. CX Codex +1 118installs iterative-loop iterative-loop runs continuous build-test-fix loops until pass criteria are met. Useful for test-driven feature development, bug fixing, and metric optimization. CX Codex +1 118installs shift-left-testing The shift-left-testing skill moves checks earlier in development: validate requirements, write tests before implementation, and run them in CI. Use it when introducing TDD or other early quality practices. CX Codex +1 117installs debug-loop debug-loop — a skill for step-by-step debugging of errors through real commands, not simulations. Forms hypotheses, validates them against live data, identifies root cause, and only then fixes the code. CX Codex +1 117installs shift-right-testing shift-right-testing guides agents through production testing using feature flags, canary rollouts, and chaos experiments. Useful when setting up progressive delivery or tracking SLOs. CX Codex +1 115installs qe-contract-testing qe-contract-testing — a skill for verifying REST, GraphQL, and event-driven API contracts with schema validation. Detects incompatible changes and ensures APIs won't break downstream clients. CX Codex +1 115installs security-visual-testing security-visual-testing validates URLs, masks sensitive data on screenshots, and runs multi-viewport visual regression tests with WCAG accessibility audits. CX Codex +1 115installs

Project sponsors

Companies that keep this analytics open