🚀 Now in Public Beta

Write Specs.
AI Implements.
Stay in Control.

SpecFact is the spec-driven development framework that keeps your AI coding assistants aligned with your specifications. Define once, validate continuously.

$ uvx specfact-cli@latest analyze ./my-project
Found 12 specifications in contracts/
Analyzed 847 lines of code
Generated plan bundle: .specfact/plan.yaml

Why SpecFact?

The missing link between AI-generated code and production-ready software.

🏗️

Brownfield-First

Built for existing Python codebases. Reverse-engineer legacy code into executable contracts automatically. No specs upfront required.

Zero-Config Entry

Run `specfact import from-code` and get value in 60 seconds. No configuration files, no setup. Works on messy repos.

🔒

Runtime Contract Enforcement

Add icontract + beartype decorators to critical paths. Contracts block violations during refactoring, preventing production bugs.

🔬

Symbolic Execution

CrossHair explores all code paths mathematically, finding edge cases that traditional testing and AI coding assistants miss.

🤖

AI-Consumer Architecture

CLI produces structured data for AI copilots. Deterministic core + AI at boundaries. Best of both worlds.

🔄

CI/CD Native

GitHub Actions integration out of the box. Shadow mode → enforce mode. Progressive rollout with audit trails.

How It Works

Three simple steps to spec-driven development.

01

Define Specifications

Write your requirements as YAML specs or Python contracts. Define what your code should do, not how.

# contracts/user_service.spec.yaml
name: UserService
version: "1.0"
operations:
  - name: create_user
    input: { email: string, name: string }
    output: { id: uuid, created_at: datetime }
    contracts:
      - email must be valid format
      - name must be 2-100 characters
02

AI Implements

Use your favorite AI coding assistant. SpecFact provides context to keep implementations aligned.

$ specfact plan ./contracts
✓ Generated implementation plan
✓ Created .specfact/plan.yaml

# AI assistants read this plan
# and implement accordingly
03

Validate Continuously

Run SpecFact in CI/CD to catch deviations. Get reports on what's wrong and how to fix it.

$ specfact enforce ./src
✓ Checking 12 specifications...
✓ Validating 847 lines of code...

⚠ 2 deviations found:
  - user_service.py:45 - missing email validation
  - user_service.py:72 - return type mismatch

Powerful CLI

Install with uvx, pip, or run directly. The SpecFact CLI integrates seamlessly with your development workflow.

Recommended
uvx specfact-cli@latest
pip
pip install specfact-cli
Read the Docs
Terminal
$ specfact init # Initialize a new SpecFact project
$ specfact analyze # Analyze codebase against specifications
$ specfact plan # Generate implementation plan from specs
$ specfact enforce # Enforce specifications in CI/CD
$ specfact compare # Compare code with spec requirements
$ specfact repro # Generate reproducibility reports

100% Open Source

SpecFact CLI is released under Apache 2.0 license. No vendor lock-in, no license keys, no telemetry required. Self-host, fork, or contribute.

uvx specfact-cli@latest --help
Star on GitHub

What's included (free forever):

  • Full CLI with all commands
  • Contract extraction from legacy code
  • Gap discovery & quality scoring
  • GitHub Actions integration
  • AI IDE slash commands (Cursor, Copilot)

Need enterprise support? Contact us