@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tyrone Ross
|
|
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,486 @@
|
|
|
1
|
+
# NavGator
|
|
2
|
+
|
|
3
|
+
**Architecture Connection Tracker for Claude Code**
|
|
4
|
+
|
|
5
|
+
> Know your stack before you change it
|
|
6
|
+
|
|
7
|
+
NavGator tracks architecture connections across your entire stack—packages, services, databases, queues, and infrastructure—so Claude knows what else needs to change when you modify one part of the system.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Component Detection**: Packages (npm, pip), frameworks, databases, queues, infrastructure
|
|
12
|
+
- **Connection Mapping**: API → Database, Frontend → API, Queue → Handler, Service calls
|
|
13
|
+
- **Impact Analysis**: "What's affected if I change X?"
|
|
14
|
+
- **Change Detection**: SHA-256 file hashing tracks what changed since last scan
|
|
15
|
+
- **Mermaid Diagrams**: Visual architecture diagrams
|
|
16
|
+
- **Claude Code Integration**: Hooks, skills, and slash commands
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
### As a CLI Tool
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Install globally
|
|
24
|
+
npm install -g @tyroneross/navgator
|
|
25
|
+
|
|
26
|
+
# Or use with npx
|
|
27
|
+
npx @tyroneross/navgator scan
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### As a Claude Code Plugin
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Clone to your plugins directory
|
|
34
|
+
git clone https://github.com/tyroneross/navgator ~/.claude/plugins/navgator
|
|
35
|
+
|
|
36
|
+
# Or symlink an existing clone
|
|
37
|
+
ln -s /path/to/navgator ~/.claude/plugins/navgator
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
### 1. Scan Your Project
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Full scan (packages + connections)
|
|
46
|
+
navgator scan
|
|
47
|
+
|
|
48
|
+
# Quick scan (packages only, faster)
|
|
49
|
+
navgator scan --quick
|
|
50
|
+
|
|
51
|
+
# Verbose output
|
|
52
|
+
navgator scan --verbose
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 2. Check Status
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
navgator status
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Output:
|
|
62
|
+
```
|
|
63
|
+
NavGator - Architecture Status
|
|
64
|
+
|
|
65
|
+
========================================
|
|
66
|
+
Last scan: 1/26/2026, 12:44:09 PM (0h ago)
|
|
67
|
+
Total components: 15
|
|
68
|
+
Total connections: 23
|
|
69
|
+
|
|
70
|
+
COMPONENTS BY TYPE:
|
|
71
|
+
npm: 8
|
|
72
|
+
service: 4
|
|
73
|
+
database: 2
|
|
74
|
+
infra: 1
|
|
75
|
+
|
|
76
|
+
CONNECTIONS BY TYPE:
|
|
77
|
+
service-call: 12
|
|
78
|
+
api-calls-db: 8
|
|
79
|
+
frontend-calls-api: 3
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 3. Analyze Impact
|
|
83
|
+
|
|
84
|
+
Before changing a component, see what's affected:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
navgator impact "Stripe"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Output:
|
|
91
|
+
```
|
|
92
|
+
NavGator - Impact Analysis: Stripe
|
|
93
|
+
|
|
94
|
+
========================================
|
|
95
|
+
Component: Stripe
|
|
96
|
+
Type: service
|
|
97
|
+
Layer: external
|
|
98
|
+
Purpose: Stripe payments
|
|
99
|
+
|
|
100
|
+
INCOMING CONNECTIONS (3):
|
|
101
|
+
These files/components USE this component:
|
|
102
|
+
|
|
103
|
+
src/api/payments.ts:45
|
|
104
|
+
Symbol: createPaymentIntent (function)
|
|
105
|
+
Code: await stripe.paymentIntents.create({...})
|
|
106
|
+
|
|
107
|
+
src/api/subscriptions.ts:23
|
|
108
|
+
Symbol: createSubscription (function)
|
|
109
|
+
Code: await stripe.subscriptions.create({...})
|
|
110
|
+
|
|
111
|
+
src/webhooks/stripe.ts:12
|
|
112
|
+
Symbol: handleWebhook (function)
|
|
113
|
+
Code: stripe.webhooks.constructEvent(...)
|
|
114
|
+
|
|
115
|
+
========================================
|
|
116
|
+
Files that may need changes if you modify Stripe:
|
|
117
|
+
- src/api/payments.ts
|
|
118
|
+
- src/api/subscriptions.ts
|
|
119
|
+
- src/webhooks/stripe.ts
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 4. View Connections
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# All connections for a component
|
|
126
|
+
navgator connections "BullMQ"
|
|
127
|
+
|
|
128
|
+
# Only incoming connections
|
|
129
|
+
navgator connections "users" --incoming
|
|
130
|
+
|
|
131
|
+
# Only outgoing connections
|
|
132
|
+
navgator connections "users" --outgoing
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 5. Generate Diagrams
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Full architecture diagram
|
|
139
|
+
navgator diagram
|
|
140
|
+
|
|
141
|
+
# Summary (top connected components only)
|
|
142
|
+
navgator diagram --summary
|
|
143
|
+
|
|
144
|
+
# Focus on specific component
|
|
145
|
+
navgator diagram --focus "Stripe"
|
|
146
|
+
|
|
147
|
+
# Specific layer
|
|
148
|
+
navgator diagram --layer backend
|
|
149
|
+
|
|
150
|
+
# Save to file
|
|
151
|
+
navgator diagram --output architecture.md --markdown
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## CLI Reference
|
|
155
|
+
|
|
156
|
+
### `navgator scan`
|
|
157
|
+
|
|
158
|
+
Scan project and update architecture tracking.
|
|
159
|
+
|
|
160
|
+
| Option | Description |
|
|
161
|
+
|--------|-------------|
|
|
162
|
+
| `-q, --quick` | Packages only, skip code analysis |
|
|
163
|
+
| `-c, --connections` | Focus on connection detection |
|
|
164
|
+
| `-p, --prompts` | Enhanced AI prompt scanning with full content |
|
|
165
|
+
| `-v, --verbose` | Detailed output |
|
|
166
|
+
| `--clear` | Clear existing data before scan |
|
|
167
|
+
| `--ast` | Use AST-based scanning (requires `ts-morph`) |
|
|
168
|
+
|
|
169
|
+
### `navgator status`
|
|
170
|
+
|
|
171
|
+
Show architecture summary.
|
|
172
|
+
|
|
173
|
+
| Option | Description |
|
|
174
|
+
|--------|-------------|
|
|
175
|
+
| `--json` | Output as JSON |
|
|
176
|
+
|
|
177
|
+
### `navgator impact <component>`
|
|
178
|
+
|
|
179
|
+
Show what's affected by changing a component.
|
|
180
|
+
|
|
181
|
+
| Option | Description |
|
|
182
|
+
|--------|-------------|
|
|
183
|
+
| `--json` | Output as JSON |
|
|
184
|
+
|
|
185
|
+
### `navgator connections <component>`
|
|
186
|
+
|
|
187
|
+
Show all connections for a component.
|
|
188
|
+
|
|
189
|
+
| Option | Description |
|
|
190
|
+
|--------|-------------|
|
|
191
|
+
| `--incoming` | Only incoming connections |
|
|
192
|
+
| `--outgoing` | Only outgoing connections |
|
|
193
|
+
| `--json` | Output as JSON |
|
|
194
|
+
|
|
195
|
+
### `navgator list`
|
|
196
|
+
|
|
197
|
+
List all tracked components.
|
|
198
|
+
|
|
199
|
+
| Option | Description |
|
|
200
|
+
|--------|-------------|
|
|
201
|
+
| `-t, --type <type>` | Filter by type (npm, service, database, etc.) |
|
|
202
|
+
| `-l, --layer <layer>` | Filter by layer (frontend, backend, etc.) |
|
|
203
|
+
| `--json` | Output as JSON |
|
|
204
|
+
|
|
205
|
+
### `navgator diagram`
|
|
206
|
+
|
|
207
|
+
Generate Mermaid architecture diagram.
|
|
208
|
+
|
|
209
|
+
| Option | Description |
|
|
210
|
+
|--------|-------------|
|
|
211
|
+
| `-f, --focus <component>` | Center on specific component |
|
|
212
|
+
| `-l, --layer <layer>` | Show specific layer only |
|
|
213
|
+
| `-s, --summary` | Top connected components only |
|
|
214
|
+
| `-d, --direction <dir>` | TB, BT, LR, or RL (default: TB) |
|
|
215
|
+
| `--no-styles` | Disable color styling |
|
|
216
|
+
| `--no-labels` | Hide connection labels |
|
|
217
|
+
| `-o, --output <file>` | Save to file |
|
|
218
|
+
| `-m, --max-nodes <n>` | Max nodes to show (default: 50) |
|
|
219
|
+
| `--markdown` | Wrap in markdown code block |
|
|
220
|
+
|
|
221
|
+
### `navgator prompts`
|
|
222
|
+
|
|
223
|
+
Scan and analyze AI prompts in the codebase.
|
|
224
|
+
|
|
225
|
+
| Option | Description |
|
|
226
|
+
|--------|-------------|
|
|
227
|
+
| `-v, --verbose` | Show full prompt content |
|
|
228
|
+
| `--json` | Output as JSON |
|
|
229
|
+
| `--detail <name>` | Show detailed view of specific prompt |
|
|
230
|
+
|
|
231
|
+
**Example output:**
|
|
232
|
+
```
|
|
233
|
+
AI PROMPTS DETECTED
|
|
234
|
+
============================================================
|
|
235
|
+
|
|
236
|
+
Total prompts: 5
|
|
237
|
+
Templates: 4
|
|
238
|
+
With tools: 0
|
|
239
|
+
|
|
240
|
+
By Provider:
|
|
241
|
+
anthropic: 2
|
|
242
|
+
openai: 3
|
|
243
|
+
|
|
244
|
+
By Category:
|
|
245
|
+
summarization: 2
|
|
246
|
+
classification: 1
|
|
247
|
+
unknown: 2
|
|
248
|
+
|
|
249
|
+
PROMPT: SYSTEM_PROMPT
|
|
250
|
+
File: src/ai/summarizer.ts:8-10
|
|
251
|
+
Provider: anthropic
|
|
252
|
+
Category: summarization
|
|
253
|
+
Purpose: System prompt for article summarization
|
|
254
|
+
Tags: has-system-prompt
|
|
255
|
+
System: "You are a helpful assistant that summarizes articles..."
|
|
256
|
+
Confidence: 100%
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## What Gets Detected
|
|
260
|
+
|
|
261
|
+
### Components
|
|
262
|
+
|
|
263
|
+
| Type | Examples |
|
|
264
|
+
|------|----------|
|
|
265
|
+
| **Packages** | npm, pip, cargo, go, gem, composer |
|
|
266
|
+
| **Frameworks** | Next.js, React, Django, FastAPI, Express |
|
|
267
|
+
| **Databases** | PostgreSQL, MongoDB, Redis, Supabase, Prisma |
|
|
268
|
+
| **Queues** | BullMQ, Celery, SQS, RabbitMQ |
|
|
269
|
+
| **Infrastructure** | Railway, Vercel, Docker, Kubernetes, GitHub Actions |
|
|
270
|
+
| **Services** | Stripe, OpenAI, Anthropic, Twilio, SendGrid, AWS S3 |
|
|
271
|
+
| **AI Prompts** | Claude/OpenAI prompts with full content, variables, purpose |
|
|
272
|
+
|
|
273
|
+
### Connections
|
|
274
|
+
|
|
275
|
+
| Type | Description |
|
|
276
|
+
|------|-------------|
|
|
277
|
+
| `service-call` | Code → External service (Stripe, OpenAI, etc.) |
|
|
278
|
+
| `api-calls-db` | API endpoint → Database table |
|
|
279
|
+
| `frontend-calls-api` | Frontend component → API endpoint |
|
|
280
|
+
| `queue-triggers` | Queue job → Handler function |
|
|
281
|
+
| `prompt-location` | AI prompt definition location |
|
|
282
|
+
| `prompt-usage` | Code that uses an AI prompt |
|
|
283
|
+
|
|
284
|
+
## Storage
|
|
285
|
+
|
|
286
|
+
Data is stored in `.claude/architecture/` within your project:
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
.claude/architecture/
|
|
290
|
+
├── components/ # Individual component JSON files
|
|
291
|
+
│ ├── COMP_npm_react_a1b2.json
|
|
292
|
+
│ └── COMP_service_stripe_c3d4.json
|
|
293
|
+
├── connections/ # Connection records
|
|
294
|
+
│ └── CONN_service_call_e5f6.json
|
|
295
|
+
├── index.json # Quick lookup index
|
|
296
|
+
├── graph.json # Full connection graph
|
|
297
|
+
├── hashes.json # File hashes for change detection
|
|
298
|
+
└── snapshots/ # Point-in-time backups
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
## Claude Code Integration
|
|
302
|
+
|
|
303
|
+
### Hooks
|
|
304
|
+
|
|
305
|
+
NavGator includes hooks that integrate with Claude Code:
|
|
306
|
+
|
|
307
|
+
**SessionStart**: Checks if architecture data is stale (>24h) and suggests running `/nav-scan`.
|
|
308
|
+
|
|
309
|
+
**PostToolUse (Bash)**: Detects package manager commands (`npm install`, `pip install`, etc.) and reminds to update architecture memory.
|
|
310
|
+
|
|
311
|
+
### Slash Commands
|
|
312
|
+
|
|
313
|
+
When installed as a Claude Code plugin:
|
|
314
|
+
|
|
315
|
+
| Command | Description |
|
|
316
|
+
|---------|-------------|
|
|
317
|
+
| `/nav-scan` | Scan project architecture |
|
|
318
|
+
| `/nav-status` | Show architecture summary |
|
|
319
|
+
| `/nav-impact <component>` | Impact analysis |
|
|
320
|
+
| `/nav-connections <component>` | View connections |
|
|
321
|
+
| `/nav-diagram` | Generate diagram |
|
|
322
|
+
| `/nav-check` | Health check (outdated packages) |
|
|
323
|
+
| `/nav-export` | Export to markdown |
|
|
324
|
+
|
|
325
|
+
### Skill Activation
|
|
326
|
+
|
|
327
|
+
The **Architecture Awareness** skill activates when you mention:
|
|
328
|
+
- "what packages", "dependencies", "tech stack"
|
|
329
|
+
- "what version", "upgrade", "add library"
|
|
330
|
+
- "what uses X", "what calls Y"
|
|
331
|
+
- "impact of changing"
|
|
332
|
+
|
|
333
|
+
## AI Prompt Tracking
|
|
334
|
+
|
|
335
|
+
NavGator includes comprehensive AI prompt detection and tracking. Use `--prompts` flag or the dedicated `prompts` command.
|
|
336
|
+
|
|
337
|
+
### What Gets Tracked
|
|
338
|
+
|
|
339
|
+
| Field | Description |
|
|
340
|
+
|-------|-------------|
|
|
341
|
+
| **Location** | File path, line numbers, containing function |
|
|
342
|
+
| **Content** | Full prompt content (up to 2000 chars per message) |
|
|
343
|
+
| **Provider** | Anthropic (Claude), OpenAI, Azure, Google |
|
|
344
|
+
| **Variables** | Template variables (`{var}`, `{{var}}`, `${var}`) |
|
|
345
|
+
| **Purpose** | Extracted from nearby comments |
|
|
346
|
+
| **Category** | summarization, classification, extraction, chat, etc. |
|
|
347
|
+
| **Usage** | Where the prompt is called (file, line, function) |
|
|
348
|
+
|
|
349
|
+
### Prompt Scanning Example
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
# Scan only prompts
|
|
353
|
+
navgator prompts
|
|
354
|
+
|
|
355
|
+
# Detailed view of a specific prompt
|
|
356
|
+
navgator prompts --detail SYSTEM_PROMPT
|
|
357
|
+
|
|
358
|
+
# Full scan with enhanced prompt tracking
|
|
359
|
+
navgator scan --prompts --verbose
|
|
360
|
+
|
|
361
|
+
# JSON output for tooling
|
|
362
|
+
navgator prompts --json
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Prompt Categories
|
|
366
|
+
|
|
367
|
+
NavGator automatically categorizes prompts:
|
|
368
|
+
|
|
369
|
+
- `chat` - Conversational prompts
|
|
370
|
+
- `summarization` - Content summarization
|
|
371
|
+
- `extraction` - Data extraction
|
|
372
|
+
- `classification` - Categorization tasks
|
|
373
|
+
- `code-generation` - Writing code
|
|
374
|
+
- `code-review` - Reviewing code
|
|
375
|
+
- `agent` - Tool/function use
|
|
376
|
+
- `translation` - Language translation
|
|
377
|
+
|
|
378
|
+
## AST-Based Scanning
|
|
379
|
+
|
|
380
|
+
For more accurate connection detection, install `ts-morph`:
|
|
381
|
+
|
|
382
|
+
```bash
|
|
383
|
+
npm install ts-morph
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
Then use the `--ast` flag:
|
|
387
|
+
|
|
388
|
+
```bash
|
|
389
|
+
navgator scan --ast
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
AST scanning provides:
|
|
393
|
+
- Accurate import tracking
|
|
394
|
+
- Method chain following (`stripe.customers.create()`)
|
|
395
|
+
- Higher confidence scores
|
|
396
|
+
|
|
397
|
+
Without `ts-morph`, NavGator uses regex-based scanning which is faster but may miss some patterns.
|
|
398
|
+
|
|
399
|
+
## Environment Variables
|
|
400
|
+
|
|
401
|
+
| Variable | Description | Default |
|
|
402
|
+
|----------|-------------|---------|
|
|
403
|
+
| `NAVGATOR_MODE` | Storage mode: `local` or `shared` | `local` |
|
|
404
|
+
| `NAVGATOR_PATH` | Custom storage path | `.claude/architecture` |
|
|
405
|
+
| `NAVGATOR_AUTO_SCAN` | Auto-scan on session start | `false` |
|
|
406
|
+
| `NAVGATOR_HEALTH_CHECK` | Enable health checks | `false` |
|
|
407
|
+
| `NAVGATOR_SCAN_DEPTH` | `shallow` or `deep` | `shallow` |
|
|
408
|
+
| `NAVGATOR_CONFIDENCE` | Confidence threshold (0-1) | `0.6` |
|
|
409
|
+
| `NAVGATOR_MAX_RESULTS` | Max results per query | `20` |
|
|
410
|
+
|
|
411
|
+
## Example Workflows
|
|
412
|
+
|
|
413
|
+
### Adding a New Integration
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
# 1. Check current architecture
|
|
417
|
+
navgator status
|
|
418
|
+
|
|
419
|
+
# 2. Install package
|
|
420
|
+
npm install stripe
|
|
421
|
+
|
|
422
|
+
# 3. Update architecture
|
|
423
|
+
navgator scan --quick
|
|
424
|
+
|
|
425
|
+
# 4. Implement integration
|
|
426
|
+
# ... write code ...
|
|
427
|
+
|
|
428
|
+
# 5. Full rescan to detect new connections
|
|
429
|
+
navgator scan
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### Before Database Migration
|
|
433
|
+
|
|
434
|
+
```bash
|
|
435
|
+
# 1. Check what uses the table
|
|
436
|
+
navgator impact "users"
|
|
437
|
+
|
|
438
|
+
# 2. Review affected files
|
|
439
|
+
navgator connections "users" --incoming
|
|
440
|
+
|
|
441
|
+
# 3. Generate diagram for documentation
|
|
442
|
+
navgator diagram --focus "users" --output migration-plan.md --markdown
|
|
443
|
+
|
|
444
|
+
# 4. Make changes to each affected file
|
|
445
|
+
# 5. Rescan to verify
|
|
446
|
+
navgator scan
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
### Understanding a New Codebase
|
|
450
|
+
|
|
451
|
+
```bash
|
|
452
|
+
# 1. Full scan
|
|
453
|
+
navgator scan --verbose
|
|
454
|
+
|
|
455
|
+
# 2. See overall architecture
|
|
456
|
+
navgator diagram --summary
|
|
457
|
+
|
|
458
|
+
# 3. List all services
|
|
459
|
+
navgator list --type service
|
|
460
|
+
|
|
461
|
+
# 4. Understand a specific component
|
|
462
|
+
navgator impact "Supabase"
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
## Dependencies
|
|
466
|
+
|
|
467
|
+
**Required:**
|
|
468
|
+
- `commander` - CLI framework
|
|
469
|
+
- `glob` - File pattern matching
|
|
470
|
+
|
|
471
|
+
**Optional:**
|
|
472
|
+
- `ts-morph` - AST-based scanning (install separately)
|
|
473
|
+
|
|
474
|
+
## License
|
|
475
|
+
|
|
476
|
+
MIT
|
|
477
|
+
|
|
478
|
+
## Contributing
|
|
479
|
+
|
|
480
|
+
Contributions welcome! Please read the contributing guidelines first.
|
|
481
|
+
|
|
482
|
+
## Links
|
|
483
|
+
|
|
484
|
+
- [GitHub Repository](https://github.com/tyroneross/navgator)
|
|
485
|
+
- [Issue Tracker](https://github.com/tyroneross/navgator/issues)
|
|
486
|
+
- [Claude Code](https://claude.ai/claude-code)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architecture-advisor
|
|
3
|
+
description: Specialized agent for architecture decisions, dependency management, and impact analysis. Use when planning significant changes to the tech stack.
|
|
4
|
+
color: "#3B82F6"
|
|
5
|
+
tools: ["Bash", "Read", "Glob", "Grep", "WebSearch"]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Architecture Advisor Agent
|
|
9
|
+
|
|
10
|
+
You are an architecture advisor specialized in analyzing technology stacks, understanding component relationships, and planning safe changes.
|
|
11
|
+
|
|
12
|
+
## Your Capabilities
|
|
13
|
+
|
|
14
|
+
1. **Stack Analysis**
|
|
15
|
+
- Understand current project architecture
|
|
16
|
+
- Identify frameworks, databases, queues, and services in use
|
|
17
|
+
- Map connections between components
|
|
18
|
+
|
|
19
|
+
2. **Impact Assessment**
|
|
20
|
+
- Determine what's affected by proposed changes
|
|
21
|
+
- Identify file:line locations that need updating
|
|
22
|
+
- Prioritize changes by criticality
|
|
23
|
+
|
|
24
|
+
3. **Compatibility Checking**
|
|
25
|
+
- Verify new packages work with existing stack
|
|
26
|
+
- Check for version conflicts
|
|
27
|
+
- Identify peer dependency issues
|
|
28
|
+
|
|
29
|
+
4. **Migration Planning**
|
|
30
|
+
- Plan safe upgrade paths
|
|
31
|
+
- Sequence changes to minimize risk
|
|
32
|
+
- Identify rollback strategies
|
|
33
|
+
|
|
34
|
+
5. **Security Review**
|
|
35
|
+
- Check for vulnerable dependencies
|
|
36
|
+
- Identify security implications of changes
|
|
37
|
+
- Recommend secure alternatives
|
|
38
|
+
|
|
39
|
+
## How to Use NavGator Data
|
|
40
|
+
|
|
41
|
+
When advising on architecture:
|
|
42
|
+
|
|
43
|
+
1. First, check if NavGator has scanned the project:
|
|
44
|
+
```bash
|
|
45
|
+
ls -la .claude/architecture/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
2. If scanned, read the index for quick overview:
|
|
49
|
+
```bash
|
|
50
|
+
cat .claude/architecture/index.json
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
3. For specific impact analysis:
|
|
54
|
+
```bash
|
|
55
|
+
npx @tyroneross/navgator impact "<component>"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
4. For connection details:
|
|
59
|
+
```bash
|
|
60
|
+
npx @tyroneross/navgator connections "<component>"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Response Format
|
|
64
|
+
|
|
65
|
+
When advising on changes:
|
|
66
|
+
|
|
67
|
+
1. **Current State:** Summarize relevant architecture
|
|
68
|
+
2. **Impact Analysis:** List affected components with file:line
|
|
69
|
+
3. **Recommendation:** Proposed approach
|
|
70
|
+
4. **Change Sequence:** Ordered steps to implement
|
|
71
|
+
5. **Verification:** How to verify the change worked
|
|
72
|
+
|
|
73
|
+
## Example Advisory
|
|
74
|
+
|
|
75
|
+
**User:** "I want to switch from Prisma to Drizzle ORM"
|
|
76
|
+
|
|
77
|
+
**Your Response:**
|
|
78
|
+
|
|
79
|
+
### Current State
|
|
80
|
+
Project uses Prisma for database access:
|
|
81
|
+
- 12 API endpoints use Prisma client
|
|
82
|
+
- 3 queue workers make DB queries
|
|
83
|
+
- Connection files: src/lib/prisma.ts
|
|
84
|
+
|
|
85
|
+
### Impact Analysis
|
|
86
|
+
Files requiring changes:
|
|
87
|
+
- src/api/users.ts:23-45 (3 queries)
|
|
88
|
+
- src/api/orders.ts:15-89 (5 queries)
|
|
89
|
+
- src/workers/sync.ts:34 (1 query)
|
|
90
|
+
... [continue for all files]
|
|
91
|
+
|
|
92
|
+
### Recommendation
|
|
93
|
+
1. Install Drizzle alongside Prisma
|
|
94
|
+
2. Create Drizzle schema from Prisma schema
|
|
95
|
+
3. Migrate one endpoint at a time
|
|
96
|
+
4. Remove Prisma after all endpoints migrated
|
|
97
|
+
|
|
98
|
+
### Change Sequence
|
|
99
|
+
1. `npm install drizzle-orm drizzle-kit`
|
|
100
|
+
2. Create src/lib/drizzle.ts
|
|
101
|
+
3. Convert src/api/users.ts (lowest risk)
|
|
102
|
+
4. Test thoroughly
|
|
103
|
+
5. Continue with remaining files
|
|
104
|
+
...
|
|
105
|
+
|
|
106
|
+
### Verification
|
|
107
|
+
- Run test suite after each file
|
|
108
|
+
- Compare query results between ORMs
|
|
109
|
+
- Monitor for N+1 queries
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Run health check on architecture (outdated packages, vulnerabilities)"
|
|
3
|
+
allowed-tools: ["Bash", "Read"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# NavGator Health Check
|
|
7
|
+
|
|
8
|
+
Run health checks on your architecture to find outdated packages, security vulnerabilities, and potential issues.
|
|
9
|
+
|
|
10
|
+
**Note:** Health checks are configurable via the `NAVGATOR_HEALTH_CHECK` environment variable.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx @tyroneross/navgator check
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## What Gets Checked
|
|
19
|
+
|
|
20
|
+
**Package Health:**
|
|
21
|
+
- Outdated packages (npm outdated, pip list --outdated, etc.)
|
|
22
|
+
- Security vulnerabilities (npm audit, pip-audit, etc.)
|
|
23
|
+
- Deprecated packages
|
|
24
|
+
|
|
25
|
+
**Connection Health:**
|
|
26
|
+
- Orphaned connections (code references that no longer exist)
|
|
27
|
+
- Missing imports
|
|
28
|
+
- Unused dependencies
|
|
29
|
+
|
|
30
|
+
## Options
|
|
31
|
+
|
|
32
|
+
- `--packages`: Only check package health
|
|
33
|
+
- `--connections`: Only check connection health
|
|
34
|
+
- `--fix`: Attempt to auto-fix issues (careful!)
|
|
35
|
+
|
|
36
|
+
## Configuration
|
|
37
|
+
|
|
38
|
+
Set `NAVGATOR_HEALTH_CHECK=true` to enable automatic health checks during scans.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
export NAVGATOR_HEALTH_CHECK=true
|
|
42
|
+
npx @tyroneross/navgator scan # Will include health check
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Output
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Health Check Results
|
|
49
|
+
====================
|
|
50
|
+
|
|
51
|
+
PACKAGES:
|
|
52
|
+
├── 3 outdated (2 minor, 1 major)
|
|
53
|
+
│ ├── react: 18.2.0 → 18.3.0 (minor)
|
|
54
|
+
│ ├── typescript: 5.3.0 → 5.4.0 (minor)
|
|
55
|
+
│ └── next: 14.0.0 → 15.0.0 (major - breaking changes)
|
|
56
|
+
└── 0 vulnerabilities
|
|
57
|
+
|
|
58
|
+
CONNECTIONS:
|
|
59
|
+
├── 2 orphaned connections
|
|
60
|
+
│ ├── src/api/old-endpoint.ts:15 (file deleted)
|
|
61
|
+
│ └── src/components/Legacy.tsx:42 (function removed)
|
|
62
|
+
└── 1 missing import
|
|
63
|
+
└── src/utils/helpers.ts:5 → lodash (not in package.json)
|
|
64
|
+
```
|