ros-worktree

Create isolated ROS 2 workspaces by copying existing workspaces and cleaning git repositories.

1|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/Idate96/codex_skills --skill ros-worktree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ros-worktree
Source: https://github.com/Idate96/codex_skills/tree/main/skills/ros-worktree
Command: npx skills add https://github.com/Idate96/codex_skills --skill ros-worktree

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you create and manage isolated ROS 2 workspaces, preventing conflicts and ensuring safe, reproducible builds and testing without affecting your primary development environment.

Core Features & Use Cases

  • Isolated Workspace Creation: Sets up a new, clean ROS 2 workspace directory.
  • Repository Management: Cleans git repositories within the workspace to a pristine state and optionally uses git worktrees for modifiable repositories.
  • Build Optimization: Allows ignoring non-ROS or heavy packages using COLCON_IGNORE for faster builds.
  • Use Case: You need to test a new feature in a specific set of ROS packages without risking your main ~/moleworks/ros2_ws. This Skill creates a temporary, isolated workspace for that purpose.

Quick Start

Create a new isolated ROS 2 workspace named 'ros2_ws_my_test' by copying the 'src' directory from your main workspace.

Frequently Asked Questions about ros-worktree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an isolated ROS 2 workspace for testing without breaking my main environment?

You can create an isolated ROS 2 workspace by copying your existing src directory into a new location. This prevents conflicts and ensures safe, reproducible builds without affecting your primary development environment.

How do I exclude heavy packages to speed up colcon builds in a ROS 2 workspace?

You can speed up colcon builds by ignoring non-ROS or heavy packages using COLCON_IGNORE. This build optimization ensures that only the necessary packages are compiled in your isolated workspace.

Can I use git worktrees to manage modifiable repositories in a ROS 2 workspace?

Yes, you can use git worktrees for modifiable repositories within your ROS 2 workspace. This advanced scenario allows you to maintain separate working directories for the same repository without duplicating files.

Does this ROS 2 workspace isolation approach support Dockerized builds?

Yes, the ROS 2 workspace isolation process supports Dockerized builds. This facilitates setting up pristine environments for safe builds and testing by leveraging containerization alongside git worktrees.

How do I clean git repositories to a pristine state before setting up a ROS 2 worktree?

The workspace setup process cleans git repositories within your workspace to a pristine state automatically. This ensures that your isolated ROS 2 environment starts without uncommitted changes or build artifacts.

What is the best way to safely test a new feature in specific ROS 2 packages?

The best way to safely test new features is to create a temporary, isolated ROS 2 workspace. By copying the src directory and ignoring unnecessary packages, you can test modifications without risking your main workspace.