Skip to content

Optimize mattpocock-skills-reviewer by offloading PR triage to an inline small-model sub-agent#34229

Merged
pelikhan merged 3 commits into
mainfrom
copilot/subagent-optimizer
May 23, 2026
Merged

Optimize mattpocock-skills-reviewer by offloading PR triage to an inline small-model sub-agent#34229
pelikhan merged 3 commits into
mainfrom
copilot/subagent-optimizer

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 23, 2026

This workflow was consuming ~1.97M tokens/run, with a deterministic triage phase embedded in the main prompt. This change extracts that phase into an inline pr-triage sub-agent so the main reviewer can start from structured triage output instead of re-deriving context from the full diff.

  • Prompt flow changes

    • Replaced Step 3’s static change-type/skill table with explicit pr-triage invocation + JSON consumption.
    • Updated Step 4 to prioritize files returned by triage (high_impact_files) when applying skills.
  • New inline sub-agent (pr-triage)

    • Added ## agent: \pr-triage`at the end of the workflow usingclaude-haiku-4.5`.
    • Defines deterministic triage responsibilities:
      • classify change_type (fixed enum),
      • select 1–2 recommended_skills,
      • rank high_impact_files,
      • emit concise key_signals.
    • Includes strict JSON output contract to keep downstream behavior predictable.
  • Contract clarity improvements

    • Step 3 now explicitly instructs the parent reviewer to invoke pr-triage and use its returned fields.
    • Triage file ranking guidance is risk-based (not hard-capped), so output can scale with PR shape.
{
  "change_type": "bug_fix",
  "recommended_skills": ["/diagnose", "/tdd"],
  "high_impact_files": [
    { "path": "pkg/example/file.go", "reason": "Touches core behavior used by multiple call sites." }
  ],
  "key_signals": [
    "Adds regression tests for previous nil-pointer crash.",
    "Modifies error handling path in request processing."
  ]
}

Copilot AI and others added 2 commits May 23, 2026 15:07
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Optimize mattpocock-skills-reviewer workflow Optimize mattpocock-skills-reviewer by offloading PR triage to an inline small-model sub-agent May 23, 2026
Copilot AI requested a review from pelikhan May 23, 2026 15:11
@pelikhan pelikhan marked this pull request as ready for review May 23, 2026 15:12
Copilot AI review requested due to automatic review settings May 23, 2026 15:12
@pelikhan pelikhan merged commit 3f1cc26 into main May 23, 2026
2 checks passed
@pelikhan pelikhan deleted the copilot/subagent-optimizer branch May 23, 2026 15:12
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

This PR refactors the “Matt Pocock skills reviewer” workflow prompt to offload deterministic PR triage (change-type classification + skill selection + file prioritization) into a dedicated inline sub-agent, so the main reviewer starts from structured triage output instead of re-deriving it from the full diff.

Changes:

  • Replaced the Step 3 static change-type/skill mapping table with instructions to invoke a new pr-triage inline agent and consume its JSON output.
  • Updated Step 4 guidance to prioritize review focus based on pr-triage.high_impact_files.
  • Regenerated the compiled .lock.yml workflow (introducing updated gh-aw compilation metadata and runtime pins).
Show a summary per file
File Description
.github/workflows/mattpocock-skills-reviewer.md Moves change-type/skill selection into a new inline pr-triage agent with a strict JSON contract; updates reviewer instructions to consume that output.
.github/workflows/mattpocock-skills-reviewer.lock.yml Regenerated compiled workflow with updated compiler metadata and updated pinned actions/images/tooling configuration.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment on lines +148 to +150
Invoke the `pr-triage` agent and capture its JSON response.
Use the returned `change_type`, `recommended_skills`, `high_impact_files`, and `key_signals`.
Apply the recommended skills in Step 4, prioritising the listed `high_impact_files`.
Comment on lines +53 to +56
# - ghcr.io/github/gh-aw-firewall/agent:0.25.49
# - ghcr.io/github/gh-aw-firewall/api-proxy:0.25.49
# - ghcr.io/github/gh-aw-firewall/squid:0.25.49
# - ghcr.io/github/gh-aw-mcpg:v0.3.9@sha256:64828b42a4482f58fab16509d7f8f495a6d97c972a98a68aff20543531ac0388
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.

[subagent-optimizer] Optimize mattpocock-skills-reviewer — 2026-05-23

3 participants