Skip to main content

The swiss knife CLI for agile DevOps teams. Keep backlog, specs, tests, and code in sync with validation and contract enforcement for new projects and long-lived codebases.

Project description

SpecFact CLI

Review AI-assisted code against your own contracts. Catch drift before it reaches PR or main.

PyPI version Python versions License Status

No API keys required. Works offline. Zero vendor lock-in.

Try it in 60 seconds

# Zero-install, no API key, works offline
uvx specfact-cli init --profile solo-developer
uvx specfact-cli code review run --path . --scope full

Sample output:

SpecFact CLI - v0.46.4

Running Ruff checks...
Running Radon complexity checks...
Running Semgrep rules...
Running AST clean-code checks...
Running basedpyright type checks...
Running pylint checks...
Running contract checks...
Running targeted tests and coverage...

Verdict: FAIL | CI exit: 1 | Score: 0 | Reward delta: -80

Findings:
  - specfact_demo/enforcement.py:96   Cyclomatic complexity for run_enforcement is 16.
  - specfact_demo/main.py:81          Avoid print() in source files; use structured logging instead.
  - examples/buggy_math.py:4          Public function divide is missing @require/@ensure decorators.

Evidence bundle: docs/_support/readme-first-contact/sample-output/

Star this repo if the output is useful. Open an issue if you want the workflow adapted for your stack.

Already installed the CLI? Use:

specfact init --profile solo-developer
specfact code review run --path . --scope full

The sample output comes from a pinned capture against nold-ai/specfact-demo-repo. Reproduce it with docs/_support/readme-first-contact/capture-readme-output.sh; capture metadata lives alongside the raw logs in docs/_support/readme-first-contact/sample-output/.

What SpecFact does

  • Reviews AI-assisted changes deterministically — compare code against contracts, clean-code rules, and policy gates
  • Extracts structure from existing code — reverse-engineer brownfield repos before you change them
  • Blocks drift before merge — use the same checks locally, in pre-commit, and in CI
  • Links backlog intent to code reality — connect backlog, specs, validation, and implementation
  • Stays local-first — no cloud account, no vendor lock-in, no built-in model dependency

What is SpecFact?

SpecFact is a local CLI for catching backlog/spec/code drift before it becomes expensive. It gives solo developers, legacy maintainers, and teams a validation layer around AI-assisted delivery, brownfield reverse engineering, and contract-first reviews.

It exists because delivery drifts in predictable ways:

  • AI-assisted code lands faster than validation catches up
  • brownfield systems rarely have trustworthy up-to-date specs
  • backlog intent gets reinterpreted before it reaches code
  • teams need the same review rules across IDEs, CI, and pull requests

Add SpecFact to your workflow

Pre-commit hook

This repository uses a modular local hook layout (parity with specfact-cli-modules: fail_fast, separate verify / format / YAML / Markdown / workflow / lint / Block 2 hooks). If you copy .pre-commit-config.yaml into another repo, you must also vendor the referenced scripts/*.sh entrypoints (at minimum scripts/pre-commit-quality-checks.sh, scripts/pre-commit-verify-modules.sh, scripts/module-verify-policy.sh, and scripts/git-branch-module-signature-flag.sh) so hook entry: paths resolve. Alternatively, skip vendoring the modular file and use the remote hook below.

For a single-hook setup in downstream repos, keep using the stable id and script shim:

- repo: https://github.com/nold-ai/specfact-cli
  rev: v0.46.4
  hooks:
    - id: specfact-smart-checks

The shim runs scripts/pre-commit-quality-checks.sh all (full pipeline including module verify).

GitHub Actions

- name: SpecFact Gate
  run: uvx specfact-cli@latest govern enforce stage --preset minimal

How SpecFact is built

SpecFact uses the same discipline it asks you to trust:

  1. Outside-in research on the workflow or drift problem
  2. Public OpenSpec proposal and spec deltas
  3. TDD evidence before implementation
  4. Dogfooding with specfact code review
  5. Format, type-check, contract-test, and docs quality gates
  6. PR review with evidence artifacts
  7. Release through the same reproducible CLI paths

For teams and organizations

SpecFact still scales beyond the solo-developer entry path:

  • Backlog + ceremony workflows for GitHub, Azure DevOps, Jira, and Linear
  • DoR/DoD and policy enforcement for teams that need repeatable gates
  • Evidence-backed PR review with the same checks used locally
  • CI/CD adoption path that keeps validation deterministic instead of model-driven

Start with:

  • specfact backlog ceremony standup ...
  • specfact backlog ceremony refinement ...
  • specfact backlog verify-readiness --bundle <bundle-name>
  • specfact govern ...

Module system

Official workflow behavior ships from nold-ai/specfact-cli-modules. The core CLI owns bootstrap, runtime contracts, trust checks, logging, and the grouped command surface. Installed modules add families such as project, backlog, code, spec, and govern.

Install examples:

specfact module install nold-ai/specfact-project
specfact module install nold-ai/specfact-backlog
specfact module install nold-ai/specfact-codebase
specfact module install nold-ai/specfact-code-review
specfact module install nold-ai/specfact-govern

If startup warns that modules are missing or outdated, run:

specfact module init --scope project
specfact module init

Documentation topology

docs.specfact.io is the canonical starting point for SpecFact.

  • Core CLI/runtime/platform documentation remains owned by specfact-cli
  • Module-specific deep docs are canonically owned by specfact-cli-modules
  • The live modules docs site is published at https://modules.specfact.io/

Use this repository's docs for the product story, runtime lifecycle, command topology, trust model, and getting-started flow. Use the modules docs site when you want deeper workflow, adapter, and module-authoring guidance.

How do I get started if I want more?

Next steps:

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

specfact_cli-0.46.19.tar.gz (610.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

specfact_cli-0.46.19-py3-none-any.whl (758.4 kB view details)

Uploaded Python 3

File details

Details for the file specfact_cli-0.46.19.tar.gz.

File metadata

  • Download URL: specfact_cli-0.46.19.tar.gz
  • Upload date:
  • Size: 610.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for specfact_cli-0.46.19.tar.gz
Algorithm Hash digest
SHA256 783bebdf78a5cc79ed510141d2d52fb8f682a5021af9b086da6bdf33a5b18008
MD5 2be4b324c6b29e0dc5bd3358e56d5498
BLAKE2b-256 2e74ffa5bb3b3016b929b4479cc73ba9c1bccf8d6f06d74131938f4b466d6460

See more details on using hashes here.

File details

Details for the file specfact_cli-0.46.19-py3-none-any.whl.

File metadata

  • Download URL: specfact_cli-0.46.19-py3-none-any.whl
  • Upload date:
  • Size: 758.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for specfact_cli-0.46.19-py3-none-any.whl
Algorithm Hash digest
SHA256 5ceca50b4f63d71090d721186b202ebcfd0fe9f2d6f8aa37c8170cad46d16661
MD5 85fd30d92a8bb2b0a73c9426494cab49
BLAKE2b-256 be2ce8ff52eae0dd89383c1d841b067477ce1a7e2bf8a6def418cc84310c5ff2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page