dragonruby-best-practices-cursorrules-prompt-file — Cursor rule
A Cursor rule that sets Ruby coding style for DragonRuby Game Toolkit: naming, file structure, error handling.
.cursor/rules/dragonruby-best-practices-cursorrules-prompt-file.mdcWhat dragonruby-best-practices-cursorrules-prompt-file does
Drop .cursor/rules/dragonruby-best-practices-cursorrules-prompt-file.mdc into your project and Cursor reads it as instructions when it writes or edits Ruby code. The file targets DragonRuby Game Toolkit specifically.
Inside are concrete requirements. Concise idiomatic Ruby, Ruby and DragonRuby conventions, object-oriented and functional patterns where they fit. Files, methods and variables use snake_case; classes and modules use CamelCase. Single quotes unless interpolation is needed, and the expressive bits of the language — unless, ||=, &. — are called out by name. Exceptions belong to exceptional cases rather than control flow, with error logging and readable messages alongside.
The rule ships with alwaysApply: false, so it does not ride along on every request. Worth checking how your Cursor build picks the file up: if the rule never fires, generated code comes back without any of these constraints. File layout is described through DragonRuby conventions rather than a fixed directory list.
What it helps with
- keep Ruby code in one style without repeating instructions to the agent
- agree on file, method and class naming across a DragonRuby project
- keep exceptions out of ordinary branching logic
- get readable error messages instead of bare raises
- lay out files the way DragonRuby expects
Example prompts for the agent
- add a new enemy class and follow the DragonRuby rules in .cursor/rules
- refactor this method to snake_case and single quotes
- check error handling in this file against the DragonRuby rule
How to install dragonruby-best-practices-cursorrules-prompt-file
Manually: put the files in place
.cursor/rules/dragonruby-best-practices-cursorrules-prompt-file.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/dragonruby-best-practices-cursorrules-prompt-file.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/dragonruby-best-practices-cursorrules-prompt-file.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/dragonruby-best-practices-cursorrules-prompt-file.mdManually: put the files in place
.clinerules/dragonruby-best-practices-cursorrules-prompt-file.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about dragonruby-best-practices-cursorrules-prompt-file
How do I install dragonruby-best-practices-cursorrules-prompt-file in Cursor?
Create .cursor/rules/dragonruby-best-practices-cursorrules-prompt-file.mdc in your project root and paste the rule contents into it.
What does this rule do?
It tells Cursor how to write Ruby for DragonRuby Game Toolkit: snake_case names, CamelCase classes, single quotes, exceptions reserved for exceptional cases.
Does it apply to every file in the project?
It sets globs: **/* with alwaysApply: false, so it covers any file but is not attached automatically to every request.
Source text
dragonruby-best-practices-cursorrules-prompt-file.mdc · CC0-1.0
--- description: "Cursor rules for DragonRuby development with best practices integration." globs: **/* alwaysApply: false --- You are an expert game developer in Ruby using the DragonRuby Game Toolkit. Code Style and Structure - Write concise, idiomatic Ruby code with accurate examples. - Follow Ruby and DragonRuby conventions and best practices. - Use object-oriented and functional programming patterns as appropriate. - Prefer iteration and modularization over code duplication. - Use descriptive variable and method names (e.g., user_signed_in?, calculate_total). - Structure files according to DragonRuby conventions. Naming Conventions - Use snake_case for file names, method names, and variables. - Use CamelCase for class and module names. - Follow DragonRuby naming conventions. Syntax and Formatting - Follow the Ruby Style Guide (https://rubystyle.guide/) - Use Ruby's expressive syntax (e.g., unless, ||=, &.) - Prefer single quotes for strings unless interpolation is needed. Error Handling and Validation - Use exceptions for exceptional cases, not for control flow. - Implement proper error logging and user-friendly messages. Follow the official DragonRuby Game Toolkit guides for best practices in routing, controllers, models, views, and other Rails components.
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules