Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Codebase'i knowledge graph olarak analiz et. Dependency, call graph, hotspot analizi.
.claude/skills/code-knowledge-graph/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 69% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 211% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 103% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 73% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 226% | 0% |
Codebase'i knowledge graph olarak modeller. Dosya, modul, fonksiyon ve class'lar node; import, call, inheritance ve composition iliskileri edge olur. Sonuc: Mermaid diagram + JSON graph data.
Kod text degil, graph'tir. Her dosya diger dosyalara baglidir. Bu baglantilari anlamadan:
Knowledge graph tum bu iliskileri gorsellestirir ve olculebilir yapar.
/code-knowledge-graph [hedef-dizin] [--focus module] [--depth N] [--format mermaid|json|both]bash# Tum codebase analizi /code-knowledge-graph src/ # Belirli module odaklan /code-knowledge-graph src/ --focus auth # Sadece circular dependency kontrolu /code-knowledge-graph src/ --focus circular # Hotspot analizi /code-knowledge-graph src/ --focus hotspots # Orphan/dead code tespiti /code-knowledge-graph src/ --focus orphans
bash# Dosya agaci tldr tree ${PATH:-src/} --ext .py # Kod yapisi: fonksiyonlar, class'lar, export'lar tldr structure ${PATH:-src/} --lang python
Her dosya, class, fonksiyon ve export bir node olur.
bash# Dosyanin import'lari (outgoing edges) tldr imports ${FILE} # Modulu kim import ediyor? (incoming edges) tldr importers ${MODULE} ${PATH:-src/} # Cross-file call graph tldr calls ${PATH:-src/}
Her import ve fonksiyon cagrisi bir directed edge olur.
bash# Architectural layer analizi tldr arch ${PATH:-src/}
Node'lar 3 katmana ayrilir:
| Katman | Tanim | Ornekler | |--------|-------|---------| | Entry | Disaridan cagirilan, ici cagirmayan | routes, cli, main, handlers | | Middle | Hem cagrilan hem cagirir | services, business logic | | Leaf | Cagirilan ama baskasini cagirmayan | utils, helpers, constants |
bash# Bu fonksiyona kim bagimli? tldr impact ${FUNCTION} ${PATH:-src/} --depth 3 # Dead code: hicbir yerden cagrilmayan fonksiyonlar tldr dead ${PATH:-src/}
codebase-memory MCP kuruluysa, persistent graph sorgusu yap:
mcp: index_status -> Repo index durumu
mcp: index_repository -> Repo'yu indexle (yoksa)
mcp: query_graph -> Graph sorgusu (iliskiler)
mcp: search_graph -> Pattern arama
mcp: get_architecture -> Mimari genel bakis
mcp: trace_call_path -> Fonksiyonlar arasi cagri yoluMCP, session'lar arasi kalici graph verisi saglar. tldr ise anlik taze analiz verir. Ikisini birlikte kullan.
A dogrudan B'yi import ediyor:
A --import--> BA, B'yi import ediyor, B de C'yi import ediyor. A, C'ye transitif bagimli:
A --import--> B --import--> C
A ....transitif....> CTransitive dependency chain'i uzadikca risk artar. tldr impact ile transitif zincirleri gor.
| Metrik | Yuksek Degerin Anlami | Risk | |--------|----------------------|------| | Fan-In (in-degree) | Cok modul buna bagimli | Fragile - degisiklik cascade yapar | | Fan-Out (out-degree) | Bu modul cok seye bagimli | Unstable - disaridan kirilabilir |
Hedef: Leaf node'larda yuksek fan-in (iyi - utility), entry node'larda yuksek fan-out (kotu - god module).
Circular dependency = A imports B, B imports A (dogrudan veya transitif).
ONCE: A <--> B (circular)
SONRA: A --> IB <-- B (interface ile decouple)Her iki modul de bir interface'e bagimli olur, birbirine degil.
ONCE: A --> B --> A (circular)
SONRA: A --> B, A <-- C (C yeni modul, B'nin A'ya ihtiyac duydugu kismi tasir)ONCE: A <--> B (ortak kod paylasiyor)
SONRA: A --> Shared <-- B (ortak kod ayri module)ONCE: A --> B --> A (geri cagri)
SONRA: A --> EventBus <-- B (event ile haberlesme)| Durum | Strateji | |-------|----------| | Type/interface paylasimi | Extract Interface | | Fonksiyon geri cagrisi | Dependency Inversion | | Ortak utility kodu | Extract Shared Module | | Async bildirim ihtiyaci | Event-Based Decoupling |
Hotspot = Graph'ta en cok baglantisi olan node.
hotspot_score = (in_degree * 2) + out_degree + (change_frequency * 3)in_degree * 2: Bagimli modul sayisi (en onemli - cascade risk)out_degree: Bagimlilik sayisi (kirilganlik)change_frequency * 3: Git log'dan degisiklik sikligi (degisen hotspot = en tehlikeli)| Hotspot Tipi | Oncelik | Aksiyon | |-------------|---------|--------| | Yuksek in-degree + sik degisen | P0 CRITICAL | Hemen split et, test ekle | | Yuksek in-degree + stabil | P2 MEDIUM | Test ekle, dikkatli degistir | | Yuksek out-degree | P1 HIGH | Dependency'leri azalt, facade pattern | | Yuksek her ikisi | P0 CRITICAL | God module - parcala |
bash# Git log'dan en cok degisen dosyalar git log --format=format: --name-only --since="6 months ago" | sort | uniq -c | sort -rn | head -20
Cok degisen + cok baglantili = en yuksek risk.
mermaidgraph TD subgraph Entry["Entry Layer (Red)"] routes[routes.py] cli[cli.py] end subgraph Middle["Middle Layer (Orange)"] auth[auth_service.py] user[user_service.py] end subgraph Leaf["Leaf Layer (Green)"] utils[utils.py] validators[validators.py] end routes --> auth routes --> user cli --> user auth --> utils auth --> validators user --> utils style routes fill:#e74c3c,color:#fff style cli fill:#e74c3c,color:#fff style auth fill:#f39c12,color:#fff style user fill:#f39c12,color:#fff style utils fill:#27ae60,color:#fff style validators fill:#27ae60,color:#fff
mermaidgraph LR handle_request --> validate handle_request --> authorize authorize --> check_token authorize --> check_role validate --> sanitize check_token --> decode_jwt
mermaidgraph LR A[module_a] -->|imports| B[module_b] B -->|imports| C[module_c] C -->|imports| A style A fill:#e74c3c,color:#fff style B fill:#e74c3c,color:#fff style C fill:#e74c3c,color:#fff linkStyle 0 stroke:#e74c3c,stroke-width:3px linkStyle 1 stroke:#e74c3c,stroke-width:3px linkStyle 2 stroke:#e74c3c,stroke-width:3px
mermaidgraph TD A[utils.py<br/>in:12 out:1<br/>HOTSPOT] B[service.py<br/>in:3 out:8] C[routes.py<br/>in:0 out:5] D[models.py<br/>in:6 out:2] C --> B C --> A B --> A B --> D D --> A style A fill:#e74c3c,stroke:#c0392b,stroke-width:4px,color:#fff style D fill:#f39c12,stroke:#e67e22,stroke-width:2px,color:#fff
Knowledge graph review'da su sorulari cevaplar:
bash tldr impact changed_function src/ --depth 3
bash tldr impact function_name src/
Yeni developer'a codebase'i tanitmak icin:
Graph verisi mimari kararlari destekler:
| Karar | Graph Verisi | |-------|-------------| | "Bu modulu bolmeli miyiz?" | In-degree + out-degree + LOC | | "Microservice siniri nerede?" | Cluster analizi (yuksek ic baglantilar, dusuk dis baglantilar) | | "Hangi modulu once refactor edelim?" | Hotspot score siralamasina bak | | "Yeni feature nereye oturur?" | Mevcut layer'a ve dependency pattern'ine bak | | "Bu dependency guvenli mi?" | Transitif dependency chain'ine bak |
| Komut | Kullanim | Cikti | |-------|---------|-------| | tldr tree [path] | Dosya agaci | JSON | | tldr structure [path] --lang X | Kod yapisi (codemaps) | JSON | | tldr calls [path] | Cross-file call graph | JSON | | tldr impact <func> [path] | Reverse call graph | JSON | | tldr dead [path] | Dead/orphan code | JSON | | tldr arch [path] | Layer detection | JSON | | tldr imports <file> | Dosyanin import'lari | JSON | | tldr importers <module> [path] | Modulu kim import ediyor | JSON |
json{ "metadata": { "project": "project-name", "analyzed_at": "2026-03-26T10:00:00Z", "total_nodes": 45, "total_edges": 128, "languages": ["python"] }, "nodes": [ { "id": "src/auth/service.py::AuthService", "type": "class", "file": "src/auth/service.py", "layer": "middle", "in_degree": 5, "out_degree": 3, "is_hotspot": true, "is_orphan": false } ], "edges": [ { "source": "src/routes.py::handle_login", "target": "src/auth/service.py::AuthService.authenticate", "type": "call" } ], "layers": { "entry": [], "middle": [], "leaf": [] }, "circular_dependencies": [], "hotspots": [], "orphans": [] }
| Arac | Ne Zaman | |------|---------| | graph-analyst agent | Tam graph analizi, otomatik rapor | | tldr arch | Hizli layer detection | | tldr calls | Hizli call graph | | codebase-memory MCP | Persistent graph, session arasi sorgulama | | /explore architecture | Genel mimari kesfetme | | architect agent | Graph verisiyle mimari karar | | janitor agent | Orphan/dead code temizligi |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 17,399 | 14,929 | -14% | 1 | 1 | 0% | 3,918 | 6,604 | +69% | 0 | 0 | — |
case-06 | fail→pass | 7,924 | 5,267 | -34% | 1 | 1 | 0% | 1,383 | 4,308 | +211% | 0 | 0 | — |
case-07 | fail→pass | 13,057 | 8,352 | -36% | 1 | 1 | 0% | 2,284 | 4,628 | +103% | 0 | 0 | — |
case-02 | fail→fail | 16,534 | 5,731 | -65% | 1 | 1 | 0% | 3,770 | 3,599 | -5% | 0 | 0 | — |
case-03 | fail→pass | 12,134 | 4,786 | -61% | 1 | 1 | 0% | 2,474 | 4,281 | +73% | 0 | 0 | — |
case-04 | fail→pass | 9,364 | 11,418 | +22% | 1 | 1 | 0% | 1,626 | 5,302 | +226% | 0 | 0 | — |
case-05 | pass→pass | 8,475 | 7,781 | -8% | 1 | 1 | 0% | 1,627 | 4,775 | +193% | 0 | 0 | — |
case-08 | fail→pass | 11,467 | 5,382 | -53% | 1 | 1 | 0% | 1,936 | 4,278 | +121% | 0 | 0 | — |
case-09 | pass→pass | 14,432 | 6,659 | -54% | 1 | 1 | 0% | 2,280 | 4,530 | +99% | 0 | 0 | — |
case-10 | fail→pass | 12,563 | 2,142 | -83% | 1 | 1 | 0% | 2,327 | 3,705 | +59% | 0 | 0 | — |
case-11 | fail→pass | 16,425 | 4,073 | -75% | 1 | 1 | 0% | 2,712 | 4,072 | +50% | 0 | 0 | — |
case-12 | fail→fail | 7,560 | 4,602 | -39% | 1 | 1 | 0% | 1,310 | 4,039 | +208% | 0 | 0 | — |
case-13 | pass→pass | 13,686 | 11,976 | -12% | 1 | 1 | 0% | 2,296 | 5,486 | +139% | 0 | 0 | — |
case-14 | fail→pass | 9,422 | 2,947 | -69% | 1 | 1 | 0% | 1,735 | 3,888 | +124% | 0 | 0 | — |
case-15 | pass→pass | 9,829 | 8,442 | -14% | 1 | 1 | 0% | 1,785 | 4,851 | +172% | 0 | 0 | — |
case-16 | pass→pass | 12,968 | 13,569 | +5% | 1 | 1 | 0% | 2,234 | 5,840 | +161% | 0 | 0 | — |
case-17 | pass→pass | 8,485 | 7,638 | -10% | 1 | 1 | 0% | 1,492 | 4,599 | +208% | 0 | 0 | — |
case-18 | fail→fail | 7,407 | 2,251 | -70% | 1 | 1 | 0% | 1,268 | 3,760 | +197% | 0 | 0 | — |
case-19 | fail→pass | 8,966 | 2,186 | -76% | 1 | 1 | 0% | 1,554 | 3,716 | +139% | 0 | 0 | — |
case-20 | pass→pass | 4,224 | 4,221 | -0% | 1 | 1 | 0% | 758 | 3,927 | +418% | 0 | 0 | — |
case-21 | pass→pass | 9,071 | 7,221 | -20% | 1 | 1 | 0% | 1,766 | 4,910 | +178% | 0 | 0 | — |
case-22 | pass→pass | 10,384 | 7,774 | -25% | 1 | 1 | 0% | 2,272 | 4,895 | +115% | 0 | 0 | — |
case-23 | pass→pass | 9,724 | 12,478 | +28% | 1 | 1 | 0% | 2,224 | 6,149 | +176% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 22 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +43 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 7/29/2026 | +50% |
Other measured skills in the registry, with their headline benchmark lift.