Skip to content

Create post_github_review plugin tool for shared PR review posting mechanics #664

Open

Description

@jflowers

Parent: #659 (Phase 1)

Problem

The GitHub review posting logic is duplicated between uf.review-council.md and uf.review-pr.md (~400 tokens each):

  • Pre-posting checks: duplicate review detection, stale review warning, CODEOWNERS check across 3 paths (.github/CODEOWNERS, CODEOWNERS, docs/CODEOWNERS)
  • Finding aggregation: body structure template, inline comment preparation with suggestion blocks
  • Verdict mapping: Council verdict → GitHub event mapping table
  • Review posting: JSON temp file creation, gh api call with --input
  • Inline comment sorting/capping rules
  • Suggestion block format and rules

The CODEOWNERS check alone (lines 729-768 in review-council, lines 1060-1094 in review-pr) is near-identical.

Proposed Solution

Create .opencode/skills/github-review-posting/SKILL.md containing:

  • Pre-posting check protocol (duplicate detection, stale review, CODEOWNERS)
  • Finding aggregation template (body structure, inline comments)
  • Verdict mapping table (single source of truth)
  • Review posting procedure (temp file + gh api)
  • Suggestion block rules
  • Inline comment sorting/capping

Commands reference: "Post review per the github-review-posting skill."

Acceptance Criteria

  • github-review-posting skill created
  • uf.review-council.md updated to reference skill (remove ~400 tokens)
  • uf.review-pr.md updated to reference skill (remove ~400 tokens)
  • CODEOWNERS check exists in exactly one place
  • Verdict mapping table exists in exactly one place
  • No behavioral change — review posting works identically
  • Tests pass (make check)

Estimated Token Savings

~800 tokens (2 files × ~400 tokens each).

