Skip to main content

SpecNest

SpecNest is a CLI for validating and coordinating spec-driven development. It stores plans, tasks, and architecture decision records (ADRs) as Markdown with YAML metadata. Humans review and approve the specifications; implementers use the CLI to find and update ready tasks.

The CLI uses a small, fixed documentation layout in the consuming project. Initialization provides a generic starter agent profile, which you can adapt to your project; SpecNest does not execute agents or install automation.

Installation

SpecNest requires Python 3.11 or newer. From a checkout of this repository, install it into your Python environment:

python -m pip install .
specnest --version

PyYAML is installed as a dependency. python -m specnest is equivalent to specnest if the environment's scripts directory is not on your PATH.

Quick start

The following example is for a new or empty consuming project. If your project already has these files, integrate the examples rather than overwriting them. Run the commands from that project's root.

  1. Initialize the project, replacing alice with a human approver's GitHub handle:

    specnest init --approver alice
    

    You can omit --approver to enter the handle interactively. It is required for a new configuration when input is not interactive. The command creates docs/specs.config.yaml, starter plan and ADR templates, the default implementer agent profile, and the plan and ADR directories. It never overwrites existing files; if a configuration already exists, an explicitly supplied approver must already be listed there. Edit the starter files to suit your project. Initialization rejects symlinked directories rather than writing through them.

  2. Create docs/architecture/decisions/ADR-0001-use-python.md:

    ---
    id: ADR-0001
    title: Use Python for the smoke check
    status: proposed
    owner: alice
    created: 2025-01-01
    updated: 2025-01-01
    supersedes: []
    ---
    
    # ADR-0001: Use Python for the smoke check
    
    ## Context
    
    The example needs a portable command.
    
    ## Decision
    
    Use Python to print a known string.
    
    ## Consequences
    
    The check requires Python.
    
  3. Create docs/plans/PLAN-0001-add-a-smoke-check.md:

    ---
    id: PLAN-0001
    title: Add a smoke check
    status: review
    owner: alice
    created: 2025-01-01
    updated: 2025-01-01
    adrs: [ADR-0001]
    depends_on: []
    ---
    
    # PLAN-0001: Add a smoke check
    
    ## Context
    
    The example needs a repeatable smoke check.
    
    ## Goals
    
    - Verify a simple Python command.
    
    ## Non-goals
    
    - Monitor a production service.
    
    ## Approach
    
    Follow ADR-0001 and verify the command's output.
    
    ## Tasks
    
    ### PLAN-0001-T01: Verify the smoke check
    
    ```yaml
    status: todo
    depends_on: []
    agent: implementer
    ```
    
    Run the command and check its output.
    
    **Acceptance criteria**
    
    - [ ] `python -c "print('ok')"` prints `ok`.
    
    ## Validation
    
    Repeat the acceptance criterion.
    
    ## Risks
    
    - This example does not check application behavior.
    
  4. Validate, approve the ADR before the plan, and work through the task. Use the configured approver's handle in place of alice:

    specnest validate
    specnest approve ADR-0001 --by alice
    specnest approve PLAN-0001 --by alice
    specnest list
    specnest next --json
    specnest show PLAN-0001-T01
    specnest task PLAN-0001-T01 --status in-progress
    python -c "print('ok')"
    specnest task PLAN-0001-T01 --status done
    specnest validate
    

Completing the last task automatically marks the plan done. SpecNest does not run acceptance criteria or authenticate the person named by --by; use your own review process and access controls.

Commands

specnest --help
specnest <command> --help
Command Purpose
specnest init [--approver HANDLE] Initialize a project without overwriting existing files.
specnest validate Report errors and warnings across all plans and ADRs. Warnings alone do not fail validation.
specnest list List plans and ADRs, including task progress.
specnest next [--plan PLAN-0001] [--json] Select a ready task from approved plans; resume an in-progress task before a new one within the same plan.
specnest show ID Show a task brief or summarize a plan or ADR.
specnest task ID --status STATUS [--reason TEXT] Update a task. Status is todo, in-progress, done, or blocked; a blocked task requires a reason.
specnest approve ID --by HANDLE Record a human approval and seal the plan or ADR.
specnest new {plan,adr} TITLE [--owner HANDLE] Create a draft from a project-supplied template.

Without --root, init uses the current directory; other commands search it and its parents for docs/specs.config.yaml. To operate elsewhere, put --root before the command, for example specnest --root /path/to/project init --approver alice.

Exit codes are 0 for success, 1 for validation or workflow errors, 2 for argument errors, and 3 when next finds no ready task. With next --json, the success response contains task, title, status, agent, plan, and plan_path; the no-task response contains "task": null and a list of "reasons".

Repository format and workflow

SpecNest looks for files in these locations, relative to the project root:

docs/specs.config.yaml                  # approvers
docs/plans/PLAN-0001-example.md         # plans
docs/architecture/decisions/ADR-0001-example.md
docs/templates/plan.md                  # required only for "new plan"
docs/templates/adr.md                   # required only for "new adr"
.github/agents/implementer.agent.md     # one file per referenced agent

Plan and ADR filenames must start with their ID; PLAN-0001.md and ADR-0001.md are also accepted. Both types require id, title, status, owner, created, and updated front matter; dates use YYYY-MM-DD. The H1 must be # ID: Title. Plans need Context, Goals, Non-goals, Approach, Tasks, Validation, and Risks sections; ADRs need Context, Decision, and Consequences. Incomplete sections and placeholders are warnings in drafts and errors when the document is ready for review or approval.

