From universe
Generates high-level architecture maps of codebases: layers, modules, boundaries, data flow, and dependency directions using directory surveys and lenskit graph analysis.
npx claudepluginhub mbwsims/claude-universe --plugin universeThis skill is limited to using the following tools:
Generate a high-level architectural map of the codebase: layers, modules, boundaries,
Queries and visualizes project architecture: domains, APIs, layers, tech stack via /architecture subcommands or natural queries like 'show me the structure'. Analyzes filesystem patterns with Mermaid diagrams.
Produces a one-screen map of unfamiliar codebase areas: entry points, core modules, data flow, callers, hidden coupling. Readable in 15 seconds for quick orientation.
Automatically analyzes codebases to generate zero-config architecture diagrams by detecting project type, tech stack, and structure. For repo overviews without custom specs.
Share bugs, ideas, or general feedback.
Generate a high-level architectural map of the codebase: layers, modules, boundaries, data flow, and dependency directions. The output should give someone who's never seen this codebase a mental model in 2 minutes.
Gather structural data:
ls -la, ls src/)package.json, pyproject.toml, Cargo.toml, go.mod — what's
the stack?next.config.js, vite.config.ts, tsconfig.json, etc.lenskit_status with detailed: true first. It
provides file count, avg risk score, top risk files, circular dependency count, hub count,
and test coverage ratio. This gives you a quantitative foundation before reading any code.Read representative files from each major directory to understand the layer:
Use the layer classification from skills/trace/references/layer-patterns.md to identify
which directory maps to which architectural layer. Common patterns:
app/, pages/, routes/, api/, handlers/, controllers/services/, use-cases/, domain/db/, repositories/, models/lib/, utils/, helpers/components/, ui/, views/middleware/, plugins/, config/For framework-specific patterns (Django, FastAPI, Spring Boot, etc.), see the reference file.
With lenskit-mcp (preferred): Call lenskit_graph to get the full dependency graph
with layer classifications, circular dependencies, hub files, and layer violations
pre-computed. Use this data directly for the module map and observations sections. For the
highest-risk or highest-centrality files, call lenskit_analyze to add risk-score and
coupling detail to the observations.
Note on tsconfig path aliases: If the project uses tsconfig path aliases (e.g.,
@/utils/helpers mapping to src/utils/helpers), lenskit resolves these automatically.
The graph data will show the true file-to-file dependencies even for aliased imports.
If you see aliased imports in the code that don't appear in the graph, check whether
the project's tsconfig.json has paths configured.
Without lenskit-mcp: For each major module/directory, identify what it imports from and what imports it:
# What does src/lib/auth import?
grep -h "from" src/lib/auth/*.ts | sort -u
# What imports from src/lib/auth?
grep -rl "from.*lib/auth" src/ | grep -v "lib/auth"
Build a dependency direction map: which layers depend on which?
Look for:
Report format:
## Architecture Map — {project name}
### Stack
{Framework, language, database, key dependencies — one line each}
### Layer Diagram
┌─────────────────────────────────────────┐
│ Entry (app/api/, app/(routes)/) │ ← External requests
├─────────────────────────────────────────┤
│ Middleware (middleware.ts, lib/auth/) │ ← Auth, rate limiting
├─────────────────────────────────────────┤
│ Business Logic (lib/services/) │ ← Core domain
├─────────────────────────────────────────┤
│ Data Access (lib/db/) │ ← Database operations
├─────────────────────────────────────────┤
│ External Services (lib/clients/) │ ← Third-party APIs
└─────────────────────────────────────────┘
### Module Map
| Module | Purpose | Depends on | Depended by |
|--------|---------|------------|-------------|
| lib/auth | Authentication | lib/db, env | api/*, middleware |
| lib/db | Database access | prisma, env | lib/services, api/* |
| lib/services | Business logic | lib/db, lib/clients | api/* |
| ... |
### Data Flow
{Primary data flow path from entry to storage — reference /trace for detailed flows}
### Boundaries
- **Trust boundary**: All API routes require auth via middleware
- **Package boundary**: (if monorepo) packages communicate via published APIs
- **External boundary**: Database via Prisma, payments via Stripe SDK
### Key Patterns
{2-3 architectural patterns the project follows: repository pattern, service layer,
middleware chain, event-driven, etc.}
### Observations
{Potential issues: circular dependencies, layer violations, god modules, etc.}
/hotspots — Find the riskiest areas in the architecture/trace — Follow a specific feature flow through the layers/explain — Deep-dive into any module you found in the mapFor monorepos (Turborepo, Nx, Lerna, pnpm workspaces):
src/ into another
(should use published package exports instead)