Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion plugin/skills/implement/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,31 @@ Load plan, dispatch subagents per task in wave order, verify completion.
- **Session metadata is the source of truth** — the session-start hook injects a metadata block with `epic-id`, `epic-slug`, `feature-id`, `feature-name`, `feature-slug`, parent artifacts, and `output-target`. Use these values verbatim — do NOT re-derive, re-extract, or generate alternatives.
- **Wave ordering drives sequencing** — foundation before consumers; parallel-safe waves dispatch all tasks concurrently; reviews run sequentially after all implementations complete
- **Model escalation** — start cheap (haiku), escalate on failure (sonnet, then opus). See Reference > Model Escalation.
- **Working directory isolation** — the CLI provides the working directory; skills don't manage worktrees; each phase commits to the feature branch at checkpoint; merge happens only at /release
- **Working directory isolation** — `/implement` always creates a dedicated git worktree so the main repo stays clean on its current branch and multiple features can run in parallel. The worktree persists until `/release` completes the squash-merge.
- **Subagent safety** — one agent per task; parallel-safe waves dispatch all tasks simultaneously, non-parallel-safe waves dispatch sequentially; agents commit per task via `git add <files>` + `git commit`; agents must NOT read the plan file, modify files outside their task's file list, or push/switch branches

## Phase 0: Worktree Setup

Before dispatching the taskplanner, ensure work happens in an isolated worktree.

### 0a. Check for existing worktree

```bash
git worktree list
```

If `.claude/worktrees/<epic-slug>` already appears (interrupted prior session), use `EnterWorktree` with `path: ".claude/worktrees/<epic-slug>"` to re-enter it, then skip to Phase 1.

### 0b. Create worktree (first run)

```bash
git worktree add .claude/worktrees/<epic-slug> -b feat/<epic-slug>
```

Then use `EnterWorktree` with `path: ".claude/worktrees/<epic-slug>"` to switch the session into it.

All subsequent work (taskplanner, implementers, reviewers, commits, tests) runs inside this worktree. The main repo working directory is never touched.

## Phase 1: Execute

Dispatch taskplanner, loop over waves dispatching implementers and reviewers.
Expand Down
25 changes: 23 additions & 2 deletions plugin/skills/release/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@ No release without passing validation.
- **Bump type auto-detected, not user-prompted** — commit message conventions determine major/minor/patch automatically
- **Warn-and-continue for non-blocking failures** — report problems, attempt fixes, only hard-stop on critical validation failures

## Phase 0: Pre-Execute

### 0. Enter Worktree

Release must run inside the implement worktree so that release-notes generation, the retro context walker, and the feature-branch checkpoint commit all operate on the feature branch's state. The squash-merge in Phase 3 still happens from the main repo via explicit `cd "$main_repo"`; this Phase 0 step only governs the parent skill's cwd and the cwd that subagents (notably the retro) inherit.

```bash
git worktree list
```

If already inside `.claude/worktrees/<epic-slug>` (current directory matches): skip to Phase 1.

If at repo root, look for `.claude/worktrees/<epic-slug>` in the worktree list. If found, use `EnterWorktree` with `path: ".claude/worktrees/<epic-slug>"` to switch into it.

If no matching worktree exists, STOP:

```
BLOCKED — no worktree found for <epic-slug>.
Run /beastmode:implement and /beastmode:validate first, then retry.
```

## Phase 1: Execute

### 1. Stage Uncommitted Changes
Expand Down Expand Up @@ -136,8 +157,6 @@ Run a context reconciliation pass across all phase artifacts before releasing.

4. **Apply BEASTMODE.md Updates** — If no L0 changes proposed, skip this step. Apply L0 changes and log.

> **TRANSITION BOUNDARY — Steps below operate from main repo, NOT the feature branch working directory.**

### 2. Commit to Feature Branch

Before merging to main, commit all release artifacts to the feature branch:
Expand All @@ -147,6 +166,8 @@ git add -A
git commit -m "release(<epic-name>): checkpoint"
```

> **TRANSITION BOUNDARY — Steps below operate from main repo, NOT the feature branch working directory.**

### 3. Squash Merge to Main

```bash
Expand Down
19 changes: 19 additions & 0 deletions plugin/skills/validate/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@ No release without passing validation.

## Phase 0: Pre-Execute

### 0. Enter Worktree

Validate must run inside the implement worktree where the feature code lives.

```bash
git worktree list
```

If already inside `.claude/worktrees/<epic-slug>` (current directory matches): skip to step 1.

If at repo root, look for `.claude/worktrees/<epic-slug>` in the worktree list. If found, use `EnterWorktree` with `path: ".claude/worktrees/<epic-slug>"` to switch into it.

If no matching worktree exists, STOP:

```
BLOCKED — no worktree found for <epic-slug>.
Run /beastmode:implement first to create the worktree and build the feature.
```

### 1. Check Feature Completion

Scan for implementation artifacts to verify all features have been implemented:
Expand Down