tracker: categorize acceptance criteria in generated requirements guide - #237
Conversation
Extends the requirements-stage prompt template so the generated guide tells the agent to group acceptance criteria under H3 sub-headings when they span multiple concerns, with continuous numbering across categories so any criterion can be referenced as "AC #N". The agent picks category names per item — no fixed vocabulary, no new stage setting. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review — PR #237: Categorize acceptance criteria in requirements guideOverviewA focused, well-scoped prompt change. The production diff is one line in Code quality
Potential issues / risks
SecurityNo concerns. No new code paths, no external I/O. PerformanceNo concerns. Pure string template change. SummaryApprove with one minor note: the |
… bullet The previous `/###/` assertion was vacuous — the protocol suffix always emits `### Input mode:` and `### Gate on advance:`, so the test would pass even if the AC categorization instruction itself were removed. Replaced with a scoped match against the AC bullet. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review — PR #237: categorize acceptance criteria in generated requirements guideOverviewA focused, well-scoped change: one line replaced in IssuesBlocker — AC #3 not implementedThe
The new prompt string contains only prose; there is no worked example: The If the worked example was intentionally dropped, the requirements doc (AC #3) and the implementation doc should be updated to reflect that decision. If it should be present, the prompt string needs amending and a test assertion added. Suggestions (non-blocking)Line length — The new string is ~260 characters on a single line. It is harder to read and edit than a template literal or a string built by array join (which is the pattern the surrounding code already uses for Test assertions are broad expect(content).toMatch(/acceptance criteria.*sub-heading/is);The Positive notes
SummaryThe implementation is conceptually correct and appropriately narrow. The main thing to resolve before merging is the missing worked example (AC #3) — either add it to the prompt and a corresponding test assertion, or explicitly record the decision to omit it in the tracker docs and remove AC #3 from the requirements. |
… prompt Per review feedback during cleanup, the worked-example fence was removed from the requirements-stage prompt. Sync the item's requirements.md and implementation.md so they reflect what actually shipped (no example). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review — PR #237: categorize acceptance criteria in generated requirements guideOverviewA single-line production change to the Code quality and best practices ✅
Potential issues / minor observations1. expect(content).toMatch(/acceptance criteria.*sub-heading/is);The 2. Dense instruction string ( The new bullet is ~270 chars in a single line. It reads clearly in context, but if the instruction needs further iteration the diff becomes hard to parse. This follows the existing convention for this file, so it's not a blocker — just worth flagging if the team ever considers extracting prompt strings to a dedicated template layer. 3. Because the instruction is unconditional, testing across all three Performance considerations ✅No runtime impact. The change only affects the string returned by a template function at stage-guide generation time. Security considerations ✅No new inputs, no new parsing, no exec paths affected. The instruction is advisory text for an LLM agent. Test coverage ✅
SummaryThis is a well-executed, low-risk change. The one actionable suggestion is dropping the unnecessary |
The AC bullet has no embedded newlines; `.` already matches everything within it, so the `s` flag was superfluous and slightly misleading. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review — PR #237: Categorize acceptance criteria in requirements guideOverviewThis PR makes a single-point prompt change in Code Quality
The change is surgical and correct. The new instruction string reads clearly and is unambiguous about the three rules: group by concern when helpful, number continuously, invent category names freely. One minor observation: the new bullet is a long single-line string (~300 chars). It's within acceptable range for an inline prompt string, but if this pattern of instructions grows further it may be worth factoring the AC instruction into a named constant or a short helper for readability. Not a blocker at this size.
The
Overall the test suite is a good proxy for the expected behaviour and is clearly written. Correctness
Potential IssuesNone blocking. The one thing worth a second look before merging: The test assertion Security / PerformanceNo concerns. This is a string constant change; no runtime logic, no external I/O, no parsing. SummaryClean, focused PR. The core change is correct and fully tested. The only suggestion worth addressing is tightening the |
Matches the literal phrase in the prompt and avoids a false-positive match against unrelated occurrences of "concern". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Code Review — PR #237: categorize acceptance criteria in requirements guideOverviewThis is a well-scoped, surgical change. It extends one bullet in the Code Quality
The single-line edit is clean and the intent is unambiguous. The new instruction is verbose, but that is appropriate here — it is a prose template that an AI agent reads, so precision matters more than brevity. No issues. One minor readability note: the replacement string is now quite long (220+ characters in a single array element). This is not wrong — splitting it would fragment the logical unit — but if the file has a linting rule for line length, worth verifying it passes (the diff looks fine as-is since tests pass).
The parametrized approach (
One observation: the regex Test Coverage
Performance & SecurityNo concerns. This is a static string template — no runtime cost, no external I/O, no user-controlled input reaches the modified path. Tracker Files (
|
| Area | Status |
|---|---|
| Correctness | ✓ No bugs introduced |
| Conventions | ✓ Follows project patterns |
| Tests | ✓ Parametrized; covers all combos |
| Performance | ✓ No impact |
| Security | ✓ No concerns |
| Scope | ✓ Minimal and focused |
Verdict: Looks good to merge. The one actionable suggestion is the implementation.md stale note and the optional regex robustness improvement in the test — neither is a blocker.
Summary
requirements-stage prompt indefaultStageFileContentso the generated stage guide tells the agent to group acceptance criteria under###sub-headings when they span multiple concerns, with continuous numbering across categories (so any criterion can be referenced as "AC #N").style ∈ {interview, draft_first}×detail ∈ {minimal, standard, thorough}.Test plan
npm test— 786/786 passing (148 intests/unit/tracker.test.ts, including 6 new parametrised cases)npm run typecheck— cleanrequirementsstage guide; the new instruction renders inline🤖 Generated with Claude Code