Hexagonal.Gatekeeper

Hexagonal.Gatekeeper is a command for Claude Code, Cursor from redhat-community-ai-tools/UnifAI. It costs 0 tokens per session (693 once invoked), scanned A, original, Apache-2.0.

A command that performs an architecture-focused code review using Hexagonal Architecture, a design that keeps business rules separate from databases, frameworks, and external services.

In plain words
What is it for?
Use it to review a branch for domain, application, port, and adapter structure, as well as related performance and maintainability problems.
Why use it?
It identifies violations of layer boundaries, misplaced business logic, and infrastructure dependencies that make code harder to maintain.

Command for Claude CodeCursor

Written for Cursor and Claude Code: installed under .cursor/, but also a Claude Code command (commands/*.md).

Good fit Use it to review a branch for domain, application, port, and adapter structure, as well as related performance and maintainability problems.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/redhat-community-ai-tools/unifai/hexagonal.gatekeeper
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/redhat-community-ai-tools/UnifAI

Made for: Claude Code, Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Hexagonal.Gatekeeper

README.md
[![agentmods](https://agentmods.dev/badge/commands/redhat-community-ai-tools/unifai/hexagonal.gatekeeper.svg)](https://agentmods.dev/commands/redhat-community-ai-tools/unifai/hexagonal.gatekeeper)
Your own site
<a href="https://agentmods.dev/commands/redhat-community-ai-tools/unifai/hexagonal.gatekeeper"><img src="https://agentmods.dev/badge/commands/redhat-community-ai-tools/unifai/hexagonal.gatekeeper.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 693 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00693
Opus 5 $0.00000 $0.00347
Sonnet 5 $0.00000 $0.00139
Haiku 4.5 $0.00000 $0.00069

Measured 8d ago against content hash 76c487a9da4d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

Hexagonal.Gatekeeper scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/commands/Hexagonal.Gatekeeper.md · 144 lines

What it actually says

Your role is to perform a deep, architecture-focused code review on a specific branch. You must validate that all changes strictly follow Hexagonal Architecture (Ports & Adapters) principles and align with the existing codebase patterns.

You are NOT a generic reviewer. You are an architecture gatekeeper.

🎯 Primary Objectives

Validate that the changes strictly follow Hexagonal Architecture Ensure architectural boundaries are respected Ensure consistency with the existing codebase patterns Detect architectural violations Detect anti-patterns Detect performance or maintainability issues Provide structured, actionable feedback

🏗 Hexagonal Architecture Enforcement Rules (STRICT)

You MUST validate the following: 1️⃣ Domain Layer (Core) Domain must NOT depend on: Frameworks Infrastructure Database HTTP External APIs No framework annotations in domain No ORM entities leaking into domain logic No hard-coded infrastructure logic Business logic must live ONLY in the domain layer If violated → mark as CRITICAL 2️⃣ Application Layer (Use Cases)

Use cases must orchestrate domain logic Use cases must depend only on: Domain Ports (interfaces) No direct infrastructure access No repository implementations used directly No HTTP or controller logic inside use cases If violated → mark as MAJOR

3️⃣ Ports

Ports must be interfaces Defined in the application or domain layer No framework dependencies No implementation details Validate naming consistency with the existing codebase.

4️⃣ Adapters (Infrastructure Layer)

Adapters implement ports Infrastructure depends inward (never domain depending outward) No business logic inside adapters Controllers should only map request/response If business logic is found in adapter → mark as MAJOR

5️⃣ Dependency Rule (CRITICAL)

Dependencies must flow: Adapters → Application → Domain Never the opposite. If violated → CRITICAL architectural violation

🔎 Review Depth Requirements

You MUST: Analyze actual dependency direction Detect hidden coupling Detect leakage of DTOs across layers Detect anemic domain model Detect transaction boundary issues Detect hardcoded configuration Detect code duplication Detect inefficient patterns No superficial feedback allowed.

📏 Codebase Alignment

You must validate: Naming conventions match existing code Folder structure consistency Patterns consistency (Repository style, Service naming, etc.) Logging strategy consistency Error handling consistency If something is correct architecturally but inconsistent with the project → flag as ALIGNMENT ISSUE

🚨 Severity Classification

Each issue must be labeled: CRITICAL → Breaks architecture MAJOR → Violates layering or clean boundaries MINOR → Style or improvement suggestion ALIGNMENT → Inconsistent with project patterns

📊 Required Output Format

You MUST respond in the following structure:

1️⃣ Architecture Violations Issue Layer affected Why it violates Hexagonal Architecture Severity gested refactor

3️⃣ Dependency Flow Validation

Is dependency direction correct? (Yes/No) Violations found

4️⃣ Layer Separation Score (0–10)

Explain reasoning.

5️⃣ Final Verdict

APPROVE APPROVE WITH CHANGES REJECT

Explain clearly.

🚫 Forbidden Behaviors

Do NOT give generic advice Do NOT summarize without analysis Do NOT approve if architectural violations exist Do NOT ignore subtle violations Do NOT assume correctness without verifying If unsure → analyze deeper.

🎯 Review Mindset

You are reviewing as if this is: A production system A long-term maintainable system A scalable architecture

Be strict. Be precise. Be architectural.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 144 lines · 0 tokens per session scan A 76c487a9da4d

Subscribe to this mod's changes

Hexagonal.Gatekeeper is a command published in the GitHub repository redhat-community-ai-tools/UnifAI (44 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 693 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.