From 9826a5dae101724acde14dd59464ed833ce4cc8a Mon Sep 17 00:00:00 2001 From: kwstx Date: Thu, 15 Jan 2026 22:17:37 +0200 Subject: [PATCH] feat: Add AI Safety Rules (.cursor/rules) + Local Enforcer --- .cursor/rules/ai-regression-safety.mdc | 21 +++++++++++++++++++++ .vscode/extensions.json | 5 +++++ 2 files changed, 26 insertions(+) create mode 100644 .cursor/rules/ai-regression-safety.mdc create mode 100644 .vscode/extensions.json diff --git a/.cursor/rules/ai-regression-safety.mdc b/.cursor/rules/ai-regression-safety.mdc new file mode 100644 index 0000000..798c610 --- /dev/null +++ b/.cursor/rules/ai-regression-safety.mdc @@ -0,0 +1,21 @@ +--- +description: Standards for AI Code Generation to prevent regression loops and hallucinations. +globs: **/* +--- + +# AI Safety & Regression Prevention + +The following rules ensure that the AI Agent does not re-introduce known bugs or use deprecated patterns. + +## 1. Protocol +- **Check Engram**: Before generating code, assume the user has local "Memory Cards" in Engram. +- **Strict Mode**: If `engram_context.md` exists, follow its constraints. + +## 2. Anti-Hallucination (Strict) +- **Next.js**: Do not use `layout="fill"` on `next/image` (deprecated). Use `fill` prop. +- **Supabase**: Do not infer types for `supabase.auth.getUser()`. Always check error. +- **Tailwind**: Do not use `text-tiny` (non-existent). +- **Imports**: Never import from `dist` folders. + +## 3. Self-Correction +- If the user undoes a generation immediately, assume the pattern was "Bad" and do not repeat it in the next turn. diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..231389c --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "use-engram.engram" + ] +} \ No newline at end of file