chore: establish cross-IDE synchronization protocol
Implement `.ai-rules`, formalize `MEMORY.md` as the source of truth, and initialize `docs/` structure to ensure consistent architectural context across development environments.
This commit is contained in:
1 parent
05407fd338
commit
4279da45bb
14 files changed
+1162
No files matched your search
@@ -0,0 +1,17 @@
|
||||
# Universal Cross-IDE AI Rules (`.ai-rules`)
|
||||
|
||||
CRITICAL RULE: This is a multi-IDE project. Whenever any modification, update, or bug fix is completed in our session, you must automatically update the `MEMORY.md` file or provide the exact markdown blocks so the project context remains perfectly synchronized across all IDEs.
|
||||
|
||||
## Session Startup Protocol
|
||||
1. Read `MEMORY.md` and `AGENTS.md` before planning or editing code to restore accurate multi-IDE project context, runtime boundaries, and architecture constraints.
|
||||
2. Treat `MEMORY.md` as the single cross-IDE source of truth for current tech stack, directory structure, active features, and recent fixes.
|
||||
|
||||
## Architectural & Engineering Guardrails
|
||||
- **Dual-Runtime Boundary**: Keep Next.js 15 web/API routes (`app/`, Port `3000`) and Express 5 + Socket.IO ingestion (`server/index.js`, Port `4000`) cleanly decoupled. Never initialize Socket.IO servers inside Next.js API routes.
|
||||
- **Storage Boundary**: Persist telemetry events exclusively to partitioned CSVs (`/storage/data/{clientId}/{YYYY-MM-DD}.csv`) via `DataBufferEngine` / `CSVStorageManager` / Redis queue. Use PostgreSQL (`pg` + `prisma/schema.prisma`) strictly for metadata (`admin_users`, `admin_login_attempts`, `client_sdks`, `deleted_clients`, `admin_settings`).
|
||||
- **UI Consistency**: Assemble pages from existing primitives in `components/ui/` and `components/layout/` adhering to design tokens in `app/globals.css` (`--radius: 0rem`, `--shadow: none`).
|
||||
- **Non-Destructive Persistence**: Never add destructive SQL (`DROP`, `TRUNCATE`) or automatic startup scripts that purge production CSV partitions without hydrated DB settings confirmation.
|
||||
|
||||
## Verification & Sync Before Finishing Any Change
|
||||
1. Run `npm run lint` and `npm run build` plus relevant test suites (`npx --yes tsx --test tests/phase*.test.ts` and `python3 -m unittest tests/phase05_sdk_test.py` when applicable).
|
||||
2. Update `MEMORY.md` with any structural, dependency, endpoint, environment variable, or status changes made during the session before finishing.
|
||||
Reference in new issue
Block a user