Added AGENTS.md
This commit is contained in:
1 parent
3d60142a1f
commit
226ababcf1
1 file changed
+35
@@ -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/<name>` or `fix/<name>`).
|
||||||
|
- **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`.
|
||||||
Reference in new issue
Block a user