Repository navigation
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
104 lines (99 loc) · 9.33 KB
/
Copy path.coderabbit.yaml
File metadata and controls
104 lines (99 loc) · 9.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
language: en
early_access: false
reviews:
# Approve once all CodeRabbit comments are resolved; request changes while any are open.
request_changes_workflow: true
high_level_summary: true
sequence_diagrams: true
poem: false
review_status: true
collapse_walkthrough: false
changed_files_summary: true
auto_review:
enabled: true
auto_incremental_review: true
path_filters:
- "!**/.*/**" # Exclude hidden/system files/scripts
- "!**/@types" # Exclude types
- "!**/public/**" # Exclude public assets
- "!**/node_modules/**" # Exclude dependencies
- "!**/dist/**" # Exclude build files
- "!src/crd/app/**" # Standalone CRD preview app with mock data
path_instructions:
- path: "**/*"
instructions: |
Repository overview:
- React 19 + TypeScript single-page app for the Alkemio platform. Uses Vite 5, Apollo Client 3, Vitest. CRD (shadcn/ui + Tailwind, `src/crd/`) is the only design system. MUI/Emotion were fully removed (story #9885) and must never be reintroduced.
- Large surface (production build transforms ~18k modules). Core implementation lives in src/core, src/domain, and src/main; generated GraphQL hooks reside in src/core/apollo/generated.
- Authoritative docs: README.md, docs/development-setup.md, .specify/memory/constitution.md, agents.md, .github/copilot-instructions.md.
Environment & bootstrap:
1. Ensure Node >=24.0.0 (Volta pins 24.14.0) and pnpm >=10.17.1.
2. Keep .env (checked in) present; override locally via .env.local.
3. `pnpm install` (validated 2025-10-30, ~1s with cached deps). pnpm warns about ignored build scripts (@sentry/cli, esbuild, husky, msw); ignore or run `pnpm approve-builds` if required.
Validation flow (validated 2025-10-30):
- `pnpm lint` → runs `tsc --noEmit` then ESLint on `src/**/*.ts(x)`; completed cleanly.
- `pnpm vitest run --reporter=basic`.
- `pnpm build` →Rewrites `.build/docker/.env.base` and `public/env-config.js`; revert before commit. Emits expected large-chunk warnings.
- `pnpm serve:dev` → serves `./build` on port 3001 (after `pnpm build`).
- `pnpm format` → Prettier for `src/**/*.ts(x)`.
- `pnpm codegen` → requires backend GraphQL endpoint at `http://localhost:3000/graphql`; regenerates `src/core/apollo/generated` artifacts.
- `pnpm start` → Vite dev server (app reachable via Traefik on `http://localhost:3000`, Vite listens on 3001). Regenerates `public/env-config.js` each run.
Layout & architecture:
- `src/index.tsx` bootstraps the SPA; `src/root.tsx` wires Sentry, Apollo, routing, auth, and global state.
- `src/core/` houses shared infrastructure (auth, analytics, routing helpers, UI kit, utilities).
- `src/domain/` contains domain façades/hooks grouped by business context (space, innovationHub, communication, etc.).
- `src/main/` provides routed shells, layouts, notifications, admin flows; keep business rules in `src/domain` or `src/core`.
- `buildConfiguration.js` injects `VITE_APP_*` env vars into `.build/docker/.env.base` and `public/env-config.js`; never commit those generated files.
Review focus:
- Follow the hierarchy: constitution → agents.md → .github/copilot-instructions.md.
- Require `pnpm codegen` and schema diff summaries when `*.graphql` changes; prohibit ad-hoc `useQuery` usage.
- Enforce React 19 concurrency hygiene, WCAG 2.1 AA accessibility, and localization via `react-i18next` (no hard-coded copy).
- **MUI/Emotion are removed**: MUI and Emotion were fully removed (story #9885); the packages are uninstalled. Flag ANY `@mui/*` or `@emotion/*` import in any file as a BLOCKING issue — they must never be reintroduced; use the CRD design system (`src/crd/`) instead.
- **i18n — all strings live in CRD**: The legacy default `translation` namespace and its `src/core/i18n/<lang>/translation.<lang>.json` files were REMOVED (story #9885). The default namespace is now `crd-common` (`src/crd/i18n/common/`). Every user-facing string belongs in the CRD per-feature namespaces under `src/crd/i18n/<feature>/`. There is no longer a frozen legacy core file. Flag any reintroduction of a `src/core/i18n/**/translation.*.json` file or a `useTranslation('translation')` / `{ ns: 'translation' }` reference as a BLOCKING issue.
- **i18n/CRD (manual translations + parity)**: Translations under `src/crd/i18n/**/*.json` are NOT managed by Crowdin. They are maintained manually (AI-assisted) per `src/crd/CLAUDE.md`; changes to any CRD locale file — including non-English ones — are expected and must pass review without Crowdin-compliance objections. All six supported languages (en, nl, es, bg, de, fr) are edited in the same PR. Enforce KEY PARITY: any key added or removed MUST be mirrored across all six language files — flag a missing or orphaned key in any locale as a blocking issue.
- Reject commits containing build artifacts (`.build/`, `public/env-config.js`, `build/`) or missing validation evidence.
- **No GraphQL schema snapshot in the repo**: the client obtains the schema from a running server (`CODEGEN_SCHEMA=http://localhost:3000/graphql` in the committed `.env`; `pnpm codegen` loads it via dotenv-flow). Flag as a BLOCKING issue: any added `schema.graphql` (or other GraphQL SDL snapshot) file, removal of `/schema.graphql` from `.gitignore`, or a change to `codegen.yml`/`.env` that makes codegen read a local file by default instead of the live endpoint. A local snapshot is allowed only as a gitignored, uncommitted developer override via `.env.local`.
- Ensure new env vars use the `VITE_APP_*` prefix and flow through `buildConfiguration.js` into `window._env_`.
Trust this onboarding note first;
- path: "specs/**/spec.md"
instructions: |
Speckit specs capture the constitution for behaviour. Confirm changes satisfy acceptance criteria, update impacted requirements, and flag any divergence or missing traceability.
- path: "specs/**/plan.md"
instructions: |
Use the delivery plan to validate sequencing, observability, and resiliency hooks promised for a spec. Highlight unimplemented tasks or newly introduced risks.
- path: "src/**/*.{ts,tsx,js}"
instructions: |
Review the React/TypeScript code for correctness and alignment with docs/code-guidelines.md.
Rely on global error handling and logging; only flag missing local try/catch or logging when additional mitigation is required.
Non-null assertions are discouraged except when paired with skip guards on GraphQL queries (see existing patterns).
Watch for security issues (XSS, CSRF, sensitive data exposure) and TypeScript typing violations.
MUI/Emotion are removed (story #9885) and the packages are uninstalled. All client-facing UI is built in the CRD design system (`src/crd/`). Flag ANY `@mui/*` or `@emotion/*` import in any file as a BLOCKING issue — they must never be reintroduced; use CRD instead.
- path: "src/**/*.{graphql,gql}"
instructions: |
Ensure documents follow generated fragment conventions, stay in sync with server schema, and include matching codegen artifacts. Flag missing schema diffs or cache update plans.
Generated artifacts must come from `pnpm codegen` against a running server — never from a committed `schema.graphql` snapshot (BLOCKING if one is added).
- path: "src/**/*.json"
instructions: |
Validate structure, schema compliance, and absence of secrets. Keep localization payloads consistent.
- path: "src/crd/i18n/**/*.json"
instructions: |
Manual (AI-assisted) translations per `src/crd/CLAUDE.md`. NOT managed by Crowdin. `crd-common` (`src/crd/i18n/common/`) is the DEFAULT namespace, resolved by every `useTranslation()` call with no namespace argument; the legacy `src/core/i18n` `translation` namespace was removed (story #9885). All six supported languages (en, nl, es, bg, de, fr) are edited in the same PR. ENFORCE KEY PARITY: every key added or removed in one `<feature>.<lang>.json` MUST be added or removed in all six language files for that feature — flag any key that is present in some locales but missing from others (a missing translation) as a blocking issue. Validate JSON structure and absence of secrets.
- path: "public/**/*.html"
instructions: |
Enforce semantic HTML and accessibility requirements. Confirm injected env placeholders remain intact.
- path: "src/**/*.yaml"
instructions: |
Confirm configuration accuracy and security expectations.
- path: "**/*.md"
instructions: |
Ensure documentation stays current, references the constitution hierarchy, and captures new risks or mitigations.
- path: "**/*.py"
instructions: |
This is a JavaScript/TypeScript repository — Python files do not belong here, anywhere.
The prototype design reference ships helper scripts under `utils/*.py` (font merging,
corruption fixes), but those live only in the external `alkem-io/client-web-prototype`
repo and must never appear here.
Flag EVERY added or modified `.py` file as a blocking issue and request its removal before merge.
Do not review the script's logic — the only acceptable resolution is deleting the file.
chat:
auto_reply: true