Skip to content

OctavianTocan/claude-rules

Repository files navigation

claude-rules

Personal coding rules for Claude Code, auto-loaded via ~/.claude/rules/. Every rule exists because something went wrong without it.

227 rules across 22 categories. Battle-tested from production bugs, code reviews, and hard-won debugging sessions across React Native, TypeScript, Rust, and CI/CD pipelines.

Quick start

git clone git@github.com:OctavianTocan/claude-rules.git ~/.claude/rules

Rules load automatically on every Claude Code conversation. To update: cd ~/.claude/rules && git pull

Categories

Category Count When it fires
ci/ 49 Editing .github/workflows/, Dockerfile, shell scripts
typescript/ 17 Editing .ts/.tsx files
react/ 19 Editing .ts/.tsx files
debugging/ 18 Always (general methodology)
brownfield/ 15 Editing native/RN brownfield files
git/ 12 Editing .github/ configs, shell scripts
twinmind/ 10 Editing app-specific .ts/.tsx/native files
react-native/ 11 Editing .ts/.tsx/.kt/.java/.swift files
testing/ 8 Editing test files
state-management/ 6 Editing .ts/.tsx/native files
error-handling/ 8 Editing .ts/.tsx files
api/ 4 Editing .ts/.tsx/.js files
auth/ 4 Editing .ts/.tsx files
sweep/ 4 Editing source files (AI review patterns)
general/ 14 Always
monorepo/ 4 Editing package.json, pnpm-workspace.yaml
expo/ 3 Editing Expo config and entry files
e2e/ 3 Editing Maestro/Android test files
figma/ 5 Editing .ts/.tsx/.css files
playwright/ 5 Editing Playwright test/config files
rust/ 3 Editing .rs files

Rule format

Every rule has YAML frontmatter with name and paths:

---
name: no-unwrap-in-production
paths: ["**/*.rs"]
---

# No unwrap() in Production Rust

Explanation of what goes wrong and why.

## Verify
"Am I using unwrap() anywhere? Can this fail at runtime?"

## Bad
...code example...

## Good
...code example...

Claude Code loads rules matching the current file's path against the paths globs. General rules with ["**/*"] fire on every file.

Writing new rules

  1. Pick the right category directory (or create one)
  2. File name = kebab-case summary of the rule
  3. Add name: (kebab-case slug) and paths: (glob array)
  4. Include: what goes wrong, why, bad/good examples, and a Verify question
  5. Commit with feat: prefix

Origin

Rules extracted from real projects:

  • TwinMind — React Native brownfield meeting app (audio, streaming, native integrations)
  • tap — Rust Telegram bot / multi-agent gateway (provider traits, subprocess testing)
  • ai-nexus — TypeScript full-stack app (Biome, multi-agent git safety)
  • openclaw-notion/todoist — Agent plugins (per-agent auth, test isolation)
  • CI pipelines across self-hosted Mac Mini runners, GitHub Actions, and Gradle builds

License

Personal use.

About

227 battle-tested coding rules for Claude Code. Auto-loaded via ~/.claude/rules/. React Native, TypeScript, Rust, CI/CD, and debugging patterns.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors