AI PRD Workflow

repository·main·Indexed 42 days ago

https://github.com/nurettincoban/ai-prd-workflow

A lightweight, RFC-driven development workflow for AI coding agents. It uses structured markdown artifacts—PRDs, Features, Rules, and RFCs—to guide AI tools from initial ideas to verified code. The workflow can be installed as native slash commands for Claude Code and Cursor, or used via copy-paste prompts for other LLMs like GPT-4o, Gemini, and Llama. It includes a multi-lens inspection process with specific commands for PRD creation, feature extraction, rule generation, and RFC implementation and review.

Tokens
11.8K
Snippets
11
Records
59
Agent score
54%

What's inside AI PRD Workflow

  1. Technology Stack for LinkSnip URL Shortener

    main

    The LinkSnip URL Shortener project is built using the following stack:

    • Runtime: Node.js 20+ with TypeScript 5.x (strict mode)
    • Framework: Express.js (REST API)
    • Database: PostgreSQL 16 (URL and analytics storage)
    • Cache: Redis 7 (redirect caching)
    • Frontend: React 18 with Vite (analytics dashboard)
    • Testing: Jest (unit/integration), Playwright (e2e)
    • Deployment: Docker with docker-compose
  2. Follow the Two-Phase Implementation approach

    main

    To prevent uncontrolled code generation, the workflow requires a strict two-phase process:

    Phase 1: Planning (No Code)

    The agent must analyze requirements and present a plan including:

    • Files to create or modify
    • Key components, data structures, and APIs
    • Proposed implementation sequence
    • Technical decisions and trade-offs
    • Potential impacts on existing functionality

    Crucial: The agent must wait for explicit user approval before moving to Phase 2.

    Phase 2: Implementation (After Approval Only)

    Once approved, the agent implements the plan in logical segments, explains complex sections, and performs a self-review.

  3. Implement Custom Aliases for URL Shortening

    main

    To allow users to specify custom identifiers for short URLs, extend the POST /api/urls endpoint to accept an optional alias field.

    Validation Rules:

    • Length: 3 to 30 characters.
    • Format: Alphanumeric and hyphens only (Regex: ^[a-zA-Z0-9-]{3,30}$).
    • Reserved Aliases: Reject specific system aliases such as api, docs, health, or admin with a 400 Bad Request.
    • Uniqueness: If the alias is already in use, return a 409 Conflict error.
  4. Understand the RFC-driven development workflow

    main

    The AI PRD Workflow follows a structured, multi-step process designed to catch defects that single-pass 'plan-then-code' agents miss. Each step acts as a different 'lens' to inspect the project.

    The Pipeline

    1. Idea → PRD: Develop a vague idea into a complete PRD.md via guided interview.
    2. Verification: Identify gaps in the PRD before building.
    3. Feature Extraction: Organize the PRD into prioritized FEATURES.md.
    4. Rule Generation: Establish technical guidelines (RULES.md) for the AI to follow.
    5. RFC Generation: Break the project into sequenced, logical implementation units (RFCs).
    6. Testing Strategy: Plan coverage based on acceptance criteria before writing code.
    7. Implementation: Execute RFCs one by one. The AI must plan, get approval, code, and then run builds/tests to prove acceptance criteria.
    8. Code Review: Review implementations against RFCs, rules, security, and performance in a fresh session.

    Key Concepts

    • Cross-referenced Artifacts: Artifacts like FEATURES.md and RFCs/ use stable IDs. This ensures that when new features are added, existing citations in RFCs remain valid and do not break.
    • Defect Detection: The workflow is designed to catch specific classes of errors at specific stages (e.g., /verify-prd catches specification contradictions, while /review-rfc catches implementation leaks or unvalidated inputs).
  5. Resolve Conflicts Between Project Artifacts

    main

    When different project documents provide conflicting instructions, follow this strict order of authority:

    1. PRD.md (Highest authority)
    2. FEATURES.md
    3. RULES.md
    4. RFCs
    5. Generated plans (Lowest authority)

    Important: If the prompt's generic guidance conflicts with RULES.md, RULES.md always wins. Never resolve contradictions silently. You must state the contradiction, specify which artifact you followed and why, and flag the conflicting artifact for correction.

  6. Resolve artifact conflicts using the Order of Authority

    main

    If instructions in the prompt conflict with project documentation, follow this hierarchy of authority:

    1. PRD.md (Highest)
    2. FEATURES.md
    3. RULES.md
    4. RFCs
    5. generated plans (Lowest)

    Note: RULES.md always overrides the generic guidance in the implementation prompt. If a contradiction is found, the agent must not resolve it silently; it must state which artifact it followed and why, then flag the other for correction.

  7. Understand the AI PRD Workflow vs. Built-in Agent Planning

    main

    The AI PRD Workflow is designed for product-level planning, whereas built-in AI agent planning modes are tactical and task-oriented. Use this workflow for greenfield products or multi-week builds to prevent scope creep and ensure decisions persist across sessions.

    FeatureBuilt-in Plan ModeAI PRD Workflow
    ScopePlans one task (implementation)Plans the product (what, for whom, scope)
    PersistenceDies with the sessionPRD, features, rules, and RFCs persist across sessions
    InputTakes requests at face value/create-prd interviews you to extract decisions
    VerificationReviews code by "looks right"/review-rfc verifies against acceptance criteria

    The Sweet Spot: Use this workflow for building real products where scope creep and forgotten decisions are the primary risks. For small fixes in existing code, standard agent planning is sufficient.