43 lines
2.5 KiB
Markdown
43 lines
2.5 KiB
Markdown
|
|
# Repository Guidelines
|
|||
|
|
|
|||
|
|
## Project Structure & Module Organization
|
|||
|
|
- Monorepo with multiple Vite apps at the root (e.g., `kediritechnopark-app/`, `adventure-rental-app/`, `motel-app/`).
|
|||
|
|
- Each app is self‑contained: `src/` (code), `public/` (static), `index.html`, `tailwind.config.js`, `vite.config.ts|js`.
|
|||
|
|
- Inside `src/`: prefer `components/`, `pages/`, `hooks/`, `lib/`, `assets/`, `styles/`. Shared code should be copied per app unless a dedicated shared package exists.
|
|||
|
|
|
|||
|
|
## Build, Test, and Development Commands
|
|||
|
|
Run these from the target app directory:
|
|||
|
|
- `npm install`: install dependencies.
|
|||
|
|
- `npm run dev`: start Vite dev server.
|
|||
|
|
- `npm run build`: production build.
|
|||
|
|
- `npm run preview`: preview build locally.
|
|||
|
|
- `npm run lint` / `npm run format`: lint and format (if configured).
|
|||
|
|
- `npm test`: run unit tests (Vitest) when present.
|
|||
|
|
|
|||
|
|
## Coding Style & Naming Conventions
|
|||
|
|
- Language: TypeScript, React function components; 2‑space indent.
|
|||
|
|
- Files: components `PascalCase.tsx`, hooks `useThing.ts`, utilities `camelCase.ts`, test files `*.test.ts(x)`.
|
|||
|
|
- Styling: Tailwind CSS utilities; theme via CSS variables; avoid inline styles except for dynamic values.
|
|||
|
|
- Tools: ESLint (TypeScript/React), Prettier. Fix issues before committing.
|
|||
|
|
|
|||
|
|
## Testing Guidelines
|
|||
|
|
- Frameworks: Vitest + @testing-library/react for unit/integration; Playwright optional for e2e.
|
|||
|
|
- Location: co‑locate as `Component.test.tsx` next to the file or under `src/__tests__/`.
|
|||
|
|
- Coverage: target ≥80% statements/branches on changed code.
|
|||
|
|
- Commands: `npm test` for watch, `npm test -- --coverage` for reports.
|
|||
|
|
|
|||
|
|
## Commit & Pull Request Guidelines
|
|||
|
|
- Use Conventional Commits: `feat:`, `fix:`, `chore:`, `docs:`, `refactor:`, etc. Example: `feat(cards): add skeleton and a11y labels`.
|
|||
|
|
- PRs: include a clear description, linked issues (e.g., `Closes #123`), screenshots for UI changes, and test notes.
|
|||
|
|
- CI passes required: build, lint, tests. Keep PRs small and focused.
|
|||
|
|
|
|||
|
|
## Security & Configuration Tips
|
|||
|
|
- Never commit secrets. Use per‑app `.env.local` with Vite `VITE_` prefixes (e.g., `VITE_API_URL`).
|
|||
|
|
- Update dependencies responsibly; prefer minor/patch bumps unless necessary.
|
|||
|
|
- Follow a11y best practices (labels, roles, keyboard support) and avoid introducing regressions.
|
|||
|
|
|
|||
|
|
## Agent-Specific Instructions
|
|||
|
|
- Read `docs/AGENT_CONTEXT.md` for the full context (identity, objectives, stack, output contract).
|
|||
|
|
- Create work items using the GitHub “AI Task” issue template.
|
|||
|
|
- Ensure PRs meet the checklist in `.github/PULL_REQUEST_TEMPLATE.md`.
|