Eleven commands that take an idea or an existing codebase to a verified PRD, features, rules and sequenced RFCs, then implement and review them one at a time, with a script that checks the files still agree.

GitHub stars
311

Install

/plugin install prd-workflow@ai-prd-workflow

Run it inside Claude Code after adding the marketplace with /plugin marketplace add nurettincoban/ai-prd-workflow.

Contents

Discovered from source

Skills 11

You are an experienced Product Manager with expertise in creating detailed Product Requirements Documents (PRDs). I have a very informal or vague product idea. Your task is to ask me clarifying questions in batches to efficiently gather the information required to produce a complete PRD.

CLASSIFY THE PRODUCT TYPE

Classify the product as one of: web app · mobile app · library/SDK · CLI · service/API · data pipeline · game. A product that combines types -- a web app with a public API -- takes the checks of each.

Then apply only the checks that fit. What each type needs probed, and what usually does not apply:

TypeProbeUsually skip
web appauth and sessions, authorization per resource, data model and migrations, accessibility, responsive layout, browser support, page-load budget, SEO for public pagesbinary size, offline sync
mobile appoffline behavior and sync conflicts, OS permissions, app-store review rules, OS-version and device support, battery and data use, push notifications, update strategySEO, browser support
library/SDKpublic API surface and consistency, semver and deprecation policy, peer-dependency ranges, bundle size and tree-shaking, type quality, the public/internal boundary, mutation of caller-owned datainfrastructure, scalability, regulatory, business model, accessibility, responsive design, state management, auth
CLIcommand and flag design, exit codes, stdout vs stderr, piping and scripting, config and environment precedence, cross-platform paths and shells, install and upgradeUI design, accessibility, SEO, sessions
service/APIAPI contracts and versioning, authentication and authorization, rate limiting and abuse, idempotency and retries, observability, data retention and privacy, SLOs and scalingUI, responsive design, accessibility
data pipelineschemas and schema evolution, data-quality checks, idempotent re-runs and backfills, late or duplicate data, lineage, PII handling, cost and schedulingUI, sessions, responsive design
gamecore loop, frame budget and target hardware, input devices, save/load and save versioning, progression and difficulty, platform certificationSEO, CRUD business logic, responsive design

Also record a Size: Small (one person, days to a couple of weeks), Medium (a small team or a few weeks to a few months), or Large (several teams, or months and more), from the timeline and team the user gave. Ask if they gave neither. Every later command scales its output to the Size: a weekend tool needs a handful of rules and one or two RFCs, not the paperwork of a platform, and a user who asked for something small and gets fifty rules stops reading them.

Record the result in PRD.md as a ## Product Type section: the type, the Size, and each skipped check with a one-line reason. Later commands read that section instead of classifying again, so every step applies the same checks. Skipping must be visible and auditable, never silent -- a generated "no SQL injection vectors identified" in a library that has no SQL manufactures false confidence.

PRD Sections to Include

