Skip to content

Create review-context convention pack for shared review discovery logic #176

Closed
3 of 3 issues completed

Description

@jflowers

Summary

Both /review-council and /review-pr need to discover and load the same types of context before reviewing: spec artifacts, linked issues, convention packs, and file classification. This logic is currently duplicated with different levels of sophistication. A new convention pack would standardize how review context is discovered and formatted for consumption by any reviewer.

Current State

Context Type /review-council /review-pr
Spec discovery Implicit via Guard persona (checks "intent drift") Explicit Step 6: branch-name matching, PR description parsing, changed-file detection
Issue linking None Step 6a: parses Fixes/Closes/Resolves #N, fetches issue details, extracts acceptance criteria, validates coverage
Convention packs Each agent loads packs per its persona definition Step 7: explicit detection, language detection, load logic
Path classification None (delegated to persona specialization) Step 8: 7-category path-based focus heuristics table
Walkthrough None Step 8: per-file change summary with focus category

Proposed Pack: review-context.md

A convention pack (.opencode/uf/packs/review-context.md) that standardizes:

  1. Spec artifact discovery protocol — how to locate the relevant spec for a change:

    • Branch name → spec directory mapping (NNN-* → specs/NNN-*/, opsx/* → openspec/changes/*/)
    • PR description parsing for spec references
    • Changed-file detection for specs introduced by the PR
    • Which sections to read (FR + User Stories for Speckit, Capabilities + Impact for OpenSpec)
  2. Issue linking protocol — how to find and process linked issues:

    • Regex patterns for Fixes/Closes/Resolves references
    • Validation rules (same repo, positive integer, max 5)
    • Acceptance criteria extraction (checkboxes, ## Acceptance Criteria heading)
    • Truncation and untrusted-input handling
  3. Path-based focus heuristics — the file classification table:

    • *_test.go → test-quality
    • **/cmd/** → cli-ux
    • **/api/** → security
    • etc.
    • Extensible via review-context-custom.md
  4. Walkthrough format — standard table format for per-file change summaries

Benefits

  • /review-council gains structured issue linking and path-based focus without reimplementing it
  • Divisor personas can reference path focus from the pack instead of relying solely on persona specialization
  • New review workflows (e.g., a future /review-spec command) get context discovery for free
  • Context discovery logic changes in one place instead of two
  • Custom packs (review-context-custom.md) let projects add project-specific path heuristics

Acceptance Criteria

  • Pack file created at .opencode/uf/packs/review-context.md
  • Scaffold asset created at internal/scaffold/assets/opencode/uf/packs/review-context.md
  • /review-pr updated to reference the pack instead of inline logic
  • /review-council updated to reference the pack for context discovery
  • Pack is extensible via review-context-custom.md
  • Scaffold tests updated for new asset count

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. moved this from Ready 🚀 to In Progress 📋 in Unbound Force Planningon Jun 24, 2026
  2. added
    enhancement
    on Jun 24, 2026
  3. yvonnedevlinrh commented on Jun 25, 2026

    @yvonnedevlinrh
    Contributor

    Convention Pack vs. Skill -- The Evidence

    What packs are (across both orgs)

    Convention packs are declarative rule catalogs with a strict format:

    • YAML frontmatter (pack_id, language, version)
    • Numbered rules with RFC 2119 severity (CS-001 [MUST] ...)
    • Standard sections (Coding Style, Architectural Patterns, Security Checks, etc.)
    • Loaded statically via @ references in AGENTS.md/CLAUDE.md
    • Purpose: tell reviewers what to check against
    • All 11 existing packs across both orgs follow this pattern -- zero exceptions
      The complytime org reinforces this: 4 repos use the exact same pack structure, with custom packs (CR-NNN) overriding canonical rules. The pattern is consistent and well-understood.

    What skills are

    Skills are procedural knowledge packages with flexible format:

    • YAML frontmatter (name, description)
    • Prose instructions, numbered steps, protocols, reference material
    • Loaded on-demand via commands or skills_use()
    • Purpose: teach an agent how to do something
    • 5 of 14 existing skills are step-by-step procedural workflows
    • The pre-flight skill was specifically extracted from duplicated command logic -- the same pattern this issue proposes

    The review-context content is procedural

    What issue #176 describes is:

    1. Spec artifact discovery protocol -- branch name mapping, PR description parsing, changed-file detection (step-by-step procedure)
    2. Issue linking protocol -- regex patterns, validation rules, acceptance criteria extraction (procedure with conditions)
    3. Path-based focus heuristics -- file classification table (this part is actually declarative/reference)
    4. Walkthrough format -- standard table template (reference)
      Items 1-2 are clearly procedural. Items 3-4 are reference/declarative. This is a mixed-content package -- but the dominant and most valuable content is procedural.

    The precedent: pre-flight

    The pre-flight skill was extracted from duplicated logic across multiple commands to serve as a shared procedural protocol. Issue #176 proposes the exact same pattern -- extracting duplicated context discovery logic from /review-pr and /review-council into a shared artifact. The precedent points firmly to skill.

    The forward reference

    /address-feedback line 143 says: "If review-context convention pack exists, use it..." -- but this was written before the triage raised the artifact-type question. The forward reference uses the term "convention pack" from the issue title, not from a design decision. Commands already reference skills (e.g., /unleash loads pre-flight), so the consumption pattern works either way.

    Recommendation: Skill, not pack

    The content is procedural. The loading pattern is on-demand (loaded when a review command needs context discovery). The closest precedent (pre-flight) is a skill. Convention packs have a strict declarative format (numbered rules, severity indicators) that doesn't fit protocol definitions.
    The path-based focus heuristics table (item 3) could arguably be a pack rule set, but splitting one small reference table into a separate pack while the rest lives in a skill creates unnecessary fragmentation. Better to keep it unified in the skill.
    Artifact: .opencode/skills/review-context/SKILL.md (+ scaffold asset at internal/scaffold/assets/opencode/skills/review-context/SKILL.md)

    This analysis was performed by the Divisor review panel.

  4. yvonnedevlinrh commented on Jun 25, 2026

    @yvonnedevlinrh
    Contributor
    1. The design decision was made to use a skill instead of a pack - Evidence
    2. The work has been split into three sub-issues
    1. The original acceptance criteria on Create review-context convention pack for shared review discovery logic #176 are superseded by the sub-issue acceptance criteria
  5. yvonnedevlinrh commented on Jun 30, 2026

    @yvonnedevlinrh
    Contributor

    All 3 sub issues have been merged and closed. Closing out this ticket also

  6. moved this from In Progress 📋 to Done ✔️ in Unbound Force Planningon Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions