2.5 KiB
2.5 KiB
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/: prefercomponents/,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, hooksuseThing.ts, utilitiescamelCase.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.tsxnext to the file or undersrc/__tests__/. - Coverage: target ≥80% statements/branches on changed code.
- Commands:
npm testfor watch,npm test -- --coveragefor 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.localwith ViteVITE_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.mdfor 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.