advise
Critical thinking analysis - validates alignment, challenges assumptions, identifies risks
Manage git worktrees (--list default, --status, --review, --merge, --discard)
$ npx -y skills add akaszubski/autonomous-dev --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
/worktreeContext preview
What this command does when you run it.
Manage git worktrees (--list default, --status, --review, --merge, --discard)
name: worktree description: "Manage git worktrees (--list default, --status, --review, --merge, --discard)" argument-hint: "Optional flags: --list (default), --status FEATURE, --review FEATURE, --merge FEATURE, --discard FEATURE" allowed-tools: [Task, Read, Write, Bash, Grep, Glob] disable-model-invocation: true user-invocable: true user_facing: true
python3 ~/.claude/lib/worktree_command.py "$@"
---
**Safe feature isolation with git worktrees for review/merge/discard workflow**
The `/worktree` command provides a complete workflow for managing git worktrees created by the autonomous development pipeline. It enables reviewing changes, merging to main branch, or discarding unwanted work - all without affecting your main working directory.
---
# List all worktrees (default mode) /worktree # Shows all active worktrees /worktree --list # Explicit list mode # Show detailed status /worktree --status my-feature # Commits ahead/behind, uncommitted changes # Interactive review (diff + approve/reject) /worktree --review my-feature # Shows diff, prompts for merge approval # Merge to target branch /worktree --merge my-feature # Merges feature to master # Discard worktree /worktree --discard my-feature # Deletes worktree with confirmation
**Time**: 5-30 seconds (depends on mode) **Interactive**: Review and discard modes require confirmation **Safe Operations**: All destructive operations require explicit approval
---
**Review workflow**:
**Isolation benefits**:
**Typical workflow**: 1. Feature developed in worktree (via `/auto-implement`) 2. Review changes (`/worktree --review my-feature`) 3. Approve to merge (or reject to iterate) 4. Discard worktree after merge (`/worktree --discard my-feature`)
---
Shows all active worktrees with status indicators.
**What it does**:
**When to use**:
**Example**:
/worktree /worktree --list
**Output**:
Feature Branch Status ------------------------------------------------------------ feature-auth feature/feature-auth clean feature-logging feature/feature-logging dirty hotfix-123 hotfix/hotfix-123 active
**Status indicators**:
---
Shows detailed information for a specific worktree.
**What it does**:
**When to use**:
**Example**:
/worktree --status feature-auth
**Output**:
Worktree Status: feature-auth ============================================================ Path: /Users/dev/project/.worktrees/feature-auth Branch: feature/feature-auth Status: dirty Target Branch: master Commits Ahead: 5 Commits Behind: 2 Uncommitted Changes (3 files): - auth/models.py - auth/tests.py - README.md
**Understanding output**:
---
Interactive diff review with approve/reject workflow.
**What it does**: 1. Shows full git diff against target branch 2. Prompts for approval (approve/reject) 3. If approved → automatically merges to target branch 4. If rejected → exits without merging
**When to use**:
**Example**:
/worktree --review feature-auth
**Output**:
Diff for worktree: feature-auth
============================================================
diff --git a/auth/models.py b/auth/models.py
index 1234567..89abcde 100644
--- a/auth/models.py
+++ b/auth/models.py
@@ -10,6 +10,12 @@ class User(Model):
email = CharField()
+ def authenticate(self, password):
+ """Authenticate user with password."""
+ return check_password(password, self.password_hash)
+
[... more diff output ...]
============================================================
Approve or reject changes? [approve/reject]: approve
✓ Successfully merged 12 files**Interactive prompts**:
---
Directly merge worktree to target branch without review.
**What it does**:
**When to use**:
**Example**:
/worktree --merge feature-auth
**Success output**:
✓ Successfully merged 12 files Merged files: - auth/models.py - au
A harness that wraps Claude Code with enforcement, specialist agents, and alignment gates to deliver consistent, production-grade software engineering outcomes.
Repo: akaszubski/autonomous-dev
Critical thinking analysis - validates alignment, challenges assumptions, identifies risks
Comprehensive quality audit - code quality, documentation, coverage, security
Autonomous experiment loop — hypothesize, modify, benchmark, commit or revert
Create GitHub issue with automated research (--quick for fast mode)
Autonomous queue drainer — picks the top /triage cluster, applies safety gates, drains via /implement --issues, pushes, deploys.