2.3 KiB
2.3 KiB
AI Agent Rules - Live_RC (Linux/Node.js)
Environment & Tech Stack
- OS: Linux (Ubuntu/Debian architecture)
- Runtime: Node.js v22/v24 LTS, npm 10+
- Core: Vanilla JavaScript, HTML5, SQLite (
data/rc_timing.sqlite) - Tests: Native Node.js test runner (
npm test) - Binaries: GLIBC 2.39+ compatible tools in
AMMC/linux_x86-64/
Critical Token & Kvot Optimization
- Compact Output Only: NEVER rewrite or output whole files (e.g.,
server.jsorsrc/app.js). Only output the exact lines, functions, or unified diffs that change. - Git Hygiene: Use
git statusorgit diff --statto inspect the workspace. Do not pipe hugegit diffoutputs into the context window. - Ignore Data & Binaries: Completely ignore the
data/directory,logs/, andAMMC/binaries. Do not scan them.
Linux Runtime Commands
Always use these exact Linux commands for management:
- Start Background:
npm start - Start Foreground (Debug):
npm run start:fg - Stop Server:
npm stop - Check Status:
npm run status - Run Tests:
npm test(Runs on isolated temporary port)
Code & Git Conventions
- Commits: Conventional Commits (e.g.,
fix(lap): repair split calculations,feat(audio): add linux sound trigger). - File System: Ensure
chmod +xcommands are suggested if modifying scripts underscripts/orAMMC/. - Always respect frontend
localStorageto backend SQLite synchronization.
Feature Generation Rules (Kvot-räddare för nya funktioner)
When implementing a NEW feature or module:
- Architecture Blueprint First: Do NOT write the code immediately. Output a 3-bullet-point layout explaining where the new logic goes (e.g., frontend state, backend API route, or SQLite schema change). Wait for human confirmation.
- Draft Modular Skeleton: Output only the function definitions, routes, or component names with empty bodies (stubs) first.
- Fill Code Incremental: Implement the feature in small, separate code blocks (max 30 lines at a time). Never generate frontend, backend, and database changes in a single massive response.
- Use Existing Utilities: Always check
server.jsandsrc/app.jsfor existing helper functions (like DB queries, WebSocket broadcasts, or audio hooks) instead of writing new ones from scratch.