The Missing Piece for Claude Code & Cursor

Getting Started with SpecFlow

Make AI assistants safe for legacy codebases

This guide shows you how to use SpecFlow with Claude Code or Cursor to safely modify legacy code. Generate specifications that teach AI what not to break. Server-based AI - no API keys needed.

The Legacy Code Problem

Most developers work on legacy codebases with missing or outdated tests and documentation. AI assistants like Claude and Cursor are powerful, but they face challenges:

❌ Without SpecFlow:

AI breaks existing behavior when it can't see the full context. It loses long-term context as conversations grow. No way to verify changes won't break requirements.

(AI assistants are flying blind on legacy code)

✅ With SpecFlow:

Generate specs from existing code (no docs needed). Give Claude/Cursor long-term memory of requirements. Prevent AI from breaking existing behavior. Generate comprehensive tests automatically.

(SpecFlow makes AI assistants safe for legacy code)

Prerequisites

  • Package Manager - Homebrew (macOS/Linux) or Chocolatey (Windows)
  • SpecFlow Account - Select a tier (FREE, PRO, or PREMIUM) and activate your license
  • AI coding assistant (recommended) - Claude Code or Cursor for MCP integration

No API keys needed! SpecFlow uses server-based AI. Just activate your license and start generating specifications.

Quick Start (4 Steps)

Step 0: Register Your Email

Before using SpecFlow, register your email to activate your account.

  1. 1. Visit SpecFlow
  2. 2. Choose a tier (Free, Pro, or Premium)
  3. 3. Enter your email address to create your account
  4. 4. Your account is now active!

💡 The CLI will use this email to verify your account and apply usage limits

Step 1: Install SpecFlow

brew tap maneeshchaturvedi/specflow
brew install specflow

# Verify installation
specflow --version

Step 2: Initialize SpecFlow

Navigate to your project and initialize SpecFlow:

# Navigate to your project
cd your-project

# Initialize SpecFlow
specflow init

This creates:

  • .specflow/config.yaml - Configuration file
  • .specflow/specs/ - Specification storage
  • .specflow/links.json - File-to-spec mappings
  • .specflow/cache/ - Cache directory

Step 3: Use Claude Code or Cursor with Automatic Spec Generation

SpecFlow integrates with Claude Code and Cursor through MCP (Model Context Protocol). When you ask your AI assistant to make changes, SpecFlow automatically generates specs and tests.

The Workflow:

  1. 1.Open your codebase in Claude Code or Cursor
  2. 2.Ask your AI assistant to make a change (e.g., "Add support for EUR currency to the payment processor")
  3. 3.SpecFlow automatically: Generates a spec documenting current behavior (if none exists), detects drift from the spec, generates tests
  4. 4.Review the spec, drift report, and tests before your AI assistant makes changes

Example Interaction:

You ask your AI assistant:

"Add EUR currency support to src/payment/processor.js"

SpecFlow (via MCP) automatically runs:

✓ Generated spec from existing code
✓ Detected constraints: USD-only, max $10,000
✓ Generated 5 tests for current behavior
✓ Drift check: Adding EUR will break USD-only constraint
⚠️  Warning: This change violates existing spec

Your AI assistant shows you:

📋 Current Spec: payment_processor_spec.json

🚨 Drift Detected: Currency constraint will change

Tests Generated: 5 tests covering USD behavior

You stay in control: Review the spec and drift before allowing your AI assistant to proceed. SpecFlow ensures you know exactly what will change.

How SpecFlow Helps Your AI Assistant

By using SpecFlow with Claude Code or Cursor, you've created a safety layer that:

🔍Gives AI context - Specs document what your code does without needing manual documentation

🛡️Prevents breaking changes - Drift detection catches when AI modifies existing behavior

💾Provides long-term memory - Specs persist across sessions so AI never loses context

Generates safety tests - Comprehensive test suites created automatically from specs

🎉 Your AI assistant can now safely modify legacy code with confidence!

SpecFlow ensures Claude Code or Cursor has the requirements context and validation it needs to make safe changes.

Next Steps

📚 Workflow Examples

See real-world scenarios: 80/20 rule, security, living docs.

💡 Quick Commands

  • • View: specflow view spec.json --format yaml
  • • Test: specflow test generate spec.json
  • • Help: specflow --help