Use before starting any new phase - explains how sequential and parallel phases automatically chain together through base branch inheritance (main worktree tracks progress, parallel phases inherit from current branch, no manual intervention needed)
Explains how sequential and parallel phases automatically chain together through base branch inheritance. Use this reference skill when starting any new phase to understand that main worktree tracks progress and parallel phases inherit from the current branch, not the original base.
/plugin marketplace add arittr/spectacular/plugin install spectacular@spectacularThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Phases automatically build on each other's completed work. Understanding how phases chain together is essential for correct execution.
This is a reference skill - read it to understand cross-phase dependencies, not to execute a workflow.
Use this skill when:
Mental model check: If you're thinking "create worktrees from {runid}-main branch", you need this skill.
MAIN WORKTREE CURRENT BRANCH = LATEST COMPLETED WORK
Key insight:
This creates automatic linear chaining across all phases.
# Working in: .worktrees/{runid}-main
# Starting from: {runid}-main (base branch)
# Task 1: Database schema
gs branch create {runid}-task-1-1-database-schema
# Creates branch, commits work
# Main worktree now on: {runid}-task-1-1-database-schema ← KEY STATE
Phase 1 result:
{runid}-task-1-1-database-schema{runid}-task-1-1-database-schema# Base detection (CRITICAL):
BASE_BRANCH=$(git -C .worktrees/{runid}-main branch --show-current)
# Returns: {runid}-task-1-1-database-schema ← Inherits from Phase 1
# Create parallel worktrees FROM Phase 1's completed branch
git worktree add .worktrees/{runid}-task-2-1 --detach "$BASE_BRANCH"
git worktree add .worktrees/{runid}-task-2-2 --detach "$BASE_BRANCH"
git worktree add .worktrees/{runid}-task-2-3 --detach "$BASE_BRANCH"
# All 3 parallel tasks build on Phase 1's database schema
After parallel tasks complete and stack:
# In main worktree (.worktrees/{runid}-main):
# Branch 1: {runid}-task-2-1-user-service → tracked
# Branch 2: {runid}-task-2-2-product-service → tracked, upstacked onto Branch 1
# Branch 3: {runid}-task-2-3-order-service → tracked, upstacked onto Branch 2
# Main worktree now on: {runid}-task-2-3-order-service ← KEY STATE
Phase 2 result:
{runid}-task-2-3-order-service# Working in: .worktrees/{runid}-main (reused from Phase 1)
# Current branch: {runid}-task-2-3-order-service (from Phase 2)
# Task 1: Integration tests
gs branch create {runid}-task-3-1-integration-tests
# Automatically stacks on Phase 2's last task via natural stacking
Phase 3 result:
Before starting parallel phase (check inheritance):
# Verify base branch before creating worktrees
BASE_BRANCH=$(git -C .worktrees/{runid}-main branch --show-current)
echo "Starting parallel phase from: $BASE_BRANCH"
# Should show previous phase's completed branch, NOT {runid}-main
Before starting sequential phase (check current state):
# Verify starting point
CURRENT_BRANCH=$(git -C .worktrees/{runid}-main branch --show-current)
echo "Starting sequential phase from: $CURRENT_BRANCH"
# Should show previous phase's last stacked branch
After phase completes (verify stack):
cd .worktrees/{runid}-main
gs log short
# Should show linear chain including all previous phases
Main worktree tracks progress
Parallel phases inherit from current
git -C .worktrees/{runid}-main branch --show-current as base{runid}-main (that's the original starting point)Parallel stacking preserves continuity
Sequential phases extend naturally
gs branch create stacks on current HEADNo manual intervention needed
# DON'T DO THIS:
git worktree add .worktrees/{runid}-task-2-1 --detach {runid}-main
Why wrong: Ignores Phase 1's completed work. Phase 2 won't have database schema from Phase 1.
Result: Broken dependency chain. Phase 2 builds on stale base instead of Phase 1's changes.
# DO THIS:
BASE_BRANCH=$(git -C .worktrees/{runid}-main branch --show-current)
git worktree add .worktrees/{runid}-task-2-1 --detach "$BASE_BRANCH"
Why correct: Inherits all previous work. Phase 2 builds on Phase 1's completed branch.
Result: Linear chain across all phases.
If you're thinking:
{runid}-main" → WRONG. Use current branch.Correct mental model:
Starting parallel phase:
BASE_BRANCH=$(git -C .worktrees/{runid}-main branch --show-current)
# Use $BASE_BRANCH for all worktree creation
Starting sequential phase:
# Already on correct branch - just create next branch
gs branch create {runid}-task-{phase}-{task}-{name}
# Automatically stacks on current HEAD
Verifying cross-phase chain:
cd .worktrees/{runid}-main
gs log short
# Should show linear progression through all phases
Phases chain automatically through main worktree's current branch.
If you're manually specifying base branches or creating worktrees from {runid}-main, you're breaking the automatic inheritance system.
Trust the pattern: main worktree tracks progress, new phases build from current state.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.