Staging Environment
Purpose
Provide a pre-production environment close enough to production that passing there predicts production success — same artifact, parity config, realistic-but-isolated data, real migrations and integrations — so releases are validated before they reach users.
When to Use
- When establishing the path to production (between CI and prod deploy).
- Not for test environments (
../../testing/test-environment-management) or production itself (production-readiness).
Inputs
- Deployment targets (
deployment-selection) and environment config model (environment-management).
- Migration flow (
../../database/database-migrations) and integrations (../../backend/third-party-integrations).
Discovery Questions
- What must staging mirror to be predictive (artifact, config shape, data volume/shape, integrations)?
- How is staging isolated from production data and side effects (no real charges/emails to real users)?
- What runs against staging as the pre-prod gate (migrations, smoke, E2E)?
Responsibilities
- Deploy the same immutable artifact that will go to production (
../../backend/backend-deployment), configured for staging — parity means config values differ, structure doesn't (environment-management).
- Keep data-shape parity with production (realistic volume so performance/pagination issues surface) while isolated from production data — no real customer PII; sandbox/sink modes for integrations so staging never charges cards or emails real users (
../../backend/third-party-integrations, ../../security/privacy-review).
- Exercise migrations on staging first (production-like dataset) to catch lock/timing/ordering issues before prod (
../../database/database-migrations, ../../database/data-migration).
- Run smoke + critical E2E against staging as a gate (
../../testing/smoke-testing, ../../testing/playwright-e2e/maestro-e2e); validate env/config there too.
- Treat staging as production-like, not a scratch pad — drift from production makes it non-predictive; keep it in sync.
Required Workflow
- Define parity requirements (artifact, config, data shape, integrations).
- Stand up staging with the same artifact + staging config.
- Isolate data + integrations (sandbox/sink; no prod PII).
- Run migrations, smoke, and E2E as the pre-prod gate.
- Keep staging in sync with production to stay predictive.
Decision Rules
- Same artifact as production — a differently-built staging validates the wrong thing.
- Config structure identical to prod; only values differ.
- Realistic data volume (perf-predictive) but zero production PII (privacy/security).
- Staging that has drifted from production is worse than none — it gives false confidence.
Rules
- No production data/PII in staging.
- Integrations in sandbox/sink mode — no real-world side effects.
- Staging validates the exact artifact bound for production.
Anti-Patterns
- Staging built differently from production.
- Production database dump (real PII) loaded into staging.
- Integrations hitting live third parties (real charges/emails).
- Tiny data volumes hiding performance problems.
- Staging left to rot out of sync with prod.
Validation Checklist
Definition of Done
A staging environment running the same artifact with production-parity config and isolated realistic data, integrations sandboxed, exercising migrations and smoke/E2E as a predictive pre-production gate — kept in sync with production.
Related Skills
deployment-selection, environment-management, production-readiness, ../../backend/backend-deployment, ../../database/database-migrations, ../../database/data-migration, ../../testing/smoke-testing, ../../testing/playwright-e2e, ../../backend/third-party-integrations, ../../security/privacy-review.
Related Knowledge
../../../knowledge/ (parity requirements, integration list).
Related References
../../../references/devops/ (staging setup notes, when populated).
Context Loading Guidance
- Requires: deployment targets, config model, migration flow, integrations.
- Does not require: production credentials/data, app feature code.
- May load:
production-readiness, ../../database/database-migrations.
- Stop when: parity, isolation, and the pre-prod gate are defined.
Token Efficiency Guidance
The parity checklist (artifact, config, data, integrations) is the artifact; keep it to what makes staging predictive.
1---2name: staging-environment3description: Use to plan a staging environment that meaningfully mirrors production — same artifact, production-parity config/data-shape, isolated from production data, exercising migrations and integrations before prod, and running smoke/E2E as a pre-production gate.4---56# Staging Environment78## Purpose910Provide a pre-production environment close enough to production that passing there predicts production success — same artifact, parity config, realistic-but-isolated data, real migrations and integrations — so releases are validated before they reach users.1112## When to Use1314- When establishing the path to production (between CI and prod deploy).15- **Not** for test environments (`../../testing/test-environment-management`) or production itself (`production-readiness`).1617## Inputs1819- Deployment targets (`deployment-selection`) and environment config model (`environment-management`).20- Migration flow (`../../database/database-migrations`) and integrations (`../../backend/third-party-integrations`).2122## Discovery Questions2324- What must staging mirror to be predictive (artifact, config shape, data volume/shape, integrations)?25- How is staging isolated from production data and side effects (no real charges/emails to real users)?26- What runs against staging as the pre-prod gate (migrations, smoke, E2E)?2728## Responsibilities2930- Deploy the **same immutable artifact** that will go to production (`../../backend/backend-deployment`), configured for staging — parity means config values differ, structure doesn't (`environment-management`).31- Keep **data-shape parity** with production (realistic volume so performance/pagination issues surface) while **isolated from production data** — no real customer PII; sandbox/sink modes for integrations so staging never charges cards or emails real users (`../../backend/third-party-integrations`, `../../security/privacy-review`).32- **Exercise migrations on staging first** (production-like dataset) to catch lock/timing/ordering issues before prod (`../../database/database-migrations`, `../../database/data-migration`).33- Run **smoke + critical E2E** against staging as a gate (`../../testing/smoke-testing`, `../../testing/playwright-e2e`/`maestro-e2e`); validate env/config there too.34- Treat staging as **production-like**, not a scratch pad — drift from production makes it non-predictive; keep it in sync.3536## Required Workflow37381. Define parity requirements (artifact, config, data shape, integrations).392. Stand up staging with the same artifact + staging config.403. Isolate data + integrations (sandbox/sink; no prod PII).414. Run migrations, smoke, and E2E as the pre-prod gate.425. Keep staging in sync with production to stay predictive.4344## Decision Rules4546- Same artifact as production — a differently-built staging validates the wrong thing.47- Config structure identical to prod; only values differ.48- Realistic data volume (perf-predictive) but zero production PII (privacy/security).49- Staging that has drifted from production is worse than none — it gives false confidence.5051## Rules5253- No production data/PII in staging.54- Integrations in sandbox/sink mode — no real-world side effects.55- Staging validates the exact artifact bound for production.5657## Anti-Patterns5859- Staging built differently from production.60- Production database dump (real PII) loaded into staging.61- Integrations hitting live third parties (real charges/emails).62- Tiny data volumes hiding performance problems.63- Staging left to rot out of sync with prod.6465## Validation Checklist6667- [ ] Same artifact as production, staging-configured.68- [ ] Config parity (structure identical, values differ).69- [ ] Data-shape parity, isolated, no prod PII.70- [ ] Integrations sandboxed/sinked.71- [ ] Migrations + smoke + E2E run as the pre-prod gate.72- [ ] Kept in sync with production.7374## Definition of Done7576A staging environment running the same artifact with production-parity config and isolated realistic data, integrations sandboxed, exercising migrations and smoke/E2E as a predictive pre-production gate — kept in sync with production.7778## Related Skills7980`deployment-selection`, `environment-management`, `production-readiness`, `../../backend/backend-deployment`, `../../database/database-migrations`, `../../database/data-migration`, `../../testing/smoke-testing`, `../../testing/playwright-e2e`, `../../backend/third-party-integrations`, `../../security/privacy-review`.8182## Related Knowledge8384`../../../knowledge/` (parity requirements, integration list).8586## Related References8788`../../../references/devops/` (staging setup notes, when populated).8990## Context Loading Guidance9192- **Requires:** deployment targets, config model, migration flow, integrations.93- **Does not require:** production credentials/data, app feature code.94- **May load:** `production-readiness`, `../../database/database-migrations`.95- **Stop when:** parity, isolation, and the pre-prod gate are defined.9697## Token Efficiency Guidance9899The parity checklist (artifact, config, data, integrations) is the artifact; keep it to what makes staging predictive.