惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
小众软件
小众软件
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
博客园 - 聂微东
S
SegmentFault 最新的问题
量子位
宝玉的分享
宝玉的分享
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
SpecFlow: Multi-Agent SDD in Cursor (4 phases, /approve, ...
Matías Espinoza · 2026-05-26 · via DEV Community
Cover image for SpecFlow: Multi-Agent SDD in Cursor (4 phases, /approve, single code writer)

Matías Espinoza

SpecFlow: Multi-Agent SDD in Cursor (4 phases, /approve, single code writer)

SpecFlow is a CLI that installs Spec-Driven Development (SDD) in your repository: four phase agents, markdown specs, and only Implementer may edit source code. It still looks like Cursor chat — you turn on flow when the feature warrants it.

@ceatoleii/specflow · Pipeline: Requirement → Plan → Tasks → Code → Review

npx @ceatoleii/specflow init

Full guide: ceatoleii.github.io/specflow


What problem it solves

Symptom SpecFlow mechanism
Vague ask → huge diff Refinertask.md with AC1, AC2
Code before design agreement SDD waits for /approve
Multiple “agents” touching src/ Only Implementer writes source
“Done” without evidence Reviewerreview.md per AC

Pipeline: Requirement → Plan → Tasks → Code → Review

flowchart LR
  R[Refining<br/>task.md] --> D[Designing<br/>plan.md + tasks.md]
  D -->|/approve| I[Implementing<br/>src/]
  I --> V[Reviewing<br/>review.md]
  V -->|PASS| A[history/ + flow off]
  V -->|FAIL| I


Architecture in 60 seconds

Phase (phase.md) Agent Writes code? Output
refining Refiner No task.md
designing SDD No plan.md, tasks.md
implementing Implementer Yes Code + tasks.md
reviewing Reviewer No review.md

Direct mode vs flow mode

Direct mode Flow mode
Signal No .agents-state/.flow-enabled File present
Start new task, flow on
Stop flow off, direct mode phrases
Use for Typos, spikes, exploration Features with clear ACs

Install (2 minutes)

Requirements: Node.js ≥ 18, interactive terminal, project root.

npx @ceatoleii/specflow init
specflow doctor

Add to .gitignore:

.agents-state/

What init installs

Path Maintained by Notes
AGENTS.md SpecFlow (init / sync) Universal entry for IDEs
.agents/ SpecFlow Phase rules — do not edit
.agents-docs/ You Stack, conventions, verification.md
.agents-state/ Runtime Per-task state — gitignore
.cursor/rules/_specflow.mdc SpecFlow Cursor adapter (default v2.2+)
.specflow-linear.json Optional Linear sync via Cursor MCP

Golden rule: fill .agents-docs/ before serious tasks — agents read it every flow.


Walkthrough: rate limiting on /api/search

Example feature:

Max 100 req/min per IP, HTTP 429 with standard JSON, existing tests stay green.

1. Start flow

In Cursor chat:

new task

Also: flow on, or new task from LIN-123 (Linear + MCP).

Verify:

specflow doctor
# Expect .flow-enabled and phase.md = refining

2. Refining → task.md

Refiner asks questions; you answer. Typical output:

# Task: Rate limit /api/search

## Goal
Limit anonymous traffic to /api/search without breaking current behavior.

## Acceptance Criteria

- **AC1:** >100 requests/min from same IP → HTTP 429
- **AC2:** Body `{ "error": "rate_limit_exceeded", "retryAfter": <number> }`
- **AC3:** Existing search endpoint tests pass unchanged

## Constraints

- Reuse existing error middleware patterns if present
- No new env vars without team approval

## Out of Scope

- Per-API-key quotas
- Admin dashboard for limits

You review ACs and Out of Scope — reply in chat to fix; no need to hand-edit the file.

3. Designing → plan.md + tasks.md

SDD proposes design. Sample tasks.md (TDD order):

## Tasks

- [ ] [test] Add integration test: 101 requests in 60s → 429 (AC1)
- [ ] [test] Assert JSON body shape matches AC2
- [ ] [impl] Create rateLimit middleware (in-memory store, 100/min)
- [ ] [impl] Wire middleware on /api/search route only
- [ ] [impl] Run full search test suite (AC3)

Read plan.md (files, approach). If the plan sneaks in unrequested refactors, ask for changes before approve.

4. /approve gate

/approve

Also valid: approved, go ahead (locale-dependent phrases in rules).

  • Phase → implementing
  • Only now may Implementer touch src/
  • With Linear enabled: issue → In Progress (via Cursor MCP)

5. Implementing

Watch:

  • tasks.md[ ][~][x]
  • git diff — must match plan.md

On spec gaps, answer in chat — Implementer should not guess.

6. Reviewing → review.md

Reviewer runs .agents-docs/verification.md (e.g. npm test, npm run lint).

Sample review.md:

# Review: Rate limit /api/search

## Acceptance Criteria

| AC | Evidence | Status |
|----|----------|--------|
| AC1 | `rate-limit.test.ts` — 101 req → 429 | PASS |
| AC2 | Snapshot `error` + `retryAfter` fields | PASS |
| AC3 | `npm test -- search` — 0 failures | PASS |

## Verification

- `npm test` — exit 0
- `npm run lint` — exit 0

## Decision

**PASS** — archived to history/, flow disabled.

Outcome What happens
PASS history/YYYY-MM-DD-slug/, flow off
FAIL Back to Implementer with concrete fixes

Five design principles

  1. Spec before code — No /approve, no implementation.
  2. One writer — Only Implementer in src/, lib/, etc.
  3. Explicit statephase.md, task.md, plan.md under .agents-state/current/.
  4. Portable rules.agents/ via sync; project facts in .agents-docs/ (never overwritten by sync).
  5. Zero overhead by default — Without an active task, assistant behaves normally.

Commands you’ll actually use

Command When
specflow init First install
specflow doctor Verify files and phase
specflow doctor --run + run verification.md
specflow status Version, Linear on/off, updates
specflow sync Update engine and adapters
specflow linear setup Enable Linear sync (MCP)
specflow status
specflow sync


Linear + Cursor MCP (optional)

  • Config: specflow linear setup or wizard during init
  • No API keys in the CLI — the Cursor agent uses the Linear MCP plugin
  • Default state mapping:
SpecFlow event Linear state
Refining complete Todo
/approve In Progress
Review PASS Done

Details: Linear Integration


When to skip SpecFlow

Use flow Skip (direct mode)
Feature with ACs and scope One-line fix
You want to read plan before diff Spec already signed elsewhere
Team shares .agents/ rules Fully ad-hoc spike

Team workflow

Commit: AGENTS.md, .agents/, .agents-docs/, adapters, .specflow-version

Do not commit: .agents-state/

npx @ceatoleii/specflow sync   # updates engine; keeps .agents-docs/


Quick troubleshooting

Issue First step
Assistant ignores phases Is .flow-enabled present? specflow doctor
Code without plan Did you /approve? Check phase.md
Review fails tests Fill .agents-docs/verification.md

More: Troubleshooting


Wrap-up

  • Install rules and templates with npx @ceatoleii/specflow init
  • Start with new task when the contract matters
  • Approve design with /approve before the diff
  • One agent writes code; Reviewer closes with per-AC evidence

Links


What feature would you run through /approve first? 👇