finish-worktreelisted
Install: claude install-skill dravr-ai/dravr-embacle
# Finish Worktree Skill
**CLAUDE: When this skill is invoked with `/finish-worktree`, immediately run:**
```bash
./.claude/skills/finish-worktree/finish-worktree.sh
```
**Then guide the user through CI monitoring and merge-and-cleanup.**
## Purpose
Completes feature branch work with proper rebase, CI validation, and squash merge back to main.
## Usage
```bash
/finish-worktree
```
## Workflow Steps
### Step 1: Rebase onto main
```bash
./.claude/skills/finish-worktree/finish-worktree.sh
```
This script:
1. Fetches latest from origin/main
2. Rebases your branch onto main
3. Runs local validation (fmt, architectural, clippy)
4. Pushes with `--force-with-lease`
### Step 2: Monitor CI
Use the first available method (**never ask for a GitHub token**):
1. `gh run list --branch <branch>` / `gh run watch` — if gh CLI is authenticated
2. GitHub MCP tools (`mcp__github__*`) — if MCP server is configured
3. WebFetch `https://github.com/dravr-ai/dravr-platform/actions` — always available
Wait for all checks to pass (green).
### Step 3: If CI Fails
Fix the issues locally, then:
```bash
# Make fixes
cargo fmt
cargo clippy --all-targets -- -D warnings -D clippy::all -D clippy::pedantic -D clippy::nursery
# Amend or add commit
git add .
git commit --amend --no-edit # or new commit
# Push again
git push --force-with-lease origin <branch-name>
```
Repeat until CI is green.
### Step 4: Squash Merge and Cleanup
Once CI is green, run from the **main worktree**:
```bash
cd /path/to/mai