13 KiB
Spectacular Commands
Spec-anchored development workflow with automatic sequential/parallel orchestration using superpowers skills and git-spice.
Workflow
Initialize → Specify → Plan → Execute
# 0. First time? Initialize your environment
/spectacular:init
# 1. Generate comprehensive spec from requirements (generates runId: a1b2c3)
/spectacular:spec "magic link authentication with Auth.js"
# 2. Decompose into execution plan with automatic phase analysis
/spectacular:plan @specs/a1b2c3-magic-link-auth/spec.md
# 3. Execute with automatic sequential/parallel orchestration
/spectacular:execute @specs/a1b2c3-magic-link-auth/plan.md
Key Innovation: Automatic parallelization based on file dependency analysis. You don't choose - Claude analyzes and orchestrates.
Commands
/spectacular:init
Purpose: Initialize spectacular environment and validate dependencies.
Checks:
- Superpowers plugin installed
- Git-spice installed and configured
- Gitignore configured for .worktrees/
- Git repository initialized
- Project structure (specs/ directory)
Actions:
- Installs missing .gitignore entries
- Creates specs/ directory if needed
- Reports missing dependencies with install instructions
Example:
/spectacular:init
First-time setup:
✅ Environment ready for spectacular workflows!
Next steps:
1. Generate a spec: /spectacular:spec "your feature description"
2. Create a plan: /spectacular:plan @specs/{run-id}-{feature-slug}/spec.md
3. Execute: /spectacular:execute @specs/{run-id}-{feature-slug}/plan.md
/spectacular:spec {description}
Purpose: Generate a complete feature specification from a brief description.
Uses:
brainstormingskill to refine requirements- Task tool to analyze codebase context
- Outputs comprehensive spec with task breakdown
Output: specs/{run-id}-{feature-slug}/spec.md
Example:
/spectacular:spec "user picks wizard with category navigation"
# Generates: specs/d4e5f6-user-picks-wizard/spec.md
What it generates:
- Requirements (functional + non-functional)
- Architecture (models, services, actions, UI)
- Implementation tasks with file paths
- Acceptance criteria per task
- Mandatory pattern reminders (next-safe-action, ts-pattern)
/spectacular:plan {spec-path}
Purpose: Decompose spec into executable plan with automatic phase analysis.
Uses:
decomposing-tasksskill (custom spectacular skill)- Analyzes file dependencies between tasks
- Groups into sequential/parallel phases
- Validates task quality (no XL, explicit files, criteria)
Output: {spec-directory}/plan.md
Example:
/spectacular:plan @specs/a1b2c3-magic-link-auth/spec.md
What it generates:
- Phase grouping with strategies (sequential/parallel)
- Task dependencies based on file analysis
- Execution time estimates with parallelization savings
- Complete implementation details per task
Automatic decisions:
- Sequential phase: Tasks share files or have dependencies
- Parallel phase: Tasks are independent, can run simultaneously
Quality validation:
- ❌ XL tasks (>8h) → Must split
- ❌ Missing files → Must specify
- ❌ Missing criteria → Must add 3-5
- ❌ Wildcard patterns → Must be explicit
/spectacular:execute {plan-path}
Purpose: Execute plan with automatic sequential/parallel orchestration.
Uses:
executing-sequential-phaseskill for sequential phase orchestrationexecuting-parallel-phaseskill for parallel phase orchestrationphase-task-verificationskill for shared branch creation/verification- Fresh subagent per task with code review gates
- Git worktrees for parallel execution
finishing-a-development-branchskill for completion- Git-spice for branch management
Flow:
- Extract run ID from plan path
- For each phase:
- Sequential:
executing-sequential-phaseorchestrates tasks in shared worktree - Parallel:
executing-parallel-phasecreates worktrees, spawns agents concurrently
- Sequential:
- Complete with
finishing-a-development-branchskill
Example:
/spectacular:execute @specs/a1b2c3-magic-link-auth/plan.md
Sequential phase execution:
Phase 1 (sequential):
Task 1 → fresh subagent → code review → commit
Task 2 → fresh subagent → code review → commit
Task 3 → fresh subagent → code review → commit
Parallel phase execution:
Phase 2 (parallel):
Worktree A: Task 4 → fresh subagent → code review → commit
Worktree B: Task 5 → fresh subagent → code review → commit
Worktree C: Task 6 → fresh subagent → code review → commit
↓
Merge all → feature branch → cleanup worktrees
Quality Gates (every task):
- Code review after each task
- Biome linting
- Tests pass
- Frequent commits
Mandatory Patterns
All commands enforce these patterns from the constitution (see @docs/constitutions/current/patterns.md):
1. next-safe-action for ALL server actions
// ✅ REQUIRED
export const submitPickAction = authenticatedAction
.schema(pickSchema)
.action(async ({ parsedInput, ctx }) => {
return pickService.submitPick(ctx.userId, parsedInput);
});
// ❌ FORBIDDEN
export async function submitPick(data: unknown) {
// Raw server action
}
2. ts-pattern for ALL discriminated unions
// ✅ REQUIRED
return match(event.status)
.with("SETUP", () => false)
.with("OPEN", () => true)
.with("LIVE", () => false)
.with("COMPLETED", () => false)
.exhaustive(); // Compiler enforces completeness!
// ❌ FORBIDDEN
switch (event.status) {
case "SETUP":
return false;
case "OPEN":
return true;
// Missing cases - no error!
}
3. Layer Boundaries
UI Components (src/components/)
↓ calls
Server Actions (src/lib/actions/) - next-safe-action only
↓ calls
Services (src/lib/services/) - business logic, no Prisma
↓ calls
Models (src/lib/models/) - Prisma only, no business logic
Rules:
- ✅ Actions call services
- ✅ Services call models
- ✅ Models use Prisma
- ❌ Services cannot import Prisma
- ❌ Actions cannot call models directly
Tech Stack Reference
- Framework: Next.js 15 (App Router + Turbopack)
- Language: TypeScript (strict mode)
- Database: Prisma + PostgreSQL
- Auth: Auth.js v5 (magic links)
- Real-time: Socket.io
- Validation: Zod + next-safe-action
- Pattern Matching: ts-pattern
- Linting: Biome
- VCS: Git + git-spice
Skills Used
Spectacular Skills
executing-sequential-phase- Orchestrates sequential phase execution with natural stackingexecuting-parallel-phase- Orchestrates parallel phase execution with worktree isolationphase-task-verification- Shared branch creation and verification logicdecomposing-tasks- Analyzes dependencies and groups into phaseswriting-specs- Generates lean feature specificationsvalidating-setup-commands- Validates CLAUDE.md setup commandsunderstanding-cross-phase-stacking- Explains base branch inheritanceusing-git-spice- Git-spice command reference and patternstroubleshooting-execute- Error recovery for execution failures
Superpowers Skills
brainstorming- Refines requirements before spec generationrequesting-code-review- Dispatches code review after each phaseverification-before-completion- Evidence-based completion verificationfinishing-a-development-branch- Completes work and chooses next action
Architecture: Orchestrator skills manage workflow lifecycle and dispatch Task tool with embedded execution instructions. Subagents receive focused ~150-line instructions (80% cognitive load reduction vs original 750-line monolithic skills).
Examples
Example 1: Single Feature (Sequential)
# Initialize (first time only)
/spectacular:init
# Generate spec
/spectacular:spec "leaderboard with real-time updates via Socket.io"
# Review: specs/a1b2c3-leaderboard/spec.md
# Generate plan with phase analysis
/spectacular:plan @specs/a1b2c3-leaderboard/spec.md
# Review: specs/a1b2c3-leaderboard/plan.md
# Plan shows: 3 phases, all sequential (tasks share files)
# Execute
/spectacular:execute @specs/a1b2c3-leaderboard/plan.md
# Result: Sequential execution, no parallelization
Example 2: Feature with Parallel Opportunities
# Generate spec
/spectacular:spec "user authentication with magic links"
# Generate plan
/spectacular:plan @specs/a1b2c3-auth/spec.md
# Review plan:
# - Phase 1 (sequential): Database + Models (share files)
# - Phase 2 (parallel): Magic link service + Email service (independent)
# - Phase 3 (sequential): Actions + UI (depend on Phase 2)
# Execute
/spectacular:execute @specs/a1b2c3-auth/plan.md
# Result:
# - Phase 1: Sequential execution
# - Phase 2: Parallel execution (significant time savings)
# - Phase 3: Sequential execution
# Overall: Faster than fully sequential execution
Example 3: Large Feature Auto-Decomposed
# Generate spec for complex feature
/spectacular:spec "admin category management with drag-reorder and live preview"
# Generate plan
/spectacular:plan @specs/a1b2c3-admin-categories/spec.md
# Plan auto-detects:
# - Phase 1 (sequential): 3 tasks - Database schema + models
# - Phase 2 (parallel): 4 tasks - Services (independent domains)
# - Phase 3 (sequential): 2 tasks - Admin actions
# - Phase 4 (parallel): 3 tasks - UI components (independent pages)
# - Phase 5 (sequential): 1 task - Integration + E2E tests
# Multiple parallel phases provide significant time savings
# Execute automatically orchestrates all phases
/spectacular:execute @specs/a1b2c3-admin-categories/plan.md
Troubleshooting
"Superpowers plugin not installed"
Cause: The superpowers plugin is required but not installed.
Fix:
/plugin install superpowers@superpowers-marketplace
Then restart Claude Code and run /spectacular:init again.
"Git-spice not installed"
Cause: Git-spice is required for stacked branch management.
Fix:
# macOS
brew install git-spice
# Linux
# See https://github.com/abhinav/git-spice for install instructions
Then run /spectacular:init again.
"Plan validation failed"
Cause: Spec has quality issues (XL tasks, missing files, missing criteria).
Fix:
- Review validation errors
- Update spec at the indicated locations
- Re-run
/spectacular:plan @spec-path
"Parallel phase failed - one agent blocked"
Cause: One task in parallel phase hit an issue.
Fix:
- Other tasks already completed and merged
- Fix failing task in its worktree:
cd {worktree-path} - Debug and commit fix
- Merge manually:
git merge {task-branch} - Cleanup worktree:
git worktree remove {path}
"Merge conflict in parallel phase"
Cause: Tasks marked as independent actually modified same files.
Fix:
- This indicates incorrect dependency analysis
- Resolve conflict manually
- Update plan to mark tasks as sequential
- Report issue so task-decomposition skill can be improved
"Tests failing after execution"
Cause: Implementation has bugs.
Fix: Code review runs after each phase, but bugs can slip through.
- Review test failures
- Use
systematic-debuggingskill to investigate - Fix issues
- Commit fixes
Design Philosophy
Spec-Anchored Development:
- Comprehensive specs eliminate questions during implementation
- Mandatory patterns ensure consistency
- Layer boundaries prevent architectural drift
- Quality gates catch issues early
Automatic Orchestration:
- Dependency analysis determines sequential vs parallel
- No manual decision needed - Claude optimizes
- Worktrees provide true isolation for parallel work
- Git-spice manages branch stacking
Task-Level Autonomy:
- Fresh subagent per task (no context pollution)
- Code review after each task (catch issues early)
- Continuous commits (small, focused changes)
- Quality gates every step
Time Optimization:
- Automatic parallelization where safe
- Time savings scale with feature size and parallelization opportunities
- No coordination overhead (worktrees isolate)
- Transparent - see exactly what's parallel vs sequential
Performance Benefits
Without this workflow:
- Manual dependency tracking
- Conservative sequential execution
- No automatic parallelization
With this workflow:
- Automatic dependency analysis
- Optimal parallel/sequential orchestration
- Worktree isolation (no conflicts)
- Time savings scale with feature complexity and number of independent tasks