Skip to content

tsungtwu/specdev-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Specdev Flow

Spec-driven development workflow for Claude Code that combines Brainstorming, OpenSpec, and Feature-Dev into a cohesive feature development lifecycle.

Overview

┌─────────────────────────────────────────────────────────────────────────────┐
│                           Specdev Flow                                       │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│   ┌──────────────┐    ┌──────────────┐    ┌──────────────┐                  │
│   │ Brainstorming │───▶│   OpenSpec   │───▶│  Feature-Dev │                  │
│   │    (Skill)    │    │    (CLI)     │    │   (Plugin)   │                  │
│   └──────────────┘    └──────────────┘    └──────────────┘                  │
│         │                    │                    │                          │
│         ▼                    ▼                    ▼                          │
│   Idea → Design       Spec Management      Codebase-Aware                   │
│   Exploration         Delta-based          Architecture                      │
│   YAGNI               Source of Truth      Implementation                    │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

Context Reset Flow

┌─────────────────────────────────────────────────────────────────────────────┐
│                         Context Management                                   │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│   DESIGN PHASES                    │           IMPLEMENT PHASES              │
│   (Phase 0-4)                      │           (Phase 5-8)                   │
│                                    │                                         │
│   ┌─────────────┐                  │                  ┌─────────────┐        │
│   │  Brainstorm │                  │                  │  Implement  │        │
│   │  Explore    │                  │                  │  Review     │        │
│   │  Architect  │                  │                  │  Archive    │        │
│   └──────┬──────┘                  │                  └──────▲──────┘        │
│          │                         │                         │               │
│          ▼                         │                         │               │
│   ┌─────────────┐    Phase 4.5     │     Fresh Context       │               │
│   │/save-context│ ════════════════►│═══════════════════════► │               │
│   └─────────────┘                  │                         │               │
│          │                         │                  ┌──────┴──────┐        │
│          ▼                         │                  │/load-context│        │
│   ┌─────────────┐                  │                  └─────────────┘        │
│   │   /clear    │                  │                         ▲               │
│   │  (manual)   │─────────────────────────────────────────────               │
│   └─────────────┘                  │                                         │
│                                    │                                         │
└─────────────────────────────────────────────────────────────────────────────┘

Context saved to: ~/Documents/workspace/cc-shared/{repo}/CONTEXT-{name}.md

Implementation Review Loop

┌─────────────────────────────────────────────────────────────────────────────┐
│                    Implementation & Review Loop (Phase 5-6)                  │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│    ┌───────────────────────────────────────────────────────────────────┐    │
│    │                                                                   │    │
│    │   ┌──────────────┐    ┌──────────────┐    ┌──────────────┐       │    │
│    │   │   Implement  │───▶│    Review    │───▶│     User     │       │    │
│    │   │   (Phase 5a) │    │  (Phase 5b)  │    │   Confirm    │       │    │
│    │   │              │    │              │    │  (Phase 5c)  │       │    │
│    │   │ - Read task  │    │ - 3 parallel │    │              │       │    │
│    │   │ - Code       │    │   reviewers  │    │ - Fix issues │       │    │
│    │   │ - Mark done  │    │ - Spec check │    │ - Continue   │       │    │
│    │   └──────────────┘    │ - Quality    │    │ - Archive    │       │    │
│    │          ▲            │ - Convention │    └───────┬──────┘       │    │
│    │          │            └──────────────┘            │              │    │
│    │          │                                        │              │    │
│    │          │     ┌────────────────────────┐         │              │    │
│    │          └─────│  More tasks remaining? │◄────────┘              │    │
│    │                │  Issues to fix?        │                        │    │
│    │                └────────────────────────┘                        │    │
│    │                                                                   │    │
│    └───────────────────────────────────────────────────────────────────┘    │
│                              │                                               │
│                              ▼ All tasks ✓ + User approved                   │
│                    ┌──────────────────────┐                                  │
│                    │  Pre-Archive (Ph 6)  │                                  │
│                    │  Archive (Ph 7)      │                                  │
│                    │  Summary (Ph 8)      │                                  │
│                    └──────────────────────┘                                  │
│                                                                              │
│   Exit Criteria:                                                             │
│   ✓ ALL tasks.md items checked off                                          │
│   ✓ No high-severity review issues                                          │
│   ✓ User explicitly approved                                                 │
│   ✓ Implementation matches all specs                                         │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

Workflow Phases

