This document explains the “why” behind the workspace-per-work-package model. For step-by-step instructions, see the how-to guides. For an introduction, see the tutorials.
Spec Kitty 0.11.0 introduces the workspace-per-work-package model to enable parallel multi-agent development. Instead of creating one worktree per feature where all work packages share the same workspace, each work package now gets its own isolated worktree.
Key Change: One git worktree per work package (instead of one per feature)
For background on how git worktrees work, see Git Worktrees Explained.
Recommended: Install jj for the best multi-agent experience. See Jujutsu Workflow Tutorial.
# Planning creates worktree immediately
/spec-kitty.specify "My Feature"
→ Creates .worktrees/010-my-feature/
→ All WPs work in same worktree
→ Sequential development (one agent at a time)
# Implementation happens in shared worktree
cd .worktrees/010-my-feature/
/spec-kitty.implement # Agent implements all WPs here
Limitations:
# Planning happens in main repository (NO worktree created)
/spec-kitty.specify "My Feature"
→ Creates kitty-specs/010-my-feature/spec.md in main
→ Commits to main
→ NO worktree created
/spec-kitty.plan
→ Creates plan.md in main
→ Commits to main
/spec-kitty.tasks
→ LLM creates tasks.md + tasks/WP01.md, tasks/WP02.md, ... in main
spec-kitty agent feature finalize-tasks
→ Parses dependencies from tasks.md
→ Generates dependency graph in WP frontmatter
→ Validates dependencies (cycle detection)
→ Commits all to main
# Implementation creates worktrees on-demand (one per WP)
spec-kitty implement WP01
→ Creates .worktrees/010-my-feature-WP01/
→ Branches from main
→ Agent A implements WP01
spec-kitty implement WP02 --base WP01
→ Creates .worktrees/010-my-feature-WP02/
→ Branches from WP01's branch
→ Agent B implements WP02 (in parallel!)
spec-kitty implement WP03
→ Creates .worktrees/010-my-feature-WP03/
→ Branches from main (independent WP)
→ Agent C implements WP03 (also in parallel!)
Benefits:
All planning commands run in your main repository. No worktrees are created during planning.
1. Specify the feature
/spec-kitty.specify "Add user authentication system"
Creates:
kitty-specs/011-user-authentication-system/spec.md (committed to main)2. Plan the implementation
/spec-kitty.plan
Creates:
kitty-specs/011-user-authentication-system/plan.md (committed to main)3. Generate work packages
/spec-kitty.tasks
LLM creates tasks.md and WP files:
kitty-specs/011-user-authentication-system/tasks.mdkitty-specs/011-user-authentication-system/tasks/WP01-database-schema.mdkitty-specs/011-user-authentication-system/tasks/WP02-api-endpoints.mdkitty-specs/011-user-authentication-system/tasks/WP03-frontend-components.md4. Finalize and commit tasks
spec-kitty agent feature finalize-tasks
dependencies: [] fieldEach WP file then includes dependency information in frontmatter:
---
work_package_id: "WP02"
title: "API Endpoints"
dependencies: ["WP01"] # WP02 depends on WP01
lane: "planned"
---
Now agents create worktrees on-demand for each WP they implement.
1. Implement WP01 (foundation)
spec-kitty implement WP01
Creates:
.worktrees/011-user-authentication-system-WP01/011-user-authentication-system-WP01 (from main)Agent A works in this worktree, commits to the WP01 branch.
2. Implement WP02 (depends on WP01)
spec-kitty implement WP02 --base WP01
Creates:
.worktrees/011-user-authentication-system-WP02/011-user-authentication-system-WP02 (from WP01’s branch)Agent B works here in parallel with Agent A (different worktrees).
3. Implement WP03 (independent)
spec-kitty implement WP03
Creates:
.worktrees/011-user-authentication-system-WP03/011-user-authentication-system-WP03 (from main)Agent C works here in parallel with A and B.
1. Review completed WPs
/spec-kitty.review WP01
Moves WP01 from doing → for_review lane. If WP02 depends on WP01, displays warning:
⚠️ WP02 depends on WP01
If review feedback requires changes, WP02 will need rebase
2. Merge completed WPs
# Run from any WP worktree for the feature
cd .worktrees/011-user-authentication-system-WP01/
spec-kitty merge
Merges all completed WP branches to main, removes worktrees.
Dependencies are declared in each WP’s frontmatter using YAML list syntax:
---
work_package_id: "WP02"
title: "Build API"
dependencies: ["WP01"] # This WP depends on WP01
---
dependencies: ["WP01", "WP03"] # Depends on both WP01 and WP03
Git limitation: Git can only branch from ONE base commit. If a WP has multiple dependencies, use --base for the primary dependency and manually merge the others.
spec-kitty implement WP04 --base WP02 # Branches from WP02
cd .worktrees/011-feature-WP04/
git merge 011-feature-WP03 # Manually merge WP03
dependencies: [] # Independent WP, branches from main
At implementation time:
spec-kitty implement WP02 --base WP01 creates workspace branching from WP01’s branchDuring review cycles:
Dependencies are validated during spec-kitty agent feature finalize-tasks:
Invalid dependency examples:
dependencies: ["WP1"] # Invalid: must be WP##
dependencies: ["WP99"] # Invalid: WP99 doesn't exist
dependencies: ["WP02"] # Invalid in WP02.md (self-dependency)
Sequential work where each WP builds on the previous one.
WP01 → WP02 → WP03 → WP04
Example: Authentication feature
Implementation:
spec-kitty implement WP01
spec-kitty implement WP02 --base WP01
spec-kitty implement WP03 --base WP02
spec-kitty implement WP04 --base WP03
Parallelization: Limited (each WP must wait for previous one to complete)
One foundation WP with multiple independent WPs building on it.
WP01
/ | \
WP02 WP03 WP04
Example: E-commerce platform
Implementation:
spec-kitty implement WP01
# After WP01 completes, run in parallel:
spec-kitty implement WP02 --base WP01 # Agent A
spec-kitty implement WP03 --base WP01 # Agent B
spec-kitty implement WP04 --base WP01 # Agent C
Parallelization: Excellent (3 agents work simultaneously after WP01 completes)
Converging dependencies where one WP depends on multiple upstream WPs.
WP01
/ \
WP02 WP03
\ /
WP04
Example: Integration layer
Implementation:
spec-kitty implement WP01
# Parallel:
spec-kitty implement WP02 --base WP01
spec-kitty implement WP03 --base WP01
# After both WP02 and WP03 complete:
spec-kitty implement WP04 --base WP03
cd .worktrees/###-feature-WP04/
git merge ###-feature-WP02 # Manually merge second dependency
Frontmatter:
# WP04.md
dependencies: ["WP02", "WP03"]
Note: Git limitation requires manual merge of second dependency. With jj, this is handled automatically via auto-rebase. See Jujutsu for Multi-Agent Development.
Multiple WPs with no dependencies (fully parallel).
WP01 WP02 WP03 WP04
Example: Documentation updates
Implementation:
# All run in parallel from main:
spec-kitty implement WP01 # Agent A
spec-kitty implement WP02 # Agent B
spec-kitty implement WP03 # Agent C
spec-kitty implement WP04 # Agent D
Parallelization: Maximum (4 agents work simultaneously)
Let’s walk through a real example using this workspace-per-WP model.
Goal: Add OAuth login to an existing application.
Planning Phase:
/spec-kitty.specify "OAuth Integration for User Login"
/spec-kitty.plan
/spec-kitty.tasks
Generated WPs with dependencies:
dependencies: []dependencies: [] (independent of WP01)dependencies: ["WP01", "WP02"] (needs both database and config)dependencies: ["WP03"] (needs backend flow first)dependencies: ["WP04"] (needs everything)Implementation Phase:
# Wave 1: Foundation (parallel)
spec-kitty implement WP01 # Agent A: Database
spec-kitty implement WP02 # Agent B: Config
# Both agents work in parallel
# Wave 2: Backend (waits for Wave 1)
# After WP01 and WP02 complete:
spec-kitty implement WP03 --base WP02
cd .worktrees/012-oauth-integration-WP03/
git merge 012-oauth-integration-WP01 # Merge second dependency
# Agent C implements backend flow
# Wave 3: Frontend (waits for Wave 2)
spec-kitty implement WP04 --base WP03
# Agent D implements UI
# Wave 4: Tests (waits for Wave 3)
spec-kitty implement WP05 --base WP04
# Agent E writes tests
Timeline:
Symptom: During upgrade to 0.11.0:
❌ Cannot upgrade to 0.11.0
Legacy worktrees detected:
- 008-unified-python-cli
- 009-jujutsu-vcs
Cause: You have in-progress features using the old worktree model.
Solution:
# Option A: Complete the feature
spec-kitty merge 008-unified-python-cli
# Option B: Delete the feature
git worktree remove .worktrees/008-unified-python-cli
git branch -D 008-unified-python-cli
ls .worktrees/
# Should be empty or only show ###-feature-WP## patterns
pip install --upgrade spec-kitty-cli
Symptom: When implementing dependent WP:
❌ Base workspace WP01 does not exist
Implement WP01 first or remove --base flag
Cause: You’re trying to implement WP02 with --base WP01, but WP01’s worktree hasn’t been created yet.
Solution:
spec-kitty implement WP01
spec-kitty implement WP02 --base WP01
Symptom: During /spec-kitty.tasks generation:
❌ Circular dependency detected:
WP01 → WP02 → WP03 → WP01
Cause: Your dependency declarations create a cycle (WP01 depends on WP03, which depends on WP02, which depends on WP01).
Solution:
/spec-kitty.tasksValid restructuring:
Before (invalid):
WP01 → WP02 → WP03 → WP01 ❌
After (valid):
WP01 → WP02 → WP03 ✅
Symptom: During review:
⚠️ WP02, WP03 depend on WP01
If review feedback requires changes, they'll need rebase
Cause: WP02 and WP03 are built on WP01’s branch. If WP01 changes during review, downstream WPs need updating.
Solution:
# Update WP02 to include WP01 changes
cd .worktrees/###-feature-WP02/
git rebase ###-feature-WP01
# Update WP03 to include WP01 changes
cd .worktrees/###-feature-WP03/
git rebase ###-feature-WP01
Symptom: WP has multiple dependencies, but --base only accepts one.
Cause: Git branches from a single commit. If WP04 depends on WP02 and WP03, you must choose one as base.
Solution:
# Use primary dependency as base
spec-kitty implement WP04 --base WP03
# Manually merge secondary dependency
cd .worktrees/###-feature-WP04/
git merge ###-feature-WP02
Future: jj integration will automate multi-parent merging.
See Upgrading to 0.11.0 for detailed migration guide.
Quick checklist:
.worktrees/ is empty or only contains ###-feature-WP## patternspip install --upgrade spec-kitty-cli