GitHub review, comment handling, and CI triage workflows with approval-gated write actions.

version
0.6.3
GitHub stars
9

Install

/plugin install github-ops@agent-powerups

Run it inside Claude Code after adding the marketplace with /plugin marketplace add yeaight7/agent-powerups.

Contents

Discovered from source

Skills 3

GitHub PR Comment Handler

Use this skill when the user wants to work through requested changes on a GitHub pull request. Use the GitHub MCP or gh CLI for PR metadata and patch context. Treat thread-aware review data as a gh api graphql problem — the flat comment surface does not preserve full review-thread state.

Run all gh commands with elevated network access. If CLI auth is required, confirm gh auth status first and ask the user to authenticate with gh auth login if it fails.

Workflow

  1. Resolve the PR.

    • If the user provides a repository and PR number or URL, use that directly.
    • If the request is about the current branch PR, use local git context: gh pr view --json number,url.
  2. Inspect review context with thread-aware reads.

    • Use gh api graphql whenever the task depends on unresolved review threads, inline review locations, or resolution state — it fetches reviewThreads, isResolved, isOutdated, and file/line anchors.
    • Use flat comment reads only for lightweight top-level PR comment summaries.
  3. Cluster actionable review threads.

    • Group comments by file or behavior area.
    • Separate actionable change requests from informational comments, approvals, already-resolved threads, and duplicates.
  4. Confirm scope before editing.

    • Present numbered actionable threads with a one-line summary of the required change.
    • If the user did not ask to fix everything, ask which threads to address.
    • If the user asks to fix everything, interpret that as all unresolved actionable threads and call out anything ambiguous.
  5. Implement the selected fixes locally.

    • Keep each code change traceable back to the thread or feedback cluster it addresses.
    • If a comment calls for explanation rather than code, draft the response rather than forcing a code change.
  6. Summarize the result.

    • List which threads were addressed, which were intentionally left open, and what tests or checks support the change.

Write Safety

  • Do not reply on GitHub, resolve review threads, or submit a review unless the user explicitly asks for that write action.
  • If review comments conflict with each other or would cause a behavioral regression, surface the tradeoff before making changes.
  • If a comment is ambiguous, ask for clarification or draft a proposed response instead of guessing.
  • Do not treat flat PR comments as a complete representation of review-thread state.
  • If gh hits auth or rate-limit issues mid-run, ask the user to re-authenticate and retry.

Fallback

If neither the connector nor gh can resolve the PR cleanly, tell the user whether the blocker is missing repository scope, missing PR context, or CLI authentication, then ask for the missing repo/PR identifier or a refreshed gh login.

Quick Reference

# Check auth
gh auth status

# View PR
gh pr view <number> --json number,url,title,state

# List review threads (GraphQL)
gh api graphql -f query='
  query($owner:String!, $repo:String!, $pr:Int!) {
    repository(owner:$owner, name:$repo) {
      pullRequest(number:$pr) {
        reviewThreads(first:50) {
          nodes {
            id
            isResolved
            isOutdated
            comments(first:5) {
              nodes { body path line }
            }
          }
        }
      }
    }
  }
' -f owner=OWNER -f repo=REPO -F pr=NUMBER

Verification

  • Review state came from thread-aware GraphQL reads, not flat comments alone
  • Actionable threads were clustered, numbered, and scope-confirmed before any edit
  • Every change is traceable to the thread or feedback cluster it addresses
  • No GitHub replies, thread resolutions, or review submissions happened without an explicit user request
  • The summary lists addressed threads, intentionally open threads, and the tests or checks supporting the changes

Purpose

Produce a clean, GitHub-native readout of failing PR checks before any code is edited. Triage first: summarize the breakage and propose a local fix plan; implement only after approval when the task is framed as triage-first.

When to Use

  • A PR is red and the cause is unknown
  • The user asks why CI is failing before asking for a fix
  • A triage-first readout must precede any code edits

Inputs

  • The PR number or URL (or the current branch to resolve it from)
  • gh CLI authenticated for the repository, or a GitHub connector

Core Rules

  • Resolve the PR first
  • Inspect failing checks before guessing
  • Prefer GitHub-native data (gh or a GitHub connector) over screenshots or copied snippets
  • Summarize the failure before proposing code changes
  • Implement only after approval when the task is framed as triage-first
  • Do not auto-commit, auto-push, or auto-rerun remote writes without approval

