devrules.directory
Curated Rules for AI Coding Assistants
The Challenge
AI coding assistants like Cursor, Claude, and GitHub Copilot are powerful, but they need clear guidelines to produce consistently high-quality code. Developers faced several pain points:
- β’ Inconsistent behavior - AI assistants make arbitrary decisions without asking
- β’ Dangerous suggestions - Unsafe patterns like eval(), exec(), or production database access
- β’ Scope creep - AI changes unrelated files or refactors without permission
- β’ Scattered knowledge - Best practices buried in blog posts, docs, and tribal knowledge
- β’ No centralized resource - No single place to discover and share effective AI rules
- β’ Rule fatigue - Hard to know which rules actually matter vs. noise
The challenge was to create a curated, searchable directory of tech-agnostic rules that dramatically improve AI collaboration quality while being easy to discover, understand, and apply.
The Solution
devrules.directory is a curated collection of battle-tested rules for AI coding assistants. Built with Next.js 16, it provides a searchable, filterable directory of tech-agnostic rules organized by categoryβfrom Assistant Behavior to Security, Testing, and Architecture patterns.
Platform Overview
Core Features
Multi-Category Rule System
Rules organized into 10+ categories including Assistant Behavior, Security, Testing, Architecture, Workflow, and more. Each rule includes detailed explanations, code examples, and practical guidance.
- β’ Assistant Behavior (highest impact)
- β’ Security & Safety rules
- β’ Testing & Quality standards
- β’ Workflow conventions
- β’ Architecture patterns
Powerful Search & Filtering
Fuzzy search powered by Fuse.js finds rules by name, description, or category. Real-time filtering with multi-select category tags and instant results as you type.
- β’ Fuzzy search with Fuse.js
- β’ Multi-category filtering
- β’ Real-time results
- β’ Clear filters button
- β’ Pagination for large result sets
Rich Rule Details
Each rule page includes comprehensive documentation with markdown rendering, syntax highlighting for code examples, related rules suggestions, and one-click copy buttons.
- β’ Markdown content rendering
- β’ Syntax highlighting (rehype-highlight)
- β’ Related rules discovery
- β’ One-click copy to clipboard
- β’ Category badges with icons
Responsive Design
Fully responsive layout with dark mode support. Masonry grid for optimal card layout, smooth animations, and mobile-first design principles.
- β’ Dark/light theme toggle
- β’ Masonry grid layout
- β’ Mobile-first responsive
- β’ Intersection Observer animations
- β’ Tailwind CSS 4 styling
SEO Optimization
Built-in SEO with dynamic metadata generation, XML sitemap, robots.txt, and structured data. Each rule page has unique meta tags for search engines.
- β’ Dynamic metadata per route
- β’ XML sitemap generation
- β’ robots.txt configuration
- β’ Open Graph tags
- β’ Semantic HTML structure
Legal Pages
Complete legal framework with Privacy Policy, Terms of Service, and About pages. Professional presentation for a production-ready directory.
- β’ Privacy Policy page
- β’ Terms of Service
- β’ About page
- β’ Footer with legal links
- β’ Professional copy
Rule Categories
How AI thinks and makes decisions
Preventing dangerous patterns and vulnerabilities
Industry-standard coding conventions
Clean code principles and patterns
Design patterns and structure
Test quality and coverage standards
Git, PR, and team collaboration
React, Next.js, TypeScript, Python, Go
API design and versioning
Styling conventions and naming
Technical Implementation
Frontend Stack
- β’ Next.js 16 - App Router, React Server Components
- β’ React 19 - Latest features and performance
- β’ TypeScript 5 - Type-safe development
- β’ Tailwind CSS 4 - Utility-first styling
- β’ shadcn/ui - Radix UI component library
- β’ next-themes - Dark mode support
Key Libraries
- β’ Fuse.js - Fuzzy search algorithm
- β’ react-markdown - Markdown rendering
- β’ rehype-highlight - Syntax highlighting
- β’ remark-gfm - GitHub Flavored Markdown
- β’ react-masonry-css - Masonry grid layout
- β’ Lucide React - Icon library
Content Architecture
Each rule is defined as a TypeScript object with a consistent structure:
Rules are stored as individual TypeScript files in lib/rules/, making them easy to add, edit, and version control.
Smart Search Implementation
Fuse.js Configuration
- β’ Threshold: 0.3 - Balanced fuzzy matching (0 = exact, 1 = match anything)
- β’ Keys: name, description, categories - Search across multiple fields
- β’ includeScore: true - Enables relevance sorting
- β’ Real-time filtering - Results update on every keystroke
Category Filtering
- β’ Multi-select - Choose multiple categories simultaneously
- β’ AND logic - Rules must match ALL selected categories
- β’ Badge UI - Visual category tags with icons
- β’ Clear filters - Reset all filters with one click
Results & Impact
devrules.directory provides a centralized, searchable resource for AI coding best practices. By focusing on tech-agnostic, behavior-driven rules, it helps developers across all languages and frameworks improve their AI collaboration quality.
π― Future Roadmap (50-60 rules)
- β’ 15-20 Assistant Behavior rules
- β’ 10-12 Security & Safety rules
- β’ 8-10 Workflow rules
- β’ 6-8 Repository Structure rules
- β’ 8-10 Testing & Quality rules
- β’ 8-12 Domain-Specific rules
Key Learnings
- β’ Content is king - The quality and actionability of rules matters more than quantity
- β’ Tech-agnostic wins - Rules that work across all languages/frameworks have the highest impact
- β’ Behavior over syntax - Focusing on AI behavior patterns is more valuable than code style rules
- β’ Search is critical - Fuzzy search with Fuse.js makes discovery effortless
- β’ TypeScript for content - Storing rules as TypeScript objects provides type safety and easy version control
- β’ Markdown + syntax highlighting - Essential for technical documentation with code examples
- β’ Category organization matters - Clear categorization helps users find relevant rules quickly
- β’ SEO from day one - Built-in metadata and sitemap generation ensure discoverability
- β’ Dark mode is expected - Modern developer tools need theme support
- β’ Pagination improves UX - Large result sets need pagination for better navigation