Generate or repair a Scout test scaffold for a Kibana plugin/package (test/scout*/{api,ui} Playwright configs, fixtures, example specs). Use when you need the initial Scout directory structure; prefer `node scripts/scout.js generate` with flags for non-interactive/LLM execution.
scout-migrate-from-ftr — After generating files, wire TypeScript for CI using Pattern A or Pattern B (Where Scout tests are typechecked in that skill). This skill documents layout; the migration skill has the full rules (relative imports, kbn_references, node scripts/type_check --project …).x-pack/platform/plugins/shared/maps)api, ui, or both<moduleRoot>/test/
scout (creates <moduleRoot>/test/scout/...)scout_<configSet>scout_uiam_localscout_cspm_agentlessRun from the Kibana repo root:
node scripts/scout.js generate --path <moduleRoot> --type <api|ui|both>
Common variants:
# UI scaffold, sequential (non-parallel)
node scripts/scout.js generate --path <moduleRoot> --type ui --no-ui-parallel
# Generate into a custom Scout root (test/scout_<configSet>/...)
node scripts/scout.js generate --path <moduleRoot> --type both --scout-root scout_<configSet>
# If some Scout directories already exist, generate only missing sections without prompting
node scripts/scout.js generate --path <moduleRoot> --type both --force
Notes:
test/<scout-root>/{api,ui} sub-directories.--path, you must also pass --force (otherwise the command fails rather than prompting).test/<scout-root>/api/playwright.config.tstest/<scout-root>/api/fixtures/constants.tstest/<scout-root>/api/fixtures/index.tstest/<scout-root>/api/tests/example.spec.tstest/<scout-root>/ui/playwright.config.tstest/<scout-root>/ui/fixtures/constants.tstest/<scout-root>/ui/fixtures/index.tstest/<scout-root>/ui/fixtures/page_objects/*test/<scout-root>/ui/tests/example.spec.tstest/<scout-root>/ui/parallel.playwright.config.tstest/<scout-root>/ui/parallel_tests/example_one.spec.tstest/<scout-root>/ui/parallel_tests/example_two.spec.tstest/<scout-root>/ui/parallel_tests/global.setup.tsThe generator does not create tsconfig.json files. Playwright runs without them, but node scripts/type_check (CI) must still include Scout specs in a TS project—see TypeScript layout below.
check_types)Pick one pattern and wire it after scout.js generate completes:
discover_enhanced)tsconfig.json, add test/<scout-root>/**/* (or broader test/**/*) to include.kbn_references for the Scout stack you use:
@kbn/scout.@kbn/scout-oblt; for API tests using synthtrace workers, also @kbn/scout-synthtrace, @kbn/synthtrace-client (and @kbn/rison for UI if needed).test/<scout-root>/{ui,api}/tsconfig.json when using this pattern (one program for plugin + Scout).server/ or common/ when the test needs shared registration constants or light server utilities.tsconfig.json under test/<scout-root>/{ui,api}/test/<scout-root>/api/tsconfig.json and/or test/<scout-root>/ui/tsconfig.json with extends, include: ["**/*"], and scoped kbn_references (see SLO, data_views, infra Scout modules for examples).../../../../server/... or public/... from those folders—TypeScript will treat server/** as part of the wrong composite project (TS6059 / TS6307). Use fixtures/constants.ts, common/, or switch to Pattern A.yarn kbn bootstrap so packages/kbn-ts-projects/config-paths.json picks up added or removed tsconfig.json paths.node scripts/type_check --project <path-to-tsconfig.json> (plugin root tsconfig.json for A, or test/<scout-root>/api/tsconfig.json / UI sibling for B).test/scout_<configSet>, you typically also need a matching server config under src/platform/packages/shared/kbn-scout/src/servers/configs/config_sets/<configSet>.start-server requires --serverConfigSet <configSet> when using a custom server config set.test/scout*/ui/tests/**/*.spec.tstest/scout*/ui/parallel_tests/**/*.spec.tstest/scout*/api/tests/**/*.spec.ts