Generated banner for GCP To AWS
Generated logo for GCP To AWS

GCP To AWS

ClineOfficialPublished by Cline

  • Skill
  • Workflow
  • Cloud and DevOps
  • Apache-2.0
  • Low risk

From the author

Migrate workloads from Google Cloud Platform to AWS — including AI and agentic workloads regardless of cloud provider. Triggers on: migrate from GCP, GCP to AWS, move off Google Cloud, migrate Terraform to AWS, migrate Cloud SQL to RDS, migrate GKE to EKS, migrate Cloud Run to Fargate, Google Cloud migration, migrate from OpenAI to Bedrock, move off OpenAI, switch from ChatGPT API to AWS, migrate from Gemini to Bedrock, migrate LangChain to Bedrock, migrate LangGraph to AWS, migrate agentic workloads to AWS, move AI workloads to AWS, migrate my AI app to AWS. Runs a 6-phase process: discover GCP resources from Terraform files, app code, or billing exports, clarify migration requirements, design AWS architecture, estimate costs, generate migration artifacts, and collect optional feedback. Clarify must finish before Design, Estimate, or Generate. Includes AI provider migration guidance (for example, OpenAI to Amazon Bedrock) by selecting closest-fit Bedrock model families for required modality, latency/quality
— the description by Cline

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The gcp-to-aws skill provides a deterministic, multi-phase process to migrate Google Cloud Platform (GCP) workloads to AWS. It supports infrastructure migration via Terraform analysis and AI workload migration by mapping models to Amazon Bedrock. The skill enforces a strict state machine, requiring discovery, clarification, design, estimation, and generation phases to ensure a reliable migration path. It includes specific logic for handling hybrid stacks, AI provider transitions, and complex infrastructure clustering.

What it does

  • Discovers GCP resources from Terraform, application code, or billing data.
  • Clarifies migration requirements through a structured questionnaire.
  • Designs AWS architecture based on GCP workload types and AI model requirements.
  • Estimates costs for the proposed AWS infrastructure and AI services.
  • Generates migration artifacts including Terraform configurations and AI provider adapters.
  • Provides specialized guidance for migrating AI workloads from Gemini or OpenAI to Amazon Bedrock.

When to use it

  • When you need to migrate existing GCP infrastructure to AWS.
  • When you are looking to move AI-driven applications from GCP or OpenAI to Amazon Bedrock.
  • When you have Terraform files or billing exports and need a structured migration plan.
  • When you require a step-by-step, validated approach to re-platforming cloud services.

Advantages

  • Enforces a rigorous, fail-closed state machine to prevent skipped steps.
  • Provides intelligent mapping of GCP services to AWS equivalents.
  • Includes specific logic for AI workload migration and model compatibility.
  • Supports multi-signal discovery using IaC, code, and billing data.
  • Ensures consistent artifact generation through a structured 6-phase process.

Usage examples

“Migrate my GKE and Cloud SQL setup to AWS.”
The agent initiates the discovery phase, analyzing your Terraform files to identify GKE and Cloud SQL resources, then guides you through the clarification and design phases for EKS and RDS.
“I need to move my LangChain app from OpenAI to Bedrock.”
The agent identifies the AI workload, selects the best-fit Bedrock model family, and generates the necessary provider adapters and migration documentation.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/cline/gcp-to-aws/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip gcp-to-aws.zip -d .agents/skills

Documentation by Cline

GCP-to-AWS Migration Skill

Philosophy

  • Re-platform by default: Select AWS services that match GCP workload types (e.g., Cloud Run → Fargate, Cloud SQL → RDS).

  • Dev sizing unless specified: Default to development-tier capacity (e.g., db.t4g.micro, single AZ). Upgrade only on user direction.

  • No human one-time migration costs: Do not present human labor, professional services, or people-time work as dollar estimates or "one-time migration cost" budget categories. Vendor charges grounded in data (for example GCP data transfer egress in the infra estimate when billing exists) are allowed.

  • Multi-signal approach: Design phase adapts based on available inputs — Terraform IaC for infrastructure, billing data for service mapping, and app code for AI workload detection.

  • BigQuery / google_bigquery_*: The skill does not recommend a specific AWS analytics or warehouse service. During Clarify, if discovery shows BigQuery (IaC google_bigquery_* and/or billing rows for BigQuery), you must surface the specialist advisory before Design (see references/phases/clarify/clarify.md). Design output uses Deferred — specialist engagement; keep directing the user to their AWS account team and/or a data analytics migration partner through Design, Estimate, and docs (see references/phases/design/design-infra.md BigQuery specialist gate).


Definitions

  • "Load" = Read the file using the Read tool and follow its instructions. Do not summarize or skip sections.

  • $MIGRATION_DIR = The run-specific directory under .migration/ (e.g., .migration/0226-1430/). Set during Phase 1 (Discover).


Context Loading Rules

Each phase loads reference files on demand. To keep per-turn context manageable and prevent instruction-following degradation:

  • Budget: Each phase should load no more than ~800 lines of instructions (excluding user artifacts like JSON profiles and MCP tool results).

  • Conditional loading: Reference files with trigger conditions (e.g., agentic_profile.is_agentic == true) MUST NOT be loaded unless the condition is met. Do not speculatively load files.

  • No duplication: Model mapping tables, pricing data, and shared warnings exist in one canonical file. Other files reference them; they do not copy them inline.

  • Progressive depth: Phase orchestrators (design.md, generate.md) contain short routing logic that points to detailed sub-files. Load the sub-file only when its path is selected.

Conditional reference files (load ONLY when condition is true):

FileCondition
design-refs/ai-gemini-to-bedrock.mdai-workload-profile.json exists AND summary.ai_source = "gemini" or "both"
design-refs/ai-openai-to-bedrock.mdai-workload-profile.json exists AND summary.ai_source = "openai" or "both"
design-refs/ai-anthropic-to-bedrock.mdai-workload-profile.json exists AND summary.ai_source = "anthropic"
design-refs/ai.mdai-workload-profile.json exists AND summary.ai_source = "other"
design-refs/design-ref-harness.mdagentic_profile.is_agentic == true AND ai_constraints.agentic.migration_approach == "harness"
design-refs/design-ref-agentic-to-agentcore.mdagentic_profile.is_agentic == true AND ai_constraints.agentic.migration_approach == "strands"
shared/retarget-gotchas.mdagentic_profile.is_agentic == true AND ai_constraints.agentic.migration_approach == "retarget"

When adding new reference files, verify the phase's total loaded instructions remain under budget. If a new file would exceed ~800 lines when combined with other loaded refs, split it or make it conditional.

Hybrid stack budget warning:

When both gcp-resource-inventory.json AND ai-workload-profile.json exist, the combined design refs will approach the ~800-line budget. Output this warning to the user before loading the AI design refs:

"⚠️ This is a large hybrid stack (infrastructure + AI workloads). To ensure complete and accurate recommendations, consider running the migration in two separate passes:

Pass 1 — Infrastructure: Run with only your Terraform files to get infra mapping, Terraform generation, and cost estimates.

Pass 2 — AI workloads: Run with only your application code to get Bedrock model recommendations, provider adapters, and AI migration artifacts.

Continue with the combined run? (Y/N)"

If the user chooses to continue, proceed with the combined run. Load AI refs after infra refs to preserve infra instruction fidelity. If the user declines, stop and instruct them to re-run with a single input source type.

This warning is advisory only — it does not block the run.


Prerequisites

User must provide at least one GCP source:

  • Terraform IaC: .tf files (with optional .tfvars, .tfstate)

  • Application code: Source files with GCP SDK or AI framework imports

  • Billing data: GCP billing/cost/usage export files (CSV or JSON)

If none of the above are found, stop and ask user to provide at least one source type.


State Machine

This is the execution controller. After completing each phase, consult this table to determine the next action.

Current StateConditionNext Action
discoverphases.discover != "completed"Load references/phases/discover/discover.md
clarifyphases.discover == "completed" AND phases.clarify != "completed"Load references/phases/clarify/clarify.md
designphases.clarify == "completed" AND phases.design != "completed"Load references/phases/design/design.md
estimatephases.design == "completed" AND phases.estimate != "completed"Load references/phases/estimate/estimate.md
generatephases.estimate == "completed" AND phases.generate != "completed"Load references/phases/generate/generate.md
completephases.generate == "completed" AND phases.feedback == "pending"Set phases.feedback to "completed" (user had two chances), then migration complete
completephases.generate == "completed" AND phases.feedback == "completed"Migration planning complete

