From 206f028fdfecbd6ac0313d35dd8dfc00140b8654 Mon Sep 17 00:00:00 2001 From: Dmytro Stanchiev Date: Mon, 6 Apr 2026 20:48:07 -0400 Subject: [PATCH] init ruler Signed-off-by: Dmytro Stanchiev --- .gitignore | 8 + .ruler/00-LINT-RULES.md | 93 ++++++ .ruler/02-BUN-GUIDE.md | 52 ++++ .ruler/03-ZOD-GUIDE.md | 19 ++ .ruler/05-TESTING-DOCTRINE.md | 460 ++++++++++++++++++++++++++++++ .ruler/08-CONTEXT7.md | 1 + .ruler/09-NIX.md | 287 +++++++++++++++++++ .ruler/99-OPENSKILLS.md | 106 +++++++ .ruler/AGENTS.md | 1 + .ruler/chrome-devtools-openurl.sh | 46 +++ .ruler/ruler.toml | 105 +++++++ .ruler/skill-selector.yaml | 23 ++ 12 files changed, 1201 insertions(+) create mode 100644 .ruler/00-LINT-RULES.md create mode 100644 .ruler/02-BUN-GUIDE.md create mode 100644 .ruler/03-ZOD-GUIDE.md create mode 100644 .ruler/05-TESTING-DOCTRINE.md create mode 100644 .ruler/08-CONTEXT7.md create mode 100644 .ruler/09-NIX.md create mode 100644 .ruler/99-OPENSKILLS.md create mode 100644 .ruler/AGENTS.md create mode 100755 .ruler/chrome-devtools-openurl.sh create mode 100644 .ruler/ruler.toml create mode 100644 .ruler/skill-selector.yaml diff --git a/.gitignore b/.gitignore index d51089b..18cce8c 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,11 @@ yarn-error.log* next-env.d.ts public/sw.js public/workbox-*.js + + +# START Ruler Generated Files +/AGENTS.md +/AGENTS.md.bak +/opencode.json +/opencode.json.bak +# END Ruler Generated Files diff --git a/.ruler/00-LINT-RULES.md b/.ruler/00-LINT-RULES.md new file mode 100644 index 0000000..a8efdeb --- /dev/null +++ b/.ruler/00-LINT-RULES.md @@ -0,0 +1,93 @@ +## CRITICAL: Lint Rules Are Sacred and Immutable + +**ABSOLUTE PROHIBITION**: You are **FORBIDDEN** from modifying, disabling, or bypassing any lint rules, ESLint configurations, TypeScript compiler settings, or any other code quality enforcement mechanisms in this repository. + +## Non-Negotiable Principles + +### 1. Rules Must NEVER Be Changed + +- **NO** adding `// eslint-disable` comments +- **NO** adding `// @ts-ignore` or `// @ts-expect-error` comments +- **NO** modifying `.eslintrc`, `eslint.config.js`, or any ESLint configuration files +- **NO** modifying `tsconfig.json` compiler options to silence errors +- **NO** modifying `biome.json`, `prettier.config.js`, `.oxlintrc`, or any formatter settings +- **NO** adding files to `.eslintignore` or exclude patterns +- **NO** downgrading errors to warnings or warnings to off +- **NO** adjusting rule severity or options + +### 2. Fix the Root Cause, Not the Symptom + +When encountering a lint error or type error: + +1. **Attempt 1-10**: Fix the underlying code issue that violates the rule + - Refactor the code to comply with the rule + - Restructure the logic to avoid the violation + - Use proper types and patterns that satisfy the linter + - Redesign the approach entirely if needed + - Consider alternative implementations + - Review similar patterns in the codebase for guidance + - Consult documentation for the library/framework being used + - Try multiple different architectural approaches + - Explore edge cases and alternative solutions + - Exhaust ALL possible code-level fixes + +2. **After 10+ Genuine Attempts**: If you have exhausted ALL reasonable code fixes and the error persists: + - **STOP** and **ASK THE USER** for guidance + - Present the specific rule violation + - Explain what you've tried (all 10+ attempts) + - Ask if there's a pattern you're missing or if an exception is warranted + - **NEVER** make the decision to disable or modify rules yourself + +### 3. Why Rules Exist + +- Lint rules enforce consistency across the codebase +- They prevent bugs and anti-patterns +- They represent team decisions and conventions +- They ensure code quality and maintainability +- They are project-specific and carefully chosen + +### 4. Common Scenarios and Correct Responses + +#### Scenario: "Unused variable" error +- ❌ WRONG: Add `// eslint-disable-next-line no-unused-vars` +- ✅ RIGHT: Remove the unused variable or use it properly + +#### Scenario: "any type" error +- ❌ WRONG: Add `// @ts-ignore` or change to `unknown` just to silence +- ✅ RIGHT: Define proper types that accurately represent the data + +#### Scenario: "Missing dependency in useEffect" warning +- ❌ WRONG: Add `// eslint-disable-next-line react-hooks/exhaustive-deps` +- ✅ RIGHT: Add the missing dependency or restructure to avoid the issue + +#### Scenario: "Type errors in third-party library" +- ❌ WRONG: Use `@ts-expect-error` or cast to `any` +- ✅ RIGHT: Install proper type definitions, create a typed wrapper, or use proper type assertions + +#### Scenario: "Complexity too high" error +- ❌ WRONG: Disable the complexity rule +- ✅ RIGHT: Refactor the function into smaller, simpler functions + +### 5. Enforcement Priority + +Lint rules have **MAXIMUM PRIORITY**. They outrank: +- Personal coding preferences +- Convenience +- Speed of implementation +- Desire to "just make it work" + +### 6. Remember + +**You are here to serve the repository's conventions, not to modify them.** + +If you find yourself thinking "it would be easier to just disable this rule," that is **EXACTLY** when you must **NOT** do it. + +## Summary + +1. ❌ NEVER disable, ignore, or modify lint rules +2. ✅ ALWAYS fix the code to comply with rules +3. ✅ Try 10+ different approaches to fix the root issue +4. ✅ ASK THE USER if all code-level fixes fail +5. ❌ NEVER act autonomously on rule modifications + +**These are not guidelines. These are absolute requirements.** diff --git a/.ruler/02-BUN-GUIDE.md b/.ruler/02-BUN-GUIDE.md new file mode 100644 index 0000000..70db85c --- /dev/null +++ b/.ruler/02-BUN-GUIDE.md @@ -0,0 +1,52 @@ +## Bun Guidelines + +**CRITICAL**: Do not assume you know full Bun APIs. For **ANY** Bun API you use, confirm them by using `bun-docs` MCP tools. + +Default to using Bun instead of Node.js. + +- Use `bun ` instead of `node ` or `ts-node ` +- Use `bun test` instead of `jest` or `vitest` +- Use `bun build ` instead of `webpack` or `esbuild` +- Use `bun install` instead of `npm install` or `yarn install` or `pnpm install` +- Use `bun run