-
Detect available surfaces. The skill can drive mStudio via MCP, the mw CLI, or the HTTP API — see references/mittwald-surfaces.md. Probe in preference order:
- MCP — check for
mcp__mittwald__mittwald_* tools in this session.
- CLI —
command -v mw && mw user get -o json (logged-in check).
- API — operator can supply an
MITTWALD_API_TOKEN; spec at https://api.mittwald.de/v2/openapi.json.
Pick the highest-preference one available and announce it. If none are available, stop and tell the operator: "No Mittwald surface (MCP, CLI, or API token) is available — I won't guess calls." Stay consistent within a phase; mixing surfaces mid-phase is fine only when one surface lacks a capability (e.g. MCP doesn't stream MySQL dumps — fall back to mw database mysql dump).
-
Open with a phase plan. Create a TodoWrite list with these six phases (mark only the first as in-progress):
- Discovery — inventory the source
- Plan — target shape, downtime budget, rollback
- Provision — create project, stack, virtualhosts, domains
- Migrate — move data (DBs, files, secrets)
- Verify — smoke test against the default
<shortId>.project.space domain
- Cutover — DNS swap, decommission window
-
Confirmation gates. Before each destructive or externally-visible action, summarize what you're about to do and call AskUserQuestion. Never run DROP, DELETE, container/stack deletion, DNS changes, or anything that mutates the source without explicit approval for that specific step.
-
Idempotency. On every resume, re-check current state (project_get, stack_list, stack_ps, domain_virtualhost_list, database_*_list) before acting. A project may already exist; a DB may already have data.
-
Always smoke-test on the default domain. Every Mittwald stack gets a <shortId>.project.space address with a valid Let's Encrypt cert from the first virtualhost. Use it for verification before DNS cutover.
-
Optional wrap-up — offer to contribute learnings. When the migration reaches a natural end (Verify passed, Cutover done, or it was rolled back), you may offer to draft a short, fully sanitized GitHub issue summarizing the migration so the skill improves over time. Read playbooks/contribute-learnings.md. Strictly opt-in (default no, never nag), no secrets or identifying details ever, and the operator reviews the exact body before anything is filed. If declined, end silently.