building-java-knowledge-graph

Analyze JVM projects and generate knowledge-graph.json of modules, packages, and dependencies.

35|8|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/microsoft/github-copilot-modernization --skill building-java-knowledge-graph
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: building-java-knowledge-graph
Source: https://github.com/microsoft/github-copilot-modernization/tree/main/plugins/github-copilot-modernization/skills/building-java-knowledge-graph
Command: npx skills add https://github.com/microsoft/github-copilot-modernization --skill building-java-knowledge-graph

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires tree-sitter, pyyaml, and includes scripts (resource) components.

What problem does it solve?

Analyzes JVM projects (Java/Kotlin/Scala/Groovy) and generates knowledge graphs with tree-sitter parsing. Requires Python 3 on the host and a JVM project with Maven/Gradle/Ant/Ivy build files. Skips gracefully if prerequisites are missing. Triggers when asked to "build knowledge graph", "analyze project structure", "parse Java codebase", or "generate dependency graph".

Core Features & Use Cases

  • Detects and analyzes JVM projects (Maven/Gradle/Ant/Ivy) and extracts modules, dependencies, and source structure.
  • Parses Java-based languages (Java/Kotlin/Scala/Groovy) to discover classes, packages, inheritance, interfaces, and annotations.
  • Generates a machine-readable knowledge graph (knowledge-graph.json) for downstream agents or visualization.
  • Use Case: Given a Java monolith with multiple modules, generate a graph showing module dependencies and package structures to guide modernization.

Quick Start

Run python3 scripts/build_knowledge_graph.py /path/to/project /path/to/output to generate knowledge-graph.json.

Frequently Asked Questions about building-java-knowledge-graph

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a knowledge graph for a Java project?

To generate a Java knowledge graph, run the build script against your JVM project directory to output a knowledge-graph.json file detailing modules, classes, and dependencies.

What build systems are supported when parsing a JVM project structure?

Parsing a JVM project structure supports Maven, Gradle, Ant, and Ivy build files to accurately map project architecture, detect language usage, and reveal module dependencies.

Can I analyze Kotlin, Scala, and Groovy codebases to map dependencies?

Yes, you can analyze Kotlin, Scala, and Groovy codebases using tree-sitter parsing to discover packages, classes, inheritance, interfaces, and annotations across JVM languages.

Do I need Python to extract a dependency graph from Java source files?

Yes, you need Python 3 installed on the host machine to execute the tree-sitter parsing scripts that extract the Java source file structure and generate the dependency graph.

What is the best way to visualize module relationships in a Java monolith?

The best way to visualize module relationships in a Java monolith is to generate a machine-readable knowledge-graph.json file, which maps project structure for downstream visualization agents.

Why does the knowledge graph generation skip my project without an error?

Knowledge graph generation skips gracefully without an error when prerequisites like Python 3 or recognized JVM build files such as Maven or Gradle are missing from the project directory.