Goal
A good prd.ts is a compact, authoritative plan that encodes intent (PRD) and ties every story to reality verification (gates). It should be self-sufficient: an agent should be able to act using only the PRD and gate failure output.
Core principles
- PRD defines intent; gates verify reality. PRD does not implement.
- Stories are minimal, high-signal: behavior + evidence + scope.
- Gates observe → act → assert. Reality is logged evidence, not assumptions.
Anatomy of a good prd.ts
- Instructions (in the story title): behavior, evidence, and scope are encoded in one line.
- Stories array: each story has id, title, gateFile, and optional dependsOn / scope.
- Gates: each gateFile runs a Gate with explicit positive evidence.
- Loop state: runPrd(...) returns success or failure + evidence.
- Iteration loop: on failure, pass prd.ts + gate output to the agent, fix, re-run.
Story title template
<Behavior> — evidence: <action|stage|tag> — scope: <path or limit>
Example:
User can log in — evidence: session_created — scope: src/auth/**
What makes a story "good"
- Specific: one observable behavior, no vague outcomes.
- Verifiable: names the exact log action/stage/tag the gate should see.
- Scoped: clearly limits where code can change.
- Standalone: can be validated without assuming other stories unless explicitly in dependsOn.
Dependency patterns that scale
- Linear chain for simple flows.
- Diamond when parallel subfeatures converge.
- Parallel tracks for independent features.
Avoid circular dependencies and long dependency chains.
Scope constraints that prevent accidents
- Feature-scoped: limit to relevant dirs.
- Size-limited: cap changed files/lines.
- Protected core: forbid critical paths/configs.
Gate alignment rules
- Always assert positive evidence, not just "no errors."
- Don't write gates for things you can't observe; add logging first.
- Keep gates close to the story's behavior (short feedback loops).
Anti-patterns
- Stories without gates.
- Evidence-less titles ("Improve performance").
- Overly broad scope ("src/**" with no limits).
- Too many dependencies per story.
- Gates that only assert noErrors.
Minimal example structure
import { runPrd } from "gateproof";
const stories = [
{
id: "user-signup",
title: "User can create account — evidence: user_created — scope: src/auth/**",
gateFile: "gates/user-signup.gate.ts",
},
{
id: "user-login",
title: "Verified user can log in — evidence: session_created — scope: src/auth/**",
gateFile: "gates/user-login.gate.ts",
dependsOn: ["user-signup"],
},
];
runPrd({ stories });
Checklist before you commit a prd.ts
- Each story has a gate file.
- Each title includes behavior + evidence + scope.
- Evidence is observable in logs.
- Dependencies are minimal and acyclic.
- Scope is tight and explicit.Write prd.ts for Gateproof
Write a prd.ts file for Gateproof. Stories with behavior, evidence, scope, and gate alignment.
Tools Updated Jan 25, 2026 ~709 tokens
0.4% of 200k
How to use this prompt
- Copy the prompt using the button above
- Paste it into your preferred AI coding assistant
- Adjust any placeholders or context as needed
- Let the agent implement the changes