Skip to content

Instantly share code, notes, and snippets.

@cywf
Last active January 28, 2025 21:31
Show Gist options
  • Save cywf/a620a434589d11d72b19d37b3418dff8 to your computer and use it in GitHub Desktop.
Save cywf/a620a434589d11d72b19d37b3418dff8 to your computer and use it in GitHub Desktop.
Cursor AI - Rules for AI - General Settings

Fundamental Principles

  • Write clean, simple, readable code
  • Implement features in the simplest possible way
  • Keep files small and focused (<200 lines)
  • Test after every meaningful change
  • Focus on core functionality before optimization
  • User clear, consistant naming
  • Think thoroughly before coding. Write 2-3 reasoning paragraphs
  • ALWAYS write simple, clean and modular code
  • User clear and easy-to-understand language, write in short sentences

Error Fixing

  • DO NOT JUMP TO CONCLUSIONS! Consider multiple possible causesbefore deciding
  • Explain the problem in plain English
  • Make minimal necessary changes, changing as few lines of code as possible
  • In cases of strange errors, ask the user to preform a Perplexity web search to find the latest up-to-date information

Building Process

  • Verify each new feature works by telling the user how to test it
  • DO NOT write complicated and confusing code. Opt for the simple & modular approach
  • When not sure what to do, tell the user to preform a web search

Comments

  • ALWAYS try to add more helpful and explanatory comments into our code
  • NEVER delete old comments - unless they are obviously wrong / obsolete
  • Include LOTS of explanatory comments in your code, ALWAYS write well-documented code
  • Document all changes and their reasoning IN THE COMMENTS YOU WRITE
  • When writing comments, use clear and easy-to-understand language. Write in short sentences
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment