--- name: review-rfc description: "Review an implemented RFC in a fresh context against its acceptance criteria, RULES.md and the test plan, and save the review to reviews/." argument-hint: "" context: fork agent: general-purpose metadata: source: "https://github.com/nurettincoban/ai-prd-workflow" version: "3.2.0" checksum: "sha256:b39ce3056a801ca6f6d643b993da8c16fac1152bba56cad8ef82b8ca6d5ce9db" --- 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 -- ` 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.