Skip to main content

Cursor Tips

Best Practices for Library Selection​

  • Never stray off the standard path.
  • Avoid using obscure or new libraries.
  • Use libraries and frameworks that Claude or GPT-4 will understand.
  • This reduces the need to manually add context about changes.

Workflow Tips​

Development Cycle​

  1. Generate code.
  2. Address TypeScript errors.
  3. Feed errors back into Claude.
  4. Use the problems tab in Cursor (CMD/CTRL + A to copy).
  5. Remember to restart the TypeScript server after using composer.

Context Management​

  • Gathering relevant file context is crucial for effective Cursor usage.
  • The .cursorrules file works best when placed in subdirectories (apps/web/api).
  • Open Cursor directly in the subdirectory containing .cursorrules.
  • Use cursor.directory as a starting place for your .cursorrules file.

Working with LLMs​

  • Alternate between using Claude as:
    • A worker (for direct tasks).
    • A teacher (for learning and discovery).
  • Emotional prompting can be effective.
  • Long-running chat windows may experience performance degradation.

Troubleshooting​

When Things Go Wrong​

  • Question outputs - LLMs can lead you down incorrect paths.
  • As a senior engineer, verify the LLM truly understands the request.
  • If you've failed 3 times, the issue might be with your approach.
  • For persistent failures with proper context, break the task into smaller pieces.

Known Issues​

  • Composer may cause occasional regressions.
  • When encountering LLM bugs:
    1. Assume it's a pre-training issue (with proper context).
    2. Document solutions in .cursorrules.
    3. Consider these documentation entries as temporary fixes.
    4. Review and remove when model updates occur.

Quality Assurance​

  • After generating significant code, request Cursor to perform bug checks.
  • The more you understand your programming language and primitives:
    • The more effectively Claude can work in 'worker mode'.
    • The less time needed in 'Discovery/learning' mode.