Workflow

  1. Resolve the PR:

    gh pr view <number-or-url> --json number,title,headRefName,url
    gh pr view --json number,title,headRefName,url    # from the current branch
    
  2. Inspect failing checks. List checks, isolate failing GitHub Actions jobs, and pull only the failing logs:

    gh pr checks <number>
    gh run list --branch <head-branch> --limit 10
    gh run view <run-id> --json jobs        # job-level status
    gh run view <run-id> --log-failed       # logs from failing steps only
    

    If a check is external (not GitHub Actions), report its URL and keep it out of local log parsing.

  3. Summarize the failure:

    • failing job
    • likely root cause
    • relevant log snippet
    • affected files or subsystem
  4. Propose the fix plan:

    • what to change locally
    • what to validate locally first
    • what remains remote-only
  5. Implement only when the user wants the fix. Keep changes traceable to the failing signal; rerun the narrowest meaningful local validation first.

Bundled Helper

  • scripts/inspect_pr_checks.py — use it when you want a structured check summary instead of raw gh output.

Output

  • Failing job(s) with a root-cause hypothesis and the minimal relevant log snippet
  • Affected files or subsystem
  • A local fix plan with validation steps, separated from remote-only actions

Verification

  • PR resolved explicitly (number/URL or current branch)
  • Failure evidence pulled from GitHub-native data, not screenshots or pasted snippets
  • Log excerpt limited to the failing step, not the whole run log
  • Summary written before any code change was proposed
  • No remote writes (commit/push/rerun) performed without approval

Failure Modes

  • Guess-first triage — proposing fixes before reading the failing job's log.
  • Log dumping — pasting entire run logs instead of --log-failed output for the failing step.
  • Unapproved remote writes — rerunning workflows or pushing while the task was triage-first.
  • Parsing external checks locally — non-Actions checks only expose a URL; report it instead.

Purpose

Combine PR review and CI failure triage into one human-controlled loop. Review findings and CI logs are inputs; they are not permission for autonomous remote actions.

When to Use

  • A PR needs both technical review and CI failure triage.
  • The user wants a single inspect -> summarize -> patch -> recheck cycle.
  • Local fixes depend on accurate PR diff and CI log context.

Do not use when the user only asked for a review, only asked for CI diagnosis, or has not approved edits.

Core Rules

  • Remote writes such as push, comment, and request re-review are always opt-in.
  • Local changes must be grounded in specific review findings or failing CI checks.
  • Prefer GitHub-first flows; treat other CI providers as adaptations.
  • Do not apply speculative fixes.

Inputs

  • PR number, branch, or URL
  • Repository remote and base branch
  • CI provider access, preferably gh for GitHub-hosted PRs
  • User approval boundary for local edits and remote writes

Workflow

1. Read PR metadata and diff

gh pr view <pr> --json number,title,author,baseRefName,headRefName,mergeStateStatus,reviewDecision,statusCheckRollup
gh pr diff <pr> --stat
gh pr diff <pr>

Record file count, risky areas, generated files, and public API changes.

2. Identify review risks

Classify findings by severity:

CategoryWhat to check
CorrectnessLogic errors, off-by-one, wrong assumptions
TestsMissing coverage for changed behavior, broken assertions
Public APIBreaking changes to exports, signatures, or contracts
SecurityInjection risks, exposed secrets, auth bypass
Migration / release riskSchema changes, feature flags, rollback difficulty

3. Inspect CI failures

gh pr checks <pr>
gh run view <run-id> --log-failed

Extract the first failing assertion or error line. Categorize each failure as code error, flaky, environment, or config.

4. Produce one readout

REVIEW FINDINGS:
  [blocking] <description> - <file:line or section>
  [non-blocking] <description>

CI FAILURES:
  <check name>: <first error line>
  Likely cause: <code error / flaky / env / config>

LIKELY FIXES:
  1. <specific change>
  2. <specific change>

VALIDATION PLAN:
  - Run: <command>
  - Expected: <outcome>

5. Apply approved local fixes

  • Apply only what the user approves from the readout.
  • Run local validation after each fix.
  • Keep commits and pushes separate from local edits unless approved.

6. Remote follow-up

State the exact operation before running it:

NEXT REMOTE ACTION: git push origin <branch>
EFFECT: updates the remote branch, triggering CI re-run
Approve?

Output

  • Combined PR review and CI readout
  • Approved local diff, if any
  • Validation commands and results
  • Proposed remote action, if requested

Verification

  • PR metadata and full diff were read.
  • Every changed file was considered or explicitly excluded with reason.
  • Review findings have severity and location.
  • CI failures have a cause category and first useful error line.
  • Any local fix was validated before proposing remote follow-up.
  • Remote follow-up was explicitly approved before execution.

Failure Modes

  • Ambiguous review feedback that needs the PR author.
  • No access to the PR or CI logs.
  • CI failure requires infrastructure changes outside this codebase.
  • Fix would require unattended remote writes.

Sponsors

Details

Marketplace
yeaight7/agent-powerups
Source
plugins/github-ops
Category
Developer Tools
License
Apache-2.0
Keywords
github, pull-requests, ci, reviews, triage

More from yeaight7/agent-powerups

All 21