Under a plan's ## Tasks section, each task has a heading such as ### PLAN-0001-T01: Title, followed immediately (apart from blank lines) by a fenced YAML metadata block and an Acceptance criteria list. The metadata may contain status, depends_on, agent, and blocked_reason; task dependencies are task ID lists, and the default agent is implementer. Plan depends_on and adrs are lists of plan IDs and ADR IDs respectively. The validator checks references, task and plan dependency cycles, agent files, statuses, and approval seals.

A typical lifecycle is:

  1. Write a draft plan or ADR, fill in its content, then set its status to review (plan) or proposed (ADR).
  2. Run specnest validate. A human approver accepts referenced ADRs and then approves the plan. Approved plans may only rely on accepted ADRs.
  3. Use next, show, and task to work in dependency order. A plan waits for prerequisite plans to be done; a task waits for prerequisite tasks to be done. Use --status blocked --reason "..." when work cannot proceed.
  4. After the last task is done, the plan becomes done. Reopening a completed task is rejected when dependent work has already started.

Approvals detect changes to sealed content. Task status and blocked reason, along with selected administrative front matter, may change without breaking the seal. To amend an approved plan, return it to review, remove its approval block, make the changes, and have a human approve it again. A deprecated or superseded ADR puts dependent approved plans on hold until they are amended and re-approved. See Architecture for details and limitations.

Scaffolding drafts

new needs docs/templates/plan.md or docs/templates/adr.md in the consuming project. init copies the bundled plan and ADR templates there if they do not already exist. You can edit or replace them with your own:

specnest new plan "Improve the smoke check" --owner alice
specnest new adr "Choose a test runner" --owner alice

Templates use {{id}}, {{title}}, {{owner}}, and {{date}} substitutions. The owner defaults to the first configured approver. Fill in the resulting drafts and replace their placeholders before review.

Development

With uv installed, set up the locked development dependencies and run the test suite from this checkout:

uv sync --locked
make test

The tests use temporary project directories; they do not require a GitHub account or modify a consuming project. Without Make, run uv run --locked python -m pytest -q instead.

Contributing

Issues and pull requests are welcome. Before opening a pull request, run make test and describe the changes and their intended behavior.

By submitting a contribution, you confirm that you have the right to submit it and agree to license it under the project's MIT license.

Publishing

Releases go to TestPyPI first, then to PyPI:

Command What it does
make publish-test Runs the tests, builds the sdist and wheel in dist/pypi, and uploads the current version to TestPyPI.
make verify-test Installs the current version's wheel from TestPyPI in an isolated environment and checks specnest --version.
make publish Runs the tests, builds, verifies the TestPyPI release, and uploads the same version to PyPI.

make publish stops before uploading if the current version is not installable from TestPyPI. PyPI and TestPyPI versions are immutable and public; use a new version for every release and keep the version in pyproject.toml and src/specnest/__init__.py in sync.

Uploads authenticate with API tokens, never with a username and password. TestPyPI and PyPI are separate services, so create an account, enable 2FA, and create an API token on each: TestPyPI and PyPI. The first upload of a new project needs an account-scoped token; afterward, replace it with a project-scoped token. Both registries upload through their /legacy/ endpoint, which is PyPI's current upload API despite its name.

In Bash or Zsh, enter each token without echoing it or saving it in shell history:

printf 'TestPyPI token: '
read -rs TEST_PYPI_TOKEN; echo
export TEST_PYPI_TOKEN
make publish-test
make verify-test
unset TEST_PYPI_TOKEN

printf 'PyPI token: '
read -rs PYPI_TOKEN; echo
export PYPI_TOKEN
make publish
unset PYPI_TOKEN

Do not commit tokens.

Publishing from GitHub Actions

.github/workflows/publish.yml publishes with Trusted Publishing, so no tokens are stored in GitHub:

  • Run workflow (manual) runs the tests, builds, uploads to TestPyPI, and verifies the install.
  • Pushing a vX.Y.Z tag does the same, then uploads the same files to PyPI. The tag must match the version in pyproject.toml.

See the release management guide for one-time setup, the complete release procedure, and local publishing details.

To release:

git tag vX.Y.Z
git push origin vX.Y.Z

License

The package is distributed under the MIT license. The implementation and license are attributed to A42SS; see LICENSE for the full terms.

The software is provided as is, without warranty. Use it at your own risk: review changes and keep backups before running commands that modify files.

Metadata

Release files for specnest 1.1.0

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

Source distribution (sdist)

Source distribution for specnest 1.1.0
File Size Uploaded Provenance Actions
specnest-1.1.0.tar.gz 47.9 kB Without provenance Details for specnest-1.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 79.4 kB

Release files / specnest-1.1.0.tar.gz

Download URL specnest-1.1.0.tar.gz
Size 47.9 kB
Tags Source
SHA-256 checksum
How to use checksums
75cbcd4b927bf7568f752cf5232ef0dd74347ae50935e5632dbbee2d67592a51
BLAKE2b-256 checksum
How to use checksums
4d4abdcaf24459c7d577582f65a85eb374bac70be2a71404c07b3266cd285abc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / specnest-1.1.0-py3-none-any.whl

Download URL specnest-1.1.0-py3-none-any.whl
Size 31.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12b7d68396e1143f86d0034657d5a00145d8b010b5049c6f72a0983df8b5ace1
BLAKE2b-256 checksum
How to use checksums
64e7bcb37016f3d9d612a32384dc069a6430abb416648b9b687cb1251a38636a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for specnest 1.1.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.

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.

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