tenets-review-architecture

tenets-review-architecture is a command for Claude Code from bardiakhosravi/tenets. It costs 0 tokens per session (2,756 once invoked), scanned A, original, MIT.

A strict code-review command for projects using Hexagonal Architecture, a design that keeps business rules separate from external systems, and Domain-Driven Design, a way to model software around business concepts. It checks the code against the repository's active architecture rules.

In plain words
What is it for?
Use it to review domain, application, infrastructure, adapter, dependency-injection, repository, and test code for architecture violations.
Why use it?
It helps catch unwanted dependencies, broken boundaries, and misplaced business logic before they spread through the codebase. It also keeps reviews tied to the project's own rules instead of general opinions.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it to review domain, application, infrastructure, adapter, dependency-injection, repository, and test code for architecture violations.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/bardiakhosravi/tenets/tenets-review-architecture
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/bardiakhosravi/tenets

Made for: Claude Code.

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 tenets-review-architecture

README.md
[![agentmods](https://agentmods.dev/badge/commands/bardiakhosravi/tenets/tenets-review-architecture/github.svg)](https://agentmods.dev/commands/bardiakhosravi/tenets/tenets-review-architecture)
Your own site
<a href="https://agentmods.dev/commands/bardiakhosravi/tenets/tenets-review-architecture"><img src="https://agentmods.dev/badge/commands/bardiakhosravi/tenets/tenets-review-architecture/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tenets-review-architecture

Your own site · 80×15
<a href="https://agentmods.dev/commands/bardiakhosravi/tenets/tenets-review-architecture"><img src="https://agentmods.dev/badge/commands/bardiakhosravi/tenets/tenets-review-architecture.svg" alt="Reviewed on agentmods" width="80" 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 2,756 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.02756
Opus 5 $0.00000 $0.01378
Sonnet 5 $0.00000 $0.00551
Haiku 4.5 $0.00000 $0.00276

Measured 11d ago against content hash 04a89b97713d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

tenets-review-architecture 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 11d 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.

cli/templates/commands/tenets-review-architecture.md · 157 lines

How it starts

The opening of the file, as written. The whole thing — 157 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a strict architecture reviewer for a codebase following Hexagonal Architecture (Ports & Adapters) with Domain-Driven Design.

Step 1: Load the rules

{{RULES_INSTRUCTION}}

Do not rely on general architecture knowledge when a repository rule is more specific. Canonical rules have stable IDs such as TENETS-PORT-005. When the local CLI is available, npx tenets explain <rule-id> provides the canonical rule, remediation, and review check.

This repository uses the {{ACTIVE_PROFILE}} profile. The following rule IDs are the complete compliance allowlist for this review:

{{ACTIVE_RULE_IDS}}

Do not report an ID outside this allowlist as a Tenets violation. A concern governed only by an inactive rule may appear under optional recommendations, clearly labeled as outside the active profile.

Step 2: Analyze the codebase

{{SCOPE_INSTRUCTION}}

Trace relevant workflows end to end through use cases, ports, adapters, dependency injection, repositories, and tests.

Step 3: Check for violations

For each file, verify:

Domain layer (**/domain/**)

  • No imports from application, infrastructure, or adapter layers
  • No imports from another bounded context's internals (TENETS-CONTEXT-002)
  • Entities use stable identity equality (TENETS-ENTITY-001) and own invariant-protecting behavior (TENETS-ENTITY-002)
  • Value objects are immutable with value equality (TENETS-VALUE-001), represent semantic concepts (TENETS-VALUE-002), and enforce intrinsic invariants during creation and hydration (TENETS-VALUE-003)
  • Cross-context relationships and port contracts use local reference ID value objects, not primitives or reused owner-context types; primitives appear only in serialized events, persistence, or external transport
  • Aggregates have one root and protect internal invariants (TENETS-AGGREGATE-001, TENETS-AGGREGATE-003)
  • Aggregate boundaries follow transactional invariants rather than navigation convenience (TENETS-AGGREGATE-002)
  • Aggregate repositories persist complete roots (TENETS-AGGREGATE-004), and foreign aggregates are referenced by identity (TENETS-AGGREGATE-005)
  • Cross-aggregate workflows remain outside aggregates (TENETS-AGGREGATE-006)
  • Concurrent writes use an explicit conflict strategy (TENETS-AGGREGATE-007)
  • One modified aggregate per transaction is the default; qualifying exceptions require an ADR (TENETS-AGGREGATE-008)
  • Domain services contain only ownerless domain behavior and remain pure and stateless (TENETS-SERVICE-001, TENETS-SERVICE-002)
  • Each bounded context owns its model and language (TENETS-CONTEXT-001)
  • Domain names follow ubiquitous language and exclude technology terminology (TENETS-NAME-001, TENETS-NAME-002)
  • Repository interfaces represent aggregate persistence in domain language (TENETS-REPO-001)
  • Repository writes accept aggregate roots (TENETS-REPO-002); queries use domain IDs, value objects, or named criteria (TENETS-REPO-003)
  • Repository methods use result-semantic names; find_* is not used (TENETS-REPO-004)
  • Domain events are immutable internal records (TENETS-EVENT-001), are recorded by successful domain behavior (TENETS-EVENT-002), and are never published directly as external contracts (TENETS-EVENT-003)
  • New Python entities, aggregates, and value objects use module-level create_<domain_object>() functions (TENETS-LIFECYCLE-002)
  • Constructors used by repositories hydrate explicit persisted state without generating identities, defaults, or creation events (TENETS-LIFECYCLE-005)
  • Domain objects enforce invariants on every applicable lifecycle path (TENETS-VALIDATE-001)
  • Domain failures use business language and remain technology-agnostic (TENETS-ERROR-002)

Read the full file on GitHub · 157 lines

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. 11d ago First seen · 157 lines · 0 tokens per session scan A 04a89b97713d

Subscribe to this mod's changes

tenets-review-architecture is a command published in the GitHub repository bardiakhosravi/tenets (45 stars, last pushed 27d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,756 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.