doubleuuser/rlm-workflow/rlm-worktree
Claude Code and agent skill by doubleuuser/rlm-workflow
- community
Checking that the SKILL.md file is still in the repository.
Use when starting any RLM requirement to set up an isolated git worktree. REQUIRED before Phase 1 - creates isolated workspace, verifies clean test baseline, and prevents main branch pollution. Trigger phrases: "create worktree", "worktree isolation", "set up worktree", "do not work on main".
Install
npx vskill@latest install doubleuuser/rlm-workflow/rlm-worktreeSKILL.md
RLM Git Worktree Isolation (Phase 0)
Overview
Git worktrees create isolated workspaces sharing the same repository, allowing parallel development without switching branches. This prevents:
- Pollution of main/master branch during development
- Accidental commits to production branches
- Context switching overhead
- Conflicts between parallel requirements
Core Principle: Systematic directory selection + safety verification = reliable isolation.
The Iron Law for RLM Worktrees:
Trigger examples
Create an isolated worktree for this requirementSet up Phase 0 worktree isolation for run '2026-02-24-add-oauth'I'm on main; move me to a worktreeUse .worktrees/ and ensure it is git-ignored
When to Use
REQUIRED for all RLM runs:
- New features
- Bug fixes
- Refactoring
- Experiments/prototypes
Insert as Phase 0:
The Worktree Rule
<HG> Do NOT proceed with any RLM phase until:
- Isolated worktree is created on feature branch
- Worktree directory is git-ignored (if project-local)
- Clean test baseline is verified
- User has explicitly consented if main branch work requested
</HG>
Directory Selection Process
Step 1: Check Existing Directories
If found: Use that directory. If both exist, .worktrees wins.
Step 2: Check CLAUDE.md
If preference specified: Use it without asking.
Step 3: Ask User (if no convention exists)
Default: .worktrees/ (option 1)
Safety Verification
For Project-Local Directories (.worktrees or worktrees)
MUST verify directory is ignored before creating worktree:
If NOT ignored:
Per "Fix broken things immediately" rule:
- Add appropriate line to .gitignore:
`` # RLM worktrees .worktrees/ ``
- Commit the change:
``bash git add .gitignore git commit -m "chore: ignore RLM worktree directory" ``
- Proceed with worktree creation
Why critical: Prevents accidentally committing worktree contents to repository.
For Global Directory (~/.config/rlm-workflow/worktrees)
No .gitignore verification needed - outside project entirely.
Worktree Creation Process
Step 1: Detect Project Name
Step 2: Check Current Branch
Step 3: Create Worktree with New Branch
Step 4: Run Project Setup
Auto-detect and run appropriate setup:
Step 5: Verify Clean Test Baseline
Run tests to ensure worktree starts clean:
If tests fail:
- Report failures
- Ask whether to proceed or investigate
- Document decision in Phase 0 artifact
If tests pass:
- Report baseline verified
- Record test count and pass rate
Step 6: Record in Phase 0 Artifact
Main Branch Protection
Automatic Detection
When user invokes "Implement requirement 'run-id'" from main/master:
Explicit Consent Required
If user explicitly requests main branch work:
Phase 0 Artifact Template
File: /.codex/rlm/<run-id>/00-worktree.md
$ git check-ignore -q .worktrees && echo "IGNORED" || echo "NOT IGNORED" IGNORED
git worktree add .worktrees/run-id -b rlm/run-id
Preparing worktree (new branch 'rlm/run-id') HEAD is now at abc1234 Previous commit message
cd .worktrees/run-id npm install
added 472 packages in 8s
npm test
Integration with RLM
Phase 0 -> Phase 1 Transition
Phase 0 must be locked before proceeding:
- Verify worktree exists and is properly configured
- Check Phase 0 gates are PASS
- Lock Phase 0 artifact
- Proceed to Phase 1 (requirements already exist)
- All subsequent phases execute in worktree context
Worktree Context for All Phases
Once Phase 0 is complete:
- All RLM commands run from worktree directory
- Git operations target feature branch
- Main branch remains untouched
- Development is fully isolated
Phase 6/7 (Global Updates)
When updating global artifacts:
- Changes are made in worktree context
- Commits go to feature branch
- User merges feature branch to main when ready
- DECISIONS.md and STATE.md updates are part of the merge
Common Mistakes
Skipping ignore verification
- Problem: Worktree contents get tracked, pollute git status
- Fix: Always use
git check-ignorebefore creating project-local worktree
Assuming directory location
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/rlm-worktree/SKILL.md
Popularity
- Repository stars
- 28
- 7-day trend score
- 17
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 22 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/doubleuuser/rlm-workflow/rlm-worktree)