Skip to content

Commit 0923dd1

Browse files
icarthickclaude
andcommitted
refactor(migration-to-aws): Consolidate duplicate schemas into single source of truth
Implement Option 1: Consolidate all schemas in output-schema.md as the authoritative source, removing duplicates from phase files. Changes: - clarify.md: Replace full clarified.json schema with reference to output-schema.md - discover-iac.md Step 6a: Replace gcp-resource-inventory.json schema with reference - discover-iac.md Step 6b: Replace gcp-resource-clusters.json schema with reference - Keep critical field names in phase files for quick reference during implementation Benefits: - Single source of truth: output-schema.md is now the only place to update schemas - Eliminates drift risk: No more duplicate definitions to keep in sync - Reduces duplication: Removed 50+ lines of redundant schema examples - Improved maintainability: Future schema changes in one place only Previous issue: gcp-resource-inventory.json schema was inconsistent between discover-iac.md and output-schema.md. Now resolved by consolidation. Updates REVIEWER_FEEDBACK.md to mark issue as RESOLVED. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent a9c299c commit 0923dd1

3 files changed

Lines changed: 19 additions & 97 deletions

File tree

REVIEWER_FEEDBACK.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,12 @@
171171
- Option 2: Create dedicated `schemas/` directory with individual schema files
172172
- Option 3: Use $ref references to avoid duplication
173173

174-
**Status**: ⏳ PENDING
174+
**Status**: ✅ RESOLVED
175+
- Implemented Option 1: Consolidated all schemas in output-schema.md
176+
- clarify.md: Replaced full schema with reference to output-schema.md
177+
- discover-iac.md: Replaced gcp-resource-inventory.json and gcp-resource-clusters.json schemas with references
178+
- clarify-questions.md: Kept as-is (provides question definitions, not authoritative schema)
179+
- Single source of truth established: output-schema.md is now the only place to update schemas
175180

176181
---
177182

plugins/migration-to-aws/skills/gcp-to-aws/references/phases/clarify.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,14 @@ For Modes C/D:
3333

3434
## Step 4: Write Clarified Output
3535

36-
Write `clarified.json`:
36+
Write `clarified.json` to `.migration/[MMDD-HHMM]/` directory.
3737

38-
```json
39-
{
40-
"mode": "A|B|C|D",
41-
"answers": {
42-
"q1_timeline": "3-6 months",
43-
"q2_primary_concern": "cost",
44-
"q3_team_experience": "moderate",
45-
"q4_traffic_profile": "predictable",
46-
"q5_database_requirements": "structured",
47-
"q6_cost_sensitivity": "high",
48-
"q7_multi_cloud": "no",
49-
"q8_compliance": "none"
50-
},
51-
"timestamp": "2026-02-26T14:30:00Z"
52-
}
53-
```
38+
**Schema:** See `references/shared/output-schema.md``clarified.json (Phase 2 output)` section for complete schema and field documentation.
39+
40+
**Key fields:**
41+
- `mode`: "A", "B", "C", or "D" (answering mode selected in Step 2)
42+
- `answers`: Object with keys q1_timeline through q8_compliance
43+
- `timestamp`: ISO 8601 timestamp
5444

5545
## Step 5: Update Phase Status
5646

plugins/migration-to-aws/skills/gcp-to-aws/references/phases/discover/discover-iac.md

Lines changed: 6 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -70,103 +70,30 @@ Extracts and clusters GCP resources from Terraform files. Produces final invento
7070
### 6a: Write gcp-resource-inventory.json
7171

7272
1. Create file: `.migration/[MMDD-HHMM]/gcp-resource-inventory.json`
73-
2. Write with exact schema (see below):
74-
75-
```json
76-
{
77-
"timestamp": "2026-02-26T14:30:00Z",
78-
"metadata": {
79-
"total_resources": 50,
80-
"primary_resources": 12,
81-
"secondary_resources": 38,
82-
"total_clusters": 6,
83-
"terraform_available": true
84-
},
85-
"resources": [
86-
{
87-
"address": "google_cloud_run_service.api",
88-
"type": "google_cloud_run_service",
89-
"classification": "PRIMARY",
90-
"secondary_role": null,
91-
"cluster_id": "compute_cloudrun_001",
92-
"config": {
93-
"region": "us-central1",
94-
"name": "api"
95-
},
96-
"dependencies": ["google_sql_database_instance.main"],
97-
"depth": 2,
98-
"serves": []
99-
},
100-
{
101-
"address": "google_service_account.app",
102-
"type": "google_service_account",
103-
"classification": "SECONDARY",
104-
"secondary_role": "identity",
105-
"cluster_id": "compute_cloudrun_001",
106-
"config": {},
107-
"dependencies": [],
108-
"depth": 1,
109-
"serves": ["google_cloud_run_service.api"]
110-
}
111-
]
112-
}
113-
```
73+
2. Write with exact schema per `references/shared/output-schema.md``gcp-resource-inventory.json (Phase 1 output)` section
11474

11575
**CRITICAL field names (use EXACTLY these):**
11676

11777
- `address` (resource Terraform address)
11878
- `type` (resource Terraform type)
11979
- `classification` (PRIMARY or SECONDARY)
120-
- `secondary_role` (for secondaries only)
80+
- `secondary_role` (for secondaries only; one of: identity, access_control, network_path, configuration, encryption, orchestration)
12181
- `cluster_id` (assigned cluster)
122-
- `depth` (topological depth)
123-
- `serves` (for secondaries only)
82+
- `depth` (topological depth, integer ≥ 0)
83+
- `serves` (for secondaries only; list of resources this secondary supports)
12484

12585
### 6b: Write gcp-resource-clusters.json
12686

12787
1. Create file: `.migration/[MMDD-HHMM]/gcp-resource-clusters.json`
128-
2. Write with exact schema:
129-
130-
```json
131-
{
132-
"timestamp": "2026-02-26T14:30:00Z",
133-
"metadata": {
134-
"total_clusters": 6
135-
},
136-
"clusters": [
137-
{
138-
"cluster_id": "compute_cloudrun_001",
139-
"name": "Cloud Run Services",
140-
"type": "compute",
141-
"description": "Primary: cloud_run_service, Secondary: service_account, iam_member",
142-
"gcp_region": "us-central1",
143-
"primary_resources": ["google_cloud_run_service.api", "google_cloud_run_service.worker"],
144-
"secondary_resources": [
145-
"google_service_account.app",
146-
"google_cloud_run_service_iam_member.*"
147-
],
148-
"network": "network_vpc_001",
149-
"creation_order_depth": 2,
150-
"must_migrate_together": true,
151-
"dependencies": ["database_sql_001"],
152-
"edges": [
153-
{
154-
"from": "google_cloud_run_service.api",
155-
"to": "google_sql_database_instance.main",
156-
"relationship_type": "data_dependency"
157-
}
158-
]
159-
}
160-
]
161-
}
162-
```
88+
2. Write with exact schema per `references/shared/output-schema.md``gcp-resource-clusters.json (Phase 1 output)` section
16389

16490
**CRITICAL field names (use EXACTLY these):**
16591

16692
- `cluster_id` (matches resources' cluster_id)
16793
- `primary_resources` (array of addresses)
16894
- `secondary_resources` (array of addresses)
16995
- `creation_order_depth` (matches resource depths)
96+
- `gcp_region` (GCP region for this cluster)
17097
- `edges` (array of {from, to, relationship_type})
17198

17299
### 6c: Validate Both Files Exist

0 commit comments

Comments
 (0)