Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 34 additions & 23 deletions advisor/plugins/aws-startup-advisor/skills/gcp-to-aws/SKILL.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -138,32 +138,44 @@ estimate artifact(s), present a brief summary, then **return to the workshop
loop**. Do **not** emit `HANDOFF_OK`, do **not** update `.phase-status.json`, do
**not** offer the what-if workshop below.

### Outer Estimate — deferred Generate advance
### Outer Estimate — Decision gate

After outer-run `HANDOFF_OK`, use the Phase Status Update Protocol
(read-merge-write) — **in the same turn** as the summary:

1. Set `phases.estimate` to `"completed"`
2. Ensure `phases.workshop` exists (seed `"pending"` if missing)
3. **Do not** set `current_phase` to `"generate"` yet — leave `current_phase` at
`"estimate"` until the workshop sidebar is resolved (entered then exited,
or declined)
4. Offer the what-if workshop below (infra route only)
3. **Do not** set `current_phase` to `"generate"` — Generate is opt-in from
here on. Leave `current_phase` at `"estimate"` and present the Decision
gate below.

### Post-Estimate: What-If Workshop Offer
### Post-Estimate: Decision Gate

When `gcp-resource-inventory.json` + `aws-design.json` + `estimation-infra.json`
exist, offer:
**The decision is the product; execution artifacts are opt-in.** The verdict
(`recommendation.outcome` / `path`) already exists in the estimate artifacts —
present it and let the user choose what happens next. Never advance to
Generate without an explicit choice of option C (or an explicit later request
for Terraform/scripts).

Present (values from the active estimate artifacts; one line each):

```
Estimate complete. Before Generate, want to see how the numbers move if you
change something? I can reprice scenarios side by side in about a minute each,
without re-running discovery — for example: a different AWS region, cheaper
single-AZ database for staging, Kubernetes (EKS) instead of Fargate, or
ARM-based (Graviton) compute.

[A] Enter what-if workshop
[B] Proceed toward Generate
Estimate complete.

### Decision pack ready

- Verdict: [outcome_label when recommendation.outcome exists; else path_label]
- AWS estimate (Balanced): $[X]/mo · Your GCP baseline: [figure with its
baseline-quality label from estimate-infra.md Part 1 — apply the
not-comparable rule when the sources measure different things]
- Timeline if you execute: ~[N–M] weeks ([complexity tier], from
shared/migration-complexity.md — omit this line when no tier signal exists)
- Deferred to specialists: [BigQuery / other deferred rows, or omit line]

[A] Done for now — I have what I need to decide
[B] Explore what-ifs — reprice scenarios side by side (~1 min each): region,
single-AZ database, EKS vs Fargate, Graviton
[C] Generate Terraform and migration scripts
```

**Data-justified scenario hint (add one line when applicable):** if a material
Expand All @@ -172,13 +184,27 @@ assumption was defaulted rather than confirmed — most commonly `availability`
comparing a [alternative] scenario would bound that assumption before you
commit." Suggest at most one.

- **A** → Load `references/phases/workshop/workshop.md`. Keep
`current_phase: estimate`; set `phases.workshop` → `"in_progress"`.
- **B** → Mark `phases.workshop` → `"completed"`. Set `current_phase` →
`"generate"`. Continue with Feedback/Generate sidebars in `SKILL.md`.

For AI-only / billing-only runs (no infra inventory), skip the workshop offer and
set `phases.workshop` → `"completed"`, `current_phase` → `"generate"`.
**Choice handling:**

