Plans

Plan: Add rejection remediation prompt to plan-review-agents

Generated: 2026-05-18T17:45:00Z · Source: add-rejection-remediation-prompt.md

File add-rejection-remediation-prompt-review.html
Path docs/plans/add-rejection-remediation-prompt-review.html

Context

The plan-review-agents skill produces a 15-section report with a final decision of Approve, Approve with revisions, or Reject. Currently all three outcomes follow the same code path — section 14 states the verdict in one line plus a rationale sentence. When a plan is rejected, the user must manually cross-reference sections 3 (highest-risk issues), 4 (blocking issues), and 12 (recommended changes) to understand what went wrong and what to fix. There is no actionable, consolidated output for rejection.

The project uses a “self-contained prompt” pattern in plan Next Steps sections: a label followed by a fenced ```text block containing a standalone prompt a user can copy-paste into Claude. This feature brings that pattern into the review panel’s rejection output.

A stress test of the initial design surfaced three high-severity gaps and several medium/low issues that this revised plan addresses:

Objective

Extend section 14 of the plan-review-agents report with decision-specific output:

The remediation prompt is context-aware (interactive vs. background mode), handles edge cases (empty blocking issues, split decisions), and the re-run loop works cleanly via dated ## Panel Review headings that preserve history across runs.

Steps

  1. Widen the outer fence in output-template.md from 3 to 5 backticks (lines 20 and 194). Why: CommonMark terminates a 3-backtick fence at the first 3-backtick line it encounters. Verify: Lines 20 and 194 use 5 backticks.
  2. Add reject-only subsections to section 14 in output-template.md. Add #### Rejection Summary and #### Remediation Prompt. Why: Data contract that drives all downstream rendering. Verify: Subsections exist, gated by HTML comments.
  3. Handle empty section 4 in the rejection summary template. Why: A panel can reject without formal blockers. Verify: Template addresses the empty-section-4 case explicitly.
  4. Make the remediation prompt context-aware for background mode. Why: “Paste into Claude” is wrong in background mode. Verify: Template has both variants with a clear mode gate.
  5. Update SKILL.md Step 6 — add a “Rejection remediation” paragraph. Why: The lead needs explicit cross-referencing instructions. Verify: Step 6 names sections 3, 4, 12, plan path, mode detection.
  6. Use dated ## Panel Review headings in SKILL.md Step 7 with seconds precision. Why: Preserve review history; avoid collisions. Verify: Format is ## Panel Review (YYYY-MM-DD HH:MM:SS UTC).
  7. Update html-spec.md — replace badge with decision banner, add remediation section. Why: HTML artifact must render decision status prominently. Verify: Banner replaces badge; no duplicate announcements.
  8. Add Step 8 re-read instruction to SKILL.md. Why: Step 8 needs the plan content including the just-appended Panel Review. Verify: Step 8 instructions include re-reading the plan file.
  9. Update the header comment in output-template.md. Why: Document the rejection flow and 5-backtick convention. Verify: Header mentions rejection flow.
  10. Update the plugin README. Why: Documents user-visible output behavior. Verify: README mentions remediation prompt, decision banner, dated headings.
  11. Bump version to 3.4.0 in CHANGELOG and marketplace.json. Why: New feature = MINOR bump. Verify: Both files updated.

Acceptance Criteria

Report output

Re-run loop

HTML artifact

Infrastructure

Verification

  1. Read all modified files and confirm changes match acceptance criteria.
  2. Trace the rejection path (interactive): output-template section 14 → Step 6 populates with “paste into Claude” variant → Step 7 applies 15a edits + appends dated Panel Review → Step 8 re-reads plan, renders HTML decision banner (red) + remediation.
  3. Trace the rejection path (background): same but Step 6 uses “re-run the panel” variant.
  4. Trace the approve path: no reject-only content; green decision banner; dated Panel Review still appended.
  5. Trace the approve-with-revisions path: no reject-only content; amber decision banner; 15a edits apply normally.
  6. Trace the re-run path: new dated heading appended without stripping; historical reviews as collapsed <details>.
  7. Verify HTML skeleton: no badge in header; banner in main; role="status"; scrollable <pre>; clipboard JS; aria-live span; print styles.
  8. Verify output-template.md: 5-backtick fence; both prompt variants; header comment.
  9. Verify no section renumbering (still 15 sections).

Files to modify

FileChange
output-template.mdWiden outer fence to 5 backticks; add reject-only subsections to section 14; handle empty section 4 fallback; add mode-aware prompt variants; update header comment
SKILL.mdAdd “Rejection remediation” paragraph to Step 6; dated Panel Review headings in Step 7; Step 8 re-read instruction; partial-edit note for Reject
html-spec.mdReplace badge with decision banner; add remediation section; clipboard fallback JS; aria-label; print styles; color-mix() CSS; historical reviews; Security & Escaping Contract; updated skeleton
README.mdDocument rejection remediation, decision banner, dated Panel Review headings
CHANGELOG.mdPrepend 3.4.0 entry
marketplace.jsonBump version 3.3.0 → 3.4.0

Key design decisions

  1. Reject-only remediation, not “approve with revisions”: Approve with revisions already has sections 12 + 15a. A lighter revisions prompt can follow later.
  2. Inside section 14, not a new section: Avoids renumbering 15a/15b. Gated by HTML comments.
  3. Reproduce, don’t summarize: Exact copies from sections 3/4/12 with reviewer role prefixes.
  4. 5-backtick outer fence: CommonMark-spec-compliant nesting.
  5. Banner replaces badge: Single <div role="status"> in <main>. No duplicate announcements.
  6. Keep all reviews with dated headings: Seconds precision. No stripping. HTML renders each as collapsed <details>.
  7. Apply 15a edits on Reject: Partial improvement is better than none.
  8. Step 8 re-reads the plan file: Captures historical reviews for HTML generation.
  9. execCommand('copy') fallback: Progressive enhancement for file:// origins.
  10. aria-live pre-exists in DOM: WCAG 4.1.3 compliance.
  11. Copy button aria-label: WCAG 4.1.2 compliance.
  12. Scrollable <pre> with keyboard access: max-height: 300px, tabindex="0", role="region".
  13. Mode-aware prompt variants in template: Single source of truth.
  14. color-mix() with fallback: var(--surface) declared first.

Next Steps

Interview Summary

Interview conducted 2026-05-18. 14 key decisions confirmed across 3 rounds covering technical trade-offs, UI/UX flows, accessibility, and edge cases.

Key Decisions Confirmed

  1. Keep historical reviews inline with dated headings
  2. Both prompt variants in the template
  3. Apply 15a edits on Reject
  4. 5-backtick outer fence is safe
  5. Always show a decision banner for all outcomes
  6. All historical reviews in HTML as collapsed sections
  7. Silent clipboard fail (visually); aria-live announces for assistive technology
  8. role="status" on decision banner
  9. Max-height with scroll on remediation <pre>
  10. Manual trace verification
  11. Include all three decision banners in this version

Open Risks

Panel Review (2026-05-18 17:45:00 UTC) — full 15-section report

1. Executive Summary

Six reviewers assessed the plan for adding rejection remediation prompts to the plan-review-agents skill. The plan is well-structured with clear steps, strong accessibility considerations, and thoughtful edge case handling. All six reviewers provided findings.

Overall assessment: Approve with revisions — the plan is implementable as-is but benefits from the refinements identified below.

2. Role-by-Role Review

Product Manager

Approval
Approve with revisions
Works well
Feature addresses a real pain point; self-contained prompt pattern aligns with project conventions
Critical concerns
Scope expansion to all-outcome banners is a risk to delivery timeline
Missing requirements
Success metrics for measuring feature adoption

Lead Developer

Approval
Approve with revisions
Works well
5-backtick CommonMark approach, section 14 nesting, mode-aware branching are sound
Critical concerns
Step 8 cannot access historical reviews without re-reading plan file after Step 7; 15a edits on Reject may partially fail
Missing requirements
Re-read instruction between Steps 7 and 8; partial-edit documentation

UX Designer

Approval
Approve with revisions
Works well
Decision banner placement follows UX best practices; copy-paste workflow is validated
Critical concerns
“Silent clipboard fail” language contradicts aria-live announcement
Missing requirements
Clarify “silent” means visually silent only

Lead Frontend Engineer

Approval
Approve with revisions
Works well
Architecture is sound; section 14 nesting avoids renumbering
Critical concerns
Badge/banner duplication creates duplicate screen reader announcements; missing color-mix() CSS fallback
Missing requirements
Banner must replace badge; extend Security & Escaping Contract

Accessibility Expert

Approval
Approve with revisions
Works well
role="status" on banner, tabindex="0" on scrollable <pre>, aria-live feedback are correct; WCAG 1.4.1 compliance via text labels
Critical concerns
aria-live span must pre-exist in DOM (WCAG 4.1.3); copy button needs aria-label (WCAG 4.1.2)
Missing requirements
Pre-existing aria-live span in HTML skeleton; accessible copy button name

Security Expert

Approval
Approve with revisions
Works well
Existing CSP is adequate; clipboard as progressive enhancement is correct
Critical concerns
Remediation prompt content must be HTML-escaped before injection into <pre>
Missing requirements
Security & Escaping Contract must explicitly name remediation content

3. Highest-Risk Issues

  1. [Lead Dev] Step 8 re-read gap — Step 8 only has the synthesized report from Step 6, not the modified file. Historical Panel Review sections won’t appear in the HTML. Severity: High.
  2. [Frontend] Badge/banner duplication — Two announcement points cause screen readers to announce the decision twice. Severity: High.
  3. [Security] Remediation content escaping — User-authored plan text in remediation prompt could break <pre> rendering or create injection vectors. Severity: Medium.

4. Blocking Issues

No formally blocking issues. All three highest-risk items are addressable within the existing plan structure.

5. Non-Blocking Improvements

  1. [PM] Add success metrics
  2. [UX] Clarify “silent fail” language
  3. [A11y] Copy button aria-label
  4. [Frontend] color-mix() CSS fallback
  5. [Lead Dev] Partial-edit note for Reject
  6. [A11y] aria-live span must pre-exist in DOM
  7. [Security] Extend Security & Escaping Contract

6. Cross-Reviewer Agreements

  • All reviewers agree the 5-backtick fence approach is correct
  • PM + UX + A11y agree the decision banner should be visible for all outcomes
  • Lead Dev + Frontend + Security agree the architecture is sound
  • UX + A11y agree remediation must be outside collapsed appendix
  • Frontend + A11y agree the banner should replace the badge

7. Cross-Reviewer Conflicts

TopicConflictResolution
“Silent fail” vs. aria-liveInterview says “silent clipboard fail” but also “announce both success and failure”Compatible: “silent” = visually silent (button unchanged); aria-live provides assistive technology feedback
Plan file growth vs. reviewer contextPM: unbounded file growth. Lead Dev: reviewers benefit from history.Accept growth; Next Steps item for reviewer-prompt guard

8. Assumption Challenges

  • Users will know to copy the prompt — Decision banner placement and copy button mitigate this; ensure clear introductory text.
  • execCommand('copy') will continue working — Deprecated but plan treats clipboard as progressive enhancement. Acceptable.

9. Balance Assessment

All six perspectives represented. The plan leans technical but PM and UX reviews ensured user-value and interaction-design concerns were addressed. No single perspective dominated.

10. Risk Matrix

RiskLikelihoodImpactMitigation
Step 8 re-read gapHigh (confirmed)HighAdd re-read instruction
Badge/banner duplicationHigh (confirmed)HighReplace badge with banner
Remediation content injectionMediumMediumExtend Escaping Contract
color-mix() unsupportedLowLowvar(--surface) fallback
Plan file growthMediumLowReviewer-prompt guard (Next Steps)
15a edits partially fail on RejectMediumLowPartial-edit note

11. Missing Requirements

  • No success metrics (deferred to implementation)
  • No explicit clipboard test plan (acceptable for plan-level spec)
  • No rollback strategy (acceptable — all changes are additive)
  1. Add Step 8 re-read instruction to SKILL.md
  2. Replace badge with banner in html-spec.md
  3. Extend Security & Escaping Contract for remediation content
  4. Add aria-label to copy button
  5. Add pre-existing aria-live span to HTML skeleton
  6. Add color-mix() CSS fallback
  7. Clarify “silent fail” in key design decisions
  8. Add partial-edit note to Step 7 Pass 1
  9. Use seconds precision in dated headings
  10. Update plan Objective to name the two subsections

13. Implementation Priorities

Critical (must be in this version)

  • Step 8 re-read instruction
  • Badge-to-banner replacement
  • Security & Escaping Contract extension

Important (strongly recommended)

  • aria-label on copy button (WCAG 4.1.2)
  • aria-live span pre-existing in DOM (WCAG 4.1.3)
  • color-mix() CSS fallback
  • Seconds precision in dated headings

Nice to have (can defer)

  • Success metrics
  • Partial-edit note

14. Final Decision

Approve with revisions.

The plan is well-designed and addresses the core user need. The three highest-risk items (Step 8 re-read, badge/banner duplication, remediation content escaping) are all addressable within the existing plan structure. The recommended changes strengthen accessibility, security, and correctness without changing the architecture.

15a. Inline Edits Applied

Target SectionActionSummary
ObjectiveeditAdded labeled internal structure, split decision definition by outcome
StepseditAdded Step 8 re-read, seconds precision, partial-edit note, Security & Escaping Contract, badge-to-banner, copy button aria-label, aria-live pre-existing in DOM
Acceptance CriteriaeditExpanded to 21-item grouped checklist
VerificationeditExpanded to 9 items with separate traces per decision path
Files to modifyeditExpanded change descriptions
Key design decisionseditExpanded to 14 numbered decisions

15b. Revised Plan

The revised plan with all inline edits applied is the content of the source plan file above the Panel Review section.