AgentSkillsCN

locafleet-orchestrator

LocaFleet的完整数据库架构参考。在进行任何数据库操作(查询、插入、更新、迁移)之前,务必查阅此参考。其中包含全部21张表、18个枚举类型、各类关系与索引。

SKILL.md
--- frontmatter
name: locafleet-orchestrator
description: >
  Meta-skill that routes tasks to the best available skill.
  Use this skill for ANY task to ensure optimal skill selection.
  Activates automatically on every request.

LocaFleet Orchestrator

You are working on LocaFleet, a Swiss car rental fleet management app. Before executing ANY task, consult this routing table to determine which skill(s) to activate.

Skill Routing Table

Database & Backend

Task patternSkill to useNotes
Schema changes, migrations, new tableslocafleet-schema + postgres-best-practicesALWAYS check schema.ts first
Drizzle queries, joins, relationslocafleet-schema + postgres-best-practicesUse type-safe patterns
Server Actions (CRUD)locafleet-stack + nextjsFollow Server Actions conventions
Hono API routes (PDF, email, heavy jobs)locafleet-stackMount on /api/*, use Zod validation
Better Auth config, sessions, RBAClocafleet-stackCheck auth.ts patterns
Supabase Storage (upload, buckets)postgres-best-practicesUse signed URLs, RLS on buckets
RLS policiespostgres-best-practices + locafleet-schematenant_id filtering on every table

Frontend & UI

Task patternSkill to useNotes
New page/componentlocafleet-ui + nextjsCheck design patterns A/B/C/D
shadcn/ui componentsshadcn-ui + locafleet-uiFollow color palette & badge mapping
Forms (react-hook-form + Zod)nextjs + locafleet-stackServer Actions for submission
Planning/Gantt viewlocafleet-uiplanby library, see planning specs
Dashboard KPIs & chartslocafleet-uiRecharts, see dashboard layout
Tables with filters, paginationlocafleet-uiTanStack Table + shadcn DataTable
i18n (translations)locafleet-stacknext-intl, FR/EN, format suisse

Infrastructure & DevOps

Task patternSkill to useNotes
Git commit, push, PRengineering-workflowsConventional commits
Code reviewengineering-workflowsRun before every PR
Test failuresengineering-workflowsSystematic test fixing
CI/CD, deploymentlocafleet-stackRailway auto-deploy
Error trackinglocafleet-stackSentry integration

Documents & PDF

Task patternSkill to useNotes
Generate contract PDFdocument-skills + locafleet-stack@react-pdf/renderer
Generate invoice PDFdocument-skills + locafleet-stackFormat suisse: CHF, apostrophes
Generate inspection PDFdocument-skillsInclude photos + signature

Testing

Task patternSkill to useNotes
Unit test Server Actionlocafleet-testing + locafleet-schemaMock DB, test tenantId + auth + Zod
Unit test Zod schemalocafleet-testingTest valid/invalid inputs, edge cases
Unit test utility functionlocafleet-testingformatCHF, formatDate, pricing logic
Component testlocafleet-testingReact Testing Library, test render + interactions
E2E testlocafleet-testingPlaywright, full user journey, use auth setup
Fix failing testsengineering-workflows + locafleet-testingSystematic test fixing

Execution Rules

  1. ALWAYS read locafleet-schema before any DB operation - never guess table/column names
  2. ALWAYS read locafleet-ui before any UI component - follow the design system exactly
  3. ALWAYS read locafleet-stack for conventions - file naming, folder structure, error handling
  4. ALWAYS write unit tests for Server Actions and Zod schemas - no action without a test
  5. Combine skills - most tasks need 2-3 skills simultaneously
  6. When in doubt, check the PRD - files in docs/prd/ are the source of truth
  7. Format suisse - Dates: DD.MM.YYYY, Montants: 1'250.00 CHF, Langue par defaut: FR