/dev — Spec-Driven Development Workflow
Full development workflow for implementing features or changes with a structured approach.
Phases
Phase 1: Understand
Before writing any code:
- •Read the spec/request — Understand exactly what's being asked. Ask clarifying questions if anything is ambiguous.
- •Auto-explore the codebase — Launch the
explore-codebaseagent to map the relevant parts of the codebase. Focus on:- •Project structure and file organization
- •Existing patterns for similar features
- •Database schema (use
explore-dbagent if DB changes needed) - •Current auth/subscription patterns
- •Check existing implementations — Look for similar features already implemented to follow established patterns.
- •Identify dependencies — Determine what libraries, APIs, or database changes are needed.
Context checkpoint: After exploration, summarize your understanding:
code
## Context Summary - **Goal:** [what we're building] - **Key files:** [files to create/modify] - **Patterns to follow:** [existing patterns discovered] - **Dependencies:** [libraries/APIs/DB changes needed] - **Open questions:** [anything unclear]
Phase 2: Plan
- •Break down the work — List the specific files to create or modify.
- •Define the approach — For each file, describe what changes are needed and why.
- •Identify risks — Note potential issues, edge cases, or breaking changes.
- •Present the plan — Share the plan with the user for approval before implementing.
Use ultrathink for complex phases that involve architectural decisions or multi-system coordination.
Phase 3: Implement
Use ultrathink for complex phases that involve architectural decisions or multi-system coordination.
Implementation Order
Backend-first (recommended for most features):
- •Database — Migrations, new tables, column changes (
/db-migrationpatterns) - •RLS policies — Security policies for new/modified tables
- •Types — Generate or update TypeScript types (
supabase gen types) - •Server Actions / API routes — Backend logic, mutations, data fetching
- •Edge Functions — If needed (stripe-sync-engine, custom webhooks)
- •UI components — Pages, layouts, client components
- •Integration — Wire everything together, test flows
Frontend-first (for UI-heavy features with existing backend):
- •Types — Define expected data shapes
- •Hooks — Data fetching and state management
- •Components — UI building blocks
- •Pages — Route pages and layouts
- •Backend — Server Actions to support the UI
- •Database — Migrations if new data storage is needed
For each step:
- •Follow existing patterns in the project
- •Handle errors at system boundaries
- •Keep it minimal — only implement what was requested
- •If implementing auth flows, cross-reference
/authskill patterns - •If implementing Stripe billing, cross-reference
/stripe-setupskill patterns
Phase 4: Verify
- •Type check — Run the TypeScript compiler to catch type errors.
- •Lint — Run the linter if configured.
- •Test — Run existing tests to ensure nothing is broken. Write new tests if the project has a test suite.
- •Manual check — Review the changes yourself for obvious issues.
Rules
- •Always read files before modifying them
- •Prefer editing existing files over creating new ones
- •Follow the project's established patterns and conventions
- •Ask before making architectural decisions
- •Don't over-engineer — keep it simple