codegraph
Fungsinya
Skill ini membangun indeks kodebase dan memakainya untuk menjawab pertanyaan struktural, seperti siapa yang memanggil sebuah fungsi atau di mana kode paling berisiko berada. Ini untuk pengembang yang ingin memahami proyek besar.
Kapan dipakai
- βSaat Anda perlu tahu siapa yang memanggil sebuah fungsi atau apa yang bergantung padanya.
- βSaat Anda ingin menemukan kode mati, titik panas, atau kopling modul dalam sebuah proyek.
- βSaat Anda ingin tahu apa yang akan terdampak oleh sebuah perubahan sebelum melakukannya.
Link skill
https://github.com/QwenLM/qwen-code/blob/main/.qwen/skills/codegraph/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βIndeks proyek ini dan tunjukkan fungsi yang tidak dipanggil siapa pun, serta titik panas terbesar.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent mengindeks kode sumber menjadi grafik fungsi, pemanggilan, impor, dan riwayat, ditambah embedding untuk pencarian berdasarkan makna. Setelah itu agent menjalankan kueri grafik dan laporan, seperti rantai pemanggilan, dependensi, dan analisis dampak.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
CodeScope Q&A
CodeScope indexes source code into a two-layer knowledge graph β structure (functions, calls, imports, classes, modules) and evolution (commits, file changes, function modifications) β plus semantic embeddings for every function. Supports Python, JavaScript/TypeScript, C, and Java (including Hadoop-scale repositories with 8K+ files). This combination enables analyses that grep, LSP, or pure vector search cannot do alone. It can also fetch GitHub issues and trace bugs to code, and review open PRs β scoring per-PR risk, detecting cross-PR conflicts, identifying auto-merge candidates, and applying GitHub labels.
When to Use This Skill
- User asks about call chains, callers, callees, or dependencies
- User wants to find dead code, hotspots, or architectural layers
- User asks about code history, who changed what, or why something was modified
- User wants to find semantically similar functions across a codebase
- User wants a full architecture analysis or report
- User asks about module coupling, circular dependencies, or bridge functions
- User wants to index or analyze a Java project (Maven, Gradle, plain Java)
- User wants to analyze GitHub issues or bug reports to find root causes
- User asks "why does this project have so many bugs" or "what code is most buggy"
- User wants to trace a bug report to the most relevant code locations
- User asks about class relationships, ownership, composition, or wants a class diagram / UML
- User wants to understand which classes own or depend on other classes
- User wants to review PRs, assess PR risk, or prioritize PR reviews
- User asks about cross-PR conflicts or which PRs can be merged independently
- User wants to find auto-merge candidates or generate a PR review report
- User asks about the blast radius or impact scope of a PR
- User wants to apply labels to PRs from analysis results
- User wants to explore PR-specific follow-up questions for a given PR
- A
.codegraphdirectory (or similar index) exists in the workspace
Getting Started
Installation
pip install codegraph-ai
Environment Variables (optional)
# Create Python virtural environment
python -m venv .venv
source .venv/bin/activate
# Point to a pre-built database (skip indexing)
export CODESCOPE_DB_DIR="/path/to/.linux_db"
# Offline mode for HuggingFace models
export HF_HUB_OFFLINE="1"
# Fallback when HuggingFace is unreachable (e.g., network issues in China)
# Use HF mirror or ModelScope for sentence-transformers models:
export HF_ENDPOINT="https://hf-mirror.com"
# https://www.modelscope.cn/models/sentence-transformers/all-MiniLM-L6-v2
Check Index Status
codegraph status --db $CODESCOPE_DB_DIR
If no index exists, create one:
codegraph init --repo . --lang auto --commits 500
Supported languages: python, c, javascript, typescript, java, or auto (auto-detects from file extensions).
The --commits flag ingests git history (for evolution queries). Without it, only structural analysis is available. Add --backfill-limit 200 to also compute function-level MODIFIES edges (slower but enables change_attribution and co_change).
To add git history to an existing index (without re-indexing structure):
codegraph ingest --repo . --db $CODESCOPE_DB_DIR --commits 500
codegraph ingest --repo . --db $CODESCOPE_DB_DIR --backfill-limit 200 # add MODIFIES edges only
Two Interfaces: CLI vs Python
Use the CLI for status and reports:
codegraph status --db $CODESCOPE_DB_DIR
codegraph analyze --db $CODESCOPE_DB_DIR --output report.md
Use the Python API for queries and custom analyses:
import os
os.environ['HF_HUB_OFFLINE'] = '1' # required
from codegraph.core import CodeScope
cs = CodeScope(os.environ['CODESCOPE_DB_DIR'])
# Cypher query
rows = list(cs.conn.execute('''
MATCH (caller:Function)-[:CALLS]->(f:Function {name: "free_irq"})
RETURN caller.name, caller.file_path LIMIT 10
'''))
for r in rows:
print(r)
cs.close() # always close when done
The Python API is more powerful β it gives you raw Cypher access and lets you chain queries.
Core Python API
Raw Queries
These are the building blocks for any custom analysis:
| Method | What it does |
|---|
Pertanyaan umum
Bahasa apa saja yang didukung?
Mendukung Python, JavaScript, TypeScript, C, dan Java.
Apa itu analisis dampak?
Analisis ini menunjukkan kode lain yang mungkin terdampak oleh sebuah perubahan, berdasarkan grafik pemanggilan.
Bisakah mencari kode berdasarkan makna?
Bisa. Skill ini memakai indeks vektor untuk menemukan fungsi yang secara semantik mirip.
Detail
Deskripsi asli dari pembuat
Analyze indexed codebases via graph database (neug) and vector index (zvec). Covers call graphs, dependencies, dead code, hotspots, module coupling, architecture reports, semantic search, impact analysis, bug root cause from GitHub issues, class diagrams (UML), and PR review (risk scoring, conflict detection, auto-merge candidates, labeling). Also covers creating, inspecting, and repairing a CodeScope index. Use for: code structure, who calls what, why something changed, similar functions, module boundaries, bug tracing, class relationships, PR risk/conflicts, or any question benefiting from a
repo: QwenLM/qwen-code
Popularitas
- Bintang GitHub
- 29k
- Peringkat
- #9768
- Lisensi
- Apache-2.0
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
qwen-code-claw
29kMembantu agent Anda menyerahkan tugas coding ke Qwen Code, seperti memahami codebase, memperbaiki bug, merapikan kode, atau membuat proyek baru.
structured-debugging
29kMengajari agent Anda men-debug bug sulit secara bertahap: menyusun hipotesis, menguji, dan menemukan penyebab asli sebelum memperbaiki.
tmux-real-user-testing
29kMembantu agent Anda menguji aplikasi terminal seperti pengguna sungguhan di dalam tmux, dengan log yang mudah dibaca dan cuplikan layar tiap aksi.
generated-ui
29kMemungkinkan agent Anda menampilkan kalkulator, simulator, atau perbandingan interaktif langsung di chat, sehingga Anda bisa mengubah input dan melihat hasilnya.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.