--- name: modernize-flp-sandbox description: > Use when migrating UI5 apps from legacy FLP sandbox to the new sandbox (New Sandbox). Triggers on ui5-modernization:modernize-flp-sandbox, mentions of "flpSandbox.html", "sap-ushell-config", or requests to update sandbox configuration. --- # New Sandbox Migration Skill Migrate a UI5 application from the legacy FLP sandbox to New Sandbox. You analyze, transform, verify, and report. The skill is fully automatic for the *core migration*; for adjacent concerns (see scope below) it asks the consumer before acting. Read `references/operations.md` now — it is the operational reference for all HTML / JSON / hook-module transformations. Read `references/sandbox-config-surface.md` now — it is the ground-truth description of what New Sandbox allows, blocks, and silently overrides. All §6 rules cite this file rather than restating constraints inline. ## Scope — three layers 1. **Core migration** — actions necessary for the app to boot under New Sandbox. Performed unconditionally; fails migration if impossible. Triggers: §6a, §6b, §6c, §6f. 2. **Test infrastructure** — gets the test suite running again without changing test semantics. Safe rewrites applied unconditionally (resource-root rebind, OPA bootstrap extraction). Anything touching test logic: detect, report, offer on request. Triggers: §6d, §6e, §6g, §6h, §6j, §6l. 3. **Adjacent migrations & advisories** — concerns surfaced *by* the migration but not *part of* it. Detect and report only; no rewrites applied. - QUnit 1.x → 2.x patterns (§6i) — advisory. - Shell-feature tests (§6j, §6l) — advisory. - Deprecated ushell services (§6k) — detected in core pass, reported as "Manual action required" (hard runtime block). ## 1. Detect App Root If the user provided a path argument, use it. Otherwise, detect from CWD: - Look for `package.json` + `webapp/` in CWD and parent directories - If not found, tell the user: "Could not detect a UI5 app root. Please run from inside the app directory or provide a path: `ui5-modernization:modernize-flp-sandbox ~/path/to/app`" Set `APP_ROOT` to the resolved absolute path. ## 2. Ensure Clean State (Pre-Migration) Before touching any files, secure a rollback point. **If git repository detected:** ```bash cd $APP_ROOT git stash push -m "modernize-flp-sandbox: pre-migration backup $(date +%Y%m%d-%H%M%S)" ``` Save the stash ref for rollback. If nothing to stash, the tree is already clean. **If no git repository:** ```bash mkdir -p $APP_ROOT/webapp/test/.migration-backup cp $APP_ROOT/webapp/test/flpSandbox*.html $APP_ROOT/webapp/test/.migration-backup/ 2>/dev/null cp $APP_ROOT/webapp/test/fioriSandboxAppConfig.json $APP_ROOT/webapp/test/.migration-backup/ 2>/dev/null ``` ## 3. Analyze Read all HTML files under `$APP_ROOT/webapp/test/` (recursive) and build a pattern inventory. **Detect legacy sandbox HTML files** — a file is legacy if it contains ANY of: - `id="sap-ushell-bootstrap"` (sandbox bootstrap script tag) - `window["sap-ushell-config"]` assignment - `src=` referencing `sandbox2.js` (intermediate New Sandbox old-style bootstrap — predates `SandboxBootTask.js`; treat identically to other legacy patterns) **OPA test-page (does NOT receive SandboxBootTask / boot-manifest):** A file matches legacy detection AND ALSO contains ALL of: - `QUnit.config` or `QUnit.config.autostart` assignment, OR `window.QUnit = {` - `sap.ui.require(` with entries from `sap/ui/qunit/`, `sap/ui/test/`, or `sap/ui/thirdparty/qunit` These files are NOT migrated as sandbox HTMLs. They receive: (a) §6g bootstrap extraction into sibling JS, (b) §6i QUnit 1.x detection → sub-skill handoff on consent. The §6g HTML edits: - Remove `