Factory Framework
Turn plain-Markdown requirements into proven software.
Factory Framework (ff) links plain-Markdown human goals directly to executable tests inside your repository. Stakeholders, engineers, and AI coding agents read the exact same contract, and verdicts come solely from executed checks — never manual checkboxes.
Overview · Benefits · Installation · Usage · Example · Documentation
Overview
Requirements rot in external wikis when tests verify implementation trivia instead of user outcomes and releases ship on guesswork.
ff organizes every domain inside factory/ using implicit <domain> filenames:
- Intents (
intents/<domain>.md) state why a capability matters for humans (User Stories recommended). - Specs (
specs/<domain>.md) define what the system guarantees (Given/When/Then or EARS recommended, with optional parent overview prose). - Checks (
tests/*+ optionalchecks/<domain>.yaml) run real behavioral tests in any language and enforce standard JSON Schema metric bounds. - Proofs (
proofs/<domain>.json) record file digests, measured metrics, evidence, and computedPROVEN,FAILING,UNPROVEN,UNCLEAR, orERRORverdicts.
Benefits
- Plain Markdown, zero clutter. Write pure headings and overview prose with zero
{#id}anchors or[x]checkboxes. Folder and heading names wireintent <- spec <- checkautomatically, and splitting a proven spec into deeper child leaves stays frictionless. - Zero-boilerplate
pytest& polyglot runners. Use Python (ff_recordbuilt-in plugin or standardrecord_property), Bash, Node.js, Go, Java, or Rust in parallel with optional$FF_RECORDJSON output. - Standard metric rules & single source of truth. Declare bounds once under
specs.<id>.metricsusing JSON Schema keywords (minimum,maximum,const, optionalunit) — omitchecks/<domain>.yamlcompletely when conventions suffice. - Anti-weakening governance. Track breaking shifts in
factory/changes/YYYY-MM-DD_<slug>.md(with optionalissue:links);ff verify --baseblocks silent deletion or weakening of proven specs and bounds. - Ready for humans and agents. Export standalone HTML, Markdown, CSV, or JSONL reports with
ff export, install the/ffskill fromskills/ff/(orff skill install), and serve read-only context withff mcp.
Installation
Requires Python 3.14+ on Linux or macOS with uv:
uv tool install --python 3.14 factory-framework
Include [pytest] for built-in pytest fixtures and [mcp] for the read-only MCP server:
uv tool install --python 3.14 "factory-framework[pytest,mcp]"
Usage
Scaffold a starter contract, run checks, verify reproducibility, and export a report:
ff init --example # Add --pytest to scaffold tests/test_hello.py with built-in ff_record
ff run
ff status
ff verify --strict
ff export -f html -o proof-report.html
Everyday commands at a glance:
ff init [--example] [--pytest]— createfactory/with a zero-dependency script (orpytestcheck via--pytest).ff statusandff ls --tree— inspect domain verdicts and trace links from intents to specs and checks.ff show <id>— read full statements, metric rules, and latest evidence for any item.ff lintandff verify— check headings, schemas, proof parity, and--baseanti-weakening rules (FFR0–FFR4).ff export -f html|md|csv|jsonl— share proof reports with stakeholders.ff skill installandff mcp— equip coding agents with/ffworkflow instructions and read-only contract inspection.
Example
Suppose you require fast, accurate checkout totals in domain checkout.
1. State why in factory/intents/checkout.md:
# Checkout
## Fast Totals
As a shopper, I want accurate order totals immediately, so that slow pricing never delays my purchase.
2. State what in factory/specs/checkout.md:
# Checkout
## Fast Totals
### Latency
Given a cart with regional shipping rules, when checkout totals are requested, then pricing, tax, and totals return in 50 ms or less.
3. Declare metric bounds and script target in factory/checks/checkout.yaml:
version: 1
specs:
spec_checkout_fast-totals_latency:
metrics:
p95_ms: { maximum: 50, unit: ms }
checks:
test_checkout_fast_totals_latency:
file: tests/check_checkout.py
4. Prove it with a behavioral check in factory/tests/check_checkout.py:
import json, os
from pathlib import Path
elapsed_ms, body = call_checkout(items=3, region="EU")
assert body["tax"] > 0 and body["total"] > body["subtotal"]
if record_path := os.environ.get("FF_RECORD"):
Path(record_path).write_text(
json.dumps(
{
"summary": "Checkout returned tax and totals under 50 ms",
"metrics": {"p95_ms": elapsed_ms},
"evidence": [f"p95_ms={elapsed_ms}", f"total={body['total']}"],
}
),
encoding="utf-8",
)
Using pytest? Omit checks/checkout.yaml's checks: block, name your function test_checkout_fast_totals_latency(ff_record: Recorder), and omit file: — ff discovers tests/test_checkout.py automatically via the built-in pytest11 plugin.
5. Run and inspect the verdict:
ff run
ff status
Factory: shop-api | Proofs: fresh | Gate: PASSED
Intents: 1/1 proven | Specs: 1/1 proven | Checks: 1/1 passing
Explore examples/demo-service/ for a multi-domain pytest + Bash project and examples/checks/ for reusable check recipes.
Documentation
- Documentation home — architecture overview and core principles
- Getting started — installation, walkthrough, and
factory/layout - Core concepts — leaf headings, parent prose,
$FF_RECORD,pytest, and proofs - Configuration —
factory/ff.yaml, optionalfactory/checks/<domain>.yaml, and runners - Commands — all 12 CLI commands, lint rules (
FF001–FF012,FFR0–FFR4), and schemas - Workflow — daily loop, change notes (
issue:),--baseCI gates, exports, and agent skills - AGENTS.md · CONTRIBUTING.md · CHANGELOG.md · LICENSE
Metadata
Release files for factory-framework 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| factory_framework-0.4.0.tar.gz | 57.2 kB | With provenance | Details for factory_framework-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| factory_framework-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for factory_framework-0.4.0-py3-none-any.whl |
Total release size: 121.8 kB
Release files / factory_framework-0.4.0.tar.gz
| Download URL | factory_framework-0.4.0.tar.gz |
|---|---|
| Size | 57.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ddb7cbd1d114e20f10dad2c09856cde2d57ec259a147e50d6965484ec9557e04
|
|
BLAKE2b-256 checksum How to use checksums |
c3f0102526b6177f0328dd84fc4f63ef52c25f7a21de16d70f760a0562d1d5b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / factory_framework-0.4.0-py3-none-any.whl
| Download URL | factory_framework-0.4.0-py3-none-any.whl |
|---|---|
| Size | 64.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3d241e543d34800cc9cb2b7be5b79283adb019f8b85e02050fa86d34cec05e4
|
|
BLAKE2b-256 checksum How to use checksums |
99ca8aaa2c3f5859d6502599a6d0050453212748661f7f4285cabdacb92b459f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logSecurity for factory-framework 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for factory_framework-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.