You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/agents/code-reviewer/AGENT.md
+19-13Lines changed: 19 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ You are a code reviewer for the egapro project. You review diffs and changed fil
9
9
10
10
## Instructions
11
11
12
-
You receive a list of changed files or a git diff. For each file, check against the checklist below. Report only confirmed violations — no false positives.
12
+
You receive a list of changed files or a git diff. For each file, check against the 21-point checklist below. Report only confirmed violations — no false positives.
13
13
14
14
## Checklist
15
15
@@ -21,18 +21,24 @@ You receive a list of changed files or a git diff. For each file, check against
21
21
5.**Useless constants** — Module-scope `const` used only once right below its definition. Remove indirection.
22
22
23
23
### Styling & DSFR
24
-
6.**Inline SVG** — Raw `<svg>` elements in components. Must use `public/assets/` + `<img>` or DSFR icon classes.
25
-
7.**Inline styles** — `style={{...}}` in `.tsx` files. Must use DSFR classes or scoped SCSS modules.
26
-
8.**common.module.scss** — Imports from shared SCSS. Each component must have its own scoped SCSS module.
27
-
9.**Raw colors** — Hardcoded `#hex` or `rgba()`. Must use DSFR CSS custom properties.
24
+
6.**Inline SVG** — Raw `<svg>` elements in components. Must use `public/assets/` + `<Image>` (from `next/image`) or DSFR icon classes.
25
+
7.**Raw `<img>`** — Must use `import Image from "next/image"` instead of raw `<img>` tags.
26
+
8.**Inline styles** — `style={{...}}` in `.tsx` files. Must use DSFR classes or scoped SCSS modules.
27
+
9.**common.module.scss** — Imports from shared SCSS. Each component must have its own scoped SCSS module.
28
+
10.**Raw colors** — Hardcoded `#hex` or `rgba()`. Must use DSFR CSS custom properties.
29
+
11.**Raw `@media`** — Raw `@media (min-width|max-width|screen)` in `.scss` files. Must use DSFR mixins: `@include respond-from(md)` / `respond-to(sm)`.
30
+
12.**Raster assets** — PNG/JPG illustrations or icons from Figma. Must be exported as SVG. Only real photographs may use raster (WebP).
28
31
29
32
### Patterns & Architecture
30
-
10.**Suppression comments** — `biome-ignore`, `eslint-disable`, `@ts-ignore`, `@ts-expect-error`. Must fix the underlying issue.
31
-
11.**Missing DB transactions** — Multiple sequential writes without `db.transaction()`.
32
-
12.**Duplicated Zod schemas** — Same Zod schema defined inline in multiple places. Must be in shared `schemas.ts`.
33
-
13.**process.env** — Direct `process.env` access instead of `import { env } from "~/env.js"`.
34
-
14.**Barrel import violation** — Importing from internal module paths instead of the barrel `index.ts`.
35
-
15.**Missing ownership check** — tRPC mutations modifying data without verifying the user owns the resource.
33
+
13.**Suppression comments** — `biome-ignore`, `eslint-disable`, `@ts-ignore`, `@ts-expect-error`. Must fix the underlying issue.
34
+
14.**Explicit `any`** — `: any` or `as any` in `.ts/.tsx` (excluding test files). Must use `unknown` with type narrowing.
35
+
15.**dangerouslySetInnerHTML** — XSS risk, forbidden in `.tsx` files. Must use safe rendering or DOMPurify.
36
+
16.**Deep relative imports** — `../../` or deeper in `.ts/.tsx`. Must use the `~/` path alias.
37
+
17.**Missing DB transactions** — Multiple sequential writes without `db.transaction()`.
38
+
18.**Duplicated Zod schemas** — Same Zod schema defined inline in multiple places. Must be in shared `schemas.ts`.
39
+
19.**process.env** — Direct `process.env` access instead of `import { env } from "~/env.js"`.
40
+
20.**Barrel import violation** — Importing from internal module paths instead of the barrel `index.ts`.
41
+
21.**Missing ownership check** — tRPC mutations modifying data without verifying the user owns the resource.
36
42
37
43
## Output Format
38
44
@@ -43,8 +49,8 @@ For each violation found:
43
49
```
44
50
45
51
Severity levels:
46
-
-`[ERROR]` — Must fix before merge (items 6, 7, 10, 11, 13, 15)
|`../../` (or deeper) |`.ts/.tsx`| Use `~/` path alias |
26
27
|`@media` (width/screen) |`.scss`| Use DSFR mixins: `@include respond-from(md)` / `respond-to(sm)`|
@@ -69,11 +70,13 @@ Before reporting ANY task as done, launch **3 parallel agents**:
69
70
70
71
If any fails → fix → re-run. Only report completion when all 3 pass.
71
72
73
+
**Bonus: Next.js runtime check** — if the dev server is running, also call `nextjs_call(get_errors)` via the `next-devtools` MCP to catch runtime/compilation errors not visible in `pnpm typecheck`.
74
+
72
75
### Gate 2 — RGAA (always)
73
76
74
77
Verify **inline while writing** AND audit all created/modified files after implementation:
75
78
-`<input>` → associated `<label>` via `htmlFor`/`id`
76
-
-`<img>`→ descriptive `alt` (or `alt=""` if decorative)
79
+
-Images → `import Image from "next/image"` (raw `<img>`blocked by hook), descriptive `alt` (or `alt=""` if decorative)
Copy file name to clipboardExpand all lines: .claude/skills/create-page/SKILL.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,7 @@ Otherwise, code only the applicable parts in order:
85
85
- Each component < 200 lines, `"use client"` only where needed
86
86
87
87
6. Run `pnpm typecheck` to validate foundations compile.
88
+
7. If dev server is running, use `nextjs_call(get_errors)` to verify no runtime errors.
88
89
89
90
### Phase 3 — Pages (parallel agents)
90
91
@@ -111,6 +112,8 @@ Each agent MUST follow:
111
112
-**Server Components** by default, `"use client"` only for hooks/events/browser APIs
112
113
-**DSFR classes** for all styling (no inline styles, no raw colors)
113
114
-**DSFR MCP** to verify HTML structure before writing
115
+
-**Figma assets as SVG**: export all illustrations/icons from Figma as SVG (never PNG/JPG). Store in `public/assets/{module}/`. Only accept raster for real photographs
116
+
-**`next/image`**: all images use `import Image from "next/image"` (raw `<img>` blocked by hook)
4.**RGAA audit** — delegate to `rgaa-auditor` agent on all changed `.tsx` files (skip if no `.tsx` in diff)
58
+
5.**Security audit** — delegate to `security-auditor` agent on all changed `.ts/.tsx` in `server/`, `routers/`, or tRPC (skip if no server files in diff)
|`dsfr`| Before writing any DSFR HTML |`get_component_doc`, `search_components`, `get_color_tokens`|
73
+
|`figma`| When implementing from a Figma design |`get_design_context`, `get_screenshot`|
74
+
75
+
**Next.js DevTools** is particularly important: use `nextjs_docs` to look up Next.js APIs (never guess from memory), and use `nextjs_call(get_errors)` to check runtime/compilation errors after changes.
76
+
77
+
See `packages/app/CLAUDE.md` for detailed usage instructions per MCP server.
78
+
79
+
---
80
+
65
81
## Useful root scripts
66
82
67
83
```bash
@@ -110,7 +126,7 @@ When creating multiple pages/screens, follow this 4-phase approach:
0 commit comments