--- name: e2e-setup description: Initialize or update the local E2E context file mapping app names to repo paths --- # /e2e-setup - Initialize E2E Context Create or update `.e2e/context.local.json` so the rest of the E2E skills know where the app source repos live on this machine. Without this context, skills run in "degraded mode" and cannot cross-reference routes, services, components, or translations from the apps. ## Why this exists The Humand E2E test repo (e.g. `humand-frontend-testing`) is **separate** from the app repos (`humand-web`, `humand-backoffice`, `hu-translations`, `material-hu`). Each developer clones those repos to different paths on their machine. This skill captures those paths once and writes them to a per-machine config that other skills consume. ## Output files - `.e2e/context.local.json` — gitignored, per-machine. The real config consumed by skills. - `.e2e/context.example.json` — committed, template for new devs. ## Inputs All interactive — the skill asks per app. No required up-front inputs. ## Workflow ### 1) Detect existing config If `.e2e/context.local.json` exists, summarize it and ask: - **Update**: keep the entries you confirm, edit the rest. - **Reset**: discard and start fresh. - **Cancel**: exit without changes. ### 2) For each required app (web, backoffice) 1. **Probe siblings of CWD** for likely folder names: `humand-web`, `humand-backoffice`, `web`, `backoffice`, etc. 2. If found, ask: `Found humand-web at . Use this? (Y/n)` 3. If not found or rejected, prompt: `Enter absolute path to humand-web:` 4. **Validate** the path: - **Hard checks (re-prompt on failure):** - Path exists. - Contains `package.json`. - **Soft check (warn + confirm, do not fail):** - Compare `package.json` `"name"` field against the expected app name (`humand-web` / `humand-backoffice`). - If it does not match, show the actual name and ask: `package.json name is "" but expected "humand-web". Use this path anyway? (y/N)`. - This supports forks, renamed clones, and monorepo subdirs without blocking the dev. ### 3) For each optional shared repo (translations, material-hu) Same flow as step 2, but each one is **opt-out** — pressing enter or saying `skip` is valid and that entry stays absent from the config. ### 4) Probe internal paths per app For each confirmed app, probe known subpaths and record only those that exist: - `sourceRoot` — usually `src/` - `routesPath` — typically `src/router/` or `src/routes/` - `pagesPath` — typically `src/pages/dashboard/` If a sub-path is missing, omit it from the config (skills will degrade gracefully). > Note: Humand apps are **in the middle of a per-module services migration**. Newer modules own their `services.ts` next to their `index.tsx` (e.g. `src/pages/dashboard/performance/services.ts`); legacy ones still keep services under a shared directory like `src/services/`; some have files in both during transition. There is no single canonical `servicesPath` that holds across modules, so this config does not record one. Consumer skills that need to read services should search per-module first (`//services.ts`) and fall back to `/services/` when nothing is found there. ### 5) Write `.e2e/context.local.json` Use this canonical shape: ```json { "apps": { "web": { "repoPath": "/abs/path/to/humand-web", "sourceRoot": "src", "routesPath": "src/router", "pagesPath": "src/pages/dashboard" }, "backoffice": { "repoPath": "/abs/path/to/humand-backoffice", "sourceRoot": "src", "routesPath": "src/router", "pagesPath": "src/pages/dashboard" } }, "shared": { "translations": { "repoPath": "/abs/path/to/hu-translations" }, "material-hu": { "repoPath": "/abs/path/to/material-hu" } } } ``` Omit any app/shared entry the dev skipped. Omit any sub-path that did not validate. ### 6) Write or update `.e2e/context.example.json` Same shape as the local file, but with `` placeholders. Commit-safe. ### 7) Ensure `.gitignore` ignores the local file Append (if not already present): ``` .e2e/context.local.json ``` ### 8) Print a summary Show the final JSON and list any apps/sub-paths that were skipped. ## Out of scope (intentional) - **Cloning repos.** If a repo is missing, the skill exits with "not found"; the dev clones manually. - **Inferring paths from `git remote`.** Path discovery stays explicit. - **Storing tokens or credentials.** Only filesystem paths. - **Running Playwright.** Setup only. ## How other skills consume the context Other E2E skills add a "Resolve app context" step at the start of their workflow: 1. Read `.e2e/context.local.json`. If missing, suggest running `/e2e-setup`. 2. If the dev opts to proceed without it, run in **degraded mode** — no cross-referencing app source code, translations, or shared components. 3. When the workspace name matches an `apps[]` key (e.g. workspace `web` ↔ `apps.web`), use that app's `repoPath` to locate routes, services, components, and pages during planning, generation, healing, or POM construction. ## Re-running Re-running `/e2e-setup` is safe. The skill detects the existing config and preserves any entries the dev confirms. Use it when: - A new app is added to the testing scope. - A repo was moved on disk. - A teammate hands over a machine and the paths changed.