How to determine current state (deterministic):

  1. Read $MIGRATION_DIR/.phase-status.json

  2. If current_phase exists, use it (must match one of: discover, clarify, design, estimate, generate, complete)

  3. Otherwise use ordered phase evaluation: discover → clarify → design → estimate → generate

  4. Pick the first phase in that order where phases.<phase> != "completed"; if none, state is complete

Phase gate checks: If prior phase incomplete, do not advance (e.g., cannot enter estimate without completed design).

Clarify is mandatory: Do not load references/phases/design/design.md, references/phases/estimate/estimate.md, or references/phases/generate/generate.md unless $MIGRATION_DIR/.phase-status.json exists and phases.clarify is exactly "completed". A preferences.json file alone is not sufficient proof that Clarify ran. If the user asks to skip Clarify or jump straight to Design, cost estimate, or artifact generation, refuse briefly, then load references/phases/clarify/clarify.md and run Phase 2. There is no exception for "quick" or "obvious" migrations.

Feedback checkpoints: Feedback is not a sequential phase — it is offered at two interleaved checkpoints (after Discover and after Estimate). See the Feedback Checkpoints section below for details.

Handoff Gate Orchestration (Fail Closed)

Load references/shared/handoff-gates.md when executing any phase completion step.

  1. Single $MIGRATION_DIR: Use one run directory for the entire migration. Do not mix artifacts across .migration/*/ sessions.

  2. Re-read from disk: Before each phase (and before each handoff gate), Read required artifacts from $MIGRATION_DIR/. Do not rely on chat memory.

  3. Advance only on HANDOFF_OK: A phase is complete only when its orchestrator emits HANDOFF_OK | phase=<name> | artifacts=.... Do not load the next phase without it.

  4. On GATE_FAIL: Output the failure line(s) to the user in plain language. Do NOT modify artifacts to pass the gate. Do NOT continue to the next phase. Tell the user which phase to re-run.

  5. Re-entry: Re-running an earlier phase after downstream phases completed requires explicit user confirmation; downstream phases must be reset to "pending". See handoff-gates.md re-entry table.

Generate phase additionally loads references/shared/validate-artifacts.md before writing migration-report.html.


State Validation

When reading $MIGRATION_DIR/.phase-status.json, validate before proceeding:

  1. Multiple sessions: If multiple directories exist under .migration/, list them with their phase status and ask: [A] Resume latest, [B] Start fresh, [C] Cancel.

  2. Invalid JSON: If .phase-status.json fails to parse, STOP. Output: "State file corrupted (invalid JSON). Delete the file and restart the current phase."

  3. Unrecognized phase: If phases object contains a phase not in {discover, clarify, design, estimate, generate, feedback}, STOP. Output: "Unrecognized phase: [value]. Valid phases: discover, clarify, design, estimate, generate, feedback."

  4. Unrecognized status: If any phases.* value is not in {pending, in_progress, completed}, STOP. Output: "Unrecognized status: [value]. Valid values: pending, in_progress, completed."

  5. Invalid current_phase (if present): If current_phase is not in {discover, clarify, design, estimate, generate, complete}, STOP. Output: "Unrecognized current_phase: [value]. Valid values: discover, clarify, design, estimate, generate, complete."

  6. Out-of-order completion: For ordered phases [discover, clarify, design, estimate, generate], if any later phase is "completed" while an earlier phase is not "completed", STOP. Output: "Inconsistent phase ordering detected. Reconcile .phase-status.json before resuming."

  7. Multiple active phases: Across core phases {discover, clarify, design, estimate, generate}, at most one phase may be "in_progress". If >1, STOP. Output: "Multiple phases are in_progress. Keep only one active phase before resuming."


State Management

Migration state lives in $MIGRATION_DIR (.migration/[MMDD-HHMM]/), created by Phase 1 and persisted across invocations.

.phase-status.json schema:

{
  "migration_id": "0226-1430",
  "last_updated": "2026-02-26T15:35:22Z",
  "current_phase": "design",
  "phases": {
    "discover": "completed",
    "clarify": "completed",
    "design": "in_progress",
    "estimate": "pending",
    "generate": "pending",
    "feedback": "pending"
  }
}

Status values: "pending" → "in_progress" → "completed". Never goes backward. For core phases (discover, clarify, design, estimate, generate), at most one phase may be "in_progress" at any time. current_phase is optional but recommended; when present it is authoritative.

The .migration/ directory is automatically protected by a .gitignore file created in Phase 1.

Phase Status Update Protocol

Use read-merge-write updates for .phase-status.json:

  1. Read the current file before every update.

  2. Change only the phase keys being advanced and last_updated.

  3. Keep prior completed phases unchanged.

  4. Set current_phase to the next deterministic phase (or complete after generate).

  5. Write the full file in the same turn as your final phase work message.

Example — after completing the Clarify phase, write $MIGRATION_DIR/.phase-status.json with:

{
  "migration_id": "MMDD-HHMM",
  "last_updated": "2026-02-26T15:35:22Z",
  "current_phase": "design",
  "phases": {
    "discover": "completed",
    "clarify": "completed",
    "design": "pending",
    "estimate": "pending",
    "generate": "pending",
    "feedback": "pending"
  }
}

Replace MMDD-HHMM with the actual migration ID, generate the last_updated ISO 8601 UTC timestamp yourself, and set each phase to its correct status at that point.


Phase Summary Table

PhaseInputsOutputsReference
Discover.tf files, app source code, and/or billing exports (at least one required)gcp-resource-inventory.json, gcp-resource-clusters.json, ai-workload-profile.json, billing-profile.json, .phase-status.json updated (outputs vary by input)references/phases/discover/discover.md
ClarifyDiscovery artifacts (gcp-resource-inventory.json, gcp-resource-clusters.json, ai-workload-profile.json, billing-profile.json — whichever exist)preferences.json, .phase-status.json updatedreferences/phases/clarify/clarify.md
Designpreferences.json + discovery artifactsaws-design.json (infra), aws-design-ai.json (AI), aws-design-billing.json (billing-only)references/phases/design/design.md
Estimateaws-design.json or aws-design-billing.json or aws-design-ai.json, preferences.jsonestimation-infra.json or estimation-ai.json or estimation-billing.json, .phase-status.json updatedreferences/phases/estimate/estimate.md
Generateestimation-infra.json or estimation-ai.json or estimation-billing.json, aws-design.json or aws-design-billing.json or aws-design-ai.json, preferences.jsongeneration-infra.json or generation-ai.json or generation-billing.json + terraform/, scripts/, ai-migration/, validation-report.json (when infra route active), MIGRATION_GUIDE.md, README.md, .phase-status.json updatedreferences/phases/generate/generate.md
Feedback.phase-status.json (discover completed minimum), all existing migration artifactsfeedback.json, trace.json, .phase-status.json updatedreferences/phases/feedback/feedback.md

MCP Servers

awspricing (for cost estimation):

  • Provides get_pricing, get_pricing_service_codes, get_pricing_service_attributes tools

  • Only needed during Estimate phase. Discover and Design do not require it.

  • Primary pricing source: references/shared/pricing-cache.md (cached 2026 rates, ±5-10% for infrastructure, ±15-25% for AI models). MCP is secondary — used only for services not found in the cache.


Files in This Skill

gcp-to-aws/
├── SKILL.md                                    ← You are here (orchestrator + state machine)
│
├── references/
│   ├── phases/
│   │   ├── discover/
│   │   │   ├── discover.md                     # Phase 1: Discover orchestrator
│   │   │   ├── discover-iac.md                 # Terraform/IaC discovery
│   │   │   ├── discover-app-code.md            # App code discovery
│   │   │   └── discover-billing.md             # Billing data discovery
│   │   ├── clarify/
│   │   │   ├── clarify.md                     # Phase 2: Clarify orchestrator
│   │   │   ├── clarify-global.md              # Category A: Global/Strategic (Q1-Q7)
│   │   │   ├── clarify-compute.md             # Categories B+C: Config Gaps + Compute (Q8-Q11)
│   │   │   ├── clarify-database.md            # Category D: Database (Q12–Q13b)
│   │   │   ├── clarify-ai.md                  # Category F: AI/Bedrock (Q14-Q22)
│   │   │   └── clarify-ai-only.md             # Standalone AI-only migration flow
│   │   ├── design/
│   │   │   ├── design.md                       # Phase 3: Design orchestrator
│   │   │   ├── design-infra.md                 # Infrastructure design (IaC-based)
│   │   │   ├── design-ai.md                    # AI workload design (Bedrock)
│   │   │   └── design-billing.md               # Billing-only design (fallback)
│   │   ├── estimate/
│   │   │   ├── estimate.md                     # Phase 4: Estimate orchestrator
│   │   │   ├── estimate-infra.md               # Infrastructure cost analysis
│   │   │   ├── estimate-ai.md                  # AI workload cost analysis
│   │   │   └── estimate-billing.md             # Billing-only cost analysis
│   │   ├── generate/
│   │   │   ├── generate.md                     # Phase 5: Generate orchestrator
│   │   │   ├── generate-infra.md               # Infrastructure migration plan
│   │   │   ├── generate-ai.md                  # AI migration plan
│   │   │   ├── generate-billing.md             # Billing-only migration plan
│   │   │   ├── generate-artifacts-infra.md     # Terraform configurations
│   │   │   ├── generate-artifacts-scripts.md  # Migration scripts
│   │   │   ├── generate-artifacts-ai.md        # Provider adapter + test harness
│   │   │   ├── generate-artifacts-billing.md   # Skeleton Terraform
│   │   │   └── generate-artifacts-docs.md      # MIGRATION_GUIDE.md + README.md
│   │   └── feedback/
│   │       ├── feedback.md                     # Phase 6: Feedback orchestrator
│   │       └── feedback-trace.md               # Anonymized trace builder
│   │
│   ├── design-refs/
│   │   ├── index.md                            # Lookup table: GCP type → design-ref file
│   │   ├── fast-path.md                        # Deterministic 1:1 mappings (Pass 1)
│   │   ├── compute.md                          # Compute mappings (Cloud Run, GCE, GKE, etc.)
│   │   ├── database.md                         # Database mappings (Cloud SQL, Spanner, etc.)
│   │   ├── storage.md                          # Storage mappings (GCS, Filestore, etc.)
│   │   ├── networking.md                       # Networking mappings (VPC, LB, DNS, etc.)
│   │   ├── messaging.md                        # Messaging mappings (Pub/Sub, etc.)
│   │   └── ai.md                               # AI mappings (Vertex AI → Bedrock)
│   │
│   ├── clustering/terraform/
│   │   ├── classification-rules.md             # Primary/secondary classification
│   │   ├── clustering-algorithm.md             # Cluster formation rules
│   │   ├── depth-calculation.md                # Topological depth calculation
│   │   └── typed-edges-strategy.md             # Edge type assignment
│   │
│   └── shared/
│       ├── schema-phase-status.md              # .phase-status.json schema (canonical reference)
│       ├── schema-discover-iac.md              # gcp-resource-inventory + clusters schemas (loaded by discover-iac.md)
│       ├── schema-discover-ai.md               # ai-workload-profile schema (loaded by discover-app-code.md and discover-iac.md Step 7d)
│       ├── schema-discover-billing.md          # billing-profile schema (loaded by discover-billing.md)
│       ├── schema-estimate-infra.md            # estimation-infra.json schema (loaded by estimate-infra.md at write time)
│       ├── handoff-gates.md                    # Fail-closed phase handoff protocol (GATE_FAIL / HANDOFF_OK)
│       ├── validate-artifacts.md               # Pre-report validation (Generate Step 0; read-only)
│       ├── migration-complexity.md             # Complexity tier definitions (small/medium/large) for timeline scaling
│       ├── pricing-cache.md                    # Cached AWS + source provider pricing (±5-25%, primary source)
│       └── bedrock-quotas.md                   # Bedrock TPM/RPM quota awareness, burndown rates, capacity planning
ConditionAction
No GCP sources found (no .tf, no app code, no billing data)Stop. Output: "No GCP sources detected. Provide at least one source type (Terraform files, application code, or billing exports) and try again."
.phase-status.json missing phase gateStop. Output: "Cannot enter Phase X: Phase Y-1 not completed. Start from Phase Y or resume Phase Y-1."
awspricing unavailable after 3 attemptsDisplay user warning about ±5-25% accuracy. Use pricing-cache.md. Add pricing_source: "cached_fallback" to the applicable estimation-*.json file.
User skips questions or says "use defaults for the rest"Apply documented defaults for remaining questions in the current batch and all subsequent batches. Phase 2 completes either way.
aws-design.json missing required clustersStop Phase 4. Output: "Re-run Phase 3 to generate missing cluster designs."

Defaults

  • IaC output: Terraform configurations, migration scripts, AI migration code, and documentation

  • Region: us-east-1 (unless user specifies, or GCP region → AWS region mapping suggests otherwise)

  • Sizing: Development tier (e.g., db.t4g.micro for databases, 0.5 CPU for Fargate)

  • Migration mode: Adapts based on available inputs (infrastructure, AI, or billing-only)

  • Cost currency: USD

  • Timeline assumption: 2-16 weeks depending on migration complexity — small (2-6 weeks), medium (6-12 weeks), large (12-18 weeks). See references/shared/migration-complexity.md for tier definitions.

Workflow Execution

When invoked, the agent MUST follow this exact sequence:

  1. Load phase status: Read .phase-status.json from .migration/*/.

    • If missing: Initialize for Phase 1 (Discover)

    • If exists: Determine current phase using deterministic rules in State Machine

  2. Determine phase to execute:

    • If current_phase exists: execute that phase.

    • Otherwise execute the first non-completed phase in ordered list: discover → clarify → design → estimate → generate.

    • If all ordered phases are completed: migration is complete (with feedback finalization rule).

  3. Read phase reference: Load the full reference file for the target phase.

  4. Execute ALL steps in order: Follow every numbered step in the reference file. Do not skip, optimize, or deviate.

  5. Validate outputs: Confirm all required output files exist with correct schema before proceeding. Phase orchestrators run Completion Handoff Gate checks per shared/handoff-gates.md.

  6. Handoff gate: Emit HANDOFF_OK or GATE_FAIL per shared/handoff-gates.md. On GATE_FAIL, stop — do not update phase status or load the next phase.

  7. Update phase status: Only after HANDOFF_OK. Use the Phase Status Update Protocol (read-merge-write) in the same turn as the phase's final output message.

  8. Feedback checkpoint: After a phase completes, check if feedback is due (see rules below). This runs before advancing to the next phase.

    • After Discover (if phases.feedback is "pending"): Output to user: "Would you like to share quick feedback (5 optional questions + anonymized usage data) to help improve this tool? Your data never includes resource names, file paths, or account IDs. [A] Send feedback now [B] Wait until after the Estimate phase"

      • If user picks A → Load references/phases/feedback/feedback.md, execute it, then continue to Clarify.

      • If user picks B → Continue to Clarify (feedback stays "pending").

    • After Estimate (if phases.feedback is "pending"): Output to user: "Would you like to share quick feedback now? (5 optional questions + anonymized usage data) [A] Yes, share feedback [B] No thanks, continue to Generate"

      • If user picks A → Load references/phases/feedback/feedback.md, execute it, then continue to Generate.

      • If user picks B → Use the Phase Status Update Protocol to set phases.feedback to "completed". Continue to Generate.

    • After Generate: No feedback offer. If phases.feedback is still "pending", use the Phase Status Update Protocol to set it to "completed" (user had two chances and chose to defer/skip).

  9. Display summary: Show user what was accomplished, highlight next phase, or confirm migration completion.

