Skip to content

ADR-255: Update reviewer/developer skill files to use thread schema - #9

Merged
jodavis merged 3 commits into
feature/ADR-246-cloud-dev-teamfrom
dev/claude/ADR-255-update-reviewer-review-sign-off-developer
Jun 4, 2026
Merged

ADR-255: Update reviewer/developer skill files to use thread schema#9
jodavis merged 3 commits into
feature/ADR-246-cloud-dev-teamfrom
dev/claude/ADR-255-update-reviewer-review-sign-off-developer

Conversation

@jodavis-claude

Copy link
Copy Markdown
Collaborator

Work item

ADR-255: Update the three agent skill markdown files (reviewer-review.md, reviewer-sign-off.md, developer-fix.md) to use the new thread schema so that all GitHub interactions are centralized in the scrum master rather than in sub-agents.

Changes

  • plugins/dev-team/commands/reviewer-review.md — Removed $PR_URL input and Step 3 (PR gate); replaced gh pr diff with git diff origin/$BASE_BRANCH; removed Step 6 (gh api post); updated output schema to {"body", "status", "threads[]} with no id field, filePath camelCase, 1-based lineNumber, and comments array; added explicit instruction that lineNumber is source-file line not diff position
  • plugins/dev-team/commands/reviewer-sign-off.md — Replaced $PR_URL header with $BASE_BRANCH and $REVIEW_THREADS; removed Step 3 (GraphQL fetch), Step 4 (GitHub MCP resolve calls and mutation), Step 6 (gh api post), and Step 6a (pr ready/Jira assign); restructured step to evaluate threads from $REVIEW_THREADS with "return every thread" instruction and comments: [] rule; output is {"body", "threads[]} with no status field; carried-over threads preserve id, new threads omit it
  • plugins/dev-team/commands/developer-fix.md — Removed Step 3 (GitHub MCP fetch) and Step 4 (triage with direct GitHub reply); added ### Build/Test Issues and ### Review Threads input sections; added mode-detection block; in review-fix mode Developer iterates threads and returns full threads[] fenced JSON block; in build/test-fix mode no JSON output is produced; steps renumbered 1–5

Design decisions

  • Sign-off id handling: Carried-over threads in reviewer-sign-off.md output include the original id so SignoffStep can match them; new threads introduced during sign-off omit id (pipeline assigns). This is required for matching without an additional lookup step.
  • Gate removal: No explicit guard added for empty $BASE_BRANCH in reviewer-review.md — if $BASE_BRANCH is empty, the git diff command fails naturally with a clear error.
  • Sign-off diff scope: Uses git diff origin/$BASE_BRANCH over all changed files rather than filtering to last-commit files, to avoid missing issues introduced across multiple fix commits.

- reviewer-review.md: replace $PR_URL with $BASE_BRANCH; remove Step 3
  (PR gate) and Step 6 (gh api post); replace gh pr diff with git diff
  origin/$BASE_BRANCH; output uses threads[] with filePath/lineNumber/
  resolved/comments schema (no id field)
- reviewer-sign-off.md: replace $PR_URL with $BASE_BRANCH and
  $REVIEW_THREADS; remove GraphQL fetch (Step 3), GitHub MCP resolve
  calls, gh api post (Step 6), and Step 6a; Reviewer evaluates threads
  from $REVIEW_THREADS and returns every thread evaluated (comments: []
  if no new comment); output has no status field; id preserved on
  carried-over threads
- developer-fix.md: remove Step 3 (GitHub MCP fetch) and Step 4
  (triage with direct GitHub reply); add Build/Test Issues and Review
  Threads input sections; add mode-detection; in review-fix mode
  Developer returns full updated threads[] JSON block; disagree flow
  appends Developer comment to thread instead of posting to GitHub

@jodavis-claude jodavis-claude left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review: ADR-255 — Update reviewer/developer skill files to use thread schema

All three exit criteria are met for reviewer-review.md, reviewer-sign-off.md, and developer-fix.md. Two correctness issues require fixes before approval.

P1-A — developer-fix.md:122: "may leave comments empty" erases Reviewer comment history

FixPrStep uses wholesale comment replacement: matched.comments = [ReviewComment(...) for c in thread_dict.get("comments", [])]. When the Developer returns "comments": [] for a thread it fixed silently (following the current instruction), this assignment erases the original Reviewer comment from the in-memory thread. At sign-off, the Reviewer receives the thread with "comments": [] and only knows the file/line location — no description of the original issue — making it harder to verify the fix.

The spec (task brief) is clear: "Each returned thread object must include all prior comments plus the new Developer reply (if any)."

Fix: Change line 122 from:

"you may leave comments empty (the Reviewer will evaluate during sign-off)"

To:

"include all prior comments from the thread's comments array as-is, and append your own {"author": "Developer", "comment": "..."} entry only if you are disagreeing or want to explain the fix. Do not clear prior comments — the sign-off Reviewer needs the original issue description."

Also update the example JSON block at lines 128–146 so the first thread (where the Developer agreed and fixed silently) shows the prior Reviewer comment preserved, not "comments": [].

P1-B — dev_team.py:885: ctx.save() called before ctx.review_fix_iteration += 1

ctx.save(self._context_path)       # line 885 — saves stale iteration count
ctx.review_fix_iteration += 1      # line 886

If the pipeline crashes between the save and the state transition, the next run re-enters FixPrStep with the same iteration count. MAX_REVIEW_FIX_ITERATIONS prevents an infinite loop, but the counter being under-counted allows one extra fix iteration than intended.

Fix: Swap the two lines so ctx.review_fix_iteration += 1 runs before ctx.save(self._context_path).

…utput

Returning comments: [] erased the original Reviewer comment, leaving
the sign-off Reviewer with no issue description. Instruction now says
to include all prior comments as-is and append a Developer reply only
when disagreeing or explaining. Example JSON block updated to match.
ctx.save() was called before ctx.review_fix_iteration += 1, so a
crash between the two lines would replay the step with the same
iteration count, allowing one extra retry beyond the configured limit.
@jodavis
jodavis changed the base branch from main to feature/ADR-246-cloud-dev-team June 4, 2026 00:42

@jodavis-claude jodavis-claude left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sign-off review for ADR-255: all exit criteria verified.

All three skill files updated correctly:

  • reviewer-review.md: uses threads[] (no id field), lineNumber is source-file line, no GitHub posting step, $BASE_BRANCH input present
  • reviewer-sign-off.md: inputs use $BASE_BRANCH and $REVIEW_THREADS, output has no status field, returns every thread with comments:[] for unchanged threads, no GitHub posting steps
  • developer-fix.md: old Steps 3-4 (GitHub fetch/reply) removed, $ISSUES and $REVIEW_THREADS input sections present, mode detection correct, threads[] output in review-fix mode only, prior comments preserved

dev_team.py: FixPrStep.review_fix_iteration incremented before ctx.save(); developer-fix thread merge correct.

No prior review threads to evaluate. No new Priority 1-4 issues found in modified files. Approved.

@jodavis-claude
jodavis-claude marked this pull request as ready for review June 4, 2026 00:47
@jodavis
jodavis merged commit 0c8220c into feature/ADR-246-cloud-dev-team Jun 4, 2026
@jodavis
jodavis deleted the dev/claude/ADR-255-update-reviewer-review-sign-off-developer branch June 4, 2026 16:32
jodavis-claude added a commit that referenced this pull request Jun 4, 2026
* ADR-255: Update reviewer/developer skill files to use thread schema

- reviewer-review.md: replace $PR_URL with $BASE_BRANCH; remove Step 3
  (PR gate) and Step 6 (gh api post); replace gh pr diff with git diff
  origin/$BASE_BRANCH; output uses threads[] with filePath/lineNumber/
  resolved/comments schema (no id field)
- reviewer-sign-off.md: replace $PR_URL with $BASE_BRANCH and
  $REVIEW_THREADS; remove GraphQL fetch (Step 3), GitHub MCP resolve
  calls, gh api post (Step 6), and Step 6a; Reviewer evaluates threads
  from $REVIEW_THREADS and returns every thread evaluated (comments: []
  if no new comment); output has no status field; id preserved on
  carried-over threads
- developer-fix.md: remove Step 3 (GitHub MCP fetch) and Step 4
  (triage with direct GitHub reply); add Build/Test Issues and Review
  Threads input sections; add mode-detection; in review-fix mode
  Developer returns full updated threads[] JSON block; disagree flow
  appends Developer comment to thread instead of posting to GitHub

* ADR-255: Fix developer-fix.md to preserve prior comments in threads output

Returning comments: [] erased the original Reviewer comment, leaving
the sign-off Reviewer with no issue description. Instruction now says
to include all prior comments as-is and append a Developer reply only
when disagreeing or explaining. Example JSON block updated to match.

* ADR-255: Fix FixPrStep to increment iteration before save

ctx.save() was called before ctx.review_fix_iteration += 1, so a
crash between the two lines would replay the step with the same
iteration count, allowing one extra retry beyond the configured limit.

---------

Co-authored-by: Joe Davis <ElwoodMoves@hotmail.com>
jodavis added a commit that referenced this pull request Jun 5, 2026
…milestone scrum master table (#12)

* ADR-256: Remove Jira tools from developer, update reviewer output schema, add dev-team.md milestone table

All authenticated connector tools removed from developer.md per the scrum-master-owns-all-operations design.
Reviewer output schema updated to thread-based JSON. Full 8-milestone table added to dev-team.md with sidecar
persistence, thread-matching, and Jira idempotency guard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ADR-255: Update reviewer/developer skill files to use thread schema (#9)

* ADR-255: Update reviewer/developer skill files to use thread schema

- reviewer-review.md: replace $PR_URL with $BASE_BRANCH; remove Step 3
  (PR gate) and Step 6 (gh api post); replace gh pr diff with git diff
  origin/$BASE_BRANCH; output uses threads[] with filePath/lineNumber/
  resolved/comments schema (no id field)
- reviewer-sign-off.md: replace $PR_URL with $BASE_BRANCH and
  $REVIEW_THREADS; remove GraphQL fetch (Step 3), GitHub MCP resolve
  calls, gh api post (Step 6), and Step 6a; Reviewer evaluates threads
  from $REVIEW_THREADS and returns every thread evaluated (comments: []
  if no new comment); output has no status field; id preserved on
  carried-over threads
- developer-fix.md: remove Step 3 (GitHub MCP fetch) and Step 4
  (triage with direct GitHub reply); add Build/Test Issues and Review
  Threads input sections; add mode-detection; in review-fix mode
  Developer returns full updated threads[] JSON block; disagree flow
  appends Developer comment to thread instead of posting to GitHub

* ADR-255: Fix developer-fix.md to preserve prior comments in threads output

Returning comments: [] erased the original Reviewer comment, leaving
the sign-off Reviewer with no issue description. Instruction now says
to include all prior comments as-is and append a Developer reply only
when disagreeing or explaining. Example JSON block updated to match.

* ADR-255: Fix FixPrStep to increment iteration before save

ctx.save() was called before ctx.review_fix_iteration += 1, so a
crash between the two lines would replay the step with the same
iteration count, allowing one extra retry beyond the configured limit.

---------

Co-authored-by: Joe Davis <ElwoodMoves@hotmail.com>

* ADR-256: Fix ctx.save() ordering and review_notes preservation in dev_team.py

P2a: Move ctx.save() to after review_fix_iteration and work_summaries updates in
FixPrStep so a pipeline resume after interruption sees the correct iteration count
and the latest work summary.

P2b: Preserve signoff body in SignoffStep when failures is empty but threads are
unresolved. ctx.review_notes now falls back to ctx.signoff_notes so the developer-fix
agent receives textual context explaining why sign-off failed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ADR-256: Document gh api strategy in dev-team.md; update reviewer.md frontmatter

P1: Add implementation note to the thread-posting section of dev-team.md explaining
that mcp__github__help was called but plugin:github:github was unavailable, and that
gh api REST/GraphQL calls are the direct equivalent. Preserves all functional
behaviour; satisfies the exit criterion by documenting the discovery outcome.

P4: Update reviewer.md description frontmatter to remove "Creates GitHub PRs" —
the scrum master owns PR creation after ADR-256; the reviewer only outputs a
structured JSON result.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ADR-256: Fix reply-to-thread URL in dev-team.md

The reply endpoint requires the pull number in the path:
  /pulls/<pull-num>/comments/<id>/replies
not the shorter form without it. Verified empirically while posting PR
thread replies — the shorter form returns 404.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ADR-256: Use mcp__plugin_github_github__add_reply_to_pull_request_comment for reply-to-thread

Satisfies exit criterion #4: MCP method name discovered from plugin:github:github
server and now referenced in Thread-posting logic. resolve-thread continues to
use gh api graphql resolveReviewThread (no MCP equivalent exists).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Remove gh CLI instructions from dev-team.md

---------

Co-authored-by: Joe Davis <ElwoodMoves@hotmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Joe Davis <jodasoft@outlook.com>
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.

3 participants