archgraph 0.1.0
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/LICENSE +21 -0
- package/README.md +123 -0
- package/bin/bgx.js +2 -0
- package/docs/examples/executors.example.json +15 -0
- package/docs/examples/view-spec.yaml +6 -0
- package/docs/release.md +15 -0
- package/docs/view-spec.md +28 -0
- package/integrations/README.md +20 -0
- package/integrations/claude/.claude/skills/backend-graphing/SKILL.md +56 -0
- package/integrations/claude/.claude/skills/backend-graphing-describe/SKILL.md +50 -0
- package/integrations/claude/.claude-plugin/marketplace.json +18 -0
- package/integrations/claude/.claude-plugin/plugin.json +9 -0
- package/integrations/claude/skills/backend-graphing/SKILL.md +56 -0
- package/integrations/claude/skills/backend-graphing-describe/SKILL.md +50 -0
- package/integrations/codex/skills/backend-graphing/SKILL.md +56 -0
- package/integrations/codex/skills/backend-graphing-describe/SKILL.md +50 -0
- package/package.json +49 -0
- package/packages/cli/src/index.js +415 -0
- package/packages/core/src/analyze-project.js +1238 -0
- package/packages/core/src/export.js +77 -0
- package/packages/core/src/index.js +4 -0
- package/packages/core/src/types.js +37 -0
- package/packages/core/src/view.js +86 -0
- package/packages/viewer/public/app.js +226 -0
- package/packages/viewer/public/canvas.js +181 -0
- package/packages/viewer/public/comments.js +193 -0
- package/packages/viewer/public/index.html +95 -0
- package/packages/viewer/public/layout.js +72 -0
- package/packages/viewer/public/minimap.js +92 -0
- package/packages/viewer/public/render.js +366 -0
- package/packages/viewer/public/sidebar.js +107 -0
- package/packages/viewer/public/styles.css +728 -0
- package/packages/viewer/public/theme.js +19 -0
- package/packages/viewer/public/tooltip.js +44 -0
- package/packages/viewer/src/index.js +590 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sangsoo Lee
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# backend-graphing
|
|
2
|
+
|
|
3
|
+
Backend/frontend code graphing workspace for endpoint-oriented architecture visualization.
|
|
4
|
+
|
|
5
|
+
## Packages
|
|
6
|
+
- `@backend-graphing/core`: static analyzer, graph model, view builder, exporters
|
|
7
|
+
- `@backend-graphing/cli`: `bgx` command for analyze/export/view/describe/install
|
|
8
|
+
- `@backend-graphing/viewer`: local interactive viewer server + DAG client with code drilldown and task queue
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
```bash
|
|
12
|
+
# install globally from local repo
|
|
13
|
+
npm install -g /Users/sangsoolee/GitHub/backend-graphing
|
|
14
|
+
|
|
15
|
+
# analyze a backend repo
|
|
16
|
+
node packages/cli/src/index.js analyze \
|
|
17
|
+
--project /Users/sangsoolee/GitHub/scout-manager-backend \
|
|
18
|
+
--out scout-manager-backend.graph.json
|
|
19
|
+
|
|
20
|
+
# export to cypher
|
|
21
|
+
node packages/cli/src/index.js export \
|
|
22
|
+
--graph scout-manager-backend.graph.json \
|
|
23
|
+
--format cypher \
|
|
24
|
+
--out scout-manager-backend.cypher
|
|
25
|
+
|
|
26
|
+
# generate a filtered view file
|
|
27
|
+
node packages/cli/src/index.js view \
|
|
28
|
+
--graph scout-manager-backend.graph.json \
|
|
29
|
+
--spec docs/examples/view-spec.yaml \
|
|
30
|
+
--out scout-manager-backend.view.json
|
|
31
|
+
|
|
32
|
+
# launch local viewer
|
|
33
|
+
node packages/cli/src/index.js view \
|
|
34
|
+
--graph scout-manager-backend.graph.json \
|
|
35
|
+
--serve \
|
|
36
|
+
--port 4310
|
|
37
|
+
|
|
38
|
+
# generate structured bilingual descriptions
|
|
39
|
+
node packages/cli/src/index.js describe \
|
|
40
|
+
--graph scout-manager-backend.graph.json \
|
|
41
|
+
--out scout-manager-backend.descriptions.json \
|
|
42
|
+
--executor codex \
|
|
43
|
+
--language bilingual \
|
|
44
|
+
--detail structured
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
After global install, use:
|
|
48
|
+
```bash
|
|
49
|
+
bgx --help
|
|
50
|
+
bgx analyze --project /absolute/path/to/project --out graph.json
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Install as Codex Skill / Claude Plugin
|
|
54
|
+
|
|
55
|
+
Global install:
|
|
56
|
+
```bash
|
|
57
|
+
npm install -g /Users/sangsoolee/GitHub/backend-graphing
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Automatic import into local assistant folders:
|
|
61
|
+
```bash
|
|
62
|
+
# install both
|
|
63
|
+
bgx install --target all
|
|
64
|
+
|
|
65
|
+
# codex only
|
|
66
|
+
bgx install --target codex
|
|
67
|
+
|
|
68
|
+
# claude only
|
|
69
|
+
bgx install --target claude
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Custom home paths:
|
|
73
|
+
```bash
|
|
74
|
+
bgx install --target all --codex-home /path/to/.codex --claude-home /path/to/.claude
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Dry-run preview:
|
|
78
|
+
```bash
|
|
79
|
+
bgx install --target all --dry-run
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Canonical Graph Format
|
|
83
|
+
`GraphBundle { schemaVersion, createdAt, project, strings[], nodes[], edges[], groups[], indexes }`
|
|
84
|
+
|
|
85
|
+
Node kinds:
|
|
86
|
+
- `endpoint`, `route_handler`, `function`, `method`, `class`, `object`, `agent`, `langgraph_node`, `mcp_tool`, `module`, `file`, `ui_route`, `ui_component`, `group`, `condition`
|
|
87
|
+
|
|
88
|
+
Edge kinds:
|
|
89
|
+
- `declares_endpoint`, `handles`, `calls`, `imports`, `invokes_agent`, `uses_mcp_tool`, `langgraph_edge`, `belongs_to_group`, `ui_calls_api`, `frontend_proxies_to_backend`, `evaluates_condition`, `condition_true`, `condition_false`, `condition_case`
|
|
90
|
+
|
|
91
|
+
## Current Extraction Coverage
|
|
92
|
+
- Express route extraction from `app/router.METHOD` with mounted prefix propagation.
|
|
93
|
+
- Handler linkage from endpoint to route handlers and function symbols.
|
|
94
|
+
- Transitive call graph extraction using TypeScript AST (with local TypeScript module fallback).
|
|
95
|
+
- Conditional flow extraction for `if`/`switch`/ternary branches into explicit condition nodes.
|
|
96
|
+
- LangGraph extraction from `.addNode/.addEdge/.addConditionalEdges` chains.
|
|
97
|
+
- MCP extraction from `*_TOOLS` arrays and `callTool("...")` usage.
|
|
98
|
+
- Grouping by endpoint + secondary overlays by agent/purpose.
|
|
99
|
+
|
|
100
|
+
## Viewer Capabilities (V2)
|
|
101
|
+
- Endpoint-first directed graph rendering (logical DAG) with conditional edge styling.
|
|
102
|
+
- Grouping by `endpoint`, `agent`, or `purpose` with item selector and search.
|
|
103
|
+
- Node click opens code snippet and related 1-hop context.
|
|
104
|
+
- Sidepanel comment/task queue with status lifecycle and approval-gated execution.
|
|
105
|
+
- Optional descriptions panel source from `bgx describe` artifact.
|
|
106
|
+
|
|
107
|
+
Executor config template:
|
|
108
|
+
- `docs/examples/executors.example.json` -> copy to `<target-repo>/.bgx/executors.json`
|
|
109
|
+
|
|
110
|
+
## Tests
|
|
111
|
+
```bash
|
|
112
|
+
npm test
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Test suites include:
|
|
116
|
+
- extractor unit tests
|
|
117
|
+
- view and export tests
|
|
118
|
+
- integration checks against `/Users/sangsoolee/GitHub/scout-manager-backend`
|
|
119
|
+
- CLI integration tests
|
|
120
|
+
- viewer asset contract tests
|
|
121
|
+
|
|
122
|
+
## PRD
|
|
123
|
+
- `.omx/plans/prd-backend-graphing-engine.md`
|
package/bin/bgx.js
ADDED
package/docs/release.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Release Notes (Initial)
|
|
2
|
+
|
|
3
|
+
## Publish Strategy
|
|
4
|
+
1. Build distributable artifacts:
|
|
5
|
+
- `npm run build`
|
|
6
|
+
2. Verify tests:
|
|
7
|
+
- `npm test`
|
|
8
|
+
3. Publish packages in dependency order:
|
|
9
|
+
- `@backend-graphing/core`
|
|
10
|
+
- `@backend-graphing/viewer`
|
|
11
|
+
- `@backend-graphing/cli`
|
|
12
|
+
|
|
13
|
+
## Versioning
|
|
14
|
+
- Follow semver.
|
|
15
|
+
- Keep `schemaVersion` updates explicit when graph model changes.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# View Spec
|
|
2
|
+
|
|
3
|
+
`bgx view --spec <file>` accepts JSON or simple YAML.
|
|
4
|
+
|
|
5
|
+
Supported fields:
|
|
6
|
+
- `version`: required (`"1"`)
|
|
7
|
+
- `focus`: optional node ID to start traversal
|
|
8
|
+
- `depth`: traversal depth (integer)
|
|
9
|
+
- `groupBy`: `endpoint | agent | purpose`
|
|
10
|
+
- `includeNodeKinds`: array of node kinds to include
|
|
11
|
+
- `excludeExternal`: boolean
|
|
12
|
+
- `collapsePatterns`: reserved array
|
|
13
|
+
- `labelMode`: `short | full`
|
|
14
|
+
|
|
15
|
+
Notes:
|
|
16
|
+
- `depth` is still supported for `bgx view` artifact generation.
|
|
17
|
+
- Local viewer UI no longer exposes a depth slider; it renders from the generated view and group/search filters.
|
|
18
|
+
|
|
19
|
+
Example:
|
|
20
|
+
```yaml
|
|
21
|
+
version: "1"
|
|
22
|
+
focus: "endpoint:004415"
|
|
23
|
+
depth: 3
|
|
24
|
+
groupBy: endpoint
|
|
25
|
+
includeNodeKinds: [endpoint, route_handler, function, agent, mcp_tool]
|
|
26
|
+
excludeExternal: false
|
|
27
|
+
labelMode: short
|
|
28
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Assistant Integrations
|
|
2
|
+
|
|
3
|
+
This folder contains copyable integration bundles for Codex and Claude.
|
|
4
|
+
|
|
5
|
+
## Codex
|
|
6
|
+
- Source bundle: `integrations/codex/skills/backend-graphing/`
|
|
7
|
+
- Source bundle: `integrations/codex/skills/backend-graphing-describe/`
|
|
8
|
+
- Destination: `$CODEX_HOME/skills/backend-graphing/` (or `~/.codex/skills/backend-graphing/`)
|
|
9
|
+
|
|
10
|
+
## Claude
|
|
11
|
+
- Source bundle: `integrations/claude/`
|
|
12
|
+
- Plugin destination: `~/.claude/plugins/marketplaces/backend-graphing/`
|
|
13
|
+
- Skill destination: `~/.claude/skills/backend-graphing/`
|
|
14
|
+
- Skill destination: `~/.claude/skills/backend-graphing-describe/`
|
|
15
|
+
|
|
16
|
+
## Automatic install
|
|
17
|
+
Use:
|
|
18
|
+
```bash
|
|
19
|
+
bgx install --target all
|
|
20
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: backend-graphing
|
|
3
|
+
description: Analyze backend/frontend codebases into endpoint-first graph artifacts with `bgx`, and export to Cypher/Mermaid or interactive view JSON.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Backend Graphing Skill
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
- User asks to map code architecture by endpoint, agent flow, or functional purpose.
|
|
10
|
+
- User needs low-level call chains and tool orchestration visibility.
|
|
11
|
+
- User wants graph outputs for Neo4j, Mermaid, or local viewer workflows.
|
|
12
|
+
|
|
13
|
+
## Required input
|
|
14
|
+
- Absolute project path to analyze.
|
|
15
|
+
- Optional frontend project path for UI-route/API linkage.
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
1. Analyze project:
|
|
19
|
+
```bash
|
|
20
|
+
bgx analyze --project <ABS_PROJECT_PATH> --out <GRAPH_JSON_PATH>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. Analyze with frontend linkage:
|
|
24
|
+
```bash
|
|
25
|
+
bgx analyze --project <ABS_BACKEND_PATH> --frontend <ABS_FRONTEND_PATH> --out <GRAPH_JSON_PATH>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
3. Export Cypher:
|
|
29
|
+
```bash
|
|
30
|
+
bgx export --graph <GRAPH_JSON_PATH> --format cypher --out <GRAPH_CYPHER_PATH>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
4. Export Mermaid:
|
|
34
|
+
```bash
|
|
35
|
+
bgx export --graph <GRAPH_JSON_PATH> --format mermaid --out <GRAPH_MMD_PATH>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
5. Build view JSON from spec:
|
|
39
|
+
```bash
|
|
40
|
+
bgx view --graph <GRAPH_JSON_PATH> --spec <VIEW_SPEC_YAML_OR_JSON> --out <VIEW_JSON_PATH>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
6. Launch local viewer:
|
|
44
|
+
```bash
|
|
45
|
+
bgx view --graph <GRAPH_JSON_PATH> --serve --port 4310
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Output expectations
|
|
49
|
+
- Graph JSON includes endpoint/handler/call relationships.
|
|
50
|
+
- LangGraph nodes and edges are captured from static source.
|
|
51
|
+
- MCP tool arrays and `callTool(...)` usage appear as explicit tool nodes and edges.
|
|
52
|
+
- Grouping includes endpoint-first plus agent/purpose overlays.
|
|
53
|
+
|
|
54
|
+
## Notes
|
|
55
|
+
- Analyzer is static (runtime traces are not ingested in current version).
|
|
56
|
+
- JS/TS projects are supported in V1.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: backend-graphing-describe
|
|
3
|
+
description: Generate bilingual natural-language descriptions for endpoint/purpose graph nodes using `bgx describe`.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Backend Graphing Describe Skill
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
- You need readable endpoint, function, or purpose descriptions from graph artifacts.
|
|
10
|
+
- You want Korean + English architectural summaries for docs or reviews.
|
|
11
|
+
|
|
12
|
+
## Required input
|
|
13
|
+
- Graph JSON path (`bgx analyze` output).
|
|
14
|
+
- Output path for description bundle.
|
|
15
|
+
- Executor choice (`codex` or `claude`).
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
1. Generate description bundle:
|
|
19
|
+
```bash
|
|
20
|
+
bgx describe \
|
|
21
|
+
--graph <GRAPH_JSON_PATH> \
|
|
22
|
+
--out <DESCRIPTION_JSON_PATH> \
|
|
23
|
+
--executor codex \
|
|
24
|
+
--language bilingual \
|
|
25
|
+
--detail structured
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. Validate executor template config:
|
|
29
|
+
```bash
|
|
30
|
+
bgx describe \
|
|
31
|
+
--graph <GRAPH_JSON_PATH> \
|
|
32
|
+
--out <DESCRIPTION_JSON_PATH> \
|
|
33
|
+
--executor claude \
|
|
34
|
+
--executor-config .bgx/executors.json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
3. Serve viewer with descriptions loaded:
|
|
38
|
+
```bash
|
|
39
|
+
bgx view --graph <GRAPH_JSON_PATH> --serve --descriptions <DESCRIPTION_JSON_PATH>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Output expectations
|
|
43
|
+
- Writes `DescriptionBundle` JSON with `entries[]` for nodes and groups.
|
|
44
|
+
- Each entry contains structured sections for `ko` and `en`:
|
|
45
|
+
- `purpose`
|
|
46
|
+
- `inputs_outputs`
|
|
47
|
+
- `main_flow`
|
|
48
|
+
- `conditions`
|
|
49
|
+
- `dependencies`
|
|
50
|
+
- `risks_notes`
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "backend-graphing-marketplace",
|
|
3
|
+
"description": "Local marketplace metadata for backend-graphing plugin",
|
|
4
|
+
"owner": {
|
|
5
|
+
"name": "Sangsoo Lee"
|
|
6
|
+
},
|
|
7
|
+
"plugins": [
|
|
8
|
+
{
|
|
9
|
+
"name": "backend-graphing",
|
|
10
|
+
"description": "Graph analysis plugin for endpoint-first backend/frontend architecture mapping with bgx",
|
|
11
|
+
"version": "0.1.0",
|
|
12
|
+
"source": "./",
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "Sangsoo Lee"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "backend-graphing",
|
|
3
|
+
"description": "Graph analysis plugin for endpoint-first backend/frontend architecture mapping with bgx",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Sangsoo Lee"
|
|
7
|
+
},
|
|
8
|
+
"keywords": ["graph", "architecture", "endpoint", "langgraph", "mcp", "code-analysis"]
|
|
9
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: backend-graphing
|
|
3
|
+
description: Analyze backend/frontend codebases into endpoint-first graph artifacts with `bgx`, and export to Cypher/Mermaid or interactive view JSON.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Backend Graphing Skill
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
- User asks to map code architecture by endpoint, agent flow, or functional purpose.
|
|
10
|
+
- User needs low-level call chains and tool orchestration visibility.
|
|
11
|
+
- User wants graph outputs for Neo4j, Mermaid, or local viewer workflows.
|
|
12
|
+
|
|
13
|
+
## Required input
|
|
14
|
+
- Absolute project path to analyze.
|
|
15
|
+
- Optional frontend project path for UI-route/API linkage.
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
1. Analyze project:
|
|
19
|
+
```bash
|
|
20
|
+
bgx analyze --project <ABS_PROJECT_PATH> --out <GRAPH_JSON_PATH>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. Analyze with frontend linkage:
|
|
24
|
+
```bash
|
|
25
|
+
bgx analyze --project <ABS_BACKEND_PATH> --frontend <ABS_FRONTEND_PATH> --out <GRAPH_JSON_PATH>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
3. Export Cypher:
|
|
29
|
+
```bash
|
|
30
|
+
bgx export --graph <GRAPH_JSON_PATH> --format cypher --out <GRAPH_CYPHER_PATH>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
4. Export Mermaid:
|
|
34
|
+
```bash
|
|
35
|
+
bgx export --graph <GRAPH_JSON_PATH> --format mermaid --out <GRAPH_MMD_PATH>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
5. Build view JSON from spec:
|
|
39
|
+
```bash
|
|
40
|
+
bgx view --graph <GRAPH_JSON_PATH> --spec <VIEW_SPEC_YAML_OR_JSON> --out <VIEW_JSON_PATH>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
6. Launch local viewer:
|
|
44
|
+
```bash
|
|
45
|
+
bgx view --graph <GRAPH_JSON_PATH> --serve --port 4310
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Output expectations
|
|
49
|
+
- Graph JSON includes endpoint/handler/call relationships.
|
|
50
|
+
- LangGraph nodes and edges are captured from static source.
|
|
51
|
+
- MCP tool arrays and `callTool(...)` usage appear as explicit tool nodes and edges.
|
|
52
|
+
- Grouping includes endpoint-first plus agent/purpose overlays.
|
|
53
|
+
|
|
54
|
+
## Notes
|
|
55
|
+
- Analyzer is static (runtime traces are not ingested in current version).
|
|
56
|
+
- JS/TS projects are supported in V1.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: backend-graphing-describe
|
|
3
|
+
description: Generate bilingual natural-language descriptions for endpoint/purpose graph nodes using `bgx describe`.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Backend Graphing Describe Skill
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
- You need readable endpoint, function, or purpose descriptions from graph artifacts.
|
|
10
|
+
- You want Korean + English architectural summaries for docs or reviews.
|
|
11
|
+
|
|
12
|
+
## Required input
|
|
13
|
+
- Graph JSON path (`bgx analyze` output).
|
|
14
|
+
- Output path for description bundle.
|
|
15
|
+
- Executor choice (`codex` or `claude`).
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
1. Generate description bundle:
|
|
19
|
+
```bash
|
|
20
|
+
bgx describe \
|
|
21
|
+
--graph <GRAPH_JSON_PATH> \
|
|
22
|
+
--out <DESCRIPTION_JSON_PATH> \
|
|
23
|
+
--executor codex \
|
|
24
|
+
--language bilingual \
|
|
25
|
+
--detail structured
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. Validate executor template config:
|
|
29
|
+
```bash
|
|
30
|
+
bgx describe \
|
|
31
|
+
--graph <GRAPH_JSON_PATH> \
|
|
32
|
+
--out <DESCRIPTION_JSON_PATH> \
|
|
33
|
+
--executor claude \
|
|
34
|
+
--executor-config .bgx/executors.json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
3. Serve viewer with descriptions loaded:
|
|
38
|
+
```bash
|
|
39
|
+
bgx view --graph <GRAPH_JSON_PATH> --serve --descriptions <DESCRIPTION_JSON_PATH>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Output expectations
|
|
43
|
+
- Writes `DescriptionBundle` JSON with `entries[]` for nodes and groups.
|
|
44
|
+
- Each entry contains structured sections for `ko` and `en`:
|
|
45
|
+
- `purpose`
|
|
46
|
+
- `inputs_outputs`
|
|
47
|
+
- `main_flow`
|
|
48
|
+
- `conditions`
|
|
49
|
+
- `dependencies`
|
|
50
|
+
- `risks_notes`
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: backend-graphing
|
|
3
|
+
description: Analyze backend/frontend codebases into endpoint-first graph artifacts with `bgx`, and export to Cypher/Mermaid or interactive view JSON.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Backend Graphing Skill
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
- User asks to map code architecture by endpoint, agent flow, or functional purpose.
|
|
10
|
+
- User needs low-level call chains and tool orchestration visibility.
|
|
11
|
+
- User wants graph outputs for Neo4j, Mermaid, or local viewer workflows.
|
|
12
|
+
|
|
13
|
+
## Required input
|
|
14
|
+
- Absolute project path to analyze.
|
|
15
|
+
- Optional frontend project path for UI-route/API linkage.
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
1. Analyze project:
|
|
19
|
+
```bash
|
|
20
|
+
bgx analyze --project <ABS_PROJECT_PATH> --out <GRAPH_JSON_PATH>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. Analyze with frontend linkage:
|
|
24
|
+
```bash
|
|
25
|
+
bgx analyze --project <ABS_BACKEND_PATH> --frontend <ABS_FRONTEND_PATH> --out <GRAPH_JSON_PATH>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
3. Export Cypher:
|
|
29
|
+
```bash
|
|
30
|
+
bgx export --graph <GRAPH_JSON_PATH> --format cypher --out <GRAPH_CYPHER_PATH>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
4. Export Mermaid:
|
|
34
|
+
```bash
|
|
35
|
+
bgx export --graph <GRAPH_JSON_PATH> --format mermaid --out <GRAPH_MMD_PATH>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
5. Build view JSON from spec:
|
|
39
|
+
```bash
|
|
40
|
+
bgx view --graph <GRAPH_JSON_PATH> --spec <VIEW_SPEC_YAML_OR_JSON> --out <VIEW_JSON_PATH>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
6. Launch local viewer:
|
|
44
|
+
```bash
|
|
45
|
+
bgx view --graph <GRAPH_JSON_PATH> --serve --port 4310
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Output expectations
|
|
49
|
+
- Graph JSON includes endpoint/handler/call relationships.
|
|
50
|
+
- LangGraph nodes and edges are captured from static source.
|
|
51
|
+
- MCP tool arrays and `callTool(...)` usage appear as explicit tool nodes and edges.
|
|
52
|
+
- Grouping includes endpoint-first plus agent/purpose overlays.
|
|
53
|
+
|
|
54
|
+
## Notes
|
|
55
|
+
- Analyzer is static (runtime traces are not ingested in current version).
|
|
56
|
+
- JS/TS projects are supported in V1.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: backend-graphing-describe
|
|
3
|
+
description: Generate bilingual natural-language descriptions for endpoint/purpose graph nodes using `bgx describe`.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Backend Graphing Describe Skill
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
- You need readable endpoint, function, or purpose descriptions from graph artifacts.
|
|
10
|
+
- You want Korean + English architectural summaries for docs or reviews.
|
|
11
|
+
|
|
12
|
+
## Required input
|
|
13
|
+
- Graph JSON path (`bgx analyze` output).
|
|
14
|
+
- Output path for description bundle.
|
|
15
|
+
- Executor choice (`codex` or `claude`).
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
1. Generate description bundle:
|
|
19
|
+
```bash
|
|
20
|
+
bgx describe \
|
|
21
|
+
--graph <GRAPH_JSON_PATH> \
|
|
22
|
+
--out <DESCRIPTION_JSON_PATH> \
|
|
23
|
+
--executor codex \
|
|
24
|
+
--language bilingual \
|
|
25
|
+
--detail structured
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. Validate executor template config:
|
|
29
|
+
```bash
|
|
30
|
+
bgx describe \
|
|
31
|
+
--graph <GRAPH_JSON_PATH> \
|
|
32
|
+
--out <DESCRIPTION_JSON_PATH> \
|
|
33
|
+
--executor claude \
|
|
34
|
+
--executor-config .bgx/executors.json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
3. Serve viewer with descriptions loaded:
|
|
38
|
+
```bash
|
|
39
|
+
bgx view --graph <GRAPH_JSON_PATH> --serve --descriptions <DESCRIPTION_JSON_PATH>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Output expectations
|
|
43
|
+
- Writes `DescriptionBundle` JSON with `entries[]` for nodes and groups.
|
|
44
|
+
- Each entry contains structured sections for `ko` and `en`:
|
|
45
|
+
- `purpose`
|
|
46
|
+
- `inputs_outputs`
|
|
47
|
+
- `main_flow`
|
|
48
|
+
- `conditions`
|
|
49
|
+
- `dependencies`
|
|
50
|
+
- `risks_notes`
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "archgraph",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Endpoint-first static code graph analyzer and interactive viewer for backend/frontend architectures",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"bgx": "./bin/bgx.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"integrations",
|
|
12
|
+
"packages/cli/src",
|
|
13
|
+
"packages/core/src",
|
|
14
|
+
"packages/viewer/src",
|
|
15
|
+
"packages/viewer/public",
|
|
16
|
+
"README.md",
|
|
17
|
+
"docs/examples",
|
|
18
|
+
"docs/view-spec.md",
|
|
19
|
+
"docs/release.md"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "node scripts/build-all.mjs",
|
|
23
|
+
"test": "node --test $(find packages -path '*/test/*.test.js' -print)",
|
|
24
|
+
"test:core": "node --test $(find packages/core/test -name '*.test.js' -print)"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"backend",
|
|
28
|
+
"graph",
|
|
29
|
+
"architecture",
|
|
30
|
+
"code-analysis",
|
|
31
|
+
"static-analysis",
|
|
32
|
+
"api",
|
|
33
|
+
"endpoint",
|
|
34
|
+
"visualization",
|
|
35
|
+
"cli",
|
|
36
|
+
"langgraph",
|
|
37
|
+
"mcp"
|
|
38
|
+
],
|
|
39
|
+
"author": "constantlee <constantlee@impakers.club>",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/Lee-Sangsu/backend-graphing.git"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/Lee-Sangsu/backend-graphing#readme",
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=18"
|
|
48
|
+
}
|
|
49
|
+
}
|