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. It does not install project-specific agent profiles or automation there.
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.
-
Create the directories:
mkdir -p docs/plans docs/architecture/decisions .github/agents
-
Create
docs/specs.config.yaml, replacingalicewith an approver's GitHub handle. The list must not be empty; quote handles that start with@.approvers: - alice
-
Create
.github/agents/implementer.agent.md:--- description: Implements approved plan tasks. --- Follow the task's acceptance criteria and the project's instructions.
SpecNest checks that the named agent file exists; it does not execute or inspect the profile. Supply real instructions appropriate for your project.
-
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.
-
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.
-
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 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, SpecNest searches the current directory and its parents for
docs/specs.config.yaml. To operate elsewhere, put --root before the
command, for example specnest --root /path/to/project validate.
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:
- Write a
draftplan or ADR, fill in its content, then set its status toreview(plan) orproposed(ADR). - Run
specnest validate. A human approver accepts referenced ADRs and then approves the plan. Approved plans may only rely on accepted ADRs. - Use
next,show, andtaskto work in dependency order. A plan waits for prerequisite plans to bedone; a task waits for prerequisite tasks to bedone. Use--status blocked --reason "..."when work cannot proceed. - 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; templates are not installed into your project automatically.
You can write your own or copy the example
plan and
ADR templates from this checkout:
mkdir -p docs/templates
cp "/path/to/SpecNest/tests/fixtures/templates/plan.md" docs/templates/plan.md
cp "/path/to/SpecNest/tests/fixtures/templates/adr.md" docs/templates/adr.md
specnest new plan "Improve the smoke check" --owner alice
specnest new adr "Choose a test runner" --owner alice
Replace /path/to/SpecNest with the checkout path. 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.Ztag does the same, then uploads the same files to PyPI. The tag must match the version inpyproject.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.0.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 |
|---|---|---|---|---|
| specnest-1.0.0.tar.gz | 44.1 kB | Without provenance | Details for specnest-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| specnest-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for specnest-1.0.0-py3-none-any.whl |
Total release size: 71.9 kB
Release files / specnest-1.0.0.tar.gz
| Download URL | specnest-1.0.0.tar.gz |
|---|---|
| Size | 44.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52044503941a72c7bf6f0096e79570e3fb0bf0eb219a6c3a691e6485c70b1eab
|
|
BLAKE2b-256 checksum How to use checksums |
e691d515a6b977648427349d7d6ea57def4f3eef3f9dcb93338bc917a014f80e
|
| 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.0.0-py3-none-any.whl
| Download URL | specnest-1.0.0-py3-none-any.whl |
|---|---|
| Size | 27.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8fc989e6efa6552856b45a7bb83c809009f6e4a568481dffc0ed7fb81685e572
|
|
BLAKE2b-256 checksum How to use checksums |
d4cf2283153c2d71d1fe40f508369aacc90db56f26e966bd23bb5b1960620a7c
|
| 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.0.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.