- **A** → Mark `phases.workshop` → `"completed"` (declined). Set
`run_mode: "decide"` and `current_phase: "complete"` in `.phase-status.json`
(`phases.generate` **stays** `"pending"` — this combination means "decision
complete, execution available on request"; see `schema-phase-status.md`).
Then run the post-gate feedback checkpoint per `SKILL.md`. Close with:
"Your decision pack is complete. If you decide to migrate, say 'generate the
Terraform and migration scripts' — everything is saved and I'll pick up from
here."
- **B** → Load `references/phases/workshop/workshop.md`. Keep
`current_phase: estimate`; set `phases.workshop` → `"in_progress"`. On
workshop exit, **return to this gate** (options A and C; the workshop's
active scenario carries into either) — do not advance to Generate directly.
- **C** → Mark `phases.workshop` → `"completed"` (declined). Set
`run_mode: "decide_and_execute"` and `current_phase` → `"generate"`. Then
run the post-gate feedback checkpoint per `SKILL.md` and continue to
Generate.

For AI-only / billing-only runs (no infra inventory), present the gate without
option B and set `phases.workshop` → `"completed"`.

## Reference Files

Expand All @@ -193,7 +219,7 @@ set `phases.workshop` → `"completed"`, `current_phase` → `"generate"`.
FORBIDDEN — Do NOT include ANY of:

- Changes to architecture mappings from the Design phase
- Execution timelines or migration schedules
- Execution timelines or migration schedules — **exception:** the Decision gate's one-line timeline band (`~N–M weeks`, tier from `shared/migration-complexity.md`) is allowed; full schedules, week-by-week plans, and runbooks remain Generate-only
- Terraform or IaC code generation
- Detailed migration procedures or runbooks
- Team staffing or resource allocation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Phase 5: Generate Migration Artifacts (Orchestrator)

> **CONSENT GUARD (check before Step 1):** This phase runs only by explicit
> opt-in. If `.phase-status.json` → `run_mode` is not `"decide_and_execute"`:
> when this turn's user message is an explicit Execute request ("generate the
> Terraform", "create the migration scripts", gate choice C), set
> `run_mode: "decide_and_execute"` (read-merge-write) and proceed; otherwise
> STOP — do not generate anything — and re-present the Decision gate (or the
> decide-complete resume offer) from `estimate.md` / `SKILL.md`.

**Execute ALL steps in order. Do not skip or optimize.**

## Overview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,31 @@
> Marks the workshop sidebar resolved and returns control to the backbone.
> Does **not** set `current_phase` to `workshop`.

## When exiting to Generate
## When exiting the workshop

Workshop exit returns to the **Decision gate** in `estimate.md` — never
directly to Generate. The user chooses A (done for now) or C (generate) there;
the active scenario carries into either choice.

1. Set `preferences.workshop.active` to `false` (keep `active_scenario_id`).
2. Ensure `scenarios/index.json` exists (baseline-only is enough).
3. Update `.phase-status.json` (read-merge-write):
- `phases.workshop` → `"completed"`
- `current_phase` → `"generate"`
- `current_phase` **stays** `"estimate"` (the Decision gate sets the next
state based on the user's choice)
- `last_updated` → now
4. Emit:

```
HANDOFF_OK | phase=workshop | artifacts=scenarios/index.json | return_to=generate
HANDOFF_OK | phase=workshop | artifacts=scenarios/index.json | return_to=decision_gate
```

5. Output: "Workshop paused. Active scenario: `{id}`. Proceeding toward Generate."
5. Output: "Workshop done. Active scenario: `{id}`." Then re-present the
Decision gate from `estimate.md` (options A and C — the workshop was just
explored, so omit B), with the gate's verdict/cost lines refreshed from the
**active scenario's** estimate.

## Soft postcondition

If scenarios are missing after an empty entry, warn and still mark workshop
`"completed"` + advance to generate — do not block Generate.
`"completed"` + return to the Decision gate — do not block the gate.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Actions (exactly one):

- **[A] Apply & reprice**
- **[B] Compare scenarios**
- **[C] Exit to Generate**
- **[C] Done — back to the decision gate** (choose "done for now" or "generate scripts" there)
- **[D] Exit to full Clarify** (danger — confirm first)

## Step 3: Validate (Apply only)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
3. Branch:
- **Apply & reprice** → `workshop-refresh.md` → `workshop-compare.md`
- **Compare scenarios** → `workshop-compare.md`
- **Exit to Generate** → `workshop-assemble.md` → return
- **Done / exit** → `workshop-assemble.md` → returns to the Decision gate in `estimate.md`
- **Exit to full Clarify** → danger; Clarify re-entry only on explicit confirm

## Hard rules
Expand All @@ -55,6 +55,7 @@ file wins — fix this table.

## Decline without entering

When Estimate offer **[B] Proceed toward Generate** is chosen, mark
`phases.workshop` `"completed"` (resolved/declined), set `current_phase` to
`"generate"`, then continue Feedback/Generate sidebars in `SKILL.md`.
When the user chooses Decision-gate option **A** (done for now) or **C**
(generate) without entering the workshop, mark `phases.workshop` `"completed"`
(resolved/declined); the gate's choice handling in `estimate.md` sets
`run_mode` and `current_phase`.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ Patching artifacts to satisfy a gate defeats fail-closed validation and produces

---

## Decide-complete is terminal, not a failure

`current_phase: "complete"` + `run_mode: "decide"` + `phases.generate: "pending"` is a **valid terminal state** (the user stopped at the decision — see `schema-phase-status.md`). It is Estimate's `HANDOFF_OK` outcome, not a `GATE_FAIL`, not an inconsistent ordering, and not an incomplete run to repair. Do not "fix" it by advancing to Generate; the only valid transition out is the decide-complete resume offer (SKILL.md state machine).

## Phase re-entry (idempotent runs)

| Situation | Rule |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,21 @@ Lightweight phase tracking. This is the SINGLE source of truth for the `.phase-s
| `last_updated` | ISO 8601 | After each phase update |
| `phases.<name>` | string | Phase transitions: `"pending"` → `"in_progress"` → `"completed"` |

**Optional field — `run_mode`:**

| Value | Meaning | Set by |
| ---------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| `"decide"` | User stopped at the decision — Generate available on request, never auto-loaded | Decision gate choice A (`estimate.md`) |
| `"decide_and_execute"` | User opted into execution artifacts — Generate may load | Decision gate choice C, or the decide-complete resume offer |
| _(absent)_ | Gate not yet reached — no Generate consent exists | — |

**Decide-complete state:** `current_phase: "complete"` + `run_mode: "decide"` + `phases.generate: "pending"` means the decision pack is done and execution was not requested. This is a **terminal-unless-asked** state, not a failure and not an incomplete run: resume offers Generate but never auto-runs it, and never re-runs Estimate. No `"skipped"` status exists — `generate` simply stays `"pending"`.

**Rules:**

- Phase status progresses: `"pending"` → `"in_progress"` → `"completed"`. Never goes backward.
- Valid phase names: discover, clarify, design, estimate, workshop, generate, feedback.
- `workshop` is an optional **sidebar** (like feedback): never appears as
`current_phase`; `"completed"` means resolved (entered or declined).
- `migration_id` matches the `$MIGRATION_DIR` folder name (e.g., `0226-1430`).
- `run_mode` is optional; when present it must be `"decide"` or `"decide_and_execute"`. It is flow state (Generate consent), not a design constraint — it never appears in `preferences.json`.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
- The workshop is a sidebar: it NEVER becomes `current_phase`. Entry sets
`phases.workshop: "in_progress"`; `current_phase` stays at `"estimate"`
until exit/decline.
- Exit to Generate (assembler): `phases.workshop: "completed"`,
`current_phase: "generate"`. Decline at the Estimate offer: same, without
requiring `scenarios/`.
- Exit (assembler): `phases.workshop: "completed"`. Skills WITHOUT a
post-Estimate decision gate advance `current_phase` to `"generate"`. Skills
that DEFINE a decision gate re-present that gate — **never** auto-advance to
Generate (the gate sets the next state from the user's choice). Decline at
the offer: same, without requiring `scenarios/`.
- Warm-start rule: `current_phase == "estimate"` AND
`phases.estimate == "completed"` AND `phases.workshop == "pending"` →
present the workshop offer; NEVER recompute Estimate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
- The workshop is a sidebar: it NEVER becomes `current_phase`. Entry sets
`phases.workshop: "in_progress"`; `current_phase` stays at `"estimate"`
until exit/decline.
- Exit to Generate (assembler): `phases.workshop: "completed"`,
`current_phase: "generate"`. Decline at the Estimate offer: same, without
requiring `scenarios/`.
- Exit (assembler): `phases.workshop: "completed"`. Skills WITHOUT a
post-Estimate decision gate advance `current_phase` to `"generate"`. Skills
that DEFINE a decision gate re-present that gate — **never** auto-advance to
Generate (the gate sets the next state from the user's choice). Decline at
the offer: same, without requiring `scenarios/`.
- Warm-start rule: `current_phase == "estimate"` AND
`phases.estimate == "completed"` AND `phases.workshop == "pending"` →
present the workshop offer; NEVER recompute Estimate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
- The workshop is a sidebar: it NEVER becomes `current_phase`. Entry sets
`phases.workshop: "in_progress"`; `current_phase` stays at `"estimate"`
until exit/decline.
- Exit to Generate (assembler): `phases.workshop: "completed"`,
`current_phase: "generate"`. Decline at the Estimate offer: same, without
requiring `scenarios/`.
- Exit (assembler): `phases.workshop: "completed"`. Skills WITHOUT a
post-Estimate decision gate advance `current_phase` to `"generate"`. Skills
that DEFINE a decision gate re-present that gate — **never** auto-advance to
Generate (the gate sets the next state from the user's choice). Decline at
the offer: same, without requiring `scenarios/`.
- Warm-start rule: `current_phase == "estimate"` AND
`phases.estimate == "completed"` AND `phases.workshop == "pending"` →
present the workshop offer; NEVER recompute Estimate.
Expand Down
Loading
Loading