Inferensys

Prompt

ADR Anti-Pattern Detection Prompt

A practical prompt playbook for detecting common failure modes in Architecture Decision Records before they become institutionalized technical debt.
Architect reviewing LLM integration architecture on laptop, system diagrams visible, modern technical office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Identifies the ideal user, context, and boundaries for deploying the ADR anti-pattern detection prompt in a real review workflow.

This prompt is designed for architects, technical leads, and review board members who need to systematically audit an Architecture Decision Record (ADR) for structural weaknesses before approval. The primary job-to-be-done is quality assurance: catching logical fallacies, documentation anti-patterns, and missing rigor that would otherwise undermine the decision's traceability and defensibility. Use it as a gate before an ADR is merged into the repository, during a formal architecture review board session, or when performing a retrospective audit of an existing decision log. The ideal user has enough architectural context to judge the prompt's findings but wants an automated first pass to surface issues that are easy to miss during manual review, such as unstated assumptions masquerading as facts or options that were never genuinely considered.

The prompt assumes the input is a complete or near-complete ADR draft containing the standard sections: context, decision, options considered, trade-offs, and consequences. It is not designed for raw meeting notes, whiteboard sketches, or partial outlines. If the input lacks a clear decision statement or option enumeration, the prompt will correctly flag those as structural gaps rather than attempting to fill them in. The detection library covers high-frequency failure modes including decision-by-default (presenting only one option as inevitable), rationalization-after-the-fact (justifying a pre-made choice rather than evaluating alternatives), missing trade-offs (listing options without comparing them on cost, risk, or feasibility dimensions), option anchoring (framing all alternatives against a favored choice), and unstated assumptions (treating team capability, budget, or timeline constraints as implicit rather than documented). Each flagged issue includes a severity rating and specific remediation guidance tied to the ADR text.

Do not use this prompt for generating new ADRs, for general code review, or for evaluating the technical correctness of the decision itself. It detects documentation and reasoning quality issues, not whether the chosen architecture will work. The prompt is also not a substitute for human architectural judgment: it will flag that trade-offs are missing but cannot assess whether the trade-offs that are present are the right ones. In regulated or safety-critical domains, always pair the prompt's output with human review and consider requiring explicit sign-off on any high-severity findings before the ADR is accepted. For teams with an existing ADR template, adapt the [PATTERN_LIBRARY] placeholder to include your organization's specific anti-patterns and examples drawn from past review failures.

PRACTICAL GUARDRAILS

Use Case Fit

Where the ADR Anti-Pattern Detection Prompt delivers reliable value and where it introduces risk or noise. Use these cards to decide if this prompt fits your review workflow before integrating it into your architecture governance pipeline.

01

Good Fit: Pre-Merge ADR Review Gates

Use when: You have a growing ADR repository and want to catch structural defects before decisions are accepted. The prompt excels at flagging missing trade-offs, unstated assumptions, and rationalization-after-the-fact patterns in draft ADRs. Guardrail: Run detection before human review so reviewers focus on architectural judgment rather than formatting and completeness checks.

02

Good Fit: Repository Health Audits

Use when: You need to assess the quality of an existing ADR corpus across multiple teams or services. The prompt can batch-process ADRs and surface systemic issues like decision-by-default or chronic absence of considered alternatives. Guardrail: Pair automated detection with a sampling-based human audit to calibrate severity ratings and avoid false confidence in pattern coverage.

03

Bad Fit: Greenfield Decisions Without Drafts

Avoid when: No ADR draft exists yet and the team needs to generate options or make a decision from scratch. This prompt detects anti-patterns in existing text; it does not generate architecture decisions or enumerate alternatives. Guardrail: Use the ADR Generation Prompt or Decision Options Enumeration Prompt first, then run anti-pattern detection on the resulting draft.

04

Bad Fit: Real-Time Architecture Discussions

Avoid when: You are in a live design session or whiteboarding meeting and want instant feedback. The prompt requires a complete or near-complete ADR text to analyze; it cannot reason reliably from partial verbal arguments or bullet-point notes. Guardrail: Capture meeting notes, run the Context Extraction Prompt to structure them, draft the ADR, then apply detection as a post-session quality step.

