[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71W4A46JVTCFRTGHNEHTCRS":3,"skill-same:01M71W4A46JVTCFRTGHNEHTCRS":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":14,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M71W4A46JVTCFRTGHNEHTCRS","app-exploration",null,"Automatically map web application routes, forms, and interactions via static code analysis and Playwright browser exploration to generate a prioritized JSON inventory of e2e test scenarios.","itlackey\u002Fakm-eval","itlackey","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6414031?v=4","01M6D08NHES2CPRGY5HCPJECD6","IT Lackey","01M71W0ZJQ3686SNJSCQZM3X4E",0,"MPL-2.0","https:\u002F\u002Fgithub.com\u002Fitlackey\u002Fakm-eval\u002Fblob\u002Fmain\u002Fcorpus\u002Flibrary\u002Fskills\u002Fe2e-testing\u002Fapp-exploration\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"app exploration","exploration","app","creation","2026","when","static","for","test scenarios","playwright browser","code analysis","generate","map","forms","e2e test","coverage","inventory","analysis","browser","code","2026-11-10 13:02:02",false,"---\ndescription: Automatically map web application routes, forms, and interactions\n  via static code analysis and Playwright browser exploration to generate a\n  prioritized JSON inventory of e2e test scenarios.\nwhen_to_use: Use when starting Playwright test creation for a web application\n  from scratch, auditing coverage gaps, onboarding to an unfamiliar codebase, or\n  after significant refactors.\nupdated: 2026-06-19\n---\n\n# App Exploration for Playwright Test Generation\n\n## When to use this skill\n\nUse this skill when:\n- Starting Playwright test creation for a web application from scratch with no existing e2e suite\n- Auditing an existing test suite to identify coverage gaps against actual app routes and interactions\n- Onboarding to an unfamiliar codebase and needing a complete map of testable surfaces before writing tests\n- After a significant refactor or feature addition that may have invalidated existing test coverage\n\nDo NOT use this skill if:\n- You already have a complete test-scenarios.json from a prior run and the app has not changed\n- The task is to write tests for a single specific component or interaction already identified\n\n---\n\n## Prerequisites\n\nVerify all of the following before proceeding:\n\n1. **Playwright installed** — `npx playwright --version` must succeed. If missing, run `npm install -D @playwright\u002Ftest`.\n2. **Chromium binary** — Run `npx playwright install chromium` if the binary is absent.\n3. **App running or startable** — Either the app is already running at a known base URL, or a start command exists (`npm run dev`, `npm start`, `pnpm dev`, etc.). Identify the base URL (default: `http:\u002F\u002Flocalhost:3000` or `http:\u002F\u002Flocalhost:5173` for Vite projects).\n4. **Read access to source** — The agent must be able to read router config files, component files, and API client files in the project.\n5. **Write access to output path** — Confirm the output directory exists or can be created before Step 4.\n\n---\n\n## Step 1: Static Code Analysis\n\nGoal: build a complete list of routes and their associated data, forms, and API calls without launching a browser.\n\n### 1a. Detect the frontend framework and locate the router config\n\nCheck for the following files in order. Use the first match.\n\n| Framework | Indicator file(s) | Route source |\n|---|---|---|\n| Next.js App Router | `app\u002F` directory with `page.tsx` or `page.jsx` files | Walk `app\u002F**\u002Fpage.tsx` — each `page.tsx` path segment is a route |\n| Next.js Pages Router | `pages\u002F` directory | Walk `pages\u002F**\u002F*.tsx` — filename maps to route, `[param]` = dynamic segment |\n| React Router v6+ | `src\u002Froutes.tsx`, `src\u002Frouter.tsx`, or `createBrowserRouter` call | Read the routes config; extract `path:` values |\n| SvelteKit | `src\u002Froutes\u002F` directory with `+page.svelte` files | Walk `src\u002Froutes\u002F**\u002F+page.svelte` — directory path = route |\n| Vue Router | `src\u002Frouter\u002Findex.ts` or `src\u002Frouter.ts` | Read `routes` array; extract `path:` values |\n| Remix | `app\u002Froutes\u002F` directory | Walk `app\u002Froutes\u002F*.tsx` — filename encodes route (`.` = `\u002F`, `_` = layout) |\n\nRead the router config file (or walk the directory) and produce a flat list:\n\n```json\n[\n  { \"route\": \"\u002F\", \"label\": \"Home\" },\n  { \"route\": \"\u002Flogin\", \"label\": \"Login\" },\n  { \"route\": \"\u002Fdashboard\", \"label\": \"Dashboard\" },\n  { \"route\": \"\u002Fusers\u002F:id\", \"label\": \"User Detail\" },\n  ...\n]\n```\n\nFor dynamic segments (`:id`, `[id]`, `$id`), record the pattern and note that a real ID must be substituted during browser exploration.\n\n### 1b. Read component files for each route\n\nFor each route, locate the corresponding component or page file. Read it and extract:\n\n- **Form fields**: `\u003Cinput>`, `\u003Cselect>`, `\u003Ctextarea>`, `\u003CForm>`, `react-hook-form` `register()` calls, `zod` schema field names\n- **Data displays**: table components, list renders, charts, cards — note what data entity they display\n- **Auth guards**: `useAuth`, `ProtectedRoute`, `redirect('\u002Flogin')`, `getServerSession`, middleware imports\n- **Navigation links**: `\u003CLink to=...>`, `\u003Ca href=...>`, `router.push(...)` — these reveal routes you may have missed\n- **Key user actions**: button labels, submit handler names, mutation calls\n\nRecord per-route notes:\n\n```json\nroute: \u002Flogin\n  forms: [{ \"fields\": [\"email\", \"password\"], \"submitLabel\": \"Sign in\", \"validation\": \"zod\" }]\n  auth_guard: false\n  navigation_links: [\"\u002Fregister\", \"\u002Fforgot-password\"]\n  data_displays: []\n  api_calls: [\"POST \u002Fapi\u002Fauth\u002Flogin\"]\n```\n\n### 1c. Read API client and service files\n\nLocate API client files: `src\u002Flib\u002Fapi.ts`, `src\u002Fservices\u002F`, `src\u002Fapi\u002F`, `src\u002Fhooks\u002Fuse*.ts` with fetch\u002Faxios calls. For each, extract:\n\n- HTTP method and endpoint path\n- Which route component imports this function\n- Whether the call requires auth headers (look for `Authorization`, `Bearer`, cookie checks)\n\nThis creates a map of route → API dependencies used later to seed test fixture needs.\n\n---\n\n## Step 2: Framework Detection\n\nGoal: determine where tests live and avoid overwriting existing config.\n\n### 2a. Detect existing test framework\n\nCheck in order:\n\n1. `playwright.config.ts` or `playwright.config.js` — Playwright is already configured; read it (see 2b).\n2. `vitest.config.ts` with `@playwright\u002Fexperimental-ct-*` — component testing; separate from e2e.\n3. `jest.config.*` — Jest is present; Playwright will coexist, but confirm no namespace collision.\n4. No config found — fresh setup; proceed to create `playwright.config.ts` only if explicitly instructed.\n\n### 2b. Read existing playwright.config.ts if present\n\nExtract:\n- `testDir` — where spec files go (e.g., `e2e\u002F`, `tests\u002F`, `__tests__\u002F`)\n- `baseURL` — the app's base URL for tests\n- `projects` — which browsers are configured\n- `webServer` command — how the app is started for tests\n\nIf `baseURL` is set, use it. Otherwise default to `http:\u002F\u002Flocalhost:3000`.\n\n### 2c. Determine output directory for test files\n\nUse this priority:\n1. `testDir` from `playwright.config.ts`\n2. `e2e\u002F` if the directory exists\n3. `tests\u002F` if the directory exists\n4. `__tests__\u002F` if the directory exists\n5. Create `e2e\u002F` at project root\n\nRecord the resolved test directory. All generated files go here.\n\n---\n\n## Step 3: Playwright Browser Exploration\n\nGoal: live-validate the static analysis, discover dynamic routes, and capture interactive element inventories.\n\n### 3a. Script setup\n\nWrite a temporary exploration script at `e2e\u002F_explore.ts` (or `.js`). The script is deleted after the inventory is complete. Template:\n\n```typescript\nimport { chromium, Page } from '@playwright\u002Ftest';\nimport * as fs from 'fs';\n\nconst BASE_URL = process.env.BASE_URL ?? 'http:\u002F\u002Flocalhost:3000';\nconst OUTPUT_PATH = process.env.OUTPUT_PATH ?? 'e2e\u002Ftest-scenarios.json';\n\nasync function explorePage(page: Page, route: string) {\n  const url = `${BASE_URL}${route}`;\n  await page.goto(url, { waitUntil: 'networkidle' });\n  await page.screenshot({ path: `e2e\u002F_screenshots${route.replace(\u002F\\\u002F\u002Fg, '_') || '_home'}.png` });\n\n  const interactiveElements = await page.$$eval(\n    '[role=\"button\"], button, a[href], input, select, textarea, [role=\"link\"], [role=\"menuitem\"]',\n    els => els.map(el => ({\n      tag: el.tagName.toLowerCase(),\n      type: (el as HTMLInputElement).type ?? null,\n      name: (el as HTMLInputElement).name ?? null,\n      id: el.id ?? null,\n      text: el.textContent?.trim().slice(0, 80) ?? null,\n      href: (el as HTMLAnchorElement).href ?? null,\n      role: el.getAttribute('role') ?? null,\n      ariaLabel: el.getAttribute('aria-label') ?? null,\n      placeholder: (el as HTMLInputElement).placeholder ?? null,\n      required: (el as HTMLInputElement).required ?? false,\n    }))\n  );\n\n  const forms = await page.$$eval('form', forms => forms.map(form => ({\n    id: form.id ?? null,\n    action: form.action ?? null,\n    method: form.method ?? 'get',\n    fields: Array.from(form.querySelectorAll('input, select, textarea')).map(f => ({\n      tag: f.tagName.toLowerCase(),\n      name: (f as HTMLInputElement).name,\n      type: (f as HTMLInputElement).type ?? null,\n      required: (f as HTMLInputElement).required,\n      placeholder: (f as HTMLInputElement).placeholder ?? null,\n    })),\n  })));\n\n  const pageTitle = await page.title();\n  const h1 = await page.$eval('h1', el => el.textContent?.trim()).catch(() => null);\n\n  return { route, url, pageTitle, h1, interactiveElements, forms };\n}\n```\n\n### 3b. Navigate each route\n\nFor each route collected in Step 1a:\n- Substitute real IDs for dynamic segments. Use IDs discovered from the app's seed data, fixtures, or visible list pages. If no real ID is available, use `1` as a placeholder and mark the scenario `needs_fixture: true`.\n- Call `explorePage(page, route)`.\n- If the page redirects to `\u002Flogin` or another route, record `auth_required: true` for that route.\n- After loading, check `page.url()` against the requested URL. A mismatch indicates a redirect.\n\n### 3c. Discover nested and dynamic routes\n\nAfter exploring the static route list:\n1. On each explored page, collect all `\u003Ca href>` values from `interactiveElements` that start with `\u002F` and are not already in the route list.\n2. Add newly discovered routes to the exploration queue (depth-limited to 2 levels beyond the static list to avoid crawling infinitely).\n3. For modal and drawer triggers: identify buttons whose click reveals a dialog. Use `page.click(selector)` then check for `[role=\"dialog\"]`, `[role=\"alertdialog\"]`, or `.modal` becoming visible. Record modal contents with the same element extraction.\n\n### 3d. Trigger error and empty states\n\nFor each form found:\n- Submit with all fields empty. Record validation messages via `page.$$eval('[role=\"alert\"], .error, [aria-live]', ...)`.\n- These become \"validation\" test scenarios.\n\nFor list\u002Ftable pages:\n- Record whether an empty state element exists (`[data-testid*=\"empty\"]`, `.empty-state`, text matching \"No results\" or \"Nothing here\").\n\n---\n\n## Step 4: Generate Scenario Inventory\n\nGoal: combine static analysis and live exploration into a structured JSON file.\n\n### Scenario object schema\n\nEach scenario in the output array has this shape:\n\n```json\n{\n  \"id\": \"login-happy-path\",\n  \"title\": \"User can log in with valid credentials\",\n  \"route\": \"\u002Flogin\",\n  \"priority\": 1,\n  \"category\": \"auth\",\n  \"type\": \"happy-path\",\n  \"preconditions\": [\"user account exists in DB\"],\n  \"steps\": [\n    \"Navigate to \u002Flogin\",\n    \"Fill email field with valid user email\",\n    \"Fill password field with valid password\",\n    \"Click 'Sign in' button\",\n    \"Assert redirect to \u002Fdashboard\",\n    \"Assert user name visible in header\"\n  ],\n  \"assertions\": [\n    { \"type\": \"url\", \"expected\": \"\u002Fdashboard\" },\n    { \"type\": \"visible\", \"selector\": \"[data-testid='user-menu']\" }\n  ],\n  \"api_calls\": [\"POST \u002Fapi\u002Fauth\u002Flogin\"],\n  \"fixtures_required\": [\"user:standard\"],\n  \"needs_fixture\": false,\n  \"auth_required\": false,\n  \"screenshot_path\": \"e2e\u002F_screenshots_login.png\",\n  \"source\": \"static+browser\"\n}\n```\n\nField definitions:\n- `id` — kebab-case unique identifier; no spaces\n- `priority` — integer 1 (highest) to 5 (lowest)\n- `category` — one of: `auth`, `crud`, `navigation`, `validation`, `error`, `accessibility`, `performance`\n- `type` — one of: `happy-path`, `sad-path`, `edge-case`, `smoke`\n- `needs_fixture` — true if a real DB record ID is required but not confirmed\n- `source` — `static` (from code only), `browser` (from live exploration only), `static+browser` (both)\n\n### Generating scenario objects\n\nFor each route and interaction discovered:\n1. Create one `happy-path` scenario for the primary success flow.\n2. Create one `sad-path` scenario per form for the primary validation failure (empty submit or invalid input).\n3. Create one `auth` scenario if `auth_required: true` was detected — testing that unauthenticated access redirects correctly.\n4. Create navigation scenarios for any links that traverse major sections.\n\n---\n\n## Step 5: Prioritize and Output\n\n### Sorting rules\n\nSort the final scenarios array by `priority` ascending, then by `category` using this order:\n\n1. `auth` — login, logout, session expiry, protected route guards\n2. `crud` — create, read, update, delete for primary data entities\n3. `navigation` — routing, breadcrumbs, back\u002Fforward behavior\n4. `validation` — form field validation, error messages\n5. `error` — 404 pages, API error states, network failure handling\n6. `accessibility` — keyboard nav, ARIA roles, focus management\n7. `performance` — load time, lazy loading, pagination\n\nWithin each category, `happy-path` before `sad-path` before `edge-case`.\n\n### Output file format\n\nWrite the final inventory to the path determined in Step 2c (e.g., `e2e\u002Ftest-scenarios.json`).\n\nThe output must be a valid JSON array:\n\n```json\n[\n  { \"id\": \"login-happy-path\", ... },\n  { \"id\": \"register-sad-path\", ... },\n  ...\n]\n```\n\n### Post-processing cleanup\n\nAfter generating the inventory:\n1. Delete `e2e\u002F_explore.ts` (or `.js`).\n2. Remove temporary screenshot files from `e2e\u002F_screenshots\u002F` unless explicitly requested to keep them.\n3. Log completion status and path to the generated scenarios file.\n\n---\n\n---\n\n## Output Example\n\nA successful run produces `e2e\u002Ftest-scenarios.json`:\n\n```json\n[\n  {\n    \"id\": \"login-happy-path\",\n    \"title\": \"User can log in with valid credentials\",\n    \"route\": \"\u002Flogin\",\n    \"priority\": 1,\n    \"category\": \"auth\",\n    \"type\": \"happy-path\",\n    \"preconditions\": [\"user account exists in DB\"],\n    \"steps\": [\n      \"Navigate to \u002Flogin\",\n      \"Fill email field with valid user email\",\n      \"Fill password field with valid password\",\n      \"Click 'Sign in' button\",\n      \"Assert redirect to \u002Fdashboard\",\n      \"Assert user name visible in header\"\n    ],\n    \"assertions\": [\n      { \"type\": \"url\", \"expected\": \"\u002Fdashboard\" },\n      { \"type\": \"visible\", \"selector\": \"[data-testid='user-menu']\" }\n    ],\n    \"api_calls\": [\"POST \u002Fapi\u002Fauth\u002Flogin\"],\n    \"fixtures_required\": [\"user:standard\"],\n    \"needs_fixture\": false,\n    \"auth_required\": false,\n    \"screenshot_path\": \"e2e\u002F_screenshots_login.png\",\n    \"source\": \"static+browser\"\n  }\n]\n```\n\nThis file serves as the blueprint for the subsequent test generation skill to write actual `.spec.ts` files.\n","# App Exploration for Playwright Test Generation\n\n## When to use this skill\n\nUse this skill when:\n- Starting Playwright test creation for a web application from scratch with no existing e2e suite\n- Auditing an existing test suite to identify coverage gaps against actual app routes and interactions\n- Onboarding to an unfamiliar codebase and needing a complete map of testable surfaces before writing tests\n- After a significant refactor or feature addition that may have invalidated existing test coverage\n\nDo NOT use this skill if:\n- You already have a complete test-scenarios.json from a prior run and the app has not changed\n- The task is to write tests for a single specific component or interaction already identified\n\n---\n\n## Prerequisites\n\nVerify all of the following before proceeding:\n\n1. **Playwright installed** — `npx playwright --version` must succeed. If missing, run `npm install -D @playwright\u002Ftest`.\n2. **Chromium binary** — Run `npx playwright install chromium` if the binary is absent.\n3. **App running or startable** — Either the app is already running at a known base URL, or a start command exists (`npm run dev`, `npm start`, `pnpm dev`, etc.). Identify the base URL (default: `http:\u002F\u002Flocalhost:3000` or `http:\u002F\u002Flocalhost:5173` for Vite projects).\n4. **Read access to source** — The agent must be able to read router config files, component files, and API client files in the project.\n5. **Write access to output path** — Confirm the output directory exists or can be created before Step 4.\n\n---\n\n## Step 1: Static Code Analysis\n\nGoal: build a complete list of routes and their associated data, forms, and API calls without launching a browser.\n\n### 1a. Detect the frontend framework and locate the router config\n\nCheck for the following files in order. Use the first match.\n\n| Framework | Indicator file(s) | Route source |\n|---|---|---|\n| Next.js App Router | `app\u002F` directory with `page.tsx` or `page.jsx` files | Walk `app\u002F**\u002Fpage.tsx` — each `page.tsx` path segment is a route |\n| Next.js Pages Router | `pages\u002F` directory | Walk `pages\u002F**\u002F*.tsx` — filename maps to route, `[param]` = dynamic segment |\n| React Router v6+ | `src\u002Froutes.tsx`, `src\u002Frouter.tsx`, or `createBrowserRouter` call | Read the routes config; extract `path:` values |\n| SvelteKit | `src\u002Froutes\u002F` directory with `+page.svelte` files | Walk `src\u002Froutes\u002F**\u002F+page.svelte` — directory path = route |\n| Vue Router | `src\u002Frouter\u002Findex.ts` or `src\u002Frouter.ts` | Read `routes` array; extract `path:` values |\n| Remix | `app\u002Froutes\u002F` directory | Walk `app\u002Froutes\u002F*.tsx` — filename encodes route (`.` = `\u002F`, `_` = layout) |\n\nRead the router config file (or walk the directory) and produce a flat list:\n\n```json\n[\n  { \"route\": \"\u002F\", \"label\": \"Home\" },\n  { \"route\": \"\u002Flogin\", \"label\": \"Login\" },\n  { \"route\": \"\u002Fdashboard\", \"label\": \"Dashboard\" },\n  { \"route\": \"\u002Fusers\u002F:id\", \"label\": \"User Detail\" },\n  ...\n]\n```\n\nFor dynamic segments (`:id`, `[id]`, `$id`), record the pattern and note that a real ID must be substituted during browser exploration.\n\n### 1b. Read component files for each route\n\nFor each route, locate the corresponding component or page file. Read it and extract:\n\n- **Form fields**: `\u003Cinput>`, `\u003Cselect>`, `\u003Ctextarea>`, `\u003CForm>`, `react-hook-form` `register()` calls, `zod` schema field names\n- **Data displays**: table components, list renders, charts, cards — note what data entity they display\n- **Auth guards**: `useAuth`, `ProtectedRoute`, `redirect('\u002Flogin')`, `getServerSession`, middleware imports\n- **Navigation links**: `\u003CLink to=...>`, `\u003Ca href=...>`, `router.push(...)` — these reveal routes you may have missed\n- **Key user actions**: button labels, submit handler names, mutation calls\n\nRecord per-route notes:\n\n```json\nroute: \u002Flogin\n  forms: [{ \"fields\": [\"email\", \"password\"], \"submitLabel\": \"Sign in\", \"validation\": \"zod\" }]\n  auth_guard: false\n  navigation_links: [\"\u002Fregister\", \"\u002Fforgot-password\"]\n  data_displays: []\n  api_calls: [\"POST \u002Fapi\u002Fauth\u002Flogin\"]\n```\n\n### 1c. Read API client and service files\n\nLocate API client files: `src\u002Flib\u002Fapi.ts`, `src\u002Fservices\u002F`, `src\u002Fapi\u002F`, `src\u002Fhooks\u002Fuse*.ts` with fetch\u002Faxios calls. For each, extract:\n\n- HTTP method and endpoint path\n- Which route component imports this function\n- Whether the call requires auth headers (look for `Authorization`, `Bearer`, cookie checks)\n\nThis creates a map of route → API dependencies used later to seed test fixture needs.\n\n---\n\n## Step 2: Framework Detection\n\nGoal: determine where tests live and avoid overwriting existing config.\n\n### 2a. Detect existing test framework\n\nCheck in order:\n\n1. `playwright.config.ts` or `playwright.config.js` — Playwright is already configured; read it (see 2b).\n2. `vitest.config.ts` with `@playwright\u002Fexperimental-ct-*` — component testing; separate from e2e.\n3. `jest.config.*` — Jest is present; Playwright will coexist, but confirm no namespace collision.\n4. No config found — fresh setup; proceed to create `playwright.config.ts` only if explicitly instructed.\n\n### 2b. Read existing playwright.config.ts if present\n\nExtract:\n- `testDir` — where spec files go (e.g., `e2e\u002F`, `tests\u002F`, `__tests__\u002F`)\n- `baseURL` — the app's base URL for tests\n- `projects` — which browsers are configured\n- `webServer` command — how the app is started for tests\n\nIf `baseURL` is set, use it. Otherwise default to `http:\u002F\u002Flocalhost:3000`.\n\n### 2c. Determine output directory for test files\n\nUse this priority:\n1. `testDir` from `playwright.config.ts`\n2. `e2e\u002F` if the directory exists\n3. `tests\u002F` if the directory exists\n4. `__tests__\u002F` if the directory exists\n5. Create `e2e\u002F` at project root\n\nRecord the resolved test directory. All generated files go here.\n\n---\n\n## Step 3: Playwright Browser Exploration\n\nGoal: live-validate the static analysis, discover dynamic routes, and capture interactive element inventories.\n\n### 3a. Script setup\n\nWrite a temporary exploration script at `e2e\u002F_explore.ts` (or `.js`). The script is deleted after the inventory is complete. Template:\n\n```typescript\nimport { chromium, Page } from '@playwright\u002Ftest';\nimport * as fs from 'fs';\n\nconst BASE_URL = process.env.BASE_URL ?? 'http:\u002F\u002Flocalhost:3000';\nconst OUTPUT_PATH = process.env.OUTPUT_PATH ?? 'e2e\u002Ftest-scenarios.json';\n\nasync function explorePage(page: Page, route: string) {\n  const url = `${BASE_URL}${route}`;\n  await page.goto(url, { waitUntil: 'networkidle' });\n  await page.screenshot({ path: `e2e\u002F_screenshots${route.replace(\u002F\\\u002F\u002Fg, '_') || '_home'}.png` });\n\n  const interactiveElements = await page.$$eval(\n    '[role=\"button\"], button, a[href], input, select, textarea, [role=\"link\"], [role=\"menuitem\"]',\n    els => els.map(el => ({\n      tag: el.tagName.toLowerCase(),\n      type: (el as HTMLInputElement).type ?? null,\n      name: (el as HTMLInputElement).name ?? null,\n      id: el.id ?? null,\n      text: el.textContent?.trim().slice(0, 80) ?? null,\n      href: (el as HTMLAnchorElement).href ?? null,\n      role: el.getAttribute('role') ?? null,\n      ariaLabel: el.getAttribute('aria-label') ?? null,\n      placeholder: (el as HTMLInputElement).placeholder ?? null,\n      required: (el as HTMLInputElement).required ?? false,\n    }))\n  );\n\n  const forms = await page.$$eval('form', forms => forms.map(form => ({\n    id: form.id ?? null,\n    action: form.action ?? null,\n    method: form.method ?? 'get',\n    fields: Array.from(form.querySelectorAll('input, select, textarea')).map(f => ({\n      tag: f.tagName.toLowerCase(),\n      name: (f as HTMLInputElement).name,\n      type: (f as HTMLInputElement).type ?? null,\n      required: (f as HTMLInputElement).required,\n      placeholder: (f as HTMLInputElement).placeholder ?? null,\n    })),\n  })));\n\n  const pageTitle = await page.title();\n  const h1 = await page.$eval('h1', el => el.textContent?.trim()).catch(() => null);\n\n  return { route, url, pageTitle, h1, interactiveElements, forms };\n}\n```\n\n### 3b. Navigate each route\n\nFor each route collected in Step 1a:\n- Substitute real IDs for dynamic segments. Use IDs discovered from the app's seed data, fixtures, or visible list pages. If no real ID is available, use `1` as a placeholder and mark the scenario `needs_fixture: true`.\n- Call `explorePage(page, route)`.\n- If the page redirects to `\u002Flogin` or another route, record `auth_required: true` for that route.\n- After loading, check `page.url()` against the requested URL. A mismatch indicates a redirect.\n\n### 3c. Discover nested and dynamic routes\n\nAfter exploring the static route list:\n1. On each explored page, collect all `\u003Ca href>` values from `interactiveElements` that start with `\u002F` and are not already in the route list.\n2. Add newly discovered routes to the exploration queue (depth-limited to 2 levels beyond the static list to avoid crawling infinitely).\n3. For modal and drawer triggers: identify buttons whose click reveals a dialog. Use `page.click(selector)` then check for `[role=\"dialog\"]`, `[role=\"alertdialog\"]`, or `.modal` becoming visible. Record modal contents with the same element extraction.\n\n### 3d. Trigger error and empty states\n\nFor each form found:\n- Submit with all fields empty. Record validation messages via `page.$$eval('[role=\"alert\"], .error, [aria-live]', ...)`.\n- These become \"validation\" test scenarios.\n\nFor list\u002Ftable pages:\n- Record whether an empty state element exists (`[data-testid*=\"empty\"]`, `.empty-state`, text matching \"No results\" or \"Nothing here\").\n\n---\n\n## Step 4: Generate Scenario Inventory\n\nGoal: combine static analysis and live exploration into a structured JSON file.\n\n### Scenario object schema\n\nEach scenario in the output array has this shape:\n\n```json\n{\n  \"id\": \"login-happy-path\",\n  \"title\": \"User can log in with valid credentials\",\n  \"route\": \"\u002Flogin\",\n  \"priority\": 1,\n  \"category\": \"auth\",\n  \"type\": \"happy-path\",\n  \"preconditions\": [\"user account exists in DB\"],\n  \"steps\": [\n    \"Navigate to \u002Flogin\",\n    \"Fill email field with valid user email\",\n    \"Fill password field with valid password\",\n    \"Click 'Sign in' button\",\n    \"Assert redirect to \u002Fdashboard\",\n    \"Assert user name visible in header\"\n  ],\n  \"assertions\": [\n    { \"type\": \"url\", \"expected\": \"\u002Fdashboard\" },\n    { \"type\": \"visible\", \"selector\": \"[data-testid='user-menu']\" }\n  ],\n  \"api_calls\": [\"POST \u002Fapi\u002Fauth\u002Flogin\"],\n  \"fixtures_required\": [\"user:standard\"],\n  \"needs_fixture\": false,\n  \"auth_required\": false,\n  \"screenshot_path\": \"e2e\u002F_screenshots_login.png\",\n  \"source\": \"static+browser\"\n}\n```\n\nField definitions:\n- `id` — kebab-case unique identifier; no spaces\n- `priority` — integer 1 (highest) to 5 (lowest)\n- `category` — one of: `auth`, `crud`, `navigation`, `validation`, `error`, `accessibility`, `performance`\n- `type` — one of: `happy-path`, `sad-path`, `edge-case`, `smoke`\n- `needs_fixture` — true if a real DB record ID is required but not confirmed\n- `source` — `static` (from code only), `browser` (from live exploration only), `static+browser` (both)\n\n### Generating scenario objects\n\nFor each route and interaction discovered:\n1. Create one `happy-path` scenario for the primary success flow.\n2. Create one `sad-path` scenario per form for the primary validation failure (empty submit or invalid input).\n3. Create one `auth` scenario if `auth_required: true` was detected — testing that unauthenticated access redirects correctly.\n4. Create navigation scenarios for any links that traverse major sections.\n\n---\n\n## Step 5: Prioritize and Output\n\n### Sorting rules\n\nSort the final scenarios array by `priority` ascending, then by `category` using this order:\n\n1. `auth` — login, logout, session expiry, protected route guards\n2. `crud` — create, read, update, delete for primary data entities\n3. `navigation` — routing, breadcrumbs, back\u002Fforward behavior\n4. `validation` — form field validation, error messages\n5. `error` — 404 pages, API error states, network failure handling\n6. `accessibility` — keyboard nav, ARIA roles, focus management\n7. `performance` — load time, lazy loading, pagination\n\nWithin each category, `happy-path` before `sad-path` before `edge-case`.\n\n### Output file format\n\nWrite the final inventory to the path determined in Step 2c (e.g., `e2e\u002Ftest-scenarios.json`).\n\nThe output must be a valid JSON array:\n\n```json\n[\n  { \"id\": \"login-happy-path\", ... },\n  { \"id\": \"register-sad-path\", ... },\n  ...\n]\n```\n\n### Post-processing cleanup\n\nAfter generating the inventory:\n1. Delete `e2e\u002F_explore.ts` (or `.js`).\n2. Remove temporary screenshot files from `e2e\u002F_screenshots\u002F` unless explicitly requested to keep them.\n3. Log completion status and path to the generated scenarios file.\n\n---\n\n---\n\n## Output Example\n\nA successful run produces `e2e\u002Ftest-scenarios.json`:\n\n```json\n[\n  {\n    \"id\": \"login-happy-path\",\n    \"title\": \"User can log in with valid credentials\",\n    \"route\": \"\u002Flogin\",\n    \"priority\": 1,\n    \"category\": \"auth\",\n    \"type\": \"happy-path\",\n    \"preconditions\": [\"user account exists in DB\"],\n    \"steps\": [\n      \"Navigate to \u002Flogin\",\n      \"Fill email field with valid user email\",\n      \"Fill password field with valid password\",\n      \"Click 'Sign in' button\",\n      \"Assert redirect to \u002Fdashboard\",\n      \"Assert user name visible in header\"\n    ],\n    \"assertions\": [\n      { \"type\": \"url\", \"expected\": \"\u002Fdashboard\" },\n      { \"type\": \"visible\", \"selector\": \"[data-testid='user-menu']\" }\n    ],\n    \"api_calls\": [\"POST \u002Fapi\u002Fauth\u002Flogin\"],\n    \"fixtures_required\": [\"user:standard\"],\n    \"needs_fixture\": false,\n    \"auth_required\": false,\n    \"screenshot_path\": \"e2e\u002F_screenshots_login.png\",\n    \"source\": \"static+browser\"\n  }\n]\n```\n\nThis file serves as the blueprint for the subsequent test generation skill to write actual `.spec.ts` files.\n",{"updated":44,"description":7,"when_to_use":45},1781827200000,"Use when starting Playwright test creation for a web application from scratch, auditing coverage gaps, onboarding to an unfamiliar codebase, or after significant refactors.","main","b293a8475fcbb20683373dc9735a2ecf0ca7889d","corpus\u002Flibrary\u002Fskills\u002Fe2e-testing\u002Fapp-exploration","https:\u002F\u002Fgithub.com\u002Fitlackey\u002Fakm-eval","https:\u002F\u002Fgithub.com\u002Fitlackey","2026-11-13 11:49:12",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add itlackey\u002Fakm-eval --skill app-exploration",{"tool":58,"command":59},"bunx","bunx skills add itlackey\u002Fakm-eval --skill app-exploration",{"tool":61,"command":62},"pnpm","pnpm dlx skills add itlackey\u002Fakm-eval --skill app-exploration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fitlackey\u002Fakm-eval\u002Fblob\u002Fmain\u002Fcorpus\u002Flibrary\u002Fskills\u002Fe2e-testing\u002Fapp-exploration\u002FSKILL.md",true,[],[67,75,82,89,96,103],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":74},"01M748G6310YQEN9SEY8E69V7F","tax-filing-checklist","Walk through the steps and documents needed to file an individual federal income tax return","https:\u002F\u002Fgithub.com\u002Fitlackey\u002Fakm-eval\u002Fblob\u002Fmain\u002Fevals\u002Fretrieval\u002Fassets\u002Fbooks\u002Flibrary\u002Fskills\u002Ftax-filing-checklist\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":74},"01M748G3C1CSMBM33KP2CCK7TB","patient-vitals-charting","Record patient vital signs consistently and flag values outside the normal reference range","https:\u002F\u002Fgithub.com\u002Fitlackey\u002Fakm-eval\u002Fblob\u002Fmain\u002Fevals\u002Fretrieval\u002Fassets\u002Fbooks\u002Flibrary\u002Fskills\u002Fpatient-vitals-charting\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":74},"01M748G05H68QFB8YVQKDHF66B","pasta-from-scratch","Make fresh egg pasta dough from scratch, roll it, and cut it into shapes","https:\u002F\u002Fgithub.com\u002Fitlackey\u002Fakm-eval\u002Fblob\u002Fmain\u002Fevals\u002Fretrieval\u002Fassets\u002Fbooks\u002Flibrary\u002Fskills\u002Fpasta-from-scratch\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":74},"01M748FXAQVJRX98HP8STRTD9P","knife-sharpening","Sharpen and hone kitchen knives to keep an edge safe and effective","https:\u002F\u002Fgithub.com\u002Fitlackey\u002Fakm-eval\u002Fblob\u002Fmain\u002Fevals\u002Fretrieval\u002Fassets\u002Fbooks\u002Flibrary\u002Fskills\u002Fknife-sharpening\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":74},"01M748FTJEZ0P6BXNERTHZ9KB3","first-aid-response","Respond to a first aid emergency using a scene-safety-first, ABC-based (airway, breathing, circulation) approach","https:\u002F\u002Fgithub.com\u002Fitlackey\u002Fakm-eval\u002Fblob\u002Fmain\u002Fevals\u002Fretrieval\u002Fassets\u002Fbooks\u002Flibrary\u002Fskills\u002Ffirst-aid-response\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":74},"01M748FQESZPA3ZW5SWKJNKMD0","contract-review-basics","Review a contract draft for missing terms, ambiguous language, and risky clauses before signing","https:\u002F\u002Fgithub.com\u002Fitlackey\u002Fakm-eval\u002Fblob\u002Fmain\u002Fevals\u002Fretrieval\u002Fassets\u002Fbooks\u002Flibrary\u002Fskills\u002Fcontract-review-basics\u002FSKILL.md",[],[]]