|
1 | 1 | # Agents instructions |
2 | 2 |
|
3 | | -## Always-on context |
4 | | - |
5 | | -- Perd is an outdoor equipment companion centered on catalog browsing, personal inventory, and packing workflows. |
6 | | -- Keep this file lean: use it for non-obvious project guardrails, and load the matching local skill for domain procedures instead of duplicating them here. |
7 | | - |
8 | | -## Product guardrails |
9 | | - |
10 | | -- Keep equipment properties in the EAV model: `category_properties` defines available fields, and `item_property_values` stores per-item values. |
11 | | -- Keep groups and categories independent. Do not add a foreign key between them unless the product plan explicitly changes. |
12 | | -- Keep catalog items flat. Size and similar distinctions belong in category properties, not a variant subsystem. |
13 | | -- Keep reference-data slugs as canonical lowercase URL tokens using only `a-z`, `0-9`, and single hyphens; `name` values stay English display strings. |
14 | | -- Keep `equipment_items` brand/category foreign keys non-cascading (`restrict`) so reference-data deletion cannot silently remove catalog or inventory records. |
15 | | - |
16 | 3 | ## Web Baseline 2025 |
17 | 4 |
|
18 | 5 | - The project targets **Baseline 2025** across all web technologies, including CSS, HTML, and JS browser APIs. |
19 | 6 | - We do not chase legacy browser support. Always choose modern native features over polyfills, fallbacks, or compatibility workarounds when they simplify the code. |
20 | 7 |
|
21 | | -## Frontend and UX guardrails |
| 8 | +## Verification |
22 | 9 |
|
23 | | -- For UI work, `new-design-assets/` is the source of truth for layout, component appearance, color tokens, typography, spacing, and interaction patterns. |
24 | | -- Consult the prototype before changing Vue components, page layouts, or visual styles; match the nearest existing prototype pattern when a case is not covered exactly. |
25 | | -- Keep async action areas structurally stable while loading or mutating. Keep the same interactive control mounted and change its state instead of swapping it for unrelated text. |
26 | | -- Group navigation and actions by user meaning. Do not tuck inventory actions or similar workflow controls into unrelated content sections such as property lists. |
| 10 | +- Run applicable checks in parallel where practical. |
| 11 | +- You can pass only changed file paths to the test and lint commands during development, but verify that the full suite passes at the end of the change. |
27 | 12 |
|
28 | | -## Workflow guardrails |
| 13 | +### Markdown file changes |
29 | 14 |
|
30 | | -- Files imported by standalone Node or `tsx` scripts, including `tools/*.ts`, migrations, seeds, and their transitive dependencies, must not rely on Nuxt-only aliases like `~/` or `@@/`. Use package-backed `#server/*` or `#shared/*` aliases only when needed. |
31 | | -- Implement only requested behavior, reproducible fixes, or currently supported project scenarios. Treat hypothetical compatibility work as follow-up unless the user explicitly scopes it in. |
32 | | -- After any architecture, route-convention, data-model, or test-strategy change, update the relevant docs in the same change. |
| 15 | +- `pnpm run lint:markdown`. |
33 | 16 |
|
34 | | -## Playwright guardrails |
| 17 | +### TypeScript or Vue file changes |
35 | 18 |
|
36 | | -- Run new Playwright scenarios against their individual spec file before the full `pnpm run test:e2e:ci` suite. |
37 | | -- `context.route(...)` matchers must account for query strings whenever the real endpoint is requested with query parameters. |
38 | | -- Mocked-auth E2E flows should not call `page.goto()` after login unless the test also establishes a real server-side session cookie. |
39 | | -- Browser tests through `wrangler dev` must keep Wrangler state, logs, and config under a writable temp directory instead of the user's default `~/.config`. |
| 19 | +- `pnpm run test:typecheck` |
| 20 | +- `pnpm run test:unit:agent` |
| 21 | +- `pnpm run lint:oxlint:agent` |
40 | 22 |
|
41 | | -## Verification |
| 23 | +### Playwright test changes |
42 | 24 |
|
43 | | -- Markdown changes: `pnpm run lint:markdown`. |
44 | | -- TypeScript or Vue changes: `pnpm run test:typecheck`, `pnpm run test:unit:agent`, `pnpm run lint:oxlint:agent`, `pnpm run build`, and `pnpm run test:e2e:ci`. |
45 | | -- Run applicable checks in parallel where practical. |
| 25 | +- `pnpm run test:e2e:ci` |
0 commit comments