Critical constraint: Agent must strictly adhere to the reference file's workflow. If unable to complete a step, stop and report the exact step that failed.

User can invoke the skill again to resume from current_phase (or deterministic ordered evaluation when current_phase is absent).

Scope Notes

v1.0 includes:

  • Terraform infrastructure discovery

  • App code scanning (AI workload detection)

  • Billing data import from GCP

  • User requirement clarification (adaptive questions by category)

  • Multi-path Design (infrastructure, AI workloads, billing-only fallback)

  • AWS cost estimation (from pricing API or fallback)

  • Migration artifact generation (Terraform, scripts, AI adapters, documentation)

  • Optional feedback collection with anonymized telemetry

Files

references/phases/clarify/clarify.md

Phase 2: Clarify Requirements

Phase 2 of 6 — Ask adaptive questions before design begins, then interpret answers into ready-to-apply design constraints.

HARD GATE — Clarify before Design: Do not load references/phases/design/design.md (or any later phase) until this phase finishes and $MIGRATION_DIR/.phase-status.json records phases.clarify as "completed". Writing preferences.json without updating phase status is a protocol violation. If the user asks to skip questions, use documented defaults and still complete this phase (including phase status).

The output — preferences.json — is consumed directly by Design and Estimate without any further interpretation.

Questions are organized into six named categories (A–F) with documented firing rules. Up to 22 questions across categories, depending on which discovery artifacts exist and which GCP services are detected. Questions are presented in progressive batches (up to 3 batches) with intermediate saves between each — partial answers persist across sessions. A standalone AI-Only flow exists for migrations that only move AI/LLM calls to Bedrock.

