ruvnet/ruflo/kg-extract

Claude Code and agent skill by ruvnet/ruflo

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Extract entities and relations from source files to build a knowledge graph

Install

npx vskill@latest install ruvnet/ruflo/kg-extract

SKILL.md

The same SKILL.md was published earlier as ruvnet/ruflo/kg-extract.

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

  1. Scan files -- use Glob and Read to enumerate and read source files at the given path
  2. Identify entities -- extract classes, functions, modules, types, and config references from each file
  3. Map relations -- for each entity, determine its relations to other entities. Critical: TypeScript `import type` and inline `type` specifiers (`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(...)) -- weight 0.9
  • type-depends-on: TypeScript type-only imports (import type { Foo } from '...' and import { type Foo, value } from '...') -- weight 0.1, never used for cycle detection or runtime impact analysis
  • extends: class inheritance -- weight 0.9
  • implements: interface implementations -- weight 0.7
  • depends-on: constructor dependencies, injected services -- weight 0.8
  • calls: function/method invocations -- weight 0.7
  • references: documentation mentions, comments -- weight 0.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) ``

  1. Store in AgentDB -- call mcp__plugin_ruflo-core_ruflo__agentdb_hierarchical-store for each entity with metadata (name, type, file, line, description)
  2. Create edges -- call mcp__plugin_ruflo-core_ruflo__agentdb_causal-edge for each relation with source, target, relation type, and weight
  3. Report -- summarize: total entities by type, total relations by type, files scanned

CLI alternative

bash
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

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
67,355
Repository forks
8,058
7-day trend score
56

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ruvnet/ruflo/kg-extract/badge)](https://verified-skill.com/skills/ruvnet/ruflo/kg-extract)

Something wrong with this skill or its page? Tell us.