gitnexus 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,117 +1,117 @@
1
- ---
2
- name: gitnexus-impact-analysis
3
- description: Analyze blast radius before making code changes
4
- ---
5
-
6
- # Impact Analysis
7
-
8
- ## Quick Start
9
- ```
10
- 0. READ gitnexus://repos → Discover indexed repos
11
- 1. If "Index is stale" → gitnexus_analyze({repo: "my-app"})
12
- 2. gitnexus_impact({target, direction: "upstream", repo: "my-app"}) → What depends on this
13
- 3. READ gitnexus://repo/my-app/clusters → Check affected areas
14
- 4. READ gitnexus://repo/my-app/processes → Affected execution flows
15
- ```
16
-
17
- ## When to Use
18
- - "Is it safe to change this function?"
19
- - "What will break if I modify X?"
20
- - "Show me the blast radius"
21
- - "Who uses this code?"
22
-
23
- ## Understanding Output
24
-
25
- | Depth | Risk Level | Meaning |
26
- |-------|-----------|---------|
27
- | d=1 | WILL BREAK | Direct callers/importers |
28
- | d=2 | LIKELY AFFECTED | Indirect dependencies |
29
- | d=3 | MAY NEED TESTING | Transitive effects |
30
-
31
- ## Workflow Checklist
32
- ```
33
- Impact Analysis:
34
- - [ ] READ gitnexus://repos to find the right repo
35
- - [ ] gitnexus_impact(target, "upstream", repo) to find dependents
36
- - [ ] READ gitnexus://repo/{name}/clusters to understand affected areas
37
- - [ ] Check high-confidence (>0.8) dependencies first
38
- - [ ] Count affected clusters (cross-cutting = higher risk)
39
- - [ ] If >10 processes affected, consider splitting change
40
- ```
41
-
42
- ## Resource Reference
43
-
44
- ### gitnexus://repo/{name}/clusters
45
- Check which clusters might be affected:
46
- ```yaml
47
- clusters:
48
- - name: Auth
49
- symbols: 47
50
- - name: API
51
- symbols: 32
52
- ```
53
-
54
- ### gitnexus://repo/{name}/processes
55
- Find which processes touch the target:
56
- ```yaml
57
- processes:
58
- - name: LoginFlow
59
- type: cross_community
60
- steps: 5
61
- ```
62
-
63
- ## Tool Reference
64
-
65
- ### gitnexus_impact
66
- Analyze blast radius:
67
- ```
68
- gitnexus_impact({
69
- target: "validateUser",
70
- direction: "upstream",
71
- minConfidence: 0.8,
72
- maxDepth: 3,
73
- repo: "my-app"
74
- })
75
-
76
- → d=1 (WILL BREAK):
77
- - loginHandler (src/auth/login.ts:42) [CALLS, 100%]
78
- - apiMiddleware (src/api/middleware.ts:15) [CALLS, 100%]
79
-
80
- → d=2 (LIKELY AFFECTED):
81
- - authRouter (src/routes/auth.ts:22) [CALLS, 95%]
82
-
83
- → Affected Processes: LoginFlow, TokenRefresh
84
- → Risk: MEDIUM (3 processes)
85
- ```
86
-
87
- ## Risk Assessment
88
-
89
- | Affected | Risk |
90
- |----------|------|
91
- | <5 symbols, 1 cluster | LOW |
92
- | 5-15 symbols, 1-2 clusters | MEDIUM |
93
- | >15 symbols or 3+ clusters | HIGH |
94
- | Critical path (auth, payments) | CRITICAL |
95
-
96
- ## Pre-Change Checklist
97
- ```
98
- Before Committing:
99
- - [ ] Run impact analysis
100
- - [ ] Review all d=1 (WILL BREAK) items
101
- - [ ] Verify test coverage for affected processes
102
- - [ ] If risk > MEDIUM, get code review
103
- - [ ] If cross-cluster, coordinate with other teams
104
- ```
105
-
106
- ## Example: "What breaks if I change validateUser?"
107
-
108
- ```
109
- 1. gitnexus_impact({target: "validateUser", direction: "upstream", repo: "my-app"})
110
- → d=1: loginHandler, apiMiddleware
111
- → d=2: authRouter, sessionManager
112
-
113
- 2. READ gitnexus://repo/my-app/clusters
114
- → Auth and API clusters affected
115
-
116
- 3. Decision: 2 direct callers, 2 clusters = MEDIUM risk
117
- ```
1
+ ---
2
+ name: gitnexus-impact-analysis
3
+ description: Analyze blast radius before making code changes
4
+ ---
5
+
6
+ # Impact Analysis
7
+
8
+ ## Quick Start
9
+ ```
10
+ 0. READ gitnexus://repos → Discover indexed repos
11
+ 1. If "Index is stale" → gitnexus_analyze({repo: "my-app"})
12
+ 2. gitnexus_impact({target, direction: "upstream", repo: "my-app"}) → What depends on this
13
+ 3. READ gitnexus://repo/my-app/clusters → Check affected areas
14
+ 4. READ gitnexus://repo/my-app/processes → Affected execution flows
15
+ ```
16
+
17
+ ## When to Use
18
+ - "Is it safe to change this function?"
19
+ - "What will break if I modify X?"
20
+ - "Show me the blast radius"
21
+ - "Who uses this code?"
22
+
23
+ ## Understanding Output
24
+
25
+ | Depth | Risk Level | Meaning |
26
+ |-------|-----------|---------|
27
+ | d=1 | WILL BREAK | Direct callers/importers |
28
+ | d=2 | LIKELY AFFECTED | Indirect dependencies |
29
+ | d=3 | MAY NEED TESTING | Transitive effects |
30
+
31
+ ## Workflow Checklist
32
+ ```
33
+ Impact Analysis:
34
+ - [ ] READ gitnexus://repos to find the right repo
35
+ - [ ] gitnexus_impact(target, "upstream", repo) to find dependents
36
+ - [ ] READ gitnexus://repo/{name}/clusters to understand affected areas
37
+ - [ ] Check high-confidence (>0.8) dependencies first
38
+ - [ ] Count affected clusters (cross-cutting = higher risk)
39
+ - [ ] If >10 processes affected, consider splitting change
40
+ ```
41
+
42
+ ## Resource Reference
43
+
44
+ ### gitnexus://repo/{name}/clusters
45
+ Check which clusters might be affected:
46
+ ```yaml
47
+ clusters:
48
+ - name: Auth
49
+ symbols: 47
50
+ - name: API
51
+ symbols: 32
52
+ ```
53
+
54
+ ### gitnexus://repo/{name}/processes
55
+ Find which processes touch the target:
56
+ ```yaml
57
+ processes:
58
+ - name: LoginFlow
59
+ type: cross_community
60
+ steps: 5
61
+ ```
62
+
63
+ ## Tool Reference
64
+
65
+ ### gitnexus_impact
66
+ Analyze blast radius:
67
+ ```
68
+ gitnexus_impact({
69
+ target: "validateUser",
70
+ direction: "upstream",
71
+ minConfidence: 0.8,
72
+ maxDepth: 3,
73
+ repo: "my-app"
74
+ })
75
+
76
+ → d=1 (WILL BREAK):
77
+ - loginHandler (src/auth/login.ts:42) [CALLS, 100%]
78
+ - apiMiddleware (src/api/middleware.ts:15) [CALLS, 100%]
79
+
80
+ → d=2 (LIKELY AFFECTED):
81
+ - authRouter (src/routes/auth.ts:22) [CALLS, 95%]
82
+
83
+ → Affected Processes: LoginFlow, TokenRefresh
84
+ → Risk: MEDIUM (3 processes)
85
+ ```
86
+
87
+ ## Risk Assessment
88
+
89
+ | Affected | Risk |
90
+ |----------|------|
91
+ | <5 symbols, 1 cluster | LOW |
92
+ | 5-15 symbols, 1-2 clusters | MEDIUM |
93
+ | >15 symbols or 3+ clusters | HIGH |
94
+ | Critical path (auth, payments) | CRITICAL |
95
+
96
+ ## Pre-Change Checklist
97
+ ```
98
+ Before Committing:
99
+ - [ ] Run impact analysis
100
+ - [ ] Review all d=1 (WILL BREAK) items
101
+ - [ ] Verify test coverage for affected processes
102
+ - [ ] If risk > MEDIUM, get code review
103
+ - [ ] If cross-cluster, coordinate with other teams
104
+ ```
105
+
106
+ ## Example: "What breaks if I change validateUser?"
107
+
108
+ ```
109
+ 1. gitnexus_impact({target: "validateUser", direction: "upstream", repo: "my-app"})
110
+ → d=1: loginHandler, apiMiddleware
111
+ → d=2: authRouter, sessionManager
112
+
113
+ 2. READ gitnexus://repo/my-app/clusters
114
+ → Auth and API clusters affected
115
+
116
+ 3. Decision: 2 direct callers, 2 clusters = MEDIUM risk
117
+ ```
@@ -1,120 +1,120 @@
1
- ---
2
- name: gitnexus-refactoring
3
- description: Plan safe refactors using blast radius and dependency mapping
4
- ---
5
-
6
- # Refactoring with GitNexus
7
-
8
- ## Quick Start
9
- ```
10
- 0. READ gitnexus://repos → Discover indexed repos
11
- 1. If "Index is stale" → gitnexus_analyze({repo: "my-app"})
12
- 2. gitnexus_impact({target, direction: "upstream", repo: "my-app"}) → Map all dependents
13
- 3. READ gitnexus://repo/my-app/schema → Understand graph structure
14
- 4. gitnexus_cypher({query: "...", repo: "my-app"}) → Find all references
15
- ```
16
-
17
- ## When to Use
18
- - "Rename this function safely"
19
- - "Extract this into a module"
20
- - "Split this service"
21
- - "Refactor without breaking things"
22
-
23
- ## Checklists
24
-
25
- ### Rename Symbol
26
- ```
27
- Rename Refactoring:
28
- - [ ] gitnexus_impact({target: oldName, direction: "upstream", repo: "my-app"}) — find all callers
29
- - [ ] gitnexus_search({query: oldName, repo: "my-app"}) — find string literals
30
- - [ ] Check for reflection/dynamic references
31
- - [ ] Update in order: interface → implementation → usages
32
- - [ ] Run tests for affected processes
33
- ```
34
-
35
- ### Extract Module
36
- ```
37
- Extract Module:
38
- - [ ] gitnexus_explore({name: target, type: "symbol", repo: "my-app"}) — map dependencies
39
- - [ ] gitnexus_impact({target, direction: "upstream", repo: "my-app"}) — find callers
40
- - [ ] READ gitnexus://repo/my-app/cluster/{name} — check cohesion
41
- - [ ] Define new module interface
42
- - [ ] Update imports across affected files
43
- ```
44
-
45
- ### Split Function
46
- ```
47
- Split Function:
48
- - [ ] gitnexus_explore({name: target, type: "symbol", repo: "my-app"}) — understand callees
49
- - [ ] Group related logic
50
- - [ ] gitnexus_impact — verify callers won't break
51
- - [ ] Create new functions
52
- - [ ] Update callers
53
- ```
54
-
55
- ## Resource Reference
56
-
57
- ### gitnexus://repo/{name}/schema
58
- Graph structure for Cypher queries:
59
- ```yaml
60
- nodes: [Function, Class, Method, Community, Process]
61
- relationships: [CALLS, IMPORTS, EXTENDS, MEMBER_OF]
62
-
63
- example_queries:
64
- find_callers: |
65
- MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "X"})
66
- RETURN caller.name
67
- ```
68
-
69
- ### gitnexus://repo/{name}/cluster/{clusterName}
70
- Check if extraction preserves cohesion:
71
- ```yaml
72
- name: Payment
73
- cohesion: 92%
74
- members: [processPayment, validateCard, PaymentService]
75
- ```
76
-
77
- ## Tool Reference
78
-
79
- ### Finding all references
80
- ```cypher
81
- MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "validateUser"})
82
- RETURN caller.name, caller.filePath
83
- ORDER BY caller.filePath
84
- ```
85
-
86
- ### Finding imports of a module
87
- ```cypher
88
- MATCH (importer)-[:CodeRelation {type: 'IMPORTS'}]->(f:File {name: "utils.ts"})
89
- RETURN importer.name, importer.filePath
90
- ```
91
-
92
- ## Example: Safely Rename `validateUser` to `authenticateUser`
93
-
94
- ```
95
- 1. gitnexus_impact({target: "validateUser", direction: "upstream", repo: "my-app"})
96
- → loginHandler, apiMiddleware, testUtils
97
-
98
- 2. gitnexus_search({query: "validateUser", repo: "my-app"})
99
- → Found in: config.json (dynamic reference!)
100
-
101
- 3. READ gitnexus://repo/my-app/processes
102
- → LoginFlow, TokenRefresh, APIGateway
103
-
104
- 4. Plan update order:
105
- 1. Update declaration in auth.ts
106
- 2. Update config.json string reference
107
- 3. Update loginHandler
108
- 4. Update apiMiddleware
109
- 5. Run tests for LoginFlow, TokenRefresh
110
- ```
111
-
112
- ## Refactoring Safety Rules
113
-
114
- | Risk Factor | Mitigation |
115
- |-------------|------------|
116
- | Many callers (>5) | Update in small batches |
117
- | Cross-cluster | Coordinate with other teams |
118
- | String references | Search for dynamic usage |
119
- | Reflection | Check for dynamic invocation |
120
- | External exports | May break downstream repos |
1
+ ---
2
+ name: gitnexus-refactoring
3
+ description: Plan safe refactors using blast radius and dependency mapping
4
+ ---
5
+
6
+ # Refactoring with GitNexus
7
+
8
+ ## Quick Start
9
+ ```
10
+ 0. READ gitnexus://repos → Discover indexed repos
11
+ 1. If "Index is stale" → gitnexus_analyze({repo: "my-app"})
12
+ 2. gitnexus_impact({target, direction: "upstream", repo: "my-app"}) → Map all dependents
13
+ 3. READ gitnexus://repo/my-app/schema → Understand graph structure
14
+ 4. gitnexus_cypher({query: "...", repo: "my-app"}) → Find all references
15
+ ```
16
+
17
+ ## When to Use
18
+ - "Rename this function safely"
19
+ - "Extract this into a module"
20
+ - "Split this service"
21
+ - "Refactor without breaking things"
22
+
23
+ ## Checklists
24
+
25
+ ### Rename Symbol
26
+ ```
27
+ Rename Refactoring:
28
+ - [ ] gitnexus_impact({target: oldName, direction: "upstream", repo: "my-app"}) — find all callers
29
+ - [ ] gitnexus_search({query: oldName, repo: "my-app"}) — find string literals
30
+ - [ ] Check for reflection/dynamic references
31
+ - [ ] Update in order: interface → implementation → usages
32
+ - [ ] Run tests for affected processes
33
+ ```
34
+
35
+ ### Extract Module
36
+ ```
37
+ Extract Module:
38
+ - [ ] gitnexus_explore({name: target, type: "symbol", repo: "my-app"}) — map dependencies
39
+ - [ ] gitnexus_impact({target, direction: "upstream", repo: "my-app"}) — find callers
40
+ - [ ] READ gitnexus://repo/my-app/cluster/{name} — check cohesion
41
+ - [ ] Define new module interface
42
+ - [ ] Update imports across affected files
43
+ ```
44
+
45
+ ### Split Function
46
+ ```
47
+ Split Function:
48
+ - [ ] gitnexus_explore({name: target, type: "symbol", repo: "my-app"}) — understand callees
49
+ - [ ] Group related logic
50
+ - [ ] gitnexus_impact — verify callers won't break
51
+ - [ ] Create new functions
52
+ - [ ] Update callers
53
+ ```
54
+
55
+ ## Resource Reference
56
+
57
+ ### gitnexus://repo/{name}/schema
58
+ Graph structure for Cypher queries:
59
+ ```yaml
60
+ nodes: [Function, Class, Method, Community, Process]
61
+ relationships: [CALLS, IMPORTS, EXTENDS, MEMBER_OF]
62
+
63
+ example_queries:
64
+ find_callers: |
65
+ MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "X"})
66
+ RETURN caller.name
67
+ ```
68
+
69
+ ### gitnexus://repo/{name}/cluster/{clusterName}
70
+ Check if extraction preserves cohesion:
71
+ ```yaml
72
+ name: Payment
73
+ cohesion: 92%
74
+ members: [processPayment, validateCard, PaymentService]
75
+ ```
76
+
77
+ ## Tool Reference
78
+
79
+ ### Finding all references
80
+ ```cypher
81
+ MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "validateUser"})
82
+ RETURN caller.name, caller.filePath
83
+ ORDER BY caller.filePath
84
+ ```
85
+
86
+ ### Finding imports of a module
87
+ ```cypher
88
+ MATCH (importer)-[:CodeRelation {type: 'IMPORTS'}]->(f:File {name: "utils.ts"})
89
+ RETURN importer.name, importer.filePath
90
+ ```
91
+
92
+ ## Example: Safely Rename `validateUser` to `authenticateUser`
93
+
94
+ ```
95
+ 1. gitnexus_impact({target: "validateUser", direction: "upstream", repo: "my-app"})
96
+ → loginHandler, apiMiddleware, testUtils
97
+
98
+ 2. gitnexus_search({query: "validateUser", repo: "my-app"})
99
+ → Found in: config.json (dynamic reference!)
100
+
101
+ 3. READ gitnexus://repo/my-app/processes
102
+ → LoginFlow, TokenRefresh, APIGateway
103
+
104
+ 4. Plan update order:
105
+ 1. Update declaration in auth.ts
106
+ 2. Update config.json string reference
107
+ 3. Update loginHandler
108
+ 4. Update apiMiddleware
109
+ 5. Run tests for LoginFlow, TokenRefresh
110
+ ```
111
+
112
+ ## Refactoring Safety Rules
113
+
114
+ | Risk Factor | Mitigation |
115
+ |-------------|------------|
116
+ | Many callers (>5) | Update in small batches |
117
+ | Cross-cluster | Coordinate with other teams |
118
+ | String references | Search for dynamic usage |
119
+ | Reflection | Check for dynamic invocation |
120
+ | External exports | May break downstream repos |