# Architecture Audit — Where The Structure Is Wrong

> Audits codebase structure to identify dependency cycles, layering violations, and god modules with a fix order.

Architecture Audit — Where The Structure Is Wrong is a paid AI agent skill on Agensi by Anton Nikonorov, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $12 (one-time purchase)
- Creator: [Anton Nikonorov](https://www.agensi.io/creators/anton-nikonorov)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Version: 1.0
- Last updated: 2026-10-20
- Security: scan passed (2026-10-20); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/architecture-audit-where-the-structure-is-wrong
- Tags: ai-agents, code-review, documentation, architecture-audit, dependency-analysis

## About this skill

Your codebase is growing, and you no longer know if your module boundaries are holding or if circular dependencies are slowing down your builds. This skill performs a cold, structural audit of your repository to map the dependency graph, identify layering violations, and surface god modules.

### What it does
- **Detects cycles** by identifying recursive dependency loops that break modularity.
- **Finds layering violations** by checking if infrastructure or UI modules are reaching into domain logic.
- **Maps reach and coupling** to identify which modules are too large or act as critical contract hubs.
- **Identifies disconnected modules** to surface dead code or isolated subsystems that are no longer in use.
- **Calculates fix order** by ranking structural issues based on their reach and severity.

### How it works
1. **Frame the audit** by defining whether to scan the whole repository or a specific subsystem against documented architectural intent.
2. **Collect structural signals** using the `agent-context` CLI to generate a module map and dependency graph.
3. **Apply eight specific checks** to score issues like unresolved imports, coupling depth, and layering non-conformance.
4. **Generate the remediation report** including a ranked table of findings and a step-by-step order for fixing them.

### Frameworks & tools
Works with any language or framework. It integrates with the `ai-agent-context` CLI for deterministic graph analysis but falls back to `git grep` and manual file inspection for environments without Node.js.

### Why this beats prompting it yourself
Standard prompts often miss deep circular dependencies or subtle layering violations across large file trees. This skill uses a standardized scoring system and remediation sequence to ensure the audit is reproducible and objective.

### Use cases
- Auditing a legacy repository before starting a major refactor.
- Reviewing module boundaries before moving to a monorepo or microservices.
- Verifying that a team is following the layering rules defined in their docs.
- Identifying dead code and unreachable modules in aging projects.

### Known limitations
The audit is read-only and does not modify code. Role detection is name-based, so repositories without standard directory names (like /domain or /infra) may yield limited layering analysis.

## Requires

- ai-agent-context
- Node.js
- agent-context
- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Architecture Audit — Where The Structure Is Wrong skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does the Architecture Audit skill help improve my codebase?

This skill performs a structural analysis to identify dependency cycles, layering violations, and 'god modules' that are too large, providing a ranked remediation report to guide your refactoring efforts.

### Does this skill support specific programming languages or frameworks?

It is language-agnostic and works with any framework; while it performs best with the `ai-agent-context` CLI, it can fall back to standard terminal tools for environments without specific runtimes.

### Will the agent automatically refactor my code after the audit?

No, this is a read-only audit tool designed to identify and rank structural issues; it provides a step-by-step fix order for you to implement safely rather than modifying your source code directly.

### How does the skill know which files belong to the 'domain' versus 'infrastructure' layers?

The skill uses directory and file naming conventions to identify layers; if your project uses non-standard naming, you can define your architectural intent during the 'Frame the audit' step to ensure accurate results.

### What is included in the purchase of this skill?

You receive the full skill package, including the structured logic for the eight architectural checks, integration instructions for the `agent-context` CLI, and the remediation report templates.

### How is this different from just asking a standard AI agent to review my code?

Standard LLM prompts often lose track of deep dependency chains in large repositories, whereas this skill uses a deterministic scoring system and graph analysis to ensure no circular loops are missed.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
