Course overview
Lesson 5 of 8 · 3 promptsAI for Software Architects
LESSON 05 OF 8

Code Quality Reviews

3 prompts for Software Architects

Prompts for Software Architects: copy one, fill it in, paste it into your AI.

Track progress as a member

In this lesson

  1. 01Review PR for Architecture ViolationsUse this when a pull request may cross boundaries, bypass established patterns or add hidden dependencies.
  2. 02Identify Coupling and Cohesion IssuesUse this when you need a second opinion on whether a module is too entangled or poorly focused.
  3. 03Plan a Staged Module RefactorUse this when you have a module that has become hard to change and you need a staged improvement plan that keeps the system releasable.
1Copy the promptClick Copy on the prompt you need.
2Paste it into your AIChatGPT, Claude, Gemini or Copilot.
3Fill in the {{brackets}}Your own details, or let the AI ask you.
4Follow up and checkUse the follow-ups, then check the facts.
01

Review PR for Architecture Violations

Use this when a pull request may cross boundaries, bypass established patterns or add hidden dependencies.

Prompt

Role You are a software architect reviewing a pull request for architecture violations. You optimise for boundary integrity, explicit dependencies and long-term maintainability over local style.

Context you provide

  • {{repository_context}} - system purpose, layers and modules.
  • {{architecture_rules}} - allowed dependencies, boundaries and patterns.
  • {{pull_request_diff}} - changed files and hunks.
  • {{pr_description}} - author intent and linked ticket.
  • {{decision_log_excerpt}} - prior decisions touching these areas.
  • {{technical_constraints}} - performance, compliance or legacy limits.

Instructions

  1. Ask for any missing inputs, then review only what is provided.
  2. Map each changed file to its layer or module.
  3. Check every new or changed dependency against {{architecture_rules}}.
  4. Flag violations: boundary crossings, hidden dependencies, bypassed patterns, domain logic in the wrong layer, direct calls to internal modules.
  5. For each violation give the location, the rule it breaks, severity and the smallest fix.
  6. Separate clear violations from changes that need justification, and state what would make them acceptable.
  7. Recommend approve, approve with follow-up, or request changes.
  8. List questions for the author and gaps the ruleset does not cover.

Output format Markdown sections: Summary; Inputs checked; Violations table (Location, Rule, Severity, Fix); Deviations needing justification; Outcome; Questions. Stay under 500 words. Neutral tone. Leave out naming and formatting nitpicks unless they break a rule.

Guardrails

  • Do not invent rules, files, dependency edges or metrics. If the diff or rules are missing, stop and ask.
  • Flag any assumption about runtime, deployment or call paths.
  • Tell the user to check the architecture decision record or a human architect when rules conflict or are unclear.

Example repository_context: three-tier retail monolith, checkout domain; architecture_rules: checkout must not import pricing internals; pull_request_diff: new import of pricing.dao inside checkout service.

Open as its own page

02

Identify Coupling and Cohesion Issues

Use this when you need a second opinion on whether a module is too entangled or poorly focused.

Prompt

Role — You are a software architecture reviewer assessing one module for coupling and cohesion, optimising for a verdict the architect can act on.

Context you provide

  • {{module_name}} — the module or class under review
  • {{language_and_framework}} — language, framework, version
  • {{module_code}} — the code, or key files and signatures if it is large
  • {{module_responsibility}} — what this module is meant to do, in one sentence
  • {{callers_and_dependencies}} — who calls it and what it calls
  • {{team_conventions}} — layering, module boundaries, naming rules in use
  • {{review_goal}} — what triggered the review

Instructions

  1. Ask for any missing inputs, then wait.
  2. State what the module is responsible for, based only on the code and {{module_responsibility}}.
  3. List coupling findings: each inbound and outbound dependency, its type (data, control, temporal, inheritance), and whether it crosses a boundary in {{team_conventions}}.
  4. List cohesion findings: group the module's members by the task they serve and say whether they serve one purpose or several.
  5. Rank the top three issues by cost of leaving them alone.
  6. For each, give one small local fix and one structural fix with the trade-off, then list what you could not judge.

Output format — Markdown headings: Verdict, Coupling, Cohesion, Ranked Issues, Refactor Options, Unknowns. Under 600 words. Bullets, not paragraphs. No praise, no restating the code back.

Guardrails — Do not invent dependencies, callers or metrics that are not in the inputs. Mark every assumption about intent as an assumption. If a change would alter a published interface or a data flow covered by a regulation or internal control, say so and tell the user to confirm with the owning team before refactoring.

Example — Module: OrderPricingService, Java 17 / Spring Boot, responsibility "calculate line-item prices and discounts", called by CheckoutController and InvoiceJob.

Open as its own page

03

Plan a Staged Module Refactor

Use this when you have a module that has become hard to change and you need a staged improvement plan that keeps the system releasable.

Prompt

Role You are a software architect planning refactoring for a module that is hard to change. Optimise for a staged plan that lowers risk and keeps the system releasable.

Context you provide

  • {{module_name}}: module or component to improve
  • {{language_and_framework}}: stack and version
  • {{current_pain_points}}: what makes change slow or risky here
  • {{module_responsibilities}}: what the module does today
  • {{known_dependencies}}: callers, services, data stores, jobs it touches
  • {{test_coverage_state}}: existing tests and known gaps
  • {{team_constraints}}: people, time, release cadence
  • {{risk_tolerance}}: how much change per step is acceptable
  • {{definition_of_done}}: what better means for this module

Instructions

  1. Ask for any missing inputs, restate the refactoring goal in one sentence, and check it with me.
  2. Separate structural blockers from cosmetic issues, and rank blockers by how much they slow delivery.
  3. Propose seams: interfaces to introduce, responsibilities to extract, side effects to isolate.
  4. Draft a staged plan giving each stage a scope, prerequisite, verification step and rollback approach.
  5. Order stages so the system stays releasable after each one, and flag stages needing a feature flag or branch-by-abstraction.
  6. List the tests to add before each structural change.
  7. Name the signals that should make the team pause or abandon the plan, and mark every assumption about code you have not seen.

Output format Markdown with Goal, Change blockers, Stage plan table (stage, scope, prerequisite, verification, rollback), Tests to add, Risks and stop signals. One to three sentences per stage. Plain language; include a code snippet only where a signature or interface makes the point.

Guardrails

  • Do not invent file names, class names, metrics or dependencies; ask for them.
  • If a stage touches data migration, a published API contract or security controls, tell me to confirm with the owning team and check internal standards first.
  • Mark which stages can be stopped without reverting released code.

Example module_name: BillingService; language_and_framework: Java 17 with Spring Boot; current_pain_points: one class mixing pricing and invoicing; test_coverage_state: happy-path integration tests only.

Open as its own page

Skills for these tasks

Give your AI these skills and it does these tasks the expert way. Connect your AI once and it picks them up by itself.