Command Pipeline

/dr-prd

Generate PRD with structured research phase (Phase 1.3) for L2+ tasks

Overview

/dr-prd generates a structured Product Requirements Document following the Enhanced Design Process. It resolves the target task, analyzes existing code and project context, researches external context (for L2+ tasks), runs a discovery interview, explores multiple technical approaches, and produces a document with clear scope, constraints, and success criteria.

Usage

/dr-prd "User notification system"
/dr-prd "Migrate database to PostgreSQL"

What It Does

  1. Analyze Context (Phase 1) — reads projectbrief.md, techContext.md, systemPatterns.md, and relevant source code to understand constraints.
  2. Research (Phase 1.3) — for L2+ tasks, spawns a researcher agent that investigates library versions, best practices, CVEs, compatibility, and stack documentation. Produces datarim/insights/INSIGHTS-{task-id}.md. L3-L4 tasks get a 10-point full checklist; L2 tasks get a 5-point lite version. L1 quick fixes skip research.
  3. Discovery Interview (Phase 1.5) — runs a focused interview scaled to complexity: Quick for L1-2, Standard for L2-3, Deep for L3-4. Reads the insights document (if available) before proposing answers. Applies codebase-first rule to prioritize existing patterns.
  4. Explore Solutions (Phase 2) — generates 3+ distinct technical approaches and evaluates each against security, pattern alignment, DRY, and testability. Rejects approaches with anti-patterns.
  5. Consult User (Phase 3) — presents alternatives clearly and waits for approval on the selected approach.
  6. Generate PRD — writes the document to datarim/prd/PRD-{slug}.md including problem statement, scope, technical approach, alternatives, success criteria, and risks. References insights document when available.
  7. Backlog Generation — optionally extracts actionable items from the PRD and proposes new backlog entries with proper task IDs.

Arguments

A brief description of the feature or task to document.

Output

Creates: datarim/prd/PRD-{slug}.md. Optionally updates datarim/backlog.md with extracted items.

PRD Structure

  • Context and analysis with existing code insights
  • Technical approach with the selected solution and considered alternatives (pros/cons)
  • Security and technical risks with mitigation strategies
  • Measurable success criteria

Example Session

> /dr-prd "Real-time notification system"

Phase 1: Analyzing context...
  Read: projectbrief.md, techContext.md, systemPatterns.md
  Found: Express.js backend, React frontend, no WebSocket setup

Phase 1.5: Discovery Interview
  Q: Should notifications persist across sessions?
  Q: Expected volume — tens or thousands per minute?

Phase 2: Exploring solutions...
  Option A: WebSocket with Socket.io
  Option B: Server-Sent Events (SSE)
  Option C: Polling with long-poll fallback

  Recommendation: Option A (best fit for bidirectional needs)

Phase 3: Awaiting your approval...

PRD saved to: datarim/prd/PRD-notification-system.md

PRD identifies 4 potential backlog items:
  1. NOTIF-0001: WebSocket server setup
  2. NOTIF-0002: Notification storage layer
  3. NOTIF-0003: React notification component
  4. NOTIF-0004: Push notification integration
Add to backlog? (y/n)

Related Commands

  • /dr-init — must run before /dr-prd
  • /dr-plan — next stage: implementation planning
  • /dr-design — deep design exploration for L3-4