PRD-driven Context Engineering: A systematic approach to building AI-powered products using progressive documentation and context-aware development workflows
> /plugin marketplace add mattgierhart/PRD-driven-context-engineering> /plugin install prd-ce@prd-ce-methodology
Repo: mattgierhart/PRD-driven-context-engineering
What's inside
Your AI partner is brilliant in one session and amnesiac by the next. This repository is the fix: a fork-ready methodology that turns documentation into a knowledge graph humans and AI navigate together โ so the 50th session is smarter than the 1st.
Quick Start ยท The Idea ยท The Lifecycle ยท The Skills ยท Live Demo Views
โญ If this changes how you build with AI, star the repo โ stars put this method in front of the next team drowning in context drift.
Every era of software solved memory its own way โ and broke it its own way:
The common mistake is treating these as tooling problems. They are memory problems.
PRD-Led Context Engineering builds Shared Memory: it treats AI as a team member, not a tool, and keeps documentation synchronized with code so humans and AI navigate the same truth.
This methodology comes from two converging experiences.
Leading human teams โ alignment always followed the same pattern: rally around a single Source-of-Truth artifact and the team moves as one. Without it, even great talent drifts.
Partnering with AI โ sometimes the model performs at a senior level, sometimes it hallucinates. The variable was never the model's intelligence. It was the Context Density provided: rich, structured context in; senior-level output out.
The convergence: documentation is not an afterthought. Documentation is the infrastructure of shared memory.
The Golden Rule: If it isn't part of the memory infrastructure, it isn't true.
So every durable decision gets a Unique ID (UJ-101, BR-004, API-045) in a Source-of-Truth file. That ID is a memory node with weight: when the AI references BR-004, it isn't guessing โ it's retrieving a specific, validated decision you encoded. The linked network of IDs across files is the Knowledge Graph, and it lives in plain markdown, in your repo, under version control.
PRD_v2.md, ever. One document, many versions, single current reality.This changes how work is measured, not just how it's tooled:
| Traditional Agile | PRD-Led Context Engineering | The Shift |
|---|---|---|
| Sprints | Context Windows | We don't time-box based on dates; we scope-box based on cognitive capacity. |
| User Stories | Prompts | We don't write descriptions; we engineer prompts that deterministically load context. |
| Tribal Knowledge | Source of Truth | If it isn't in the Knowledge Graph (SoT/), it doesn't exist. |
| Standups | Documentation Hooks | No status meetings. Event-driven hooks handle context loading, gate checks, and memory handoffs. |
| Project Management | Context Governance | We don't task-manage people. The system gates execution until context is verified valid. |
Everything below ships in this repo, works offline, and forks in one click:
| Feature | What it gives you |
|---|---|
| ๐ง The Knowledge Graph | 14 SoT files, 21 ID types, zero databases โ durable memory in markdown |
| ๐ The Progressive PRD | A gated v0.1 โ v1.0 lifecycle that stops AI from one-shotting your architecture |
| ๐ 47 Skills | Stage playbooks from problem framing to crossing the chasm โ Dunford, Hormozi, Moore, Torres built in |
| ๐ Readiness Scoring | The repo computes whether you're ready to advance โ and what to fix first |
| ๐ซ The Development Graph | @implements tags bridge code to specs; drift surfaces as a verdict, not a surprise |
| ๐ฐ The Human Review Layer | Every SoT file rendered as a styled, hyperlinked page its reviewer actually wants to read |
| ๐ค The Agent Squad | Four role agents with persistent memory, coordinated through files instead of meetings |
The pitch: long-term product memory with no database, no SaaS, no lock-in โ just files with discipline.
The architecture is 3 + 1 + SoT + Temp, designed to manage Context Density for both human cognitive load and AI context windows:
README.md โ the Dashboard (where am I? what is active?)PRD.md โ the Strategy (why and what)CLAUDE.md โ the Physics (how the AI must behave)epics/: the only variable state. An EPIC frames one problem as one context window.SoT/SoT.*.md: the immutable facts. Business Rules (BR-), User Journeys (UJ-), API Contracts (API-), and 18 more ID types. Nothing duplicated; everything referenced by ID.temp/: the scratch pad. Files attach to the active EPIC and get harvested to SoT before the EPIC closes.Just-in-Time Context: instead of dumping documentation into the context window, reference specific IDs (
UJ-101,API-002). Fewer input tokens, deeper understanding.
The pitch: the "One-Shot" โ asking AI to build the whole app at once โ produces generic code and rapid drift. The Progressive PRD makes that impossible by design.
PRD.md is a gated workflow, not a document. The AI focuses on one stage at a time, and no stage advances until its Definition of Done is met:
| Version | Name | Focus | Definition of Done (DoD) |
|---|---|---|---|
| v0.1 | Spark | Problem & Outcomes | Problem defined, Outcomes measurable, Open Questions list. |
| v0.2 | Market Definition | Segments & ICP | Segments sized, "Not For" defined, Business Rules (BR-) created. |
| v0.3 | Commercial Model | Value & Pricing | Competitors profiled, Pricing model, Monetization rules. |
| v0.4 | User Journeys | Personas & Flows | Core journeys mapped (UJ-), Dependencies (API-) noted. |
| v0.5 | Red Team Review | Risks & Feasibility | Risks (Market/Tech) identified, Mitigations linked to tests. |
| v0.6 | Architecture | Technical Strategy | Stack selected, API contracts (API-) drafted, ARC- conformance rules, Cost guardrails. |
| v0.7 | Build Execution | Implementation Loop | Code tested (TEST-), SoT updated, code traced to specs (Development Graph), Epic loop execution. |
| v0.8 | Release & Deployment | Operational Readiness | Runbooks (RUN-), Monitoring (MON-, MON-DRIFT-), Rollback plan, Changelog system, MOPS handoff. |
| v0.9 | Launch | Go-to-Market | Positioning (Dunford), Offer (Hormozi), Channels (ORB), Launch metrics (KPI-), Feedback channels (CFD-), Tactical playbooks (AEO, alternatives, outreach, HN/Reddit). |
| v1.0 | Growth | Market Adoption | Adoption stage (ADO-STAGE-), Beachhead (ADO-BEACHHEAD-), Whole product (ADO-WHOLE-), References (ADO-REF-), Continuous discovery, Case studies, Testimonials. |
Why gates work: constrained focus prevents the AI from guessing the architecture before it understands the users; deep focus produces meaningful IDs; the result is not just a working product but a desirable one.
The paradox that makes it practical: gates provide focus; the ecosystem provides agility. Because documentation is modular and interlocked, you can revisit any stage just-in-time โ customer feedback during Build doesn't restart the plan, it updates the BR- rules and lets hooks propagate the change.
The pitch: the lifecycle isn't advice โ it's executable. Every stage ships with skills that know what to consume, what IDs to produce, and which gate they feed.
prd-v01-* โ prd-v10-*): problem framing, competitive landscape, pricing, persona definition, journey mapping, risk discovery, architecture design, epic scoping, test planning, release planning, GTM strategy, case studiesโฆghm-*): gate checks, SoT building, ID registration, insight harvesting, status sync.quick (founder gut-check, <15 min), standard (default), deep (investor-ready, with assumption logs) โ so the method scales from solo founder to team.Every skill emits Consumes / Produces sections in SoT IDs, which is what keeps the knowledge graph connected as you move through stages.
The pitch: before advancing a stage or starting an EPIC, the repo already knows whether you're ready โ and why not.
Readiness is a three-layer graph over the artifacts you already author:
All three write to one file โ status/readiness.json โ with causal links intact: an EPIC's unmet criterion points at its caused_by SoT file; the top blockers are ranked by downstream impact. The highest-leverage fix is rarely the lowest-scoring file โ it's the lowest-scoring file blocking the most EPICs. The system tells you which.
python scripts/readiness.py run # compute all layers + print report
python scripts/readiness.py status # print last-computed report
python scripts/readiness.py run --json # machine-readable output for hooks/CI
Exit codes 0/1/2 map to PASS / WARN / BLOCK (thresholds: warn=70, block=50, overridable per item). The ghm-gate-check skill delegates here for stage-advancement decisions.
Once building starts (v0.7), the code itself joins the knowledge graph. An AST pass extracts code nodes into status/devgraph.json; the @implements / @verifies tags you write under rule 04 become bridge edges linking each code unit to the spec it realizes. Readiness then measures reality, not just spec health:
implementation_coverage โ which scoped specs actually have implementing codearchitecture_conformance โ do the ARC- rules still hold in the as-built system (drift = a violate verdict, not a surprise in review)Untagged code shows up as an orphan node โ a context leak you can see. The same devgraph.json powers the HeartBeat visualizer: a live pulse of built / unbuilt / drifted. See docs/DEVELOPMENT_GRAPH.md.
Deeper reading: .claude/rules/07-readiness-protocol.md ยท docs/READINESS_PROTOCOL.md
The pitch: markdown SoT files are optimized for agents and diffs. Humans reviewing a gate deserve a better reading surface โ so every SoT file ships with a styled, hyperlinked HTML view in the format its natural reviewer already expects. Start at SoT/html/index.html (opens from file://, no build step, no JS).
The contract: markdown stays authoritative; the HTML is a render. Entry anchors equal unique IDs (SoT.BUSINESS_RULES.html#BR-001), and every cross-reference is a hyperlink โ a reviewer walks the knowledge graph by clicking, the same way an agent walks it by ID.
![]() | ![]() |
The Atlas (index.html) โ registry of every view, ID anatomy, graph patterns | User Journeys โ trigger โ steps โ value moment, the way design reviews read flows |
![]() | ![]() |
| API Contracts โ Swagger-style reference with method plates and status codes | Data Model โ ER-style entity cards with keys and a relationship map |
![]() | ![]() |
| Customer Feedback โ quote-first insight cards with decision stamps | Adoption โ Moore lifecycle curve with the chasm and a "you are here" marker |
Each of the 13 pages serves a different reviewer: policy register for BR-, ADRs + topology diagram for TECH-/ARC-, Storybook-style specimens for DES-, Given/When/Then cards for TEST-, an ops console for DEP-/RUN-/MON-/SEC-, a retro playbook for LL-, a vendor context map for INT-. The full schema-per-ID-type and persona-per-view rationale lives in SoT/html/README.md.
Screenshots are generated โ when the pages change, refresh them with
python3 SoT/html/screenshot.py(Playwright + Chromium; seeSoT/html/README.mdfor setup) and commit the regenerated PNGs with the change.
Next direction (concept): these pages render SoT outward for review. A proposed third artifact class โ deliverables โ would add an input mode where a human contributes judgment (rank, select, acknowledge) and the page emits paste-ready SoT markdown. See
docs/DELIVERABLES_CONCEPT.md.
The pitch: four role agents that remember, coordinate through files, and get smarter every EPIC โ no standups required.
MEMORY.md. A SubagentStop hook actively extracts memories from the conversation. During EPIC harvest, cross-EPIC insights are promoted to SoT/SoT.LESSONS_LEARNED.md as durable LL- entries.SessionStart injects read order, UserPromptSubmit checks context density, PreToolUse verifies an active EPIC before code writes, Stop reminds on SoT cascade updates. Behavior is standardized by HOOK_CONTRACT.md.ghm-status-sync./
โโโ README.md # Dashboard, structure, and status
โโโ PRD.md # Product definition (Progressive PRD)
โโโ CLAUDE.md # The agent's operating instructions
โโโ epics/ # Active Context Windows (Tasks)
โโโ SoT/ # Shared Memory Store (SoT.* files + html/ review layer)
โโโ temp/ # Scratch Pad for explorations and audits
โโโ .claude/ # Methodology runtime (skills, hooks, agents)
โโโ skills/ # 41 stage skills (prd-v*) + 6 operators (ghm-*)
โโโ hooks/ # Session/user/stop hooks + subagent memory hooks
โโโ agents/ # Role agents with persistent MEMORY.md
โโโ domain-profile.yaml # ID registry + skill taxonomy
โโโ settings.json # Hook wiring and execution config
Agent Note:
.claude/can be replaced with.gemini/,.codex/, or any other agent structure, but the skills, hooks, and agent model here were built with Anthropic's documentation model in mind.
Fork Note: this
README.mdexplains the methodology. When you fork for a product, copyREADME_template.mdtoREADME.mdand customize it.
# 1. Fork this repo for your product, then:
cp README_template.md README.md # your product dashboard replaces this page
# 2. Open the repo in Claude Code โ hooks load the read order automatically.
# 3. Start the lifecycle at the beginning:
# "Let's frame the problem" โ triggers prd-v01-problem-framing
# The skill produces CFD- evidence IDs and fills PRD.md v0.1.
# 4. Advance only through gates:
python scripts/readiness.py run # are we ready for v0.2?
From there, the method drives itself: each stage's skills consume the previous stage's IDs, the readiness score tells you when to advance, and the knowledge graph grows with every decision. No subscriptions, no servers, no lock-in โ fork and go.
The methodology is fork-native: everything runs from files in your repo, with no services to stand up.
python scripts/readiness.py run before advancing.SoT/ with IDs before or during the change, never after. Review them as humans through SoT/html/.temp/ notes and agent memories get promoted to durable LL- entries at EPIC close, so the next session starts smarter.You don't have to fork. The self-install path drops the framework into a fresh or
existing repo without clobbering product content โ the subscription-native pattern
borrowed from ZQadus/Xantham-system-blueprint:
ship a blueprint a fresh Claude Code session executes, so all cost lands on your Pro/Max
plan, not the metered API.
# Deterministic CLI (from a clone of this repo):
bash install.sh --target /path/to/your/repo --profile product --dry-run # preview
bash install.sh --target /path/to/your/repo --profile product # install
Or paste the one-line bootstrap from BLUEPRINT.md into a fresh Claude
Code session and let the ghm-self-install
wizard drive it. Both paths read .claude/install-manifest.yaml
(framework vs. product file classes), are idempotent, and merge into an existing
.claude/settings.json rather than overwriting it.
The self-install path is the foundation โ fuller distribution is next:
CHECKSUMS.sha256).Watch the repo to catch these when they land. The fork and self-install paths both work end-to-end today.
| Agent | Role | Last Active | Current EPIC | Status |
|---|---|---|---|---|
| horizon | Strategy (v0.1-v0.5) | โ | โ | idle |
| studio | Design (v0.3-v0.6) | โ | โ | idle |
| devlab | Build (v0.6-v0.8) | โ | โ | idle |
| metro | Ops (v0.9-v1.0) | โ | โ | idle |
| EPIC | State | Lead | Last Updated |
|---|---|---|---|
| (no active EPICs) | โ | โ | โ |
Thank you for helping refine PRD-Led Context Engineering. This repository is not just a codebase; it is a living system of Memory as Infrastructure.
Before contributing, read:
README.md โ this page: the methodology and dashboard.CLAUDE.md โ the Agent Operating Instructions.The goal is always Context Density: exactly the right information, at exactly the right time, for humans and AI alike.
Refine the methodology
SoT/ templates, the HTML review layer, or epics/EPIC_TEMPLATE.md.Report friction
BR-XXX, UJ-XXX).[Link](README.md)), never absolute paths.Open a GitHub Issue โ and if the method earned it, leave a star on the way out. โญ
.claude/
.claude-plugin/
marketplace.json
agents/
devlab/
AGENT.md
MEMORY_ARCHIVE.md
MEMORY.md
horizon/
AGENT.md
MEMORY_ARCHIVE.md
MEMORY.md
metro/
AGENT.md
MEMORY_ARCHIVE.md
MEMORY.md
studio/
AGENT.md
MEMORY_ARCHIVE.md
MEMORY.md
domain-profile.yaml
hooks/
cascade_checklist.md
cascade_checklist.py
context-density-gate.md
context-density-gate.sh
context-validation.md
context-validation.sh
HOOK_CONTRACT.md
metrics_drift_check.md
metrics_drift_check.py
sot-sync-reminder.sh
sot-update-trigger.md
sot-update-trigger.sh
stage-gate-validation.md
subagent-memory-load.sh
subagent-memory-save.sh
traceability-gate.sh
install-manifest.yaml
projects/
-Users-mattgierhart-Documents-MLG-Github-PRD-driven-context-engineering/
memory/
EXECUTIVE-SUMMARY.md
PHASE2-COMPLETE.md
PHASE3-FINDINGS.md
README.md
rename_templates.py
rules/
01-session-protocols.md
02-document-ecosystem.md
03-documentation-discipline.md
04-coding-standards.md
05-lifecycle-gates.md
06-cross-agent-communication.md
07-readiness-protocol.md
08-skill-execution-modes.md
settings.json
skills/
ghm-gate-check/
assets/
gate-checklist-template.md
references/
examples.md
gate-criteria.md
SKILL.md
ghm-harvest/
assets/
harvest-log-template.md
references/
examples.md
harvest-patterns.md
SKILL.md
ghm-id-register/
assets/
id-validation-checklist.md
references/
cross-reference-patterns.md
examples.md
SKILL.md
ghm-self-install/
SKILL.md
ghm-sot-builder/
assets/
sot-template.md
references/
examples.md
sot-patterns.md
SKILL.md
ghm-status-sync/
assets/
status-sync-template.md
references/
examples.md
sync-triggers.md
SKILL.md
ghm-template-sync/
SKILL.md
IMPROVEMENT_SUMMARY.md
init/
SKILL.md
PHASE_2_EXECUTION_PLAN.md
prd-v01-problem-framing/
assets/
problem-statement.md
references/
examples.md
research-prompts.md
SKILL.md
prd-v01-user-value-articulation/
assets/
value-statement.md
references/
research-prompts.md
transformation-examples.md
SKILL.md
prd-v02-competitive-landscape-mapping/
assets/
feature-matrix.md
landscape.md
references/
examples.md
research-prompts.md
SKILL.md
prd-v02-product-type-classification/
assets/
classification.md
references/
decision-framework.md
examples.md
gtm-constraints.md
SKILL.md
prd-v03-features-value-planning/
assets/
competitive-feature-matrix.md
fea.md
references/
examples.md
SKILL.md
prd-v03-moat-definition/
assets/
br-targeting.md
cfd-moat-analysis.md
references/
examples.md
SKILL.md
prd-v03-outcome-definition/
assets/
kpi.md
references/
benchmarks.md
examples.md
SKILL.md
prd-v03-pricing-model/
assets/
br-pricing.md
references/
examples.md
SKILL.md
prd-v04-persona-definition/
assets/
per.md
references/
examples.md
SKILL.md
prd-v04-screen-flow-definition/
assets/
des.md
scr.md
references/
design-brief-guidance.md
design-tool-examples.md
examples.md
navigation-patterns.md
SKILL.md
prd-v04-user-journey-mapping/
assets/
uj.md
references/
examples.md
sequencing.md
SKILL.md
prd-v04-visual-prototype-gate/
assets/
feedback-capture-template.md
references/
screen-count-guidelines.md
tool-adaptation-notes.md
SKILL.md
prd-v05-risk-discovery-interview/
assets/
risk.md
references/
examples.md
question-bank.md
SKILL.md
prd-v05-technical-stack-selection/
assets/
evaluation-scorecard.md
tech-reuse.md
tech.md
references/
brownfield.md
examples.md
SKILL.md
prd-v06-architecture-design/
assets/
arc.md
references/
diagrams.md
examples.md
SKILL.md
prd-v06-environment-setup/
assets/
env.md
references/
examples.md
SKILL.md
prd-v06-technical-specification/
assets/
api.md
dbt.md
references/
examples.md
SKILL.md
prd-v07-epic-scoping/
assets/
epic.md
references/
dependency-mapping.md
examples.md
SKILL.md
prd-v07-implementation-loop/
assets/
session-state.md
traceability-checklist.md
references/
behavioral-examples.md
examples.md
session-state.md
traceability.md
SKILL.md
prd-v07-test-planning/
assets/
test.md
references/
examples.md
test-types.md
SKILL.md
prd-v08-changelog-as-marketing/
SKILL.md
prd-v08-drift-baseline-compare/
SKILL.md
prd-v08-marketing-ops-handoff/
SKILL.md
prd-v08-monitoring-setup/
assets/
mon-template.md
references/
dashboard-guide.md
monitoring-stack.md
slo-guide.md
SKILL.md
prd-v08-release-planning/
assets/
dep-template.md
references/
deployment-strategies.md
examples.md
rollback-procedures.md
SKILL.md
prd-v08-runbook-creation/
assets/
run-template.md
references/
examples.md
incident-response.md
troubleshooting-trees.md
SKILL.md
prd-v09-aeo-audit/
SKILL.md
prd-v09-alternatives-pages/
SKILL.md
prd-v09-cold-outreach-tiered/
SKILL.md
prd-v09-feedback-loop-setup/
assets/
cfd-feedback-template.md
references/
feedback-analysis-patterns.md
SKILL.md
prd-v09-gtm-strategy/
assets/
gtm-template.md
references/
channel-selection.md
examples.md
launch-strategies.md
messaging-frameworks.md
SKILL.md
prd-v09-hn-reddit-launch/
SKILL.md
prd-v09-launch-channels-orb/
SKILL.md
prd-v09-launch-metrics/
assets/
kpi-template.md
references/
examples.md
launch-metrics.md
validation-criteria.md
SKILL.md
prd-v09-offer-construction-hormozi/
SKILL.md
prd-v09-positioning-dunford/
SKILL.md
prd-v10-case-study-builder/
SKILL.md
prd-v10-chasm-adoption-moore/
SKILL.md
prd-v10-continuous-discovery-torres/
SKILL.md
prd-v10-mom-test-interview/
SKILL.md
prd-v10-testimonial-collector/
SKILL.md
PRINCIPLES.md
README.md
SKILL_TEMPLATE/
assets/
.gitkeep
references/
.gitkeep
scripts/
.gitkeep
SKILL.md
skills-inventory.md
VERSION
workflow-review-interview.md
.github/
mlc_config.json
workflows/
markdown_link_check.yml
plugin-sync.yml
readiness.yml
.gitignore
BLUEPRINT.md
CHANGELOG.md
CLAUDE.md
docs/
DELIVERABLES_CONCEPT.md
DEVELOPMENT_GRAPH.md
HARNESS_FORGE_LESSONS.md
MIGRATION_BRIEF_v3.2.md
MIGRATION_BRIEF_v3.md
MODERNIZATION_ASSESSMENT_PROMPT.md
READINESS_PROTOCOL.md
epics/
EPIC_TEMPLATE.md
README.md
install.sh
LICENSE
MIGRATION.md
plugins/
prd-ce/
.claude-plugin/
plugin.json
agents/
devlab.md
horizon.md
metro.md
studio.md
hooks/
context-density-gate.sh
context-validation.sh
hooks.json
sot-sync-reminder.sh
sot-update-trigger.sh
subagent-memory-load.sh
subagent-memory-save.sh
traceability-gate.sh
scripts/
_merge_settings.py
asof.py
check-stage-gate.sh
compute-prd-readiness.py
compute-readiness.py
compute-sot-readiness.py
generate-id-pattern.sh
prd-ce-init.sh
readiness.py
validate-edges.py
validate-ids.sh
skills/
ghm-gate-check/
assets/
gate-checklist-template.md
references/
examples.md
gate-criteria.md
SKILL.md
... 447 moreFAQ
prd-driven-context-engineering is a Claude Code plugin with 100 hand-picked skills for documentation work, indexed on Flowy. Install it with the command on its page. It includes SKILL_TEMPLATE, ghm-gate-check, ghm-harvest. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.