Category Reference Files

FileCategoryQuestionsLoaded When
clarify-global.mdA — Global/StrategicQ1–Q7Always
clarify-compute.mdB — Config Gaps, C — ComputeQ8–Q11Compute or billing-source resources present
clarify-database.mdD — DatabaseQ12–Q13bDatabase resources present
clarify-ai.mdF — AI/BedrockQ14–Q26ai-workload-profile.json exists
clarify-ai-only.md(standalone)Q1–Q10AI-only migration (no infrastructure artifacts)

Step 0: Prior Run Check

Check $MIGRATION_DIR/ for existing state:

Case 1 — Completed preferences exist (preferences.json present):

"I found existing migration preferences from a previous run. Would you like to:"

A) Re-use these preferences and skip questions B) Start fresh and re-answer all questions

  • If A: Run Step 2 item 6 only (BigQuery detection) on current discovery artifacts. If bigquery_present is true, output the Step 4 BigQuery / deferred analytics advisory block once (even though questions are skipped), then skip to Validation Checklist with the existing preferences.json.

  • If B: delete preferences.json, continue to Step 1.

Case 2 — Draft preferences exist (preferences-draft.json present, no preferences.json):

"I found a partial set of answers from a previous session ([N] of [total] batches completed). Would you like to:"

A) Resume from where you left off — I'll pick up the remaining questions B) Start fresh and re-answer all questions

  • If A: load the draft, read metadata.batches_completed to determine which batches are done, skip completed batches when entering Step 4.

  • If B: delete preferences-draft.json, continue to Step 1.

Case 3 — No prior state: Continue to Step 1.


Step 1: Read Inventory and Determine Migration Type

Read $MIGRATION_DIR/ and check which discovery outputs exist:

  • gcp-resource-inventory.json + gcp-resource-clusters.json — infrastructure discovered

  • ai-workload-profile.json — AI workloads detected

  • billing-profile.json — billing data parsed

At least one discovery artifact must exist to proceed.

Migration Type Detection
  • Full migration: gcp-resource-inventory.json or billing-profile.json exists (may also have ai-workload-profile.json)

  • AI-only migration: ONLY ai-workload-profile.json exists (no infrastructure or billing artifacts)

If AI-only: Read clarify-ai-only.md NOW and follow that flow. Skip all remaining steps below.

HARD GATE — AI-Only Path: You MUST read clarify-ai-only.md before presenting any questions. The question text, answer options, and interpretation rules are ONLY in that file — they are NOT in this file. Do NOT fabricate questions from the summaries above.

Discovery Summary

Present a discovery summary:

If gcp-resource-inventory.json exists:

Infrastructure discovered: [total resources] GCP resources across [cluster count] clusters Top resource types: [list top 3–5 types]

If ai-workload-profile.json exists:

AI workloads detected: [from models[].model_id] Capabilities in use: [from integration.capabilities_summary where true] Integration pattern: [from integration.pattern] via [from integration.primary_sdk]

If billing-profile.json exists:

Monthly GCP spend: $[total_monthly_spend] Top services by cost: [top 3–5 from billing data]


Step 1.5: Fast-Path Gate (Simple Stacks)

After presenting the Discovery Summary, check $MIGRATION_DIR/migration-preview.json for fast-path eligibility:

IF migration-preview.json exists
   AND eligible_for_clarify_fast_path == true
THEN offer infra fast-path (3 questions)
ELSE IF eligible_for_clarify_simple_path == true
THEN offer simple hybrid path (~6 questions)
ELSE skip to Step 2 (full Clarify)
Infra fast-path (no AI)

If eligible_for_clarify_fast_path, present this offer before any questions:

"Your stack looks straightforward — [primary_resource_count] resource(s), no database, no AI detected.

Want to use smart defaults and answer just 3 questions instead of up to 22?

[Yes — 3 questions] / [No — ask me everything]"

If user chooses Yes:

  1. Ask only: Q1 (region), Q2 (compliance), Q7 (maintenance window) — from clarify-global.md.

  2. Apply documented defaults for ALL other questions. Record each in metadata.questions_defaulted.

  3. Still run the BigQuery advisory if bigquery_present is true.

  4. Write preferences.json with metadata.clarify_mode: "fast_path". Skip Steps 2–4.

Simple hybrid path (simple infra + lightweight AI)

If eligible_for_clarify_simple_path, present:

"Your stack looks straightforward with lightweight AI ([model IDs from profile]) — no agentic framework detected.

Want a short question set (~6 questions) instead of the full flow? I'll use discovery for region, database sizing, and model detection.

[Yes — short path] / [No — ask me everything]"

If user chooses Yes:

  1. Run Step 2 extraction (mandatory — do not skip).

  2. Run Step 2.5 Detected Settings Confirmation (mandatory — wait for user response).

  3. Ask only questions not resolved by extraction (after any user corrections):

    • Q2 (compliance) — always ask

    • Q7 (maintenance window) — always ask

    • Q16 (AI priority) — from clarify-ai.md

    • Q21 (AI latency) — from clarify-ai.md

    • Q3 (GCP spend) — only if billing did not extract it

    • Q1 (region) — only if region extraction ambiguous (multiple GCP regions)

  4. Apply documented defaults for all other unanswered questions. Record in metadata.questions_defaulted.

  5. Write preferences.json with metadata.clarify_mode: "simple_hybrid". Skip Step 4 batch loop — go to Category E opt-in (if applicable) then Step 5.

Agentic hard block: If agentic_profile.is_agentic == true, never offer infra fast-path or simple hybrid path. Agentic workloads require Q23–Q26.

If user chooses No, or neither path is eligible: Continue to Step 2 (full Clarify).


Step 2: Extract Known Information

Before generating questions, scan the inventory to extract values that are already known:

  1. GCP regions — Extract all GCP regions from the inventory. Map to the closest AWS region as a suggested default for Q1.

  2. Resource types present — Build a set of resource types: compute (Cloud Run, Cloud Functions, GKE, GCE), database (Cloud SQL, Spanner, Memorystore), storage (Cloud Storage), messaging (Pub/Sub).

  3. Billing SKUs — If billing-profile.json exists, check if any SKU reveals storage class, HA configuration, or other answerable questions.

  4. Billing-only mode — If billing-profile.json exists and gcp-resource-inventory.json does NOT exist, check billing-profile.json → services[] for Category B question matching.

  5. AI framework detection — If ai-workload-profile.json exists, check integration.gateway_type and integration.frameworks for auto-detection of Q14 answer.

  6. BigQuery / analytics warehouse — Set bigquery_present to true if any of: (a) a resource in gcp-resource-inventory.json has gcp_type (or equivalent type field) starting with google_bigquery_; (b) billing-profile.json lists a service/SKU that clearly indicates BigQuery (e.g., service name or SKU contains BigQuery). Otherwise bigquery_present is false.

  7. Database size auto-detect (Q13b) — For each google_sql_database_instance, read config.disk_size, config.disk_size_gb, or gcp_config.disk_size_gb. Map to Q13b band and skip Q13b when unambiguous:

