kg-extract
하는 일
이 스킬은 소스 파일을 읽고 클래스, 함수, 모듈을 서로 어떻게 관련되는지 보여 주는 지도로 바꿉니다. 코드베이스의 구조와 변경이 어디까지 퍼질지 이해해야 하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓코드베이스의 부분들이 서로 어떻게 의존하는지 알고 싶을 때.
- ✓변경이 얼마나 멀리 영향을 줄지 판단해야 할 때.
- ✓큰 변경 후 코드 지도를 새로 고치고 싶을 때.
스킬 링크
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-knowledge-graph/skills/kg-extract/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“내 프로젝트의 주요 부분을 파악하고, 서로 어떻게 의존하는지 정리해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 소스 파일을 읽고 클래스, 함수, 모듈, 타입을 식별한 뒤, 가져오기와 상속 같은 관계를 기록합니다. 결과는 프로젝트 메모리 저장소에 그래프로 저장됩니다.
기술 내용 (원본 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
자주 묻는 질문
타입 전용 가져오기도 런타임 연결로 세나요?
아닙니다. 타입 전용 가져오기는 더 약한 관계로 남기며, 순환 탐지에는 쓰지 않습니다.
어떤 관계를 기록하나요?
가져오기, extends, implements, depends-on 관계이며, 각각 가중치가 있습니다.
그래프는 어디에 저장되나요?
스킬이 쓰는 메모리 저장소인 AgentDB에 저장됩니다.
상세 정보
작성자의 원본 설명
Extract entities and relations from source files to build a knowledge graph
repo: ruvnet/ruflo
인기도
- GitHub 스타
- 81k
- 순위
- #1639
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
agent-adaptive-coordinator
81k작업량이 바뀔 때 에이전트 무리를 나누고 재배치해, 작업에 맞는 배치를 고르도록 에이전트를 돕습니다.
agent-agent
81k큰 목표를 순서가 있는 행동 계획으로 나누고, 조건이 바뀌면 다시 계획하도록 에이전트를 가르칩니다.
agent-agentic-payments
81kAI 쇼핑을 위한 지출 위임장을 관리합니다. 지출 상한, 시간 창, 판매자 규칙, 서명된 승인을 포함합니다.
agent-analyze-code-quality
81k에이전트가 파일을 바꾸지 않고, 코드 품질 문제와 코드 냄새, 기술 부채, 리팩터링 아이디어를 찾아 검토하도록 돕습니다.
비슷한 스킬
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
slacrawl
394k에이전트가 로컬 Slack 보관본에서 메시지를 검색하고 개수를 세며, 보관본이 얼마나 최신인지 확인하고 필요할 때 새로 고치도록 돕습니다.
goplaces
394k에이전트가 Google Places로 장소를 검색하고, 세부 정보와 리뷰를 가져오고, 장소 이름을 확인하며, 스크립트용 JSON을 출력하도록 돕습니다.