Qwik Router Development
Use this skill for packages/qwik-router/** work. Keep the repo-wide rules from .ruler/AGENTS.md
in force.
Fast Path
- Classify the touched router surface before editing: runtime, buildtime, middleware, adapter, SSG,
markdown/MDX, or Vite integration.
- Read the smallest source file plus the closest
*.unit.ts or *.spec.ts file before changing
behavior.
- For middleware, loader, action, or navigation changes, trace handler ordering and shared state
from request creation through response/client consumption before editing.
- For unit/spec coverage, run
pnpm vitest run <path>.
- For browser/router behavior, rebuild first with
pnpm build.core.dev, then use the focused
Qwik Router e2e command.
- If public router API markdown changes are expected, run
pnpm api.update after tests pass.
Source Map
- Runtime:
packages/qwik-router/src/runtime/src/
- Buildtime route generation:
packages/qwik-router/src/buildtime/
- Vite integration:
packages/qwik-router/src/buildtime/vite/
- Middleware:
packages/qwik-router/src/middleware/
- Adapters:
packages/qwik-router/src/adapters/
- SSG:
packages/qwik-router/src/ssg/
- Router e2e tests:
e2e/qwik-e2e/tests/qwikrouter/
Verification
Use the closest command that covers the changed surface:
pnpm vitest run packages/qwik-router/src/buildtime/routing/parse-pathname.unit.ts
pnpm vitest run packages/qwik-router/src/runtime/src/client-navigate.unit.ts
pnpm build.core.dev
pnpm playwright test e2e/qwik-e2e/tests/qwikrouter/nav.e2e.ts --browser=chromium --config e2e/qwik-e2e/playwright.config.ts
Do not use --project chromium with e2e/qwik-e2e/playwright.config.ts; this config expects the
--browser=chromium flag.
Quality Bar
- Keep middleware, loader, and action ordering explicit. Do not add broad fallbacks that hide which
module owns a request.
- Add regression tests for the exact route shape or request mode that failed, such as index route,
layout loader, page loader, redirect, action, or SPA navigation.
- When changing serialized route state or loader data, update both server output and client
consumption in the same change.
- Preserve deprecated Qwik City compatibility only when current source still supports it, and keep
compatibility warnings/tests intentional.
- If router work exposes stale guidance here or in
.ruler/AGENTS.md, update the guidance before
finishing or record why guidance edits were out of scope.
Stop Conditions
- Stop and inspect the generated API workflow before hand-editing any
*.api.md file.
- Stop and switch to
qwik-e2e-verification when most of the work is Playwright setup/debugging.
- Stop and run
pnpm api.update if exported router API changed.
1---2name: qwik-router-development3description: Use when modifying or reviewing Qwik Router code under packages/qwik-router, including runtime routing, buildtime route generation, middleware, adapters, SSG, markdown/MDX handling, or router tests.4---56# Qwik Router Development78Use this skill for `packages/qwik-router/**` work. Keep the repo-wide rules from `.ruler/AGENTS.md`9in force.1011## Fast Path12131. Classify the touched router surface before editing: runtime, buildtime, middleware, adapter, SSG,14 markdown/MDX, or Vite integration.152. Read the smallest source file plus the closest `*.unit.ts` or `*.spec.ts` file before changing16 behavior.173. For middleware, loader, action, or navigation changes, trace handler ordering and shared state18 from request creation through response/client consumption before editing.194. For unit/spec coverage, run `pnpm vitest run <path>`.205. For browser/router behavior, rebuild first with `pnpm build.core.dev`, then use the focused21 Qwik Router e2e command.226. If public router API markdown changes are expected, run `pnpm api.update` after tests pass.2324## Source Map2526- Runtime: `packages/qwik-router/src/runtime/src/`27- Buildtime route generation: `packages/qwik-router/src/buildtime/`28- Vite integration: `packages/qwik-router/src/buildtime/vite/`29- Middleware: `packages/qwik-router/src/middleware/`30- Adapters: `packages/qwik-router/src/adapters/`31- SSG: `packages/qwik-router/src/ssg/`32- Router e2e tests: `e2e/qwik-e2e/tests/qwikrouter/`3334## Verification3536Use the closest command that covers the changed surface:3738```bash39pnpm vitest run packages/qwik-router/src/buildtime/routing/parse-pathname.unit.ts40pnpm vitest run packages/qwik-router/src/runtime/src/client-navigate.unit.ts41pnpm build.core.dev42pnpm playwright test e2e/qwik-e2e/tests/qwikrouter/nav.e2e.ts --browser=chromium --config e2e/qwik-e2e/playwright.config.ts43```4445Do not use `--project chromium` with `e2e/qwik-e2e/playwright.config.ts`; this config expects the46`--browser=chromium` flag.4748## Quality Bar4950- Keep middleware, loader, and action ordering explicit. Do not add broad fallbacks that hide which51 module owns a request.52- Add regression tests for the exact route shape or request mode that failed, such as index route,53 layout loader, page loader, redirect, action, or SPA navigation.54- When changing serialized route state or loader data, update both server output and client55 consumption in the same change.56- Preserve deprecated Qwik City compatibility only when current source still supports it, and keep57 compatibility warnings/tests intentional.58- If router work exposes stale guidance here or in `.ruler/AGENTS.md`, update the guidance before59 finishing or record why guidance edits were out of scope.6061## Stop Conditions6263- Stop and inspect the generated API workflow before hand-editing any `*.api.md` file.64- Stop and switch to `qwik-e2e-verification` when most of the work is Playwright setup/debugging.65- Stop and run `pnpm api.update` if exported router API changed.