harness-architecture-enforcer

harness-architecture-enforcer is an agent for Claude Code from Intense-Visions/harness-engineering. It costs 30 tokens per session (8,377 once invoked), scanned A, original, MIT.

An automated check for whether a codebase follows its defined architecture, including allowed relationships between layers and modules.

In plain words
What is it for?
It helps validate dependency rules after code changes, new modules, refactoring, or before approving a pull request.
Why use it?
It catches forbidden imports, broken layer boundaries, and circular dependencies before they make the code harder to change or merge.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is Import: import { UserForm } from '../components/UserForm'.

Part of the harness-claude plugin — 85 skills, 89 commands, 16 agents, 4 hooks, 4 MCP servers shipped together

Good fit It helps validate dependency rules after code changes, new modules, refactoring, or before approving a pull request.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Intense-Visions/harness-engineering
agentmods
npx agentmods add agents/intense-visions/harness-engineering/harness-architecture-enforcer

Made for: Claude Code.

Or install harness-claude, the plugin that ships this one along with the rest of its 85 skills, 89 commands, 16 agents, 4 hooks, 4 MCP servers.

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 harness-architecture-enforcer

README.md
[![agentmods](https://agentmods.dev/badge/agents/intense-visions/harness-engineering/harness-architecture-enforcer/github.svg)](https://agentmods.dev/agents/intense-visions/harness-engineering/harness-architecture-enforcer)
Your own site
<a href="https://agentmods.dev/agents/intense-visions/harness-engineering/harness-architecture-enforcer"><img src="https://agentmods.dev/badge/agents/intense-visions/harness-engineering/harness-architecture-enforcer/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 harness-architecture-enforcer

Your own site · 80×15
<a href="https://agentmods.dev/agents/intense-visions/harness-engineering/harness-architecture-enforcer"><img src="https://agentmods.dev/badge/agents/intense-visions/harness-engineering/harness-architecture-enforcer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 8,377 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.00030 $0.08377
Opus 5 $0.00015 $0.04189
Sonnet 5 $0.00006 $0.01675
Haiku 4.5 $0.00003 $0.00838

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

Security

Grade A, and why

harness-architecture-enforcer 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 9d 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.

.antigravity-extension/agents/harness-architecture-enforcer.md · 730 lines

How it starts

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

Role

Enforce layer boundaries, detect circular dependencies, block forbidden imports

Skills

  • enforce-architecture
  • check-mechanical-constraints
  • harness-dependency-health

Steps

  1. Run harness check-deps (always)
  2. Run harness validate (always)

Methodology

Enforce Architecture

Validate architectural layer boundaries and detect dependency violations. No code may violate layer constraints — this is a hard gate, not a suggestion.

When to Use

  • Before approving any pull request or merge
  • After writing new imports or module references
  • When adding a new module or package to the project
  • When on_pre_commit or on_architecture_check triggers fire
  • After refactoring that moves code between layers or modules
  • NOT when editing documentation, configuration, or non-code files
  • NOT when the violation is intentional and requires a constraint update (escalate instead)

Process

Phase 1: Load Constraints

  1. Read harness.config.json to understand the project's architectural constraints. The config defines:
    • Layers — ordered list of architectural layers (e.g., ui -> service -> repository -> domain)
    • Dependency rules — which layers may import from which (typically: layers may only import from layers below them)
    • Forbidden imports — specific import paths that are never allowed in certain contexts
    • Boundary definitions — which directories/packages belong to which layer
  • Design constraints — when design config exists, also load design constraint rules:
    • Token compliance — components must reference design tokens, not hardcoded values
    • Accessibility compliance — color pairs must meet WCAG contrast ratios
    • Anti-pattern enforcement — project-specific anti-patterns from design-system/DESIGN.md
    • Platform binding — tokens must have appropriate platform bindings for enabled platforms
  1. Understand the layer model. In a typical layered architecture:
    • Higher layers depend on lower layers (UI depends on Service, Service depends on Repository)
    • Lower layers NEVER depend on higher layers (Repository must not import from UI)
    • Same-layer imports may or may not be allowed depending on project config
    • Cross-cutting concerns (logging, config) have their own rules

Read the full file on GitHub · 730 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. 9d ago First seen · 730 lines · 30 tokens per session scan A c28a00c82cc7

Subscribe to this mod's changes

harness-architecture-enforcer is an agent published in the GitHub repository Intense-Visions/harness-engineering (20 stars, last pushed today), licensed MIT. It adds 30 tokens to every session and 8,377 once invoked, about $0.0002 per session on Opus 5. 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.