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.
npx agentmods add commands/redhat-community-ai-tools/unifai/hexagonal.refactorgit clone --depth 1 https://github.com/redhat-community-ai-tools/UnifAIWrote 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.
[](https://agentmods.dev/commands/redhat-community-ai-tools/unifai/hexagonal.refactor)<a href="https://agentmods.dev/commands/redhat-community-ai-tools/unifai/hexagonal.refactor"><img src="https://agentmods.dev/badge/commands/redhat-community-ai-tools/unifai/hexagonal.refactor.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00808 |
| Opus 5 | $0.00000 | $0.00404 |
| Sonnet 5 | $0.00000 | $0.00162 |
| Haiku 4.5 | $0.00000 | $0.00081 |
Grade A, and why
Hexagonal.Refactor 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 159 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Your task is to fix the reported issues in the current branch.
You must strictly: Follow Hexagonal Architecture (Ports & Adapters) Follow the existing codebase patterns Avoid architectural drift Avoid duplication Avoid mockups or placeholder implementations Reuse existing components when possible You are not allowed to introduce new patterns unless absolutely required and aligned with the codebase
🎯 Primary Objectives Fix all reported issues correctly Preserve architectural boundaries Keep strict dependency direction Maintain consistency with the existing project structure Improve efficiency where possible Avoid code duplication Reuse existing services, utilities, mappers, helpers, or abstractions
🏗 Architectural Enforcement (STRICT) You MUST ensure:
1️⃣ Dependency Direction Adapters → Application → Domain Domain must not depend on infrastructure No framework logic in domain No direct DB or HTTP usage in domain Use ports for external communication If a fix requires cross-layer access → refactor using proper ports
2️⃣ No Business Logic Leakage No business logic in controllers No business logic in repositories No business logic in adapters Business rules belong in Domain
3️⃣ Reusability Enforcement Before adding new code: Check if similar logic already exists Reuse existing utilities Reuse existing error handling strategy Reuse existing logging pattern Reuse existing mapper strategy Reuse existing base classes if available If reusable logic exists → use it Do NOT duplicate code
4️⃣ No Mock Implementations No TODO placeholders No temporary stubs No mock returns No fake implementations No simplified shortcuts All fixes must be production-ready
5️⃣ Codebase Alignment You MUST match: Naming conventions Folder structure File organization Logging style Exception handling pattern Dependency injection style Repository pattern used in the project DTO mapping approach used in the project If unsure → follow the dominant pattern
🧹 Mandatory Refactor & Cleanup Enforcement (STRICT) When modifying or refactoring logic, you MUST:
1️⃣ Replace — Not Layer If logic changes → fully replace the old implementation Do NOT stack new logic on top of old logic Do NOT keep fallback paths unless explicitly required
2️⃣ Remove Obsolete Code Delete previous implementations that are no longer used Remove dead code branches Remove unused methods Remove unused classes Remove unused interfaces Remove unused imports Remove obsolete DTOs / mappers if no longer needed
3️⃣ No Commented Leftovers Do NOT comment out old logic Do NOT keep legacy code blocks Do NOT leave TODO markers for removed logic
4️⃣ Consistency Verification After changes, verify: No duplicate logic exists No parallel implementations exist No unused dependencies remain The feature has a single clear execution path Keeping obsolete or duplicated logic is considered a failure.
✨ Efficiency & Clean Code While fixing: Remove duplication Remove dead code Avoid unnecessary abstractions Avoid over-engineering Keep methods focused Maintain SRP Improve readability Do NOT introduce architectural changes unless required to fix violations
📌 Required Output Format You MUST respond with:
1️⃣ Summary of Fix Strategy Explain how you approached the fix.
2️⃣ Detailed Changes For each issue: What was wrong Why it violated architecture or codebase rules What was changed Why the new implementation is correct
3️⃣ Reuse Validation List reusable components leveraged.
4️⃣ Duplication Check Confirm whether duplication was removed or avoided.
5️⃣ Architecture Validation Confirm: Dependency direction respected Layer separation maintained No business logic leakage
6️⃣ Final Integrity Check Confirm: No mockups No temporary fixes Production-ready code
🚫 Forbidden Actions Do NOT introduce new architectural styles Do NOT move business logic outside the Domain Do NOT duplicate code Do NOT bypass ports Do NOT simplify logic just to pass review Do NOT change unrelated parts of the system
🎯 Mindset You are fixing code for a: Production system Long-term maintainable architecture Scalable application
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.
- 5d ago First seen · 159 lines · 0 tokens per session scan A de545f54756d
Hexagonal.Refactor is a command published in the GitHub repository redhat-community-ai-tools/UnifAI (44 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 808 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.
Other commands, from other repositories
memory-store
Store an insight, decision, or pattern to memory.
journey-audit
Outside-in product audit as a deep session — 7 read-only roles check what the site promises against what the code does, what a user experiences, what arrives by mail, and what the data says is used. Writes a dossier; needs a per-repo journey-manifest.
dispatcher
Pick the next-best repo to work on across the portfolio — rank free repos, recommend one, claim its lease atomically, and route to the entry command.
cost-tracker
Track session costs, understand token spend, and get optimization tips.
workpm
PM 모드로 오케스트레이터 시작. 팀을 구성하고 5단계 워크플로우로 작업을 완수합니다.
mach12:gh-pr-read
Read a GitHub pull request's title, body, and all top-level PR conversation comments; optionally locate an HTML-marker comment.