Rule
0 installs · 0 said it worked
Cursor rules guiding ROS and ROS2 package development
A Cursor rules file that steers the assistant through ROS and ROS2 work: package layout, node and interface design, timing and frames, build and testing, and common mistakes to avoid.
People use this for
- ros2 cursor rules
- robot operating system coding guidelines
- ros2 package node design rules
- write rules for ros nodes and launch files
- guide assistant for ros2 package development
- Name
cursor-rules-guiding-ros-and-ros2-package-development- Works with
- Cursor
- License
- CC0(as observed at the source)
- Version
- v1 · updated Nov 29, 2026
Imported on Nov 29, 2026 from github.com . License observed at the source on Nov 29, 2026: CC0.
Are you the author?Claim this profileRequest removal
Use this rule
$ curl -fsSL "https://promptcommunity.dev/api/v1/posts/cursor-rules-guiding-ros-and-ros2-package-development-mrkn/export/mdc" -o .cursor/rules/cursor-rules-guiding-ros-and-ros2-package-development.mdcThen open a new session; Cursor picks it up from .cursor/rules/.
Manual install
Save cursor-rules-guiding-ros-and-ros2-package-development.mdc as .cursor/rules/cursor-rules-guiding-ros-and-ros2-package-development.mdc for this project or ~/.cursor/rules/cursor-rules-guiding-ros-and-ros2-package-development.mdc for every project, then start a new session.
Rule
description: ROS and ROS2 rules for packages, nodes, launch files, messages, services, actions, simulation, and testing globs: ["/*.py", "/.cpp", "**/.hpp", "/*.h", "package.xml", "CMakeLists.txt", "/.launch.py", "**/.msg", "/*.srv", "/.action", "**/.urdf", "**/*.xacro"] alwaysApply: false
ROS and ROS2 Rules
Package Structure
- Keep packages focused on one robot capability or integration boundary.
- Use
package.xmlandCMakeLists.txtorsetup.pyconsistently with the package type. - Keep launch files under
launch/, configs underconfig/, messages undermsg/, services undersrv/, and actions underaction/. - Use namespaces and remapping instead of hardcoded topic names when nodes may be reused.
Nodes and Interfaces
- Keep nodes small and composable.
- Use parameters for tunable behavior; declare ROS2 parameters explicitly.
- Prefer messages for state streams, services for quick request/response operations, and actions for long-running goals with feedback.
- Use standard message types before creating custom interfaces.
- Document topic, service, action, frame, and parameter contracts.
Timing and Frames
- Use ROS time when simulation or bag replay matters.
- Use
tf2for frame transforms and document frame names. - Avoid blocking callbacks; move long work to timers, worker threads, or actions.
- Set QoS profiles intentionally for sensor data, latched-like config, and reliable command paths.
Build and Test
- Use
colcon buildand keep package dependencies explicit. - Run linters and formatters used by the workspace.
- Add launch tests or integration tests for multi-node behavior.
- Use simulation, bags, or recorded fixtures for repeatable sensor scenarios.
- Test failure cases such as missing transforms, stale sensor data, and unavailable services.
Common Mistakes
- Do not hardcode absolute paths; use package share directories.
- Do not publish commands without validating frame, units, and timestamp assumptions.
- Do not create custom messages when a standard message fits.
- Do not ignore QoS mismatches between publishers and subscribers.
No result recorded yet. Added it? File a Tried-it report so the next person knows how it went in your editor.
Tried it
Reports from people who added this rule to their editor. They roll up into the badges above.
No one has filed a report yet. Try the prompt and be the first.
Related rules
- Quality engineering agent role for risk-based test strategy and CI quality gates
A senior quality engineering role prompt that guides an assistant through risk-based test strategy, test automation architecture, CI/CD quality gates, edge-case analysis, and defect management, writing results to a TODO checklist file.
Coding · @wkaandemir
- Autonomous coding agent that builds a verified app-builder harness
Master system prompt that directs an autonomous senior Python engineer to build a spec-driven, evidence-traced app-builder harness milestone by milestone without asking questions.
Coding · @mahfuzahmedog
- Cursor rules for writing and testing Xian smart contracts in Python
A Cursor rules file that guides the assistant through writing Xian blockchain smart contracts in Python, covering naming, state, context variables, events, error handling, and unittest-based testing with security checks.
Coding · @patrickjs
- Flaky Test Detector: separate flaky CI tests from real failures
Agent skill that reads repeated CI run results (JUnit XML or CSV history), flags tests that pass and fail without code changes, ranks them by flip and failure rate, and recommends targeted fixes or quarantine plans instead of retries.
Coding · @f
- Agent that writes, runs, and repairs tests after code changes
A system prompt defining a test-writer-fixer agent that writes unit, integration, and end-to-end tests, runs suites, analyzes failures, and repairs tests without weakening them.
Coding · @ersinyilmaz
License: CC0v1 · published Nov 29, 2026
Comments
No comments yet. If you tried this prompt, say how it went.