2.4 KiB
2.4 KiB
Audit Result: AI Development Constitution
Source plan: plans/rule-ai.md
Date: 2026-06-29
What Was Audited
- Folder structure under
src/app,src/components,src/features,src/hooks,src/lib,src/db, andsrc/config. - Feature structure for all directories in
src/features. - Table patterns across training records, pending review, employee directory, audit logs, users, courses, employees, products, notifications, announcements, and online lessons.
- Form patterns using
useAppFormand Zod. - Route Handler and Drizzle persistence patterns.
- Auth and role helpers.
- Shared UI, dialog, sheet, alert dialog, upload, table, and layout components.
- Existing documentation and
AGENTS.md.
Important Corrections From The Plan
The plan names some tools that are not the actual stack. The generated docs follow the real repository implementation:
- Persistence is Drizzle ORM, not Prisma.
- Forms use TanStack Form, not React Hook Form.
- Runtime mutations use Route Handlers plus TanStack Query, not
next-safe-action. - Icons come from
@/components/icons. - Data tables should use the shared DataTable stack.
Canonical Features Selected
Primary:
training-records
Secondary:
employee-directoryannouncementsaudit-logs
Documents Created
docs/AI_DEVELOPMENT_GUIDE.mddocs/PROJECT_ARCHITECTURE.mddocs/REFRACTOR_REPORT.md
Files Updated
AGENTS.md
Key Findings
training-recordsis the strongest canonical feature because it covers server data, Route Handlers, table, form, upload, and review behavior.employee-directoryis a strong table reference for responsive DataTable behavior.announcementsandnotificationsstill use manual pagination in places.- Legacy/template areas such as
products,employees,forms,kanban,chat, and demo pages should not be copied into new runtime work. - New tables should use
DataTable,DataTableToolbar,DataTablePagination,DataTableViewOptions,DataTableColumnHeader, anduseDataTable. - New forms should use
useAppForm, shared TanStack Form wrappers, and Zod.
Recommended Next Steps
- Keep
training-recordsas the default feature reference for future work. - Finish aligning
online-lessonsto a single DataTable implementation. - Do not refactor legacy features without explicit approval.
- Use
docs/REFRACTOR_REPORT.mdas the backlog for future consistency work.