# Qwik Router Development

> 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.

- **Type:** Skill
- **Install:** `agentstack add skill-modem-dev-ossrules-qwik-router-development`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [modem-dev](https://agentstack.voostack.com/s/modem-dev)
- **Installs:** 0
- **Category:** [Content & Media](https://agentstack.voostack.com/c/content-and-media)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [modem-dev](https://github.com/modem-dev)
- **Source:** https://github.com/modem-dev/ossrules/tree/main/public/files/qwik/.ruler/skills/qwik-router-development
- **Website:** https://ossrules.md

## Install

```sh
agentstack add skill-modem-dev-ossrules-qwik-router-development
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Qwik Router Development

Use this skill for `packages/qwik-router/**` work. Keep the repo-wide rules from `.ruler/AGENTS.md`
in force.

## Fast Path

1. Classify the touched router surface before editing: runtime, buildtime, middleware, adapter, SSG,
   markdown/MDX, or Vite integration.
2. Read the smallest source file plus the closest `*.unit.ts` or `*.spec.ts` file before changing
   behavior.
3. For middleware, loader, action, or navigation changes, trace handler ordering and shared state
   from request creation through response/client consumption before editing.
4. For unit/spec coverage, run `pnpm vitest run `.
5. For browser/router behavior, rebuild first with `pnpm build.core.dev`, then use the focused
   Qwik Router e2e command.
6. 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:

```bash
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.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [modem-dev](https://github.com/modem-dev)
- **Source:** [modem-dev/ossrules](https://github.com/modem-dev/ossrules)
- **License:** MIT
- **Homepage:** https://ossrules.md

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-modem-dev-ossrules-qwik-router-development
- Seller: https://agentstack.voostack.com/s/modem-dev
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
