Class: RubyAiGemContext::Platforms::Cursor
Class Method Summary
collapse
backup, exists?, full_path, path, read, write
Class Method Details
.description ⇒ Object
15
16
17
|
# File 'lib/ruby_ai_gem_context/platforms/cursor.rb', line 15
def description
"Cursor IDE - Project rules file"
end
|
.filename ⇒ Object
11
12
13
|
# File 'lib/ruby_ai_gem_context/platforms/cursor.rb', line 11
def filename
".cursorrules"
end
|
.generation_prompt ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/ruby_ai_gem_context/platforms/cursor.rb', line 19
def generation_prompt
<<~PROMPT
Generate a .cursorrules file for this Ruby project. This file tells Cursor AI how to work with this codebase.
The format should be clear instructions/rules, NOT markdown headers. Write it as a set of directives.
Include:
1. Project overview - What this project is and does
2. Tech stack - Ruby version, key gems, frameworks
3. Code style rules - Naming conventions, formatting, patterns to follow
4. File organization - Where different types of code live
5. Testing approach - How to write tests, what framework is used
6. Common patterns - Idioms and patterns used in this codebase
7. Things to avoid - Anti-patterns, deprecated approaches
8. Key commands - How to run tests, lint, build, etc.
Write in a direct, instructional tone. Each rule should be actionable.
Keep it focused on practical guidance for generating and modifying code.
PROMPT
end
|
.name ⇒ Object
7
8
9
|
# File 'lib/ruby_ai_gem_context/platforms/cursor.rb', line 7
def name
"Cursor"
end
|
.template ⇒ Object
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# File 'lib/ruby_ai_gem_context/platforms/cursor.rb', line 41
def template
<<~TEMPLATE
# Project Overview
This is a Ruby project. Describe what it does here.
# Tech Stack
- Ruby 3.x
- RSpec for testing
- Add other key dependencies
# Code Style
- Use snake_case for methods and variables
- Use CamelCase for classes and modules
- Prefer single quotes for strings without interpolation
- Keep methods short and focused (under 10 lines ideally)
- Use meaningful variable names
# File Organization
- lib/ contains the main library code
- spec/ contains RSpec tests
- Each class gets its own file
# Testing
- Write RSpec tests for all new code
- Use describe/context/it blocks
- Prefer let over instance variables
- Test behavior, not implementation
# Patterns to Follow
- Dependency injection over global state
- Composition over inheritance
- Small, focused classes
# Things to Avoid
- Monkey patching core classes
- Global mutable state
- Deep inheritance hierarchies
# Commands
- Run tests: bundle exec rspec
- Run linter: bundle exec rubocop
- Install deps: bundle install
TEMPLATE
end
|