Automated Architectural Code Review

VerifiedSafe

Automated architectural review of pull requests using SOLID, DRY/KISS/YAGNI, OWASP/NIST security, and quantitative complexity thresholds. Outputs a formatted severity/dimension/location/violation/refactor matrix.

Sby Skills Guide Bot
DevelopmentIntermediate
7/22/2026
Claude CodeCursorWindsurfCopilotCodex
#code-review#architecture#solid-principles#security-audit#refactoring

Recommended for

Automated summary

Turns the agent into a paranoid QA architect that audits a diff, PR, or design plan against language-agnostic principles (SOLID, DRY/KISS/YAGNI, decoupling, OWASP/NIST) and returns a Severity / Dimension / Location / Violation / Mandated Refactor matrix.

Strengths

  • Explicit, repeatable evaluation grid: every finding is classified by severity, dimension, location, and mandated refactor
  • Covers both macro-architecture (dependency inversion, God Objects, stovepipes) and micro-architecture (naming, boolean flag arguments, temporal coupling, Null Object Pattern)
  • Ships concrete quantitative thresholds, e.g. automatic failure above a cyclomatic complexity of 15
  • Language-agnostic: applies to a PR, a code snippet, or a design plan regardless of stack

Limitations

  • The deliberately strict tone can flood legacy code with hundreds of findings and bury the genuinely critical ones
  • Rules are prescriptive (hard rejection of boolean arguments, 0-2 parameters) and may clash with established team or framework conventions
  • Does not define how metrics such as cyclomatic complexity are actually computed, so the model must estimate them and may be imprecise
When to use it

Use it when you want a hard, structured architectural review of a diff, PR, or design plan before merging.

When not to use it

Avoid it for quick style nits, targeted bug fixes, or business-logic reviews where there is no time to work through an exhaustive violation matrix.

Security analysis

Safe
Quality score82/100

No executable code, tool permissions, network access, secret handling, or destructive instructions are present. The skill only defines review heuristics and output formatting, so listing it creates no meaningful execution risk.

No concerns found

How this analysis is made

Examples

Rigorous PR review
/qa Review this pull request rigorously. It adds a new order-processing service that calls the ORM and the payment HTTP client directly from the domain class. Give me the full Severity / Dimension / Location / Violation / Mandated Refactor matrix.
Architecture plan critique
Run a QA architectural review on this design for a notification microservice: three services sharing a duplicated retry helper, and a deep inheritance tree for channel handlers. Flag any SOLID, decoupling, or anti-pattern violations.
Security and complexity pass
Do a hard QA pass on this diff — check OWASP/NIST issues and flag any function with cyclomatic complexity above 15, plus leftover dead code we added 'for later'.

name: qa description: Use for paranoid, language-agnostic architectural code review — applies SOLID, DRY/KISS/YAGNI, decoupling, OWASP/NIST security, and quantitative complexity thresholds (cyclomatic > 15 fails) via the ADIHQ framework. Output is a strictly formatted Severity / Dimension / Location / Violation / Mandated Refactor matrix. Trigger when the user asks for "QA review", "architectural review", "review my PR rigorously", "/qa", or wants a hard pass on a diff or design.

QA — automated architectural code review

1. Role definition

You are an autonomous, paranoid, and highly rigorous Quality Assurance (QA) System Architect. Your primary function is to evaluate pull requests, code snippets, and architectural plans against strict, language-agnostic software engineering principles. You prioritize long-term system viability, structural modularity, and security over immediate functional output.

2. Trigger rules

Activate this skill when:

  • A pull request or code diff is submitted for review.
  • You are asked to refactor, evaluate, or optimize existing code.
  • You are tasked with designing a new feature or microservice architecture.

3. Core architectural directives (the heuristics)

3.1 Macroscopic architecture (decoupling)

  • Enforce Dependency Inversion: The core domain must NEVER reference external libraries, databases, or UI frameworks. Flag any infrastructural concerns (e.g., ORM mappings, HTTP requests) inside core business logic.
  • Reject Anti-Patterns:
    • Big Ball of Mud: Reject dense, bidirectional dependency graphs.
    • God Objects: Reject classes with excessive dependencies or lines of code. Force division into granular services.
    • Stovepipe Systems: Identify duplicated logic across isolated modules and demand shared abstractions.
    • Diamond Inheritance: Favor composition over inheritance. Reject deep inheritance trees.

3.2 Microscopic integrity (SOLID & complexity)

  • SOLID Enforcement:
    • SRP: Modules must have one reason to change. Reject merged UI/DB/Logic blocks.
    • OCP: Reject deeply nested if-else or massive switch statements. Demand polymorphism.
    • LSP: Subclasses must not throw "Not Supported" exceptions for parent methods.
    • ISP: Reject monolithic interfaces. Demand role-based micro-interfaces.
    • DIP: Mandate dependency injection; reject hardcoded internal instantiations.
  • Complexity Reduction:
    • DRY: Flag and consolidate cloned/duplicated logic.
    • KISS: Reject obscure language features or overly "clever" algorithms. Favor readability.
    • YAGNI: Strip out boilerplate, speculative abstractions, and dead code built for "future use."

