Portable Responsive Document
PRD is a structured, profile-based, portable document format and ecosystem designed to support responsive document behavior beyond static traditional formats like PDF.
PRD is intended to preserve the strengths of portable documents while improving:
- responsive reading
- semantic structure
- profile-aware behavior
- long-term extensibility
- modern viewing experiences
PRD is:
- a portable document/package format
- a manifest-first system
- a structured content model
- a profile-based architecture
- a foundation for viewer and studio tooling
- a disciplined extension-ready ecosystem
PRD is not:
- just a PDF clone
- just a zipped website
- just a viewer app
- just a crypto document idea
Implementation and doc work should follow the canonical docs in this order:
docs/foundation/04_PRD/PRD_FOUNDATION.mddocs/decisions/PRD_DECISIONS.mddocs/foundation/04_PRD/PRD_GLOSSARY.mddocs/foundation/04_PRD/PRD_ROADMAP.mddocs/history/PRD_Project_History_Record.md- the specific target doc being updated
Supporting control docs:
docs/architecture/PRD_SYSTEM_BLUEPRINT.mddocs/architecture/PRD_SYSTEM_ARCHITECTURE.mddocs/governance/PRD_PROFILE_REGISTRY.mddocs/governance/PRD_PROMPT_DOCTRINE.mddocs/prompts/PRD_MASTER_PROMPTS.md
Start at:
docs/README.md
Use these focused paths from there:
- core format and package canon
docs/core/PRD_MINIMAL_VALID_SPEC.mddocs/core/PRD_MANIFEST_DRAFT.mddocs/core/PRD_PACKAGE_LAYOUT_DRAFT.mddocs/core/PRD_VERSIONING_POLICY.md
- runtime contracts
docs/runtime/PRD_CAPABILITY_MODEL.mddocs/runtime/PRD_CONFORMANCE.mddocs/runtime/PRD_CLI_JSON_CONTRACT.md
- control docs
docs/decisions/PRD_DECISIONS.mddocs/governance/PRD_PROFILE_REGISTRY.mddocs/governance/PRD_RELEASE_POLICY.mddocs/governance/PRD_HOSTING_RUNBOOK.md
- product boundaries
docs/product/PRD_PRODUCT_BOUNDARIES.mddocs/product/PRD_AUTHORING_WORKFLOW.mddocs/product/PRD_IMPORT_EXPORT_MATRIX.md
- prompt packs and doctrine
docs/governance/PRD_PROMPT_DOCTRINE.mddocs/prompts/PRD_MASTER_PROMPTS.md
PRD is built around a few core pillars:
- Portable: documents should remain transferable and viewable as files/packages
- Responsive: content should adapt intelligently across device sizes and contexts
- Structured: documents should preserve meaningful semantic structure
- Profile-based: different document types should be supported through explicit profiles
- Extensible: future advanced capabilities should attach through disciplined extensions
PRD is designed to support first-class profiles such as:
general-documentcomicstoryboard
Document kinds such as:
articlereportresumeportfoliomagazine
currently belong inside the general-document family unless later canon promotes them separately.
web novel currently belongs inside the general-document family.
manhua and manhwa currently belong inside the comic family.
Comics and storyboards are intentional parts of the system design, not afterthoughts.
This repository is the early implementation home for the PRD foundation.
The initial goal is not to build the full ecosystem at once.
The initial goal is to establish a clean executable base for:
- manifest design
- package layout
- profile modeling
- validation
- example PRD packages
- a minimal viewer
The first implementation phase focuses on:
- manifest schema
- structured content schema
- validator CLI
- example PRD packages
- minimal web viewer
- foundational documentation
Explicitly out of scope for the first foundation layer:
- crypto ownership systems
- payment/commerce systems
- full encryption systems
- full signing/authenticity stack
- live collaborative/network behavior
- giant runtime/script systems
- broad conversion/import platform work
Current implementation-facing assumptions in this repo:
- canonical core profile IDs are
general-document,comic, andstoryboard responsive-documentis treated only as a legacy alias that normalizes togeneral-document- localization is optional and lean at the manifest boundary
- resume remains a document kind inside the
general-documentfamily, not a promoted top-level canonical profile - web novels are treated as
general-documentfamily works - manhua and manhwa are treated as
comicfamily works
This repo is trying to prove a serious base format and toolchain, not every future PRD feature at once.
PRD/
AGENTS.md
README.md
apps/
docs/
examples/
packages/
schemas/
scripts/
Current docs structure:
docs/
architecture/
archive/
core/
decisions/
extensions/
foundation/
governance/
history/
market/
product/
profiles/
prompts/
runtime/
Current implementation structure:
packages/
prd-types/
prd-validator/
prd-packager/
prd-cli/
prd-viewer-core/
apps/
prd-viewer-web/
examples/
document-basic/
document-segmented-basic/
resume-basic/
comic-basic/
storyboard-basic/
A conceptual PRD package looks like:
my-document.prd/
manifest.json
content/
assets/
profiles/
extensions/
protected/
Key ideas:
manifest.jsonis the canonical structural source of truth- core
assetsare packaged reusable resources; linked supplemental references belong underattachments/ content/holds structured document contentassets/holds declared reusable assetsprofiles/supports profile-specific specializationextensions/holds declared extension dataprotected/is reserved for future protected/private data flows
The current top-level scripts are:
pnpm buildpnpm typecheckpnpm testpnpm docs:checkpnpm codex:checkpnpm codex:packpnpm codex:run:webpnpm dev:webpnpm viewer:demo:assetspnpm viewer:demo:buildpnpm viewer:demo:devpnpm examples:packpnpm examples:validatepnpm examples:smokepnpm foundation:gatepnpm runtime:conformancepnpm consumer:smoke:npmpnpm release:audit:registrypnpm release:check
Docs consistency guard scope:
pnpm docs:checkenforces canonical doc-path usage fordocs/**plus root control docs (README.md,AGENTS.md).- Optional root-doc enforcement is available via
node ./scripts/check-docs-consistency.mjs --include-root-docsfor selected non-archive root docs (BUILD_STATUS.md,NEXT_STEPS.md).
Example CLI usage:
prd init ./my-prd --profile general-document
prd import markdown ./source.md --out ./my-prd-from-markdown
prd import images ./pages --profile comic --out ./my-comic
prd validate <path>
prd inspect <path>
prd pack <path> --out ./out.prdCLI output/exit-code contract: packages/prd-cli/README.md.
Versioned machine-readable JSON contract snippets: docs/runtime/PRD_CLI_JSON_CONTRACT.md.
Published reference-viewer runtime corpus: examples/runtime-conformance/runtime-conformance-manifest.json.
Public product and ecosystem boundaries: docs/product/PRD_PRODUCT_BOUNDARIES.md.
Current authoring workflow: docs/product/PRD_AUTHORING_WORKFLOW.md.
Import/export sequencing matrix: docs/product/PRD_IMPORT_EXPORT_MATRIX.md.
Versioning policy across format, manifest, runtime, and npm tooling surfaces: docs/core/PRD_VERSIONING_POLICY.md.
Hosted viewer demo workflow:
pnpm viewer:demo:assets
pnpm viewer:demo:build
pnpm viewer:demo:build:cloudflare
pnpm viewer:demo:build:github-pages
pnpm viewer:demo:devviewer:demo:assets packs canonical examples and copies selected .prd archives into the web viewer's ignored public/examples/ directory for the hosted demo. Those hosted samples are demo assets only; they do not change PRD's packaged-first loading contract.
The hosted app has three public routes in one deployable Vite build: / is Home, /viewer/ is the reference Web Viewer workspace, and /docs/ is the public docs index. The intended production host is Cloudflare Pages at prd.eonhive.com; GitHub Pages remains the temporary staging/fallback path served beneath the configured /prd/ base path. Hosting operations are tracked in docs/governance/PRD_HOSTING_RUNBOOK.md.
The public /docs/ route is a user-friendly navigation layer over canonical repo docs. It does not replace docs/, and it intentionally does not link the tracked codex/ operational planning files.
Cloudflare Pages should build from the repository root with pnpm viewer:demo:build:cloudflare and output apps/prd-viewer-web/dist. Do not set the Cloudflare project root to apps/prd-viewer-web; the production build needs root access to build the CLI and pack hosted sample archives before the Vite build.
Use this flow when contributing in the monorepo before opening a PR.
For the full contributor workflow and checklist, see docs/contributing.md.
PRD packages resolve locally through pnpm workspace linking plus semver-compatible internal package ranges.
The repo pins that behavior in .npmrc with link-workspace-packages=true.
That keeps changes in packages/* immediately available to apps/* and other packages without publishing to npm, while still producing consumer-safe package metadata for npm releases.
Run:
pnpm installExpected outcome:
- install completes successfully
- internal dependencies resolve to local workspace packages (not downloaded published versions)
- you can edit one package and use it from another package immediately
Run the full gate from repo root:
pnpm typecheck
pnpm test
pnpm build
pnpm examples:smokepnpm examples:smoke is the canonical aggregate smoke command for this repo.
Use pnpm examples:smoke -- --json-summary when you need machine-readable outputs for CI annotations and reporting.
Expected outcome:
pnpm typecheck: exits 0 with no TypeScript type errorspnpm test: exits 0 with all tests passingpnpm build: exits 0 and builds all workspace targetspnpm examples:smoke: exits 0 after running smoke scripts fordocument-basic,resume-basic,comic-basic, andstoryboard-basicpnpm examples:smoke -- --json-summary: exits 0 and writes JSON summaries for CI annotation underexamples/dist/smoke-summaries/pnpm runtime:conformance: exits 0 and writes the reference-viewer runtime summary underexamples/dist/runtime-conformance-summary.json
If all four pass, the local MVP contributor gate is considered green.
The contributor gate command names above should always match the root package.json scripts (typecheck, test, build, examples:smoke).
Use a changeset when your work is intended to change versioned package outputs (for example: public API changes, behavior changes that should ship in a package release, or package dependency/version updates) and is intended for the automated main-branch release flow.
Do not add a changeset for repository-only work that is not intended for package publication (for example: internal docs, planning notes, or other non-releasable maintenance).
Release publication remains CI-driven from main; do not manually publish from feature branches or local workstations except for explicit maintainer emergency recovery.
When a change touches release/check flows, keep smoke gates documented and aligned:
pnpm release:checkshould include the smoke gate via canonicalpnpm examples:smoke- CI/release automation that needs annotations should run
pnpm examples:smoke -- --json-summary
The public npm preview is live for the core PRD tooling packages. Contributors should still focus on local workspace validation and MVP gate health; npm credentials are not required to contribute or verify normal development work.
The current PRD reference stack is:
- packaged-first
- offline-first for the base readable path
- eager whole-package in-memory in the reference viewer and current inspection tooling
This repo does not currently claim streaming, range requests, worker unzip, or lazy section fetch as part of core PRD validity or conformance.
The public npm surface is a 0.1.1 public preview of the PRD tooling packages under the eonhive org:
@eonhive/prd-types@eonhive/prd-validator@eonhive/prd-packager@eonhive/prd-cli
They require Node.js 20+. The viewer packages stay private and are not part of the npm publish set.
The repo root also includes .nvmrc pinned to Node 22 so local release and Codex sessions can match the release workflow directly.
npm install -g @eonhive/prd-cli
prd init ./my-first-prd --profile general-document
prd import markdown ./source.md --out ./my-first-prd-from-markdown
prd import images ./pages --profile comic --out ./my-first-comic
prd validate path/to/package.prdWithout a global install:
npx @eonhive/prd-cli init ./my-first-prd --profile general-document
npx @eonhive/prd-cli import markdown ./source.md --out ./my-first-prd-from-markdown
npx @eonhive/prd-cli import images ./frames --profile storyboard --out ./my-first-board
npx @eonhive/prd-cli validate path/to/examples/document-basic
npx @eonhive/prd-cli pack path/to/examples/document-basic --out ./out.prdprd validate accepts a .prd archive or an unpacked package directory. For programmatic use, depend on @eonhive/prd-validator and import @eonhive/prd-validator/node for filesystem validation (validatePackage).
Source and issues: github.com/eonhive/PRD.
Release management uses Changesets plus the GitHub Actions Release workflow on main. Do not publish from an ad hoc local machine. Use:
pnpm changesetto record package changespnpm release:bootstrapto inspect first-preview bootstrap statepnpm release:checkfor the release gate (including canonicalpnpm examples:smoke)pnpm release:preflightto verify npm token auth,eonhiveorg membership, target package names, and whether the release is in first-preview bootstrap mode or normal versioned-release modepnpm release:audit:registryto verify published npm metadata contains noworkspace:*dependencies and thatlatestpoints to the expected versionpnpm release:statusto inspect pending release state
The release workflow publishes only after the Node 20+ CI gate is green. For the one-time 0.1.0 preview, it runs a publish preflight first, then bootstraps any still-unpublished current preview packages, and then falls back to normal Changesets behavior. For later unified versions such as 0.1.1, the same preflight now passes in normal versioned-release mode without requiring unpublished packages to stay at 0.1.0. The preflight writes examples/dist/release-publish-preflight-summary.json so npm auth and org-scope failures are explicit instead of surfacing first at pnpm publish. After publish, the post-publish verification path now runs a registry metadata audit first and then npm consumer smoke. The audit writes examples/dist/release-registry-audit-summary.json. Maintainer docs live in PRD_RELEASE_POLICY.md and PRD_NPM_RELEASE_RUNBOOK.md; version-surface policy lives in PRD_VERSIONING_POLICY.md.
pnpm foundation:gate is now the canonical repo-level conformance gate. It runs build, tests, docs consistency, example validation, and aggregate example smoke checks, then emits examples/dist/foundation-gate-summary.json.
pnpm runtime:conformance is the canonical reference-viewer runtime corpus check. It evaluates the published fixtures in examples/runtime-conformance/runtime-conformance-manifest.json and emits examples/dist/runtime-conformance-summary.json.
pnpm consumer:smoke:npm is the post-publish external-consumer smoke check. It installs the published @eonhive/prd-* packages from npm in a clean temp project, then exercises prd pack, prd validate, and prd inspect without workspace linking. It emits examples/dist/external-consumer-smoke-summary.json.
The npm preview line started at 0.1.0, but 0.1.0 leaked workspace:* dependency metadata for some published packages. The consumer-safe 0.1.1 patch is now the clean published preview; the broken 0.1.0 versions are deprecated with upgrade guidance, and post-publish registry audit plus npm consumer smoke pass for 0.1.1.
For Codex-driven work, use the repo-local run actions instead of manually piecing together commands:
pnpm codex:checkRunstypecheck,test,build, andexamples:validatein one predictable sequence.pnpm codex:packBuilds the workspace and produces the example.prdarchives underexamples/dist/.pnpm codex:run:webBuilds the workspace, packs the example archives, and starts the web viewer.pnpm viewer:demo:buildPacks canonical examples, prepares hosted sample assets, and builds the deployable PRD Web Viewer demo.pnpm viewer:demo:build:cloudflareBuilds the hosted viewer demo for the root-domain Cloudflare Pages production path.pnpm viewer:demo:build:github-pagesBuilds the hosted viewer demo for the GitHub Pages/prd/staging/fallback path.pnpm viewer:demo:devPrepares hosted sample assets and starts the PRD Web Viewer demo locally.
Codex desktop also reads .codex/environments/environment.toml for this workspace. That file now defines:
Web ViewerCheckRelease CheckBuildTestsPack ExamplesValidate Examples
The environment setup step runs pnpm install in the project root when Codex creates a fresh worktree for this repo.
The repo also now includes .github/workflows/codex-ci.yml, which runs the same Codex check flow automatically on pushes, pull requests, and manual workflow dispatch.
For release automation, the repo also includes .github/workflows/release.yml, which gates npm publication through Changesets and CI on main.
The hosted PRD Web Viewer demo is currently built and deployed by .github/workflows/viewer-demo-pages.yml using GitHub Pages as staging/fallback. The workflow builds with PRD_VIEWER_BASE_PATH=/prd/ and deploys apps/prd-viewer-web/dist, with /prd/ as Home, /prd/viewer/ as the viewer workspace route, and /prd/docs/ as the public docs index. Production is intended to move to Cloudflare Pages at prd.eonhive.com after launch QA. The app includes a Cloudflare Pages _redirects fallback, and the GitHub Pages workflow copies index.html to 404.html for SPA route refresh support.
- Run
pnpm codex:check - Run
pnpm viewer:demo:dev - Open PRD Home at
/and use either light or premium dark mode - Open the viewer workspace at
/viewer/, then load a hosted sample archive or choose/drag a.prdarchive into the viewer drop zone - Open the public docs index at
/docs/ - Confirm package status, package facts, manifest metadata, localization/attachments, and rendered content in the reference viewer
Current example behavior:
document-basicis the canonical small structuredgeneral-documentexample usingcontent/root.jsonand now demonstrates structured links, tables, charts, packaged audio media, one bundled attachment, and a French localized resource overlay for both content and small reader-facing metadata, including localized cover and inline image selectiondocument-segmented-basicproves the Phase 3 segmentation path for largergeneral-documentworks by keeping one canonical root and moving top-level sections into packaged files undercontent/sections/; it also carries one lean collection membership through manifestidentityandpublicresume-basicis a resume-flavored structuredgeneral-documentexample that keeps authored resume metadata underprofiles/resume.json, usespresentation: "scan"for a scan-oriented resume viewer surface, and includes supplemental manifestidentityandpublicreferencescomic-basicis now the canonical structuredcomicexample usingcontent/root.jsonwith image-backed panel cards, optional panel navigation, and one lean manifest-declared series membershipstoryboard-basicis now the canonical structuredstoryboardexample usingcontent/root.jsonwith image-backed frames and optional review-grid behavior
The web viewer also now exposes a locale switcher when a package declares localization and includes localized content mappings under content/locales/index.json. For general-document, the preferred path is one shared structured root plus localized resource overlays; those overlays can localize both the document body and small reader-facing metadata such as summary, cover, lean collection/series labels, and declared image-node asset selection. Full alternate locale roots remain an escape hatch, but they are not the canonical example path.
The reference viewer also now surfaces declared attachments as supplemental links. Bundled attachments resolve from attachments/, while linked attachments remain optional external references and do not replace the packaged base open path.
Larger general-document packages may now also segment top-level sections into packaged files under content/sections/ while keeping manifest.entry pointed at content/root.json. This keeps the small-path example small while still giving bigger works a disciplined scaling path.
Across packages, PRD now also uses a lean collection/series relationship model in the manifest rather than a spine or package-of-packages container. Stable grouping refs live under identity, small display labels live under public, and richer about-the-series material still belongs in content or attachments.
This monorepo preserves the PRD boundary between format and viewer:
- format packages own manifests, profiles, validation, packaging, and package rules
packages/prd-viewer-coreowns open behavior and rendering-model support logicapps/prd-viewer-webowns browser UI and web delivery concerns
The app does not define PRD validity, and the format packages do not depend on React UI code.
The public product boundary is locked in PRD_PRODUCT_BOUNDARIES.md: core PRD defines package validity, the reference stack proves implementation truth, and Studio/Cloud/SDK/PRDc remain optional product or ecosystem layers above the core.
The preferred build order is:
- lock repo rules in
AGENTS.md - define manifest schema
- define base content schema
- implement
prd validate - create
examples/document-basic - build a minimal web viewer
- expand to additional profiles
The first major milestone is:
examples/document-basicvalidates successfully and opens in the viewer.
When contributing, preserve these rules:
- manifest-first architecture
- profile-based design
- viewer/format separation
- structured content over flattened presentation
- explicit extensions over hidden behavior
- portability as a core property
- simplicity in the foundation layer
Avoid turning PRD into either:
- a rigid static print-only format
- an undisciplined packaged web app
Canonical schema definitions for the PRD manifest and structured content models.
Shared core types used across validator, viewer, CLI, and tooling.
Validation logic for manifests, entry paths, resources, and profile alignment.
Packaging logic for producing .prd ZIP archives from source package directories.
Command-line tooling such as:
prd validate <path>Later commands may include packaging, inspection, and profile-aware utilities.
Shared parsing, resolution, support-state, and rendering-model logic for PRD viewing.
A minimal web viewer that proves the concept of PRD in actual use.
Reference PRD packages used for validation, tests, demos, and viewer development.
The first useful deliverables for this repo are:
schemas/manifest.schema.jsonschemas/content.schema.jsonpackages/prd-validatorpackages/prd-cliexamples/document-basicapps/prd-viewer-web
Contributors should:
- make small, reviewable changes
- update docs when format behavior changes
- avoid inventing new canon terminology casually
- add tests for validator behavior
- keep naming consistent across schema, viewer, validator, and examples
Important directional decisions should be recorded in docs/decisions/PRD_DECISIONS.md.
Over time, PRD may support broader tooling and extension lanes such as:
- richer profile systems
- import/export pipelines
- annotations/comments
- signatures
- protected/private content
- ownership/license metadata
- AI helper layers
- other extension-governed capabilities
Those should remain disciplined extensions, not core-foundation clutter.
Current phase: foundation bootstrapping
The project is establishing the minimum serious base needed for PRD to become a real format and ecosystem:
- clear manifest model
- predictable package shape
- validation
- examples
- viewer proof-of-concept
PRD wins by being:
- portable
- structured
- profile-aware
- responsive
- extensible
It does not win by becoming a prettier PDF clone or a random packaged app mess.