05

Required Inputs: Complete ADR Text and Pattern Library

Risk: Running detection on incomplete ADRs produces false positives and misses context-dependent anti-patterns like unstated assumptions. Guardrail: Require all standard ADR sections (context, decision, options, consequences) before invoking detection. Maintain a curated pattern library with examples and severity definitions so the prompt has stable reference points for flagging.

06

Operational Risk: Over-Reliance on Automated Flagging

Risk: Teams may treat the prompt's output as a definitive quality gate and skip human architectural judgment. The prompt can miss domain-specific anti-patterns or flag stylistic issues that are not actual defects. Guardrail: Position detection output as advisory input for human reviewers. Require human sign-off on all severity-high findings before an ADR is accepted or rejected based on flagged issues.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for detecting anti-patterns in Architecture Decision Records, ready to be adapted with your specific ADR content and review standards.

This prompt template is designed to be copied directly into your AI harness, IDE, or evaluation pipeline. It uses square-bracket placeholders that you must replace with your actual ADR text, review criteria, and output format requirements before sending to the model. The template is structured to produce a consistent, machine-readable flagged-issue report that your application can parse, log, and route for human review.

text
You are an architecture review assistant trained to detect common anti-patterns in Architecture Decision Records (ADRs). Your task is to analyze the provided ADR and identify failure modes that undermine decision quality.

## INPUT
[ADR_TEXT]

## PATTERN LIBRARY
Use the following pattern definitions to guide your analysis. For each pattern, assign a severity rating of LOW, MEDIUM, HIGH, or CRITICAL based on the risk it poses to decision correctness and system outcomes.

1. DECISION_BY_DEFAULT: The decision is presented as the only viable path without evidence that alternatives were seriously considered. Severity is HIGH if the decision has broad system impact.
2. MISSING_TRADE_OFFS: The ADR states a decision and its benefits but omits costs, downsides, or rejected alternatives. Severity is MEDIUM if the omission hides known risks; CRITICAL if it hides irreversible consequences.
3. UNSTATED_ASSUMPTIONS: The rationale depends on conditions that are not explicitly stated, validated, or assigned an owner. Severity is HIGH if a false assumption would invalidate the decision.
4. RATIONALIZATION_AFTER_THE_FACT: The ADR reads as a justification for a decision already made rather than a balanced evaluation that preceded the choice. Indicators include one-sided evidence and dismissive treatment of alternatives. Severity is CRITICAL.
5. WEAK_RATIONALE: The rationale relies on vague claims ("best practice," "industry standard," "scalable") without concrete evidence, metrics, or context-specific reasoning. Severity is MEDIUM.
6. MISSING_CONTEXT: The ADR lacks essential background such as constraints, stakeholder concerns, or the problem statement that motivated the decision. Severity is HIGH if the missing context makes the decision unreviewable.
7. GOLD_PLATING: The chosen option includes unnecessary complexity, premature optimization, or speculative features not justified by current requirements. Severity is LOW unless the complexity introduces material risk.
8. CONSEQUENCE_BLINDNESS: The ADR describes the decision but omits the consequences—both positive and negative—that follow from it. Severity is HIGH if negative consequences affect other teams or systems.

## CONSTRAINTS
- Only flag patterns you can cite specific evidence for from the ADR text.
- Do not invent patterns not present in the input.
- For each flagged pattern, quote the relevant ADR passage that supports the finding.
- If no patterns are detected, return an empty findings array.
- Do not rewrite or improve the ADR; only report findings.

## OUTPUT_SCHEMA
Return a JSON object with this exact structure:
{
  "adr_title": "string (extracted or 'Untitled')",
  "findings": [
    {
      "pattern": "PATTERN_NAME",
      "severity": "LOW|MEDIUM|HIGH|CRITICAL",
      "evidence": "Direct quote from ADR",
      "explanation": "Why this pattern applies and what risk it creates",
      "suggested_action": "What the author should do to address this finding"
    }
  ],
  "summary": {
    "total_findings": number,
    "critical_count": number,
    "high_count": number,
    "medium_count": number,
    "low_count": number,
    "overall_assessment": "One-sentence summary of ADR quality"
  }
}

