gitnexushub 0.2.7 → 0.2.9

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/dist/content.js CHANGED
@@ -23,68 +23,68 @@ export const HUB_SKILLS = [
23
23
  * No detect_changes or rename references (not available via Hub MCP).
24
24
  */
25
25
  function generateHubContent(projectName, stats) {
26
- return `${GITNEXUS_START_MARKER}
27
- # GitNexus — Code Intelligence
28
-
29
- This project is indexed by GitNexus as **${projectName}** (${stats.nodes || 0} symbols, ${stats.edges || 0} relationships, ${stats.processes || 0} execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
30
-
31
- > Re-indexing is managed from the GitNexus Hub dashboard.
32
-
33
- ## Always Do
34
-
35
- - **MUST run impact analysis before editing any symbol.** Before modifying a function, class, or method, run \`gitnexus_impact({target: "symbolName", direction: "upstream"})\` and report the blast radius (direct callers, affected processes, risk level) to the user.
36
- - **MUST warn the user** if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.
37
- - When exploring unfamiliar code, use \`gitnexus_query({query: "concept"})\` to find execution flows instead of grepping. It returns process-grouped results ranked by relevance.
38
- - When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use \`gitnexus_context({name: "symbolName"})\`.
39
-
40
- ## When Debugging
41
-
42
- 1. \`gitnexus_query({query: "<error or symptom>"})\` — find execution flows related to the issue
43
- 2. \`gitnexus_context({name: "<suspect function>"})\` — see all callers, callees, and process participation
44
- 3. \`READ gitnexus://repo/${projectName}/process/{processName}\` — trace the full execution flow step by step
45
-
46
- ## When Refactoring
47
-
48
- - **Extracting/Splitting**: MUST run \`gitnexus_context({name: "target"})\` to see all incoming/outgoing refs, then \`gitnexus_impact({target: "target", direction: "upstream"})\` to find all external callers before moving code.
49
-
50
- ## Never Do
51
-
52
- - NEVER edit a function, class, or method without first running \`gitnexus_impact\` on it.
53
- - NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.
54
-
55
- ## Tools Quick Reference
56
-
57
- | Tool | When to use | Command |
58
- |------|-------------|---------|
59
- | \`query\` | Find code by concept | \`gitnexus_query({query: "auth validation"})\` |
60
- | \`context\` | 360-degree view of one symbol | \`gitnexus_context({name: "validateUser"})\` |
61
- | \`impact\` | Blast radius before editing | \`gitnexus_impact({target: "X", direction: "upstream"})\` |
62
- | \`cypher\` | Custom graph queries | \`gitnexus_cypher({query: "MATCH ..."})\` |
63
-
64
- ## Impact Risk Levels
65
-
66
- | Depth | Meaning | Action |
67
- |-------|---------|--------|
68
- | d=1 | WILL BREAK — direct callers/importers | MUST update these |
69
- | d=2 | LIKELY AFFECTED — indirect deps | Should test |
70
- | d=3 | MAY NEED TESTING — transitive | Test if critical path |
71
-
72
- ## Resources
73
-
74
- | Resource | Use for |
75
- |----------|---------|
76
- | \`gitnexus://repo/${projectName}/context\` | Codebase overview, check index freshness |
77
- | \`gitnexus://repo/${projectName}/clusters\` | All functional areas |
78
- | \`gitnexus://repo/${projectName}/processes\` | All execution flows |
79
- | \`gitnexus://repo/${projectName}/process/{name}\` | Step-by-step execution trace |
80
-
81
- ## Self-Check Before Finishing
82
-
83
- Before completing any code modification task, verify:
84
- 1. \`gitnexus_impact\` was run for all modified symbols
85
- 2. No HIGH/CRITICAL risk warnings were ignored
86
- 3. All d=1 (WILL BREAK) dependents were updated
87
-
26
+ return `${GITNEXUS_START_MARKER}
27
+ # GitNexus — Code Intelligence
28
+
29
+ This project is indexed by GitNexus as **${projectName}** (${stats.nodes || 0} symbols, ${stats.edges || 0} relationships, ${stats.processes || 0} execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
30
+
31
+ > Re-indexing is managed from the GitNexus Hub dashboard.
32
+
33
+ ## Always Do
34
+
35
+ - **MUST run impact analysis before editing any symbol.** Before modifying a function, class, or method, run \`gitnexus_impact({target: "symbolName", direction: "upstream"})\` and report the blast radius (direct callers, affected processes, risk level) to the user.
36
+ - **MUST warn the user** if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.
37
+ - When exploring unfamiliar code, use \`gitnexus_query({query: "concept"})\` to find execution flows instead of grepping. It returns process-grouped results ranked by relevance.
38
+ - When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use \`gitnexus_context({name: "symbolName"})\`.
39
+
40
+ ## When Debugging
41
+
42
+ 1. \`gitnexus_query({query: "<error or symptom>"})\` — find execution flows related to the issue
43
+ 2. \`gitnexus_context({name: "<suspect function>"})\` — see all callers, callees, and process participation
44
+ 3. \`READ gitnexus://repo/${projectName}/process/{processName}\` — trace the full execution flow step by step
45
+
46
+ ## When Refactoring
47
+
48
+ - **Extracting/Splitting**: MUST run \`gitnexus_context({name: "target"})\` to see all incoming/outgoing refs, then \`gitnexus_impact({target: "target", direction: "upstream"})\` to find all external callers before moving code.
49
+
50
+ ## Never Do
51
+
52
+ - NEVER edit a function, class, or method without first running \`gitnexus_impact\` on it.
53
+ - NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.
54
+
55
+ ## Tools Quick Reference
56
+
57
+ | Tool | When to use | Command |
58
+ |------|-------------|---------|
59
+ | \`query\` | Find code by concept | \`gitnexus_query({query: "auth validation"})\` |
60
+ | \`context\` | 360-degree view of one symbol | \`gitnexus_context({name: "validateUser"})\` |
61
+ | \`impact\` | Blast radius before editing | \`gitnexus_impact({target: "X", direction: "upstream"})\` |
62
+ | \`cypher\` | Custom graph queries | \`gitnexus_cypher({query: "MATCH ..."})\` |
63
+
64
+ ## Impact Risk Levels
65
+
66
+ | Depth | Meaning | Action |
67
+ |-------|---------|--------|
68
+ | d=1 | WILL BREAK — direct callers/importers | MUST update these |
69
+ | d=2 | LIKELY AFFECTED — indirect deps | Should test |
70
+ | d=3 | MAY NEED TESTING — transitive | Test if critical path |
71
+
72
+ ## Resources
73
+
74
+ | Resource | Use for |
75
+ |----------|---------|
76
+ | \`gitnexus://repo/${projectName}/context\` | Codebase overview, check index freshness |
77
+ | \`gitnexus://repo/${projectName}/clusters\` | All functional areas |
78
+ | \`gitnexus://repo/${projectName}/processes\` | All execution flows |
79
+ | \`gitnexus://repo/${projectName}/process/{name}\` | Step-by-step execution trace |
80
+
81
+ ## Self-Check Before Finishing
82
+
83
+ Before completing any code modification task, verify:
84
+ 1. \`gitnexus_impact\` was run for all modified symbols
85
+ 2. No HIGH/CRITICAL risk warnings were ignored
86
+ 3. All d=1 (WILL BREAK) dependents were updated
87
+
88
88
  ${GITNEXUS_END_MARKER}`;
89
89
  }
90
90
  /**
@@ -18,7 +18,7 @@ async function configure(hubUrl, token) {
18
18
  existing.mcpServers = {};
19
19
  }
20
20
  existing.mcpServers.gitnexus = {
21
- type: 'http',
21
+ type: 'sse',
22
22
  url: mcpUrl,
23
23
  headers: { Authorization: `Bearer ${token}` },
24
24
  };
package/package.json CHANGED
@@ -1,53 +1,53 @@
1
- {
2
- "name": "gitnexushub",
3
- "version": "0.2.7",
4
- "description": "Connect your editor to GitNexus Hub — one command MCP setup + project context",
5
- "author": "Abhigyan Patwari",
6
- "license": "PolyForm-Noncommercial-1.0.0",
7
- "homepage": "https://app.akonlabs.com",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/Akon-Labs/gitnexus-enterprise.git",
11
- "directory": "gitnexus-connect"
12
- },
13
- "bugs": {
14
- "url": "https://github.com/Akon-Labs/gitnexus-enterprise/issues"
15
- },
16
- "keywords": [
17
- "gitnexus",
18
- "mcp",
19
- "model-context-protocol",
20
- "claude",
21
- "cursor",
22
- "windsurf",
23
- "code-intelligence",
24
- "ai-agent"
25
- ],
26
- "type": "module",
27
- "bin": {
28
- "gnx": "dist/index.js",
29
- "gitnexus-connect": "dist/index.js"
30
- },
31
- "scripts": {
32
- "build": "tsc",
33
- "dev": "tsx src/index.ts",
34
- "prepare": "npm run build"
35
- },
36
- "dependencies": {
37
- "commander": "^12.0.0",
38
- "picocolors": "^1.1.1"
39
- },
40
- "devDependencies": {
41
- "@types/node": "^20.19.37",
42
- "tsx": "^4.0.0",
43
- "typescript": "^5.4.5"
44
- },
45
- "engines": {
46
- "node": ">=18.0.0"
47
- },
48
- "files": [
49
- "dist",
50
- "skills"
51
- ],
52
- "publishConfig": {}
53
- }
1
+ {
2
+ "name": "gitnexushub",
3
+ "version": "0.2.9",
4
+ "description": "Connect your editor to GitNexus Hub — one command MCP setup + project context",
5
+ "author": "Abhigyan Patwari",
6
+ "license": "PolyForm-Noncommercial-1.0.0",
7
+ "homepage": "https://app.akonlabs.com",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Akon-Labs/gitnexus-enterprise.git",
11
+ "directory": "gitnexus-connect"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/Akon-Labs/gitnexus-enterprise/issues"
15
+ },
16
+ "keywords": [
17
+ "gitnexus",
18
+ "mcp",
19
+ "model-context-protocol",
20
+ "claude",
21
+ "cursor",
22
+ "windsurf",
23
+ "code-intelligence",
24
+ "ai-agent"
25
+ ],
26
+ "type": "module",
27
+ "bin": {
28
+ "gnx": "dist/index.js",
29
+ "gitnexus-connect": "dist/index.js"
30
+ },
31
+ "scripts": {
32
+ "build": "tsc",
33
+ "dev": "tsx src/index.ts",
34
+ "prepare": "npm run build"
35
+ },
36
+ "dependencies": {
37
+ "commander": "^12.0.0",
38
+ "picocolors": "^1.1.1"
39
+ },
40
+ "devDependencies": {
41
+ "@types/node": "^20.19.37",
42
+ "tsx": "^4.0.0",
43
+ "typescript": "^5.4.5"
44
+ },
45
+ "engines": {
46
+ "node": ">=18.0.0"
47
+ },
48
+ "files": [
49
+ "dist",
50
+ "skills"
51
+ ],
52
+ "publishConfig": {}
53
+ }
@@ -1,89 +1,89 @@
1
- ---
2
- name: gitnexus-debugging
3
- description: "Use when the user is debugging a bug, tracing an error, or asking why something fails. Examples: \"Why is X failing?\", \"Where does this error come from?\", \"Trace this bug\""
4
- ---
5
-
6
- # Debugging with GitNexus
7
-
8
- ## When to Use
9
-
10
- - "Why is this function failing?"
11
- - "Trace where this error comes from"
12
- - "Who calls this method?"
13
- - "This endpoint returns 500"
14
- - Investigating bugs, errors, or unexpected behavior
15
-
16
- ## Workflow
17
-
18
- ```
19
- 1. gitnexus_query({query: "<error or symptom>"}) → Find related execution flows
20
- 2. gitnexus_context({name: "<suspect>"}) → See callers/callees/processes
21
- 3. READ gitnexus://repo/{name}/process/{name} → Trace execution flow
22
- 4. gitnexus_cypher({query: "MATCH path..."}) → Custom traces if needed
23
- ```
24
-
25
- > If "Index is stale" → trigger re-indexing from the Hub dashboard.
26
-
27
- ## Checklist
28
-
29
- ```
30
- - [ ] Understand the symptom (error message, unexpected behavior)
31
- - [ ] gitnexus_query for error text or related code
32
- - [ ] Identify the suspect function from returned processes
33
- - [ ] gitnexus_context to see callers and callees
34
- - [ ] Trace execution flow via process resource if applicable
35
- - [ ] gitnexus_cypher for custom call chain traces if needed
36
- - [ ] Read source files to confirm root cause
37
- ```
38
-
39
- ## Debugging Patterns
40
-
41
- | Symptom | GitNexus Approach |
42
- | -------------------- | ---------------------------------------------------------- |
43
- | Error message | `gitnexus_query` for error text → `context` on throw sites |
44
- | Wrong return value | `context` on the function → trace callees for data flow |
45
- | Intermittent failure | `context` → look for external calls, async deps |
46
- | Performance issue | `context` → find symbols with many callers (hot paths) |
47
- | Recent regression | `impact` on changed functions → check what callers broke |
48
-
49
- ## Tools
50
-
51
- **gitnexus_query** — find code related to error:
52
-
53
- ```
54
- gitnexus_query({query: "payment validation error"})
55
- → Processes: CheckoutFlow, ErrorHandling
56
- → Symbols: validatePayment, handlePaymentError, PaymentException
57
- ```
58
-
59
- **gitnexus_context** — full context for a suspect:
60
-
61
- ```
62
- gitnexus_context({name: "validatePayment"})
63
- → Incoming calls: processCheckout, webhookHandler
64
- → Outgoing calls: verifyCard, fetchRates (external API!)
65
- → Processes: CheckoutFlow (step 3/7)
66
- ```
67
-
68
- **gitnexus_cypher** — custom call chain traces:
69
-
70
- ```cypher
71
- MATCH path = (a)-[:CodeRelation {type: 'CALLS'}*1..2]->(b:Function {name: "validatePayment"})
72
- RETURN [n IN nodes(path) | n.name] AS chain
73
- ```
74
-
75
- ## Example: "Payment endpoint returns 500 intermittently"
76
-
77
- ```
78
- 1. gitnexus_query({query: "payment error handling"})
79
- → Processes: CheckoutFlow, ErrorHandling
80
- → Symbols: validatePayment, handlePaymentError
81
-
82
- 2. gitnexus_context({name: "validatePayment"})
83
- → Outgoing calls: verifyCard, fetchRates (external API!)
84
-
85
- 3. READ gitnexus://repo/my-app/process/CheckoutFlow
86
- → Step 3: validatePayment → calls fetchRates (external)
87
-
88
- 4. Root cause: fetchRates calls external API without proper timeout
89
- ```
1
+ ---
2
+ name: gitnexus-debugging
3
+ description: "Use when the user is debugging a bug, tracing an error, or asking why something fails. Examples: \"Why is X failing?\", \"Where does this error come from?\", \"Trace this bug\""
4
+ ---
5
+
6
+ # Debugging with GitNexus
7
+
8
+ ## When to Use
9
+
10
+ - "Why is this function failing?"
11
+ - "Trace where this error comes from"
12
+ - "Who calls this method?"
13
+ - "This endpoint returns 500"
14
+ - Investigating bugs, errors, or unexpected behavior
15
+
16
+ ## Workflow
17
+
18
+ ```
19
+ 1. gitnexus_query({query: "<error or symptom>"}) → Find related execution flows
20
+ 2. gitnexus_context({name: "<suspect>"}) → See callers/callees/processes
21
+ 3. READ gitnexus://repo/{name}/process/{name} → Trace execution flow
22
+ 4. gitnexus_cypher({query: "MATCH path..."}) → Custom traces if needed
23
+ ```
24
+
25
+ > If "Index is stale" → trigger re-indexing from the Hub dashboard.
26
+
27
+ ## Checklist
28
+
29
+ ```
30
+ - [ ] Understand the symptom (error message, unexpected behavior)
31
+ - [ ] gitnexus_query for error text or related code
32
+ - [ ] Identify the suspect function from returned processes
33
+ - [ ] gitnexus_context to see callers and callees
34
+ - [ ] Trace execution flow via process resource if applicable
35
+ - [ ] gitnexus_cypher for custom call chain traces if needed
36
+ - [ ] Read source files to confirm root cause
37
+ ```
38
+
39
+ ## Debugging Patterns
40
+
41
+ | Symptom | GitNexus Approach |
42
+ | -------------------- | ---------------------------------------------------------- |
43
+ | Error message | `gitnexus_query` for error text → `context` on throw sites |
44
+ | Wrong return value | `context` on the function → trace callees for data flow |
45
+ | Intermittent failure | `context` → look for external calls, async deps |
46
+ | Performance issue | `context` → find symbols with many callers (hot paths) |
47
+ | Recent regression | `impact` on changed functions → check what callers broke |
48
+
49
+ ## Tools
50
+
51
+ **gitnexus_query** — find code related to error:
52
+
53
+ ```
54
+ gitnexus_query({query: "payment validation error"})
55
+ → Processes: CheckoutFlow, ErrorHandling
56
+ → Symbols: validatePayment, handlePaymentError, PaymentException
57
+ ```
58
+
59
+ **gitnexus_context** — full context for a suspect:
60
+
61
+ ```
62
+ gitnexus_context({name: "validatePayment"})
63
+ → Incoming calls: processCheckout, webhookHandler
64
+ → Outgoing calls: verifyCard, fetchRates (external API!)
65
+ → Processes: CheckoutFlow (step 3/7)
66
+ ```
67
+
68
+ **gitnexus_cypher** — custom call chain traces:
69
+
70
+ ```cypher
71
+ MATCH path = (a)-[:CodeRelation {type: 'CALLS'}*1..2]->(b:Function {name: "validatePayment"})
72
+ RETURN [n IN nodes(path) | n.name] AS chain
73
+ ```
74
+
75
+ ## Example: "Payment endpoint returns 500 intermittently"
76
+
77
+ ```
78
+ 1. gitnexus_query({query: "payment error handling"})
79
+ → Processes: CheckoutFlow, ErrorHandling
80
+ → Symbols: validatePayment, handlePaymentError
81
+
82
+ 2. gitnexus_context({name: "validatePayment"})
83
+ → Outgoing calls: verifyCard, fetchRates (external API!)
84
+
85
+ 3. READ gitnexus://repo/my-app/process/CheckoutFlow
86
+ → Step 3: validatePayment → calls fetchRates (external)
87
+
88
+ 4. Root cause: fetchRates calls external API without proper timeout
89
+ ```
@@ -1,78 +1,78 @@
1
- ---
2
- name: gitnexus-exploring
3
- description: "Use when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase. Examples: \"How does X work?\", \"What calls this function?\", \"Show me the auth flow\""
4
- ---
5
-
6
- # Exploring Codebases with GitNexus
7
-
8
- ## When to Use
9
-
10
- - "How does authentication work?"
11
- - "What's the project structure?"
12
- - "Show me the main components"
13
- - "Where is the database logic?"
14
- - Understanding code you haven't seen before
15
-
16
- ## Workflow
17
-
18
- ```
19
- 1. READ gitnexus://repos → Discover indexed repos
20
- 2. READ gitnexus://repo/{name}/context → Codebase overview, check staleness
21
- 3. gitnexus_query({query: "<what you want to understand>"}) → Find related execution flows
22
- 4. gitnexus_context({name: "<symbol>"}) → Deep dive on specific symbol
23
- 5. READ gitnexus://repo/{name}/process/{name} → Trace full execution flow
24
- ```
25
-
26
- > If step 2 says "Index is stale" → trigger re-indexing from the Hub dashboard.
27
-
28
- ## Checklist
29
-
30
- ```
31
- - [ ] READ gitnexus://repo/{name}/context
32
- - [ ] gitnexus_query for the concept you want to understand
33
- - [ ] Review returned processes (execution flows)
34
- - [ ] gitnexus_context on key symbols for callers/callees
35
- - [ ] READ process resource for full execution traces
36
- - [ ] Read source files for implementation details
37
- ```
38
-
39
- ## Resources
40
-
41
- | Resource | What you get |
42
- | --------------------------------------- | ------------------------------------------------------- |
43
- | `gitnexus://repo/{name}/context` | Stats, staleness warning (~150 tokens) |
44
- | `gitnexus://repo/{name}/clusters` | All functional areas with cohesion scores (~300 tokens) |
45
- | `gitnexus://repo/{name}/cluster/{name}` | Area members with file paths (~500 tokens) |
46
- | `gitnexus://repo/{name}/process/{name}` | Step-by-step execution trace (~200 tokens) |
47
-
48
- ## Tools
49
-
50
- **gitnexus_query** — find execution flows related to a concept:
51
-
52
- ```
53
- gitnexus_query({query: "payment processing"})
54
- → Processes: CheckoutFlow, RefundFlow, WebhookHandler
55
- → Symbols grouped by flow with file locations
56
- ```
57
-
58
- **gitnexus_context** — 360-degree view of a symbol:
59
-
60
- ```
61
- gitnexus_context({name: "validateUser"})
62
- → Incoming calls: loginHandler, apiMiddleware
63
- → Outgoing calls: checkToken, getUserById
64
- → Processes: LoginFlow (step 2/5), TokenRefresh (step 1/3)
65
- ```
66
-
67
- ## Example: "How does payment processing work?"
68
-
69
- ```
70
- 1. READ gitnexus://repo/my-app/context → 918 symbols, 45 processes
71
- 2. gitnexus_query({query: "payment processing"})
72
- → CheckoutFlow: processPayment → validateCard → chargeStripe
73
- → RefundFlow: initiateRefund → calculateRefund → processRefund
74
- 3. gitnexus_context({name: "processPayment"})
75
- → Incoming: checkoutHandler, webhookHandler
76
- → Outgoing: validateCard, chargeStripe, saveTransaction
77
- 4. Read src/payments/processor.ts for implementation details
78
- ```
1
+ ---
2
+ name: gitnexus-exploring
3
+ description: "Use when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase. Examples: \"How does X work?\", \"What calls this function?\", \"Show me the auth flow\""
4
+ ---
5
+
6
+ # Exploring Codebases with GitNexus
7
+
8
+ ## When to Use
9
+
10
+ - "How does authentication work?"
11
+ - "What's the project structure?"
12
+ - "Show me the main components"
13
+ - "Where is the database logic?"
14
+ - Understanding code you haven't seen before
15
+
16
+ ## Workflow
17
+
18
+ ```
19
+ 1. READ gitnexus://repos → Discover indexed repos
20
+ 2. READ gitnexus://repo/{name}/context → Codebase overview, check staleness
21
+ 3. gitnexus_query({query: "<what you want to understand>"}) → Find related execution flows
22
+ 4. gitnexus_context({name: "<symbol>"}) → Deep dive on specific symbol
23
+ 5. READ gitnexus://repo/{name}/process/{name} → Trace full execution flow
24
+ ```
25
+
26
+ > If step 2 says "Index is stale" → trigger re-indexing from the Hub dashboard.
27
+
28
+ ## Checklist
29
+
30
+ ```
31
+ - [ ] READ gitnexus://repo/{name}/context
32
+ - [ ] gitnexus_query for the concept you want to understand
33
+ - [ ] Review returned processes (execution flows)
34
+ - [ ] gitnexus_context on key symbols for callers/callees
35
+ - [ ] READ process resource for full execution traces
36
+ - [ ] Read source files for implementation details
37
+ ```
38
+
39
+ ## Resources
40
+
41
+ | Resource | What you get |
42
+ | --------------------------------------- | ------------------------------------------------------- |
43
+ | `gitnexus://repo/{name}/context` | Stats, staleness warning (~150 tokens) |
44
+ | `gitnexus://repo/{name}/clusters` | All functional areas with cohesion scores (~300 tokens) |
45
+ | `gitnexus://repo/{name}/cluster/{name}` | Area members with file paths (~500 tokens) |
46
+ | `gitnexus://repo/{name}/process/{name}` | Step-by-step execution trace (~200 tokens) |
47
+
48
+ ## Tools
49
+
50
+ **gitnexus_query** — find execution flows related to a concept:
51
+
52
+ ```
53
+ gitnexus_query({query: "payment processing"})
54
+ → Processes: CheckoutFlow, RefundFlow, WebhookHandler
55
+ → Symbols grouped by flow with file locations
56
+ ```
57
+
58
+ **gitnexus_context** — 360-degree view of a symbol:
59
+
60
+ ```
61
+ gitnexus_context({name: "validateUser"})
62
+ → Incoming calls: loginHandler, apiMiddleware
63
+ → Outgoing calls: checkToken, getUserById
64
+ → Processes: LoginFlow (step 2/5), TokenRefresh (step 1/3)
65
+ ```
66
+
67
+ ## Example: "How does payment processing work?"
68
+
69
+ ```
70
+ 1. READ gitnexus://repo/my-app/context → 918 symbols, 45 processes
71
+ 2. gitnexus_query({query: "payment processing"})
72
+ → CheckoutFlow: processPayment → validateCard → chargeStripe
73
+ → RefundFlow: initiateRefund → calculateRefund → processRefund
74
+ 3. gitnexus_context({name: "processPayment"})
75
+ → Incoming: checkoutHandler, webhookHandler
76
+ → Outgoing: validateCard, chargeStripe, saveTransaction
77
+ 4. Read src/payments/processor.ts for implementation details
78
+ ```
@@ -1,99 +1,99 @@
1
- ---
2
- name: gitnexus-impact-analysis
3
- description: "Use when the user wants to know what will break if they change something, or needs safety analysis before editing code. Examples: \"Is it safe to change X?\", \"What depends on this?\", \"What will break?\""
4
- ---
5
-
6
- # Impact Analysis with GitNexus
7
-
8
- ## When to Use
9
-
10
- - "Is it safe to change this function?"
11
- - "What will break if I modify X?"
12
- - "Show me the blast radius"
13
- - "Who uses this code?"
14
- - Before making non-trivial code changes
15
-
16
- ## Workflow
17
-
18
- ```
19
- 1. gitnexus_impact({target: "X", direction: "upstream"}) → What depends on this
20
- 2. Review d=1 items (WILL BREAK) and affected processes
21
- 3. gitnexus_context({name: "<high-risk symbol>"}) → Understand callers/callees
22
- 4. READ gitnexus://repo/{name}/process/{name} → Trace affected execution flows
23
- 5. Assess risk and report to user
24
- ```
25
-
26
- ## Checklist
27
-
28
- ```
29
- - [ ] gitnexus_impact({target, direction: "upstream"}) to find dependents
30
- - [ ] Review d=1 items first (these WILL BREAK)
31
- - [ ] Check high-confidence (>0.8) dependencies
32
- - [ ] gitnexus_context on high-risk d=1 symbols
33
- - [ ] READ processes to check affected execution flows
34
- - [ ] Assess risk level and report to user
35
- ```
36
-
37
- ## Understanding Output
38
-
39
- | Depth | Risk Level | Meaning |
40
- | ----- | ---------------- | ------------------------ |
41
- | d=1 | **WILL BREAK** | Direct callers/importers |
42
- | d=2 | LIKELY AFFECTED | Indirect dependencies |
43
- | d=3 | MAY NEED TESTING | Transitive effects |
44
-
45
- ## Risk Assessment
46
-
47
- | Affected | Risk |
48
- | ------------------------------ | -------- |
49
- | <5 symbols, few processes | LOW |
50
- | 5-15 symbols, 2-5 processes | MEDIUM |
51
- | >15 symbols or many processes | HIGH |
52
- | Critical path (auth, payments) | CRITICAL |
53
-
54
- ## Tools
55
-
56
- **gitnexus_impact** — the primary tool for symbol blast radius:
57
-
58
- ```
59
- gitnexus_impact({
60
- target: "validateUser",
61
- direction: "upstream",
62
- minConfidence: 0.8,
63
- maxDepth: 3
64
- })
65
-
66
- → d=1 (WILL BREAK):
67
- - loginHandler (src/auth/login.ts:42) [CALLS, 100%]
68
- - apiMiddleware (src/api/middleware.ts:15) [CALLS, 100%]
69
-
70
- → d=2 (LIKELY AFFECTED):
71
- - authRouter (src/routes/auth.ts:22) [CALLS, 95%]
72
- ```
73
-
74
- **gitnexus_context** — understand high-risk dependents:
75
-
76
- ```
77
- gitnexus_context({name: "loginHandler"})
78
- → Incoming calls: authRouter, oauthCallback
79
- → Outgoing calls: validateUser, createSession
80
- → Processes: LoginFlow (step 2/5)
81
- ```
82
-
83
- ## Example: "What breaks if I change validateUser?"
84
-
85
- ```
86
- 1. gitnexus_impact({target: "validateUser", direction: "upstream"})
87
- → d=1: loginHandler, apiMiddleware (WILL BREAK)
88
- → d=2: authRouter, sessionManager (LIKELY AFFECTED)
89
- → Affected processes: LoginFlow, TokenRefresh
90
- → Risk: MEDIUM
91
-
92
- 2. gitnexus_context({name: "loginHandler"})
93
- → Understand how loginHandler uses validateUser
94
-
95
- 3. READ gitnexus://repo/my-app/process/LoginFlow
96
- → Full execution trace to see where validateUser fits
97
-
98
- 4. Risk: 2 direct callers, 2 processes = MEDIUM
99
- ```
1
+ ---
2
+ name: gitnexus-impact-analysis
3
+ description: "Use when the user wants to know what will break if they change something, or needs safety analysis before editing code. Examples: \"Is it safe to change X?\", \"What depends on this?\", \"What will break?\""
4
+ ---
5
+
6
+ # Impact Analysis with GitNexus
7
+
8
+ ## When to Use
9
+
10
+ - "Is it safe to change this function?"
11
+ - "What will break if I modify X?"
12
+ - "Show me the blast radius"
13
+ - "Who uses this code?"
14
+ - Before making non-trivial code changes
15
+
16
+ ## Workflow
17
+
18
+ ```
19
+ 1. gitnexus_impact({target: "X", direction: "upstream"}) → What depends on this
20
+ 2. Review d=1 items (WILL BREAK) and affected processes
21
+ 3. gitnexus_context({name: "<high-risk symbol>"}) → Understand callers/callees
22
+ 4. READ gitnexus://repo/{name}/process/{name} → Trace affected execution flows
23
+ 5. Assess risk and report to user
24
+ ```
25
+
26
+ ## Checklist
27
+
28
+ ```
29
+ - [ ] gitnexus_impact({target, direction: "upstream"}) to find dependents
30
+ - [ ] Review d=1 items first (these WILL BREAK)
31
+ - [ ] Check high-confidence (>0.8) dependencies
32
+ - [ ] gitnexus_context on high-risk d=1 symbols
33
+ - [ ] READ processes to check affected execution flows
34
+ - [ ] Assess risk level and report to user
35
+ ```
36
+
37
+ ## Understanding Output
38
+
39
+ | Depth | Risk Level | Meaning |
40
+ | ----- | ---------------- | ------------------------ |
41
+ | d=1 | **WILL BREAK** | Direct callers/importers |
42
+ | d=2 | LIKELY AFFECTED | Indirect dependencies |
43
+ | d=3 | MAY NEED TESTING | Transitive effects |
44
+
45
+ ## Risk Assessment
46
+
47
+ | Affected | Risk |
48
+ | ------------------------------ | -------- |
49
+ | <5 symbols, few processes | LOW |
50
+ | 5-15 symbols, 2-5 processes | MEDIUM |
51
+ | >15 symbols or many processes | HIGH |
52
+ | Critical path (auth, payments) | CRITICAL |
53
+
54
+ ## Tools
55
+
56
+ **gitnexus_impact** — the primary tool for symbol blast radius:
57
+
58
+ ```
59
+ gitnexus_impact({
60
+ target: "validateUser",
61
+ direction: "upstream",
62
+ minConfidence: 0.8,
63
+ maxDepth: 3
64
+ })
65
+
66
+ → d=1 (WILL BREAK):
67
+ - loginHandler (src/auth/login.ts:42) [CALLS, 100%]
68
+ - apiMiddleware (src/api/middleware.ts:15) [CALLS, 100%]
69
+
70
+ → d=2 (LIKELY AFFECTED):
71
+ - authRouter (src/routes/auth.ts:22) [CALLS, 95%]
72
+ ```
73
+
74
+ **gitnexus_context** — understand high-risk dependents:
75
+
76
+ ```
77
+ gitnexus_context({name: "loginHandler"})
78
+ → Incoming calls: authRouter, oauthCallback
79
+ → Outgoing calls: validateUser, createSession
80
+ → Processes: LoginFlow (step 2/5)
81
+ ```
82
+
83
+ ## Example: "What breaks if I change validateUser?"
84
+
85
+ ```
86
+ 1. gitnexus_impact({target: "validateUser", direction: "upstream"})
87
+ → d=1: loginHandler, apiMiddleware (WILL BREAK)
88
+ → d=2: authRouter, sessionManager (LIKELY AFFECTED)
89
+ → Affected processes: LoginFlow, TokenRefresh
90
+ → Risk: MEDIUM
91
+
92
+ 2. gitnexus_context({name: "loginHandler"})
93
+ → Understand how loginHandler uses validateUser
94
+
95
+ 3. READ gitnexus://repo/my-app/process/LoginFlow
96
+ → Full execution trace to see where validateUser fits
97
+
98
+ 4. Risk: 2 direct callers, 2 processes = MEDIUM
99
+ ```
@@ -1,161 +1,161 @@
1
- ---
2
- name: gitnexus-pr-review
3
- description: "Use when the user wants to review a pull request, understand what a PR changes, assess risk of merging, or check for missing test coverage. Examples: \"Review this PR\", \"What does PR #42 change?\", \"Is this PR safe to merge?\""
4
- ---
5
-
6
- # PR Review with GitNexus
7
-
8
- ## When to Use
9
-
10
- - "Review this PR"
11
- - "What does PR #42 change?"
12
- - "Is this safe to merge?"
13
- - "What's the blast radius of this PR?"
14
- - "Are there missing tests for this PR?"
15
- - Reviewing someone else's code changes before merge
16
-
17
- ## Workflow
18
-
19
- ```
20
- 1. gh pr diff <number> or git diff main...HEAD → Get changed files
21
- 2. git diff main...HEAD --name-only → Get file list
22
- 3. gitnexus_detect_changes({changed_files: ["file1", "file2", ...]}) → Map to affected flows
23
- 4. For each changed symbol:
24
- gitnexus_impact({target: "<symbol>", direction: "upstream"}) → Blast radius per change
25
- 5. gitnexus_context({name: "<key symbol>"}) → Understand callers/callees
26
- 6. Summarize findings with risk assessment
27
- ```
28
-
29
- ## Checklist
30
-
31
- ```
32
- - [ ] Get PR diff and file list (gh pr diff / git diff --name-only)
33
- - [ ] gitnexus_detect_changes({changed_files: [...]}) to map changes to affected flows
34
- - [ ] gitnexus_impact on each non-trivial changed symbol
35
- - [ ] Review d=1 items (WILL BREAK) — are callers updated?
36
- - [ ] gitnexus_context on key changed symbols to understand full picture
37
- - [ ] Check if affected processes have test coverage
38
- - [ ] Assess overall risk level
39
- - [ ] Write review summary with findings
40
- ```
41
-
42
- ## Review Dimensions
43
-
44
- | Dimension | How GitNexus Helps |
45
- | --- | --- |
46
- | **Correctness** | `context` shows callers — are they all compatible with the change? |
47
- | **Blast radius** | `impact` shows d=1/d=2/d=3 dependents — anything missed? |
48
- | **Completeness** | `detect_changes` shows all affected flows — are they all handled? |
49
- | **Test coverage** | `impact({includeTests: true})` shows which tests touch changed code |
50
- | **Breaking changes** | d=1 upstream items that aren't updated in the PR = potential breakage |
51
-
52
- ## Risk Assessment
53
-
54
- | Signal | Risk |
55
- | --- | --- |
56
- | Changes touch <3 symbols, 0-1 processes | LOW |
57
- | Changes touch 3-10 symbols, 2-5 processes | MEDIUM |
58
- | Changes touch >10 symbols or many processes | HIGH |
59
- | Changes touch auth, payments, or data integrity code | CRITICAL |
60
- | d=1 callers exist outside the PR diff | Potential breakage — flag it |
61
-
62
- ## Tools
63
-
64
- **gitnexus_detect_changes** — map PR diff to affected execution flows:
65
-
66
- ```
67
- gitnexus_detect_changes({changed_files: ["src/payments.ts", "src/checkout.ts", "src/types.ts"]})
68
-
69
- → Changed: 8 symbols in 3 files
70
- → Affected processes: CheckoutFlow, RefundFlow, WebhookHandler
71
- → Risk: MEDIUM
72
- ```
73
-
74
- **gitnexus_impact** — blast radius per changed symbol:
75
-
76
- ```
77
- gitnexus_impact({target: "validatePayment", direction: "upstream"})
78
-
79
- → d=1 (WILL BREAK):
80
- - processCheckout (src/checkout.ts:42) [CALLS, 100%]
81
- - webhookHandler (src/webhooks.ts:15) [CALLS, 100%]
82
-
83
- → d=2 (LIKELY AFFECTED):
84
- - checkoutRouter (src/routes/checkout.ts:22) [CALLS, 95%]
85
- ```
86
-
87
- **gitnexus_impact with tests** — check test coverage:
88
-
89
- ```
90
- gitnexus_impact({target: "validatePayment", direction: "upstream", includeTests: true})
91
-
92
- → Tests that cover this symbol:
93
- - validatePayment.test.ts [direct]
94
- - checkout.integration.test.ts [via processCheckout]
95
- ```
96
-
97
- **gitnexus_context** — understand a changed symbol's role:
98
-
99
- ```
100
- gitnexus_context({name: "validatePayment"})
101
-
102
- → Incoming calls: processCheckout, webhookHandler
103
- → Outgoing calls: verifyCard, fetchRates
104
- → Processes: CheckoutFlow (step 3/7), RefundFlow (step 1/5)
105
- ```
106
-
107
- ## Example: "Review PR #42"
108
-
109
- ```
110
- 1. git diff main...HEAD --name-only
111
- → payments.ts, checkout.ts, types.ts, utils.ts
112
-
113
- 2. gitnexus_detect_changes({changed_files: ["src/payments.ts", "src/checkout.ts", "src/types.ts", "src/utils.ts"]})
114
- → Changed symbols: validatePayment, PaymentInput, formatAmount
115
- → Affected processes: CheckoutFlow, RefundFlow
116
- → Risk: MEDIUM
117
-
118
- 3. gitnexus_impact({target: "validatePayment", direction: "upstream"})
119
- → d=1: processCheckout, webhookHandler (WILL BREAK)
120
- → webhookHandler is NOT in the PR diff — potential breakage!
121
-
122
- 4. gitnexus_impact({target: "PaymentInput", direction: "upstream"})
123
- → d=1: validatePayment (in PR), createPayment (NOT in PR)
124
- → createPayment uses the old PaymentInput shape — breaking change!
125
-
126
- 5. gitnexus_context({name: "formatAmount"})
127
- → Called by 12 functions — but change is backwards-compatible (added optional param)
128
-
129
- 6. Review summary:
130
- - MEDIUM risk — 3 changed symbols affect 2 execution flows
131
- - BUG: webhookHandler calls validatePayment but isn't updated for new signature
132
- - BUG: createPayment depends on PaymentInput type which changed
133
- - OK: formatAmount change is backwards-compatible
134
- - Tests: checkout.test.ts covers processCheckout path, but no webhook test
135
- ```
136
-
137
- ## Review Output Format
138
-
139
- Structure your review as:
140
-
141
- ```markdown
142
- ## PR Review: <title>
143
-
144
- **Risk: LOW / MEDIUM / HIGH / CRITICAL**
145
-
146
- ### Changes Summary
147
- - <N> symbols changed across <M> files
148
- - <P> execution flows affected
149
-
150
- ### Findings
151
- 1. **[severity]** Description of finding
152
- - Evidence from GitNexus tools
153
- - Affected callers/flows
154
-
155
- ### Missing Coverage
156
- - Callers not updated in PR: ...
157
- - Untested flows: ...
158
-
159
- ### Recommendation
160
- APPROVE / REQUEST CHANGES / NEEDS DISCUSSION
161
- ```
1
+ ---
2
+ name: gitnexus-pr-review
3
+ description: "Use when the user wants to review a pull request, understand what a PR changes, assess risk of merging, or check for missing test coverage. Examples: \"Review this PR\", \"What does PR #42 change?\", \"Is this PR safe to merge?\""
4
+ ---
5
+
6
+ # PR Review with GitNexus
7
+
8
+ ## When to Use
9
+
10
+ - "Review this PR"
11
+ - "What does PR #42 change?"
12
+ - "Is this safe to merge?"
13
+ - "What's the blast radius of this PR?"
14
+ - "Are there missing tests for this PR?"
15
+ - Reviewing someone else's code changes before merge
16
+
17
+ ## Workflow
18
+
19
+ ```
20
+ 1. gh pr diff <number> or git diff main...HEAD → Get changed files
21
+ 2. git diff main...HEAD --name-only → Get file list
22
+ 3. gitnexus_detect_changes({changed_files: ["file1", "file2", ...]}) → Map to affected flows
23
+ 4. For each changed symbol:
24
+ gitnexus_impact({target: "<symbol>", direction: "upstream"}) → Blast radius per change
25
+ 5. gitnexus_context({name: "<key symbol>"}) → Understand callers/callees
26
+ 6. Summarize findings with risk assessment
27
+ ```
28
+
29
+ ## Checklist
30
+
31
+ ```
32
+ - [ ] Get PR diff and file list (gh pr diff / git diff --name-only)
33
+ - [ ] gitnexus_detect_changes({changed_files: [...]}) to map changes to affected flows
34
+ - [ ] gitnexus_impact on each non-trivial changed symbol
35
+ - [ ] Review d=1 items (WILL BREAK) — are callers updated?
36
+ - [ ] gitnexus_context on key changed symbols to understand full picture
37
+ - [ ] Check if affected processes have test coverage
38
+ - [ ] Assess overall risk level
39
+ - [ ] Write review summary with findings
40
+ ```
41
+
42
+ ## Review Dimensions
43
+
44
+ | Dimension | How GitNexus Helps |
45
+ | --- | --- |
46
+ | **Correctness** | `context` shows callers — are they all compatible with the change? |
47
+ | **Blast radius** | `impact` shows d=1/d=2/d=3 dependents — anything missed? |
48
+ | **Completeness** | `detect_changes` shows all affected flows — are they all handled? |
49
+ | **Test coverage** | `impact({includeTests: true})` shows which tests touch changed code |
50
+ | **Breaking changes** | d=1 upstream items that aren't updated in the PR = potential breakage |
51
+
52
+ ## Risk Assessment
53
+
54
+ | Signal | Risk |
55
+ | --- | --- |
56
+ | Changes touch <3 symbols, 0-1 processes | LOW |
57
+ | Changes touch 3-10 symbols, 2-5 processes | MEDIUM |
58
+ | Changes touch >10 symbols or many processes | HIGH |
59
+ | Changes touch auth, payments, or data integrity code | CRITICAL |
60
+ | d=1 callers exist outside the PR diff | Potential breakage — flag it |
61
+
62
+ ## Tools
63
+
64
+ **gitnexus_detect_changes** — map PR diff to affected execution flows:
65
+
66
+ ```
67
+ gitnexus_detect_changes({changed_files: ["src/payments.ts", "src/checkout.ts", "src/types.ts"]})
68
+
69
+ → Changed: 8 symbols in 3 files
70
+ → Affected processes: CheckoutFlow, RefundFlow, WebhookHandler
71
+ → Risk: MEDIUM
72
+ ```
73
+
74
+ **gitnexus_impact** — blast radius per changed symbol:
75
+
76
+ ```
77
+ gitnexus_impact({target: "validatePayment", direction: "upstream"})
78
+
79
+ → d=1 (WILL BREAK):
80
+ - processCheckout (src/checkout.ts:42) [CALLS, 100%]
81
+ - webhookHandler (src/webhooks.ts:15) [CALLS, 100%]
82
+
83
+ → d=2 (LIKELY AFFECTED):
84
+ - checkoutRouter (src/routes/checkout.ts:22) [CALLS, 95%]
85
+ ```
86
+
87
+ **gitnexus_impact with tests** — check test coverage:
88
+
89
+ ```
90
+ gitnexus_impact({target: "validatePayment", direction: "upstream", includeTests: true})
91
+
92
+ → Tests that cover this symbol:
93
+ - validatePayment.test.ts [direct]
94
+ - checkout.integration.test.ts [via processCheckout]
95
+ ```
96
+
97
+ **gitnexus_context** — understand a changed symbol's role:
98
+
99
+ ```
100
+ gitnexus_context({name: "validatePayment"})
101
+
102
+ → Incoming calls: processCheckout, webhookHandler
103
+ → Outgoing calls: verifyCard, fetchRates
104
+ → Processes: CheckoutFlow (step 3/7), RefundFlow (step 1/5)
105
+ ```
106
+
107
+ ## Example: "Review PR #42"
108
+
109
+ ```
110
+ 1. git diff main...HEAD --name-only
111
+ → payments.ts, checkout.ts, types.ts, utils.ts
112
+
113
+ 2. gitnexus_detect_changes({changed_files: ["src/payments.ts", "src/checkout.ts", "src/types.ts", "src/utils.ts"]})
114
+ → Changed symbols: validatePayment, PaymentInput, formatAmount
115
+ → Affected processes: CheckoutFlow, RefundFlow
116
+ → Risk: MEDIUM
117
+
118
+ 3. gitnexus_impact({target: "validatePayment", direction: "upstream"})
119
+ → d=1: processCheckout, webhookHandler (WILL BREAK)
120
+ → webhookHandler is NOT in the PR diff — potential breakage!
121
+
122
+ 4. gitnexus_impact({target: "PaymentInput", direction: "upstream"})
123
+ → d=1: validatePayment (in PR), createPayment (NOT in PR)
124
+ → createPayment uses the old PaymentInput shape — breaking change!
125
+
126
+ 5. gitnexus_context({name: "formatAmount"})
127
+ → Called by 12 functions — but change is backwards-compatible (added optional param)
128
+
129
+ 6. Review summary:
130
+ - MEDIUM risk — 3 changed symbols affect 2 execution flows
131
+ - BUG: webhookHandler calls validatePayment but isn't updated for new signature
132
+ - BUG: createPayment depends on PaymentInput type which changed
133
+ - OK: formatAmount change is backwards-compatible
134
+ - Tests: checkout.test.ts covers processCheckout path, but no webhook test
135
+ ```
136
+
137
+ ## Review Output Format
138
+
139
+ Structure your review as:
140
+
141
+ ```markdown
142
+ ## PR Review: <title>
143
+
144
+ **Risk: LOW / MEDIUM / HIGH / CRITICAL**
145
+
146
+ ### Changes Summary
147
+ - <N> symbols changed across <M> files
148
+ - <P> execution flows affected
149
+
150
+ ### Findings
151
+ 1. **[severity]** Description of finding
152
+ - Evidence from GitNexus tools
153
+ - Affected callers/flows
154
+
155
+ ### Missing Coverage
156
+ - Callers not updated in PR: ...
157
+ - Untested flows: ...
158
+
159
+ ### Recommendation
160
+ APPROVE / REQUEST CHANGES / NEEDS DISCUSSION
161
+ ```