Skip to main content

Project Spec

Machine-readable specs that link intent to code, with tooling to surface drift.

Software is full of implicit knowledge—what the system should do versus what it does. This gap becomes critical when AI agents enter the picture: an agent can't distinguish between a test that's wrong and a test that's protecting something important. Without explicit intent, agents silently regress functionality, drift from requirements, and lose context between sessions.

Project Spec solves this by declaring intent in YAML specs, linking those declarations bidirectionally to code via markers, and running reconciliation to surface gaps.

Read the manifesto → for the full philosophy and motivation.


Prerequisites

  • Python 3.10+

Installation

# Install from source (PyPI coming soon)
git clone https://github.com/codewithcheese/projectspec.git
pip install ./projectspec[validation]

Quick Start

# Run reconciliation on the example project
cd projectspec/examples/taskflow
projectspec reconcile

Example output:

Reconciliation complete: 3/5 features OK
  (1 planned features skipped)

spec/capabilities/auth.yaml:
  user-authentication/password-reset: [ERROR] Path does not exist
    → tests/api/test_password_reset.py

Unlinked files (not referenced in any spec):
  src/api/routes/teams.py

The output shows:

  • OK - Features where all linked files exist
  • ERROR - Missing implementation or test files
  • WARNING - Missing documentation files
  • Planned - Features with status: planned (skipped)
  • Unlinked - Files not referenced by any spec

What You Get

  • Schema validation - Specs validated against JSON Schema defined in KindDefinitions
  • File existence checking - Verify implementedIn, testedIn, documentedIn paths exist
  • Coverage verification - Match @implements, @tests, @documents markers to acceptance criteria
  • Relationship graphs - Track dependencies, detect cycles, validate entity references
  • JSON output - Machine-readable results for CI integration (--format json)
  • Custom kinds - Define domain-specific entity types (not just Capability/Feature)
  • GitHub Action - Run reconciliation and spec review on PRs with comments and labels

CI Integration

Add ProjectSpec checks to your GitHub workflow:

# .github/workflows/projectspec.yml
name: Projectspec
on: [push, pull_request]

jobs:
  check:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: codewithcheese/projectspec/.github/actions/projectspec@main

On PRs, this posts a comment summarizing spec changes and adds severity labels (spec-info, spec-warning). See the CI Integration Guide for configuration options.

How It Works

┌─────────────────┐
│   SPEC FILES    │ ← Human-controlled source of truth
│   (yaml)        │
└────────┬────────┘
         │
         │ declares
         ▼
┌─────────────────┐      ┌─────────────────┐
│  CAPABILITIES   │ ───► │ IMPLEMENTATION  │
│  (what it does) │      │ (code, tests,   │
│                 │ ◄─── │  docs)          │
└─────────────────┘      └─────────────────┘
         │                        │
         └────────┬───────────────┘
                  │
                  ▼
         ┌─────────────────┐
         │ RECONCILIATION  │ ← Surface drift, resolve intentionally
         │ (diff spec vs   │
         │  reality)       │
         └─────────────────┘

Code links back to specs via markers:

"""
@implements feature:auth/login
  - User can log in with email and password
  - Invalid credentials return 401
"""
def login(email: str, password: str) -> Token:
    ...

Adding Specs to Your Project

  1. Create spec directory structure:

    your-project/
    ├── spec/
    │   ├── kinds/           # Copy from examples or define your own
    │   │   ├── capability.yaml
    │   │   └── feature.yaml
    │   └── capabilities/    # Your specs go here
    │       └── auth.yaml
    └── src/
    
  2. Write your first spec:

    apiVersion: projectspec/v1alpha1
    kind: Feature
    metadata:
      name: auth/login
    spec:
      status: implemented
      acceptance:
        - User can log in with email and password
        - Invalid credentials return 401
      implementedIn:
        - src/auth/login.py
      testedIn:
        - tests/test_auth.py
    
  3. Add markers to your code:

    # src/auth/login.py
    """
    @implements feature:auth/login
      - User can log in with email and password
      - Invalid credentials return 401
    """
    
  4. Run reconciliation:

    projectspec reconcile
    

Core Concepts

Spec as contract - The spec is a machine-readable agreement, not documentation that rots. Every statement is verifiable: "feature is implemented" → linked files exist.

Reconciliation - Drift between spec and reality is expected. The goal isn't to prevent drift—it's to surface it and resolve it intentionally.

Human authority over spec - Agents implement what specs say; changing specs requires human approval. This prevents agents from "solving" problems by redefining them away.

Documentation

Understand the concepts:

Reference:

Working with specs:

Status

This is an early exploration of the methodology. The format and tooling will evolve.

Current limitations:

  • No watch mode for continuous reconciliation
  • Limited adapter support (Python, Markdown)
  • No IDE integration yet

Metadata

Release files for projectspec 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for projectspec 0.1.1
File Size Uploaded Provenance
projectspec-0.1.1.tar.gz 56.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for projectspec 0.1.1
File Interpreter ABI Platform
projectspec-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 94.3 kB

Release files / projectspec-0.1.1.tar.gz

Download URL projectspec-0.1.1.tar.gz
Size 56.0 kB
Tags Source
SHA-256 checksum
How to use checksums
59081e3a76cbc74bd51d76738a58879ec9bfa58afa3f89e123460bc086c8c247
BLAKE2b-256 checksum
How to use checksums
684a446358b18b36d1091fbf7047ea12310b298a8e7cbcb819faed5a61c354d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.2 cpython/3.12.12 HTTPX/0.28.1

Release files / projectspec-0.1.1-py3-none-any.whl

Download URL projectspec-0.1.1-py3-none-any.whl
Size 38.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07113d3b568d9f61ebaf7b7dc70c0f735ef94eed3996598c47a2bbd0dc5d12bf
BLAKE2b-256 checksum
How to use checksums
4c6da37bb46f987de29a59152f5ed707727a797477f18f43ca72a2cb23f1a93b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.2 cpython/3.12.12 HTTPX/0.28.1

Security for projectspec 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page