Coding

Architecture Review & Fix Strategy

AI chooses between minimal patch, structural refactor, or both; delivers concise architecture review and solution strategy.

#software architecture#code review#refactoring#debugging#code complexity#design patterns#development best practices

Prompt

Perform a high-level architecture check on the code we are working on. Focus on structure, not line-by-line debugging.

Produce these sections:

1) **Scope Recap** β€” One sentence that states the suspected issue and execution path.

2) **Components** β€” Bullet list of modules/functions/files that touch the issue; give each a one-line role.

3) **Interaction Map** β€” An ASCII sketch of calls/data flow and boundaries (network, DB, filesystem, threads/async), e.g. A -> B -> C.

4) **Assessment** β€” 3–6 bullets evaluating:
   - Coupling/cohesion and ownership of responsibilities
   - Error handling & propagation (fail-fast vs silent failure)
   - State management & side effects (shared/mutable/hidden)
   - Sync vs async boundaries; timing/concurrency hazards
   - Data contracts (types, nullability, validation) and config

5) **Possible Fixes** β€” Propose the most appropriate solution(s):
   - If a small, elegant patch reduces complexity, suggest that.
   - If a structural refactor is warranted, outline that.
   - If both are relevant, present both options.

6) **Risks & Trade-offs** β€” Short list of consequences of the proposed fixes.

**Rules:**
- Stay strictly within components that touch the target issue.
- Prefer minimal structural changes over broad refactors.
- Decide whether a patch, a structural refactor, or both are necessary.
- Ask at most three clarifying questions only if progress is blocked.
- Keep output concise and decision-oriented.
Sam Holstein
Written by
Sam Holstein
@msamholstein_6ead51

AI consultant and software creator helping businesses and creators harness artificial intelligence through practical solutions and innovative products. Creator of BestPromptIdeas.com.

Reviews

0 reviews

No reviews yet. Be the first to leave feedback.

Sign in to leave a rating or review.