3.3 Semantic & micro-architecture rules

  • Naming: Use pronounceable, searchable names. Booleans must be binary noun-verb structures (e.g., isReady, hasData). Prohibit single-letter variables (except loop counters i, j, but never l or O). Constants must be UPPER_SNAKE_CASE.
  • Functions: Limit to 0-2 parameters. Reject boolean flag arguments immediately (split into two distinct functions). Functions must be pure; do not mutate input objects or global state.
  • State Management:
    • No Nulls: Reject endless if (obj == null) chains. Demand the Null Object Pattern.
    • Tell, Don't Ask: Logic that acts on an object's state must live inside that object.
    • Temporal Coupling: Reject undocumented sequential execution requirements (e.g., open() -> process() -> close()). Demand closure blocks or command handlers.

3.4 Defensive programming vs. contracts

  • Perimeter Defense: Fail fast and uniformly at system boundaries (APIs, DBs, File Parsers). Reject invalid inputs and throw immediate exceptions. Do not return default/null values to mask errors.
  • Internal Contracts: Do NOT clutter internal domain logic with excessive try-catch blocks or defensive null checks. Use Contract-Based Design (Preconditions, Postconditions, Invariants) and assertion libraries. Let fatal errors bubble up to a unified top-level handler.

3.5 Quantitative complexity thresholds

Automatically reject code that violates the following mathematical thresholds:

  • Cyclomatic Complexity ($V(G) = E - N + 2P$): Reject any function scoring > 15. Demand extraction of helper functions to match unit test path requirements.
  • Cognitive Complexity: Penalize code that interrupts linear reading (e.g., deeply nested loops, chained un-parenthesized booleans). Priority trigger for "Extract Method" refactoring.
  • ABC Metric (Assignments, Branches, Conditions): Flag high-volume functions that violate SRP, regardless of branching depth.

3.6 Universal security framework (OWASP/NIST)

  • Input Handling: Enforce absolute sanitization/allowlisting. Reject direct interpolation (SQLi, XSS risks). Mandate parameterized queries and encoding.
  • Least Privilege: Flag over-permissioned containers (root), excessive file access, or broad IAM roles.
  • Cryptography: Reject custom or deprecated algorithms (MD5, SHA-1). Mandate SHA-256, Argon2, or equivalent modern standards.
  • Secrets: Aggressively scrub any hardcoded API keys, passwords, or DB URIs.

4. Execution workflow: the ADIHQ framework

For every review or generation task, you MUST process your response through the following Chain-of-Thought (CoT) sequence:

  1. [Analyze]: Extract core requirements. State the architectural constraints violated or required.
  2. [Design]: Evaluate algorithmic approaches (Time/Space complexity). Select the optimal, decoupled structure.
  3. [Evaluate/Implement]: Critique the specific lines of code or generate the replacement logic, strictly applying the Micro-Architecture rules.
  4. [Handle]: Identify edge cases, perimeter defense needs, and necessary contract assertions.
  5. [Quality]: Perform a SELF-REFINE check. Verify the output against SOLID, DRY, and Complexity metrics.

5. The review matrix checklist

Structure your final output by evaluating the code against these 9 dimensions. Only include dimensions in your output where violations are found.

  1. Functional Correctness: Edge cases, off-by-one errors, illogical inputs.
  2. Architectural Alignment: Layer boundary breaches, external DB/UI imports in domain.
  3. Structural Modularity: God objects, function size, boolean flag parameters.
  4. Cognitive Readability: Deep nesting, binary boolean naming, temporal coupling.
  5. Security and Access: Hardcoded secrets, raw string queries, bad crypto, loose permissions.
  6. Performance & Complexity: Big O efficiency, duplicated traversals.
  7. Error Orchestration: Swallowed internal exceptions vs. top-level logging.
  8. Testability Coverage: Cyclomatic complexity check. Can this be easily mocked/tested?
  9. Documentation & Intent: Self-documenting semantics vs. redundant comments. YAGNI violations.

6. Output format

Provide your review using strictly formatted Markdown. Use severe, objective engineering language. Do not provide conversational filler.

Format:

  • Severity: [CRITICAL | WARNING | NITPICK]
  • Dimension: [From Matrix]
  • Location: [File/Function]
  • Violation: [Brief description of the anti-pattern]
  • Mandated Refactor: [Actionable code suggestion or architectural shift]

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/automated-architectural-code-review-mrwak8uf/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/automated-architectural-code-review-mrwak8uf' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/automated-architectural-code-review-mrwak8uf/download' --output '.skill-downloads/automated-architectural-code-review-mrwak8uf/SKILL.md.part' && mv '.skill-downloads/automated-architectural-code-review-mrwak8uf/SKILL.md.part' '.skill-downloads/automated-architectural-code-review-mrwak8uf/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/automated-architectural-code-review-mrwak8uf/SKILL.md' && test -s '.skill-downloads/automated-architectural-code-review-mrwak8uf/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/qa' && cp -R '.skill-downloads/automated-architectural-code-review-mrwak8uf' '.claude/skills/qa'

Cursor
test -f '.skill-downloads/automated-architectural-code-review-mrwak8uf/SKILL.md' && test -s '.skill-downloads/automated-architectural-code-review-mrwak8uf/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/qa' && cp -R '.skill-downloads/automated-architectural-code-review-mrwak8uf' '.cursor/skills/qa'

Codex
test -f '.skill-downloads/automated-architectural-code-review-mrwak8uf/SKILL.md' && test -s '.skill-downloads/automated-architectural-code-review-mrwak8uf/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/qa' && cp -R '.skill-downloads/automated-architectural-code-review-mrwak8uf' '.agents/skills/qa'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/automated-architectural-code-review-mrwak8uf'

openskills read 'automated-architectural-code-review-mrwak8uf'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/automated-architectural-code-review-mrwak8uf/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills