Skip to content

fix: require worktree setup before subagent-driven-development and executing-plans#382

Merged
obra merged 8 commits intoobra:mainfrom
clkao:fix/subagent-worktree-requirement
Jan 30, 2026
Merged

fix: require worktree setup before subagent-driven-development and executing-plans#382
obra merged 8 commits intoobra:mainfrom
clkao:fix/subagent-worktree-requirement

Conversation

@clkao
Copy link
Contributor

@clkao clkao commented Jan 29, 2026

Summary

  • Add using-git-worktrees as a required prerequisite for subagent-driven-development and executing-plans skills
  • Add "never start on main/master without explicit user consent" to red flags
  • Update using-git-worktrees to list these skills as callers
  • Fix flaky test case-sensitivity and add tests for the new requirements

Problem

The subagent-driven-development and executing-plans skills execute implementation plans but don't require setting up an isolated workspace first. This leads to implementations being committed directly to main/master, which:

  • Pollutes main with WIP commits
  • Makes rollback difficult
  • Prevents code review via PR
  • Causes finishing-a-development-branch to fail (nothing to merge/PR)

Solution

  • Make using-git-worktrees a required prerequisite in both skills
  • Add explicit red flag warning about starting on main without consent
  • Create bidirectional cross-references between the skills

Files Changed

File Change
skills/subagent-driven-development/SKILL.md Added worktree to required skills, added main branch red flag
skills/executing-plans/SKILL.md Added Integration section with worktree requirement, added main branch warning
skills/using-git-worktrees/SKILL.md Added subagent-driven-development and executing-plans as callers
tests/claude-code/test-subagent-driven-development.sh Fixed case-sensitivity bug, added Tests 8 & 9

Test Plan

  • Test 8 verifies worktree requirement is mentioned in skill
  • Test 9 verifies main branch warning is present
  • Cross-references are symmetric between skills

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Documentation

    • Added explicit policy requiring user consent before implementing changes on main/master branches
    • Introduced workflow prerequisites specifying required setup steps before task execution
  • Tests

    • Added test coverage for branch policy enforcement and workflow prerequisite validation

✏️ Tip: You can customize this high-level summary in your review settings.

clkao and others added 8 commits January 29, 2026 14:34
The assertion now matches "subagent-driven-development", "Subagent-Driven
Development", and "Subagent Driven" since Claude's responses may use
different casing and formatting styles.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add Test 8 to verify that using-git-worktrees is mentioned as a required
skill for subagent-driven-development. This test will initially fail per
TDD approach - the skill file needs to be updated to pass this test.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
TDD: Test verifies that subagent-driven-development skill warns
against starting implementation directly on main/master branch.
Test expects skill to recommend worktree or feature branch instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…d skill

Adds using-git-worktrees as the first required workflow skill in the
Integration section. This makes explicit that an isolated workspace
should be set up before starting subagent-driven development.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…list

Add explicit warning against starting implementation on main/master
branch without first using a worktree for isolation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update Integration section to show bidirectional relationship:
subagent-driven-development and executing-plans now list
using-git-worktrees as required, so this skill should list
them as callers.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add Integration section referencing using-git-worktrees skill as required,
consistent with subagent-driven-development skill. Also add reminder to
never start on main/master branch.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Instead of prohibiting main branch work entirely, allow it with explicit
user consent. This is more flexible while still ensuring users are aware
of the implications.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Updates to workflow skill documentation and tests establish explicit prerequisites for git worktree setup and enforce safeguards against starting implementation on main/master branches without user consent. Changes span three skill definitions and related test validations.

Changes

Cohort / File(s) Summary
Skill Documentation Updates
skills/executing-plans/SKILL.md, skills/subagent-driven-development/SKILL.md, skills/using-git-worktrees/SKILL.md
Added explicit policies against main/master branch work without consent, introduced integration requirements for git worktree setup, and clarified prerequisite relationships between workflow skills.
Test Updates
tests/claude-code/test-subagent-driven-development.sh
Extended test assertions to match multiple skill name variants and added validation for worktree prerequisites and main branch safeguard warnings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • yoavsion

Poem

🐰 A rabbit hops through git branches tall,
With worktrees set, they'll never fall,
"Not on main!" the warnings say,
Skills aligned in every way! 🌱

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately describes the main change: making worktree setup a required prerequisite for two specific skills.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@obra obra merged commit 06b92f3 into obra:main Jan 30, 2026
1 check passed
@obra
Copy link
Owner

obra commented Jan 30, 2026

Thanks! merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants