kg-extract
यह क्या करती है
यह स्किल सोर्स फ़ाइलें पढ़ती है और क्लास, फ़ंक्शन और मॉड्यूल को उनके आपसी संबंधों के नक्शे में बदलती है। जो डेवलपर कोडबेस का ढाँचा समझना चाहते हैं और यह जानना चाहते हैं कि बदलाव कहाँ तक फैल सकते हैं, उनके लिए यह है।
कब इस्तेमाल करें
- ✓जब आप समझना चाहें कि कोडबेस के हिस्से एक-दूसरे पर कैसे निर्भर हैं।
- ✓जब आपको आँकना हो कि कोई बदलाव कहाँ तक पहुँच सकता है।
- ✓जब बड़े बदलावों के बाद कोड का नक्शा ताज़ा करना हो।
Skill का लिंक
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-knowledge-graph/skills/kg-extract/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे प्रोजेक्ट के मुख्य हिस्सों का नक्शा बनाइए और दिखाइए कि वे एक-दूसरे पर कैसे निर्भर हैं।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
स्किल सोर्स फ़ाइलें पढ़ती है, क्लास, फ़ंक्शन, मॉड्यूल और टाइप पहचानती है, फिर उनके संबंध दर्ज करती है, जैसे इम्पोर्ट और inheritance के ज़रिए। नतीजा प्रोजेक्ट की मेमोरी में एक graph के रूप में सहेजा जाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
KG Extract
Extract entities (classes, functions, modules, types, concepts) and their relations (imports, extends, implements, depends-on, calls) from source files, then store them as a knowledge graph in AgentDB.
When to use
When you need to build or update a knowledge graph from source code or documentation. Useful for understanding codebase structure, dependency analysis, and impact assessment.
Steps
Scan files -- use
GlobandReadto enumerate and read source files at the given pathIdentify entities -- extract classes, functions, modules, types, and config references from each file
Map relations -- for each entity, determine its relations to other entities. Critical: TypeScript
import typeand inlinetypespecifiers (import { type Foo, bar }) are erased at compile time and MUST NOT be counted as value imports -- they're a separate, weaker relation. Misclassifying them produces phantom runtime cycles (see ruvnet/ruflo#2049).imports: value imports (import { x } from '...',require(...)) -- weight0.9type-depends-on: TypeScript type-only imports (import type { Foo } from '...'andimport { type Foo, value } from '...') -- weight0.1, never used for cycle detection or runtime impact analysisextends: class inheritance -- weight0.9implements: interface implementations -- weight0.7depends-on: constructor dependencies, injected services -- weight0.8calls: function/method invocations -- weight0.7references: documentation mentions, comments -- weight0.3
Regex hint for classifying TS imports (so a naive
from '...'grep doesn't conflate the two):^\s*import\s+type\s+ → type-depends-on (entire import is type-only) ^\s*import\s*\{[^}]*\btype\s+\w+ → split: type specifiers → type-depends-on, value specifiers → imports ^\s*import\s+[^{]*\bfrom\s+ → imports (value)Store in AgentDB -- call
mcp__plugin_ruflo-core_ruflo__agentdb_hierarchical-storefor each entity with metadata (name, type, file, line, description)Create edges -- call
mcp__plugin_ruflo-core_ruflo__agentdb_causal-edgefor each relation with source, target, relation type, and weightReport -- summarize: total entities by type, total relations by type, files scanned
CLI alternative
npx @claude-flow/cli@latest memory store --namespace knowledge-graph --key "entity-NAME" --value "METADATA_JSON"
npx @claude-flow/cli@latest memory search --query "entities in auth module" --namespace knowledge-graph
अक्सर पूछे जाने वाले सवाल
क्या केवल-टाइप वाले इम्पोर्ट रनटाइम लिंक गिने जाते हैं?
नहीं। केवल-टाइप इम्पोर्ट एक कमज़ोर संबंध के रूप में रखे जाते हैं और cycle पहचानने में इस्तेमाल नहीं होते।
कौन से संबंध दर्ज होते हैं?
इम्पोर्ट, extends, implements और depends-on संबंध, हर एक का अपना वज़न होता है।
graph कहाँ सहेजा जाता है?
यह AgentDB में सहेजा जाता है, वह मेमोरी स्टोर जिसे स्किल इस्तेमाल करती है।
जानकारी
लेखक का मूल विवरण
Extract entities and relations from source files to build a knowledge graph
repo: ruvnet/ruflo
लोकप्रियता
- GitHub स्टार
- 81k
- रैंकिंग में स्थान
- #1639
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
agent-adaptive-coordinator
81kआपके एजेंट को काम बदलने पर AI एजेंटों के समूह को बाँटने और फिर से संतुलित करने में मदद करती है, और काम के हिसाब से लेआउट चुनती है।
agent-agent
81kआपके एजेंट को बड़े लक्ष्य को क्रमबद्ध कार्यों की योजना में बदलना सिखाती है, और स्थिति बदलने पर योजना फिर से बनाना भी।
agent-agentic-payments
81kAI खरीदारी के लिए खर्च के आदेश मैनेज करने में मदद करती है, जिसमें खर्च की सीमा, समय अवधि, व्यापारी नियम और signed मंज़ूरियाँ शामिल हैं।
agent-analyze-code-quality
81kआपके एजेंट को कोड की गुणवत्ता जाँचने में मदद करती है, बिना फ़ाइलें बदले code smells, technical debt और refactoring के सुझाव खोजकर।
मिलती-जुलती skills
gitcrawl
394kयह आपके एजेंट को GitHub issues और pull requests के सेव आर्काइव में खोजने, मिलते-जुलते मामलों को समूह में रखने और लाइव स्थिति जांचने देती है।
slacrawl
394kयह आपके एजेंट को स्थानीय Slack आर्काइव में संदेश खोजने और गिनने, उसकी ताज़गी जांचने और ज़रूरत पड़ने पर उसे ताज़ा करने देती है।
goplaces
394kयह आपके एजेंट को Google Places से जगहें खोजने, उनका विवरण और समीक्षाएं पाने, और जगह के नाम हल करने में मदद करती है, स्क्रिप्ट के लिए JSON आउटपुट के साथ।