feat(openprd): implement the OpenPRD standard — engine, CLI, conformance bundle - #100
Merged
Conversation
…nce bundle
OpenPRD has existed as a document (docs/openprd.md), a front-matter schema, a
template, and this repo's prd/ collection. Nothing enforced it. This adds the
reference implementation.
@logicsrc/openprd
- parser: front-matter + the eight `##` sections + numbered requirements.
`###` stays content so a long Requirements section can be organized, and
headings or R#-shaped lines inside code fences are ignored
- validation splits the standard's four conformance rules (filename,
front-matter schema, id-matches-prefix, eight sections in order) from
lint (empty section, missing priority tag, numbering gaps, duplicate R#,
date order, one-sided supersession, stale index). Conformance failures are
errors; --strict promotes the rest. Stable codes, file, line, hint
- collection rules the per-file view cannot see: unique ids, monotonic
numbering with no gaps, 0000 reserved for the template, cross-references
that resolve
- lifecycle enforced rather than advisory: Draft cannot jump to Final,
terminal statuses do not resume, Superseded must name its replacement
- deterministic index generation, so `prd index` is idempotent and CI can
diff it
- front-matter rewriting that leaves the body byte-identical
- the optional LogicSRC task bridge the standard describes: each R# becomes
one logicsrc.task, validated against logicsrc-task.schema.json before it
is emitted; creator DID derived from the author email
CLI: logicsrc prd init|new|list|show|validate|lint|index|status|next|tasks|
export. Exit codes stable for CI (0 ok, 1 invalid, 2 usage, 3 not found).
Conformance bundle: packages/schemas/fixtures/openprd/ — 6 documents that must
validate and 12 that must fail, each naming the error code it must produce.
Several rules depend on the filename, so every fixture records the name it is
validated as.
Docs: an Implementation section in docs/openprd.md (CLI, validation model,
task bridge, conformance bundle), the spec added to the site's docs surface,
nav and sitemap entries, and a README section.
Verification: 76 new tests; full monorepo build and all 451 workspace tests
pass. The suite dogfoods this repo — prd/ validates with zero errors and zero
warnings, the embedded template is byte-identical to docs/openprd/0000-
template.md, and all 210 requirements in PRD 0001 map to schema-valid tasks.
prd/README.md is regenerated by the tool it now ships.
Refs: docs/openprd.md
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenPRD has existed as a document —
docs/openprd.md, a front-matter schema, a template, and this repo'sprd/collection. Nothing enforced it. This adds the reference implementation.45 files, ~3.6k lines.
@logicsrc/openprd##sections, numbered requirements.###stays content so a long Requirements section can be organized, and headings orR#-shaped lines inside code fences are ignored. Handles- R1 [P0] …and the bolded- **R1 [P0]** …style real PRDs use.R#, date order, one-sided supersession, stale index). Conformance failures are errors;--strictpromotes the rest. Every finding carries a stable code, file, line, and hint.0000reserved for the template, cross-references that resolve.Draftcannot jump toFinal, terminal statuses do not resume,Supersededmust name its replacement.prd indexis idempotent and CI can diff it.R#becomes onelogicsrc.task, validated againstlogicsrc-task.schema.jsonbefore emission.CLI
logicsrc prd init logicsrc prd new "Expand the parked-domain service" logicsrc prd validate --strict logicsrc prd status 0001 Review logicsrc prd tasks 0001 --priority P0init|new|list|show|validate|lint|index|status|next|tasks|export. Exit codes stable for CI:0ok,1invalid,2usage,3not found.Conformance bundle
packages/schemas/fixtures/openprd/— 6 documents that must validate, 12 that must fail, each naming the error code it must produce. Several rules depend on the filename, so every fixture records the name it is validated as.Verification
prd/validates with zero errors and zero warnings, the embedded template is byte-identical todocs/openprd/0000-template.md, and all 210 requirements in PRD 0001 map to schema-valid tasksprd/README.mdis now regenerated by the tool it ships — the hand-written index it replaced was correctly flagged as staleNote
The standard document itself is unchanged except for a new Implementation section. A PRD is still just a file: none of this is required for a document to conform.
🤖 Generated with Claude Code