This document provides repository-level guidance for coding agents (including Codex) working in CommandMate.
- Applies to the entire repository.
- This file is the primary entry point for agent behavior in this repo.
- For detailed background and implementation history, refer to
README.md,docs/, andCLAUDE.md.
- Project: CommandMate
- Stack: Next.js 14, TypeScript, Tailwind CSS, SQLite (
better-sqlite3) - Runtime: Node.js 20+
- Main areas:
src/app: App Router pages and API routessrc/lib: core business logic and utilitiessrc/components: UI componentstests/unit,tests/integration,tests/e2e: test suites
- Keep changes issue-focused and minimal.
- Preserve existing architecture and naming patterns.
- Prefer small, reviewable commits over large refactors.
- Do not introduce unrelated cleanups in the same change.
- If behavior changes, add or update tests in the same PR.
- Use strict TypeScript types; avoid
anyunless unavoidable. - Reuse existing utilities in
src/libbefore adding new helpers. - Keep API validation explicit and defensive.
- Follow existing React/Next.js patterns in the touched module.
- Keep comments short and meaningful; avoid obvious comments.
- Do not perform destructive operations (
git reset --hard, broad file deletion) unless explicitly requested. - Do not overwrite user-authored files unexpectedly.
- Treat auth/security-related paths with extra care:
src/lib/auth.tssrc/middleware.tssrc/lib/env-sanitizer.tssrc/lib/ip-restriction.ts
Before finishing, run relevant checks for changed scope:
# unit tests
npm run test:unit
# integration tests when API/DB behavior changes
npm run test:integration
# lint when editing TS/React broadly
npm run lintFor small fixes, run targeted tests first, then expand only if needed.
- Keep
AGENTS.mdconcise and execution-oriented. - Avoid duplicating large sections from
CLAUDE.md; link or reference instead. - If guidance conflicts are found:
- Prioritize explicit repository files and current code behavior.
- Update this file and related docs together in the same PR.
- Title format:
feat: ...,fix: ...,docs: ..., etc. - Include:
- What changed
- Why it changed
- How it was validated
- Any known risks or follow-up tasks