Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 29 additions & 26 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
# Repository Guidelines

## Project Structure & Module Organization
- `app/`: Next.js App Router pages, layouts, and global styles (`app/globals.css`, `app/editor-theme.css`).
- `components/`: shared UI components and providers.
- `hooks/`: reusable React hooks (keep hook names `useThing`).
- `lib/`: utilities and shared helpers.
- `public/`: static assets served by Next.js.
- `test/`: unit and visual tests plus utilities and setup.
- `src-tauri/`: Tauri desktop shell and Rust configuration.
- `src/`: Solid frontend application.
- `src/components/`: shared Solid UI and feature components.
- `src/routes/`: route-level screens and global route styles.
- `src/state/`: app state stores.
- `src/lib/`: utilities, Tauri helpers, markdown helpers, and i18n.
- `public/`: static assets served by Vite.
- `src-tauri/`: Tauri desktop shell and Rust commands.
- `test/`: Vitest and Playwright coverage, helpers, and docs.

## Build, Test, and Development Commands
- `pnpm dev`: start the Next.js dev server (Turbopack).
- `pnpm build`: production build.
- `pnpm start`: serve the production build.
- `pnpm lint`: run ESLint (`next lint`).
- `pnpm dev`: start the Solid + Vite dev server.
- `pnpm build`: production build and TypeScript check.
- `pnpm start`: preview the production build.
- `pnpm lint`: run TypeScript checking.
- `pnpm test`: run Vitest once.
- `pnpm test:watch`: Vitest watch mode.
- `pnpm test:ui`: Vitest UI.
- `pnpm test:visual`: Playwright visual regression tests.
- `pnpm test:visual:ui`: Playwright UI runner.
- `npx tsx test/run-all-tests.ts`: run the full test suite with reporting.
- `pnpm tauri dev`: run the desktop shell in development.
- `pnpm tauri build`: build the desktop app.

## Coding Style & Naming Conventions
- TypeScript + React (Next.js). Follow existing file patterns and keep diffs minimal.
- Indentation: 2 spaces in TS/TSX; align JSX props vertically when multi-line.
- Components: `PascalCase` exports; files are typically kebab-case (match the folder).
- Hooks: functions named `useThing`, stored in `hooks/`.
- Linting: follow ESLint rules from `eslint.config.mjs`; fix lint before PRs.
- TypeScript + Solid. Keep diffs focused and consistent with nearby files.
- Indentation: 2 spaces in TS/TSX and CSS.
- Components: `PascalCase` exports; filenames are typically kebab-case or grouped by feature.
- Shared state lives in `src/state/`; generic helpers live in `src/lib/`.
- Prefer small composable helpers over framework-heavy abstractions.

## Testing Guidelines
- Unit tests live in `test/components/*.test.tsx` (Vitest + React Testing Library).
- Visual regression tests live in `test/visual/*.spec.ts` (Playwright).
- Use `test/setup.ts` and `test/utils/` for shared helpers.
- If visuals change intentionally, update snapshots: `pnpm test:visual --update-snapshots`.
- Unit and integration tests live in `test/components`, `test/hooks`, and `test/lib`.
- Visual regression tests live in `test/visual/*.spec.ts`.
- Use `test/setup.ts` and `test/utils/` for shared test setup.
- If visuals change intentionally, update snapshots with `pnpm test:visual --update-snapshots`.
- WebKit snapshots are optional locally and can be enabled with `PLAYWRIGHT_ENABLE_WEBKIT=1`.

## Commit & Pull Request Guidelines
- Commit messages follow conventional commits: `type(scope): subject`.
Examples: `chore(deps): ...`, `ci(test): ...`.
- PRs should include: a concise description, linked issue (if any), and screenshots for UI changes.
- Note test coverage in the PR body (e.g., `pnpm test`, `pnpm test:visual`).
- PRs should include a concise description, linked issue if any, and screenshots for UI changes.
- Mention validation in the PR body, for example `pnpm test`, `pnpm test:visual`, or `pnpm build`.

## Configuration Notes
- App config is in `next.config.ts`; tooling config in `vitest.config.ts` and `playwright.config.ts`.
- Prefer `pnpm` for dependency changes; keep `pnpm-lock.yaml` in sync.
- Frontend config lives in `vite.config.ts`, `vitest.config.ts`, and `playwright.config.ts`.
- Tauri config lives in `src-tauri/tauri.conf.json` and `src-tauri/Cargo.toml`.
- Prefer `pnpm` for dependency changes and keep `pnpm-lock.yaml` in sync.
Loading