codegraph
यह क्या करती है
यह स्किल कोडबेस का इंडेक्स बनाती है और उससे संरचना के सवालों के जवाब देती है, जैसे किसी फ़ंक्शन को कौन बुलाता है या सबसे जोखिम भरा कोड कहाँ है। यह बड़े प्रोजेक्ट समझने वाले डेवलपरों के लिए है।
कब इस्तेमाल करें
- ✓जब आपको पता करना हो कि कोई फ़ंक्शन किसे बुलाता है या वह किस पर निर्भर है।
- ✓जब आप किसी प्रोजेक्ट में बेकार कोड, हॉटस्पॉट या मॉड्यूल की जुड़ाव-स्थिति खोजना चाहें।
- ✓जब आप बदलाव करने से पहले जानना चाहें कि उससे क्या प्रभावित होगा।
Skill का लिंक
https://github.com/QwenLM/qwen-code/blob/main/.qwen/skills/codegraph/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस प्रोजेक्ट को इंडेक्स कीजिए और मुझे वे फ़ंक्शन दिखाइए जिन्हें कोई नहीं बुलाता, साथ में सबसे बड़े हॉटस्पॉट भी।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट स्रोत कोड को फ़ंक्शन, कॉल, इम्पोर्ट और इतिहास के ग्राफ़ में इंडेक्स करता है, और अर्थ के आधार पर खोज के लिए एम्बेडिंग भी बनाता है। फिर वह ग्राफ़ क्वेरी और रिपोर्ट चलाता है, जैसे कॉल चेन, निर्भरताएँ और प्रभाव विश्लेषण।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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 |
|---|
अक्सर पूछे जाने वाले सवाल
यह कौन सी भाषाएँ सपोर्ट करती है?
यह Python, JavaScript, TypeScript, C और Java सपोर्ट करती है।
प्रभाव विश्लेषण क्या है?
यह कॉल ग्राफ़ के आधार पर दिखाता है कि किसी बदलाव से दूसरे कौन से कोड प्रभावित हो सकते हैं।
क्या यह कोड को अर्थ से खोज सकती है?
हाँ। यह वेक्टर इंडेक्स से उन फ़ंक्शन को ढूँढती है जो अर्थ में मिलते-जुलते हैं।
जानकारी
लेखक का मूल विवरण
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
लोकप्रियता
- GitHub स्टार
- 29k
- रैंकिंग में स्थान
- #9768
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
qwen-code-claw
29kयह आपके एजेंट को कोडिंग के काम Qwen Code को सौंपने में मदद करती है, जैसे कोडबेस समझना, बग ठीक करना, कोड रीफ़ैक्टर करना या नया प्रोजेक्ट बनाना।
structured-debugging
29kयह आपके एजेंट को कठिन बग ढूँढने का चरण-दर-चरण तरीका सिखाती है: परिकल्पना बनाना, लक्षित जांच करना, परखना और ठीक करने से पहले असली कारण ढूँढना।
tmux-real-user-testing
29kयह आपके एजेंट को tmux के अंदर टर्मिनल ऐप को असली यूज़र की तरह टेस्ट करने में मदद करती है, हर कदम की स्क्रीन-तस्वीर के साथ पढ़ने योग्य लॉग सहेजकर।
generated-ui
29kयह आपके एजेंट को चैट के अंदर ही एक इंटरैक्टिव कैलकुलेटर, सिम्युलेटर या तुलना दिखाने देती है, ताकि आप इनपुट बदलकर नतीजे देख सकें।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।