ga-plugins-cli 0.1.0 → 0.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.
Files changed (55) hide show
  1. package/dist/config-patcher.d.ts +20 -50
  2. package/dist/config-patcher.d.ts.map +1 -1
  3. package/dist/config-patcher.js +138 -102
  4. package/dist/config-patcher.js.map +1 -1
  5. package/dist/index.js +75 -22
  6. package/dist/index.js.map +1 -1
  7. package/dist/installer.d.ts +0 -18
  8. package/dist/installer.d.ts.map +1 -1
  9. package/dist/installer.js +19 -39
  10. package/dist/installer.js.map +1 -1
  11. package/dist/types.d.ts +10 -6
  12. package/dist/types.d.ts.map +1 -1
  13. package/dist/uninstaller.d.ts +0 -23
  14. package/dist/uninstaller.d.ts.map +1 -1
  15. package/dist/uninstaller.js +22 -68
  16. package/dist/uninstaller.js.map +1 -1
  17. package/package.json +3 -2
  18. package/plugins/go-reviewer/.claude-plugin/plugin.json +12 -0
  19. package/plugins/go-reviewer/commands/go-review.md +424 -0
  20. package/plugins/go-reviewer/mcp-servers/go-reviewer-mcp/README.md +236 -0
  21. package/plugins/go-reviewer/mcp-servers/go-reviewer-mcp/main.go +678 -0
  22. package/plugins/go-scaffolder/.claude-plugin/plugin.json +12 -0
  23. package/plugins/go-scaffolder/commands/scaffold-service.md +802 -0
  24. package/plugins/go-scaffolder/reference-service/.env.example +27 -0
  25. package/plugins/go-scaffolder/reference-service/Dockerfile +55 -0
  26. package/plugins/go-scaffolder/reference-service/REFERENCE-SERVICE-NOTICE.md +104 -0
  27. package/plugins/go-scaffolder/reference-service/cmd/server/main.go +266 -0
  28. package/plugins/go-scaffolder/reference-service/config/config.go +67 -0
  29. package/plugins/go-scaffolder/reference-service/go.mod +17 -0
  30. package/plugins/go-scaffolder/reference-service/internal/domain/booking.go +118 -0
  31. package/plugins/go-scaffolder/reference-service/internal/handler/booking.go +242 -0
  32. package/plugins/go-scaffolder/reference-service/internal/handler/booking_test.go +451 -0
  33. package/plugins/go-scaffolder/reference-service/internal/repository/booking_postgres.go +124 -0
  34. package/plugins/go-scaffolder/reference-service/internal/usecase/booking.go +181 -0
  35. package/plugins/go-standards/.claude-plugin/plugin.json +22 -0
  36. package/plugins/go-standards/commands/go-standards-check.md +232 -0
  37. package/plugins/go-standards/skills/concurrency.md +336 -0
  38. package/plugins/go-standards/skills/config.md +267 -0
  39. package/plugins/go-standards/skills/error-handling.md +286 -0
  40. package/plugins/go-standards/skills/http-chi.md +390 -0
  41. package/plugins/go-standards/skills/logging-observability.md +340 -0
  42. package/plugins/go-standards/skills/naming-and-style.md +315 -0
  43. package/plugins/go-standards/skills/project-layout.md +313 -0
  44. package/plugins/go-standards/skills/testing.md +366 -0
  45. package/plugins/java2go-porter/.claude-plugin/plugin.json +21 -0
  46. package/plugins/java2go-porter/agents/analyzer.md +232 -0
  47. package/plugins/java2go-porter/agents/reviewer.md +241 -0
  48. package/plugins/java2go-porter/agents/test-pairer.md +365 -0
  49. package/plugins/java2go-porter/agents/translator.md +419 -0
  50. package/plugins/java2go-porter/commands/port-java-service.md +149 -0
  51. package/plugins/java2go-porter/skills/idiom-mapping.md +75 -0
  52. package/plugins/migration-safety/.claude-plugin/plugin.json +20 -0
  53. package/plugins/migration-safety/commands/gen-characterization-test.md +452 -0
  54. package/plugins/migration-safety/commands/strangler-plan.md +356 -0
  55. package/plugins/migration-safety/skills/strangler-fig.md +382 -0