To adapt this template, replace [ADR_TEXT] with the full body of the ADR you want to analyze. If your organization uses a different set of anti-patterns, modify the pattern library while preserving the severity scale and evidence-quoting requirement. The output schema is designed for direct ingestion into a review dashboard or CI/CD pipeline—keep the JSON structure stable so downstream validators can parse findings reliably. Before deploying, run this prompt against a golden set of ADRs with known anti-patterns to calibrate detection accuracy and tune the pattern descriptions for your team's writing style.

IMPLEMENTATION TABLE

Prompt Variables

Required and optional inputs for the ADR Anti-Pattern Detection Prompt. Each placeholder must be populated before the prompt is sent to the model. Validation notes describe how to check input quality before execution.

PlaceholderPurposeExampleValidation Notes

[ADR_TEXT]

The full body of the Architecture Decision Record to scan for anti-patterns

Title: Adopt PostgreSQL for OLTP Status: Accepted Context: We need a relational database...

Required. Must be non-empty string with minimum 200 characters. Reject if only title or status line present. Check for truncated input.

[PATTERN_LIBRARY]

Reference catalog of known ADR anti-patterns with definitions, examples, and severity ratings

decision-by-default: Choosing the first option mentioned without documented alternatives. Severity: HIGH.

Required. Must contain at least 5 pattern definitions. Each pattern needs a name, description, and severity field. Validate JSON structure if library is machine-readable.

[SEVERITY_THRESHOLD]

Minimum severity level for inclusion in the flagged-issue report

MEDIUM

Optional. Must be one of: LOW, MEDIUM, HIGH, CRITICAL. Defaults to MEDIUM if omitted. Reject invalid enum values.

[CONTEXT_WINDOW]

Additional project or organizational context that may explain or mitigate apparent anti-patterns

Team is a 3-person startup. ADR written during prototyping phase. Formal review process not yet established.

Optional. If provided, must be under 500 words to avoid diluting pattern detection. Null allowed. Flag if context contradicts ADR claims.

[OUTPUT_FORMAT]

Desired structure for the flagged-issue report

JSON with fields: pattern_name, severity, location_in_adr, evidence_quote, explanation, remediation_suggestion

Required. Must specify valid schema. Default to structured JSON if not provided. Reject free-text-only output format requests for production harnesses.

[MAX_FINDINGS]

Upper bound on number of flagged issues to return

10

Optional. Must be positive integer between 1 and 50. Defaults to 20 if omitted. Use to control token cost and review fatigue.

[REQUIRE_CITATIONS]

Whether each finding must quote the specific ADR passage that triggered detection

Optional. Must be boolean true or false. Defaults to true. Set to false only for quick scans where traceability is not required.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the ADR Anti-Pattern Detection Prompt into an automated review pipeline or manual architecture workflow.

This prompt is designed to be integrated into a code review or documentation pipeline, not just used as a one-off chat interaction. The primary integration point is a pull request or merge request workflow where ADRs are committed as markdown files. When a new ADR is proposed, the system should automatically run this prompt against the document and attach the resulting flagged-issue report as a non-blocking review comment. This gives architects and reviewers a structured starting point for their human review, rather than requiring them to manually spot anti-patterns from scratch.

For implementation, wrap the prompt in a thin service that accepts an ADR markdown file path or raw text as input. The service should validate the model's output against a strict JSON schema before surfacing results. The expected output schema includes a flagged_issues array where each issue has a pattern_name (matching the pattern library), severity (CRITICAL, HIGH, MEDIUM, LOW), location (section or line reference in the ADR), evidence (quoted text from the ADR), and recommendation. If the model's output fails schema validation, retry once with the validation error included in the prompt context. If it fails again, log the failure and surface a manual review flag rather than silently dropping the analysis. Model choice matters here: use a model with strong reasoning capabilities (such as Claude 3.5 Sonnet or GPT-4o) because detecting rationalization-after-the-fact and unstated assumptions requires inferring what is not written, not just pattern-matching surface text.

