Architecture Intelligence

Tri netra

Architecture Intelligence for AI Coding Agents

Deterministic architecture analysis that prevents AI coding agents from introducing architectural violations before code is generated.

0Files Analyzed
0LLM Calls
0Smoke Tests
Architecture Score ANALYZING
0
src/services/user.service.ts
1import { UserRepo } from '@/infra/db';
2import { EmailService } from '@/domain/email'; // ✗ layer violation
3
4export class UserService {
5  constructor(private repo: UserRepo) {}
6}

Why AI Agents Break Architecture

01

Cross-layer imports

Agents generate plausible imports that violate dependency boundaries — service layers reaching into domain internals without understanding the architectural contract.

02

Barrel re-export chains

Index files mask true dependencies. A single barrel import can transitively pull in dozens of modules across forbidden boundaries.

03

Merge-time violations

Individual commits pass review. Composed merges introduce architectural regressions that only surface in production dependency graphs.

04

No pre-generation guard

Existing linters run after code exists. AI agents need deterministic validation before a single line is written.

Pre-generation Validation Workflow

Every proposed change passes through a deterministic analysis pipeline — no LLM, no guesswork, no telemetry.

01

Parse Intent

Agent proposes import graph delta via MCP or CLI before code generation.

02

Analyze Graph

Deterministic engine resolves barrels, traces transitive deps, checks rules.

03

Enforce Rules

Architecture policy from architecture.json blocks violations with evidence.

04

Sign Receipt

Ed25519 compliance receipt issued for every passing analysis.

See Every Dependency

Interactive import graph analysis with barrel resolution and layer boundary detection.

Allowed Violation Barrel External
Selecteduser.service.ts
Layerapplication
Imports4 direct, 12 transitive
Violations1 blocked
Barrel depth3 resolved

Architecture Enforcement

Architecture Rule Enforcement

Declarative rules in architecture.json define layer boundaries, forbidden imports, and module coupling constraints.

Barrel Re-export Resolution

Traces through index.ts barrel files to reveal true transitive dependencies hidden behind re-exports.

MCP Integration

Native MCP server exposes architecture tools directly to Cursor, Claude, and any MCP-compatible agent.

Deterministic Repair Engine

Suggests minimal import path corrections when violations are detected — no LLM required.

TypeScript, JavaScript & Python

Multi-language support with language-specific import resolution and module system analysis.

Merge-Time Architecture Analysis

Individual commits may pass. Composed merges can still break architecture. Trinetra analyzes the merged graph before integration.

feature/auth-refactor
a3f8c2dAdd AuthService layer
b7e1a09Wire session middleware
c4d2f11Update barrel exports
main
d9a5e33Refactor domain entities
e1b6c44Split email module
f2c7d55Update protections.json
Ready to analyze

Click to simulate compositional merge analysis

Live Architecture Context in Your Editor

VS Code / Cursor extension with real-time architecture scoring, dependency chains, and guardrail verdicts.

Trinetra Workspace Inspector — my-app
user.service.ts architecture.json
1 import { UserRepo } from '@/infra/db';
2 import { EmailService } from '@/domain/email';
3
4 export class UserService {
5 async createUser(data: CreateUserDTO) {
6 const user = await this.repo.insert(data);
7 await this.email.sendWelcome(user); // ← violation
8 return user;
9 }
10 }
Line Lens — Line 2

Import Resolution

Resolves to domain/email/email.service.ts via barrel domain/email/index.ts

Layer Check

application → domain: FORBIDDEN per rule no-cross-layer-import

Execution Flow

UserService.createUser → EmailService.sendWelcome → SMTPAdapter.connect

Function Telemetry

3 call sites, 2 transitive deps, depth 4

Local-first Security

Signed compliance receipts. Offline verification. Zero egress. No telemetry. Ever.

Ed25519 Signed Receipts

Cryptographically signed compliance receipts for every analysis pass. Verifiable offline with public key.

Offline Verification

Full analysis engine runs locally. No network calls. No cloud dependency. Works air-gapped.

Zero Egress

No telemetry, no analytics, no phone-home. Your architecture data never leaves your machine.

Integrate Everywhere

CLI

Analyze, validate, and enforce from the terminal.

trinetra analyze --strict

GitHub Action

Merge-time compositional analysis in CI.

trinetra/action@v1

Pre-commit Hook

Block architectural violations before commit.

trinetra hook install

SARIF Output

Standard SARIF reports for GitHub, Azure DevOps, and security dashboards.

trinetra analyze --sarif

Declarative Architecture Policy

architecture.json
{ "layers": ["domain", "application", "infra"], "rules": [{ "from": "application", "forbid": ["domain"], "except": ["ports/*"] }] }
policy.json
{ "enforcement": "strict", "merge_analysis": true, "barrel_depth_limit": 5, "sign_receipts": true }
protections.json
{ "pre_commit": true, "ci_gate": true, "mcp_guard": true, "block_on_violation": true }

Built for Scale

0
Files analyzed in single pass
0
Smoke tests passing
0
LLM calls in analysis engine

Three Integration Surfaces

CLI

Terminal-first workflow for CI, scripts, and power users.

VS Code / Cursor

Workspace Inspector with live context, line lens, and guardrail verdicts.

MCP Server

Architecture tools exposed to any MCP-compatible AI agent.

Trusted by Platform Teams

"We stopped 847 cross-layer imports in the first week. Trinetra catches what ESLint and dependency-cruiser miss because it resolves barrels."

SK
Sarah Kim
Staff Engineer, Series C Fintech

"The MCP integration means our Cursor agents now ask Trinetra before writing imports. Architecture violations dropped 94% in two sprints."

MR
Marcus Rivera
Principal Engineer, AI Platform

"Signed compliance receipts gave our security team the audit trail they needed. Zero egress was non-negotiable for us."

AL
Anika Lindström
Engineering Manager, Enterprise SaaS

Common Questions

No. The analysis engine is fully deterministic. It uses static analysis, import graph resolution, and rule evaluation. No LLM calls, ever.

TypeScript, JavaScript, and Python with full import graph analysis. Go and Rust are on the roadmap.

Trinetra builds the import graph of the merged result before integration, detecting violations that individual commits wouldn't surface alone.

Never. Trinetra is local-first with zero telemetry and zero egress. All analysis runs on your machine.

Every passing analysis produces an Ed25519 signed receipt. Verify offline with the bundled public key — no network required.

Start in 60 Seconds

No account required. No API keys. Fully local.

npm install -g @trinetra/cli && trinetra init
1Install the CLI globally via npm
2Run trinetra init in your project root
3Configure architecture.json with your layer rules
4Install the VS Code extension or connect via MCP
View Documentation

Layer Boundaries Visualized

Clean separation enforced at every import boundary.

CLEAN ARCHITECTURE API / Presentation Application / Services Domain / Ports Infrastructure VIOLATION DETECTED API Application Domain ← BLOCKED Infrastructure