███████╗██████╗ ███████╗ ██████╗███████╗██╗ ██████╗ ██╗ ██╗ ██╔════╝██╔══██╗██╔════╝██╔════╝██╔════╝██║ ██╔═══██╗██║ ██║ ███████╗██████╔╝█████╗ ██║ █████╗ ██║ ██║ ██║██║ █╗ ██║ ╚════██║██╔═══╝ ██╔══╝ ██║ ██╔══╝ ██║ ██║ ██║██║███╗██║ ███████║██║ ███████╗╚██████╗██║ ███████╗╚██████╔╝╚███╔███╔╝ ╚══════╝╚═╝ ╚══════╝ ╚═════╝╚═╝ ╚══════╝ ╚═════╝ ╚══╝╚══╝
Bootstrap your AI coding agent with persistent context. One command. Any stack. Any agent.
Your agent has no memory.
AI coding agents are powerful but stateless. Every session starts from zero. specflow makes your project the context — persistent, structured, version-controlled.
CONTEXT DIES EVERY SESSION
You spend 10 minutes re-explaining your stack, patterns, and constraints to your agent. Every. Single. Time.
SWITCHING AGENTS BREAKS EVERYTHING
Moved from Cursor to Claude Code? Your carefully crafted prompts go nowhere. Start from scratch.
THE AGENT DOESN'T KNOW YOUR RULES
It uses raw SQL instead of Prisma. Skips auth middleware. Ignores the patterns you've built over months.
SPECS LIVE IN YOUR HEAD
No structured spec means the agent implements the wrong thing, then you fix it, then it regresses.
Three tools. One workflow.
specflow orchestrates OpenSpec, Skills.sh, and Obsidian into a single command. Each does one thing perfectly. Together they give your agent full context.
Specs that survive sessions
Structured feature specs that live in your repo. Your agent reads them before every task. When a spec ships, patterns are extracted into SEED.md automatically.
Best practices, per library
One markdown file per dependency. Your agent reads Prisma patterns, Stripe integration guides, shadcn conventions — all from .skills/. Updated as your stack evolves.
Your notes become agent context
Tag notes in Obsidian — #decision routes to SEED.md, #pattern routes to skills. Archived specs write back to your vault. Your thinking persists across tools.
How a dev uses specflow.
Four moments in your development lifecycle. Each one builds on the last. SEED.md gets smarter with every feature you ship.
Bootstrap once
specflow init- →Reads your package.json → detects stack automatically
- →Multi-select prompt: pick which agents you use
- →Patches CLAUDE.md, .cursor/rules/, .windsurfrules — all at once
- →Pulls skills from skills.sh for every detected dependency
- →Connects Obsidian vault if you have one
- →Writes SPECS/SEED.md — fill in your architecture decisions
Spec first, code second
specflow spec "add feature"- →Creates SPECS/active/<slug>/ with three files
- →proposal.md — problem, solution, scope, open questions
- →design.md — data model, API surface, components, constraints
- →tasks.md — actionable checklist
- →Your agent reads the spec before implementing
- →No more re-explaining the feature every session
Your notes become context
specflow sync- →Jot decisions in Obsidian while you build
- →#decision → feeds SEED.md, shapes future specs
- →#pattern → feeds skills, improves future code
- →#bug → shows up in MEMORY/INDEX.md for your agent
- →Run sync any time to pull fresh notes in
- →Agent reads MEMORY/INDEX.md at session start
Archive and evolve
specflow spec --archive add-razorpay-payments- →Moves spec to SPECS/archive/ with timestamp
- →Extracts patterns from design.md automatically
- →Merges new patterns into SEED.md — it gets smarter
- →Writes spec summary back to your Obsidian vault
- →Next spec starts with everything you just learned
- →SEED.md evolves from real shipped work, not docs
The loop closes: archived specs → SEED.md → better specs → better code.
SEED.md evolves from real shipped features, not documentation nobody maintains.
Three files. Full context.
specflow writes these to your project. Your agent reads them. Two go in git. One stays local.
Context-dense brief written directly into the agent's own file. The AI reads this at session start. Commit this.
> specflow-context> stack: nextjs|prisma|clerk|stripe|shadcn> agents: [claude-code,cursor]> skills: [vercel/nextjs,prisma/best-practices,stripe/node]> spec: SPECS/active/add-payments/ — read before implementing> memory: MEMORY/INDEX.md — synced 2026-03-11 ## Critical Patterns- All DB queries use Prisma (never raw SQL)- Auth routes protected with Clerk middleware- API responses wrapped in standardized envelope ## Hard Constraints- Do not modify migration files- Never store auth tokens in localStorage
Your patterns, anti-patterns, decisions. Fill in once. Evolves automatically when specs are archived. Commit this.
# SEED — Architectural DNA> Evolved from 6 archived specs · 2026-03-11 ## Stack- nextjs (App Router), prisma, clerk, stripe ## Patterns- Validate all inputs with Zod before DB writes- Payments via Stripe (Razorpay for IN market)- Use server actions for mutations, REST for public APIs ## Anti-Patterns- Direct SQL queries (always use Prisma)- Hardcoded API keys in source
Top notes from your Obsidian vault — tagged #specflow, #hot, #bug. Re-synced on demand. Gitignore this.
# memory## vaultpath:/Users/sky/obsidian/OneRouterlast-sync:2026-03-11T09:23:00Ztagged:#specflow=3 pinned=2 ## hot-notes ### Projects/OneRouter/Architecture.md> source:tagged:#specflow · modified:2026-03-10Unified SDK over Stripe + Razorpay + PayPalProvider selected at runtime by currency
Works with every agent.
specflow auto-detects which agent you use from your project structure. The init prompt lets you select multiple — it patches each one.
Full CLI reference.
Full bootstrap. Detects stack, installs skills, patches agent files, connects Obsidian.
Re-patch agent file from current config. Run after stack changes or adding a new agent.
Use specflow as a library inside your own CLI tool or editor extension. Register your native AI instance for spec-driven context generation.
// Claude Code, Cursor, Windsurf, etc. import { createSpecflowPlugin } from '@kousthubha/specflow/plugin'; const sf = await createSpecflowPlugin(root); await sf.registerCliAI(nativeAI); await sf.detectAndSetup({ useCliAI: true });