Skip to content

Add PR review and PR comment response templates#242

Merged
Alan-Jowett merged 6 commits intomicrosoft:mainfrom
Alan-Jowett:add-pr-review-templates
Apr 14, 2026
Merged

Add PR review and PR comment response templates#242
Alan-Jowett merged 6 commits intomicrosoft:mainfrom
Alan-Jowett:add-pr-review-templates

Conversation

@Alan-Jowett
Copy link
Copy Markdown
Member

@Alan-Jowett Alan-Jowett commented Apr 14, 2026

Summary

Add two new templates for pull request workflows: review-pull-request for analyzing PR diffs and respond-to-pr-comments for addressing reviewer feedback. Both support document mode (produce a report) and action mode (execute via gh CLI with mandatory user confirmation).

New Components

Type Name Path Description
format pr-comment-responses formats/pr-comment-responses.md Structured per-thread response output with contradiction detection
template review-pull-request templates/review-pull-request.md PR code review with document or action output mode
template respond-to-pr-comments templates/respond-to-pr-comments.md PR comment response with fix/explain per-thread and contradiction detection

Design Decisions

  • Reused systems-engineer persona — code review expertise already covered; no new persona needed.
  • Reused investigation-report format for review-pull-request — same findings/severity/remediation pattern as review-code.
  • New pr-comment-responses format — per-thread response structure (fix vs explain, contradiction report, action summary) has no existing format analog.
  • No new protocols — thread-state detection and contradiction detection are template-specific instructions, not reusable reasoning methodologies.
  • Both templates support output_mode: document|action — document produces a report; action executes via gh CLI. Action mode requires explicit user confirmation before every mutation (posting comments, pushing commits, resolving threads).
  • Separate templates for reviewing vs responding — these are distinct tasks (proactive analysis vs reactive feedback handling) with different inputs, outputs, and workflows.

Checklist

  • All files have SPDX license headers
  • YAML frontmatter is valid and complete
  • Component names match file names (kebab-case)
  • manifest.yaml updated with all new components
  • No vague instructions in protocols or templates
  • Templates have a quality checklist section
  • New components do not conflict with existing ones
  • CI validation passes (tests/validate-manifest.py)

Add two new templates for pull request workflows:

- review-pull-request: Analyze a PR's diff, commits, and linked issues
  to produce a structured code review. Supports document mode
  (investigation report) or action mode (post inline review comments
  via GitHub API). Language-agnostic by default with optional
  language-specific focus.

- respond-to-pr-comments: Process PR review feedback and generate
  per-thread responses (code fixes, explanations, or both). Detects
  contradictory feedback across reviewers. Supports document mode
  (response plan) or action mode (make code changes, post replies,
  and resolve threads via GitHub API).

Both templates require explicit user confirmation before any mutation
in action mode.

Also adds the pr-comment-responses format for structured per-thread
response output with contradiction detection and action summaries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 14, 2026 03:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds PromptKit components to support pull-request workflows: one template to review PR diffs and another to respond to PR review comments, plus a dedicated output format for per-thread responses and manifest wiring so the new components are discoverable.

Changes:

  • Added review-pull-request template supporting document vs. action mode PR reviews.
  • Added respond-to-pr-comments template supporting document vs. action mode per-thread responses with contradiction detection.
  • Added pr-comment-responses output format and registered new components in manifest.yaml.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
templates/review-pull-request.md New PR review template (investigation-report output; optional action mode via gh api).
templates/respond-to-pr-comments.md New template for per-thread responses to review feedback (document/action modes; contradiction detection).
formats/pr-comment-responses.md New output format to structure per-thread response plans and contradiction reporting.
manifest.yaml Registers the new format and templates so they’re available via PromptKit tooling.

Comment thread templates/respond-to-pr-comments.md
Comment thread templates/respond-to-pr-comments.md Outdated
Comment thread templates/review-pull-request.md Outdated
Comment thread formats/pr-comment-responses.md Outdated
- Add operational-constraints protocol to respond-to-pr-comments
  (consistency with other mutation-capable templates)
- Fix GitHub API endpoint for replying to PR review comments
  (use in_reply_to field, not /replies sub-path)
- Fix inline review comment posting to use JSON input file
  (prevents array-as-string serialization errors)
- Align format contradiction section with template non-goals
  (neutral options/tradeoffs instead of picking a side)
- Update manifest.yaml protocol list to match

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

Comment thread templates/respond-to-pr-comments.md Outdated
Comment thread formats/pr-comment-responses.md Outdated
Comment thread formats/pr-comment-responses.md Outdated
Comment thread templates/review-pull-request.md
Comment thread templates/review-pull-request.md
Comment thread templates/review-pull-request.md Outdated
- Add thread/comment ID capture instructions for action mode
  (respond-to-pr-comments Phase 1 now records GraphQL thread IDs
  and comment database IDs needed for replies and resolution)
- Remove behavioral directives from pr-comment-responses format
  (formats define structure only; action-mode workflow stays in template)
- Move response-type heuristics from format to template only
  (format now defines allowed enum values; heuristics stay in template)
- Fix severity scale: Nit -> Informational to match investigation-report
- Add Coverage row to document-mode mapping table
- Clarify non-goals: forbid merge only, allow APPROVE/REQUEST_CHANGES
  reviews with user confirmation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Alan-Jowett Alan-Jowett requested a review from Copilot April 14, 2026 15:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread templates/review-pull-request.md
Comment thread templates/respond-to-pr-comments.md Outdated
Comment thread manifest.yaml
Comment thread templates/review-pull-request.md
- Add commit_id to review JSON payload and instruction to fetch head SHA
  (anchors review comments to the correct diff)
- Switch reply posting from --field to --input reply.json approach
  (prevents shell escaping issues with multi-line or quoted content)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Alan-Jowett Alan-Jowett requested a review from Copilot April 14, 2026 15:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread templates/respond-to-pr-comments.md
Comment thread templates/respond-to-pr-comments.md Outdated
Comment thread templates/respond-to-pr-comments.md
- Add PR reference to gh pr view command (makes it executable)
- Use GraphQL variables for resolveReviewThread mutation
  (more robust for scripting than hardcoded string interpolation)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Alan-Jowett Alan-Jowett requested a review from Copilot April 14, 2026 15:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread formats/pr-comment-responses.md Outdated
Comment thread formats/pr-comment-responses.md
Comment thread manifest.yaml
Comment thread manifest.yaml
Change contradiction section empty text from a custom sentence to
'None identified' matching the repo-wide formatting convention.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Alan-Jowett Alan-Jowett merged commit 274b823 into microsoft:main Apr 14, 2026
4 checks passed
@Alan-Jowett Alan-Jowett deleted the add-pr-review-templates branch April 14, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants