Skip to content

Repository files navigation

SpecFlow logo

Agentic Harness for Large-Scale Code Generation

License: MITPyPI versionPython 3.13Publish to PyPI


AI agent harness for automated code generation and complexity estimation. Multiple deployable codebases built by multiple SOTA AI models. When their code complexity scores align, it proves the specs are complete.

SpecFlow is an AI agent harness that automates code generation, deployment, and testing through parallel AI agents in isolated, sandboxed execution environments.

Validator agents continuously assess, resume, and refine work until delivery standards are met.

SpecFlow iconography

SpecFlow-demo.mp4

Getting Started

Software

RequirementNotes
DockerContainer runtime for the harness sandbox. Install Docker
uvPython package manager. Install via brew install uv or see docs
IDESpecFlow is used as MCP in a IDE with agentic AI enabled: Cursor, Claude Code, Copilot, Gemini etc. This is the users project.

Keys and Tokens

KeyName in .envNotes
GitHub Personal Access TokenGITHUB_TOKENFor disposable workspace repos. Scope: repo + read:user + workflowrepo,read:user. Advan
P10Y API keyP10Y_API_KEYCode complexity scoring. Setup guide
LLM provider keyOPENROUTER_API_KEY or ANTHROPIC_API_KEYOne key required. Get OpenRouter key (default) or Get Anthropic key

Installation

Few simple steps to get you going:

  • clone repo
    git clone https://github.com/griddynamics/specflow.git &&cd specflow
  • install Specflow (includes the Terminal UI that guides you through onboarding)
    uv tool install --editable ./mcp_server
  • start Specflow app and follow instructions
    specflow tui
    

Important

Specflow Harness Sandbox is now running locally. Easiest: in specflow tui, press c (Add MCP to AI tool) — the setup screen detects Claude Code, Gemini CLI, and Cursor and wires SpecFlow up for you (one key), with an honest connected/added/failed status per client. Prefer to do it by hand? Copy-paste the content of .specflow-local/mcp-config.json into your client.

Cursor
Cursor
Claude Code
Claude Code
Claude Desktop
Claude Desktop
GitHub Copilot
Copilot
Gemini CLI
Gemini CLI

...and any other IDE or client that supports the Model Context Protocol.

Usage

MCP is now ready to use in any project. Prompt your IDE agent to talk to the harness.

Let's say specification files are in specs directory, you can follow these steps:

  1. Start a new project in IDE and put your specs files into specs directory

    specs/
    |-- product-requirements.md
    |-- user-flows.pdf
    \-- acceptance-criteria.md
    
  2. Check your specification completeness using check_specification_completeness tool

    Use SpecFlow MCP to check specification completeness in specs directory
    
  3. Create a detailed plan using our run_planning tool

    Create implementation plan using SpecFlow MCP
    
  4. When you are happy with the plan, run generation using run_generation as above

    Run generation with SpecFlow MCP
    
  5. Generation usually takes many hours, use our TUI to monitor progress and receive Desktop Notifications:

    # Any terminal
    specflow tui

SpecFlow iconography

  1. When the generation has been completed, you can retrieve the results and P10Y reports from harness:

    Download outputs using Specflow MCP
    

    The rule of thumb is: if the P10Y score spread is low, then your specification is ready!

  2. Use the built-in prompt to compare the variants and identify their strong and weak sides, together with a plan to automatically assemble the best variant.

    use SpecFlow MCP prompt: specflow-compare-variants
    

MCP Tools

ToolDescription
check_specification_completenessAnalyze specs for gaps and contradictions (local)
run_planningGenerate a phased implementation plan (local)
read_documentExtract PDF/DOCX/PPTX/XLSX/CSV to markdown (local)
run_generationUpload and launch parallel codegen on the backend (2-8 hrs)
check_statusPoll generation progress
download_outputsDownload archived artifacts from a completed run
retry_generationRetry a failed generation

If you want to go deeper

Install only SpecFlow skills

We have portable set of skills that is normally used as preparation phase for Human-In-The-Loop AI assisted specification checks and planning.

Example for Claude Code:

/plugin marketplace add griddynamics/specflow
/plugin install specflow

SpecFlow Detailed Overview

SpecFlow.Detailed.Look.mp4

Full MCP config and usage: MCP_USER.md

Full MCP API reference: docs/mcp/API_REFERENCE.md

Detailed SpecFlow harness instructions: QUICKSTART.md

Important

AI agents work in scratchpad repos that are reset before each run — we create them for you. **Do not point SpecFlow at repositories with code or history you want to keep. ** The managed SpecFlow service is for Grid Dynamics employees only. Open-source users should run the local quickstart.

Documentation

DocumentDescription
QUICKSTART.mdLocal setup and first run
CONTRIBUTING.mdHow to contribute — workflow and PR checklist
CLAUDE.mdDevelopment protocol and STEEL commandments
TOKEN_ECONOMY_GUIDANCE.mdToken economics and model choice — budgeting AI spend predictably
docs/ARCHITECTURE.mdSystem design and data flow
docs/mcp/API_REFERENCE.mdMCP tool reference
docs/backend/DEVELOPMENT.mdBackend development guide
docs/backend/API_REFERENCE.mdREST API reference
docs/operations/TROUBLESHOOTING.mdTroubleshooting guide
docs/IDE-SETUP.mdIDE configuration (Cursor + Claude Code)
docs/examples/deployment-spec-example.mdExample spec for agentic deployment + E2E tests
SECURITY.mdSecurity policy and vulnerability reporting

Contact

Questions, feedback, or anything that doesn't fit a GitHub issue: specflow@griddynamics.com

Found a security vulnerability? Please report it privately per SECURITY.md rather than opening a public issue.

License

MIT — Copyright (c) 2024 Grid Dynamics International, Inc.

(back to top)

About

Agentic harness for large-scale AI code generation - by Grid Dynamics

Topics

Resources

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages