Production-Readiness Review
Deliverable Specification
Produce a single Markdown review document directed to a Principal Engineer containing:
- Header: System name, scope/status, date, execution method (iteration counts, rubber-duck passes).
- Issue Index: Compact table grouped by metric (ID, Title, Severity, Confidence, Location, Bucket).
- Remediation Sections: One section per root-cause bucket detailing issues and the single production-grade solution with issue-by-issue mechanism mapping, concrete references, effort/risk, and validation strategies.
- Traceability Matrix: Mapping
Issue -> Bucket -> Metric. - Assumptions & Unverified Items: Any operational assumptions or unreadable paths marked UNVERIFIED with validation instructions.
- References: Verified list of file:line, spec, and upstream citations.
Strict Constraints:
- Simple, direct, technically precise language. Short paragraphs. Concrete nouns.
- Do not use em dashes anywhere in the output or review.
- Every claim, issue, and solution must cite a verifiable reference (file:line, named spec, or authoritative upstream documentation).
Phase 0: Intake & Autonomous Execution Contract
1. Upfront Batch Intake
Gather the following 8 inputs upfront in a single batch. If any are provided in the initial prompt, fill them automatically and prompt only for missing items:
- System Name: Target component or service name.
- Code Paths / Repos: Target file paths to review (REQUIRED: cannot proceed without readable source code).
- Sibling Systems & Test Kits: Supporting repos, mock kits, or integration harnesses.
- Runtime Facts: Target environments, cluster specs, dashboards, prod constraints, and permission for read-only CLI commands.
- Scope & Status: Active vs. latent, flag-off, or greenfield status.
- Audience: Default is Principal Engineer.
- Output File Path: Default is
<SYSTEM>_PRODUCTION_READINESS_REVIEW.mdin the current working directory. - Inclusions / Exclusions: Target metrics to emphasize or explicitly out-of-scope modules.
2. Autonomous Execution Contract
Once intake is collected, restate the execution plan in one line and run autonomously to completion:
- Never pause to ask clarifying questions, request mid-run approvals, or solicit confirmation.
- If an operational detail is ambiguous, record the most defensible assumption in the document's Assumptions section (noting what would invalidate it) and continue.
- If a referenced path is unreadable, label the finding
UNVERIFIEDwith instructions on how to verify it manually, and proceed. - Rubber-duck challenges run agent-to-agent (spawning subagents or multi-pass self-critiques), never through user interruptions.
- The review terminates only after the final Markdown document is written to the output path.
Ground Rules
- Code Is Ground Truth: Audit the actual implementation code first. If code conflicts with documentation, specifications, or comments, treat code as truth and document the specification drift.
- Evidence Invariant: Every assertion must link to an explicit file:line, architectural spec, or upstream library standard. Unsubstantiated claims are forbidden.
- Continuous Rubber-Ducking: Red-team every candidate finding through 10 to 15 critique rounds. Challenge reasoning, eliminate false positives, uncover hidden failure modes, and calibrate severity. Never accept a first draft.
- Context Differentiation: Explicitly distinguish between latent vs. active code paths, test harness vs. production implementations, and design omissions vs. runtime bugs.
- Deduplication & Root Cause: Merge overlapping symptoms into single, foundational root-cause issues.
- Continuous Evidence Log: Maintain traceable citation mappings throughout execution.
Audit Metrics
Evaluate the codebase against all 9 standard quality attributes plus domain-specific requirements:
- Reliability & Fault-Tolerance: Crash recovery, retry storms, circuit breakers, timeout propagation, backpressure, idempotency.
- Availability & Recovery: Single points of failure (SPOFs), health checks, graceful degradation, failover mechanics, drain behavior.
- Performance: Hot paths, algorithmic bottlenecks, lock contention, memory allocations, latency percentiles (p99/p99.9), serialization overhead.
- Scalability & Elasticity: Statefulness, resource limits, connection pooling, sharding/partitioning bottlenecks, concurrency limits.
- Correctness & Data Integrity: ACID transaction boundaries, race conditions, consistency models, schema migrations, serialization safety.
- Security & Blast Radius: Auth boundaries, privilege escalation, untrusted input parsing, secret leakage, blast radius containment.
- Observability & Debuggability: Structured logging, metric cardinality, tracing context propagation, alertability, actionable error messages.
- Operability & Maintainability: Configuration validation, flag safety, rollout/rollback safety, runbook clarity, dead code.
- Resource Efficiency & Cost: Memory leaks, goroutine/thread leaks, disk I/O amplification, idle resource waste, compute overhead.
- Domain-Specific Attributes: Real-time deadlines, regulatory boundaries, protocol invariants.
Review Lifecycle
flowchart TD
A[Phase 0: Intake Batch] --> B[Phase 1: Metric-by-Metric Discovery]
B --> C[Phase 2: Root-Cause Bucketing]
C --> D[Phase 3: Production-Grade Remediation]
D --> E[Phase 4: Assembly & Adversarial Fact-Check]
E --> F[Write Final Review Document]
Phase 1: Metric-by-Metric Iterative Discovery
For EACH metric sequentially:
- Source Inspection: Inspect raw source code through the lens of that specific metric.
- Adversarial Rubber-Duck Iteration: Execute 10 to 15 critique passes on the candidate findings:
- Eliminate claims lacking file:line backing.
- Correct faulty reasoning and invalidate flawed failure-mode assumptions.
- Surface blind spots and missed boundary conditions.
- Tighten severity (
Critical,High,Medium) and confidence (High,Med,Low). - Stop when a round yields zero material alterations, or at 15 rounds.
- Lock Metric Issues: Emit the finalized, cited issue list before moving to the next metric.
Issue Record Schema:
- ID: Sequential unique identifier (
ISSUE-001). - Title: One-line concise description.
- Component & Reference: Target component and exact
file:lineor spec reference. - Failure Mode: Concrete, step-by-step failure mechanism (avoid generic risks).
- Affected Metrics: Primary and secondary impacted quality attributes.
- Severity & Confidence: Graded strictly against operational blast radius.
- Scope: Testing kit, production implementation, or shared utility.
Phase 2: Root-Cause Bucketing
- Cluster all finalized issues across all metrics into natural remediation buckets based on shared root cause.
- Avoid fixed bucket counts; let the clustering reflect the codebase structure.
- Rubber-duck the clusters by evaluating: "Does a single cohesive architecture or code fix resolve all issues in this bucket without forcing unrelated concerns together?"
- Re-cluster until every issue maps to exactly one primary remediation bucket.
Phase 3: Single Production-Grade Solution Per Bucket
For each bucket:
- Candidate Research: Identify 2 to 3 candidate solutions based on in-repo conventions, sibling modules, or upstream ecosystem best practices.
- Adversarial Stress-Testing: Stress-test candidates against operational constraints, failure modes, and performance trade-offs. Select the single superior production-grade approach.
- Remediation Specification:
- Chosen architectural or implementation solution.
- Exact mapping showing how the solution eliminates each issue in the bucket (
Issue ID -> Resolution Mechanism). - Verifiable reference citations (file:line, spec, or upstream documentation).
- Implementation effort, deployment risk, and potential operational trade-offs.
- Concrete validation and testing strategy.
Phase 4: Assembly, Traceability & Final Fact-Check
- Assemble the comprehensive review document conforming to the Deliverable Specification.
- Build the Traceability Matrix (
Issue -> Bucket -> Metric) ensuring zero orphaned or unaddressed findings. - Conduct a final adversarial rubber-duck pass from the perspective of a skeptical Principal Engineer:
- Challenge every unreferenced assertion.
- Audit severity ratings for inflation or under-estimation.
- Verify every issue-to-mechanism resolution claim.
- Overwrite/write the deliverable Markdown file directly to the configured output path.
- Emit a concise completion summary reporting output path, total issue count, bucket count, and unverified assumptions.