Skip to content
Back to skills

Jade Core Knowledge Graph

ASecurity

Core skill that builds a Java Knowledge Graph from `.java` sources using tree-sitter-java, enabling impact analysis, rule ordering, and consumer test selection in the JADE migration pipeline.

  • 2 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 11, 2026
ai-agentspythonjavanodeapi

Works with

  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add TheRealSeber/PolishedJADEite --skill jade-core-knowledge-graph --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Jade Core Knowledge Graph?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Jade Core Knowledge Graph
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/therealseber-jade-core-knowledge-graph/badge)](https://www.skillsdirectory.com/skills/therealseber-jade-core-knowledge-graph)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: jade-core-knowledge-graph
description: >-
  Core skill that builds a Java Knowledge Graph from `.java` sources using
  tree-sitter-java, enabling impact analysis, rule ordering, and consumer test
  selection in the JADE migration pipeline.
---

# jade-core-knowledge-graph

Universal Java source analyzer that builds a Knowledge Graph from `.java` files using tree-sitter-java. Produces `03.5-knowledge-graph.json` consumed by downstream pipeline phases for impact analysis, semantic verification, rule ordering, and consumer test selection.

## Invocation Contract

```
python .claude/skills/jade-core-knowledge-graph/scripts/build_graph.py --workspace <path> --artifacts-dir <path>
python .claude/skills/jade-core-knowledge-graph/scripts/query_graph.py --graph <path> --query <type> [args...]
```

Exit codes: `0`=success, `1`=partial/no-results, `2`=failure, `3`=env-error.

## Pipeline Phase

**Phase 3.5** -- runs after TOOLING_SCOUT (Phase 3), before SCANNER (Phase 4). Build graph once per migration run.

## Graph Schema

- **Nodes**: One per `.java` file with class_name, package, kind, modifiers, extends, implements, methods (with full signatures), fields, constructors
- **Edges**: 5 types -- `imports`, `extends`, `implements`, `calls`, `type_refs`
- External types (`java.*`, `javax.*`) recorded as edges but never recursed into

## Query Types

| Query | Args | Returns |
|-------|------|---------|
| `dependents` | `--target <file>` | Files importing/referencing target |
| `impact-chain` | `--target <file> --method <name>` | Call sites for a method |
| `rule-scope` | `--files <list>` | `{direct, transitive, total}` |
| `consumer-coverage` | `--files <list> --consumer-map <path>` | Consumer project names |
| `transform-order` | `--rules <list> --rule-files-map <path>` | Topologically sorted rules |

## Python API

```python
from schema import KnowledgeGraph
kg = KnowledgeGraph.load("artifacts/03.5-knowledge-graph.json")
deps = kg.query_dependents("core/AID.java")
calls = kg.query_call_sites("core/Agent.java", "doDelete")
```

## Edge Cases

1. **Parse errors**: File gets partial node (imports via regex fallback). Logged as warning.
2. **Wildcard imports**: Resolved to ALL files in the package (over-approximation).
3. **Overloaded methods**: Call resolution by method name only (conservative).
4. **Anonymous inner classes**: Attached to parent file, not separate nodes.
5. **Generics**: Erased. `List<Agent>` -> type_ref to `Agent`.
6. **Cycles**: Graph is directed, cycles don't break queries.

## Artifact

Writes: `03.5-knowledge-graph.json` to artifacts directory.
Format: `{run_id, generated_at, stats, nodes: {path: {node}}, edges: {type: [edge]}}`.

Files in this skill

  • SKILL.md2.6 KB
  • scripts/build_graph.py21.3 KB
  • scripts/plan_shards.py17.4 KB
  • scripts/query_graph.py3.7 KB
  • scripts/schema.py15.4 KB
  • scripts/tree_sitter_java_queries.py12.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.