.agents/skills/scout-migrate-from-ftr/SKILL.md
This is the single entry point for FTR-to-Scout migrations. It runs a deliberate five-step workflow:
scout-best-practices-reviewer skill to verify migration parity and Scout best-practice compliance.The review gate is the point of the workflow. The plan front-loads decisions (UI vs API vs RTL/Jest, parallelism, auth, Cloud portability, batching) so the user can correct course cheaply, before any code is rewritten. Do not skip it.
Before starting, collect or confirm:
x-pack/platform/test/functional/apps/dashboard).Follow references/generate-plan.md to produce a migration plan in the target Scout module root. The plan answers what should change and why; the executor answers how.
If a plan already exists for this source directory and matches the current FTR contents, skip to step 2.
After writing the plan, stop. Do not start touching test files.
Surface the plan to the user with this message (substitute the real path):
I generated a migration plan at
<path-to-the-plan-file>. Please review it carefully — it captures the test-type decisions, batching, auth strategy, Cloud portability, and any flagged risks before any code changes. Reply when you're ready to proceed with the migration, or with any questions or corrections to the plan.
Then surface a short chat-side summary of the items the user should not miss, even if they skim the plan file:
NEEDS VERIFICATION: anything the planner could not determine and flagged for human input.Keep the chat summary tight. The plan file is the comprehensive doc; the chat summary is the can't-miss subset.
If the user pushes back on classifications, batching, or anything else, update the plan and re-surface. Only continue once the user explicitly approves.
Once the user approves, follow references/execute-plan.md end to end. That file owns the file placement rules, FTR-to-Scout dependency mapping, loadTestFile splitting, helper extraction, and typecheck instructions.
If during execution you discover the plan was wrong about a specific file's test type (e.g. the planner said "API test" but the suite actually exercises a real user flow), pause and confirm with the user before changing course.
Once execution is complete, run the new Scout tests and fix failures until they pass. Refer to docs/extend/scout/run-tests.md for run-tests commands (local stateful and the local serverless simulation).
For faster feedback during the loop, start the test servers once and reuse them across iterations:
node scripts/scout.js start-server --stateful --serverConfigSet <configSet> (or --serverless <project>).node scripts/playwright test --config <playwright.config.ts> <test-file>.Falling back to node scripts/scout.js run-tests works but restarts the servers each time, which is much slower for iterative debugging.
Loop:
Once the tests pass, follow the scout-best-practices-reviewer skill on the new and changed spec files. Provide the removed FTR test files as context so the reviewer can verify migration parity (every behavior the FTR suite covered is still covered, in the right layer).
Address blocker and major findings before considering the migration done. Surface minor and nit items for the user to triage.
NEEDS VERIFICATION rather than guessing.references/generate-plan.mdreferences/execute-plan.mdreferences/pick-correct-test-type.mddocs/extend/scout/run-tests.md