Activity

  1. added
    enhancement
    refactor
    on Oct 5, 2026
  2. self-assigned this
    on Oct 5, 2026
  3. jflowers commented on Oct 19, 2026

    @jflowers
    ContributorAuthor

    Re-scope: skill → plugin tool

    Since this issue was filed, the Router Pattern (intent-level tools whose deterministic code maps a single agent intent to the required sequence of operations) has become the repo's direction of travel — #716 shipped it for /uf.unleash, and the AGENTS.md determinism gate now forbids mechanical procedural prose where an executable tool is feasible.

    A skill keeps the LLM as the orchestrator: it still reads the posting protocol and executes each step (review-state fetch → CODEOWNERS probe → verdict mapping → mktemp → gh api --input → cleanup). Every one of those steps is deterministic once two judgment outputs exist: the composed review body and the human's gate decision. That makes this a tool, not a skill.

    Proposed contract

    post_github_review({
      pr_number: number,
      verdict: string,                        // council verdict — event mapping is internal
      body: string,                           // LLM-composed under review-voice packs
      inline_comments: [{file, line, body}],  // LLM-composed under review-voice packs
      gate_confirmed: boolean                 // MANDATORY GATE as a required parameter
    })
    

    Internal sequence (absorbed from command prose)

    1. Existing-review state fetch (duplicate-review detection, stale-dismissal warning, requested-reviewer detection)
    2. Branch protection check + CODEOWNERS 3-path probe (.github/CODEOWNERS, CODEOWNERS, docs/CODEOWNERS)
    3. Verdict → GitHub event mapping — absorbs Create map_verdict plugin tool for verdict-to-GitHub-event mapping #671's map_verdict as an internal constant; the LLM never needs the table
    4. Refuse to post unless gate_confirmed: true — the MANDATORY GATE becomes structural instead of instructed, and a session resumed after context compression must re-supply it
    5. mktemp (chmod 600) → gh api --input → temp-file cleanup on ALL paths (success and failure)

    The inline-comment selection algorithm (severity sort → alphabetical round-robin → top 15 → overflow to body) is also a pure function currently described as prose in both commands — a candidate to absorb here or in a sibling lib function so it exists exactly once.

    What deliberately stays with the LLM

    • Body and inline-comment composition (review-voice packs)
    • The gate decision itself (human question via the question tool)
    • Fix-branch offer logic for pre-existing CI failures

    Relationship to other issues

    Retitled from "Create github-review-posting skill..." to reflect the tool direction. Acceptance criteria change accordingly: skill creation → tool creation in uf-workflow with make plugin-test coverage; the "no behavioral change" criterion is enforced by tests rather than prose assertion.

  4. changed the title [-]Create github-review-posting skill for shared PR review mechanics[/-] [+]Create post_github_review plugin tool for shared PR review posting mechanics[/+] on Oct 19, 2026
  5. jflowers commented on Nov 2, 2026

    @jflowers
    ContributorAuthor

    Issue Triage: VALID — enhancement

    The Divisor review panel assessed this issue with six review personas; all six classify it as a valid, objective enhancement (6/6, unanimous).

    Classification

    Field Value
    Verdict VALID
    Category enhancement (internal architectural consolidation — user-visible behavior unchanged by design)
    Objectivity objective
    Split not recommended

    Panel analysis

    The duplication claim verifies against the live sources: uf.review-council.md and uf.review-pr.md both carry the review-state fetch, the CODEOWNERS 3-path probe (.github/CODEOWNERS, CODEOWNERS, docs/CODEOWNERS), the verdict→event mapping, the mktemp + gh api --input posting sequence, and the inline-comment sorting/capping rules. The line numbers cited in the original body have drifted since filing; the near-identical prose persists.

    The re-scope from skill to intent-level plugin tool follows binding governance rather than preference:

    • Constitution Principle VI (Deterministic Execution) and the AGENTS.md determinism gate forbid mechanical procedural prose where an executable tool is feasible.
    • Determinism pack DE-005 requires a fixed judgment-free tool-call sequence to collapse into a single intent-level tool; a skill keeps the LLM orchestrating that sequence. Shipped precedent: uf.unleash: move deterministic instruction from command markdown into plugin tools #716 (uf_unleash_branch_gate, uf_delegate_command, dispatch_review_runs).
    • DE-006 places judgment at the tool boundary: body, inline_comments, and gate_confirmed arrive as validated parameters, while the verdict→event mapping and the severity-sort → round-robin → top-15 capping run inside the tool as constants/pure functions.
    • gate_confirmed as a required parameter strengthens the MANDATORY GATE structurally: a session resumed after context compression must re-supply it, so gate enforcement no longer depends on instructed prose.

    Recommendations for implementation

    1. Pin the refusal path with an explicit negative test — gate_confirmed false or absent must refuse to post. Happy-path contract tests alone leave the gate unguarded against regression.
    2. Preserve warn-before-post semantics for the absorbed pre-posting checks (duplicate review, stale dismissal, CODEOWNERS): fail closed with structured reasons rather than post-and-annotate.
    3. Enumerate the characterization tests behind "no behavioral change": verdict-mapping table entries, top-15 selection/capping rules, format templates, and the CODEOWNERS multi-path probe order.
    4. Reject unknown verdict strings at validation rather than defaulting (for the Create map_verdict plugin tool for verdict-to-GitHub-event mapping #671 mapping absorbed as an internal constant).
    5. Land the tool in a decomposed uf-workflow module (Decompose uf-workflow plugin index (3,700+ lines, 25 tools) #741) with make plugin-test coverage under the 94% plugin coverage floor.

    Related issues

    Duplicate search surfaced #671 (standalone map_verdict tool) as a similar open issue. This issue is not a duplicate of #671: #664 covers the entire posting pipeline, and the re-scope comment folds map_verdict in as an internal constant. The panel recommends treating #664 as the surviving tracker and closing #671 as absorbed when this ships.

    Next steps

    Route through the specification workflow before implementation (this is an agent-tooling change). The re-scoped acceptance criteria — tool creation in a decomposed uf-workflow module, make plugin-test coverage, behavioral equivalence enforced by tests — are ready to seed spec artifacts.

    This triage was performed by the Divisor review panel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementrefactor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions