Spaces:
Paused
Paused
Repository Guidelines
Project Structure & Module Organization
apps/backendcontains the Node/TypeScript GraphRAG, MCP, and integration services; integration and smoke specs sit inapps/backend/src/testsand mirror the service tree.apps/matrix-frontendhouses the Vite/React dashboard; UI assets live inapps/matrix-frontend/public, while component hooks keep colocated specs under__tests__.- Shared contracts reside in
packages/domain-typesandpackages/mcp-types; rebuild them before consuming new DTOs elsewhere. - Packaging layers live in
desktop-appand automation reference material inagents/,docs/,scripts/, andtests/.
Build, Test, and Development Commands
npm install(repo root) hydrates all workspaces.npm run devlaunches backend + widget board; usenpm run dev:backendornpm run dev:frontendwhen debugging one surface.npm run buildcompiles shared packages, backend, and frontend; follow withnpm run build:desktop[:os]for installers.npm run lint,npm run lint:fix, andnpm run format:checkkeep ESLint/Prettier baselines; run them before opening a PR.npm run test,npm run test:coverage, andnode run-comprehensive-tests.jscover unit, coverage-gated, and long smoke paths.
Coding Style & Naming Conventions
- TypeScript first, strict mode on; avoid
anyand prefer typed service interfaces from/packages. - Prettier enforces two-space indent, single quotes, and trailing commas;
.editorconfigmatches this setup. - React components use
PascalCase, hooksuseCamelCase, feature folders remain kebab-case, and env files stay uppercase snake case (.env.PROFILE).
Testing Guidelines
- Write
*.test.tsfor units,*.integration.test.tsfor cross-service flows, and colocate specs with the code aside from backend suites that belong inapps/backend/src/tests. - Vitest + Testing Library cover UI logic; backend suites lean on Neo4j fixtures and GraphRAG mocks documented in
tests/README. - Aim for ≥80% statement coverage on adapters and persistence layers (
npm run test:coverage), and attach coverage deltas to PRs when dipping. - Use Playwright (
npx playwright test) only afternpm run build:frontendpasses locally.
Commit & Pull Request Guidelines
- Follow the existing conventional commit style (
feat(scope):,fix(scope):, etc.) and mention ticket IDs in the subject or body. - Keep commits focused (types, backend, matrix-frontend) and push only formatted, lint-clean diffs.
- PRs must include a summary, reproduction/validation steps, linked issues, and screenshots or API traces for UI/API work; mention relevant docs under
docs/. - Before requesting review, rerun
npm run lint,npm run test,npm run build, and document any suites intentionally skipped.
Security & Configuration Tips
- Never commit credentials; seed secrets by copying
.env.exampleto.env,.env.local, or profile-specific files and rotate throughswitch-env.ps1. - Review
security/threat notes before exposing endpoints, and scrub PII fromlogs/ormonitoring/artifacts shared externally. - Desktop builds embed frontend assets—validate
.env.productionoverrides before tagging a release.