@@ -0,0 +1,356 @@
1
+ # Command: strangler-plan
2
+
3
+ Produce a step-by-step Strangler Fig traffic-cutover checklist for migrating a domain from Java/Spring Boot to Go at Garuda Airlines. The output is a human-actionable plan — not a script. All traffic switching is performed by the human team using their gateway tooling.
4
+
5
+ ---
6
+
7
+ ## Step 1: Identify the Domain
8
+
9
+ Ask the user:
10
+
11
+ > "What is the name of the domain or service group being migrated?
12
+ > (e.g., `booking`, `check-in`, `loyalty-points`)"
13
+
14
+ Record as `<domain-name>`.
15
+
16
+ ---
17
+
18
+ ## Step 2: Identify the Gateway Technology
19
+
20
+ Ask the user:
21
+
22
+ > "What gateway or routing technology routes traffic to your services?
23
+ > Please choose or describe:
24
+ >
25
+ > 1. Kong Gateway
26
+ > 2. Nginx (or OpenResty)
27
+ > 3. AWS ALB (Application Load Balancer) with weighted target groups
28
+ > 4. Istio / Envoy service mesh
29
+ > 5. Custom (describe it)
30
+ > 6. NEEDS DECISION — not yet decided
31
+ >
32
+ > If you choose NEEDS DECISION, a gateway-agnostic checklist with placeholders will be generated."
33
+
34
+ Record as `<gateway-type>`. If the user selects NEEDS DECISION or 6, set `<gateway-agnostic> = true`.
35
+
36
+ ---
37
+
38
+ ## Step 3: List Endpoints Being Migrated in This Phase
39
+
40
+ Ask the user:
41
+
42
+ > "Which endpoints are being migrated to the Go service in this phase?
43
+ > List them one per line, e.g.:
44
+ > POST /api/v1/bookings
45
+ > GET /api/v1/bookings/{id}
46
+ > DELETE /api/v1/bookings/{id}
47
+ >
48
+ > Note: In the GA 10→1 consolidation, you may be migrating endpoint groups from multiple
49
+ > Java services at once. List ALL endpoints being cut over in this phase."
50
+
51
+ Record as `<endpoint-list>`.
52
+
53
+ ---
54
+
55
+ ## Step 4: Identify the Java and Go Service Coordinates
56
+
57
+ Ask the user:
58
+
59
+ > "What are the service names and host/port details for traffic routing?
60
+ > - Java service name (as known to your gateway): e.g., `booking-java-svc`
61
+ > - Go service name (as known to your gateway): e.g., `flight-ops-svc`
62
+ > - Java service host:port (in test/staging): e.g., `booking-java-svc.internal:8080`
63
+ > - Go service host:port (in test/staging): e.g., `flight-ops-svc.internal:8081`"
64
+
65
+ Record as `<java-svc>`, `<go-svc>`, `<java-host>`, `<go-host>`.
66
+
67
+ ---
68
+
69
+ ## Step 5: Identify Monitoring Dashboard
70
+
71
+ Ask the user:
72
+
73
+ > "Where are your Grafana (or equivalent) dashboards for these services?
74
+ > (URL or dashboard name — used to generate monitoring checklist items.
75
+ > If unknown, enter UNKNOWN and placeholders will be used.)"
76
+
77
+ Record as `<dashboard-url>`.
78
+
79
+ ---
80
+
81
+ ## Step 6: Generate the Strangler Fig Cutover Checklist
82
+
83
+ Produce a Markdown file at `strangler-plans/<domain-name>-cutover-plan.md` with the following content:
84
+
85
+ ---
86
+
87
+ ### strangler-plans/<domain-name>-cutover-plan.md
88
+
89
+ ```markdown
90
+ # Strangler Fig Cutover Plan: <domain-name>
91
+
92
+ **Domain**: <domain-name>
93
+ **Java service**: <java-svc> (<java-host>)
94
+ **Go service**: <go-svc> (<go-host>)
95
+ **Gateway**: <gateway-type>
96
+ **Endpoints in this phase**: <endpoint-list>
97
+ **Generated**: <ISO date>
98
+ **Skill reference**: migration-safety/skills/strangler-fig.md
99
+
100
+ > This plan describes incremental traffic cutover using the Strangler Fig pattern.
101
+ > No big-bang switchover. Java and Go services run in parallel at all times until Step 7.
102
+ > Rollback is always available until Step 7.
103
+
104
+ ---
105
+
106
+ ## Pre-Flight Checklist (Complete Before Starting)
107
+
108
+ - [ ] Go service `<go-svc>` is deployed and healthy in the target environment
109
+ - [ ] Go service passes ALL characterization tests (see `gen-characterization-test` output)
110
+ - [ ] REVIEW.md has been signed off — all MUST DECIDE items resolved
111
+ - [ ] Java service `<java-svc>` remains running and unchanged
112
+ - [ ] Monitoring dashboard is open: <dashboard-url>
113
+ - [ ] Team members on standby: __________________ (list names)
114
+ - [ ] Rollback procedure has been tested: (yes/no) ______
115
+ - [ ] Database migration (if any) is complete and both services can read the same schema: (yes/no) ______
116
+ - [ ] On-call engineer notified: (yes/no) ______
117
+
118
+ ---
119
+
120
+ ## Step 1: Deploy Go Service (Both Running)
121
+
122
+ **Goal**: Go service is live, receiving zero production traffic. Java service handles 100%.
123
+
124
+ Actions:
125
+ - [ ] Deploy `<go-svc>` to production environment
126
+ - [ ] Verify health endpoint: `curl -f http://<go-host>/health`
127
+ - [ ] Verify Go service connects to production database (read-only test query)
128
+ - [ ] Verify Go service connects to all external dependencies (broker, external HTTP clients)
129
+ - [ ] Confirm gateway can route to Go service (test with direct host access, bypassing gateway)
130
+
131
+ **Checkpoint**: both `<java-svc>` and `<go-svc>` are running. 100% traffic still on Java.
132
+
133
+ ---
134
+
135
+ ## Step 2: Canary — Route 5% of Traffic to Go Service
136
+
137
+ **Goal**: small percentage of real traffic hits the Go service. Observe for 30 minutes.
138
+ **Rollback trigger**: error rate on Go service exceeds 0.1% OR p99 latency degrades >20%.
139
+
140
+ ```
141
+ <GATEWAY-SPECIFIC CONFIG BLOCK>
142
+ ```
143
+
144
+ <!-- For Kong: -->
145
+ <!-- Add weighted route:
146
+ - Java upstream: weight 95
147
+ - Go upstream: weight 5
148
+ - Endpoints: <endpoint-list>
149
+ kong deck sync --state kong-canary-5pct.yaml
150
+ -->
151
+
152
+ <!-- For Nginx: -->
153
+ <!-- upstream block with split_clients:
154
+ split_clients "${remote_addr}${uri}" $backend {
155
+ 5% go_upstream;
156
+ * java_upstream;
157
+ }
158
+ -->
159
+
160
+ <!-- For AWS ALB: -->
161
+ <!-- Weighted target group: Java TG weight=95, Go TG weight=5
162
+ aws elbv2 modify-rule --rule-arn <RULE_ARN> \
163
+ --actions Type=forward,ForwardConfig='{TargetGroups=[{TargetGroupArn=<JAVA_TG_ARN>,Weight=95},{TargetGroupArn=<GO_TG_ARN>,Weight=5}]}'
164
+ -->
165
+
166
+ <!-- For Istio: -->
167
+ <!-- VirtualService weight split:
168
+ spec:
169
+ http:
170
+ - route:
171
+ - destination: host: <java-svc>, weight: 95
172
+ - destination: host: <go-svc>, weight: 5
173
+ -->
174
+
175
+ <!-- For GATEWAY_AGNOSTIC (NEEDS DECISION): -->
176
+ <!-- TODO(human): implement 5% traffic split to <go-host> using your gateway.
177
+ The split should be by request percentage (random or hash-based), not by endpoint.
178
+ Endpoints affected: <endpoint-list>
179
+ -->
180
+
181
+ Monitor for 30 minutes:
182
+ - [ ] Error rate on `<go-svc>`: ____% (target: < 0.1%)
183
+ - [ ] p99 latency on `<go-svc>`: ____ms (target: within 20% of Java baseline)
184
+ - [ ] Error rate on `<java-svc>`: ____% (should be unchanged from before)
185
+ - [ ] Business KPIs (e.g., booking completion rate): ____ (should be unchanged)
186
+ - [ ] No new error log lines in `<go-svc>` that were not present before
187
+
188
+ **Checkpoint**: 30 minutes at 5% with no degradation. Proceed to Step 3.
189
+
190
+ ---
191
+
192
+ ## Step 3: Anti-Corruption Layer (If Needed)
193
+
194
+ **Goal**: if request or response shapes differ between Java and Go, add translation layer.
195
+
196
+ - [ ] Compare Java request schema with Go request schema for each endpoint in <endpoint-list>
197
+ - [ ] Compare Java response schema with Go response schema for each endpoint
198
+ - [ ] If schemas match: skip this step (document "schemas match" here)
199
+ - [ ] If schemas differ:
200
+ - [ ] Implement ACL adapter (request transformation on ingress, response transformation on egress)
201
+ - [ ] Add ACL to the gateway layer OR as a sidecar on the Go service
202
+ - [ ] Re-run characterization tests with ACL in place
203
+ - [ ] Document which fields differ and the transformation applied: __________________
204
+
205
+ ACL status: [ ] Not needed [ ] Implemented — see: __________________
206
+
207
+ ---
208
+
209
+ ## Step 4: Ramp Traffic to 25% → 50% → 75%
210
+
211
+ For each ramp increment, wait at least 1 hour and verify monitoring before proceeding.
212
+
213
+ ### 4a: Ramp to 25%
214
+
215
+ - [ ] Update gateway: Go=25%, Java=75%
216
+ - [ ] Wait 1 hour
217
+ - [ ] Error rate on Go: ____% (target: < 0.1%)
218
+ - [ ] p99 latency: ____ms
219
+ - [ ] Business KPIs: ____
220
+
221
+ ### 4b: Ramp to 50%
222
+
223
+ - [ ] Update gateway: Go=50%, Java=50%
224
+ - [ ] Wait 1 hour
225
+ - [ ] Error rate on Go: ____% (target: < 0.1%)
226
+ - [ ] p99 latency: ____ms
227
+ - [ ] Business KPIs: ____
228
+
229
+ ### 4c: Ramp to 75%
230
+
231
+ - [ ] Update gateway: Go=75%, Java=25%
232
+ - [ ] Wait 1 hour
233
+ - [ ] Error rate on Go: ____% (target: < 0.1%)
234
+ - [ ] p99 latency: ____ms
235
+ - [ ] Business KPIs: ____
236
+
237
+ **Checkpoint**: 75% Go traffic stable for 1 hour. Proceed to Step 5.
238
+
239
+ ---
240
+
241
+ ## Step 5: Full Cutover — 100% Traffic to Go Service
242
+
243
+ **Goal**: all production traffic for <endpoint-list> is routed to `<go-svc>`.
244
+ **Rollback window**: Java service stays running for 2 weeks after this step.
245
+
246
+ - [ ] Update gateway: Go=100%, Java=0%
247
+
248
+ <!-- Gateway-specific 100% config: same as Step 2 but weight=100 for Go, weight=0 for Java -->
249
+ <!-- TODO(human): apply 100% routing config in your gateway -->
250
+
251
+ - [ ] Verify: send test request to each endpoint in <endpoint-list>, confirm response from Go service
252
+ (check X-Service-Name or similar header if available)
253
+ - [ ] Monitor for 2 hours:
254
+ - [ ] Error rate: ____% (target: < 0.1%)
255
+ - [ ] p99 latency: ____ms
256
+ - [ ] Business KPIs: ____
257
+ - [ ] No unexpected errors in Go service logs
258
+ - [ ] Notify stakeholders: "Domain `<domain-name>` is now served 100% by Go service `<go-svc>`"
259
+
260
+ **Checkpoint**: 2 hours at 100% stable. Java remains running as fallback.
261
+
262
+ ---
263
+
264
+ ## Step 6: Fallback Period — Keep Java Running for 2 Weeks
265
+
266
+ **Goal**: Java service stays running and ready for immediate rollback if a hidden defect surfaces.
267
+
268
+ - [ ] Do NOT stop or undeploy `<java-svc>`
269
+ - [ ] Keep gateway routing config such that Java can be restored to 100% within 5 minutes
270
+ - [ ] Daily monitoring checks during the 2-week fallback window:
271
+ - [ ] Day 1 check: __________________
272
+ - [ ] Day 3 check: __________________
273
+ - [ ] Day 7 check: __________________
274
+ - [ ] Day 14 check: __________________
275
+ - [ ] At end of 2 weeks: team confirms no rollback was needed: (yes/no) ______
276
+
277
+ **Rollback procedure** (if needed at any point before Step 7):
278
+ 1. Update gateway: Java=100%, Go=0% (reverse of Step 5)
279
+ 2. Notify team
280
+ 3. File incident report
281
+ 4. Do not retry Go cutover until root cause is identified and fixed
282
+
283
+ ---
284
+
285
+ ## Step 7: Decommission Java Service
286
+
287
+ **HUMAN DECISION REQUIRED before this step.**
288
+ This step is irreversible. Do not proceed until Step 6 is fully complete and signed off.
289
+
290
+ - [ ] Team confirms: no rollback events during 2-week fallback window
291
+ - [ ] Characterization tests are passing against Go service in production (or staging equivalent)
292
+ - [ ] Archive Java source code to long-term storage (do not delete permanently yet)
293
+ - [ ] Update gateway: remove Java upstream entirely
294
+ - [ ] Stop and undeploy `<java-svc>`
295
+ - [ ] Update team documentation, runbooks, and on-call guides
296
+ - [ ] Decommission Java service infrastructure (scale down to zero)
297
+ - [ ] Notify downstream teams that `<java-svc>` is decommissioned
298
+
299
+ **Signed off by**: __________________
300
+ **Date**: __________________
301
+
302
+ ---
303
+
304
+ ## Rollback Quick Reference
305
+
306
+ | Situation | Action | Time to rollback |
307
+ |-----------|--------|-----------------|
308
+ | Go service crashes (Step 2-4) | Update gateway weight: Java=100%, Go=0% | < 5 min |
309
+ | Silent data corruption detected (Step 5) | Gateway: Java=100%; investigate Go service | < 5 min |
310
+ | Latency spike on Go (Step 5) | Gateway: Java=100%; profile Go service | < 5 min |
311
+ | After Step 7 (decommissioned) | Redeploy Java from archive; restore DB if needed | > 1 hour |
312
+
313
+ **Decision authority for rollback**: any engineer on the on-call rotation may initiate rollback
314
+ without management approval. Speed is more important than process here.
315
+
316
+ ---
317
+
318
+ ## Monitoring Checklist (Reference During All Steps)
319
+
320
+ Dashboard: <dashboard-url>
321
+
322
+ | Metric | Java Baseline | Go Target | Alert Threshold |
323
+ |--------|-------------|-----------|----------------|
324
+ | Error rate (5xx) | ____% | ____% | > 0.1% |
325
+ | p99 latency | ____ms | ____ms | > 20% above baseline |
326
+ | Request throughput | ____ req/s | ____ req/s | < 10% of expected |
327
+ | DB connection pool utilization | ____% | ____% | > 80% |
328
+ | Business KPI: <domain-specific KPI> | ____ | ____ | > 1% delta |
329
+
330
+ TODO(human): fill in baseline values from Java service before starting cutover.
331
+ ```
332
+
333
+ ---
334
+
335
+ ## Step 7: Print Summary
336
+
337
+ After writing the plan file, print:
338
+
339
+ ```
340
+ ==========================================================================
341
+ STRANGLER FIG CUTOVER PLAN GENERATED
342
+ Domain: <domain-name>
343
+ Gateway: <gateway-type>
344
+ Endpoints: <endpoint-list>
345
+ Output: strangler-plans/<domain-name>-cutover-plan.md
346
+
347
+ BEFORE STARTING CUTOVER:
348
+ 1. Complete the Pre-Flight Checklist in the plan
349
+ 2. Ensure characterization tests pass (run: gen-characterization-test first)
350
+ 3. Assign a rollback decision authority
351
+ 4. Open your monitoring dashboard: <dashboard-url>
352
+
353
+ This plan follows the Strangler Fig strategy — see migration-safety/skills/strangler-fig.md
354
+ for the full rationale and pattern reference.
355
+ ==========================================================================
356
+ ```