A Product Requirements Document (PRD) in Deployaar is the specification layer that bridges a plain-English feature request and the code an agent writes. It is not optional documentation — it is the machine-readable contract the coding agent implements against and the ground truth the AI code reviewer checks every PR against. A weak PRD produces weak code; a precise one produces code that matches intent. PRDs are generated automatically byDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/paramveer-cyber/Deployaar/llms.txt
Use this file to discover all available pages before exploring further.
packages/services/prd as soon as clarification is complete, but they require human approval before the pipeline proceeds.
PRD Structure
Deployaar generates exactly seven sections for every PRD, each targeting a distinct dimension of the feature spec. All sections are stored as free-form text and versioned with the PRD record.| Field | Purpose |
|---|---|
problemStatement | A clear articulation of the problem this feature solves. Written from the user’s perspective. |
goals | A bulleted list of measurable goals the feature must achieve once shipped. |
nonGoals | An explicit list of what this feature will not do. Prevents scope creep and gives the reviewer clear non-goal boundaries to enforce. |
userStories | User stories in “As a [user], I want [goal] so that [reason]” format. Defines who benefits and how. |
acceptanceCriteria | Concrete, testable conditions that must all be true for the feature to be considered done. These are the primary signal for the AI code reviewer. |
edgeCases | Corner cases, error states, and failure modes the implementation must handle. Only edge cases listed here are enforced by the AI reviewer. |
successMetrics | How success will be measured after the feature ships — engagement metrics, error rates, latency targets, etc. |
packages/services/prd/index.ts using Zod structured output and enforced during the extraction pass:
How Generation Works
PRD generation is triggered by thefeature-request/clarification.complete Inngest event and runs inside the onClarificationComplete workflow function. The generatePrd function in packages/services/prd orchestrates a two-pass AI call:
Context assembly
The service loads the feature request title, the raw description (
rawRequest), and the full clarification thread from the database. The thread is formatted as a readable conversation with PM: and Requester: prefixes.Raw PRD generation
A
generateText call sends the context to the user’s configured AI provider with a system prompt that instructs the model to act as a senior product manager writing a production-quality spec. The output is free-form markdown prose.Structured extraction
A second
generateText call with Output.object({ schema: prdStructuredOutputSchema }) extracts the seven sections from the raw prose into the typed schema. This ensures every PRD has the same machine-readable structure regardless of which AI provider generated it.resolveLanguageModelForUser. The clarification thread is the primary input — if clarification was skipped or thin, the PRD is generated from the original request description alone.
PRD Approval
PRD approval is the primary human-in-the-loop checkpoint in the Deployaar pipeline. No code is written and no engineering tasks are generated until an owner or admin explicitly approves the PRD. The approval call inpackages/services/prd enforces role-based access:
- The PRD record is stamped with
approvedByUserIdandapprovedAt. - The feature request status transitions to
planning. - The
prd/approvedInngest event fires, triggering theonPrdApprovedworkflow. - The workflow calls
generateTasks, which breaks the PRD into 5–15 ordered engineering tasks.
onClarificationComplete workflow uses step.waitForEvent with a 30-day timeout to hold the pipeline open until the prd/approved event arrives. If no approval occurs within 30 days, the workflow exits without proceeding.
PRD and Code Review
Once a coding agent run produces a PR, the AI code reviewer re-reads the PRD in full before evaluating a single line of code. The reviewer is explicitly grounded in the spec:- Acceptance criteria are the primary signal. If all acceptance criteria are met, that is strong evidence the PR should pass.
- Non-goals define what the reviewer may not flag as missing — if something is listed as a non-goal and the PR doesn’t implement it, that is correct behaviour.
- Edge cases define which corner cases are mandatory. Edge cases not listed in the PRD are at most suggestions, never blocking.