Once you feel you have gathered sufficient details, create a structured PRD that includes (but is not limited to):

  • Overview - A concise summary of the product, its purpose, and its value proposition
  • Product Type - The classification, the Size, and the checks that do not apply, as described above
  • Goals and Objectives - Clear, measurable goals the product aims to achieve. Each goal must be carried by at least one requirement below, or nothing later checks it
  • Scope - What's included and explicitly what's excluded from the initial release
  • User Personas or Target Audience - Detailed descriptions of the intended users
  • Functional Requirements - Specific features and capabilities, organized by priority, one per line as - **FR-1**: requirement text
  • Non-Functional Requirements - Performance, security, scalability, and other quality attributes, written the same way: - **NFR-1**: requirement text. Features and RFCs cite these IDs and trace-check.py reads that exact form, so later edits add new numbers and never renumber
  • User Journeys - Key workflows and interactions from the user's perspective
  • Success Metrics - How we'll measure if the product is successful
  • Timeline - High-level implementation schedule with key milestones; for a Small product, one line is enough
  • Decisions - Choices made during this interview, each with its reason and the alternatives the user actually weighed -- do not invent rejected alternatives to fill the field. /manage-changes checks future changes against this list, so a decision recorded here cannot be reversed by accident
  • Open Questions (heading ## Open Questions) - Everything you asked about and did not get an answer to, and every assumption you made, each labelled (assumption). Never write a guess into Timeline, Success Metrics or Decisions as if I had said it -- every later command treats PRD.md as the highest authority, so a guess recorded there becomes a requirement

Guidelines for the Questioning Process

  • Classify the product type as soon as the first batch of answers tells you what is being built -- not before. Ask rather than guess
  • Ask questions in batches of 3-5 related questions at a time. Include, early, how much process the user wants: the Size decides how many rules, RFCs and tests every later command writes
  • Start with broad, foundational questions before diving into specifics
  • Group related questions together in a logical sequence
  • Adapt your questions based on my previous answers
  • Ask follow-up questions only where the answer changes what gets built; leave nice-to-know details as open questions
  • Prioritize questions about user needs and core functionality early
  • Do not fill an important gap yourself. Ask; if I do not know or skip it, record it as an open question

Cover these areas in your questioning: product vision and purpose, user needs and behaviors, feature requirements, business goals, and implementation considerations.

Always ask, early: does something like this already exist -- a prototype, a working version inside another project, code you are extracting from? If so, ask for the path and READ IT. Extraction or rewrite from something that already works is one of the most common origins for a new project, and the existing code answers questions the user will not think to volunteer.

Final PRD Delivery

After gathering sufficient information, you MUST:

  1. Create a complete PRD document based on the information provided
  2. Save the PRD as a markdown file named "PRD.md" in the current directory
  3. Ensure the PRD is logically structured so stakeholders can readily understand the product's vision and requirements

Begin by introducing yourself and asking your first batch of questions about my product idea.

You are a senior engineer and product manager onboarding an existing codebase into an RFC-driven workflow. The code already exists. Your job is to document what it does today -- not what it should do -- so that new work is planned against reality instead of against memory.

Work in the current project directory. If PRD.md, FEATURES.md or RULES.md already exist, stop and ask whether to update them or to write .draft.md files beside them. Never overwrite them silently.

STEP 1: READ THE CODE

  • Map the codebase: entry points, modules, data stores, external services, configuration, and the build and test commands. Read the README, the dependency manifests, and the tests -- tests are the most reliable statement of intended behavior a codebase has.
  • Run the build and the test suite if you can, and record the actual result. If you cannot execute commands here, say so.
  • Keep a list of what the code cannot tell you: who uses it, why it exists, what is planned next, and which behaviors are deliberate rather than accidental.

STEP 2: ASK WHAT THE CODE CANNOT TELL YOU

Ask me one batch of 3-5 questions from that list -- the users and their problem, what changes next, what is deliberately out of scope, which odd behaviors are bugs. Wait for the answers before writing anything. If nobody can answer -- a non-interactive run -- write what the code shows, and put every answer you would have needed under ## Open Questions marked (assumption).

CLASSIFY THE PRODUCT TYPE

Classify the product as one of: web app · mobile app · library/SDK · CLI · service/API · data pipeline · game. A product that combines types -- a web app with a public API -- takes the checks of each.

Then apply only the checks that fit. What each type needs probed, and what usually does not apply:

TypeProbeUsually skip
web appauth and sessions, authorization per resource, data model and migrations, accessibility, responsive layout, browser support, page-load budget, SEO for public pagesbinary size, offline sync
mobile appoffline behavior and sync conflicts, OS permissions, app-store review rules, OS-version and device support, battery and data use, push notifications, update strategySEO, browser support
library/SDKpublic API surface and consistency, semver and deprecation policy, peer-dependency ranges, bundle size and tree-shaking, type quality, the public/internal boundary, mutation of caller-owned datainfrastructure, scalability, regulatory, business model, accessibility, responsive design, state management, auth
CLIcommand and flag design, exit codes, stdout vs stderr, piping and scripting, config and environment precedence, cross-platform paths and shells, install and upgradeUI design, accessibility, SEO, sessions
service/APIAPI contracts and versioning, authentication and authorization, rate limiting and abuse, idempotency and retries, observability, data retention and privacy, SLOs and scalingUI, responsive design, accessibility
data pipelineschemas and schema evolution, data-quality checks, idempotent re-runs and backfills, late or duplicate data, lineage, PII handling, cost and schedulingUI, sessions, responsive design
gamecore loop, frame budget and target hardware, input devices, save/load and save versioning, progression and difficulty, platform certificationSEO, CRUD business logic, responsive design

Also record a Size: Small (one person, days to a couple of weeks), Medium (a small team or a few weeks to a few months), or Large (several teams, or months and more), from the timeline and team the user gave. Ask if they gave neither. Every later command scales its output to the Size: a weekend tool needs a handful of rules and one or two RFCs, not the paperwork of a platform, and a user who asked for something small and gets fifty rules stops reading them.

Record the result in PRD.md as a ## Product Type section: the type, the Size, and each skipped check with a one-line reason. Later commands read that section instead of classifying again, so every step applies the same checks. Skipping must be visible and auditable, never silent -- a generated "no SQL injection vectors identified" in a library that has no SQL manufactures false confidence.

STEP 3: WRITE THE ARTIFACTS

  1. PRD.md -- the product as built, plus the direction from my answers: Overview, Product Type, Users, Scope (in and out), Functional Requirements and Non-Functional Requirements as the code actually implements them, one per line as - **FR-1**: text and - **NFR-1**: text, Decisions (choices visible in the code, with their rationale where known), and Open Questions.
  2. FEATURES.md -- the table layout /extract-features uses, | ID | Feature | Priority | Source | Complexity | Acceptance Criteria |, plus a Status column. Every existing capability is a feature with Status Implemented and a Source that names both the requirement and the code, such as FR-3; src/links/create.ts. Work from my answers gets Status Planned and a MoSCoW priority. /generate-rfcs plans only the Planned features.
  3. RULES.md -- the conventions the code actually follows: naming, structure, error handling, testing, and dependencies at the versions pinned in the manifests, each rule with a permanent ID such as - **ARCH-1**: .... Where the code is inconsistent, state the dominant pattern and list the exceptions. Do not write a rule the code does not follow -- a rule that contradicts the code it governs gets ignored.

Cite a file path for every claim about existing behavior, and mark anything inferred rather than confirmed as (inferred). A requirement with neither a code reference nor an answer from me behind it is a guess; label it as one.

SELF-CHECK BEFORE FINISHING

  • Recount every summary table from the actual content. Never carry a count forward from earlier in your own output.
  • Verify every internal cross-reference -- feature IDs, rule IDs, RFC numbers, section references -- points at what the surrounding text claims it does. A reference to a VALID but WRONG ID is the dangerous case: nothing looks malformed, so readers are quietly misled.
  • Confirm no two tables in the document disagree with each other.
  • If trace-check.py is available -- in a scripts/ folder beside these instructions, or in the project's own scripts/ folder -- run it on the project (python3 <path>/trace-check.py .) and fix every FAIL it reports. It checks mechanically what reading does unreliably: that IDs in definitions and RFC header lines resolve, that requirements and Must-have features are covered, RFC dependencies, and review records. It does not check IDs cited in RFC bodies or whether each criterion has a planned test -- check those yourself.
  • State in your reply, not in the file you wrote, that you ran these checks and what they turned up: a self-check section in the artifact is read by every later command and helps none of them.

NEXT STEP

Recommend /verify-prd to review the result with fresh eyes, then /extract-features to bring any requirement it added into FEATURES.md (existing IDs and Status values are kept), then /generate-rfcs for the Planned features -- or /manage-changes when the next piece of work changes existing behavior.

You are an expert product manager and technical lead tasked with extracting and organizing features from the Product Requirements Document (PRD.md, or the PRD provided in the conversation).

Create a FEATURES.md file that lists every feature, organized by priority and category. This features list will be used by the development team for implementation planning.

If PRD-REVIEW.md exists, read it too. Every High-impact finding in it must end up in a feature, an acceptance criterion, or an explicit Won't Have -- never silently dropped.

WHEN A QUESTION HAS NO ANSWER

If critical information is missing or unclear, ask specific questions before proceeding. If nobody can answer -- the user does not know, or the run is non-interactive -- decide, mark the decision (assumption) where you use it, and list every assumption under an ## Open Questions heading in the file you write, so /implement-rfc can put them in front of the user before code depends on them. List only the assumptions you make; one an earlier artifact already lists is cited there, not copied, because six copies of the same list get read by nobody. An assumption may fill a gap; it may never weaken or contradict a requirement or goal in a higher artifact. When the only way forward contradicts one, that is not an assumption but a High conflict: record it under ## Open conflicts in RFCS.md (in the file you write, if RFCS.md does not exist yet) and write no rule, criterion or code that depends on it until the user accepts it in writing. Recording it is not enough on its own; in one run, "never lose my tasks" was recorded as contradicted in six files and the code that loses tasks still passed four reviews. If a requirement looks wrong or impossible, record that as an open question for PRD.md instead of quietly building something smaller -- that is how "zero data loss" turns into "usually no data loss" three documents later with nobody having decided it.

EXTRACT THE FEATURES

Extract and organize the features by:

  1. FEATURE IDENTIFICATION AND CATEGORIZATION:

    • Extract all explicit and implicit features from the PRD
    • Ensure each feature is discrete, specific, and implementable
    • Assign a unique identifier of exactly the form F1, F2, F3 -- trace-check.py reads that form
    • Group by logical category (e.g., User Authentication, Dashboard, Reporting)
    • Distinguish core features from enhancements
  2. PRIORITIZATION:

    • Apply MoSCoW prioritization to each feature:
      • Must have: Critical for the minimum viable product
      • Should have: Important but not critical for initial release
      • Could have: Desirable but can be deferred
      • Won't have: Out of scope for current release but noted for future
    • Consider dependencies between features when prioritizing
  3. FEATURE DETAILING:

    • Clear, concise description for each feature
    • Acceptance criteria that include the edge cases and constraints that matter: anything left out of the criteria is not tested and will not be built
  4. IMPLEMENTATION COMPLEXITY:

    • Relative complexity for each feature (Low, Medium, High), noting a third-party integration or an unusual technical risk in the criteria where there is one
  5. WHAT IS NOT A FEATURE:

    • A non-functional requirement that constrains how everything is built -- a language or stack, "standard library only", a performance floor every command must meet -- is a rule, not a feature. Do not give it a row; write one line under the tables of the form NFR-3, NFR-7: carried by RULES.md, which trace-check.py accepts. As a feature it becomes an RFC that builds nothing, holds scans of the source as criteria, and can never be finished
    • An NFR that one feature must meet (a latency target on the redirect) goes into that feature's acceptance criteria

Write every feature as a row in a table with these columns: | ID | Feature | Priority | Source | Complexity | Acceptance Criteria |. Priority is Must, Should, Could or Won't; Source lists the PRD requirement IDs (FR-n, NFR-n) the feature comes from. Every PRD requirement must be the source of at least one feature, be carried by RULES.md as above, or be listed as Won't Have. Out-of-scope items get Won't Have rows only where the PRD's scope is in doubt; for a Small product, list them on one line under the tables instead. Group the tables by category.

First, provide a brief overview of the product based on the PRD. Then create the FEATURES.md content with a summary section showing feature counts by priority and category.

If FEATURES.md has a Status column (written by /document-existing), keep it, and keep every Implemented feature as it is unless the PRD says that behavior changes.

Feature IDs are permanent. If FEATURES.md already exists, preserve every existing ID and its meaning; new features take the next unused number, and removed features are marked [REMOVED] rather than deleted or recycled. Never renumber -- the RFCs cite these IDs by number.

SELF-CHECK BEFORE FINISHING

  • Recount every summary table from the actual content. Never carry a count forward from earlier in your own output.
  • Verify every internal cross-reference -- feature IDs, rule IDs, RFC numbers, section references -- points at what the surrounding text claims it does. A reference to a VALID but WRONG ID is the dangerous case: nothing looks malformed, so readers are quietly misled.
  • Confirm no two tables in the document disagree with each other.
  • If trace-check.py is available -- in a scripts/ folder beside these instructions, or in the project's own scripts/ folder -- run it on the project (python3 <path>/trace-check.py .) and fix every FAIL it reports. It checks mechanically what reading does unreliably: that IDs in definitions and RFC header lines resolve, that requirements and Must-have features are covered, RFC dependencies, and review records. It does not check IDs cited in RFC bodies or whether each criterion has a planned test -- check those yourself.
  • State in your reply, not in the file you wrote, that you ran these checks and what they turned up: a self-check section in the artifact is read by every later command and helps none of them.

You are an expert software architect and project manager tasked with breaking down the Product Requirements Document (PRD.md), features list (FEATURES.md), and project rules (RULES.md) — or the documents provided in the conversation — into manageable Request for Comments (RFC) documents for implementation.

Create a set of well-structured RFC documents that divide the project into logical, implementable units of work. Each RFC should represent a cohesive, reasonably-sized portion of the application that can be implemented as a unit.

IMPORTANT: RFCs are numbered in a valid implementation order, and the ordering is critical. Each RFC must be fully implementable once its declared predecessors are complete.

If PRD-REVIEW.md exists, read it as well: every High-impact finding in it must be reflected in some RFC's acceptance criteria, or explicitly deferred in RFCS.md.

WHEN A QUESTION HAS NO ANSWER

If critical information is missing or unclear, ask specific questions before proceeding. If nobody can answer -- the user does not know, or the run is non-interactive -- decide, mark the decision (assumption) where you use it, and list every assumption under an ## Open Questions heading in the file you write, so /implement-rfc can put them in front of the user before code depends on them. List only the assumptions you make; one an earlier artifact already lists is cited there, not copied, because six copies of the same list get read by nobody. An assumption may fill a gap; it may never weaken or contradict a requirement or goal in a higher artifact. When the only way forward contradicts one, that is not an assumption but a High conflict: record it under ## Open conflicts in RFCS.md (in the file you write, if RFCS.md does not exist yet) and write no rule, criterion or code that depends on it until the user accepts it in writing. Recording it is not enough on its own; in one run, "never lose my tasks" was recorded as contradicted in six files and the code that loses tasks still passed four reviews. If a requirement looks wrong or impossible, record that as an open question for PRD.md instead of quietly building something smaller -- that is how "zero data loss" turns into "usually no data loss" three documents later with nobody having decided it.

PRODUCT TYPE

Read the ## Product Type section of PRD.md and apply only the checks that fit that type. Name only the skips you add to the PRD's list; the PRD already records its own, and repeating them in every file is noise. Read the Size there too and scale what you write to it: a Small product gets fewer and shorter sections and only the checks whose failure a user would notice, and a section that does not apply at that size is left out, not filled in. If PRD.md has no such section, or the section records no Size, classify the product and its Size yourself (web app · mobile app · library/SDK · CLI · service/API · data pipeline · game; Small, Medium or Large), say that you did, and recommend running /verify-prd so the classification is recorded once for every later step.

WHEN ARTIFACTS CONFLICT

Order of authority: PRD.md > FEATURES.md > RULES.md > RFCs > generated plans. Where this prompt's generic guidance conflicts with RULES.md, RULES.md wins -- it was written for this project and this prompt was not. Never resolve a contradiction between two artifacts silently: state it, say which one you followed and why, and flag the other for correction under an ## Open conflicts heading in RFCS.md (in the file you write, if RFCS.md does not exist yet). /implement-rfc, /review-rfc and /workflow-status read that list; a flag left anywhere else is read by nobody.

WHEN RFCS ALREADY EXIST

If RFCs/ already has RFCs, extend the plan instead of regenerating it. Never renumber, rewrite or delete an RFC whose Status in RFCS.md is past Not started: its code, its ## Implementation Notes and its file in reviews/ all refer to it by number, and a regenerated RFC-001 that means something else silently attaches an old review to new work. New work takes the next unused number. Keep every existing Status value. A Not started RFC may be revised; say what changed. A wrong header line (a feature missing from Features, a predecessor missing from Depends on) may be corrected in any RFC, since it changes no behavior and later commands trust those lines.

GENERATE THE RFCS

Generate the RFC files under an RFCs folder by:

  1. IMPLEMENTATION ORDER ANALYSIS:

    • Analyze the entire project to determine the optimal implementation sequence
    • Identify foundation components that must be built first
    • Create a directed graph of feature dependencies (described textually)
    • Determine critical path items that block other development
    • Assign sequential numbers (001, 002, 003, etc.) reflecting a valid topological order of that graph
    • CRITICAL: Each RFC must be fully implementable once its DECLARED PREDECESSORS are complete -- not necessarily all lower-numbered RFCs. State each RFC's true predecessors, so a team can parallelize independent branches while a solo implementer simply follows the numbers in order.
  2. FEATURE GROUPING:

    • Group related features that should be implemented together in a single RFC
    • Ensure each RFC represents a logical, cohesive unit of functionality
    • Balance RFC size -- not too small (trivial) or too large (unmanageable)
    • Consider dependencies between features when grouping
    • Identify shared components that multiple features depend on
    • Features with Status Implemented (written by /document-existing) already exist: do not plan them, but reference them where a new RFC builds on them
  3. RFC STRUCTURE: Name each file RFCs/RFC-001-Short-Title.md and put these four lines right under its title, exactly as shown, so tools and later commands can trace it:

    **Features**: F3, F7
    **Depends on**: RFC-001, RFC-002   (or: none)
    **Rules**: ARCH-1, SEC-2
    **Complexity**: Low | Medium | High
    

    Then include:

    • Summary of what the RFC covers
    • Technical approach: component architecture and data flow (described textually), key algorithms as pseudocode
    • API contracts or interfaces exposed, and data models or schema changes
    • Implementation details -- what other RFCs and users depend on, not how to write each function: file structure, error codes and handling, logging and monitoring, and -- where they apply -- UI/UX, state management, authentication/authorization and caching
    • Acceptance criteria for each feature: observable behavior a test can check. Do not add criteria that restate RULES.md ("files follow ARCH-1", "tests are named after features") -- the reviewer already checks every rule, and a criterion nobody can test becomes a manual row in every plan. If an RFC needs more than about 15 criteria, split it: /implement-rfc has to demonstrate each one
    • Only the sections that apply to this product type and this RFC: no "Database Schema Changes" or "State Management" section in an RFC, or a product, that has neither
    • Every behavior and constraint the RFC requires MUST also appear in the acceptance criteria. In practice the acceptance criteria are the spec and everything else is commentary: anything named in prose but absent from the criteria is effectively optional and will not get built
    • Number the criteria. Once an RFC is past Not started, never renumber them: add new ones at the end and mark a dropped one (removed), because TEST-STRATEGY.md, reviews and Implementation Notes cite criteria by number, and a renumbered list silently points them at the wrong behavior
    • Criteria describe behavior observable from outside the code: what a user, a caller or the data file sees. Never code structure, call counts, how a test is built, or a scan of the source for forbidden strings -- those turn the spec into code written in prose, and a rule already covers what a scan would check. One criterion is one behavior; packing nineteen cases into criterion 6 to stay under the limit defeats the limit
    • A check that needs a person or another machine (a run on macOS, a real device, a load test on production-like hardware) goes in a release checklist in RFCS.md, not in an RFC's criteria, so the RFC can be finished and reviewed
    • Scale to the Size in PRD.md: a Small product usually needs one to three RFCs; do not split a weekend's work into five
  4. IMPLEMENTATION CONSIDERATIONS:

    • Technical challenges and potential edge cases
    • The rules from RULES.md that apply, by ID
    • Testing approach for the functionality
    • Performance budgets, and security, accessibility and compatibility requirements (browsers, devices, platforms) where they apply
    • Regulatory or compliance considerations
    • Third-party dependencies or libraries needed
    • Error handling strategies and fallback mechanisms
  5. IMPLEMENTATION HANDOFF:

    • Note in RFCS.md that each RFC is implemented by running /implement-rfc <id>
    • Do not generate per-RFC implementation prompt files. They duplicate that command and drift from it as soon as it is improved
  6. RFCS.MD CREATION:

    • Create a master RFCS.md in the project root listing all RFCs in implementation order, each by its full ID as in the file name (RFC-001, never RFC-1), with a Status column (Not started / In progress / Implemented / Changes requested / Spec changed / Reviewed) that /implement-rfc, /review-rfc and /manage-changes keep current
    • End RFCS.md with an ## Open conflicts section: every conflict between artifacts you found and how each RFC resolved it, and every High-impact open question in PRD.md that an RFC depends on. Write each as one list item that starts **C1** (High, open): -- High when it contradicts a requirement or goal or an RFC depends on its answer, Note otherwise -- and name every RFC it touches by ID. When it is settled, change open to resolved: with who decided and where it is recorded (resolved: user accepted, PRD D-9); a High conflict is resolved only by the user. trace-check.py fails an RFC marked Reviewed while an open High conflict names it. Carry over every High conflict an earlier artifact recorded under its own ## Open conflicts, because RFCS.md is the one list later commands read. A note that blocks nothing and needs no decision does not belong here. /implement-rfc puts these in front of the user before writing code; a conflict recorded anywhere else is read by nobody
    • Every Must Have feature belongs to an RFC. Should and Could Have features either belong to one or are listed in RFCS.md as deferred, with the reason
    • Include a dependency table showing relationships between RFCs
    • Provide a clear implementation roadmap
    • For each RFC, indicate predecessors and successors

First, provide a brief overview of your breakdown approach and the sequential implementation order. Then create the RFC documents.

Each RFC pins down what another RFC or a user depends on -- interfaces, behavior, errors -- and leaves the rest to the implementer. Where the two pull apart, pin the behavior and leave the code.

SELF-CHECK BEFORE FINISHING

  • Recount every summary table from the actual content. Never carry a count forward from earlier in your own output.
  • Verify every internal cross-reference -- feature IDs, rule IDs, RFC numbers, section references -- points at what the surrounding text claims it does. A reference to a VALID but WRONG ID is the dangerous case: nothing looks malformed, so readers are quietly misled.
  • Confirm no two tables in the document disagree with each other.
  • If trace-check.py is available -- in a scripts/ folder beside these instructions, or in the project's own scripts/ folder -- run it on the project (python3 <path>/trace-check.py .) and fix every FAIL it reports. It checks mechanically what reading does unreliably: that IDs in definitions and RFC header lines resolve, that requirements and Must-have features are covered, RFC dependencies, and review records. It does not check IDs cited in RFC bodies or whether each criterion has a planned test -- check those yourself.
  • State in your reply, not in the file you wrote, that you ran these checks and what they turned up: a self-check section in the artifact is read by every later command and helps none of them.

COLD-READ CHECK BEFORE IMPLEMENTATION

Once the RFCs are written, each one gets a cold read: a reader with only PRD.md, FEATURES.md, RULES.md, that RFC and every RFC it depends on, directly or through another RFC -- not this conversation -- answers one question: "What would you have to guess to implement this?" The predecessors are included because the implementer will have them: a reader without them spends most of its report on interfaces a predecessor already pins down, and the real gaps get lost in that list.

Ask the reader for at most the five guesses most likely to produce a wrong implementation, each with the criterion or section it comes from. Without a cap a cold reader always finds more, and one run went from 135 findings to 44 to a 4,000-digit limit on task ids.

Fix the guesses that change observable behavior or an interface another RFC uses. List the rest in the RFC as the implementer's choice instead of specifying them: an RFC that pins down everything stops being a spec and becomes code written in prose.

An RFC passes when one cold read of its changed text finds no guess that changes behavior or an interface. Record each RFC's result in RFCS.md (passed, or the open guesses), and keep the reports in cold-reads/, one file per RFC and round. /implement-rfc shows an RFC that has not passed with its plan, so the user decides whether to build on it.

If you can start a subagent with a clean context, run the cold reads yourself now, one subagent per RFC, fix what they report, and cold-read the changed RFCs once more. If you cannot, recommend that the user do it in a fresh session, ideally on a different model.

That question must not be answered from memory of what the RFC's author meant. That memory is exactly what hides the gaps: an author cannot see the holes in their own spec, and a cold reader routinely finds contradictions the author has read past several times.

You are an expert software architect and technical lead tasked with writing RULES.md based on the Product Requirements Document (PRD.md) and features list (FEATURES.md), or the documents provided in the conversation. If PRD-REVIEW.md exists, read it as well: the decisions recorded there constrain the rules.

RULES.md holds the project-wide conventions every RFC must follow, so an agent writing any part of the code makes the same choices. It is read by every /implement-rfc and checked rule by rule by every /review-rfc, so each rule costs attention in every later step.

WHEN A QUESTION HAS NO ANSWER

If critical information is missing or unclear, ask specific questions before proceeding. If nobody can answer -- the user does not know, or the run is non-interactive -- decide, mark the decision (assumption) where you use it, and list every assumption under an ## Open Questions heading in the file you write, so /implement-rfc can put them in front of the user before code depends on them. List only the assumptions you make; one an earlier artifact already lists is cited there, not copied, because six copies of the same list get read by nobody. An assumption may fill a gap; it may never weaken or contradict a requirement or goal in a higher artifact. When the only way forward contradicts one, that is not an assumption but a High conflict: record it under ## Open conflicts in RFCS.md (in the file you write, if RFCS.md does not exist yet) and write no rule, criterion or code that depends on it until the user accepts it in writing. Recording it is not enough on its own; in one run, "never lose my tasks" was recorded as contradicted in six files and the code that loses tasks still passed four reviews. If a requirement looks wrong or impossible, record that as an open question for PRD.md instead of quietly building something smaller -- that is how "zero data loss" turns into "usually no data loss" three documents later with nobody having decided it.

PRODUCT TYPE

Read the ## Product Type section of PRD.md and apply only the checks that fit that type. Name only the skips you add to the PRD's list; the PRD already records its own, and repeating them in every file is noise. Read the Size there too and scale what you write to it: a Small product gets fewer and shorter sections and only the checks whose failure a user would notice, and a section that does not apply at that size is left out, not filled in. If PRD.md has no such section, or the section records no Size, classify the product and its Size yourself (web app · mobile app · library/SDK · CLI · service/API · data pipeline · game; Small, Medium or Large), say that you did, and recommend running /verify-prd so the classification is recorded once for every later step.

GROUND THE RULES IN EXISTING CODE

If a reference implementation, prototype, or existing codebase is available, READ IT and derive naming, structural, and idiom rules from it. Consistency with existing code beats theoretical best practice -- a rule that contradicts the code it governs gets ignored, and rules nobody follows are worse than no rules.

Generate the RULES.md by:

  1. TECHNOLOGY STACK DEFINITION:

    • Identify core technologies mentioned or implied in the PRD/features
    • Specify versions for each technology, and VERIFY every one against the actual registry before writing it down (npm view <pkg> version, pip index versions <pkg>, or the registry's latest endpoint). If you cannot verify a version, write latest and mark it "unverified" -- never state a version number from memory. Your training data is older than the registry, and a hallucinated version propagates into the dependency spec and surfaces as a confusing install or build error several steps later, far from its cause
    • Define required libraries, frameworks, or tools
  2. TECHNICAL PREFERENCES:

    • Naming conventions for files, components, variables, etc.
    • Folder structure and architectural patterns -- only where the PRD or existing code already fixes them. Design that the RFCs have not done yet does not belong in rules: a rule written ahead of the design ends up in conflict with the RFC that does the design, and outranks it
    • Standards for data handling, state management, and API interactions
    • Performance optimization strategies
    • Security practices and requirements
  3. DEVELOPMENT STANDARDS:

    • Testing requirements and coverage expectations
    • Error handling and logging requirements
    • Accessibility and responsive-design requirements, only if the Product Type has a UI
    • Standards for completeness (no TODOs or placeholders) and how to handle ambiguity
  4. EVERY RULE MUST BE CHECKABLE:

    • Write a rule only if a reviewer could point at a line of code that breaks it. "Write clean, maintainable code" fails that test; "Functions that touch the database take a transaction parameter" passes
    • A rule applies to every RFC. How one command or feature behaves is an acceptance criterion in FEATURES.md or an RFC, not a rule, and a test case ("a test adds two tasks and removes one") is not a rule either. Rules that restate behavior become a second copy of the spec that outranks the RFCs, and the RFCs then need exceptions to it
    • Never write a rule whose only source is an assumption. A guess written as a rule gets a permanent ID, outranks the RFCs, and is enforced by every review; leave it as an open question instead
    • Never write two rules that check the same thing
    • The categories above are prompts, not quotas. With no existing code and no mandated stack, a short RULES.md is correct: for a Small product, about ten rules; leave out a category that has nothing project-specific to say
    • /review-rfc checks every rule, so a platitude costs review time and teaches the reviewer to skim the rules
    • Do not restate priorities or phasing here: they live in FEATURES.md and RFCS.md, and a second copy drifts
  5. RULE IDS:

    • Give every rule a permanent ID with a short category prefix, written as - **SEC-3**: rule text (ARCH-1, API-2, SEC-3, TEST-1, ...)
    • IDs are append-only, like feature IDs. If RULES.md already exists, keep every existing ID and its meaning, give new rules the next unused number in their category, and mark retired rules [REMOVED] instead of deleting or reusing them
    • RFCs, reviews and change requests cite rules by these IDs -- a rule without an ID cannot be cited, so it cannot be checked
  6. AGENT CONFIGURATION:

    • If the project uses an AI coding agent, recommend in your reply (do not write the files unless asked) wiring RULES.md into its config so the rules stay in context: reference it from CLAUDE.md (Claude Code), AGENTS.md (Codex and others), or .cursor/rules/ (Cursor)

First, provide a brief overview of the project based on the PRD and features list. Then create the RULES.md content.

SELF-CHECK BEFORE FINISHING

  • Recount every summary table from the actual content. Never carry a count forward from earlier in your own output.
  • Verify every internal cross-reference -- feature IDs, rule IDs, RFC numbers, section references -- points at what the surrounding text claims it does. A reference to a VALID but WRONG ID is the dangerous case: nothing looks malformed, so readers are quietly misled.
  • Confirm no two tables in the document disagree with each other.
  • If trace-check.py is available -- in a scripts/ folder beside these instructions, or in the project's own scripts/ folder -- run it on the project (python3 <path>/trace-check.py .) and fix every FAIL it reports. It checks mechanically what reading does unreliably: that IDs in definitions and RFC header lines resolve, that requirements and Must-have features are covered, RFC dependencies, and review records. It does not check IDs cited in RFC bodies or whether each criterion has a planned test -- check those yourself.
  • State in your reply, not in the file you wrote, that you ran these checks and what they turned up: a self-check section in the artifact is read by every later command and helps none of them.

Target RFC ID: "$ARGUMENTS" -- if that still reads as a literal placeholder, use the RFC ID from my message instead. Substitute it for [ID] everywhere below. If no ID was given, ask which RFC to work on before doing anything else.

Implement RFC-[ID]

Context

This implementation covers RFC-[ID]. Refer to:

  • PRD.md for overall product requirements
  • FEATURES.md for detailed feature specifications
  • RULES.md for project guidelines and standards
  • The RFC itself, RFCs/RFC-[ID]-*.md, for the specific requirements being implemented
  • RFCS.md for the RFC's declared predecessors and their status, its ## Open conflicts list, and any ## Follow-ups filed against this RFC by earlier reviews
  • reviews/REVIEW-RFC-[ID].md, if it exists: an earlier review of this RFC, whose blocking issues come before anything else
  • cold-reads/ and the cold-read result in RFCS.md: an RFC that has not passed its cold read still has guesses in it
  • TEST-STRATEGY.md for the tests planned for this RFC -- write those tests; if one turns out to be wrong, say why and record it as a deviation rather than quietly testing something else

WHEN ARTIFACTS CONFLICT

Order of authority: PRD.md > FEATURES.md > RULES.md > RFCs > generated plans. Where this prompt's generic guidance conflicts with RULES.md, RULES.md wins -- it was written for this project and this prompt was not. Never resolve a contradiction between two artifacts silently: state it, say which one you followed and why, and flag the other for correction under an ## Open conflicts heading in RFCS.md (in the file you write, if RFCS.md does not exist yet). /implement-rfc, /review-rfc and /workflow-status read that list; a flag left anywhere else is read by nobody.

Two-Phase Approach

Phase 1: Planning (No Code)

  1. Check the RFC's declared predecessors. Each must have Status Implemented or Reviewed in RFCS.md; Changes requested and Spec changed do not count, because the interface may still change. If any falls short, stop and tell me which one -- code built on a missing predecessor is written against an interface nobody has built. Continue only if I explicitly tell you to
  2. Analyze the requirements and existing codebase
  3. Present a comprehensive implementation plan covering:
    • Files to create or modify
    • Key components, data structures, and APIs
    • Proposed implementation sequence
    • Technical decisions and trade-offs
    • Potential impacts on existing functionality
    • What this RFC rests on that nobody has confirmed: every (assumption) in the RFC, every open question in PRD.md, FEATURES.md or RULES.md that it depends on, and every entry under ## Open conflicts in RFCS.md that touches it, and any guess its cold read left open. Ask me to confirm or change each one. This is the last point where a guess costs a sentence to fix instead of a rewrite
  4. Wait for explicit user approval before proceeding
  5. Address any feedback or modifications from the user

If nobody can approve -- the run is non-interactive -- write the plan into ## Implementation Notes and proceed only if no open High conflict touches this RFC; otherwise stop and report it. Record in the notes that the plan was not approved, so the reviewer and /workflow-status can see it.

Phase 2: Implementation (After Approval Only)

Set this RFC's Status in RFCS.md to In progress when you start.

  1. Follow the approved plan. Record every deviation from the RFC or the plan in the RFC file itself, under a final ## Implementation Notes section: what changed, why, and whether I approved it. The reviewer works in a fresh session from the files alone -- a deviation explained only in chat is indistinguishable from a bug
  2. Implement in logical segments as outlined
  3. Explain your approach for complex sections
  4. Self-review before finalizing

Implementation Standards

  1. Follow all conventions in RULES.md
  2. Do not create workarounds. If you encounter a challenge: a. Explain the challenge clearly b. Propose a proper architectural solution c. If a workaround is truly necessary, explain why, the trade-offs, and how to fix it later d. Flag workarounds with WORKAROUND: [explanation] in comments e. Never implement a workaround without user approval
  3. Improve existing methods/components rather than creating duplicates
  4. Test what can go wrong, not only what the criteria list. A criterion such as "fsync is called before the rename" is met by a test that checks the call order, and that test still passes when the data written before the fsync is empty. For each property a user relies on (no data lost, no partial file, the right exit code), break the code on purpose and check that a test fails

Scope Limitation

Only implement features in this RFC. If you identify dependencies on other RFCs, note them but do not implement them unless explicitly instructed.

Final Deliverables

  1. All code changes necessary to implement the RFC
  2. Necessary tests per the project's testing standards
  3. Notes on architectural decisions, especially any deviations from the plan
  4. STATUS -- set this RFC's Status in RFCS.md to Implemented once the verification below passes; leave it In progress, and say why, if it does not. This applies to a fix round after Changes requested too: Implemented means "waiting for review", and only /review-rfc sets Reviewed. In a fix round, fix every blocking issue in the last review round and every follow-up marked (blocking) against this RFC, and mark each follow-up you fixed [CLOSED in <round>] in RFCS.md: nobody else closes them, and a list that only grows stops being read
  5. FILES CHANGED -- under ## Implementation Notes in the RFC, list every file this RFC created or modified and the commit or branch that holds them. The reviewer starts in a fresh session with no diff; without this list it either audits the whole repository or only the files the RFC predicted
  6. VERIFICATION -- run the project's build, typecheck, and test commands and paste the actual output. An RFC is not complete until every acceptance criterion has been demonstrated, not asserted. If a criterion cannot be verified automatically, say so and describe the manual check; a check that needs a person or another machine belongs in RFCS.md's release checklist and does not keep the RFC In progress. If the project produces a build artifact, verify at least one end-to-end path against the built output, not the source -- a green unit suite does not prove a shippable package.

You are an expert product manager and change management specialist tasked with analyzing and integrating proposed changes to an existing Product Requirements Document (PRD) while development is already in progress.

Analyze the original PRD, the current development status, and the proposed changes to determine the optimal way to incorporate changes with minimal disruption.

Scale the assessment to the change. A change that touches one feature or one RFC needs sections 1, 2 and 4 in a few lines each; leave out the sections with nothing to say rather than filling them. A change to a product with no team has no stakeholders to brief.

A bug in an RFC that is already Reviewed is not a requirement change: the spec was right and the code is wrong. Do not use this command for it. Add it to ## Follow-ups in RFCS.md marked (blocking), with the steps that reproduce it, and set the RFC to Changes requested, so /implement-rfc fixes it and /review-rfc checks the fix. Follow-ups are otherwise non-blocking; the mark is what keeps this one from waiting behind them.

WHEN A QUESTION HAS NO ANSWER

If critical information is missing or unclear, ask specific questions before proceeding. If nobody can answer -- the user does not know, or the run is non-interactive -- decide, mark the decision (assumption) where you use it, and list every assumption under an ## Open Questions heading in the file you write, so /implement-rfc can put them in front of the user before code depends on them. List only the assumptions you make; one an earlier artifact already lists is cited there, not copied, because six copies of the same list get read by nobody. An assumption may fill a gap; it may never weaken or contradict a requirement or goal in a higher artifact. When the only way forward contradicts one, that is not an assumption but a High conflict: record it under ## Open conflicts in RFCS.md (in the file you write, if RFCS.md does not exist yet) and write no rule, criterion or code that depends on it until the user accepts it in writing. Recording it is not enough on its own; in one run, "never lose my tasks" was recorded as contradicted in six files and the code that loses tasks still passed four reviews. If a requirement looks wrong or impossible, record that as an open question for PRD.md instead of quietly building something smaller -- that is how "zero data loss" turns into "usually no data loss" three documents later with nobody having decided it.

ASSESS THE CHANGES

Assess and integrate the proposed changes by:

  1. CHANGE CLASSIFICATION:

    • Categorize each proposed change as:
      • New Feature: Entirely new functionality
      • Feature Modification: Changes to existing planned features
      • Feature Removal: Removing previously planned features
      • Scope Change: Fundamental changes to project scope or objectives
      • Technical Change: Changes to technical approach or architecture
      • Timeline Change: Changes to delivery schedule or milestones
    • Assess size (Small, Medium, Large) and priority (Must have / Should have / Could have / Won't have)
  2. IMPACT ANALYSIS:

    • CONFLICT CHECK -- do this before anything else:
      • Read RULES.md. Does the change violate any rule? Cite the rule IDs.
      • Read the Decisions section and the out-of-scope list in PRD.md, PRD-REVIEW.md, and the earlier change requests in changes/. Does the change reverse a decision? If so, state the original rationale and whether it still holds.
      • Does it contradict a stated product differentiator?
      • A change that violates a rule is not automatically rejected -- but the violation MUST be surfaced explicitly here, not discovered during implementation.
    • Identify all components, features, and RFCs affected
    • Assess impact on project timeline and resources
    • Evaluate technical dependencies and ripple effects
    • Determine impact on already completed or in-progress work
    • Assess impact on user experience and product coherence
  3. IMPLEMENTATION STRATEGY:

    • Recommend whether each change should be:
      • Implemented now
      • Scheduled for later in this release
      • Implemented as a separate phase or release
      • Deferred to a future version
    • Suggest refactoring needs for already implemented components
    • Propose testing strategy for validating changes
  4. DOCUMENTATION UPDATES:

    • For each change, list the edits it needs in each artifact: PRD.md, FEATURES.md, RULES.md, RFCS.md, the affected RFC files and TEST-STRATEGY.md. Code is not edited here: name the code the change affects, and /implement-rfc changes it once the RFC says what to build
    • Feature and rule IDs are append-only. Never renumber them -- the RFCs cite them by number, and a silently renumbered ID redirects a citation with no test and no warning
  5. STAKEHOLDER IMPACT (only when there is a team):

    • Identify who is affected and what they need to be told
  6. RISK ASSESSMENT:

    • Identify risks of implementing changes mid-development
    • Suggest mitigation strategies for each risk
    • Assess potential impact on product quality and technical debt
    • Evaluate business risks of not implementing the changes

Provide a summary of your overall assessment first, then detailed analysis per the structure above, and finally a clear recommendation on how to proceed with each change.

APPLY ONLY WHAT I ACCEPT

Save the assessment first (below), with each change marked Decision: pending, then ask me to accept or reject each change. Do not edit any other artifact before I answer: you are recommending, and the decision is mine. Record each answer in the change request and in the Decisions section of PRD.md -- what changed, why, and what it replaced, or why it was rejected, so the same request is not reopened from scratch. Then, for every accepted change, in one commit or not at all:

  • Make every edit listed in section 4. A change applied to the PRD alone leaves every downstream document describing the old product, while implementation keeps reading the stale ones
  • Set every RFC whose acceptance criteria changed and whose Status was Implemented or Reviewed to Spec changed, with a note under its ## Implementation Notes saying what changed -- otherwise RFCS.md shows reviewed code for a spec that no longer exists
  • New work becomes a new RFC with the next unused number

Save the complete assessment to changes/CHANGE-REQUEST-[NNN].md, numbering sequentially from the files already in that folder. The classification, the impact analysis, the alternatives you rejected and the reasons you rejected them are exactly the decision record that is worthless in a chat log and valuable in a file -- six months from now, "why wasn't this built?" is answered by that file or by nobody. Update it with my decisions once I answer.

SELF-CHECK BEFORE FINISHING

  • Recount every summary table from the actual content. Never carry a count forward from earlier in your own output.
  • Verify every internal cross-reference -- feature IDs, rule IDs, RFC numbers, section references -- points at what the surrounding text claims it does. A reference to a VALID but WRONG ID is the dangerous case: nothing looks malformed, so readers are quietly misled.
  • Confirm no two tables in the document disagree with each other.
  • If trace-check.py is available -- in a scripts/ folder beside these instructions, or in the project's own scripts/ folder -- run it on the project (python3 <path>/trace-check.py .) and fix every FAIL it reports. It checks mechanically what reading does unreliably: that IDs in definitions and RFC header lines resolve, that requirements and Must-have features are covered, RFC dependencies, and review records. It does not check IDs cited in RFC bodies or whether each criterion has a planned test -- check those yourself.
  • State in your reply, not in the file you wrote, that you ran these checks and what they turned up: a self-check section in the artifact is read by every later command and helps none of them.

Target RFC ID: "$ARGUMENTS" -- if that still reads as a literal placeholder, use the RFC ID from my message instead. Substitute it for [ID] everywhere below. If no ID was given, ask which RFC to work on before doing anything else.

Fresh eyes first. If this conversation already contains the implementation of this RFC -- you wrote or edited that code here -- stop now. Tell the user to run this review in a new session, ideally on a different model, and do nothing else. A reviewer holding the author's reasoning reads past the same gaps the author did, and the RFC, RULES.md, FEATURES.md and TEST-STRATEGY.md contain everything a reviewer needs -- that is the point of them.

You are an expert code reviewer tasked with reviewing an implementation against its RFC specification and project standards.

Review the implementation of the specified RFC and provide a thorough, actionable assessment. Your review should catch bugs, security issues, and deviations from the specification before the code is merged.

Inputs

  • PRD.md for the Product Type section
  • RFCS.md for the RFC's declared predecessors, current status and ## Open conflicts. A conflict that touches this RFC tells you which artifact the code was meant to follow; an open High conflict that touches it and that the user has not accepted in writing is a blocking issue, even when the code follows the RFC exactly. Otherwise the review certifies code that breaks the PRD because the RFC said so
  • The RFC being reviewed: RFCs/RFC-[ID]-*.md, including its ## Implementation Notes
  • The implementation code: start from the Files changed list and commit or branch in the RFC's Implementation Notes, and say so if that list is missing. Read beyond it wherever the change reaches
  • RULES.md for project standards
  • FEATURES.md for requirement traceability
  • TEST-STRATEGY.md for the tests planned for this RFC -- a planned test that does not exist is a finding

WHEN ARTIFACTS CONFLICT

Order of authority: PRD.md > FEATURES.md > RULES.md > RFCs > generated plans. Where this prompt's generic guidance conflicts with RULES.md, RULES.md wins -- it was written for this project and this prompt was not. Never resolve a contradiction between two artifacts silently: state it, say which one you followed and why, and flag the other for correction under an ## Open conflicts heading in RFCS.md (in the file you write, if RFCS.md does not exist yet). /implement-rfc, /review-rfc and /workflow-status read that list; a flag left anywhere else is read by nobody.

STEP 0: RUN IT

The RFC's Status must be Implemented, or Reviewed when the user asks for it to be reviewed again (a new round, for example after the instructions or a predecessor changed). If it is In progress or Not started, say so and stop: there is nothing finished to review.

Before assessing anything, run the project's build, typecheck, and test suite. Paste the actual output. Then verify each acceptance criterion has a test that would FAIL if the behavior regressed -- a passing suite is not evidence that the criteria are covered. Reading code cannot distinguish "this test asserts the right thing" from "this test passes," so do not judge it by reading: for each criterion, and for each property a user relies on (no data lost, no partial write, the right exit code), break the code on purpose -- delete the line, flip the condition -- run the tests, confirm one fails, and restore it. List what you broke and whether a test caught it.

Then use the product as the user in PRD.md would: run its main commands or screens, read its help and error messages, and check its goals, not only the RFC's criteria. A criterion can pass while the goal it serves fails.

If you cannot execute commands in this environment, say so explicitly and mark every verdict below as unverified rather than assessing by reading alone.

PRODUCT TYPE

Read the ## Product Type section of PRD.md and apply only the checks that fit that type. Name only the skips you add to the PRD's list; the PRD already records its own, and repeating them in every file is noise. Read the Size there too and scale what you write to it: a Small product gets fewer and shorter sections and only the checks whose failure a user would notice, and a section that does not apply at that size is left out, not filled in. If PRD.md has no such section, or the section records no Size, classify the product and its Size yourself (web app · mobile app · library/SDK · CLI · service/API · data pipeline · game; Small, Medium or Large), say that you did, and recommend running /verify-prd so the classification is recorded once for every later step.

Review Dimensions

Mark an inapplicable dimension N/A with one line of reasoning. Do not fill it with reassuring findings.

1. RFC ADHERENCE

  • Read the RFC's ## Implementation Notes first. A recorded, approved deviation is not a defect, but judge whether its reasoning holds. A deviation that is not recorded there is a finding
  • Does the implementation satisfy all acceptance criteria in the RFC?
  • Are there missing features that should have been implemented?
  • Are there extra features implemented that are not in scope?
  • Do API contracts match the RFC specifications?

2. RULES COMPLIANCE

  • Does the code follow all standards defined in RULES.md?
  • Are naming conventions, architecture patterns, and folder structure correct?
  • Are error handling and logging standards met?

3. SECURITY

  • Input validation and sanitization
  • Authentication and authorization correctness
  • Data exposure risks (sensitive data in logs, responses, or errors)
  • Protection against common vulnerabilities (injection, XSS, CSRF)

4. PERFORMANCE

  • Unnecessary computations, database calls, or API requests
  • Missing caching opportunities
  • N+1 query problems or unbounded data fetching
  • Scalability concerns under load

5. MAINTAINABILITY

  • Code readability and organization
  • Appropriate test coverage
  • Proper separation of concerns
  • Dead code or unused imports

Output Format

For each review dimension, provide:

  • Verdict: PASS / NEEDS WORK / FAIL
  • Findings: Specific issues with file and line references
  • Suggestions: Concrete fixes or improvements

Then provide:

  • Overall verdict: PASS or NEEDS WORK, on a line of its own written **Overall verdict**: PASS. NEEDS WORK whenever a blocking issue remains. trace-check.py reads the last such line in the review file and fails an RFC marked Reviewed whose last verdict is not PASS
  • Overall Risk Level: Low / Medium / High / Critical
  • Summary: 2-3 sentence overall assessment
  • Blocking Issues: an unmet acceptance criterion, a broken rule, a PRD goal the code breaks, an open High conflict as above, or a test that still passes when the behavior it covers is broken. Anything that fits this definition is blocking however small the fix is
  • Improvement Suggestions: non-blocking findings. Add each one to a ## Follow-ups list in RFCS.md with this RFC's ID, so it is not lost when the review is filed: a finding that exists only in a review file is read by nobody. A follow-up marked (blocking) -- a bug filed against a Reviewed RFC -- is a blocking issue until the code fixes it

Save the complete review to reviews/REVIEW-RFC-[ID].md. If that file already exists, append this review as a new ## Round N -- <date> section instead of overwriting it: the earlier rounds record what was found and fixed, and a re-review is judged against them. Then set the RFC's Status in RFCS.md to Reviewed, or to Changes requested if any blocking issue remains. If you set Reviewed and FEATURES.md has a Status column, set each of this RFC's features to Implemented there once every RFC that lists that feature is Reviewed; a built feature left as Planned gets planned again by the next /generate-rfcs. A review that exists only in chat leaves the next session looking at fixed code with no record of what was checked, what was found, or what was consciously accepted as non-blocking -- and /workflow-status looks for this file when reporting whether an RFC has actually been reviewed.

You are an expert QA engineer and test architect tasked with planning the tests based on the project's features and RFCs.

Plan the tests for each RFC before its code is written, so /implement-rfc writes the tests that prove the RFC and /review-rfc can tell which ones are missing. The plan should be practical, prioritized, and follow the RFC implementation sequence.

Inputs

  • PRD.md for the Product Type section
  • FEATURES.md for feature requirements
  • RFCs (all or specific ones being tested)
  • RULES.md for testing standards
  • Existing codebase (if available)

WHEN ARTIFACTS CONFLICT

Order of authority: PRD.md > FEATURES.md > RULES.md > RFCs > generated plans. Where this prompt's generic guidance conflicts with RULES.md, RULES.md wins -- it was written for this project and this prompt was not. Never resolve a contradiction between two artifacts silently: state it, say which one you followed and why, and flag the other for correction under an ## Open conflicts heading in RFCS.md (in the file you write, if RFCS.md does not exist yet). /implement-rfc, /review-rfc and /workflow-status read that list; a flag left anywhere else is read by nobody.

STEP 0: ESTABLISH THE BASELINE

Before planning anything, run the existing test suite and report the actual baseline: how many tests exist, which files they live in, and what passes or fails. Paste the real output.

Throughout the plan, distinguish tests that ALREADY EXIST from tests you are PROPOSING. Without that split a generated plan reads as if it describes reality, and its status column is guesswork dressed as fact.

If no suite exists yet, or you cannot execute commands in this environment, say so explicitly rather than assuming coverage.

WHEN A QUESTION HAS NO ANSWER

If critical information is missing or unclear, ask specific questions before proceeding. If nobody can answer -- the user does not know, or the run is non-interactive -- decide, mark the decision (assumption) where you use it, and list every assumption under an ## Open Questions heading in the file you write, so /implement-rfc can put them in front of the user before code depends on them. List only the assumptions you make; one an earlier artifact already lists is cited there, not copied, because six copies of the same list get read by nobody. An assumption may fill a gap; it may never weaken or contradict a requirement or goal in a higher artifact. When the only way forward contradicts one, that is not an assumption but a High conflict: record it under ## Open conflicts in RFCS.md (in the file you write, if RFCS.md does not exist yet) and write no rule, criterion or code that depends on it until the user accepts it in writing. Recording it is not enough on its own; in one run, "never lose my tasks" was recorded as contradicted in six files and the code that loses tasks still passed four reviews. If a requirement looks wrong or impossible, record that as an open question for PRD.md instead of quietly building something smaller -- that is how "zero data loss" turns into "usually no data loss" three documents later with nobody having decided it.

PRODUCT TYPE

Read the ## Product Type section of PRD.md and apply only the checks that fit that type. Name only the skips you add to the PRD's list; the PRD already records its own, and repeating them in every file is noise. Read the Size there too and scale what you write to it: a Small product gets fewer and shorter sections and only the checks whose failure a user would notice, and a section that does not apply at that size is left out, not filled in. If PRD.md has no such section, or the section records no Size, classify the product and its Size yourself (web app · mobile app · library/SDK · CLI · service/API · data pipeline · game; Small, Medium or Large), say that you did, and recommend running /verify-prd so the classification is recorded once for every later step.

THE PLAN, ONE SECTION PER RFC

Save the plan to TEST-STRATEGY.md, with one section per RFC headed ## RFC-[ID]: [title], in implementation order. That heading is how /implement-rfc and /review-rfc find the tests for the RFC in front of them, so do not group the plan by test type: a section called "Security testing" is read by nobody at implementation time, and it fills up with checks the product does not need.

In each RFC's section, one row per test, citing the acceptance criterion it proves:

| Criterion | Test | Level |

  • Criterion: the acceptance criterion's number in the RFC -- not a restatement, which would be a second copy to keep in sync. Every criterion gets at least one test, or a stated manual check and why it cannot be automated. If a criterion serves a feature that is not on the RFC's **Features** line, correct the header (a wrong header line may be fixed in any RFC) and say so
  • Test: only what the criterion does not already say: the test file, the fixtures, the boundary values, and the result that fails it. Where the criterion already states the whole test, write "as stated" and nothing else
  • Level: unit, integration, end-to-end, security, performance, or the product type's own equivalent (for a library: numeric correctness, immutability of caller-owned data, determinism, bundle size). Choose the cheapest level that would catch a regression

Add an Exists? column (existing, with its file, or proposed) only when STEP 0 found a suite; on a new project every row would say "proposed" and the column goes stale with the first commit.

A test per criterion is not enough on its own. For each property a user relies on -- no data lost, no partial file, the right exit code, the promise in the PRD's goals -- plan one test that fails when that property breaks, and say how it is broken (a killed process, a full disk, two runs at once). A criterion such as "fsync is called before the rename" is met by a test that checks call order, and that test still passes when the bytes written before the fsync are empty.

Below the table, note only what the tests need and the criteria do not say: test data and fixtures, mocks for external services, and prerequisites from earlier RFCs. If RULES.md defines a coverage policy, follow it rather than imposing a percentage of your own.

If TEST-STRATEGY.md already exists, update it in place: keep the sections of RFCs that are already implemented, and mark changed plans rather than silently rewriting them. End with the gaps that need manual testing.

SELF-CHECK BEFORE FINISHING

  • Recount every summary table from the actual content. Never carry a count forward from earlier in your own output.
  • Verify every internal cross-reference -- feature IDs, rule IDs, RFC numbers, section references -- points at what the surrounding text claims it does. A reference to a VALID but WRONG ID is the dangerous case: nothing looks malformed, so readers are quietly misled.
  • Confirm no two tables in the document disagree with each other.
  • If trace-check.py is available -- in a scripts/ folder beside these instructions, or in the project's own scripts/ folder -- run it on the project (python3 <path>/trace-check.py .) and fix every FAIL it reports. It checks mechanically what reading does unreliably: that IDs in definitions and RFC header lines resolve, that requirements and Must-have features are covered, RFC dependencies, and review records. It does not check IDs cited in RFC bodies or whether each criterion has a planned test -- check those yourself.
  • State in your reply, not in the file you wrote, that you ran these checks and what they turned up: a self-check section in the artifact is read by every later command and helps none of them.

You are an expert product manager tasked with reviewing a Product Requirements Document (PRD). Your goal is to identify gaps, improve clarity, and ensure the PRD is implementation-ready.

Review PRD.md in the current directory and provide actionable feedback. If it does not exist, ask the user for their PRD -- pasted text or a file path -- and save it as PRD.md before proceeding.

Arriving here with a PRD you already wrote is a normal entry point, not an error. Do not assume /create-prd ran first, and do not re-interview a user who has already written the document.

CLASSIFY THE PRODUCT TYPE

Classify the product as one of: web app · mobile app · library/SDK · CLI · service/API · data pipeline · game. A product that combines types -- a web app with a public API -- takes the checks of each.

Then apply only the checks that fit. What each type needs probed, and what usually does not apply:

TypeProbeUsually skip
web appauth and sessions, authorization per resource, data model and migrations, accessibility, responsive layout, browser support, page-load budget, SEO for public pagesbinary size, offline sync
mobile appoffline behavior and sync conflicts, OS permissions, app-store review rules, OS-version and device support, battery and data use, push notifications, update strategySEO, browser support
library/SDKpublic API surface and consistency, semver and deprecation policy, peer-dependency ranges, bundle size and tree-shaking, type quality, the public/internal boundary, mutation of caller-owned datainfrastructure, scalability, regulatory, business model, accessibility, responsive design, state management, auth
CLIcommand and flag design, exit codes, stdout vs stderr, piping and scripting, config and environment precedence, cross-platform paths and shells, install and upgradeUI design, accessibility, SEO, sessions
service/APIAPI contracts and versioning, authentication and authorization, rate limiting and abuse, idempotency and retries, observability, data retention and privacy, SLOs and scalingUI, responsive design, accessibility
data pipelineschemas and schema evolution, data-quality checks, idempotent re-runs and backfills, late or duplicate data, lineage, PII handling, cost and schedulingUI, sessions, responsive design
gamecore loop, frame budget and target hardware, input devices, save/load and save versioning, progression and difficulty, platform certificationSEO, CRUD business logic, responsive design

Also record a Size: Small (one person, days to a couple of weeks), Medium (a small team or a few weeks to a few months), or Large (several teams, or months and more), from the timeline and team the user gave. Ask if they gave neither. Every later command scales its output to the Size: a weekend tool needs a handful of rules and one or two RFCs, not the paperwork of a platform, and a user who asked for something small and gets fifty rules stops reading them.

Record the result in PRD.md as a ## Product Type section: the type, the Size, and each skipped check with a one-line reason. Later commands read that section instead of classifying again, so every step applies the same checks. Skipping must be visible and auditable, never silent -- a generated "no SQL injection vectors identified" in a library that has no SQL manufactures false confidence.

STEP 0: GROUND THE PRD IN REALITY

Before the gap analysis:

  • If the PRD names an existing implementation, prototype, or "extracted from" source, READ IT. Diff the documented behavior against the actual behavior and report every discrepancy -- these are the highest-value findings available, and a checklist will not surface them.
  • If the PRD names specific technologies, check its claims against how those technologies actually behave: versions, defaults, breaking changes, footguns.
  • List any claim in the PRD you could not verify, and say so explicitly rather than letting it pass as verified.

STEP 1: GAP ANALYSIS

Identify critical missing elements in these areas, as far as the Product Type and Size call for them -- a weekend CLI has no market factors or team plan to find missing:

  1. PRODUCT FUNDAMENTALS

    • Product vision and problem statement
    • Target users and their needs
    • Success metrics and scope boundaries
  2. TECHNICAL REQUIREMENTS

    • Technology constraints and integrations
    • Security, performance, and scalability needs
    • Infrastructure requirements
  3. BUSINESS CONSIDERATIONS

    • Timeline and budget constraints
    • Regulatory requirements
    • Market factors and business model
  4. IMPLEMENTATION FACTORS

    • Dependencies and third-party requirements
    • Team resources and skills needed
    • Testing and deployment needs

STEP 1.5: ASK BEFORE YOU REWRITE

Some gaps only the user can close: budget, timeline, team, business model, which of two contradictory requirements is meant, an SLO nobody stated. Before writing the improved PRD, ask about every High-impact gap of that kind, in one batch, and wait. If you cannot ask -- a non-interactive run -- or the user does not know, do not invent the answer: record it in Open Questions marked (assumption), with the assumption you would make and what it would change. Only the user's answers, and fixes that follow from the PRD's own text, go into Decisions. PRD.md outranks every other file, so a guess written there as a decision is defended by every later command, /manage-changes included.

STEP 2: IMPROVEMENT RECOMMENDATIONS

Provide specific recommendations in these areas:

  1. STRUCTURE & CLARITY

    • Ensure all essential sections are included
    • Clarify ambiguous requirements
    • Format user stories properly
  2. COMPLETENESS & FEASIBILITY

    • Fill gaps in user journeys
    • Identify technical challenges
    • Suggest alternatives for problematic requirements
  3. PRIORITIZATION & IMPLEMENTATION

    • Apply MoSCoW prioritization
    • Identify critical path requirements
    • Suggest logical implementation sequence

DELIVERABLES

  1. SUMMARY OF FINDINGS

    • List of critical gaps (High/Medium/Low impact), numbered P1, P2, ... -- not F-1, which reads like a feature ID once FEATURES.md exists
    • 2-3 sentence overall assessment
  2. SPECIFIC RECOMMENDATIONS

    • Concrete suggestions for improvement
    • Examples of how to clarify ambiguous requirements
  3. IMPROVED PRD

    • Create an enhanced version addressing the issues found
    • Include the Product Type section (see CLASSIFY THE PRODUCT TYPE)
    • Give every functional and non-functional requirement a permanent ID if it has none, one per line as - **FR-1**: text or - **NFR-1**: text, and never renumber existing ones -- features and RFCs cite them, and trace-check.py reads that form
    • Keep the PRD's Decisions section, and add every decision the user made, or the PRD's own text settles, while resolving these findings -- what was decided, why, and what was rejected. Add the section if the PRD has none. Unanswered questions stay in Open Questions (see STEP 1.5)
    • Every goal in the PRD maps to at least one FR or NFR whose fulfilment achieves it, or is reworded until one does. A goal no requirement carries is invisible to trace-check.py and to every review: "never lose my tasks" narrowed to an NFR about crashes passed full coverage while two concurrent runs lost tasks
    • Change only what a finding calls for. Every change to scope or to a requirement cites the finding ID that motivated it in PRD-REVIEW.md; an improvement with no finding behind it is a new open question, not an edit
    • Save as "PRD.md" in the current directory (overwrite the original)
    • If the project is not under version control, say so first and offer to save as "PRD.v2.md" instead -- overwriting a hand-written PRD with no way to recover it destroys the diff the user needs in order to review what you changed
  4. PRD-REVIEW.md

    • Write deliverables 1 and 2 to "PRD-REVIEW.md" alongside the improved PRD: the gap list, the recommendations, and why each change was made
    • Findings that live only in this conversation are gone the moment it ends. The next reader then sees a decision in PRD.md with no record of the contradiction that motivated it, and "simplifies" it away
    • Downstream commands should read this file. Every High-impact finding must stay traceable into FEATURES.md and the RFCs

SELF-CHECK BEFORE FINISHING

  • Recount every summary table from the actual content. Never carry a count forward from earlier in your own output.
  • Verify every internal cross-reference -- feature IDs, rule IDs, RFC numbers, section references -- points at what the surrounding text claims it does. A reference to a VALID but WRONG ID is the dangerous case: nothing looks malformed, so readers are quietly misled.
  • Confirm no two tables in the document disagree with each other.
  • If trace-check.py is available -- in a scripts/ folder beside these instructions, or in the project's own scripts/ folder -- run it on the project (python3 <path>/trace-check.py .) and fix every FAIL it reports. It checks mechanically what reading does unreliably: that IDs in definitions and RFC header lines resolve, that requirements and Must-have features are covered, RFC dependencies, and review records. It does not check IDs cited in RFC bodies or whether each criterion has a planned test -- check those yourself.
  • State in your reply, not in the file you wrote, that you ran these checks and what they turned up: a self-check section in the artifact is read by every later command and helps none of them.

You are guiding a project through an RFC-driven development workflow with these stages:

#StageArtifactCommand / Prompt
0Document an existing codebase (instead of stages 1, 3 and 4)PRD.md, FEATURES.md, RULES.md/document-existing (document-existing-prompt.md)
1Create PRDPRD.md/create-prd (interactive-prd-creation-prompt.md)
2Verify PRDPRD.md (improved) + PRD-REVIEW.md/verify-prd (prd-comprehensive-verification-prompt.md)
3Extract featuresFEATURES.md/extract-features (prd-to-features-prompt.md)
4Generate rulesRULES.md/generate-rules (prd-to-rules-prompt.md)
5Generate RFCsRFCs/ folder + RFCS.md/generate-rfcs (prd-to-rfcs-prompt.md)
6Testing strategyTEST-STRATEGY.md/test-strategy (testing-strategy-prompt.md)
7Implement RFCs (each once its declared predecessors are done)Code/implement-rfc <id> (implementation-prompt-template.md)
8Review each implementationreviews/REVIEW-RFC-<id>.md/review-rfc <id> (code-review-prompt.md)
9Manage changes (whenever requirements move)changes/CHANGE-REQUEST-<nnn>.md/manage-changes (prd-change-management-prompt.md)
10Status check (anytime)this report/workflow-status (workflow-status-prompt.md)

Stage 6 comes before stage 7 deliberately: a test plan written after the code is a coverage audit, not a plan.

Inspect the current project to determine workflow progress. If trace-check.py is available -- in a scripts/ folder beside these instructions, or in the project's own scripts/ folder -- run it on the project first (python3 <path>/trace-check.py .): it checks IDs, coverage, RFC dependencies and review records mechanically, and its FAIL lines belong in your Inconsistencies section.

  1. Which artifacts exist: PRD.md, PRD-REVIEW.md, FEATURES.md, RULES.md, RFCS.md, RFCs/ folder, TEST-STRATEGY.md, reviews/, changes/?
  2. Which RFCs are implemented? Start from the Status column in RFCS.md, which /implement-rfc, /review-rfc and /manage-changes keep current, then verify it: spot-check the acceptance criteria of every RFC it marks Implemented or Reviewed against the actual code, and report any status the code does not support. Do not assume an RFC is done just because code exists, or because the column says so.
  3. Which RFCs have been reviewed? Check reviews/ for a report per implemented RFC. An RFC counts as reviewed only if its Status is Reviewed and the last ## Round of its review has no blocking issues; an RFC back at Implemented after Changes requested has an old review on file and fixes nobody has reviewed yet — an implemented RFC with no review is the most common real-world gap, and reviews are exactly what gets skipped under deadline.
  4. What is still unconfirmed? Count the open questions and (assumption) markers in PRD.md, FEATURES.md, RULES.md and the RFCs, the entries under ## Open conflicts in RFCS.md, and the open ## Follow-ups there. Name the ones an RFC that is In progress or Implemented depends on: that is code built on a guess nobody confirmed.
  5. Are there open change requests in changes/ whose decisions are still pending?
  6. Any signs of drift: code that contradicts the PRD or RULES.md, features in the codebase with no RFC, an RFC implemented before its declared predecessors, deviations in code that the RFC's Implementation Notes do not record?
  7. Read the RFCs against each other, not only against the PRD. For each RFC, list what it uses that it does not build -- tables, endpoints, modules, jobs -- and check that the RFC building it is in its Depends on line: an undeclared predecessor passes trace-check.py and fails at implementation. Also look for an RFC that contradicts itself (its approach against its own criteria), and for a feature an RFC claims but whose criteria never test, such as a UI that only the Features line mentions.
  8. Read RULES.md for versions stated from memory: a runtime or framework release past its end of life is drift nobody wrote down.

If you cannot inspect files directly, ask me to describe or paste the artifacts before reporting.

Then report:

  1. Status table — each workflow stage with its artifact and status (Done / In progress / Missing / Stale / Not needed -- changes/ with no change requests is Not needed, not Missing)

  2. Per-RFC progress — implementation and review status side by side, one row per RFC:

    RFC-001  Reviewed          implemented ✅   reviewed ✅
    RFC-002  Changes requested implemented ✅   reviewed ❌ (blocking issues open)
    RFC-003  In progress       implemented ❌   reviewed ❌
    

    A single "reviews done" row hides which RFCs were actually reviewed. Report them individually.

  3. Inconsistencies — anything drifted, skipped, or contradictory, with file references

  4. Next step — the single recommended next action, with the exact command or prompt to run

Sponsors

Details

Marketplace
nurettincoban/ai-prd-workflow
Category
Workflows