{"owner":"CodeWithCJ","repo":"SparkyFitness","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md"],"skills":{"AGENTS.md":"# AGENTS.md\n\n*Last updated: 2026-08-07*\n\nThis is the repo-root monorepo guide for SparkyFitness. Use it to choose the right package, understand shared repo-level rules, and find the next guide to read.\n\n**For AI Tools & Developers:** Start with `agent-docs/README.md` (in this repo) for quick navigation to:\n- `file-and-domain-reference.md` — Find any code by feature in seconds\n- `testing-patterns.md` — Concrete test examples for each layer\n- `architecture-permissions.md` — Permission types and RLS patterns\n- Plus 5 more guides for migrations, data flow, anti-patterns, new features, and planning\n\nPackage-level guides win. For work inside a package, follow that package's `AGENTS.md` when present, otherwise its `CLAUDE.md`.\n\n## Scope\n\n- Start here when work begins at repo root or spans multiple packages.\n- Keep root-level guidance focused on workspace layout, shared conventions, and cross-package coordination.\n- Root `package.json` is tooling only (`husky`, `lint-staged`, `prettier`), not an app entrypoint.\n- Run scripts from the package directory you are changing.\n\n## Package Guides\n\n- Repo-root alias: `CLAUDE.md` points to this file.\n- Frontend: `SparkyFitnessFrontend/AGENTS.md`\n- Server: `SparkyFitnessServer/AGENTS.md`\n- Mobile: `SparkyFitnessMobile/AGENTS.md`\n- Shared: `shared/AGENTS.md`\n\nFor `docs/` and `SparkyFitnessGarmin/`, there is no package-level `AGENTS.md`. `SparkyFitnessGarmin/` is only a handful of Python files (`main.py`, `routes.py`, `service.py`, `schemas.py`); read them directly. For `docs/`, inspect the local manifest and content layout.\n\n## Monorepo Map\n\n- `SparkyFitnessFrontend/` - React 19 + Vite web app.\n- `SparkyFitnessServer/` - Express 5 + PostgreSQL backend API.\n- `SparkyFitnessMobile/` - Expo SDK 56 / React Native 0.85 app.\n- `shared/` - source-first TypeScript workspace package for `@workspace/shared` schemas, constants, and timezone/day helpers.\n- `docs/` - Nuxt / Docus docs site.\n- `SparkyFitnessGarmin/` - standalone Python integration service outside the current `pnpm` workspace.\n- `docker/`, `helm/`, `.github/` - infra and deployment assets.\n- `db_schema_backup.sql` - repo-root schema snapshot kept in sync by CI (`.github/workflows/schema-backup.yml`); never hand-edit or regenerate locally.\n- `docker/.env.example` - tracked env template commonly copied to repo-root `.env`.\n\n## Workspace Notes\n\n- `pnpm-workspace.yaml` currently lists `frontend`, `SparkyFitnessFrontend`, `shared`, `SparkyFitnessMobile`, `SparkyFitnessServer`, and `docs`.\n- Only `SparkyFitnessFrontend/` exists on disk right now; treat `frontend` as a legacy workspace entry unless the task is specifically about workspace cleanup.\n- `shared/` is a library package, not an app. Validate shared changes from the consuming package(s), not in isolation.\n- `SparkyFitnessGarmin/` is outside the current workspace. Inspect its own manifest and scripts before working there.\n\n## Agent Efficiency (read this before searching)\n\nDo not read or search these paths; they burn context for nothing:\n\n- `WIP/` - personal scratch area; contains zips and full copies of other repos, including a stale duplicate of this repo (`WIP/SparkyFitness-main/`). Never read or edit anything under it.\n- `SparkyFitnessMobile/ios/` and `SparkyFitnessMobile/android/` - generated native projects (`ios/` is >1 GB of Pods). Regenerate with `npx expo prebuild --clean`; edit `app.config.ts`, `plugins/`, or `targets/` instead.\n- `pnpm-lock.yaml` (~1.3 MB) - never read; check `package.json` files instead.\n- `db_schema_backup.sql` (~330 KB) - never read whole; grep for the one `CREATE TABLE` you need.\n- `SparkyFitnessFrontend/dist/` - build output.\n- `SparkyFitnessFrontend/public/locales/` except `en/` - 27 machine-synced translations. Only `en/translation.json` is ever hand-edited, and even that (~120 KB) should be grepped, not read whole.\n\nCheap ways to learn things:\n\n- Database table index: read `docs/content/8.developer/4.database.md` (quick reference of all ~120 tables with one-line purpose). For detailed schema, read `shared/src/schemas/database/<Table>.zod.ts` (one small Zod file per table).\n- Database security & permissions: `docs/content/8.developer/11.database-security-tiers.md` (security tier, permission type, and RLS rules for every table).\n- API request/response contract: `shared/src/schemas/api/<Name>.api.zod.ts`.\n- Definition of done: CI (`.github/workflows/ci-tests.yml`) runs `pnpm run validate` plus the package's CI test script for each changed package. Run those locally before declaring work complete.\n\n## Cross-Package Rules\n\n- If you add or change a server migration (such as creating a new table), follow `agent-docs/new-migration-checklist.md`. In short, you MUST:\n  1. Create the migration file in `SparkyFitnessServer/db/migrations/YYYYMMDDHHMMSS_description.sql`.\n  2. Update the Row-Level Security (RLS) policies in `SparkyFitnessServer/db/rls_policies.sql`.\n  3. **Restart the server** (`pnpm start` from `SparkyFitnessServer/`) to apply the migration.\n  4. Leave `db_schema_backup.sql` alone — after merge, CI regenerates it from the migrations and opens an automated sync PR (`.github/workflows/schema-backup.yml`). Never manually edit the backup file or commit a locally generated copy.\n  5. Add or update the matching Zod schema in `shared/src/schemas/database/`.\n  6. Update the user-facing documentation in `docs/content/2.features/9.family-friends-sharing.md`.\n  7. Update the developer documentation in `docs/content/8.developer/11.database-security-tiers.md` to classify the table as Tier 1, Tier 2, or Tier 3.\n- Prefer the shared timezone helpers from `@workspace/shared` and `SparkyFitnessServer/utils/timezoneLoader.ts` for day-string logic. Avoid `toISOString().split('T')[0]` for user-facing or business-logic dates.\n- Keep `YYYY-MM-DD` values as calendar-day strings until you reach a database or external API boundary that needs UTC instants.\n- Auth or API contract changes usually need a quick check in both web and mobile because they share the same backend.\n- Frontend local dev proxies `/api`, `/health-data`, and `/uploads` to the server on `3010`. The `/health-data` proxy is rewritten to `/api/health-data`, while server APIs remain rooted at `/api`.\n- Server runtime secrets are usually sourced from repo-root `.env`, commonly created from `docker/.env.example`. The server can also load secret files via `SparkyFitnessServer/utils/secretLoader.ts`.\n- Extract shared logic on the **second** duplication (\"rule of two\"), not the third - duplicated logic drifts as different sessions edit each copy. Extract *behavior*, not coincidental shape. See `agent-docs/anti-patterns.md`.\n- **Strict TypeScript Typing:** Never use `any` or `// eslint-disable-next-line @typescript-eslint/no-explicit-any` when creating new functions or editing existing code. Always define explicit TypeScript interfaces, types, or import schemas from `@workspace/shared`. Do NOT copy legacy `any` parameter signatures when refactoring or extending legacy service/repository files.\n\n\n## Architecture Docs (Reduce Scanning, Prevent Bugs)\n\nBefore diving into code, read these docs if you're working on data access, permissions, or adding a new feature domain:\n\n- `agent-docs/architecture-permissions.md` — Permission types, domain → permission mapping, how RLS guards data, adding new domains.\n- `agent-docs/data-flow-patterns.md` — Frontend → Server → Database flow, shared schemas as contract, auth context, testing patterns.\n- `agent-docs/new-domain-template.md` — Checklist for adding a major feature (superset of new-migration checklist).\n\nThese docs answer: \"How do I safely add a feature across the stack?\" without scanning 20+ files.\n\n## Keeping These Guides Accurate\n\n- If your change adds a new domain, route family, database table, package, or cross-cutting convention, update the affected `AGENTS.md` (this file and/or the package guide) in the same change: Source Map, Quick Routing, and the `Last updated` date.\n- Stale guides are worse than no guides; when you notice a claim in any `AGENTS.md` that contradicts the code, fix the guide as part of your change.\n\n## Common Commands\n\nUse the package guide for fuller validation and platform-specific workflows. These are the common entrypoints:\n\n### Frontend (`SparkyFitnessFrontend/`)\n\n```bash\npnpm dev\npnpm run validate\npnpm test\n```\n\n### Server (`SparkyFitnessServer/`)\n\n```bash\npnpm start\npnpm run validate\npnpm test\npnpm run test:coverage\n```\n\n### Mobile (`SparkyFitnessMobile/`)\n\n```bash\npnpm start\npnpm run ios\npnpm run android\npnpm run validate\npnpm exec jest --watchman=false --runInBand\nnpx expo prebuild --clean\n```\n\n### Docs (`docs/`)\n\n```bash\npnpm dev\npnpm run build\n```\n\n"},"files":{"AGENTS.md":"# AGENTS.md\n\n*Last updated: 2026-08-07*\n\nThis is the repo-root monorepo guide for SparkyFitness. Use it to choose the right package, understand shared repo-level rules, and find the next guide to read.\n\n**For AI Tools & Developers:** Start with `agent-docs/README.md` (in this repo) for quick navigation to:\n- `file-and-domain-reference.md` — Find any code by feature in seconds\n- `testing-patterns.md` — Concrete test examples for each layer\n- `architecture-permissions.md` — Permission types and RLS patterns\n- Plus 5 more guides for migrations, data flow, anti-patterns, new features, and planning\n\nPackage-level guides win. For work inside a package, follow that package's `AGENTS.md` when present, otherwise its `CLAUDE.md`.\n\n## Scope\n\n- Start here when work begins at repo root or spans multiple packages.\n- Keep root-level guidance focused on workspace layout, shared conventions, and cross-package coordination.\n- Root `package.json` is tooling only (`husky`, `lint-staged`, `prettier`), not an app entrypoint.\n- Run scripts from the package directory you are changing.\n\n## Package Guides\n\n- Repo-root alias: `CLAUDE.md` points to this file.\n- Frontend: `SparkyFitnessFrontend/AGENTS.md`\n- Server: `SparkyFitnessServer/AGENTS.md`\n- Mobile: `SparkyFitnessMobile/AGENTS.md`\n- Shared: `shared/AGENTS.md`\n\nFor `docs/` and `SparkyFitnessGarmin/`, there is no package-level `AGENTS.md`. `SparkyFitnessGarmin/` is only a handful of Python files (`main.py`, `routes.py`, `service.py`, `schemas.py`); read them directly. For `docs/`, inspect the local manifest and content layout.\n\n## Monorepo Map\n\n- `SparkyFitnessFrontend/` - React 19 + Vite web app.\n- `SparkyFitnessServer/` - Express 5 + PostgreSQL backend API.\n- `SparkyFitnessMobile/` - Expo SDK 56 / React Native 0.85 app.\n- `shared/` - source-first TypeScript workspace package for `@workspace/shared` schemas, constants, and timezone/day helpers.\n- `docs/` - Nuxt / Docus docs site.\n- `SparkyFitnessGarmin/` - standalone Python integration service outside the current `pnpm` workspace.\n- `docker/`, `helm/`, `.github/` - infra and deployment assets.\n- `db_schema_backup.sql` - repo-root schema snapshot kept in sync by CI (`.github/workflows/schema-backup.yml`); never hand-edit or regenerate locally.\n- `docker/.env.example` - tracked env template commonly copied to repo-root `.env`.\n\n## Workspace Notes\n\n- `pnpm-workspace.yaml` currently lists `frontend`, `SparkyFitnessFrontend`, `shared`, `SparkyFitnessMobile`, `SparkyFitnessServer`, and `docs`.\n- Only `SparkyFitnessFrontend/` exists on disk right now; treat `frontend` as a legacy workspace entry unless the task is specifically about workspace cleanup.\n- `shared/` is a library package, not an app. Validate shared changes from the consuming package(s), not in isolation.\n- `SparkyFitnessGarmin/` is outside the current workspace. Inspect its own manifest and scripts before working there.\n\n## Agent Efficiency (read this before searching)\n\nDo not read or search these paths; they burn context for nothing:\n\n- `WIP/` - personal scratch area; contains zips and full copies of other repos, including a stale duplicate of this repo (`WIP/SparkyFitness-main/`). Never read or edit anything under it.\n- `SparkyFitnessMobile/ios/` and `SparkyFitnessMobile/android/` - generated native projects (`ios/` is >1 GB of Pods). Regenerate with `npx expo prebuild --clean`; edit `app.config.ts`, `plugins/`, or `targets/` instead.\n- `pnpm-lock.yaml` (~1.3 MB) - never read; check `package.json` files instead.\n- `db_schema_backup.sql` (~330 KB) - never read whole; grep for the one `CREATE TABLE` you need.\n- `SparkyFitnessFrontend/dist/` - build output.\n- `SparkyFitnessFrontend/public/locales/` except `en/` - 27 machine-synced translations. Only `en/translation.json` is ever hand-edited, and even that (~120 KB) should be grepped, not read whole.\n\nCheap ways to learn things:\n\n- Database table index: read `docs/content/8.developer/4.database.md` (quick reference of all ~120 tables with one-line purpose). For detailed schema, read `shared/src/schemas/database/<Table>.zod.ts` (one small Zod file per table).\n- Database security & permissions: `docs/content/8.developer/11.database-security-tiers.md` (security tier, permission type, and RLS rules for every table).\n- API request/response contract: `shared/src/schemas/api/<Name>.api.zod.ts`.\n- Definition of done: CI (`.github/workflows/ci-tests.yml`) runs `pnpm run validate` plus the package's CI test script for each changed package. Run those locally before declaring work complete.\n\n## Cross-Package Rules\n\n- If you add or change a server migration (such as creating a new table), follow `agent-docs/new-migration-checklist.md`. In short, you MUST:\n  1. Create the migration file in `SparkyFitnessServer/db/migrations/YYYYMMDDHHMMSS_description.sql`.\n  2. Update the Row-Level Security (RLS) policies in `SparkyFitnessServer/db/rls_policies.sql`.\n  3. **Restart the server** (`pnpm start` from `SparkyFitnessServer/`) to apply the migration.\n  4. Leave `db_schema_backup.sql` alone — after merge, CI regenerates it from the migrations and opens an automated sync PR (`.github/workflows/schema-backup.yml`). Never manually edit the backup file or commit a locally generated copy.\n  5. Add or update the matching Zod schema in `shared/src/schemas/database/`.\n  6. Update the user-facing documentation in `docs/content/2.features/9.family-friends-sharing.md`.\n  7. Update the developer documentation in `docs/content/8.developer/11.database-security-tiers.md` to classify the table as Tier 1, Tier 2, or Tier 3.\n- Prefer the shared timezone helpers from `@workspace/shared` and `SparkyFitnessServer/utils/timezoneLoader.ts` for day-string logic. Avoid `toISOString().split('T')[0]` for user-facing or business-logic dates.\n- Keep `YYYY-MM-DD` values as calendar-day strings until you reach a database or external API boundary that needs UTC instants.\n- Auth or API contract changes usually need a quick check in both web and mobile because they share the same backend.\n- Frontend local dev proxies `/api`, `/health-data`, and `/uploads` to the server on `3010`. The `/health-data` proxy is rewritten to `/api/health-data`, while server APIs remain rooted at `/api`.\n- Server runtime secrets are usually sourced from repo-root `.env`, commonly created from `docker/.env.example`. The server can also load secret files via `SparkyFitnessServer/utils/secretLoader.ts`.\n- Extract shared logic on the **second** duplication (\"rule of two\"), not the third - duplicated logic drifts as different sessions edit each copy. Extract *behavior*, not coincidental shape. See `agent-docs/anti-patterns.md`.\n- **Strict TypeScript Typing:** Never use `any` or `// eslint-disable-next-line @typescript-eslint/no-explicit-any` when creating new functions or editing existing code. Always define explicit TypeScript interfaces, types, or import schemas from `@workspace/shared`. Do NOT copy legacy `any` parameter signatures when refactoring or extending legacy service/repository files.\n\n\n## Architecture Docs (Reduce Scanning, Prevent Bugs)\n\nBefore diving into code, read these docs if you're working on data access, permissions, or adding a new feature domain:\n\n- `agent-docs/architecture-permissions.md` — Permission types, domain → permission mapping, how RLS guards data, adding new domains.\n- `agent-docs/data-flow-patterns.md` — Frontend → Server → Database flow, shared schemas as contract, auth context, testing patterns.\n- `agent-docs/new-domain-template.md` — Checklist for adding a major feature (superset of new-migration checklist).\n\nThese docs answer: \"How do I safely add a feature across the stack?\" without scanning 20+ files.\n\n## Keeping These Guides Accurate\n\n- If your change adds a new domain, route family, database table, package, or cross-cutting convention, update the affected `AGENTS.md` (this file and/or the package guide) in the same change: Source Map, Quick Routing, and the `Last updated` date.\n- Stale guides are worse than no guides; when you notice a claim in any `AGENTS.md` that contradicts the code, fix the guide as part of your change.\n\n## Common Commands\n\nUse the package guide for fuller validation and platform-specific workflows. These are the common entrypoints:\n\n### Frontend (`SparkyFitnessFrontend/`)\n\n```bash\npnpm dev\npnpm run validate\npnpm test\n```\n\n### Server (`SparkyFitnessServer/`)\n\n```bash\npnpm start\npnpm run validate\npnpm test\npnpm run test:coverage\n```\n\n### Mobile (`SparkyFitnessMobile/`)\n\n```bash\npnpm start\npnpm run ios\npnpm run android\npnpm run validate\npnpm exec jest --watchman=false --runInBand\nnpx expo prebuild --clean\n```\n\n### Docs (`docs/`)\n\n```bash\npnpm dev\npnpm run build\n```\n\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","title":"AGENTS.md","content":"# AGENTS.md\n\n*Last updated: 2026-08-07*\n\nThis is the repo-root monorepo guide for SparkyFitness. Use it to choose the right package, understand shared repo-level rules, and find the next guide to read.\n\n**For AI Tools & Developers:** Start with `agent-docs/README.md` (in this repo) for quick navigation to:\n- `file-and-domain-reference.md` — Find any code by feature in seconds\n- `testing-patterns.md` — Concrete test examples for each layer\n- `architecture-permissions.md` — Permission types and RLS patterns\n- Plus 5 more guides for migrations, data flow, anti-patterns, new features, and planning\n\nPackage-level guides win. For work inside a package, follow that package's `AGENTS.md` when present, otherwise its `CLAUDE.md`.\n\n## Scope\n\n- Start here when work begins at repo root or spans multiple packages.\n- Keep root-level guidance focused on workspace layout, shared conventions, and cross-package coordination.\n- Root `package.json` is tooling only (`husky`, `lint-staged`, `prettier`), not an app entrypoint.\n- Run scripts from the package directory you are changing.\n\n## Package Guides\n\n- Repo-root alias: `CLAUDE.md` points to this file.\n- Frontend: `SparkyFitnessFrontend/AGENTS.md`\n- Server: `SparkyFitnessServer/AGENTS.md`\n- Mobile: `SparkyFitnessMobile/AGENTS.md`\n- Shared: `shared/AGENTS.md`\n\nFor `docs/` and `SparkyFitnessGarmin/`, there is no package-level `AGENTS.md`. `SparkyFitnessGarmin/` is only a handful of Python files (`main.py`, `routes.py`, `service.py`, `schemas.py`); read them directly. For `docs/`, inspect the local manifest and content layout.\n\n## Monorepo Map\n\n- `SparkyFitnessFrontend/` - React 19 + Vite web app.\n- `SparkyFitnessServer/` - Express 5 + PostgreSQL backend API.\n- `SparkyFitnessMobile/` - Expo SDK 56 / React Native 0.85 app.\n- `shared/` - source-first TypeScript workspace package for `@workspace/shared` schemas, constants, and timezone/day helpers.\n- `docs/` - Nuxt / Docus docs site.\n- `SparkyFitnessGarmin/` - standalone Python integration service outside the current `pnpm` workspace.\n- `docker/`, `helm/`, `.github/` - infra and deployment assets.\n- `db_schema_backup.sql` - repo-root schema snapshot kept in sync by CI (`.github/workflows/schema-backup.yml`); never hand-edit or regenerate locally.\n- `docker/.env.example` - tracked env template commonly copied to repo-root `.env`.\n\n## Workspace Notes\n\n- `pnpm-workspace.yaml` currently lists `frontend`, `SparkyFitnessFrontend`, `shared`, `SparkyFitnessMobile`, `SparkyFitnessServer`, and `docs`.\n- Only `SparkyFitnessFrontend/` exists on disk right now; treat `frontend` as a legacy workspace entry unless the task is specifically about workspace cleanup.\n- `shared/` is a library package, not an app. Validate shared changes from the consuming package(s), not in isolation.\n- `SparkyFitnessGarmin/` is outside the current workspace. Inspect its own manifest and scripts before working there.\n\n## Agent Efficiency (read this before searching)\n\nDo not read or search these paths; they burn context for nothing:\n\n- `WIP/` - personal scratch area; contains zips and full copies of other repos, including a stale duplicate of this repo (`WIP/SparkyFitness-main/`). Never read or edit anything under it.\n- `SparkyFitnessMobile/ios/` and `SparkyFitnessMobile/android/` - generated native projects (`ios/` is >1 GB of Pods). Regenerate with `npx expo prebuild --clean`; edit `app.config.ts`, `plugins/`, or `targets/` instead.\n- `pnpm-lock.yaml` (~1.3 MB) - never read; check `package.json` files instead.\n- `db_schema_backup.sql` (~330 KB) - never read whole; grep for the one `CREATE TABLE` you need.\n- `SparkyFitnessFrontend/dist/` - build output.\n- `SparkyFitnessFrontend/public/locales/` except `en/` - 27 machine-synced translations. Only `en/translation.json` is ever hand-edited, and even that (~120 KB) should be grepped, not read whole.\n\nCheap ways to learn things:\n\n- Database table index: read `docs/content/8.developer/4.database.md` (quick reference of all ~120 tables with one-line purpose). For detailed schema, read `shared/src/schemas/database/<Table>.zod.ts` (one small Zod file per table).\n- Database security & permissions: `docs/content/8.developer/11.database-security-tiers.md` (security tier, permission type, and RLS rules for every table).\n- API request/response contract: `shared/src/schemas/api/<Name>.api.zod.ts`.\n- Definition of done: CI (`.github/workflows/ci-tests.yml`) runs `pnpm run validate` plus the package's CI test script for each changed package. Run those locally before declaring work complete.\n\n## Cross-Package Rules\n\n- If you add or change a server migration (such as creating a new table), follow `agent-docs/new-migration-checklist.md`. In short, you MUST:\n  1. Create the migration file in `SparkyFitnessServer/db/migrations/YYYYMMDDHHMMSS_description.sql`.\n  2. Update the Row-Level Security (RLS) policies in `SparkyFitnessServer/db/rls_policies.sql`.\n  3. **Restart the server** (`pnpm start` from `SparkyFitnessServer/`) to apply the migration.\n  4. Leave `db_schema_backup.sql` alone — after merge, CI regenerates it from the migrations and opens an automated sync PR (`.github/workflows/schema-backup.yml`). Never manually edit the backup file or commit a locally generated copy.\n  5. Add or update the matching Zod schema in `shared/src/schemas/database/`.\n  6. Update the user-facing documentation in `docs/content/2.features/9.family-friends-sharing.md`.\n  7. Update the developer documentation in `docs/content/8.developer/11.database-security-tiers.md` to classify the table as Tier 1, Tier 2, or Tier 3.\n- Prefer the shared timezone helpers from `@workspace/shared` and `SparkyFitnessServer/utils/timezoneLoader.ts` for day-string logic. Avoid `toISOString().split('T')[0]` for user-facing or business-logic dates.\n- Keep `YYYY-MM-DD` values as calendar-day strings until you reach a database or external API boundary that needs UTC instants.\n- Auth or API contract changes usually need a quick check in both web and mobile because they share the same backend.\n- Frontend local dev proxies `/api`, `/health-data`, and `/uploads` to the server on `3010`. The `/health-data` proxy is rewritten to `/api/health-data`, while server APIs remain rooted at `/api`.\n- Server runtime secrets are usually sourced from repo-root `.env`, commonly created from `docker/.env.example`. The server can also load secret files via `SparkyFitnessServer/utils/secretLoader.ts`.\n- Extract shared logic on the **second** duplication (\"rule of two\"), not the third - duplicated logic drifts as different sessions edit each copy. Extract *behavior*, not coincidental shape. See `agent-docs/anti-patterns.md`.\n- **Strict TypeScript Typing:** Never use `any` or `// eslint-disable-next-line @typescript-eslint/no-explicit-any` when creating new functions or editing existing code. Always define explicit TypeScript interfaces, types, or import schemas from `@workspace/shared`. Do NOT copy legacy `any` parameter signatures when refactoring or extending legacy service/repository files.\n\n\n## Architecture Docs (Reduce Scanning, Prevent Bugs)\n\nBefore diving into code, read these docs if you're working on data access, permissions, or adding a new feature domain:\n\n- `agent-docs/architecture-permissions.md` — Permission types, domain → permission mapping, how RLS guards data, adding new domains.\n- `agent-docs/data-flow-patterns.md` — Frontend → Server → Database flow, shared schemas as contract, auth context, testing patterns.\n- `agent-docs/new-domain-template.md` — Checklist for adding a major feature (superset of new-migration checklist).\n\nThese docs answer: \"How do I safely add a feature across the stack?\" without scanning 20+ files.\n\n## Keeping These Guides Accurate\n\n- If your change adds a new domain, route family, database table, package, or cross-cutting convention, update the affected `AGENTS.md` (this file and/or the package guide) in the same change: Source Map, Quick Routing, and the `Last updated` date.\n- Stale guides are worse than no guides; when you notice a claim in any `AGENTS.md` that contradicts the code, fix the guide as part of your change.\n\n## Common Commands\n\nUse the package guide for fuller validation and platform-specific workflows. These are the common entrypoints:\n\n### Frontend (`SparkyFitnessFrontend/`)\n\n```bash\npnpm dev\npnpm run validate\npnpm test\n```\n\n### Server (`SparkyFitnessServer/`)\n\n```bash\npnpm start\npnpm run validate\npnpm test\npnpm run test:coverage\n```\n\n### Mobile (`SparkyFitnessMobile/`)\n\n```bash\npnpm start\npnpm run ios\npnpm run android\npnpm run validate\npnpm exec jest --watchman=false --runInBand\nnpx expo prebuild --clean\n```\n\n### Docs (`docs/`)\n\n```bash\npnpm dev\npnpm run build\n```\n\n","category":"root","tokens":2174}]}