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.
@@ -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:** `.cursor/skills/ui-ux-pro-max/`, `.claude/skills/ui-ux-pro-max/`, `.kiro/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 **`.cursor/rules/ontosight.mdc`** (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 .cursor/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 .cursor/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 .cursor/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 **`.cursor/references/ontosight.md`** for flags and troubleshooting.
package/.cursor/CURSOR.md CHANGED
@@ -60,6 +60,7 @@ Project rules are **`.cursor/rules/*.mdc`**. They use YAML frontmatter:
60
60
  | Data & naming | `naming-conventions`, `database` |
61
61
  | Ops & quality | `security`, `monitoring`, `testing`, `git-workflow`, `system-design` |
62
62
  | Code intelligence | `codegraph` (MCP usage; see below) |
63
+ | Code visualization | `ontosight` (CLI; see below) |
63
64
 
64
65
  ---
65
66
 
@@ -80,6 +81,20 @@ If the index is missing, run `npx @colbymchenry/codegraph init -i` in the projec
80
81
 
81
82
  ---
82
83
 
84
+ ## Code visualization (OntoSight)
85
+
86
+ This project includes **[OntoSight](https://www.npmjs.com/package/@royalsolution/ontosight)** for interactive CodeGraph call subgraphs in the browser.
87
+
88
+ | Item | Location |
89
+ |------|----------|
90
+ | Usage rules | `.cursor/rules/ontosight.mdc` |
91
+ | Setup reference | `.cursor/references/ontosight.md` |
92
+ | Shared index | `.codegraph/` (same as CodeGraph) |
93
+
94
+ 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.
95
+
96
+ ---
97
+
83
98
  ## Agent personas
84
99
 
85
100
  Instructions live in **`.cursor/agents/`**. Invoke by **@ mentioning** the file (e.g. `@.cursor/agents/backend.md`).
@@ -120,6 +135,7 @@ Reusable playbooks: **`.cursor/skills/*/SKILL.md`** (and related `.md` files whe
120
135
  | `performance-checklist.md` | Performance |
121
136
  | `accessibility-checklist.md` | WCAG-oriented checks |
122
137
  | `codegraph.md` | CodeGraph install and Claude Code setup |
138
+ | `ontosight.md` | OntoSight CLI for visual call graphs |
123
139
  | `agent-continuity.md` | Session handoff and `/resume` / `/handoff` |
124
140
  | `supabase.md` | Supabase skills, MCP OAuth, secrets |
125
141
 
@@ -84,4 +84,8 @@ Example — correct:
84
84
  | Stale symbols after edit | Wait ~2s for watcher sync, or check staleness banner in tool output |
85
85
  | Init failed during install | Run `npx @colbymchenry/codegraph init -i` manually |
86
86
 
87
+ ## Visualization (OntoSight)
88
+
89
+ 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).
90
+
87
91
  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)
@@ -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 **`.cursor/rules/ontosight.mdc`**) |
27
+ | "Show/demonstrate impact of changing Z" | `codegraph_impact` → then OntoSight `--symbol Z` (see **`.cursor/rules/ontosight.mdc`**) |
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 **`.cursor/rules/ontosight.mdc`**.
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
 
@@ -28,6 +28,7 @@ Supporting prompts: `debug`, `simplify`, `fix-issue`, `handoff`, `resume` in `.c
28
28
  - Prefer **tests first** and **small vertical slices** (see `.cursor/skills/incremental-implementation/`).
29
29
  - Use **`.cursor/references/`** for checklists (security, testing, performance, accessibility).
30
30
  - For **structural** code questions (symbols, callers, callees, traces, impact), prefer **CodeGraph** MCP tools (`codegraph_*`) per **`.cursor/rules/codegraph.mdc`** instead of grep/read exploration loops.
31
+ - When the user wants a **visual call graph**, use **OntoSight CLI** per **`.cursor/rules/ontosight.mdc`** (`npx @royalsolution/ontosight@0.2.0`).
31
32
 
32
33
  ## Agents (personas)
33
34
 
@@ -0,0 +1,89 @@
1
+ ---
2
+ description: OntoSight CLI — visualize CodeGraph call subgraphs in the browser
3
+ alwaysApply: true
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 **`.cursor/rules/codegraph.mdc`** for MCP usage and **`.cursor/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 **`.cursor/skills/ui-ux-pro-max/IMPACT-DEMO.md`** — presentation checklist (use your tool's skills path: `.claude/skills/`, `.kiro/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 |
@@ -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:** `.cursor/skills/ui-ux-pro-max/`, `.claude/skills/ui-ux-pro-max/`, `.kiro/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 **`.cursor/rules/ontosight.mdc`** (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 .cursor/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 .cursor/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 .cursor/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 **`.cursor/references/ontosight.md`** for flags and troubleshooting.
package/.kiro/KIRO.md CHANGED
@@ -50,7 +50,7 @@ Follow this workflow for feature development:
50
50
 
51
51
  Project standards are **`.kiro/steering/*.md`**. They use YAML frontmatter:
52
52
 
53
- - **`inclusion: always`** — Loaded every session (`kiro-overview.md`, `security.md`, `codegraph.md`, `agent-continuity.md`)
53
+ - **`inclusion: always`** — Loaded every session (`kiro-overview.md`, `security.md`, `codegraph.md`, `ontosight.md`, `agent-continuity.md`)
54
54
  - **`inclusion: fileMatch`** — Loaded when edited files match `fileMatchPattern`
55
55
  - **`inclusion: manual`** — Reference with `#filename` in chat or `/` slash commands
56
56
 
@@ -61,6 +61,7 @@ Project standards are **`.kiro/steering/*.md`**. They use YAML frontmatter:
61
61
  | Data & naming | `naming-conventions`, `database` |
62
62
  | Ops & quality | `security`, `monitoring`, `testing`, `git-workflow`, `system-design` |
63
63
  | Code intelligence | `codegraph` (MCP usage; see below) |
64
+ | Code visualization | `ontosight` (CLI; see below) |
64
65
  | Agent continuity | `agent-continuity` (`.agent/SESSION.md` handoff) |
65
66
 
66
67
  ---
@@ -88,6 +89,20 @@ If the index is missing, run `npx @colbymchenry/codegraph init -i` in the projec
88
89
 
89
90
  ---
90
91
 
92
+ ## Code visualization (OntoSight)
93
+
94
+ This project includes **[OntoSight](https://www.npmjs.com/package/@royalsolution/ontosight)** for interactive CodeGraph call subgraphs in the browser.
95
+
96
+ | Item | Location |
97
+ |------|----------|
98
+ | Usage rules | `.kiro/steering/ontosight.md` |
99
+ | Setup reference | `.kiro/references/ontosight.md` |
100
+ | Shared index | `.codegraph/` (same as CodeGraph) |
101
+
102
+ 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.
103
+
104
+ ---
105
+
91
106
  ## Agent personas
92
107
 
93
108
  Instructions live in **`.kiro/agents/`**. Invoke by **referencing** the file (e.g. `@.kiro/agents/backend.md`).
@@ -83,4 +83,8 @@ Example — correct:
83
83
  | Stale symbols after edit | Wait ~2s for watcher sync, or check staleness banner in tool output |
84
84
  | Init failed during install | Run `npx @colbymchenry/codegraph init -i` manually |
85
85
 
86
+ ## Visualization (OntoSight)
87
+
88
+ 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).
89
+
86
90
  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)