Disk size (GB)db_size valueSkip Q13b?
< 10"<10GB"Yes — chosen_by: "extracted"
10 – 99"10-100GB"Yes — chosen_by: "extracted"
100 – 499"100-500GB"Yes — chosen_by: "extracted"
≥ 500">500GB"Yes — chosen_by: "extracted"

If multiple instances disagree, ask Q13b. Record in metadata.inventory_clarifications.db_size_gb when extracted.

  1. Q6 from Cloud SQL HA — For each google_sql_database_instance, read availability_type (or config.availability_type):

GCP valueavailability extracted
ZONAL"single-az"
REGIONAL"multi-az"

Skip Q6 only when all Cloud SQL PostgreSQL/MySQL instances agree on the same mapped value. multi-az-ha and multi-region are never auto-extracted — those require Q6 user answers (Mission-Critical / Catastrophic). Cloud SQL REGIONAL maps to multi-az (RDS Multi-AZ), not multi-az-ha (Aurora). Record in metadata.inventory_clarifications.cloud_sql_ha. When availability_type is missing on any instance, or instances disagree, ask Q6.

  1. Q12/Q13 dev-tier defaults — When all Cloud SQL instances match dev pattern (db-f1-micro, db-g1-small, or tier contains micro/small with availability_type: ZONAL), extract and skip Q12 and Q13. When instances mix dev and prod tiers, do not extract — ask Q12 and Q13.

database_traffic: "steady" — chosen_by: "extracted"
db_io_workload: "low" — chosen_by: "extracted"
  1. Q3 GCP spend from billing — If billing-profile.json exists, map summary.total_monthly_spend to spend band and skip Q3 when unambiguous:

Monthly USDgcp_monthly_spend
< 1,000"<$1K"
1,000–4,999"$1K-$5K"
5,000–19,999"$5K-$20K"
20,000–99,999"$20K-$100K"
≥ 100,000">$100K"
  1. Q1 region extraction — When inventory has a single GCP region among PRIMARY compute/database resources, map to closest AWS region and skip Q1 with target_region chosen_by: "extracted". When multiple regions, suggest default but still ask Q1.

  2. Q19 primary model — If ai-workload-profile.json exists and models[0].model_id is set with confidence ≥ 0.8, map to Q19 answer and skip Q19. Set ai_model_baseline with chosen_by: "extracted".

  3. Q20 input modalities — If integration.capabilities_summary exists:

SignalExtractSkip Q20?
vision: trueai_vision: "vision-required"Yes
image_generation: true (no vision)note in ai_capabilities_required; Q20 may still ask unless text-only path clearPartial — skip if only text + image gen via separate API
all false / text onlyai_vision: "text-only"Yes

When image_generation: true and vision: false, set ai_capabilities_required derived from profile and skip Q20 (image output is not vision input).

  1. Q9 WebSocket scan — Only when application code was actually analyzed. Treat code as analyzed when any of: (a) discover-app-code.md ran and found source files; (b) ai-workload-profile.json → metadata.sources_analyzed.application_code == true; (c) a companion app directory was scanned. Scan for WebSocket usage: websocket, WebSocket, socket.io, @nestjs/websockets, FastAPI WebSocket, ws package imports. If code was analyzed and no matches, extract websocket: false and skip Q9. If matches found, ask Q9 to confirm. If no application code was available (Terraform-only workspace, no code discovery), do NOT extract Q9 — leave Q9 in the question flow. Absence of a code scan is not evidence of no WebSockets.

  2. Q10 Cloud Run traffic — If Cloud Run min_instance_count / min_instances > 0 in Terraform config, extract cloud_run_traffic_pattern: "constant-24-7" and skip Q10. Otherwise ask Q10.

  3. Multi-instance Cloud SQL conflicts — When multiple google_sql_database_instance resources disagree on values used for Q6, Q12/Q13, or Q13b (e.g. one ZONAL and one REGIONAL; mixed dev/prod tiers; different disk sizes):

    • Do not extract a single global value or skip the affected question(s)

    • Record per-instance values in metadata.inventory_clarifications.cloud_sql_instances[] (address, availability_type, tier, disk_size_gb)

    • In Step 2.5, show a per-instance breakdown (see below) instead of a single summary row

    • Ask the affected question(s), or let the user pick a global posture during Step 2.5 confirmation

Record all extracted values in metadata.inventory_clarifications where applicable. Questions fully resolved by extraction are skipped (not asked) with chosen_by: "extracted" and listed in metadata.questions_skipped_extracted.

After Step 2 completes, proceed to Step 2.5 before Step 3 or any questions.


Step 2.5: Confirm Detected Settings (Mandatory Gate)

When to run: After Step 2 whenever any setting was extracted (i.e., questions_skipped_extracted would be non-empty, or any constraint was populated with chosen_by: "extracted" in working memory).

Skip Step 2.5 only when Step 2 produced zero extractions — nothing inferred from IaC, billing, or code. Proceed directly to Step 3.

HARD GATE — do NOT present question batches or ask individual questions until the user responds to this summary.

Present a structured table (omit rows for settings not extracted):

### What we detected from your Terraform, billing, and code

| Setting | Detected value | Source | Question skipped |
| ------- | -------------- | ------ | ---------------- |
| Region | us-west-2 (GCP us-west1) | gcp-resource-inventory.json | Q1 |
| GCP monthly spend | $1K–$5K (~$2,400/mo) | billing-profile.json | Q3 |
| Database availability | Single-AZ (Cloud SQL `ZONAL`) | Terraform `availability_type` | Q6 |
| Database size | 10–100 GB (allocated disk: 10 GB) | Terraform `disk_size` | Q13b |
| DB traffic / I/O | Steady / Low (dev-tier `db-f1-micro`) | Terraform tier + ZONAL | Q12, Q13 |
| Cloud Run traffic | Constant 24/7 (`min_instances > 0`) | Terraform | Q10 |
| WebSockets | None detected (code scanned) | application code scan | Q9 |
| AI framework | Direct SDK (no gateway) | ai-workload-profile.json | Q14 |
| AI model | gemini-2.5-flash | ai-workload-profile.json | Q19 |
| Input modalities | Text only | ai-workload-profile.json | Q20 |

Does this look correct?

- Reply **"looks good"** or **"correct"** to proceed — I'll only ask about what we couldn't infer.
- To fix something, name the setting and the correct value, e.g. **"availability: mission-critical"**, **"db size: 100-500GB"**, **"region: eu-central-1"**, **"model: gpt-4o"**. I'll update that setting; if the correction is ambiguous I'll ask the full question for that item.
- Reply **"ask me everything"** to discard all extractions and run the full question flow (clear `questions_skipped_extracted`; set all previously extracted constraints to pending).

Multi-instance Cloud SQL conflicts: When instances disagree, replace the single-row summary with a per-instance table and do not skip the conflicting question until resolved:

| Instance | availability_type | tier | disk_size (GB) |
| -------- | ----------------- | ---- | -------------- |
| google_sql_database_instance.main | ZONAL | db-f1-micro | 10 |
| google_sql_database_instance.analytics | REGIONAL | db-n1-standard-4 | 100 |

These instances disagree on availability. Which posture should we use for the migration design?
A) Most conservative (highest HA) | B) Use [instance name] as primary | C) Ask me the full Q6 question

Override handling — when the user corrects a detected value:

User correction (examples)Update constraintRe-ask?
availability: mission-critical / multi-az-haavailability: "multi-az-ha", chosen_by: "user"No — value is explicit
availability: significant / multi-azavailability: "multi-az", chosen_by: "user"No
availability: dev / single-azavailability: "single-az", chosen_by: "user"No
db size: <10GB / 10-100GB / etc.Set db_size to stated band, chosen_by: "user"No if band is explicit
region: [AWS region]Set target_region, chosen_by: "user"No
model: [model name]Set ai_model_baseline, chosen_by: "user"No if maps cleanly to Q19
websockets: yesSet websocket: "required", chosen_by: "user"No
spend: $5K-$20KSet gcp_monthly_spend, chosen_by: "user"No if band is explicit
Vague correction ("that's wrong")Remove that item from skipped listYes — ask full question

For each override: remove the associated question ID(s) from metadata.questions_skipped_extracted, set chosen_by: "user", and record in metadata.detected_settings with "confirmed": false and "corrected_by_user": true.

