class-ai-agent 1.5.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/rules/antigravity-overview.md +2 -1
- package/.agent/rules/codegraph.md +8 -0
- package/.agent/rules/ontosight.md +89 -0
- package/.agents/references/codegraph.md +4 -0
- package/.agents/references/ontosight.md +130 -0
- package/.agents/skills/ui-ux-pro-max/IMPACT-DEMO.md +101 -0
- package/.claude/CLAUDE.md +16 -0
- package/.claude/references/ontosight.md +130 -0
- package/.claude/rules/codegraph.md +8 -0
- package/.claude/rules/ontosight.md +85 -0
- package/.claude/skills/ui-ux-pro-max/IMPACT-DEMO.md +101 -0
- package/.cursor/CURSOR.md +16 -0
- package/.cursor/references/codegraph.md +4 -0
- package/.cursor/references/ontosight.md +130 -0
- package/.cursor/rules/codegraph.mdc +8 -0
- package/.cursor/rules/cursor-overview.mdc +1 -0
- package/.cursor/rules/ontosight.mdc +89 -0
- package/.cursor/skills/ui-ux-pro-max/IMPACT-DEMO.md +101 -0
- package/.kiro/KIRO.md +16 -1
- package/.kiro/references/codegraph.md +4 -0
- package/.kiro/references/ontosight.md +130 -0
- package/.kiro/skills/ui-ux-pro-max/IMPACT-DEMO.md +101 -0
- package/.kiro/steering/codegraph.md +8 -0
- package/.kiro/steering/kiro-overview.md +2 -1
- package/.kiro/steering/ontosight.md +89 -0
- package/AGENTS.md +5 -0
- package/GEMINI.md +17 -1
- package/README.md +60 -7
- package/bin/class-ai-agent.cjs +5 -0
- package/package.json +3 -2
|
@@ -24,10 +24,11 @@ Supporting workflows: `debug`, `simplify`, `fix-issue`, `handoff`, `resume` in `
|
|
|
24
24
|
|
|
25
25
|
## Mandatory standards
|
|
26
26
|
|
|
27
|
-
- Follow **`.agent/rules/`** (`*.md` with YAML frontmatter). **`security.md`**, **`codegraph.md`**, and **`agent-continuity.md`** use `trigger: always_on`; others often use `trigger: glob`.
|
|
27
|
+
- Follow **`.agent/rules/`** (`*.md` with YAML frontmatter). **`security.md`**, **`codegraph.md`**, **`ontosight.md`**, and **`agent-continuity.md`** use `trigger: always_on`; others often use `trigger: glob`.
|
|
28
28
|
- Prefer **tests first** and **small vertical slices** (see `.agents/skills/incremental-implementation/`).
|
|
29
29
|
- Use **`.agents/references/`** for checklists (security, testing, performance, accessibility).
|
|
30
30
|
- For **structural** code questions, prefer **CodeGraph** MCP tools per **`.agent/rules/codegraph.md`**.
|
|
31
|
+
- When the user wants a **visual call graph**, use **OntoSight CLI** per **`.agent/rules/ontosight.md`** (`npx @royalsolution/ontosight@0.2.0`).
|
|
31
32
|
|
|
32
33
|
## Agents (personas)
|
|
33
34
|
|
|
@@ -23,6 +23,14 @@ Use codegraph for **structural** questions — what calls what, what would break
|
|
|
23
23
|
| "See several related symbols' source at once" | `codegraph_explore` |
|
|
24
24
|
| "What files exist under path/" | `codegraph_files` |
|
|
25
25
|
| "Is the index healthy?" | `codegraph_status` |
|
|
26
|
+
| Visual exploration of a subgraph in browser | `npx @royalsolution/ontosight@0.2.0` (see **`.agent/rules/ontosight.md`**) |
|
|
27
|
+
| "Show/demonstrate impact of changing Z" | `codegraph_impact` → then OntoSight `--symbol Z` (see **`.agent/rules/ontosight.md`**) |
|
|
28
|
+
|
|
29
|
+
### Visualization
|
|
30
|
+
|
|
31
|
+
For interactive call-graph UI (user asks to "show the graph" or explore architecture visually), use **OntoSight CLI** after gathering context with `codegraph_*` tools. See **`.agent/rules/ontosight.md`**.
|
|
32
|
+
|
|
33
|
+
For **impact demonstration** requests ("show impact", "blast radius", "what breaks if I change X"), run `codegraph_impact` first, present a text summary, then open OntoSight — never stop at MCP text alone when the user wants to see or show impact.
|
|
26
34
|
|
|
27
35
|
### Tool parameters (do not mix)
|
|
28
36
|
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
description: "OntoSight CLI — visualize CodeGraph call subgraphs in the browser"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## OntoSight
|
|
7
|
+
|
|
8
|
+
[OntoSight](https://www.npmjs.com/package/@royalsolution/ontosight) visualizes CodeGraph call subgraphs in an interactive browser UI. It is **not** an MCP server — there are no `ontosight_*` tools. Use **CodeGraph MCP** (`codegraph_*`) to answer structural questions in chat; use **OntoSight CLI** when the user wants a visual, interactive call graph.
|
|
9
|
+
|
|
10
|
+
See **`.agent/rules/codegraph.md`** for MCP usage and **`.agents/references/ontosight.md`** for full flags and troubleshooting.
|
|
11
|
+
|
|
12
|
+
### CodeGraph MCP vs OntoSight
|
|
13
|
+
|
|
14
|
+
| Goal | Use |
|
|
15
|
+
|------|-----|
|
|
16
|
+
| Find symbols, callers, traces, impact (text in chat) | `codegraph_*` MCP tools |
|
|
17
|
+
| Visual exploration of a subgraph | `npx @royalsolution/ontosight@0.2.0` |
|
|
18
|
+
| User says "show me the graph" | OntoSight CLI |
|
|
19
|
+
| Impact / blast radius demonstration | `codegraph_impact` → summary → OntoSight CLI |
|
|
20
|
+
|
|
21
|
+
Rule of thumb: gather facts with CodeGraph MCP; open OntoSight when visualization helps the human explore complexity you already identified.
|
|
22
|
+
|
|
23
|
+
### When to run OntoSight
|
|
24
|
+
|
|
25
|
+
Run (or suggest) OntoSight when the user:
|
|
26
|
+
|
|
27
|
+
- Asks to visualize, show, or explore a call graph or architecture
|
|
28
|
+
- Wants an interactive view after you surfaced symbols via `codegraph_search` / `codegraph_context`
|
|
29
|
+
- Is doing onboarding or architecture review and benefits from a graph UI
|
|
30
|
+
- Asks about **impact**, **blast radius**, or **what breaks** and wants to see or demonstrate scope (refactor, rename, delete)
|
|
31
|
+
|
|
32
|
+
Do **not** run OntoSight to collect agent context — that duplicates CodeGraph MCP and blocks the terminal while the browser is open.
|
|
33
|
+
|
|
34
|
+
### Impact analysis demonstration
|
|
35
|
+
|
|
36
|
+
**Triggers** — open the graph, not only text:
|
|
37
|
+
|
|
38
|
+
- "impact", "blast radius", "what breaks", "what would break", "downstream", "affected by"
|
|
39
|
+
- "show impact", "demonstrate impact", "visualize impact"
|
|
40
|
+
- User is about to refactor, rename, or delete a symbol and wants to see scope
|
|
41
|
+
|
|
42
|
+
**Workflow** (mandatory order):
|
|
43
|
+
|
|
44
|
+
1. `codegraph_search({ query: "<symbol>" })` — confirm name, file, kind
|
|
45
|
+
2. `codegraph_impact({ query: "<symbol>" })` — ranked blast radius (chat facts)
|
|
46
|
+
3. Read **`.agents/skills/ui-ux-pro-max/IMPACT-DEMO.md`** — presentation checklist (use your tool's skills path: `.agents/skills/`, `.agents/skills/`, `.agents/skills/`)
|
|
47
|
+
4. Optional: run ui-ux-pro-max searches from the playbook for chart/UX framing
|
|
48
|
+
5. Summarize in chat: seed symbol, top impacted callers, risk tier, what the graph will highlight
|
|
49
|
+
6. `npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200`
|
|
50
|
+
|
|
51
|
+
**Hop guidance:** use `--hops 3` (or `4` for deep trees) for impact demos; prefer `--path` over raising `--max-nodes` when truncated.
|
|
52
|
+
|
|
53
|
+
**UX rule:** always give a **text summary before** opening the browser (progressive disclosure); include a **ranked table** of top impacted symbols as an accessible alternative to the graph alone.
|
|
54
|
+
|
|
55
|
+
### Suggested workflows
|
|
56
|
+
|
|
57
|
+
**Symbol the user named:**
|
|
58
|
+
|
|
59
|
+
1. `codegraph_search({ query: "<name>" })` → confirm file + kind
|
|
60
|
+
2. Summarize in chat
|
|
61
|
+
3. `npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir-from-search>`
|
|
62
|
+
|
|
63
|
+
**Feature area ("how does auth work?"):**
|
|
64
|
+
|
|
65
|
+
1. `codegraph_context({ task: "authentication flow", maxNodes: 20 })`
|
|
66
|
+
2. Summarize key symbols in chat
|
|
67
|
+
3. `npx @royalsolution/ontosight@0.2.0 . --task "authentication flow" --hops 2 --max-nodes 200`
|
|
68
|
+
|
|
69
|
+
**Large repo:** prefer `--path` or `--symbol` before raising `--max-nodes`.
|
|
70
|
+
|
|
71
|
+
### Commands
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npx @royalsolution/ontosight@0.2.0 .
|
|
75
|
+
npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir>
|
|
76
|
+
npx @royalsolution/ontosight@0.2.0 . --task "auth flow" --hops 2 --max-nodes 200
|
|
77
|
+
npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unless `ONTOSIGHT_SKIP_AUTO_INIT=1`). Ask the user before auto-init on very large repos.
|
|
81
|
+
|
|
82
|
+
### Prerequisites
|
|
83
|
+
|
|
84
|
+
| Requirement | Notes |
|
|
85
|
+
|-------------|-------|
|
|
86
|
+
| Node 20+ | For `npx @royalsolution/ontosight@0.2.0` |
|
|
87
|
+
| Python 3.11+ | Used by `ontosight-codegraph` |
|
|
88
|
+
| uv (recommended) or pipx | Wrapper tries `uvx` first, then `pipx run` |
|
|
89
|
+
| CodeGraph index | `.codegraph/codegraph.db` in project root |
|
|
@@ -87,4 +87,8 @@ Example — correct:
|
|
|
87
87
|
| Stale symbols after edit | Wait ~2s for watcher sync, or check staleness banner in tool output |
|
|
88
88
|
| Init failed during install | Run `npx @colbymchenry/codegraph init -i` manually |
|
|
89
89
|
|
|
90
|
+
## Visualization (OntoSight)
|
|
91
|
+
|
|
92
|
+
For interactive call-graph exploration in the browser, use **[OntoSight](https://www.npmjs.com/package/@royalsolution/ontosight)** (`npx @royalsolution/ontosight@0.2.0`). Gather facts with `codegraph_*` first; open OntoSight when the user wants a visual UI. See [`.cursor/references/ontosight.md`](ontosight.md).
|
|
93
|
+
|
|
90
94
|
Upstream: [colbymchenry/codegraph](https://github.com/colbymchenry/codegraph)
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# OntoSight reference
|
|
2
|
+
|
|
3
|
+
[OntoSight](https://www.npmjs.com/package/@royalsolution/ontosight) visualizes [CodeGraph](https://github.com/colbymchenry/codegraph) call subgraphs in an interactive browser UI. **class-ai-agent** installs usage rules across all four agent trees; invocation is via `npx` (no npm dependency).
|
|
4
|
+
|
|
5
|
+
**Recommended version:** `@royalsolution/ontosight@0.2.0` (pins PyPI `ontosight-codegraph` 0.2.0). Use unpinned `npx @royalsolution/ontosight@0.2.0` only when the user explicitly wants latest.
|
|
6
|
+
|
|
7
|
+
OntoSight complements CodeGraph MCP — use `codegraph_*` for structural facts in chat; use OntoSight when the user wants visual exploration. See also [`.cursor/references/codegraph.md`](codegraph.md).
|
|
8
|
+
|
|
9
|
+
## Per-tool wiring
|
|
10
|
+
|
|
11
|
+
| Tool | Rules | Reference |
|
|
12
|
+
|------|-------|-----------|
|
|
13
|
+
| Cursor | `.cursor/rules/ontosight.mdc` | `.cursor/references/ontosight.md` |
|
|
14
|
+
| Claude Code | `.claude/rules/ontosight.md` | `.claude/references/ontosight.md` |
|
|
15
|
+
| Kiro | `.kiro/steering/ontosight.md` | `.kiro/references/ontosight.md` |
|
|
16
|
+
| Antigravity | `.agent/rules/ontosight.md` | `.agents/references/ontosight.md` |
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Full project — seeds from highest fan-in symbols
|
|
22
|
+
npx @royalsolution/ontosight@0.2.0 .
|
|
23
|
+
|
|
24
|
+
# Seed around a symbol (optionally scoped to a path)
|
|
25
|
+
npx @royalsolution/ontosight@0.2.0 . --symbol view_graph --path src/auth/
|
|
26
|
+
|
|
27
|
+
# Task-scoped subgraph (keyword FTS seeding)
|
|
28
|
+
npx @royalsolution/ontosight@0.2.0 . --task "auth flow" --hops 2 --max-nodes 200
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unless `ONTOSIGHT_SKIP_AUTO_INIT=1`).
|
|
32
|
+
|
|
33
|
+
## Flags
|
|
34
|
+
|
|
35
|
+
| Flag | Description | Default |
|
|
36
|
+
|------|-------------|---------|
|
|
37
|
+
| `[project-path]` | Project root containing `.codegraph/` | `.` (cwd) |
|
|
38
|
+
| `--path <dir>` | Limit symbols to files under this path | — |
|
|
39
|
+
| `--symbol <name>` | Seed symbol for BFS subgraph expansion | auto (fan-in) |
|
|
40
|
+
| `--task <text>` | Natural-language seed (keyword match) | — |
|
|
41
|
+
| `--hops <n>` | BFS hop depth | `2` |
|
|
42
|
+
| `--max-nodes <n>` | Cap subgraph size | `200` |
|
|
43
|
+
|
|
44
|
+
`--symbol` and `--task` are mutually exclusive seeds; `--path` narrows either.
|
|
45
|
+
|
|
46
|
+
## Suggested agent workflows
|
|
47
|
+
|
|
48
|
+
### Symbol the user named
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
1. codegraph_search({ query: "view_graph" }) → confirm file + kind
|
|
52
|
+
2. Tell user what you found
|
|
53
|
+
3. npx @royalsolution/ontosight@0.2.0 . --symbol view_graph --path <dir-from-search>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Feature area ("how does auth work?")
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
1. codegraph_context({ task: "authentication flow", maxNodes: 20 })
|
|
60
|
+
2. Summarize key symbols in chat
|
|
61
|
+
3. npx @royalsolution/ontosight@0.2.0 . --task "authentication flow" --hops 2 --max-nodes 200
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Impact analysis demonstration
|
|
65
|
+
|
|
66
|
+
When the user wants to **know** or **see** impact (blast radius, what breaks, downstream callers):
|
|
67
|
+
|
|
68
|
+
**Triggers:** "impact", "blast radius", "what breaks", "what would break", "downstream", "affected by", "show impact", "demonstrate impact", "visualize impact"; or user is about to refactor/rename/delete a symbol.
|
|
69
|
+
|
|
70
|
+
**Workflow:**
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
1. codegraph_search({ query: "<symbol>" }) → confirm file + kind
|
|
74
|
+
2. codegraph_impact({ query: "<symbol>" }) → ranked blast radius
|
|
75
|
+
3. Read skills/ui-ux-pro-max/IMPACT-DEMO.md → UX presentation checklist
|
|
76
|
+
4. Optional: ui-ux-pro-max chart/ux searches (see playbook)
|
|
77
|
+
5. Summarize in chat (seed, ranked table, what graph shows)
|
|
78
|
+
6. npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Example:**
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npx @royalsolution/ontosight@0.2.0 . --symbol deleteUser --path src/services/ --hops 3 --max-nodes 200
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**UX:** Always text summary before opening the browser; include a ranked table of top impacted symbols (accessible alternative to graph-only). See [IMPACT-DEMO.md](../skills/ui-ux-pro-max/IMPACT-DEMO.md).
|
|
88
|
+
|
|
89
|
+
**Truncated subgraph:** narrow `--path` or lower `--hops` before raising `--max-nodes`.
|
|
90
|
+
|
|
91
|
+
### Index missing
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npx @colbymchenry/codegraph init -i
|
|
95
|
+
# or let the OntoSight wrapper auto-init (default)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Environment variables
|
|
99
|
+
|
|
100
|
+
| Variable | Effect |
|
|
101
|
+
|----------|--------|
|
|
102
|
+
| `ONTOSIGHT_SKIP_AUTO_INIT=1` | Fail if `.codegraph/codegraph.db` missing instead of running init |
|
|
103
|
+
| `ONTOSIGHT_CODEGRAPH_VERSION` | Pin PyPI `ontosight-codegraph` version |
|
|
104
|
+
|
|
105
|
+
## Requirements
|
|
106
|
+
|
|
107
|
+
| Requirement | Notes |
|
|
108
|
+
|-------------|-------|
|
|
109
|
+
| Node 20+ | For `npx @royalsolution/ontosight@0.2.0` |
|
|
110
|
+
| Python 3.11+ | Used by `ontosight-codegraph` |
|
|
111
|
+
| uv (recommended) or pipx | Wrapper tries `uvx` first, then `pipx run` |
|
|
112
|
+
| CodeGraph index | `.codegraph/codegraph.db` in project root |
|
|
113
|
+
|
|
114
|
+
## What the user sees
|
|
115
|
+
|
|
116
|
+
1. Terminal prints project path, seed, hops/max-nodes, and a topology table (critical / hub nodes).
|
|
117
|
+
2. OntoSight opens in the browser with the call subgraph, critical-node highlights, and a CodeGraph query panel for live reloads.
|
|
118
|
+
3. Process stays running until the user closes the server (Ctrl+C in terminal).
|
|
119
|
+
|
|
120
|
+
## Troubleshooting
|
|
121
|
+
|
|
122
|
+
| Issue | Action |
|
|
123
|
+
|-------|--------|
|
|
124
|
+
| `CodeGraph index not found` | Run `npx @colbymchenry/codegraph init -i` or remove `ONTOSIGHT_SKIP_AUTO_INIT` |
|
|
125
|
+
| `Neither uv nor pipx found` | Install uv: `curl -LsSf https://astral.sh/uv/install.sh \| sh` |
|
|
126
|
+
| Subgraph truncated warning | Add `--symbol`, `--task`, or `--path`; lower scope before raising `--max-nodes` |
|
|
127
|
+
| Stale symbols after edits | Wait ~2s for CodeGraph watcher sync, or re-run init |
|
|
128
|
+
| Agent needs facts, not UI | Use `codegraph_*` MCP tools instead |
|
|
129
|
+
|
|
130
|
+
Upstream: [@royalsolution/ontosight](https://www.npmjs.com/package/@royalsolution/ontosight)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Impact analysis demonstration — UX playbook
|
|
2
|
+
|
|
3
|
+
Use this playbook when presenting **CodeGraph impact analysis** with an **OntoSight** graph demo. It extends the [ui-ux-pro-max SKILL](SKILL.md) for a specific agent workflow — not a full design-system pass.
|
|
4
|
+
|
|
5
|
+
**Skill path by tool:** `.agents/skills/ui-ux-pro-max/`, `.agents/skills/ui-ux-pro-max/`, `.agents/skills/ui-ux-pro-max/`, `.agents/skills/ui-ux-pro-max/`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
User asks about blast radius, what breaks, downstream impact, or wants to **see** / **show** / **demonstrate** impact before a refactor, rename, or delete.
|
|
12
|
+
|
|
13
|
+
Pair with **`.agent/rules/ontosight.md`** (or synced `ontosight` rule in your tool tree).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## ui-ux-pro-max searches (optional, recommended)
|
|
18
|
+
|
|
19
|
+
Run from project root. Adjust the skills path to match your tool.
|
|
20
|
+
|
|
21
|
+
### Network graph UX
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
python3 .agents/skills/ui-ux-pro-max/scripts/search.py "relationship connection network graph" --domain chart
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Use for: drilldown + hover expectations; provide an adjacency-list or ranked table alternative (network graphs are poor for screen-reader-only users).
|
|
28
|
+
|
|
29
|
+
### Impact tier framing
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
python3 .agents/skills/ui-ux-pro-max/scripts/search.py "root cause decomposition hierarchy drill-down" --domain chart
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Use for: grouping impact into tiers (direct callers vs transitive) in chat before opening the graph.
|
|
36
|
+
|
|
37
|
+
### Progressive disclosure
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
python3 .agents/skills/ui-ux-pro-max/scripts/search.py "progressive disclosure loading feedback" --domain ux
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Use for: summary-before-graph; tell the user what OntoSight is loading and what they will see.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Chat summary template
|
|
48
|
+
|
|
49
|
+
Present this **before** running `npx @royalsolution/ontosight@0.2.0`:
|
|
50
|
+
|
|
51
|
+
### 1. Seed
|
|
52
|
+
|
|
53
|
+
- Symbol name, kind (function, class, …), file path
|
|
54
|
+
|
|
55
|
+
### 2. Blast radius
|
|
56
|
+
|
|
57
|
+
Top 5–10 from `codegraph_impact`, in a **ranked table**:
|
|
58
|
+
|
|
59
|
+
| Rank | Symbol | File | Relationship |
|
|
60
|
+
|------|--------|------|--------------|
|
|
61
|
+
| 1 | … | … | direct caller |
|
|
62
|
+
| 2 | … | … | transitive |
|
|
63
|
+
|
|
64
|
+
Group by risk: **direct callers** (highest) vs **transitive** (lower).
|
|
65
|
+
|
|
66
|
+
### 3. What the graph shows
|
|
67
|
+
|
|
68
|
+
- Seed node and `--hops` depth (typically 3 for impact demos)
|
|
69
|
+
- Note that OntoSight highlights critical / hub nodes in the topology table
|
|
70
|
+
- Mention interactive pan, zoom, and live CodeGraph re-query in the browser
|
|
71
|
+
|
|
72
|
+
### 4. Action
|
|
73
|
+
|
|
74
|
+
Short line: *"Opening interactive impact graph…"* then run:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir-from-search> --hops 3 --max-nodes 200
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Accessibility notes
|
|
83
|
+
|
|
84
|
+
- **Always** include the ranked table — graph-only answers fail accessibility guidance for network visualizations.
|
|
85
|
+
- Keep table columns sortable by impact rank when possible in prose.
|
|
86
|
+
- If subgraph truncates, say so and offer a narrower `--path` before raising `--max-nodes`.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Full agent workflow
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
1. codegraph_search({ query: "<symbol>" })
|
|
94
|
+
2. codegraph_impact({ query: "<symbol>" })
|
|
95
|
+
3. Read this file (IMPACT-DEMO.md)
|
|
96
|
+
4. Optional: ui-ux-pro-max chart/ux searches above
|
|
97
|
+
5. Chat summary (template sections 1–3)
|
|
98
|
+
6. npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
See **`.agents/references/ontosight.md`** for flags and troubleshooting.
|
package/.claude/CLAUDE.md
CHANGED
|
@@ -97,6 +97,7 @@ All rules in `.claude/rules/` are **mandatory** and must be followed:
|
|
|
97
97
|
| `git-workflow.md` | Branching strategy, conventional commits |
|
|
98
98
|
| `agent-continuity.md` | Session handoff via `.agent/SESSION.md` |
|
|
99
99
|
| `codegraph.md` | CodeGraph MCP usage; when to use `codegraph_*` tools |
|
|
100
|
+
| `ontosight.md` | OntoSight CLI for visual call graphs |
|
|
100
101
|
|
|
101
102
|
---
|
|
102
103
|
|
|
@@ -121,6 +122,20 @@ Then in each project: `codegraph init -i` (class-ai-agent may run this on instal
|
|
|
121
122
|
|
|
122
123
|
---
|
|
123
124
|
|
|
125
|
+
## Code visualization (OntoSight)
|
|
126
|
+
|
|
127
|
+
This project includes **[OntoSight](https://www.npmjs.com/package/@royalsolution/ontosight)** for interactive CodeGraph call subgraphs in the browser.
|
|
128
|
+
|
|
129
|
+
| Item | Location |
|
|
130
|
+
|------|----------|
|
|
131
|
+
| Usage rules | `.claude/rules/ontosight.md` |
|
|
132
|
+
| Setup reference | `.claude/references/ontosight.md` |
|
|
133
|
+
| Shared index | `.codegraph/` (same as CodeGraph) |
|
|
134
|
+
|
|
135
|
+
Use `codegraph_*` MCP tools to gather structural facts in chat; run `npx @royalsolution/ontosight@0.2.0 .` when the user wants a visual call graph. For **impact analysis demos**, follow `skills/ui-ux-pro-max/IMPACT-DEMO.md` (search → `codegraph_impact` → summary → graph). Requires Node 20+, Python 3.11+, and uv or pipx.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
124
139
|
## Available Agents
|
|
125
140
|
|
|
126
141
|
Invoke the right agent for each task type:
|
|
@@ -178,6 +193,7 @@ Quick references in `.claude/references/`:
|
|
|
178
193
|
| `performance-checklist.md` | Core Web Vitals, optimization |
|
|
179
194
|
| `accessibility-checklist.md` | WCAG 2.1 AA compliance |
|
|
180
195
|
| `codegraph.md` | CodeGraph install (Claude Code) and Cursor MCP notes |
|
|
196
|
+
| `ontosight.md` | OntoSight CLI for visual call graphs |
|
|
181
197
|
| `agent-continuity.md` | Session handoff and `/resume` / `/handoff` |
|
|
182
198
|
| `supabase.md` | Supabase skills, MCP OAuth, secrets |
|
|
183
199
|
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# OntoSight reference
|
|
2
|
+
|
|
3
|
+
[OntoSight](https://www.npmjs.com/package/@royalsolution/ontosight) visualizes [CodeGraph](https://github.com/colbymchenry/codegraph) call subgraphs in an interactive browser UI. **class-ai-agent** installs usage rules across all four agent trees; invocation is via `npx` (no npm dependency).
|
|
4
|
+
|
|
5
|
+
**Recommended version:** `@royalsolution/ontosight@0.2.0` (pins PyPI `ontosight-codegraph` 0.2.0). Use unpinned `npx @royalsolution/ontosight@0.2.0` only when the user explicitly wants latest.
|
|
6
|
+
|
|
7
|
+
OntoSight complements CodeGraph MCP — use `codegraph_*` for structural facts in chat; use OntoSight when the user wants visual exploration. See also [`.cursor/references/codegraph.md`](codegraph.md).
|
|
8
|
+
|
|
9
|
+
## Per-tool wiring
|
|
10
|
+
|
|
11
|
+
| Tool | Rules | Reference |
|
|
12
|
+
|------|-------|-----------|
|
|
13
|
+
| Cursor | `.cursor/rules/ontosight.mdc` | `.cursor/references/ontosight.md` |
|
|
14
|
+
| Claude Code | `.claude/rules/ontosight.md` | `.claude/references/ontosight.md` |
|
|
15
|
+
| Kiro | `.kiro/steering/ontosight.md` | `.kiro/references/ontosight.md` |
|
|
16
|
+
| Antigravity | `.agent/rules/ontosight.md` | `.agents/references/ontosight.md` |
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Full project — seeds from highest fan-in symbols
|
|
22
|
+
npx @royalsolution/ontosight@0.2.0 .
|
|
23
|
+
|
|
24
|
+
# Seed around a symbol (optionally scoped to a path)
|
|
25
|
+
npx @royalsolution/ontosight@0.2.0 . --symbol view_graph --path src/auth/
|
|
26
|
+
|
|
27
|
+
# Task-scoped subgraph (keyword FTS seeding)
|
|
28
|
+
npx @royalsolution/ontosight@0.2.0 . --task "auth flow" --hops 2 --max-nodes 200
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unless `ONTOSIGHT_SKIP_AUTO_INIT=1`).
|
|
32
|
+
|
|
33
|
+
## Flags
|
|
34
|
+
|
|
35
|
+
| Flag | Description | Default |
|
|
36
|
+
|------|-------------|---------|
|
|
37
|
+
| `[project-path]` | Project root containing `.codegraph/` | `.` (cwd) |
|
|
38
|
+
| `--path <dir>` | Limit symbols to files under this path | — |
|
|
39
|
+
| `--symbol <name>` | Seed symbol for BFS subgraph expansion | auto (fan-in) |
|
|
40
|
+
| `--task <text>` | Natural-language seed (keyword match) | — |
|
|
41
|
+
| `--hops <n>` | BFS hop depth | `2` |
|
|
42
|
+
| `--max-nodes <n>` | Cap subgraph size | `200` |
|
|
43
|
+
|
|
44
|
+
`--symbol` and `--task` are mutually exclusive seeds; `--path` narrows either.
|
|
45
|
+
|
|
46
|
+
## Suggested agent workflows
|
|
47
|
+
|
|
48
|
+
### Symbol the user named
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
1. codegraph_search({ query: "view_graph" }) → confirm file + kind
|
|
52
|
+
2. Tell user what you found
|
|
53
|
+
3. npx @royalsolution/ontosight@0.2.0 . --symbol view_graph --path <dir-from-search>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Feature area ("how does auth work?")
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
1. codegraph_context({ task: "authentication flow", maxNodes: 20 })
|
|
60
|
+
2. Summarize key symbols in chat
|
|
61
|
+
3. npx @royalsolution/ontosight@0.2.0 . --task "authentication flow" --hops 2 --max-nodes 200
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Impact analysis demonstration
|
|
65
|
+
|
|
66
|
+
When the user wants to **know** or **see** impact (blast radius, what breaks, downstream callers):
|
|
67
|
+
|
|
68
|
+
**Triggers:** "impact", "blast radius", "what breaks", "what would break", "downstream", "affected by", "show impact", "demonstrate impact", "visualize impact"; or user is about to refactor/rename/delete a symbol.
|
|
69
|
+
|
|
70
|
+
**Workflow:**
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
1. codegraph_search({ query: "<symbol>" }) → confirm file + kind
|
|
74
|
+
2. codegraph_impact({ query: "<symbol>" }) → ranked blast radius
|
|
75
|
+
3. Read skills/ui-ux-pro-max/IMPACT-DEMO.md → UX presentation checklist
|
|
76
|
+
4. Optional: ui-ux-pro-max chart/ux searches (see playbook)
|
|
77
|
+
5. Summarize in chat (seed, ranked table, what graph shows)
|
|
78
|
+
6. npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Example:**
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npx @royalsolution/ontosight@0.2.0 . --symbol deleteUser --path src/services/ --hops 3 --max-nodes 200
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**UX:** Always text summary before opening the browser; include a ranked table of top impacted symbols (accessible alternative to graph-only). See [IMPACT-DEMO.md](../skills/ui-ux-pro-max/IMPACT-DEMO.md).
|
|
88
|
+
|
|
89
|
+
**Truncated subgraph:** narrow `--path` or lower `--hops` before raising `--max-nodes`.
|
|
90
|
+
|
|
91
|
+
### Index missing
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npx @colbymchenry/codegraph init -i
|
|
95
|
+
# or let the OntoSight wrapper auto-init (default)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Environment variables
|
|
99
|
+
|
|
100
|
+
| Variable | Effect |
|
|
101
|
+
|----------|--------|
|
|
102
|
+
| `ONTOSIGHT_SKIP_AUTO_INIT=1` | Fail if `.codegraph/codegraph.db` missing instead of running init |
|
|
103
|
+
| `ONTOSIGHT_CODEGRAPH_VERSION` | Pin PyPI `ontosight-codegraph` version |
|
|
104
|
+
|
|
105
|
+
## Requirements
|
|
106
|
+
|
|
107
|
+
| Requirement | Notes |
|
|
108
|
+
|-------------|-------|
|
|
109
|
+
| Node 20+ | For `npx @royalsolution/ontosight@0.2.0` |
|
|
110
|
+
| Python 3.11+ | Used by `ontosight-codegraph` |
|
|
111
|
+
| uv (recommended) or pipx | Wrapper tries `uvx` first, then `pipx run` |
|
|
112
|
+
| CodeGraph index | `.codegraph/codegraph.db` in project root |
|
|
113
|
+
|
|
114
|
+
## What the user sees
|
|
115
|
+
|
|
116
|
+
1. Terminal prints project path, seed, hops/max-nodes, and a topology table (critical / hub nodes).
|
|
117
|
+
2. OntoSight opens in the browser with the call subgraph, critical-node highlights, and a CodeGraph query panel for live reloads.
|
|
118
|
+
3. Process stays running until the user closes the server (Ctrl+C in terminal).
|
|
119
|
+
|
|
120
|
+
## Troubleshooting
|
|
121
|
+
|
|
122
|
+
| Issue | Action |
|
|
123
|
+
|-------|--------|
|
|
124
|
+
| `CodeGraph index not found` | Run `npx @colbymchenry/codegraph init -i` or remove `ONTOSIGHT_SKIP_AUTO_INIT` |
|
|
125
|
+
| `Neither uv nor pipx found` | Install uv: `curl -LsSf https://astral.sh/uv/install.sh \| sh` |
|
|
126
|
+
| Subgraph truncated warning | Add `--symbol`, `--task`, or `--path`; lower scope before raising `--max-nodes` |
|
|
127
|
+
| Stale symbols after edits | Wait ~2s for CodeGraph watcher sync, or re-run init |
|
|
128
|
+
| Agent needs facts, not UI | Use `codegraph_*` MCP tools instead |
|
|
129
|
+
|
|
130
|
+
Upstream: [@royalsolution/ontosight](https://www.npmjs.com/package/@royalsolution/ontosight)
|
|
@@ -19,6 +19,14 @@ Use codegraph for **structural** questions — what calls what, what would break
|
|
|
19
19
|
| "See several related symbols' source at once" | `codegraph_explore` |
|
|
20
20
|
| "What files exist under path/" | `codegraph_files` |
|
|
21
21
|
| "Is the index healthy?" | `codegraph_status` |
|
|
22
|
+
| Visual exploration of a subgraph in browser | `npx @royalsolution/ontosight@0.2.0` (see **`.claude/rules/ontosight.md`**) |
|
|
23
|
+
| "Show/demonstrate impact of changing Z" | `codegraph_impact` → then OntoSight `--symbol Z` (see **`.claude/rules/ontosight.md`**) |
|
|
24
|
+
|
|
25
|
+
### Visualization
|
|
26
|
+
|
|
27
|
+
For interactive call-graph UI (user asks to "show the graph" or explore architecture visually), use **OntoSight CLI** after gathering context with `codegraph_*` tools. See **`.claude/rules/ontosight.md`**.
|
|
28
|
+
|
|
29
|
+
For **impact demonstration** requests ("show impact", "blast radius", "what breaks if I change X"), run `codegraph_impact` first, present a text summary, then open OntoSight — never stop at MCP text alone when the user wants to see or show impact.
|
|
22
30
|
|
|
23
31
|
### Tool parameters (do not mix)
|
|
24
32
|
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
|
|
2
|
+
## OntoSight
|
|
3
|
+
|
|
4
|
+
[OntoSight](https://www.npmjs.com/package/@royalsolution/ontosight) visualizes CodeGraph call subgraphs in an interactive browser UI. It is **not** an MCP server — there are no `ontosight_*` tools. Use **CodeGraph MCP** (`codegraph_*`) to answer structural questions in chat; use **OntoSight CLI** when the user wants a visual, interactive call graph.
|
|
5
|
+
|
|
6
|
+
See **`.claude/rules/codegraph.md`** for MCP usage and **`.claude/references/ontosight.md`** for full flags and troubleshooting.
|
|
7
|
+
|
|
8
|
+
### CodeGraph MCP vs OntoSight
|
|
9
|
+
|
|
10
|
+
| Goal | Use |
|
|
11
|
+
|------|-----|
|
|
12
|
+
| Find symbols, callers, traces, impact (text in chat) | `codegraph_*` MCP tools |
|
|
13
|
+
| Visual exploration of a subgraph | `npx @royalsolution/ontosight@0.2.0` |
|
|
14
|
+
| User says "show me the graph" | OntoSight CLI |
|
|
15
|
+
| Impact / blast radius demonstration | `codegraph_impact` → summary → OntoSight CLI |
|
|
16
|
+
|
|
17
|
+
Rule of thumb: gather facts with CodeGraph MCP; open OntoSight when visualization helps the human explore complexity you already identified.
|
|
18
|
+
|
|
19
|
+
### When to run OntoSight
|
|
20
|
+
|
|
21
|
+
Run (or suggest) OntoSight when the user:
|
|
22
|
+
|
|
23
|
+
- Asks to visualize, show, or explore a call graph or architecture
|
|
24
|
+
- Wants an interactive view after you surfaced symbols via `codegraph_search` / `codegraph_context`
|
|
25
|
+
- Is doing onboarding or architecture review and benefits from a graph UI
|
|
26
|
+
- Asks about **impact**, **blast radius**, or **what breaks** and wants to see or demonstrate scope (refactor, rename, delete)
|
|
27
|
+
|
|
28
|
+
Do **not** run OntoSight to collect agent context — that duplicates CodeGraph MCP and blocks the terminal while the browser is open.
|
|
29
|
+
|
|
30
|
+
### Impact analysis demonstration
|
|
31
|
+
|
|
32
|
+
**Triggers** — open the graph, not only text:
|
|
33
|
+
|
|
34
|
+
- "impact", "blast radius", "what breaks", "what would break", "downstream", "affected by"
|
|
35
|
+
- "show impact", "demonstrate impact", "visualize impact"
|
|
36
|
+
- User is about to refactor, rename, or delete a symbol and wants to see scope
|
|
37
|
+
|
|
38
|
+
**Workflow** (mandatory order):
|
|
39
|
+
|
|
40
|
+
1. `codegraph_search({ query: "<symbol>" })` — confirm name, file, kind
|
|
41
|
+
2. `codegraph_impact({ query: "<symbol>" })` — ranked blast radius (chat facts)
|
|
42
|
+
3. Read **`.claude/skills/ui-ux-pro-max/IMPACT-DEMO.md`** — presentation checklist (use your tool's skills path: `.claude/skills/`, `.kiro/skills/`, `.agents/skills/`)
|
|
43
|
+
4. Optional: run ui-ux-pro-max searches from the playbook for chart/UX framing
|
|
44
|
+
5. Summarize in chat: seed symbol, top impacted callers, risk tier, what the graph will highlight
|
|
45
|
+
6. `npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200`
|
|
46
|
+
|
|
47
|
+
**Hop guidance:** use `--hops 3` (or `4` for deep trees) for impact demos; prefer `--path` over raising `--max-nodes` when truncated.
|
|
48
|
+
|
|
49
|
+
**UX rule:** always give a **text summary before** opening the browser (progressive disclosure); include a **ranked table** of top impacted symbols as an accessible alternative to the graph alone.
|
|
50
|
+
|
|
51
|
+
### Suggested workflows
|
|
52
|
+
|
|
53
|
+
**Symbol the user named:**
|
|
54
|
+
|
|
55
|
+
1. `codegraph_search({ query: "<name>" })` → confirm file + kind
|
|
56
|
+
2. Summarize in chat
|
|
57
|
+
3. `npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir-from-search>`
|
|
58
|
+
|
|
59
|
+
**Feature area ("how does auth work?"):**
|
|
60
|
+
|
|
61
|
+
1. `codegraph_context({ task: "authentication flow", maxNodes: 20 })`
|
|
62
|
+
2. Summarize key symbols in chat
|
|
63
|
+
3. `npx @royalsolution/ontosight@0.2.0 . --task "authentication flow" --hops 2 --max-nodes 200`
|
|
64
|
+
|
|
65
|
+
**Large repo:** prefer `--path` or `--symbol` before raising `--max-nodes`.
|
|
66
|
+
|
|
67
|
+
### Commands
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npx @royalsolution/ontosight@0.2.0 .
|
|
71
|
+
npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir>
|
|
72
|
+
npx @royalsolution/ontosight@0.2.0 . --task "auth flow" --hops 2 --max-nodes 200
|
|
73
|
+
npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unless `ONTOSIGHT_SKIP_AUTO_INIT=1`). Ask the user before auto-init on very large repos.
|
|
77
|
+
|
|
78
|
+
### Prerequisites
|
|
79
|
+
|
|
80
|
+
| Requirement | Notes |
|
|
81
|
+
|-------------|-------|
|
|
82
|
+
| Node 20+ | For `npx @royalsolution/ontosight@0.2.0` |
|
|
83
|
+
| Python 3.11+ | Used by `ontosight-codegraph` |
|
|
84
|
+
| uv (recommended) or pipx | Wrapper tries `uvx` first, then `pipx run` |
|
|
85
|
+
| CodeGraph index | `.codegraph/codegraph.db` in project root |
|