diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..d9e93ac --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,35 @@ +# AGENTS.md + +Context for AI coding agents in **BeatHound**. + +## Overview + +Hybrid web/mobile app built with **React, TypeScript, Vite, and Ionic Framework**. + +## Commands + +Run these checks before considering a task complete: +- **Dev:** `npm run dev` +- **Build & Typecheck:** `npm run build` +- **Test:** `npm test` +- **Lint:** `npm run lint` + +## Git Workflow + +- **Branching:** Always create new feature or bugfix branches directly from `dev` (e.g., `git checkout dev && git pull && git checkout -b feat/` or `fix/`). +- **Protected Branches:** Never commit or push changes directly to `main` or `dev`. + +## Code Style & Ionic Conventions + +- **Strict TypeScript:** Never use `any` or `@ts-ignore`. Define explicit interfaces/types for props, state, and API responses. +- **Ionic Components:** Always import Ionic UI components from `@ionic/react` and icons from `ionicons/icons`. Prefer Ionic components (`IonPage`, `IonContent`, `IonButton`, etc.) over raw HTML elements for layout and interactive controls. +- **React Patterns:** Use functional components with hooks. Keep components small and focused; extract complex business logic into custom hooks (`src/hooks/`). +- **Control Flow:** Prefer early returns over deeply nested `if-else` blocks. Use `async/await` instead of `.then()` chains. +- **Error Handling:** Never swallow errors in empty `catch` blocks; always handle or log them with clear context. +- **Scope:** Keep changes minimal and strictly scoped to the task; do not refactor unrelated code or rename existing files unless asked. + +## Safety & Boundaries + +- **Always:** Run `npm run lint` and `npm run build` after modifying code to catch TypeScript or bundling issues early. +- **Ask First:** Before installing new npm packages, modifying `vite.config.ts` / `capacitor.config.*`, or deleting existing files. +- **Never:** Commit or expose secrets (`.env*`, API keys), weaken existing test assertions just to make tests pass, or run `git push --force`.