When user confirms: mark all rows "confirmed": true in metadata.detected_settings.

metadata.detected_settings schema (write to preferences.json at Step 5):

"detected_settings": [
  {
    "key": "availability",
    "value": "single-az",
    "source": "terraform:availability_type=ZONAL",
    "questions_skipped": ["Q6"],
    "confirmed": true,
    "corrected_by_user": false
  }
]

Step 3: Generate Questions by Category

Category Definitions and Firing Rules
CategoryNameFiring RuleReference FileQuestions
AGlobal/StrategicAlways firesclarify-global.mdQ1 (location), Q2 (compliance), Q3 (GCP spend), Q4 (funding stage), Q5 (multi-cloud), Q6 (uptime), Q7 (maintenance)
BConfiguration Gapsbilling-profile.json exists AND gcp-resource-inventory.json does NOT existclarify-compute.mdCloud SQL HA, Cloud Run count, Memorystore memory, Functions gen
CCompute ModelCompute resources present (Cloud Run, Cloud Functions, GKE, GCE)clarify-compute.mdQ8 (K8s sentiment), Q9 (WebSocket), Q10 (Cloud Run traffic), Q11 (Cloud Run spend)
DDatabase ModelDatabase resources present (Cloud SQL, Spanner, Memorystore)clarify-database.mdQ12 (DB traffic pattern), Q13 (DB I/O), Q13b (DB size)
EMigration PostureDisabled by default — requires explicit user opt-in(inline below)HA upgrades, right-sizing
FAI/Bedrockai-workload-profile.json existsclarify-ai.mdQ14–Q26 (Q14–Q22 always; Q23–Q26 only when agentic_profile.is_agentic == true)

Apply firing rules to determine which categories are active:

  1. Category A is always active.

  2. Check for billing-only mode — if billing-profile.json exists and gcp-resource-inventory.json does NOT, Category B is active.

  3. Check for compute resources — if present, Category C is active. Within C, skip Q8 if no GKE present. Skip Q10/Q11 if no Cloud Run present.

  4. Check for database resources — if present, Category D is active.

  5. Category E is disabled by default. Offered after the last batch completes in Step 4 (see Category E Opt-In in Step 4). If user declines or does not respond, apply Category E defaults (no HA upgrades, no right-sizing).

  6. Check for ai-workload-profile.json — if present, Category F is active.

If no IaC, billing data, or code is available (empty discovery): only Category A is active. All service-specific categories are skipped.

HARD GATE — Read Category Files Before Proceeding

STOP. You MUST read each active category's file NOW, before moving to Step 4.

The exact question wording, answer options, context rationale, and interpretation rules exist ONLY in the category files listed below. They are NOT in this file. The table above is a summary index only — do NOT use it to fabricate questions.

Read these files based on which categories are active:

Active CategoryFile to Read
A (always)clarify-global.md
B or Cclarify-compute.md
Dclarify-database.md
Fclarify-ai.md

Do NOT proceed to Step 4 until you have read every applicable file above.

Early-Exit Rules

Apply these before presenting questions:

  • Q5 = "Yes, multi-cloud required" — Immediately record compute: "eks". Skip Q8 (Kubernetes sentiment) — all container workloads resolve to EKS.

  • Q6 extracted — When Step 2 mapped Cloud SQL availability_type → skip Q6.

  • Q10/Q11 N/A — Cloud Run not present, auto-skip.

  • Q10 extracted — When min_instances > 0, skip Q10.

  • Q12/Q13 N/A — Cloud SQL (PostgreSQL or MySQL) not present in inventory, auto-skip.

  • Q12/Q13 extracted — Dev-tier Cloud SQL (Step 2 item 9), skip Q12 and Q13.

  • Q13b extracted — Unambiguous disk size from inventory (Step 2 item 7), skip Q13b.

  • Q3 extracted — Billing band mapped (Step 2 item 10), skip Q3.

  • Q1 extracted — Single-region inventory (Step 2 item 11), skip Q1.

  • Q9 extracted — No WebSocket signals in a completed code scan (Step 2 item 14), skip Q9. Do not extract when no code was analyzed.

  • Q14 auto-detected — If integration.gateway_type is non-null OR integration.frameworks is non-empty in ai-workload-profile.json, skip Q14. Set ai_framework with chosen_by: "extracted".

  • Q19 auto-detected — Primary model from ai-workload-profile.json (Step 2 item 12), skip Q19.

  • Q20 auto-detected — Modalities from capabilities_summary (Step 2 item 13), skip Q20.

Batch Planning

After determining active categories, organize questions into up to three batches presented sequentially with intermediate saves:

BatchNameCategoriesQuestionsFires When
1Strategic RequirementsA (Global/Strategic)Q1–Q7 (minus Q4)Always
2InfrastructureB (Config Gaps), C (Compute), D (Database)Q8–Q13b + Category B promptsAny compute or database resources present
3AI WorkloadsF (AI/Bedrock)Q14–Q26 (Q23–Q26 only if agentic)ai-workload-profile.json exists

Determine active batches:

  1. Batch 1 is always active.

  2. Batch 2 is active if Category B, C, or D fired.

  3. Batch 3 is active if Category F fired.

Record the ordered list of active batches and count the questions per batch (after extraction and early-exit filtering). These counts are used for per-batch progress messaging — not shown as a grand total upfront.

Category E (Migration Posture) is offered after the last substantive batch completes, before writing final preferences.json.


Category E — Migration Posture (Disabled by Default)

Fire when: User explicitly opts in. Default behavior when disabled: Apply conservative defaults — no HA upgrades, no right-sizing.

If the user opts in, present after all other categories:

Q-E1 — Should we recommend upgrading Single-AZ to Multi-AZ where possible?

A) Yes — upgrade to Multi-AZ for higher availability | B) No — keep current topology

Interpret → ha_upgrade: A → true, B → false. Default: B → false.

Q-E2 — Should we use billing utilization data to right-size instance types?

A) Yes — right-size based on utilization | B) No — match current capacity

Interpret → right_sizing: A → true, B → false. Default: B → false.


Step 4: Present Questions in Progressive Batches

Prerequisite: Step 2.5 confirmation must be complete (user said "looks good" or finished correcting) before presenting Batch 1. Do not re-show the full detected-settings table here unless the user asks for a recap.

BigQuery / deferred analytics (mandatory callout): If Step 2 set bigquery_present to true, output this block once, before any questions (same turn as Batch 1), then continue with the question flow:

BigQuery / analytics warehouse: Your discovery inputs include BigQuery. This skill does not select an AWS analytics or data-warehouse target (no Athena, Redshift, Glue, or EMR recommendation from the plugin). Before warehouse, data lake, SQL analytics, or BI cutover planning, engage your AWS account team and/or a data analytics migration partner to assess query patterns, data volumes, ETL/ELT, and downstream consumers. Design will mark these resources as Deferred — specialist engagement.

Questions are presented in sequential batches with a save after each. After each batch the user can skip individual questions (defaults applied), say "use defaults for the rest" to apply defaults for all remaining batches and proceed immediately, or answer normally.

Batch Loop

For each active batch (determined in Batch Planning above), execute steps 4a–4d:

4a. Present Batch

Use a conversational tone with brief context explaining why each question matters. Number questions within each batch starting from 1.

Batch 1 — Strategic Requirements (always first):

