Skip to main content

plan-doc

Typed parser for plan-file YAML frontmatter (schema v1). Extracts the machine-readable fields a plan-driven-PR workflow needs — template, disposal, branch, a planner-handoff dossier block — from markdown plan documents. Validation is strict on plan-doc's own fields (loud failures on bad values and typos) but lenient on foreign top-level fields a host project carries alongside the schema (captured in .extra).

Source is maintained in a private monorepo. Releases are built and published by GitHub Actions through a PyPI Trusted Publisher; provenance attestations are visible on the PyPI file listing.

from pathlib import Path
from plan_doc import PlanDoc, PlanDocError, NonDraftPrFrontmatterError

doc = PlanDoc.from_path(Path("docs/plans/my-plan.md"))
if doc.disposal == "delete-on-merge":
    ...
if doc.dossier is not None:
    files = doc.dossier.get("files", [])

What it enforces

  • Schema v1. plan_schema: 1 is required; template, disposal, phase, cleanup_trigger, ticket, branch, tdd_mode, dossier are plan-doc's own top-level keys. Foreign top-level keys (a host project's own frontmatter convention — id, title, status, …) are tolerated and captured in PlanDoc.extra, so a plan can carry both schemas at once. The typo guard survives: an unknown key within edit-distance 1 of a known field still raises PlanDocError (dispozal fails loud), so a misspelling can't silently disable disposal/minimal handling. (Lenient policy since 0.1.1; 0.1.0 rejected every non-schema key.)
  • First-block-only parsing. Only a ---...--- block at the very top of the file is frontmatter. Body-level --- horizontal rules are never split on.
  • Foreign-document discrimination. Valid frontmatter with no plan_schema and no plan indicator fields raises the typed subclass NonDraftPrFrontmatterError, so callers can treat non-plan documents leniently without swallowing real validation errors.
  • No frontmatter at all raises PlanDocError with an actionable message (add plan_schema: 1).

Dependency note

pyyaml is a hard dependency, and the module also keeps a minimal no-yaml fallback parser (_parse_yaml_minimal) for simple key: value frontmatter. Both halves are deliberate: the upstream source of this module runs in a zero-pip environment and relies on the fallback, while the package declares full functionality. The fallback is covered by tests here — don't remove either half.

Provenance

Originally extracted (code byte-identical, module docstring reframed) from the draft-pr skill of the m0j0d portfolio plugin. As of 2026-06-14 this package is the canonical source of truth: the plugin's vendored copy was deleted and plugin now consumes this package via editable install.

Pool purity rule: transport-free, LLM-agnostic, no secrets. Pure parsing; the only I/O is Path.read_text in PlanDoc.from_path.

License

MIT

Metadata

Release files for plan-doc 0.1.4

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

Source distribution (sdist)

Source distribution for plan-doc 0.1.4
File Size Uploaded Provenance Actions
plan_doc-0.1.4.tar.gz 16.7 kB With provenance Details for plan_doc-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for plan-doc 0.1.4
File Interpreter ABI Platform Actions
plan_doc-0.1.4-py3-none-any.whl Python 3 none any Details for plan_doc-0.1.4-py3-none-any.whl

Total release size: 27.7 kB

Release files / plan_doc-0.1.4.tar.gz

Download URL plan_doc-0.1.4.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d37b3ac22b7458d9f0ad788982d4f4e142fda768ed4aeddf43bd9410453dac5b
BLAKE2b-256 checksum
How to use checksums
2d03f5f7aa42e19958577b8b82765e74016446f3e2e19e13766701098d32db37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / plan_doc-0.1.4-py3-none-any.whl

Download URL plan_doc-0.1.4-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec89003435c4161770616ee403b043629941f9028ef54476561157c564cc1def
BLAKE2b-256 checksum
How to use checksums
67f1c1ea1f72df8b91ba2dbb987480cc599cbd1eb0d38d3b14701a1629e510e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Security for plan-doc 0.1.4

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for plan_doc-0.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

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