Production Parity Test Designer
Overview
A test design skill that ensures production failures are caught before production. Rather than increasing test count, this skill focuses on which test tier should cover which production gap, eliminating proxy metrics (tests that pass but miss real failures) and structuring a layered defense from PR CI through release packaging.
Core Philosophy: Tests exist to reproduce production failure modes. If a test cannot fail in the same way production fails, it provides false confidence.
Scope Boundary: This skill designs the test architecture and allocation strategy. It does not write test code directly (use tdd-developer for that) or generate UAT procedures (use uat-testcase-generator for that).
When to Use
- PR CI が軽すぎて本番差分を検出できないとき
- SQLite と PostgreSQL のような DB 方言差があるとき
- UI が成功表示するのに DB に書かれていない問題があるとき
- mock により runtime import error が隠れているとき
- timezone / locale / OS / dependency の差分が本番で初めて顕在化するとき
- 「何を unit で、何を smoke で見るか」が曖昧なとき
- 過去の重大 defect を再発禁止テストとして構造化したいとき
- packaging / container build の整合性を保証したいとき
- テスト構成を見直して production parity を高めたいとき
Prerequisites
- Existing codebase with some tests: At least a basic test suite exists (even if insufficient)
- Production environment information: DB type, OS, container config, dependency list
- CI configuration: Current CI pipeline definition (GitHub Actions, CircleCI, etc.)
- Known defect history: Past incidents, RCA reports, or bug tracker data (optional but valuable)
- Dependency manifest: requirements.txt, package.json, Gemfile, go.mod, etc.
Inputs
- Existing test configuration and structure
- CI pipeline definition
- Production environment specifications (DB, OS, container, runtime)
- Known defects, RCA reports, or incident history
- Dependency manifests and lockfiles
- Timezone, locale, and environment variable configuration
Outputs
- Production Gap Inventory -- comprehensive list of dev/CI vs production differences
- Test Tier Allocation Matrix -- failure modes mapped to optimal test tiers
- PR Smoke Suite Proposal -- minimum parity checks required in every PR
- Adversarial Regression Backlog -- re-occurrence prevention tests for past defects
- Packaging / Dependency Integrity Checklist -- install, import, build verification
- Standard Test Command Map -- named commands for each execution context
Workflows
Step 1: Production Gap Inventory(本番差分の棚卸し)
Enumerate all differences between development/CI and production environments.
- Load
references/production_gap_catalog.md for the full gap taxonomy
- Interview the operator or inspect configuration to identify gaps in these categories:
- DB dialect: SQLite vs PostgreSQL/MySQL, schema differences, SQL syntax gaps
- OS / container: macOS dev vs Linux production, filesystem case sensitivity
- Dependency installation: pip install vs Docker image layers, native extensions
- Environment variables: Missing secrets, different feature flags, config drift
- Timezone / locale: Server TZ, DB TZ, application TZ, locale-sensitive formatting
- Real vs mock: Mocked APIs, stubbed services, fake filesystems
- Serialization: JSON/YAML parsing differences, encoding, binary formats
- Packaging / deployment: Build artifacts, image layers, startup scripts
- For each gap, document:
- Gap description: What differs between dev/CI and production
- Current coverage: Is any test currently exercising this gap?
- Risk if undetected: What breaks in production if this gap is missed?
- Output: Production Gap Inventory -- a standalone list of gaps, distinct from the Test Tier Allocation Matrix created in Step 3. Record gaps in the first three columns of
assets/test_tier_matrix_template.md (Failure mode, Production gap, and current coverage); the Test tier and remaining columns are populated in Step 3.
Step 2: Failure Mode Enumeration(失敗モードの列挙)
For each production gap, define concrete failure modes.
- For each gap from Step 1, enumerate specific ways the system breaks:
- SQLite passes but PostgreSQL throws syntax error on
UPSERT
- UI shows success toast but
INSERT silently fails (no error, no data)
import cv2 works in dev but fails in production container (missing native lib)
datetime.now() returns naive in dev, aware in production -> TypeError on comparison
- Row index access breaks when column order changes between DB versions
- Load
references/adversarial_test_patterns.md for additional failure patterns
- Classify each failure mode by:
- Visibility: Silent (no error) vs Loud (exception/crash)
- Blast radius: Single record vs Entire feature vs System-wide
- Detection difficulty: Easy (log check) vs Hard (data audit required)
- Output: Failure mode list annotated with classification
Step 3: Test Tier Allocation(テスト階層への配賦)
Assign each failure mode to the optimal test tier.
- Load
references/test_tier_strategy.md for tier responsibilities and tradeoffs
- Apply the following allocation rules:
- Unit: Pure logic, boundary values, input validation, format conversion
- Integration: Real DB queries, real repository operations, multi-component interaction
- E2E: UI action -> persistence verification -> business-visible outcome
- Smoke: Minimum production parity checks that must pass in every PR
- Packaging: Install, import, build, container image integrity
- Nightly / Heavy: Full parity suite, performance baselines, large dataset tests
- Decision criteria for tier assignment:
- If the failure depends on external state (DB, API, filesystem) -> Integration or higher
- If the failure is a logic error reproducible with pure inputs -> Unit
- If the failure requires end-to-end flow through UI -> E2E
- If the failure relates to dependency availability -> Packaging
- If the test must run fast enough for PR CI -> Smoke (with runtime budget)
- Populate
assets/test_tier_matrix_template.md with assignments
- Flag any failure modes that have no viable test tier (requires monitoring instead)
Step 4: Proxy Metric Elimination(プロキシメトリクスの排除)
Identify and remove tests that provide false confidence.
- Review existing tests for proxy metric patterns:
- UI-only verification: E2E checks screen display but never queries the database
- Mock-only coverage: All external calls mocked, never tested with real dependencies
- Coverage theater: High line coverage but no type mismatch or boundary testing
- All-green illusion: Tests pass but production DB has never been touched
- Happy-path bias: Only success paths tested, no error/edge case coverage
- For each identified proxy metric:
- Document what the test actually verifies vs what it appears to verify
- Specify what additional assertion or real dependency is needed
- Assign to the appropriate test tier from Step 3
- Load
references/persistence_verification_guide.md for persistence verification patterns
- Output: List of proxy metrics with remediation actions
Step 5: PR Smoke Suite Definition(PR必須スモークセットの決定)
Define the minimum set of production parity checks for every PR.
- From the Test Tier Matrix (Step 3), select items marked "Must run in PR"
- Apply runtime budget constraint:
- Target: PR smoke suite completes within 2-5 minutes
- If over budget, prioritize by blast radius and detection difficulty
- Define smoke categories (use
assets/smoke_suite_template.md):
- DB dialect smoke: At least one real-DB operation (upsert, query with dialect-specific syntax)
- Import smoke: Verify all production imports succeed
- Persistence smoke: UI action -> DB read verification
- Timezone smoke: Mixed aware/naive datetime operation
- Serialization smoke: Round-trip encode/decode with production formats
- For each smoke test, document:
- Purpose and what production gap it covers
- Runtime budget allocation
- Environment requirements (e.g., PostgreSQL service in CI)
- Pass/fail meaning (what does failure indicate?)
- Output: PR smoke suite specification
Step 6: Adversarial Regression Backlog(再発禁止テストバックログ)
Create regression tests derived from past defects and attack patterns. This skill designs regression tests for known app-specific exploit/failure patterns, but it is not a substitute for dedicated security review or penetration testing.
- Load
references/adversarial_test_patterns.md for attack pattern catalog
- For each known past defect or incident:
- Identify the exploit/failure pattern (how did it break?)
- Define the minimal reproducible scenario (smallest test that would have caught it)
- Specify the expected protected behavior (what should the system do instead?)
- Determine the regression scope (which related areas need similar protection?)
- Add proactive adversarial tests for common patterns:
- SQL injection via user input fields
- Authentication bypass via header manipulation
- Path traversal in file upload/download
- Invalid state transitions in workflow engines
- Duplicate submission / idempotency violations
- Stale write / optimistic locking failures
- Populate
assets/adversarial_regression_template.md
- Output: Prioritized adversarial regression backlog
Step 7: Packaging / Dependency Integrity Checklist(パッケージング・依存整合性チェック)
Verify that the application builds, installs, and imports correctly in a production-equivalent environment.
- Load
references/packaging_integrity_guide.md for verification patterns
- Populate
assets/packaging_checklist_template.md covering:
- Dependency files: lockfile alignment, pinned versions, no floating ranges
- Install path: clean install from lockfile succeeds without network for pinned deps
- Import smoke: all top-level imports succeed in a fresh environment
- Runtime command: main entry point starts without error
- Image parity: container image matches production base image and dependencies
- Environment secrets: required env vars are documented and validated at startup
- Output: Completed packaging / dependency integrity checklist
Step 8: Standard Command Map(実行コマンドの固定)
Define named test commands for each execution context.
- Use
assets/command_map_template.md to define commands for:
- Local fast: Developer runs during coding (unit + basic integration)
- PR CI required: Smoke suite that gates every pull request
- Nightly parity: Full production parity suite on schedule
- Staging E2E: End-to-end tests against staging environment
- Release packaging: Build, install, import verification before release
- For each command:
- Specify the exact command syntax (e.g.,
pytest tests/ -m smoke --timeout=300)
- List which test tiers are included
- Define execution context (local / CI / staging / release)
- Assign ownership (team or individual responsible for maintenance)
- Output: Complete command map with all execution contexts
Resources
| Resource |
Type |
Purpose |
When to Load |
references/production_gap_catalog.md |
Reference |
Full taxonomy of production vs dev/CI differences |
Step 1 |
references/test_tier_strategy.md |
Reference |
Tier responsibilities, speed vs reliability tradeoffs, PR criteria |
Step 3 |
references/adversarial_test_patterns.md |
Reference |
Attack and failure pattern catalog for regression tests |
Step 2, 6 |
references/persistence_verification_guide.md |
Reference |
Patterns for verifying stored state beyond UI display |
Step 4 |
references/packaging_integrity_guide.md |
Reference |
Dependency, build, import, container verification patterns |
Step 7, 8 |
references/timezone_dialect_boundary_guide.md |
Reference |
Timezone mixing, DB timestamp semantics, locale formatting |
Step 1, 2 |
assets/test_tier_matrix_template.md |
Template |
Failure mode to test tier allocation table |
Step 3 |
assets/smoke_suite_template.md |
Template |
PR smoke suite specification template |
Step 5 |
assets/adversarial_regression_template.md |
Template |
Regression test backlog with exploit patterns |
Step 6 |
assets/packaging_checklist_template.md |
Template |
Dependency and build integrity checklist |
Step 7 |
assets/command_map_template.md |
Template |
Test command definitions per execution context |
Step 8 |
Best Practices
Production Gap First, Test Count Second
- Never start by asking "how many tests do we need?"
- Start by asking "what production failures are invisible to our current tests?"
- A single well-placed integration test against a real PostgreSQL instance is worth more than 50 unit tests running against SQLite
Persistence Over Presentation
- Every E2E test that checks UI display MUST also verify the underlying data store
- "Success toast appeared" is not a valid assertion -- verify the database row exists, has correct values, and timestamps are properly stored
- Load
references/persistence_verification_guide.md for read-after-write patterns
Runtime Budget Discipline
- PR smoke suites MUST have a runtime budget (target: 2-5 minutes)
- Tests that exceed the budget get demoted to nightly, not skipped
- Track actual vs budgeted runtime and alert on drift
- Fast feedback loops keep developers engaged; slow suites get ignored
Mock Minimization Strategy
- Mocks are acceptable for: external rate-limited APIs, payment processors in test, third-party webhook senders
- Mocks are NOT acceptable for: your own database, your own file storage, your own message queue
- Every mock should have a corresponding integration test that uses the real dependency
- Document which mocks exist and why -- unreviewed mocks become invisible risk
Adversarial Thinking
- For every feature, ask: "How would a malicious user or a chaotic system break this?"
- Past defects are the best source of adversarial test ideas -- every RCA should produce at least one regression test
- Load
references/adversarial_test_patterns.md for systematic exploit patterns
Environment Parity in CI
- CI should match production as closely as possible: same DB engine, same OS family, same timezone config
- Use service containers (e.g., PostgreSQL in GitHub Actions) rather than in-memory substitutes
- Pin dependency versions in CI to match production lockfiles
- Load
references/packaging_integrity_guide.md for container and dependency alignment
1---2name: production-parity-test-designer3description: 本番と同じ失敗を本番前に検出するためのテスト階層設計スキル。 DB方言差、実依存関係、永続化確認、timezone差、packaging整合性、 adversarial regressionをunit/integration/e2e/smoke/packagingに 適切に割り振り、PR CIで最低限の本番同等性を保証する。 Use when designing production-parity tests, closing test blind spots, building smoke suites for real dependencies, verifying persistence beyond UI success, or creating adversarial regression backlogs.4---56# Production Parity Test Designer78## Overview910A test design skill that ensures **production failures are caught before production**. Rather than increasing test count, this skill focuses on **which test tier should cover which production gap**, eliminating proxy metrics (tests that pass but miss real failures) and structuring a layered defense from PR CI through release packaging.1112**Core Philosophy**: Tests exist to reproduce production failure modes. If a test cannot fail in the same way production fails, it provides false confidence.1314**Scope Boundary**: This skill designs the test architecture and allocation strategy. It does not write test code directly (use `tdd-developer` for that) or generate UAT procedures (use `uat-testcase-generator` for that).1516## When to Use1718- PR CI が軽すぎて本番差分を検出できないとき19- SQLite と PostgreSQL のような DB 方言差があるとき20- UI が成功表示するのに DB に書かれていない問題があるとき21- mock により runtime import error が隠れているとき22- timezone / locale / OS / dependency の差分が本番で初めて顕在化するとき23- 「何を unit で、何を smoke で見るか」が曖昧なとき24- 過去の重大 defect を再発禁止テストとして構造化したいとき25- packaging / container build の整合性を保証したいとき26- テスト構成を見直して production parity を高めたいとき2728## Prerequisites2930- **Existing codebase with some tests**: At least a basic test suite exists (even if insufficient)31- **Production environment information**: DB type, OS, container config, dependency list32- **CI configuration**: Current CI pipeline definition (GitHub Actions, CircleCI, etc.)33- **Known defect history**: Past incidents, RCA reports, or bug tracker data (optional but valuable)34- **Dependency manifest**: requirements.txt, package.json, Gemfile, go.mod, etc.3536## Inputs3738- Existing test configuration and structure39- CI pipeline definition40- Production environment specifications (DB, OS, container, runtime)41- Known defects, RCA reports, or incident history42- Dependency manifests and lockfiles43- Timezone, locale, and environment variable configuration4445## Outputs46471. **Production Gap Inventory** -- comprehensive list of dev/CI vs production differences482. **Test Tier Allocation Matrix** -- failure modes mapped to optimal test tiers493. **PR Smoke Suite Proposal** -- minimum parity checks required in every PR504. **Adversarial Regression Backlog** -- re-occurrence prevention tests for past defects515. **Packaging / Dependency Integrity Checklist** -- install, import, build verification526. **Standard Test Command Map** -- named commands for each execution context5354## Workflows5556### Step 1: Production Gap Inventory(本番差分の棚卸し)5758Enumerate all differences between development/CI and production environments.59601. Load `references/production_gap_catalog.md` for the full gap taxonomy612. Interview the operator or inspect configuration to identify gaps in these categories:62 - **DB dialect**: SQLite vs PostgreSQL/MySQL, schema differences, SQL syntax gaps63 - **OS / container**: macOS dev vs Linux production, filesystem case sensitivity64 - **Dependency installation**: pip install vs Docker image layers, native extensions65 - **Environment variables**: Missing secrets, different feature flags, config drift66 - **Timezone / locale**: Server TZ, DB TZ, application TZ, locale-sensitive formatting67 - **Real vs mock**: Mocked APIs, stubbed services, fake filesystems68 - **Serialization**: JSON/YAML parsing differences, encoding, binary formats69 - **Packaging / deployment**: Build artifacts, image layers, startup scripts703. For each gap, document:71 - **Gap description**: What differs between dev/CI and production72 - **Current coverage**: Is any test currently exercising this gap?73 - **Risk if undetected**: What breaks in production if this gap is missed?744. Output: **Production Gap Inventory** -- a standalone list of gaps, distinct from the Test Tier Allocation Matrix created in Step 3. Record gaps in the first three columns of `assets/test_tier_matrix_template.md` (Failure mode, Production gap, and current coverage); the Test tier and remaining columns are populated in Step 3.7576### Step 2: Failure Mode Enumeration(失敗モードの列挙)7778For each production gap, define concrete failure modes.79801. For each gap from Step 1, enumerate specific ways the system breaks:81 - SQLite passes but PostgreSQL throws syntax error on `UPSERT`82 - UI shows success toast but `INSERT` silently fails (no error, no data)83 - `import cv2` works in dev but fails in production container (missing native lib)84 - `datetime.now()` returns naive in dev, aware in production -> `TypeError` on comparison85 - Row index access breaks when column order changes between DB versions862. Load `references/adversarial_test_patterns.md` for additional failure patterns873. Classify each failure mode by:88 - **Visibility**: Silent (no error) vs Loud (exception/crash)89 - **Blast radius**: Single record vs Entire feature vs System-wide90 - **Detection difficulty**: Easy (log check) vs Hard (data audit required)914. Output: Failure mode list annotated with classification9293### Step 3: Test Tier Allocation(テスト階層への配賦)9495Assign each failure mode to the optimal test tier.96971. Load `references/test_tier_strategy.md` for tier responsibilities and tradeoffs982. Apply the following allocation rules:99 - **Unit**: Pure logic, boundary values, input validation, format conversion100 - **Integration**: Real DB queries, real repository operations, multi-component interaction101 - **E2E**: UI action -> persistence verification -> business-visible outcome102 - **Smoke**: Minimum production parity checks that must pass in every PR103 - **Packaging**: Install, import, build, container image integrity104 - **Nightly / Heavy**: Full parity suite, performance baselines, large dataset tests1053. Decision criteria for tier assignment:106 - If the failure depends on external state (DB, API, filesystem) -> Integration or higher107 - If the failure is a logic error reproducible with pure inputs -> Unit108 - If the failure requires end-to-end flow through UI -> E2E109 - If the failure relates to dependency availability -> Packaging110 - If the test must run fast enough for PR CI -> Smoke (with runtime budget)1114. Populate `assets/test_tier_matrix_template.md` with assignments1125. Flag any failure modes that have no viable test tier (requires monitoring instead)113114### Step 4: Proxy Metric Elimination(プロキシメトリクスの排除)115116Identify and remove tests that provide false confidence.1171181. Review existing tests for proxy metric patterns:119 - **UI-only verification**: E2E checks screen display but never queries the database120 - **Mock-only coverage**: All external calls mocked, never tested with real dependencies121 - **Coverage theater**: High line coverage but no type mismatch or boundary testing122 - **All-green illusion**: Tests pass but production DB has never been touched123 - **Happy-path bias**: Only success paths tested, no error/edge case coverage1242. For each identified proxy metric:125 - Document what the test actually verifies vs what it appears to verify126 - Specify what additional assertion or real dependency is needed127 - Assign to the appropriate test tier from Step 31283. Load `references/persistence_verification_guide.md` for persistence verification patterns1294. Output: List of proxy metrics with remediation actions130131### Step 5: PR Smoke Suite Definition(PR必須スモークセットの決定)132133Define the minimum set of production parity checks for every PR.1341351. From the Test Tier Matrix (Step 3), select items marked "Must run in PR"1362. Apply runtime budget constraint:137 - Target: PR smoke suite completes within **2-5 minutes**138 - If over budget, prioritize by blast radius and detection difficulty1393. Define smoke categories (use `assets/smoke_suite_template.md`):140 - **DB dialect smoke**: At least one real-DB operation (upsert, query with dialect-specific syntax)141 - **Import smoke**: Verify all production imports succeed142 - **Persistence smoke**: UI action -> DB read verification143 - **Timezone smoke**: Mixed aware/naive datetime operation144 - **Serialization smoke**: Round-trip encode/decode with production formats1454. For each smoke test, document:146 - Purpose and what production gap it covers147 - Runtime budget allocation148 - Environment requirements (e.g., PostgreSQL service in CI)149 - Pass/fail meaning (what does failure indicate?)1505. Output: PR smoke suite specification151152### Step 6: Adversarial Regression Backlog(再発禁止テストバックログ)153154Create regression tests derived from past defects and attack patterns. This skill designs regression tests for known app-specific exploit/failure patterns, but it is **not a substitute for dedicated security review or penetration testing**.1551561. Load `references/adversarial_test_patterns.md` for attack pattern catalog1572. For each known past defect or incident:158 - Identify the **exploit/failure pattern** (how did it break?)159 - Define the **minimal reproducible scenario** (smallest test that would have caught it)160 - Specify the **expected protected behavior** (what should the system do instead?)161 - Determine the **regression scope** (which related areas need similar protection?)1623. Add proactive adversarial tests for common patterns:163 - SQL injection via user input fields164 - Authentication bypass via header manipulation165 - Path traversal in file upload/download166 - Invalid state transitions in workflow engines167 - Duplicate submission / idempotency violations168 - Stale write / optimistic locking failures1694. Populate `assets/adversarial_regression_template.md`1705. Output: Prioritized adversarial regression backlog171172### Step 7: Packaging / Dependency Integrity Checklist(パッケージング・依存整合性チェック)173174Verify that the application builds, installs, and imports correctly in a production-equivalent environment.1751761. Load `references/packaging_integrity_guide.md` for verification patterns1772. Populate `assets/packaging_checklist_template.md` covering:178 - **Dependency files**: lockfile alignment, pinned versions, no floating ranges179 - **Install path**: clean install from lockfile succeeds without network for pinned deps180 - **Import smoke**: all top-level imports succeed in a fresh environment181 - **Runtime command**: main entry point starts without error182 - **Image parity**: container image matches production base image and dependencies183 - **Environment secrets**: required env vars are documented and validated at startup1843. Output: Completed packaging / dependency integrity checklist185186### Step 8: Standard Command Map(実行コマンドの固定)187188Define named test commands for each execution context.1891901. Use `assets/command_map_template.md` to define commands for:191 - **Local fast**: Developer runs during coding (unit + basic integration)192 - **PR CI required**: Smoke suite that gates every pull request193 - **Nightly parity**: Full production parity suite on schedule194 - **Staging E2E**: End-to-end tests against staging environment195 - **Release packaging**: Build, install, import verification before release1962. For each command:197 - Specify the exact command syntax (e.g., `pytest tests/ -m smoke --timeout=300`)198 - List which test tiers are included199 - Define execution context (local / CI / staging / release)200 - Assign ownership (team or individual responsible for maintenance)2013. Output: Complete command map with all execution contexts202203## Resources204205| Resource | Type | Purpose | When to Load |206|----------|------|---------|--------------|207| `references/production_gap_catalog.md` | Reference | Full taxonomy of production vs dev/CI differences | Step 1 |208| `references/test_tier_strategy.md` | Reference | Tier responsibilities, speed vs reliability tradeoffs, PR criteria | Step 3 |209| `references/adversarial_test_patterns.md` | Reference | Attack and failure pattern catalog for regression tests | Step 2, 6 |210| `references/persistence_verification_guide.md` | Reference | Patterns for verifying stored state beyond UI display | Step 4 |211| `references/packaging_integrity_guide.md` | Reference | Dependency, build, import, container verification patterns | Step 7, 8 |212| `references/timezone_dialect_boundary_guide.md` | Reference | Timezone mixing, DB timestamp semantics, locale formatting | Step 1, 2 |213| `assets/test_tier_matrix_template.md` | Template | Failure mode to test tier allocation table | Step 3 |214| `assets/smoke_suite_template.md` | Template | PR smoke suite specification template | Step 5 |215| `assets/adversarial_regression_template.md` | Template | Regression test backlog with exploit patterns | Step 6 |216| `assets/packaging_checklist_template.md` | Template | Dependency and build integrity checklist | Step 7 |217| `assets/command_map_template.md` | Template | Test command definitions per execution context | Step 8 |218219## Best Practices220221### Production Gap First, Test Count Second222223- Never start by asking "how many tests do we need?"224- Start by asking "what production failures are invisible to our current tests?"225- A single well-placed integration test against a real PostgreSQL instance is worth more than 50 unit tests running against SQLite226227### Persistence Over Presentation228229- Every E2E test that checks UI display MUST also verify the underlying data store230- "Success toast appeared" is not a valid assertion -- verify the database row exists, has correct values, and timestamps are properly stored231- Load `references/persistence_verification_guide.md` for read-after-write patterns232233### Runtime Budget Discipline234235- PR smoke suites MUST have a runtime budget (target: 2-5 minutes)236- Tests that exceed the budget get demoted to nightly, not skipped237- Track actual vs budgeted runtime and alert on drift238- Fast feedback loops keep developers engaged; slow suites get ignored239240### Mock Minimization Strategy241242- Mocks are acceptable for: external rate-limited APIs, payment processors in test, third-party webhook senders243- Mocks are NOT acceptable for: your own database, your own file storage, your own message queue244- Every mock should have a corresponding integration test that uses the real dependency245- Document which mocks exist and why -- unreviewed mocks become invisible risk246247### Adversarial Thinking248249- For every feature, ask: "How would a malicious user or a chaotic system break this?"250- Past defects are the best source of adversarial test ideas -- every RCA should produce at least one regression test251- Load `references/adversarial_test_patterns.md` for systematic exploit patterns252253### Environment Parity in CI254255- CI should match production as closely as possible: same DB engine, same OS family, same timezone config256- Use service containers (e.g., PostgreSQL in GitHub Actions) rather than in-memory substitutes257- Pin dependency versions in CI to match production lockfiles258- Load `references/packaging_integrity_guide.md` for container and dependency alignment