Before mapping your infrastructure to AWS, I have a few sections of questions
to tailor the migration plan. You can answer each, skip individual ones
(I'll use sensible defaults), or say "use defaults for the rest" at any point.

Let's start with your strategic requirements.

--- Strategic Requirements ---

Question 1: [Q1 text with context]
Question 2: [Q2 text with context]
...
Question [N]: [Q7 text with context]

Batch 2 — Infrastructure (if active):

After Batch 1 answers are saved, present:

Got it — your strategic preferences are saved.

Next up: [N] questions about your compute and database setup.
You can answer each, skip individual ones, or say "use defaults for the rest."

--- Infrastructure ---

Question 1: [first active question text with context]
...

Batch 3 — AI Workloads (if active):

After prior batch answers are saved, present. Adapt the intro based on whether this is the second or third batch:

[Infrastructure preferences saved. / Strategic preferences saved.]

Last section — [N] questions about your AI workloads, then we're ready to design.
You can answer each, skip individual ones, or say "use defaults for the rest."

--- AI Workloads ---

Question 1: [first active question text with context]
...

If Batch 3 is the second batch (Batch 2 was skipped because no infra resources), use "Next up" instead of "Last section" if appropriate.

Single-batch shortcut: If only Batch 1 is active (no infrastructure or AI categories fired), skip the multi-batch framing. Present Batch 1 questions with a simpler intro and proceed directly to Category E opt-in then Step 5 after answers — no draft file needed.

4b. Wait for Response

Wait for the user's response to the current batch. Do NOT present the next batch or proceed to Design without a response or an explicit "use defaults for the rest."

"Use defaults for the rest" handling: If the user says this at any point:

  1. Apply documented defaults for all unanswered questions in the current batch.

  2. Apply documented defaults for all questions in remaining batches.

  3. Skip directly to Category E opt-in, then Step 5 (write final preferences.json).

4c. Interpret Batch Answers

Apply the interpret rule (from the category reference files) for every answered question in the batch. For skipped questions within the batch, apply the documented default.

Apply early-exit rules triggered by this batch's answers. For example, if Batch 1 includes Q5 = "Yes, multi-cloud required", record compute: "eks" and mark Q8 as skipped (early-exit) for Batch 2.

4d. Save Draft

If more batches remain after this one: Write (or update) $MIGRATION_DIR/preferences-draft.json with all answers collected so far. Use the same schema as preferences.json with these additional metadata fields:

{
  "metadata": {
    "draft": true,
    "batches_completed": ["strategic"],
    "batches_remaining": ["infrastructure", "ai"],
    "migration_type": "full",
    "timestamp": "<ISO timestamp>",
    ...
  },
  "design_constraints": { ... },
  "ai_constraints": { ... }
}

Batch name values: "strategic", "infrastructure", "ai".

Return to 4a for the next batch.

If this was the last active batch: Do not write a draft — proceed to Category E opt-in then Step 5.

Category E Opt-In

After the last substantive batch is answered (but before writing final preferences.json), offer Category E if billing-profile.json exists:

"Would you also like HA upgrade and right-sizing recommendations based on your billing data? If not, I'll use conservative defaults (no upgrades, match current capacity)."

If user opts in, present Q-E1–Q-E2 (defined in Category E — Migration Posture above). Otherwise, apply Category E defaults (ha_upgrade: false, right_sizing: false).


Answer Combination Triggers

ScenarioKey AnswersRecommendation
Early-stage funding pathQ3 = lower spend bandEntry-tier migration funding program review
Growth-stage funding pathQ3 = higher spend bandMigration funding/support program review based on spend profile
Must stay portableQ5 = Yes multi-cloudEKS only, no ECS Fargate
Kubernetes-averseQ5 = No + Q8 = FrustratedECS Fargate strongly recommended
WebSocket appQ9 = YesALB WebSocket config required
Low-traffic Cloud RunQ10 = Business hours + Q11 < $100Recommend staying on Cloud Run
Cloud SQL Postgres — dev/low HAQ6 = Inconvenient + Cloud SQL in inventoryRDS PostgreSQL single-AZ
Cloud SQL Postgres — prod HA (RDS)Q6 = Significant Issue + Cloud SQL in inventoryRDS PostgreSQL Multi-AZ
Cloud SQL Postgres — mission-criticalQ6 = Mission-Critical + Cloud SQL in inventoryAurora PostgreSQL Multi-AZ; apply Q12/Q13
Cloud SQL Postgres — global catastrophicQ6 = Catastrophic + Q1 = Global + Cloud SQL in inventoryAurora PostgreSQL Global Database
High I/O database (RDS path)Q6 = Inconvenient/Significant + Q13 = HighRDS io2 or Provisioned IOPS
High I/O database (Aurora path)Q6 = Mission-Critical/Catastrophic + Q13 = HighAurora I/O-Optimized
Write-heavy global DBQ6 = Mission-Critical/Catastrophic + Q12 = Write-heavy/globalAurora DSQL architecture review (RDS path only: size writer; flag review)
Rapidly growing DB (RDS path)Q6 = Inconvenient/Significant + Q12 = Rapidly growingRDS with headroom on instance class
Rapidly growing DB (Aurora path)Q6 = Mission-Critical/Catastrophic + Q12 = Rapidly growingAurora Serverless v2
Zero downtime requiredQ7 = No downtimeBlue/green + AWS DMS required (RDS or Aurora blue/green per Q6)
HIPAA complianceQ2 = HIPAABAA services only, specific regions
FedRAMP requiredQ2 = FedRAMPGovCloud regions only
CCPA / CPRAQ2 = G (CCPA / CPRA)Consumer privacy, logging/retention, data-inventory posture; confirm regions with legal review
Gateway-only AIQ14 = B only (LLM router/gateway)Config change only; skip SDK migration
LangChain/LangGraph AIQ14 includes CProvider swap via ChatBedrock; 1–3 days
OpenAI Agents SDKQ14 includes EHighest AI effort; Bedrock Agents; 2–4 weeks
Multi-agent + MCPQ14 = D + FBedrock Agents to unify orchestration + MCP
Voice platform AIQ14 includes GCheck native Bedrock support; Nova 2 Sonic if needed
GPT-5.5 migrationQ19 = GPT-5.5Claude Opus 4.6 — Bedrock 17% cheaper on output; or Sonnet 4.6 for 53% savings
GPT-5.5 Pro migrationQ19 = GPT-5.5 ProNova 2 Pro — 95% cheaper on Bedrock
GPT-5.4 migrationQ19 = GPT-5.4Claude Sonnet 4.6 — near price parity; AWS consolidation
GPT-5.4 Mini/Nano migrationQ19 = GPT-5.4 Mini or NanoNova Lite/Micro — 87-94% cheaper on Bedrock
GPT-4 Turbo migrationQ19 = GPT-4 TurboClaude Sonnet 4.6 — 70% cheaper on input
o-series migrationQ19 = o-seriesClaude Sonnet 4.6 with extended thinking
High-volume cost-critical AIQ18 = High + cost criticalNova Micro or Haiku 4.5 + provisioned throughput
Reasoning/agent workloadQ17 = Extended thinkingClaude Sonnet 4.6 extended thinking; Opus 4.6 for hardest
Speech-to-speech AIQ17 = Real-time speechNova 2 Sonic
RAG workloadQ17 = RAG optimizationBedrock Knowledge Bases + Titan Embeddings
Vision workloadQ20 = Vision requiredClaude Sonnet 4.6 (multimodal)
Latency-critical AIQ21 = CriticalHaiku 4.5 or Nova Micro + streaming
Complex reasoning tasksQ22 = ComplexClaude Sonnet 4.6; Opus 4.6 for hardest

Step 5: Assemble and Write preferences.json

Assemble all interpreted answers from the completed batches into the final $MIGRATION_DIR/preferences.json. If preferences-draft.json exists, use it as the base — merge in the final batch's answers, remove the draft-specific metadata fields (draft, batches_completed, batches_remaining), and set metadata.timestamp to the current time. Write $MIGRATION_DIR/preferences.json:

{
  "metadata": {
    "migration_type": "full",
    "timestamp": "<ISO timestamp>",
    "discovery_artifacts": ["gcp-resource-inventory.json", "ai-workload-profile.json"],
    "questions_asked": [
      "Q1",
      "Q2",
      "Q3",
      "Q5",
      "Q6",
      "Q7",
      "Q16",
      "Q17",
      "Q19",
      "Q21",
      "Q22"
    ],
    "questions_defaulted": ["Q9"],
    "questions_skipped_extracted": ["Q14"],
    "questions_skipped_early_exit": ["Q8"],
    "questions_skipped_not_applicable": ["Q4", "Q10", "Q11", "Q12", "Q13", "Q13b"],
    "detected_settings": [
      {
        "key": "availability",
        "value": "multi-az",
        "source": "terraform:availability_type=REGIONAL",
        "questions_skipped": ["Q6"],
        "confirmed": true,
        "corrected_by_user": false
      }
    ],
    "category_e_enabled": false,
    "clarify_mode": "full",
    "inventory_clarifications": {}
  },
  "design_constraints": {
    "target_region": { "value": "us-east-1", "chosen_by": "user" },
    "compliance": { "value": ["hipaa"], "chosen_by": "user" },
    "gcp_monthly_spend": { "value": "$5K-$20K", "chosen_by": "user" },
    "funding_stage": { "value": "series-a", "chosen_by": "user" },
    "availability": { "value": "multi-az", "chosen_by": "default" },
    "cutover_strategy": { "value": "maintenance-window-weekly", "chosen_by": "user" },
    "kubernetes": { "value": "eks-or-ecs", "chosen_by": "user" },
    "database_traffic": { "value": "steady", "chosen_by": "user" },
    "db_io_workload": { "value": "medium", "chosen_by": "user" },
    "db_size": { "value": "10-100GB", "chosen_by": "user" }
  },
  "ai_constraints": {
    "ai_framework": { "value": ["direct"], "chosen_by": "extracted" },
    "ai_monthly_spend": { "value": "$500-$2K", "chosen_by": "user" },
    "ai_priority": { "value": "balanced", "chosen_by": "user" },
    "ai_critical_feature": { "value": "function-calling", "chosen_by": "user" },
    "ai_token_volume": { "value": "low", "chosen_by": "user" },
    "ai_model_baseline": { "value": "claude-sonnet-4-6", "chosen_by": "user" },
    "ai_vision": { "value": "text-only", "chosen_by": "user" },
    "ai_latency": { "value": "important", "chosen_by": "user" },
    "ai_complexity": { "value": "moderate", "chosen_by": "user" },
    "ai_capabilities_required": {
      "value": ["text_generation", "streaming", "function_calling"],
      "chosen_by": "extracted"
    }
  }
}
Schema Rules
  1. Every entry in design_constraints and ai_constraints is an object with value and chosen_by fields.

  2. chosen_by values: "user" (explicitly answered), "default" (system default applied — includes "I don't know" answers), "extracted" (inferred from inventory), "derived" (computed from combination of answers + detected capabilities).

  3. Only write a key to design_constraints / ai_constraints if the answer produces a constraint. Absent keys mean "no constraint — Design decides."

  4. Do not write null values.

  5. For billing-source inventories, metadata.inventory_clarifications records Category B answers.

  6. metadata.questions_skipped_early_exit records questions skipped due to early-exit logic (e.g., Q8 skipped because Q5=multi-cloud).

  7. metadata.questions_skipped_extracted records questions skipped because inventory already provided the answer.

  8. metadata.detected_settings records each auto-detected setting with source, confirmation status, and whether the user corrected it in Step 2.5.

  9. metadata.questions_skipped_not_applicable records questions skipped because the relevant service wasn't in the inventory.

  10. ai_constraints section is present ONLY if Category F fired. Omit entirely if no AI artifacts exist.

  11. ai_constraints.ai_capabilities_required is the UNION of detected capabilities from ai-workload-profile.json + critical feature from Q17 + vision from Q20. chosen_by is "derived".

  12. ai_constraints.ai_framework is an array (Q14 is select-all-that-apply). If auto-detected, chosen_by is "extracted".

After writing preferences.json, delete $MIGRATION_DIR/preferences-draft.json if it exists.


Defaults Table

QuestionDefaultConstraint
Q1 — LocationA (single region)target_region: closest AWS region to GCP region
Q2 — ComplianceA (none)no constraint
Q3 — GCP spendB ($1K–$5K)gcp_monthly_spend: "$1K-$5K"
Q4 — Funding stage(skip in IDE mode)no constraint
Q5 — Multi-cloudB (AWS-only)no constraint
Q6 — UptimeB (significant)availability: "multi-az"
Q7 — MaintenanceD (flexible)cutover_strategy: "flexible"
Q8 — K8s sentimentB (neutral)kubernetes: "eks-or-ecs"
Q9 — WebSocketB (no)no constraint
Q10 — Cloud Run trafficC (24/7)cloud_run_traffic_pattern: "constant-24-7"
Q11 — Cloud Run spendB ($100–$500)cloud_run_monthly_spend: "$100-$500"
Q12 — DB trafficA (steady)database_traffic: "steady"
Q13 — DB I/OB (medium)db_io_workload: "medium"
Q13b — DB sizeE (unknown)db_size: "unknown" → default to pgcopydb
Q14 — AI framework(auto-detect)ai_framework from code detection
Q15 — AI spendB ($500–$2K)ai_monthly_spend: "$500-$2K"
Q16 — AI priorityE (balanced)ai_priority: "balanced"
Q17 — Critical featureJ (none)no additional override
Q18 — Volume + costA (low + quality)ai_token_volume: "low"
Q19 — Current model(auto-detect)ai_model_baseline from code detection
Q20 — Input typesA (text only)no constraint
Q21 — AI latencyB (important)ai_latency: "important"
Q22 — Task complexityB (moderate)ai_complexity: "moderate"

Validation Checklist

Before handing off to Design:

  • [ ] If extractions were made, Step 2.5 detected-settings confirmation was shown and user responded before questions

  • [ ] If extractions were made, metadata.detected_settings records each inferred value with confirmed status

  • [ ] If bigquery_present was true, the Step 4 BigQuery specialist advisory was shown before questions — or, if Step 0 option A (reuse preferences), the same advisory was shown after BigQuery detection

  • [ ] preferences.json written to $MIGRATION_DIR/

  • [ ] design_constraints.target_region is populated with value and chosen_by

  • [ ] design_constraints.availability is populated when Cloud SQL PostgreSQL/MySQL is in inventory (asked, extracted, or defaulted — Design must not run with absent/null availability)

  • [ ] Only keys with non-null values are present in design_constraints

  • [ ] Every entry in design_constraints and ai_constraints has value and chosen_by fields

  • [ ] Config gap answers recorded in metadata.inventory_clarifications (billing mode only)

  • [ ] Early-exit skips recorded in metadata.questions_skipped_early_exit

  • [ ] ai_constraints section present ONLY if Category F fired

  • [ ] If Category F fired, ai_constraints.ai_framework is populated (from detection or Q14)

  • [ ] If Category F fired, ai_capabilities_required is derived from detection + Q17 + Q20

  • [ ] ai_constraints.ai_framework is an array (Q14 is multi-select)

  • [ ] Output is valid JSON

  • [ ] preferences-draft.json has been deleted (if it existed)

  • [ ] metadata.clarify_mode is set to "fast_path", "simple_hybrid", or "full"


Completion Handoff Gate (Fail Closed)

Load shared/handoff-gates.md. Re-read from disk before checking.

Re-entry guard: If aws-design.json (or aws-design-ai.json / aws-design-billing.json) exists and phases.design is "completed": STOP unless the user explicitly confirms re-running Clarify. Emit GATE_FAIL | phase=clarify | field=aws-design.json | reason=stale_downstream.

Checks (all must PASS):

  1. preferences.json exists and parses as JSON.

  2. Step 5 validation checklist items all pass (including metadata.clarify_mode).

  3. If gcp-resource-inventory.json contains google_sql_database_instance → design_constraints.availability.value is set (non-null, non-empty).

On any FAIL: Emit GATE_FAIL | phase=clarify | field=<path> | reason=missing. Do NOT modify artifacts to pass the gate. Do NOT update .phase-status.json. Tell the user to answer the missing question or re-run Clarify.

On PASS: Emit HANDOFF_OK | phase=clarify | artifacts=preferences.json.

Step 6: Update Phase Status

Only after HANDOFF_OK. In the same turn as the output message below, use the Phase Status Update Protocol (Write tool) to write .phase-status.json with phases.clarify set to "completed".

Output to user: "Clarification complete. Proceeding to Phase 3: Design AWS Architecture."


Scope Boundary

This phase covers requirements gathering ONLY.

FORBIDDEN — Do NOT include ANY of:

  • Detailed AWS architecture or service configurations

  • Code migration examples or SDK snippets

  • Detailed cost calculations

  • Migration timelines or execution plans

  • Terraform generation

Your ONLY job: Understand what the user needs. Nothing else.

Requirements and compatibility

Written for: Claude Code

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Names Claude Code tools, Needs an MCP server

Security

What our scanner noticed· Low risk

  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Cline
Publisher
Cline (Official)
Source
cline/skills · skills/gcp-to-aws · commit 2637846
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Cline or Cline.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download gcp-to-aws.zip