@tyroneross/navgator 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/.claude-plugin/plugin.json +10 -0
- package/LICENSE +21 -0
- package/README.md +486 -0
- package/agents/architecture-advisor.md +109 -0
- package/commands/nav-check.md +64 -0
- package/commands/nav-connections.md +58 -0
- package/commands/nav-diagram.md +106 -0
- package/commands/nav-export.md +71 -0
- package/commands/nav-impact.md +58 -0
- package/commands/nav-scan.md +46 -0
- package/commands/nav-status.md +44 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +627 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config.d.ts +95 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +262 -0
- package/dist/config.js.map +1 -0
- package/dist/diagram.d.ts +36 -0
- package/dist/diagram.d.ts.map +1 -0
- package/dist/diagram.js +333 -0
- package/dist/diagram.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/scanner.d.ts +57 -0
- package/dist/scanner.d.ts.map +1 -0
- package/dist/scanner.js +282 -0
- package/dist/scanner.js.map +1 -0
- package/dist/scanners/connections/ast-scanner.d.ts +26 -0
- package/dist/scanners/connections/ast-scanner.d.ts.map +1 -0
- package/dist/scanners/connections/ast-scanner.js +430 -0
- package/dist/scanners/connections/ast-scanner.js.map +1 -0
- package/dist/scanners/connections/service-calls.d.ts +14 -0
- package/dist/scanners/connections/service-calls.d.ts.map +1 -0
- package/dist/scanners/connections/service-calls.js +719 -0
- package/dist/scanners/connections/service-calls.js.map +1 -0
- package/dist/scanners/infrastructure/index.d.ts +27 -0
- package/dist/scanners/infrastructure/index.d.ts.map +1 -0
- package/dist/scanners/infrastructure/index.js +233 -0
- package/dist/scanners/infrastructure/index.js.map +1 -0
- package/dist/scanners/packages/npm.d.ts +18 -0
- package/dist/scanners/packages/npm.d.ts.map +1 -0
- package/dist/scanners/packages/npm.js +256 -0
- package/dist/scanners/packages/npm.js.map +1 -0
- package/dist/scanners/packages/pip.d.ts +14 -0
- package/dist/scanners/packages/pip.d.ts.map +1 -0
- package/dist/scanners/packages/pip.js +228 -0
- package/dist/scanners/packages/pip.js.map +1 -0
- package/dist/scanners/prompts/detector.d.ts +119 -0
- package/dist/scanners/prompts/detector.d.ts.map +1 -0
- package/dist/scanners/prompts/detector.js +617 -0
- package/dist/scanners/prompts/detector.js.map +1 -0
- package/dist/scanners/prompts/index.d.ts +51 -0
- package/dist/scanners/prompts/index.d.ts.map +1 -0
- package/dist/scanners/prompts/index.js +340 -0
- package/dist/scanners/prompts/index.js.map +1 -0
- package/dist/scanners/prompts/types.d.ts +127 -0
- package/dist/scanners/prompts/types.d.ts.map +1 -0
- package/dist/scanners/prompts/types.js +37 -0
- package/dist/scanners/prompts/types.js.map +1 -0
- package/dist/setup.d.ts +65 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +261 -0
- package/dist/setup.js.map +1 -0
- package/dist/storage.d.ts +147 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +931 -0
- package/dist/storage.js.map +1 -0
- package/dist/types.d.ts +296 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +55 -0
- package/dist/types.js.map +1 -0
- package/dist/ui-server.d.ts +17 -0
- package/dist/ui-server.d.ts.map +1 -0
- package/dist/ui-server.js +815 -0
- package/dist/ui-server.js.map +1 -0
- package/hooks/hooks.json +57 -0
- package/package.json +80 -0
- package/scripts/ibr-ui-test.mjs +359 -0
- package/scripts/postinstall.cjs +35 -0
- package/skills/architecture-awareness/SKILL.md +141 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Show all connections for a specific component"
|
|
3
|
+
allowed-tools: ["Bash", "Read"]
|
|
4
|
+
arguments:
|
|
5
|
+
- name: "component"
|
|
6
|
+
description: "Component name to show connections for"
|
|
7
|
+
required: true
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# NavGator Connection View
|
|
11
|
+
|
|
12
|
+
Show all incoming and outgoing connections for a specific component.
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx @tyroneross/navgator connections "<component-name>"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
**API endpoint connections:**
|
|
23
|
+
```bash
|
|
24
|
+
npx @tyroneross/navgator connections "/api/users"
|
|
25
|
+
# Shows: Database tables this endpoint reads/writes
|
|
26
|
+
# Shows: Frontend components that call this endpoint
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Database table connections:**
|
|
30
|
+
```bash
|
|
31
|
+
npx @tyroneross/navgator connections "users"
|
|
32
|
+
# Shows: All API endpoints that access this table
|
|
33
|
+
# Shows: Queue handlers that modify this table
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Output Format
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
Component: users (database table)
|
|
40
|
+
Layer: database
|
|
41
|
+
|
|
42
|
+
INCOMING CONNECTIONS (what connects TO this):
|
|
43
|
+
├── POST /api/users (api-endpoint)
|
|
44
|
+
│ └── src/api/users.ts:45 → createUser()
|
|
45
|
+
├── PUT /api/users/:id (api-endpoint)
|
|
46
|
+
│ └── src/api/users.ts:78 → updateUser()
|
|
47
|
+
└── summarize-worker (queue-handler)
|
|
48
|
+
└── src/workers/summarize.ts:23 → processJob()
|
|
49
|
+
|
|
50
|
+
OUTGOING CONNECTIONS (what this connects TO):
|
|
51
|
+
└── None (database tables don't connect outward)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Options
|
|
55
|
+
|
|
56
|
+
- `--json`: Output as JSON
|
|
57
|
+
- `--incoming`: Show only incoming connections
|
|
58
|
+
- `--outgoing`: Show only outgoing connections
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nav-diagram
|
|
3
|
+
description: Generate a Mermaid diagram of the architecture
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# NavGator Diagram Generator
|
|
7
|
+
|
|
8
|
+
Generate visual architecture diagrams in Mermaid format.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- Visualize the overall architecture before making changes
|
|
13
|
+
- Generate documentation diagrams
|
|
14
|
+
- Understand component relationships at a glance
|
|
15
|
+
- Create focused diagrams around specific components
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
### Full Architecture Diagram
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx @tyroneross/navgator diagram
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Generates a complete architecture diagram with all components grouped by layer (frontend, backend, database, queue, infrastructure, external).
|
|
26
|
+
|
|
27
|
+
### Component-Focused Diagram
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx @tyroneross/navgator diagram --focus "Stripe"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Generates a diagram centered on a specific component, showing its direct connections.
|
|
34
|
+
|
|
35
|
+
### Layer Diagram
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx @tyroneross/navgator diagram --layer backend
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Shows only components in a specific layer and their connections to other layers.
|
|
42
|
+
|
|
43
|
+
### Summary Diagram
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx @tyroneross/navgator diagram --summary
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Shows only the most-connected components for a simplified overview.
|
|
50
|
+
|
|
51
|
+
## Options
|
|
52
|
+
|
|
53
|
+
| Option | Description |
|
|
54
|
+
|--------|-------------|
|
|
55
|
+
| `--focus <name>` | Center diagram on a specific component |
|
|
56
|
+
| `--layer <name>` | Show only a specific layer (frontend, backend, database, queue, infra, external) |
|
|
57
|
+
| `--summary` | Show only top connected components |
|
|
58
|
+
| `--direction <dir>` | Diagram direction: TB, BT, LR, RL (default: TB) |
|
|
59
|
+
| `--no-styles` | Disable color styling |
|
|
60
|
+
| `--no-labels` | Hide connection labels |
|
|
61
|
+
| `--output <file>` | Save to file instead of stdout |
|
|
62
|
+
| `--max-nodes <n>` | Maximum nodes to show (default: 50) |
|
|
63
|
+
|
|
64
|
+
## Output Format
|
|
65
|
+
|
|
66
|
+
The diagram is output as Mermaid markdown that can be:
|
|
67
|
+
- Pasted into GitHub/GitLab markdown files
|
|
68
|
+
- Rendered in VS Code with Mermaid extensions
|
|
69
|
+
- Used in documentation tools like Docusaurus, MkDocs
|
|
70
|
+
- Converted to images using mermaid-cli
|
|
71
|
+
|
|
72
|
+
## Example Output
|
|
73
|
+
|
|
74
|
+
```mermaid
|
|
75
|
+
graph TB
|
|
76
|
+
subgraph Frontend
|
|
77
|
+
COMP_npm_react_a1b2["react"]
|
|
78
|
+
COMP_npm_nextjs_c3d4["Next.js"]
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
subgraph Backend
|
|
82
|
+
COMP_npm_express_e5f6["express"]
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
subgraph External Services
|
|
86
|
+
COMP_service_stripe_g7h8["Stripe"]
|
|
87
|
+
COMP_service_openai_i9j0["OpenAI"]
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
COMP_npm_nextjs_c3d4 -->|calls| COMP_npm_express_e5f6
|
|
91
|
+
COMP_npm_express_e5f6 -->|uses| COMP_service_stripe_g7h8
|
|
92
|
+
|
|
93
|
+
style COMP_npm_react_a1b2,COMP_npm_nextjs_c3d4 fill:#bbdefb,stroke:#1976d2
|
|
94
|
+
style COMP_npm_express_e5f6 fill:#c8e6c9,stroke:#388e3c
|
|
95
|
+
style COMP_service_stripe_g7h8,COMP_service_openai_i9j0 fill:#ffccbc,stroke:#e64a19
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Tips
|
|
99
|
+
|
|
100
|
+
1. **Run scan first**: Diagrams are generated from the stored architecture data. Run `/nav-scan` first if you haven't already.
|
|
101
|
+
|
|
102
|
+
2. **Use focus for complex projects**: Large codebases may have too many nodes. Use `--focus` to see specific areas.
|
|
103
|
+
|
|
104
|
+
3. **Export for documentation**: Use `--output architecture.md` to save directly to your docs folder.
|
|
105
|
+
|
|
106
|
+
4. **Combine with impact analysis**: After running `/nav-impact <component>`, generate a focused diagram to visualize the affected components.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Export architecture to markdown or JSON"
|
|
3
|
+
allowed-tools: ["Bash", "Read", "Write"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# NavGator Export
|
|
7
|
+
|
|
8
|
+
Export your project's architecture documentation to markdown or JSON format.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx @tyroneross/navgator export [format] [output-file]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Formats
|
|
17
|
+
|
|
18
|
+
**Markdown (default):**
|
|
19
|
+
```bash
|
|
20
|
+
npx @tyroneross/navgator export md ARCHITECTURE.md
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**JSON:**
|
|
24
|
+
```bash
|
|
25
|
+
npx @tyroneross/navgator export json architecture.json
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Markdown Output Example
|
|
29
|
+
|
|
30
|
+
```markdown
|
|
31
|
+
# Project Architecture
|
|
32
|
+
|
|
33
|
+
## Components
|
|
34
|
+
|
|
35
|
+
### Packages (npm)
|
|
36
|
+
- react (18.2.0) - UI framework
|
|
37
|
+
- next (14.0.0) - React framework
|
|
38
|
+
- @supabase/supabase-js (2.39.0) - Database client
|
|
39
|
+
|
|
40
|
+
### Infrastructure
|
|
41
|
+
- Railway - Deployment platform
|
|
42
|
+
- Docker - Containerization
|
|
43
|
+
|
|
44
|
+
### External Services
|
|
45
|
+
- Stripe - Payment processing
|
|
46
|
+
- OpenAI - AI/LLM integration
|
|
47
|
+
|
|
48
|
+
## Connections
|
|
49
|
+
|
|
50
|
+
### API → Database
|
|
51
|
+
| Endpoint | Table | File | Line |
|
|
52
|
+
|----------|-------|------|------|
|
|
53
|
+
| POST /api/users | users | src/api/users.ts | 45 |
|
|
54
|
+
| GET /api/orders | orders | src/api/orders.ts | 23 |
|
|
55
|
+
|
|
56
|
+
### Frontend → API
|
|
57
|
+
| Component | Endpoint | File | Line |
|
|
58
|
+
|-----------|----------|------|------|
|
|
59
|
+
| UserForm | POST /api/users | src/components/UserForm.tsx | 67 |
|
|
60
|
+
|
|
61
|
+
### AI Prompts
|
|
62
|
+
| Name | File | Line |
|
|
63
|
+
|------|------|------|
|
|
64
|
+
| summarize-article | src/prompts/summarize.ts | 12 |
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Options
|
|
68
|
+
|
|
69
|
+
- `--components-only`: Export only components, skip connections
|
|
70
|
+
- `--connections-only`: Export only connections
|
|
71
|
+
- `--graph`: Include mermaid diagram of connections
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Show what's affected if you change a component"
|
|
3
|
+
allowed-tools: ["Bash", "Read"]
|
|
4
|
+
arguments:
|
|
5
|
+
- name: "component"
|
|
6
|
+
description: "Component name to analyze (e.g., 'users-table', 'bullmq', 'stripe')"
|
|
7
|
+
required: true
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# NavGator Impact Analysis
|
|
11
|
+
|
|
12
|
+
Show what other components and code would be affected if you change a specific component.
|
|
13
|
+
|
|
14
|
+
**This is the key value of NavGator:** Know what else needs updating before you make a change.
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx @tyroneross/navgator impact "<component-name>"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Examples
|
|
23
|
+
|
|
24
|
+
**Database table change:**
|
|
25
|
+
```bash
|
|
26
|
+
npx @tyroneross/navgator impact "users"
|
|
27
|
+
# Shows: All API endpoints that read/write the users table
|
|
28
|
+
# Shows: File:line references for each connection
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Queue/worker change:**
|
|
32
|
+
```bash
|
|
33
|
+
npx @tyroneross/navgator impact "bullmq"
|
|
34
|
+
# Shows: All handlers triggered by BullMQ jobs
|
|
35
|
+
# Shows: AI prompts called from workers
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**External service change:**
|
|
39
|
+
```bash
|
|
40
|
+
npx @tyroneross/navgator impact "stripe"
|
|
41
|
+
# Shows: All files that call Stripe APIs
|
|
42
|
+
# Shows: Frontend components that handle Stripe flows
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Output
|
|
46
|
+
|
|
47
|
+
For each affected component, you'll see:
|
|
48
|
+
- Component name and type
|
|
49
|
+
- Connection type (api-calls-db, frontend-calls-api, etc.)
|
|
50
|
+
- File path and line number
|
|
51
|
+
- Function name (if detected)
|
|
52
|
+
- Code snippet (truncated)
|
|
53
|
+
|
|
54
|
+
## Use Cases
|
|
55
|
+
|
|
56
|
+
1. **Before schema migration:** "If I change the users table, what APIs need updating?"
|
|
57
|
+
2. **Before refactoring:** "If I modify this BullMQ worker, what prompts are affected?"
|
|
58
|
+
3. **Before removing a dependency:** "What code uses this package?"
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Scan project architecture and update connection tracking"
|
|
3
|
+
allowed-tools: ["Bash", "Read", "Glob", "Grep"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# NavGator Architecture Scan
|
|
7
|
+
|
|
8
|
+
Scan the current project to detect and track architecture components and their connections.
|
|
9
|
+
|
|
10
|
+
## What Gets Scanned
|
|
11
|
+
|
|
12
|
+
**Components:**
|
|
13
|
+
- Packages (npm, pip, cargo, go, gem, composer)
|
|
14
|
+
- Frameworks (Next.js, React, Django, FastAPI, etc.)
|
|
15
|
+
- Databases (PostgreSQL, MongoDB, Redis, Supabase)
|
|
16
|
+
- Queues (BullMQ, Celery, SQS)
|
|
17
|
+
- Infrastructure (Railway, Vercel, Docker)
|
|
18
|
+
- External services (Stripe, OpenAI, Twilio)
|
|
19
|
+
|
|
20
|
+
**Connections:**
|
|
21
|
+
- API → Database (which endpoints touch which tables)
|
|
22
|
+
- Frontend → API (which components call which endpoints)
|
|
23
|
+
- Queue → Handler (which jobs trigger which code)
|
|
24
|
+
- Service calls (where external APIs are used)
|
|
25
|
+
- AI prompts (where Claude/OpenAI calls live, with file:line)
|
|
26
|
+
|
|
27
|
+
## Run the Scan
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx @tyroneross/navgator scan
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Options
|
|
34
|
+
|
|
35
|
+
- `--quick`: Only scan package files, skip code analysis
|
|
36
|
+
- `--connections`: Focus on connection detection
|
|
37
|
+
- `--verbose`: Show detailed detection output
|
|
38
|
+
|
|
39
|
+
## After Scanning
|
|
40
|
+
|
|
41
|
+
Review the detected architecture:
|
|
42
|
+
- Total components found
|
|
43
|
+
- Connections mapped
|
|
44
|
+
- Any potential issues (outdated packages, missing connections)
|
|
45
|
+
|
|
46
|
+
Use `/nav-status` to see a summary, or `/nav-impact <component>` to see what's affected by a specific component.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Show architecture summary and health status"
|
|
3
|
+
allowed-tools: ["Bash", "Read"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# NavGator Architecture Status
|
|
7
|
+
|
|
8
|
+
Display a summary of the project's architecture including components, connections, and health status.
|
|
9
|
+
|
|
10
|
+
## Run Status Check
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx @tyroneross/navgator status
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## What You'll See
|
|
17
|
+
|
|
18
|
+
**Component Summary:**
|
|
19
|
+
- Total packages by type (npm, pip, etc.)
|
|
20
|
+
- Frameworks and databases detected
|
|
21
|
+
- Infrastructure and services in use
|
|
22
|
+
|
|
23
|
+
**Connection Summary:**
|
|
24
|
+
- API → Database connections
|
|
25
|
+
- Frontend → API connections
|
|
26
|
+
- Queue → Handler connections
|
|
27
|
+
- External service calls
|
|
28
|
+
- AI prompt locations
|
|
29
|
+
|
|
30
|
+
**Health Status (if enabled):**
|
|
31
|
+
- Outdated packages
|
|
32
|
+
- Security vulnerabilities
|
|
33
|
+
- Missing connections
|
|
34
|
+
|
|
35
|
+
## Options
|
|
36
|
+
|
|
37
|
+
- `--json`: Output as JSON for programmatic use
|
|
38
|
+
- `--verbose`: Show all components and connections
|
|
39
|
+
|
|
40
|
+
## Related Commands
|
|
41
|
+
|
|
42
|
+
- `/nav-scan`: Rescan the project
|
|
43
|
+
- `/nav-impact <component>`: See what's affected by a component
|
|
44
|
+
- `/nav-connections <component>`: See all connections for a component
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA;;;GAGG"}
|