Skip to content

A collection of example rules that can be used with Cursor, Claude, or other AI assistant coding tools to improve code quality and maintain consistent development practices.

Notifications You must be signed in to change notification settings

jsonallen/example-ai-coding-rules

Repository files navigation

AI Coding Assistant Rules

A collection of example rules that can be used with Cursor, Claude, or other AI assistant coding tools to improve code quality and maintain consistent development practices.

Overview

This repository contains customizable rule templates that help AI coding assistants understand your project's specific requirements, coding standards, and workflow preferences. These rules act as persistent instructions that guide AI behavior throughout your development sessions.

Available Rules

1. Development Partnership Rule (development_partnership_rule.md)

Establishes a collaborative approach between developer and AI assistant with emphasis on:

  • Simple, direct implementations without over-engineering
  • Mandatory automated checks and validation
  • Research → Plan → Implement workflow
  • Clear communication and guidance patterns

2. Astro Technology Stack Rule (astro_technology_stack_rule.md)

Defines specific technology versions and conventions for Astro-based projects:

  • Astro 5.x with latest APIs and patterns
  • Tailwind CSS 4.x CSS-first configuration
  • React 20.x with Server Components
  • TypeScript strict mode requirements

3. Git Feature Branch Rule (git_feature_branch_rule.md)

Enforces proper Git branching strategies:

  • Never work directly in main branch
  • Linear issue branch naming: cit-[issue-number]
  • Feature branch naming: feat-[description]
  • Consistent workflow and naming conventions

4. Linear Issue Creation Rule (linear_issue_creation_rule.md)

Guidelines for creating well-structured Linear issues:

  • Clear functional requirements
  • Engaging overviews and value propositions
  • Specific acceptance criteria
  • Proper scoping and prioritization

Usage

In Cursor

  1. Copy the desired rule file(s) to your project root
  2. Add the rule content to your .cursorrules file
  3. The AI assistant will automatically follow these guidelines

In Claude Projects

  1. Add the rule content to your project's custom instructions
  2. The rules will persist across all conversations within that project

In Other AI Tools

Most AI coding assistants support some form of persistent instructions or system prompts. Add the relevant rules to your tool's configuration.

Customization

These rules are designed to be modified for your specific needs:

  1. Adjust technology versions - Update version numbers in the technology stack rule
  2. Modify workflows - Adapt the development partnership workflow to match your team's process
  3. Change naming conventions - Customize branch naming patterns in the Git rule
  4. Add project-specific requirements - Extend any rule with your unique constraints

Best Practices

  • Start simple - Begin with one or two rules and add more as needed
  • Be specific - Clear, concrete instructions work better than vague guidelines
  • Update regularly - Keep technology versions and workflows current
  • Test thoroughly - Verify the AI follows your rules correctly
  • Iterate based on results - Refine rules based on actual usage

Contributing

Feel free to submit pull requests with additional rule templates or improvements to existing ones. Please ensure any new rules are:

  • Well-documented with clear use cases
  • Generic enough to be adapted by others
  • Tested with at least one AI coding assistant

License

These rule templates are provided as examples and can be freely used and modified for any purpose.

About

A collection of example rules that can be used with Cursor, Claude, or other AI assistant coding tools to improve code quality and maintain consistent development practices.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •