plugins/github-copilot-modernization/skills/building-java-knowledge-graph/SKILL.md
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 either prerequisite is missing. Triggers when asked to "build knowledge graph", "analyze project structure", "parse Java codebase", or "generate dependency graph".
npx skillsauth add microsoft/github-copilot-modernization building-java-knowledge-graphInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Step 1 — Verify JVM project:
find "$PROJECT_ROOT" -maxdepth 5 -type f \( -name "*.java" -o -name "*.kt" -o -name "*.scala" -o -name "*.groovy" \) | head -1
If no JVM files found: skip this skill. Set
knowledge_graph_dirtonullinsetup_artifacts. Non-fatal — downstream agents fall back to direct source analysis.
Step 2 — Verify Python:
python3 --version 2>/dev/null || python --version 2>/dev/null
If unavailable: skip this skill with same fallback as above.
# First-time setup (~1 minute)
pip3 install --user 'tree-sitter<0.21'
python3 scripts/install_grammars.py
# Optional: SVG generation
brew install graphviz # macOS
# Analyze project
python3 scripts/build_knowledge_graph.py /path/to/project output-dir
⚠️ DESTRUCTIVE OUTPUT: The script wipes ALL files in output-dir before writing. NEVER point it at a shared directory like {{BASE_PATH}}/ or {{BASE_PATH}}/artifacts/. Use a dedicated subdirectory:
# ✅ SAFE — dedicated subdirectory
python3 scripts/build_knowledge_graph.py /path/to/project {{BASE_PATH}}/artifacts/kg_output
# ❌ DANGER — will delete constitution.md, board.md, other artifacts!
python3 scripts/build_knowledge_graph.py /path/to/project {{BASE_PATH}}
After the script finishes, copy knowledge-graph.json to {{BASE_PATH}}/ for other agents to consume.
application*.properties, application*.yaml/ymlsettings.gradle parsingAll outputs are written under the provided artifact path (pass as 2nd argument to the script).
knowledge-graph.json ← complete graph (nodes + edges)
module-dependencies.{dot,svg} ← module dependency diagram
module-{name}.{dot,svg} ← per-module class diagrams
project-{name}.{dot,svg} ← complete project diagram
references/schema.md — node/edge types, ID patterns, fields, visualization colorsreferences/querying.md — jq and Python query examplesscripts/build_knowledge_graph.py — main analyzerscripts/install_grammars.py — grammar installertesting
Generate and run post-migration tests from the frozen baseline specification.
devops
How team members request infrastructure connection info and handle secrets in team mode
testing
Create a test baseline for the project to be modernized. The baseline will be used for later verification of modernization tasks.
tools
Convert an arbitrary CSV report (e.g. a Black Duck export or a custom migration-issue inventory) into a schema-valid assessment `report.json` the modernization pipeline can consume — so it appears in the assessment UI and migration solutions resolve automatically. This skill is LLM-driven: you read and interpret the CSV yourself and author `report.json` by hand against the schema. A small helper script only does deterministic lookups (migration solutions, the ruleId for a solution) and validates the finished report. There is NO "convert everything" script and NO assumed column layout. Triggers: "convert csv to assessment report", "import csv report", "turn this spreadsheet into a report.json", "Black Duck csv to report", "build report.json from csv", "migrate a third-party assessment export". NOT for: AppCAT-style analysis from source (use `assessment`), generating a modernization plan (use `create-modernization-plan`), or editing a report.json the pipeline already produced.