For teams with an existing ADR repository, batch processing is a common pattern. Run the prompt across all existing ADRs to establish a baseline anti-pattern inventory, then run it incrementally on new or modified ADRs. Store results in a database with fields for ADR filename, commit hash, detection timestamp, and issue details. This enables trend analysis—are certain anti-patterns recurring across the team? Are severity levels decreasing over time as the team internalizes the feedback? Avoid using this prompt as a hard gate that blocks ADR merges. False positives are common, especially for MEDIUM and LOW severity detections. Instead, use it as an advisory signal that prompts a human reviewer to look closer at specific sections. The highest-value integration is surfacing CRITICAL issues (like decision-by-default with no alternatives documented) directly in the PR comments where they are hardest to ignore.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, format, and validation rules for the ADR anti-pattern detection response. Use this contract to parse, validate, and route findings before surfacing them to reviewers.

Field or ElementType or FormatRequiredValidation Rule

findings

Array of objects

Must be a non-empty array if issues detected; empty array only if no anti-patterns found. Schema check: each element must match the finding object contract.

findings[].pattern_id

String (snake_case)

Must match an entry in the provided pattern library enum. Reject unknown values. Example: decision_by_default, missing_trade_offs, unstated_assumptions, rationalization_after_fact.

findings[].severity

String (enum)

Must be one of: critical, high, medium, low. Critical reserved for decisions likely to cause unrecoverable failure. Parse check: case-insensitive match, normalize to lowercase.

findings[].title

String

Must be 5-120 characters. Must not be generic placeholder text. Must reference a specific pattern instance from the input ADR.

findings[].description

String

Must contain at least one direct quote or paraphrase from the source ADR as evidence. Minimum 30 characters. Null or vague descriptions trigger a retry.

findings[].location

String or null

If present, must reference a recognizable ADR section name (e.g., Context, Options, Decision, Rationale, Consequences). Null allowed when the pattern spans the entire document.

findings[].suggested_remediation

String

Must be a concrete, actionable suggestion specific to the detected pattern. Must not be generic advice. Minimum 20 characters. Retry if suggestion is a restatement of the pattern name.

meta

Object

Must contain review_timestamp (ISO 8601 string) and patterns_checked (integer count of patterns in the library that were evaluated). Schema check required.

PRACTICAL GUARDRAILS

Common Failure Modes

When an ADR anti-pattern detection prompt fails, it usually fails in predictable ways. Here are the most common failure modes, why they happen, and how to guard against them before the prompt reaches production.

01

False Positives on Acceptable Patterns

What to watch: The prompt flags a legitimate architectural choice as an anti-pattern because it matches a surface-level heuristic. For example, marking any single-option decision as 'decision-by-default' when the context clearly shows only one viable path existed. Guardrail: Include a 'legitimate use' clause in each anti-pattern definition. Require the model to explain why the pattern is problematic in this specific context before flagging, not just that it matches a template.

02

Missing Anti-Patterns Due to Implicit Assumptions

What to watch: The prompt fails to detect rationalization-after-the-fact because the ADR text is well-written but the decision was clearly made before the analysis. The model takes the document at face value rather than detecting structural tells like options that exist only to be dismissed. Guardrail: Add explicit checks for structural signals: options with no real pros, strawman alternatives, and rationale sections that read as post-hoc justification. Include a 'suspicious structure' category separate from content-based detection.

03

Severity Inflation on Low-Risk Issues

What to watch: The prompt assigns 'critical' or 'high' severity to every detected anti-pattern, making the output useless for prioritization. Reviewers ignore the report because everything looks equally urgent. Guardrail: Define severity criteria explicitly in the prompt: critical requires active harm or irreversible consequence, high means likely to cause rework, medium is a documentation quality issue, low is a style preference. Require the model to justify the severity level with specific impact reasoning.

04

Context Window Truncation on Long ADRs

What to watch: The ADR plus the pattern library plus the detection instructions exceed the context window, causing the model to lose the beginning of the ADR or the end of the pattern definitions. Detection quality degrades silently on the truncated sections. Guardrail: Implement a pre-check that estimates token count before sending. If the ADR exceeds a safe threshold, split it into sections and run detection per section, then merge results. Alternatively, summarize the ADR first and run detection on the summary plus the full text for evidence extraction.

