Cross-layer imports
Agents generate plausible imports that violate dependency boundaries — service layers reaching into domain internals without understanding the architectural contract.
Architecture Intelligence
Architecture Intelligence for AI Coding Agents
Deterministic architecture analysis that prevents AI coding agents from introducing architectural violations before code is generated.
The Problem
Agents generate plausible imports that violate dependency boundaries — service layers reaching into domain internals without understanding the architectural contract.
Index files mask true dependencies. A single barrel import can transitively pull in dozens of modules across forbidden boundaries.
Individual commits pass review. Composed merges introduce architectural regressions that only surface in production dependency graphs.
Existing linters run after code exists. AI agents need deterministic validation before a single line is written.
How Trinetra Works
Every proposed change passes through a deterministic analysis pipeline — no LLM, no guesswork, no telemetry.
Agent proposes import graph delta via MCP or CLI before code generation.
Deterministic engine resolves barrels, traces transitive deps, checks rules.
Architecture policy from architecture.json blocks violations with evidence.
Ed25519 compliance receipt issued for every passing analysis.
Import Graph Visualization
Interactive import graph analysis with barrel resolution and layer boundary detection.
Core Capabilities
Declarative rules in architecture.json define layer boundaries, forbidden imports, and module coupling constraints.
Traces through index.ts barrel files to reveal true transitive dependencies hidden behind re-exports.
Native MCP server exposes architecture tools directly to Cursor, Claude, and any MCP-compatible agent.
Suggests minimal import path corrections when violations are detected — no LLM required.
Multi-language support with language-specific import resolution and module system analysis.
Compositional Merge Checking
Individual commits may pass. Composed merges can still break architecture. Trinetra analyzes the merged graph before integration.
Click to simulate compositional merge analysis
Workspace Inspector
VS Code / Cursor extension with real-time architecture scoring, dependency chains, and guardrail verdicts.
Resolves to domain/email/email.service.ts via barrel domain/email/index.ts
application → domain: FORBIDDEN per rule no-cross-layer-import
UserService.createUser → EmailService.sendWelcome → SMTPAdapter.connect
3 call sites, 2 transitive deps, depth 4
Compliance
Signed compliance receipts. Offline verification. Zero egress. No telemetry. Ever.
Cryptographically signed compliance receipts for every analysis pass. Verifiable offline with public key.
Full analysis engine runs locally. No network calls. No cloud dependency. Works air-gapped.
No telemetry, no analytics, no phone-home. Your architecture data never leaves your machine.
Developer Workflow
Analyze, validate, and enforce from the terminal.
Merge-time compositional analysis in CI.
Block architectural violations before commit.
Standard SARIF reports for GitHub, Azure DevOps, and security dashboards.
Configuration
Performance
CLI + VS Code + MCP
Terminal-first workflow for CI, scripts, and power users.
Workspace Inspector with live context, line lens, and guardrail verdicts.
Architecture tools exposed to any MCP-compatible AI agent.
From Engineers
"We stopped 847 cross-layer imports in the first week. Trinetra catches what ESLint and dependency-cruiser miss because it resolves barrels."
"The MCP integration means our Cursor agents now ask Trinetra before writing imports. Architecture violations dropped 94% in two sprints."
"Signed compliance receipts gave our security team the audit trail they needed. Zero egress was non-negotiable for us."
FAQ
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.
Installation
No account required. No API keys. Fully local.
npm install -g @trinetra/cli && trinetra inittrinetra init in your project rootArchitecture Diagrams
Clean separation enforced at every import boundary.