spec-flow has been renamed to persistent due to naming conflicts. All commands now use persistent instead of specflow. The npm package is now @kousthubha/persistent.
Documentation
Everything you need to use persistent in your project.
Installation
Run without installing (recommended for first use):
bash
npx @kousthubha/persistent init
Or install globally:
bash
npm install -g @kousthubha/persistent
Requires Node 18+. No API keys needed for core features — only analyze uses Anthropic.
persistent init
Full project bootstrap. Run once from your project root.
AI deep-dive into your actual code. Generates project-specific skill files that reflect how YOUR project uses each library.
bash
persistent analyze # analyze all detected skills
persistent analyze --key sk-ant-... # pass API key directly
persistent analyze --force # regenerate even if files exist
persistent analyze --only stripe/node # target specific dependencies
How it differs from init
→ init → broad bootstrap, 2-3 minutes total
→ analyze → deep code tracing, 5-10 minutes per skill, much more detailed
→ init → generic best practices
→ analyze → your project's actual patterns and gotchas
→ init → recommended first, regenerate rarely
→ analyze → recommended after stack is mature, run on demand
What analyze generates
→ How this project uses each dependency (not generic docs)
→ Actual import patterns traced from source files
→ Custom abstractions and wrappers built on top of libraries
→ Project-specific configuration choices and why they matter
→ Naming conventions and error handling patterns
→ Version-specific gotchas for your installed versions
→ Conflicts with other libraries in your stack
→ Code examples pulled directly from your source
→ Suggestions for architectural improvements
Uses claude-haiku-4-5 via Anthropic API — fast and cheap. Set ANTHROPIC_API_KEY in env to avoid passing --key every time.
Slash commands
For Claude Code and OpenCode, persistent init creates native slash commands. Type /persistent- in the AI chat to see them.
These are AI-native — the AI agent itself executes these commands by reading files and analyzing code. They appear as instant suggestions in the chat interface.
/persistent-specAI generates or validates specs via OpenSpec. Read SPECS/SEED.md + MEMORY/INDEX.md for context.
/persistent-skillAI analyzes your actual code patterns → creates/evolves project-specific skills with examples from your source
/persistent-syncAI reads MEMORY/INDEX.md + Obsidian vault notes → routes by tag → updates SEED.md and skills
/persistent-analyzeAI performs deep code analysis → generates detailed skill files with architecture insights and gotchas
Where commands are stored
After persistent init, slash commands are written to:
text
.claude/commands/
├── persistent-init.md
├── persistent-spec.md
├── persistent-skill.md
├── persistent-sync.md
└── persistent-analyze.md
.opencode/commands/
└── (same files)
# Each .md file contains instructions for the AI to read and execute
# The AI reads these when you type /persistent-* in the chat
How they work
→ You type /persistent-spec in Claude Code/OpenCode chat
→ AI reads the markdown file for instructions
→ AI reads your codebase, SPECS/SEED.md, MEMORY/INDEX.md per instructions
→ AI generates context (specs, skills, config updates)
→ AI writes files to your project
→ Result: faster, more context-aware interactions with the AI
Supported agents: Claude Code (.claude/commands/) and OpenCode (.opencode/commands/). Other agents (Cursor, Copilot, etc.) use CLI commands directly from terminal.
Config file (.persistent.json)
Auto-created by persistent init. Persists state between commands.
The stable source of truth for all context generation. Lives at .persistent/generation-spec.json in your project — commit it.
It defines: file schemas (required sections, token limits), validation rules, AI generation prompts, integration settings for OpenSpec/skills/Obsidian. Follows semantic versioning — switching AI models or CLI tools doesn't break your specs because the spec is the source of truth, not the model.
bash
# Initialize generation-spec in your project
persistent init # creates .persistent/generation-spec.json automatically