Phase Description Skill
0-4.5 Design - Prerequisites, Brainstorming, Proposal, Exploration, Architecture, Context Reset /specdev-design
5-6 Implement - Implementation & Review Loop /specdev-implement
6-8 Archive - Pre-Archive Verification, Archive, Documentation Update, Summary /specdev-archive

Phase Details

Phase 0   Prerequisites      openspec init --tools claude
Phase 1   Brainstorming      Idea → Design (one question at a time, 2-3 approaches)
Phase 2   Proposal           OpenSpec proposal.md, tasks.md, specs/
Phase 3   Exploration        Existing specs review + Feature-Dev Explorer
Phase 4   Architecture       Feature-Dev Architect (2-3 approaches)
Phase 4.5 Context Reset      /save-context → /clear → /load-context
Phase 5   Implementation     OpenSpec Apply + Code
Phase 5b  Review Loop        Feature-Dev Reviewer (iterate until done)
Phase 6   Pre-Archive        Verify all tasks complete
Phase 7   Archive            openspec archive <change-id>
Phase 7.5 Doc Update         README, CHANGELOG updates
Phase 8   Summary            Completion report

Components

Skills (included)

Skill Description
/specdev Full workflow orchestrator (Phase 0-8)
/specdev-design Design phases only (Phase 0-4.5)
/specdev-implement Implementation phases only (Phase 5-6)
/specdev-archive Archive phases only (Phase 6-8)
/brainstorming Collaborative idea exploration
/using-openspec OpenSpec quick reference guide
/save-context Save context before switching tasks
/load-context Load previously saved context

External Dependencies

OpenSpec CLI

Spec management CLI tool for delta-based specification tracking.

npm install -g openspec

Key commands:

openspec init --tools claude    # Initialize in project
openspec validate <id> --strict # Validate change
openspec archive <id> --yes     # Apply deltas to source specs

Feature-Dev Plugin

Codebase-aware development plugin with specialized agents.

Install via Claude Code:

/install-plugin feature-dev@claude-plugins-official

Agents:

  • feature-dev:code-explorer - Trace and understand existing code
  • feature-dev:code-architect - Design implementation approaches
  • feature-dev:code-reviewer - Review implementation quality

Installation

1. Install Skills

Option A: Use the install skill (recommended)

cd specdev-flow
claude
# Then run:
/install-specdev

Option B: Manual copy

cp -r skills/* ~/.claude/skills/

Option C: Manual symlink

for skill in skills/*/; do
  ln -sf "$(pwd)/$skill" ~/.claude/skills/
done

2. Install Dependencies

# OpenSpec CLI
npm install -g openspec

# Feature-Dev Plugin (in Claude Code)
/install-plugin feature-dev@claude-plugins-official

Usage

Full Workflow

/specdev implement user authentication with JWT

Partial Workflows

# Design only (stop before implementation)
/specdev-design add dark mode support

# Implementation only (after design is complete)
/specdev-implement

# Archive only (after implementation is complete)
/specdev-archive

Core Principles

  1. Brainstorm before spec - Explore and refine the idea before formalizing
  2. Spec first, code second - Define what to build before deciding how
  3. Understand before acting - Analyze existing codebase patterns before designing
  4. One question at a time - Don't overwhelm during brainstorming
  5. YAGNI ruthlessly - Remove unnecessary features from all designs
  6. Human in the loop - User confirmation required at every phase transition
  7. All specs in English - Specification documents must be in English
  8. Never modify source specs directly - Only use deltas in changes/

Directory Structure

skills/
├── brainstorming/           # Idea exploration skill
│   └── SKILL.md
├── specdev/                 # Main workflow orchestrator
│   ├── SKILL.md
│   └── openspec-reference.md
├── specdev-design/          # Design phases (0-4.5)
│   ├── SKILL.md
│   └── openspec-reference.md
├── specdev-implement/       # Implementation phases (5-6)
│   ├── SKILL.md
│   └── openspec-reference.md
├── specdev-archive/         # Archive phases (6-8)
│   ├── SKILL.md
│   └── openspec-reference.md
├── using-openspec/          # OpenSpec quick guide
│   ├── SKILL.md
│   └── openspec-examples.md
├── save-context/            # Context save skill
│   └── SKILL.md
└── load-context/            # Context load skill
    └── SKILL.md

Context Management

The workflow uses /save-context and /load-context skills to manage context resets:

  • Phase 4.5: Mandatory context reset before implementation
  • During implementation: Reset when context approaches 2% remaining
  • Natural reset points: After Phase 4, after major tasks, before Phase 7

License

MIT

About

SDD flow

Resources

Stars

Watchers

Forks

Contributors