1.9 KiB
1.9 KiB
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>orfix/<name>). - Protected Branches: Never commit or push changes directly to
mainordev.
Code Style & Ionic Conventions
- Strict TypeScript: Never use
anyor@ts-ignore. Define explicit interfaces/types for props, state, and API responses. - Ionic Components: Always import Ionic UI components from
@ionic/reactand icons fromionicons/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-elseblocks. Useasync/awaitinstead of.then()chains. - Error Handling: Never swallow errors in empty
catchblocks; 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 lintandnpm run buildafter 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 rungit push --force.