05

Pattern Library Drift Over Time

What to watch: The anti-pattern definitions in the prompt become stale as the team's architecture evolves. Patterns that were once critical become irrelevant, and new failure modes emerge that the prompt doesn't cover. The report becomes noise that engineers learn to ignore. Guardrail: Version the pattern library separately from the detection instructions. Schedule quarterly reviews of detection results against actual ADR outcomes. Track false positive and false negative rates. Add a 'pattern freshness' date to each anti-pattern definition and flag patterns older than a threshold for review.

06

Over-Reliance on Pattern Matching Without Reasoning

What to watch: The model treats the anti-pattern library as a checklist and flags every partial match without reasoning about whether the pattern actually applies. The output becomes a mechanical grep result rather than an architectural review. Guardrail: Require the model to produce a 'reasoning trace' for each flagged issue that connects specific ADR text to specific pattern criteria and explains the architectural harm. Include a 'confidence' field and suppress low-confidence flags. Add a counter-check: for each flag, ask the model to argue why it might NOT be an anti-pattern before finalizing.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the ADR Anti-Pattern Detection Prompt before shipping. Each criterion defines a pass standard, a failure signal, and a test method. Run against a small labeled dataset of known-good and known-bad ADRs to calibrate thresholds.

CriterionPass StandardFailure SignalTest Method

Pattern Recall

Detects at least 80% of known anti-patterns in a labeled test set of 20 ADRs

Misses more than 4 known anti-patterns across the test set; false-negative rate exceeds 20%

Run prompt against a golden dataset with pre-labeled anti-patterns; compare detected vs expected

False-Positive Rate

Flags no more than 2 false positives per 10 clean ADRs

Flags 3 or more non-issues in clean ADRs; reviewers dismiss output as noisy

Feed 10 ADRs known to be well-structured; count incorrect flags; reject if >2

Severity Accuracy

Assigns Critical severity to at least 90% of decision-by-default and missing-trade-offs patterns

Rates a decision-by-default as Low or Info; severity inflation on minor issues

Spot-check severity labels on 5 known-severe and 5 known-minor patterns; verify alignment

Evidence Citation

Every flagged pattern includes a direct quote or section reference from the source ADR

Pattern flagged with no source reference or a hallucinated quote not present in the input

Parse output for [EVIDENCE] field; grep source ADR for quoted text; fail if any quote absent

Pattern Library Coverage

Output uses only patterns defined in the pattern library; no invented pattern names

Output contains a pattern name not in the provided library (e.g., 'vibe-driven-architecture')

Extract all pattern names from output; diff against pattern library enum; fail on unknown values

Output Schema Compliance

Output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present

Missing required fields; malformed JSON; extra untyped fields that break downstream parsing

Validate output with JSON Schema validator using the provided schema; reject on parse or schema errors

Rationalization Detection

Correctly identifies at least 85% of post-hoc rationalizations where rationale was written after decision

Misses rationalization signals like 'we had already started building' or 'the team was familiar with'

Test on 10 ADRs with known rationalization markers; measure recall against human-labeled ground truth

Unstated Assumption Surfacing

Surfaces at least 1 verifiable unstated assumption per ADR that contains hidden assumptions

Returns empty assumption list for an ADR known to contain 3+ unstated assumptions

Feed 5 ADRs with documented hidden assumptions; verify output lists at least 1 per ADR; fail if empty on known cases

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a small set of known anti-patterns. Remove severity ratings and pattern library references. Focus on binary detection: present or absent. Use a simple markdown checklist output instead of structured JSON.

code
Review this ADR for common anti-patterns:
[ADR_TEXT]

Flag any of these patterns you detect:
- Decision-by-default (no alternatives considered)
- Missing trade-offs
- Unstated assumptions
- Rationalization-after-the-fact

Return a checklist with ✓ or ✗ for each pattern.

Watch for

  • Over-flagging: the model may mark every pattern as present
  • False positives on well-structured ADRs that use implicit rationale
  • No severity differentiation, making it hard to prioritize fixes
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.