From gg-senior-tools
Analyze a codebase and generate an indented dependency tree mapping modules, components, and their relationships, plus a UML-like Physical Data Model extracted from migrations/schema files. Trigger when the user wants to map the codebase, understand module dependencies, identify impact zones before a feature, or initialize/update dep-tree.md. Also auto-triggered by gg-skill-phase at end of phase execution.
How this skill is triggered — by the user, by Claude, or both
Slash command
/gg-senior-tools:gg-skill-dep-treeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Produce a readable indented dependency tree grouped by domain, showing what each module uses, triggers, or depends on. Optionally includes a UML-like Physical Data Model (MPD) extracted from migrations/schema files.
Produce a readable indented dependency tree grouped by domain, showing what each module uses, triggers, or depends on. Optionally includes a UML-like Physical Data Model (MPD) extracted from migrations/schema files.
Two use cases:
Output language: French for relationship labels; English for module/component names (as they appear in code).
Mode -u / -update — called automatically by gg-skill-phase at end of phase execution, or manually after any code change:
dep-tree.md, identify its Last updated headergit diff --name-only since last dep-tree update)dep-tree.md in place## Changelog entry at the bottom:### Phase N — {date}
- [ModuleX] nouvelle dépendance → ServiceY ajoutée
- [ModuleZ] relation modifiée : utilise → déclenche
- [NewModule] ajouté, dépend de Database + Auth
Feature Mode — if a target is specified (e.g. add payment module):
Full generation — no flag and no target: produce the complete tree from scratch.
Identify:
Read: package.json, composer.json, pyproject.toml, or equivalent.
Scan: src/, app/, lib/, components/, modules/, services/ — whatever exists.
Identify the top-level domains (3–10 max):
Each domain becomes a root node in the tree.
For each domain, identify its children (sub-components, services, hooks, controllers...).
For each node, determine the relationship type using these labels:
| Label | Meaning |
|---|---|
→ utilise | direct import / dependency |
→ dépend de | requires another module to function |
→ déclenche | emits event / calls callback |
→ modifie | writes to / mutates state or data |
→ exposé par | provided by parent / injected |
→ utilisé par | reverse dependency (consumed elsewhere) |
Use actual imports, function calls, and event listeners — not guesswork.
Render the tree using box-drawing characters:
DomainName → [optional: dépend de OtherDomain]
├─ SubComponent → utilise ServiceA + ServiceB
│ ├─ ChildComponent → modifie SubComponent state
│ └─ onEventName → déclenche DomainB + DomainC
└─ OtherSub → utilisé par 4 modules
Rules:
├─ for non-last children, └─ for last child, │ for continuation lines[+N éléments]After the tree, add a compact relation index:
DÉPENDANCES CROISÉES
─────────────────────
Database ← utilisé par 6 modules
EventBus ← utilisé par 4 modules
AuthService ← utilisé par Dashboard, Profile, Admin
If the project has a database layer (migrations, schema files, ORM models), generate a UML-like MPD section in dep-tree.md.
See references/mpd-extraction.md for full extraction rules, output format, and FK notation.
Source priority:
database/migrations/*.phpsrc/Entity/*.phpprisma/schema.prisma*.sql filesMode -u behavior: re-read only migrations newer than Last updated date. Add/modify only affected table blocks. Do not regenerate the full MPD.
If no database layer found: skip this step silently.
dep-tree.md at the project rootFreshness header — always present at the top of dep-tree.md:
> dep-tree.md — Last updated: {ISO date} | Phase: {N} | Mode: full|update
> Stale if: current phase > {N} and dep-tree not updated after phase {N} close
Authentication
├─ LoginFlow → utilise AuthService + Router
│ ├─ OAuthProvider → utilisé par LoginFlow
│ └─ SessionManager → utilisé par Login + Dashboard
└─ onAuthStateChange → déclenche Dashboard + Notifications
Dashboard → dépend de Authentication
├─ ClientList → utilise Database + SearchService
│ ├─ Filters → modifie ClientList
│ └─ onClientSelect → déclenche ClientDetail
└─ ClientDetail → utilise Database + API
Database — Supabase → utilisé par 6 modules
gg-skill-dep-tree ← you are here (init or update)
↓
gg-skill-phase (auto-calls dep-tree -u after each phase)
↓
gg-skill-recette
npx claudepluginhub schpill/gg-senior-tools --plugin gg-senior-toolsGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.