Skip to main content

RAC — lint and diff product requirements written in Markdown.

Project description

RAC (Requirements-as-Code)

Lint, diff, and analyse product requirements from the command line

Product requirements are often trapped in documents, making them difficult to review, validate, and track over time.

RAC brings software engineering workflows to product requirements.

Write requirements in Markdown. Store them in Git. Validate them, compare versions, and analyse change over time.

Markdown
    ↓
Product Model
    ↓
Validation
    ↓
Diffing
    ↓
Portfolio Analysis
    ↓
AI Review (future)

Why RAC?

Engineers have mature tooling for code:

  • Linters
  • Code review
  • Diffs
  • Static analysis
  • Version control

Product requirements typically have none of these.

RAC applies the same principles to product requirements.

Validate

rac validate bond_dashboard.md

Compare

rac diff bond_dashboard_v1.md bond_dashboard_v2.md

Analyse

rac stats ./features

(planned for v0.2)


Example

Create a requirement file:

# Bond Dashboard

## Problem

Retail investors struggle to understand interest-rate exposure.

## Requirements

- [REQ-001] User can view portfolio holdings
- [REQ-002] User can view portfolio duration
- [REQ-003] User can view portfolio yield

## Success Metrics

- Monthly Active Users
- Dashboard Views

## Risks

- Inaccurate market data

Validate it:

rac validate bond_dashboard.md

Output:

PASS

Now compare two versions:

rac diff bond_dashboard_v1.md bond_dashboard_v2.md

Output:

Added Requirements

+ REQ-004 View projected yield forecast

Modified Requirements

~ REQ-002

Before:
User can view portfolio duration

After:
User can view and compare portfolio duration

RAC compares product changes, not just text changes.


Installation

Using pip

pip install requirements-as-code

Using uv

uv tool install requirements-as-code

Verify installation:

rac --help

Quick Start

Create a file:

touch feature.md

Add requirements:

# Trade Alerts

## Problem

Investors miss important market movements.

## Requirements

- [REQ-001] User can create a trade alert
- [REQ-002] User can edit a trade alert
- [REQ-003] User can delete a trade alert

Validate:

rac validate feature.md

Compare versions:

rac diff old.md new.md

Philosophy

RAC follows a few simple principles.

Markdown First

Requirements should remain easy to write and review.

RAC uses Markdown as the source format.

No proprietary editors.

No custom file formats.

Git Native

Requirements should work naturally inside:

  • GitHub
  • GitLab
  • VS Code
  • Cursor
  • Claude Code

AI Optional

RAC should be useful without AI.

The foundation is:

  • structure
  • validation
  • diffing
  • analysis

AI is an enhancement, not a dependency.

Product Model

Internally, RAC converts Markdown into a structured Product Model.

Markdown
    ↓
Parser
    ↓
Feature Model
    ↓
Validation
    ↓
Diffing
    ↓
Stats

This enables reliable analysis without relying on fragile text processing.


Markdown Specification

Every feature is represented by a single Markdown file.

Example:

# Feature Title

## Problem

Problem statement.

## Requirements

- [REQ-001] Requirement text
- [REQ-002] Requirement text

## Success Metrics

- Metric 1

## Risks

- Risk 1

Required Sections

Required:

  • # Title
  • ## Problem
  • ## Requirements

Optional (recommended):

  • ## Success Metrics
  • ## Risks

Commands

Validate

Validate a requirement file.

rac validate feature.md

Checks:

  • Required sections exist
  • Requirement IDs are valid
  • Requirement IDs are unique
  • Requirement text is not empty

Warnings:

  • Missing risks
  • Missing success metrics
  • Duplicate requirement text
  • Ambiguous wording

Diff

Compare two versions of a feature.

rac diff old.md new.md

Detects:

  • Added requirements
  • Removed requirements
  • Modified requirements
  • Added metrics
  • Removed metrics
  • Added risks
  • Removed risks

Requirements are matched by ID.


Stats (Planned)

Portfolio-level analysis.

rac stats ./features

Example output:

Portfolio Overview
==================

Features: 12

Requirements: 87

Success Metrics: 24

Risks: 18

Features Missing Risks: 3

Features Missing Metrics: 2

Review (Planned)

AI-assisted product review.

rac review feature.md

Potential checks:

  • Missing requirements
  • Missing risks
  • Ambiguity
  • Product concerns
  • Engineering concerns

RAC will use the user's configured AI provider rather than requiring hosted infrastructure.


Roadmap

v0.1

  • Markdown parser
  • Product Model (AST)
  • Validation
  • Diffing
  • CLI

v0.2

  • Portfolio statistics
  • Quality metrics
  • Repository-wide analysis

v0.3

  • AI review
  • Provider abstraction
  • Git-aware workflows

v1.0

  • Product intelligence
  • Daily product briefs
  • VS Code integration

Contributing

Contributions, ideas, and feedback are welcome.

The project is intentionally focused on one goal:

Treat product requirements like code.


License

MIT

Project details


Download files

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

Source Distribution

requirements_as_code-0.1.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

requirements_as_code-0.1.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file requirements_as_code-0.1.0.tar.gz.

File metadata

  • Download URL: requirements_as_code-0.1.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for requirements_as_code-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e4085eadf25b6ad26855997017f9263314c6195842ec3f9afbbd6e1571ee1d52
MD5 a236533fe9d114bc990b7de4ab122bd6
BLAKE2b-256 422c02dfcab65e3a66a9cb167246aa999ba06f2a060fc3d4fea17bd2dd3e805d

See more details on using hashes here.

Provenance

The following attestation bundles were made for requirements_as_code-0.1.0.tar.gz:

Publisher: python-publish.yml on tcballard/requirements-as-code

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file requirements_as_code-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for requirements_as_code-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61e69f759c99f9e2740a56cb087adc0a3f6de6d243e7c901a9f4ab75cd88c655
MD5 91a9e222b2ce5957b55dab818cb2864a
BLAKE2b-256 275b76b1f86d73e336de9694a9a16087477b5046a556edba0ce77a850957fd49

See more details on using hashes here.

Provenance

The following attestation bundles were made for requirements_as_code-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on tcballard/requirements-as-code

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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