Project profile: architecture and layers in about 15 lines
In an unfamiliar project, run profile once instead of listing folders. It tells you how
the project is built — architecture, which folder holds which layer, design patterns and the call direction between
layers — from folder and file names, confirmed by the code graph. It never guesses.
Run it
bash ~/.claude/skills/callgraph/callgraph.sh profile --project myapp # about 15 lines
bash ~/.claude/skills/callgraph/callgraph.sh profile --project myapp --full # per folder, confidence counts, call pairs between layers
What the profile contains
- Architecture — Laravel / Yii layered MVC, DDD / hexagonal, Vue / React frontend, SwiftUI MVVM or Rust web,
using the framework found in
composer.json,package.jsonorCargo.toml. - Layers — which folder holds the controllers, services, repositories, models, components, stores…, with file counts.
- Design patterns — Repository, Factory, Strategy, Observer…
- Call direction — whether the layers call each other in the expected direction.
- Unknown folders — folders without a clear role.
The code graph confirms what the names suggest: extends Controller,
implements *RepositoryInterface, defineStore, and the direction of the calls between
layers. Every file gets a role with a confidence (high / medium / low), or stays "unknown".
Use the layers in queries
A layer is a name from the profile (controller, service, repository,
model, component, store…), not a path — so you can narrow a query without
knowing the folder names. All of this is opt-in; the default output does not change.
bash ~/.claude/skills/callgraph/callgraph.sh --project myapp app --layer service # only the service files (several: service,repository)
bash ~/.claude/skills/callgraph/callgraph.sh --project myapp app --format summary --layers # summary grouped by layer
bash ~/.claude/skills/callgraph/callgraph.sh --project myapp app --grep 'Repo::find' --depth 2 --by-layer # callers by layer, closest first
--layeris the only one that filters;--layersand--by-layeronly group and order.--by-layerorders "who calls it?" results by layer, closest to the called code first.- Over MCP: the
layerparameter onoutline,searchandfind_callers, andby_layeronfind_callers.
Your own folder names: .callgraph-layers
Folder names that say nothing, or are not English? A commit-able .callgraph-layers file in the project
root maps them, for example:
service = app/Szolgaltatasok, app/Logic
ignore-role = app/Legacy
For AI clients
The project_profile MCP tool returns the same profile (full: true for the details). When
the MCP server starts in a project folder (one with composer.json, package.json,
Cargo.toml, Package.swift, .git or .callgraph), a compact profile
is sent to the client on connect. Set up the MCP server.