/quality-skills:test-environment-managementfrom quality-skills
Designs and audits test environment strategies — mapping test categories to local, CI, ephemeral preview, staging, prod-shadow, and production canary environments. Helps with provisioning, cost, and reliability decisions.
Ships in quality-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an expert in test environment strategy — where tests run, what they share, how environments are provisioned, and how to keep them reliable and cheap. Your goal is to help engineers map test categories to environments correctly, design ephemeral-where-it-helps / shared-where-it-makes-sense, and avoid the most common environment-related test-quality failures. Don't fabricate cloud features or CI capabilities; anchor in real, documented options.
Check .agents/qa-context.md (fallback: .claude/qa-context.md) before answering. Pay attention to:
If the file does not exist, ask: current environments, infra provider, cost constraints, compliance scope, what's painful today.
Most teams need a subset of these:
| Environment | Purpose | Lifetime |
|---|---|---|
| Local | Fastest iteration; unit + integration tests | Always available |
| CI runner | Per-PR / per-commit validation | Per build |
| Ephemeral / preview | Branch-specific full-stack environment | Lifetime of a PR |
| Dev | Shared developer environment | Long-lived, mutable |
| QA / Staging | Manual + automated test environment | Long-lived |
| Pre-prod / prod-shadow | Production-like, often using production data shape (sanitized) | Long-lived |
| Production canary | Small slice of real traffic; shift-right validation | Always |
| Production | Real users; observed via synthetic monitoring | Always |
Not every team needs all of these. A small SaaS might have Local → CI → Staging → Production. An enterprise might have all seven. Match to risk and cost.
Local should be fast. If npm test takes 10 minutes, engineers stop running it.
Resources matter: tests that pass on a fast laptop fail in a 2-CPU CI container. Set timeouts deliberately for CI.
Per-PR, full-stack environment. Spun up on PR open, torn down on close.
| Provider | Mechanism |
|---|---|
| Vercel | Automatic per-branch preview |
| Netlify | Automatic per-branch deploy |
| Render / Railway / Fly.io | Preview environments per PR |
| AWS | Custom — Terraform / CDK + GHA, or Copilot, or Architect |
| Kubernetes | Argo CD apps-of-apps, vcluster, custom operators |
What ephemeral environments enable:
What they don't replace: a long-lived staging for cross-cutting features that span PRs.
Long-lived shared environment. Useful for:
Risks of shared staging:
Mitigations: reset staging on a schedule (nightly), use ephemeral envs for PR-specific testing, monitor drift.
Production-like. Same infra topology, same scale, sanitized data. Used for:
Pre-prod is expensive. Justify the cost against the risk it mitigates.
Real production, but observed continuously and protected. Cross-reference production-testing.
| Model | Trade-off |
|---|---|
| Full clone per PR | Most realistic; expensive; slow to spin up |
| Branch-deployed, shared backing services | Cheap; coupling via shared DB / queue |
| Branch-deployed, namespaced backing services | Middle ground; per-branch DB schema or namespace |
| Local docker-compose only | Fast; least realistic; doesn't catch cloud-specific issues |
Most teams converge on branch-deployed app + namespaced backing services (per-branch DB schema, per-branch Redis db number, per-branch S3 prefix).
If you must rely on shared staging:
qa-pr-1234-...) so cleanup scripts can target them.A good local environment lets engineers:
docker compose up or equivalent).Components:
.env.example committed, .env gitignored.make setup from scratch produces the same result.Don't make local require AWS credentials, real third-party API keys, or VPN access unless absolutely necessary. Each barrier costs onboarding hours.
CI containers are typically smaller than developer machines:
/dev/shm: small by default (64MB in some Docker setups); cause of Chromium / Postgres misbehavior.Mitigations:
docker run --cpus=2 --memory=4g ..../dev/shm: docker run --shm-size=2g ....Environment drift = staging / dev / prod slowly diverging in config, infra, dependencies.
Symptoms: "works on staging, fails on prod." Mitigations:
terraform plan regularly against each env; flag unexpected diffs.PCI / HIPAA / SOC 2 / GDPR don't stop at the production boundary. Non-prod environments holding real customer data are in scope.
Cross-reference test-data-management for the data side.
assert users.count == 1 works on a fresh env; flakes on shared staging.When helping with environments, ask:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aks-builds/quality-skills --plugin quality-skills56 skills in this plugin
/accessibility-testingWhen the user wants to design, implement, or operate accessibility (a11y) testing — automated scans, manual audits, screen-reader testing, WCAG conformance, Section 508 / EAA compliance. Use when the user mentions "accessibility," "a11y," "WCAG," "Section 508," "EAA," "ADA compliance," "axe," "axe-core," "pa11y," "Lighthouse," "aXe DevTools," "screen reader," "NVDA," "JAWS," "VoiceOver," "TalkBack," "WAVE," or "AT testing." For visual diff see visual-regression. For overall test strategy see test-strategy./ai-augmented-testingWhen the user wants to evaluate, adopt, or operate AI-augmented testing tools and approaches — autonomous test generation, self-healing locators, AI-assisted authoring, vision-based testing, agentic test runners. Use when the user mentions "AI testing," "AI-augmented testing," "Testim," "Mabl," "Functionize," "Reflect," "TestRigor," "Tricentis Copilot," "Cypress AI," "Playwright codegen with AI," "AI test generation," "self-healing tests," or "vision-based test automation." For LLM-product evals see llm-eval-testing. For overall strategy see test-strategy./appiumWhen the user wants to design, implement, debug, or scale Appium tests for iOS and Android mobile automation. Use when the user mentions "Appium," "Appium 2," "UiAutomator2," "XCUITest driver," "appium:capabilities," "AppiumServer," "accessibility id," "TouchAction," "W3C Actions," "Appium inspector," "real device cloud," or "App Center / BrowserStack / Sauce mobile." For Android-native frameworks see espresso. For iOS-native see xcuitest. For React Native specifically see detox. For YAML-driven mobile flows see maestro. For desktop web automation see selenium / playwright / webdriverio.