agentleFS
cisco-opencisco-open/ai-harness-toolkit/skills/pr-follow-up/SKILL.md

pr-follow-up

Skill13 starsChanged 7 months agoApache-2.0View on GitHub

Monitor a GitHub pull request after creation, wait for new review comments, resolve code review comments after fixes, and report CI success or failure. Use when the user wants the backend of the review flow handled after a PR is opened.

The file

Show its rules and text

We split this skill into the rules it gives an agent

26 rules. About 0 are common, 24 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈24

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill after a PR already exists.

    line 9
  2. Distinctive:

    If the PR is ambiguous, determine it with:

    line 28
  3. Distinctive:

    When comments appear, fetch the review threads and comment bodies.

    line 40
  4. Distinctive:

    After fixes are validated, ask the user whether to resolve the addressed review threads.

    line 42
  5. Very specific:

    Use the gh-pr-comment-resolution workflow to resolve review threads after approval.

    line 43
  6. Distinctive:

    use unsupported interactive watch commands

    line 49
  7. Distinctive:

    Prefer the PR for the current branch:

    line 56
  8. Distinctive:

    If that fails, ask the user which PR to monitor.

    line 62
  9. Very specific:

    Use a short repeated loop with one-time status calls, not --watch flags.

    line 80
  10. Distinctive:

    When new unresolved review threads appear, treat that as a trigger to enter this flow rather than a stop condition:

    line 97
  11. Distinctive:

    Ask the user whether to apply fixes.

    line 101
  12. Distinctive:

    If the user confirms, implement them.

    line 102
  13. Distinctive:

    Ask the user whether to resolve the addressed review threads.

    line 104
  14. Distinctive:

    If the user confirms, resolve them.

    line 105
  15. Distinctive:

    If you need owner and repo for GraphQL calls, derive them once with:

    line 107
  16. Distinctive:

    Use this GraphQL pattern:

    line 113
  17. Distinctive:

    if checks are still pending, keep polling and report that the PR is still running

    line 131
  18. Distinctive:

    if any check fails, report which check failed and stop

    line 132
  19. Distinctive:

    if all required checks pass, report success and stop

    line 133
  20. Distinctive:

    If the user separately asks to investigate a failure, then pivot into a deeper CI workflow.

    line 135
  21. Distinctive:

    Stop and report when any of these is true:

    line 139
  22. Distinctive:

    Default timeout: 30 minutes unless the user asks for longer.

    line 149
  23. Distinctive:

    Keep updates short and event-driven.

    line 150
  24. Distinctive:

    Only surface deltas since the last poll.

    line 151
  25. Distinctive:

    When new comments arrive:

    line 161
  26. Distinctive:

    If you later automate this further, keep the separation clean:

    line 193

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PR Follow-up

Use this skill after a PR already exists. It is intentionally narrower than full CI self-healing: it watches for review comments, helps resolve them, and reports CI outcome. It does not require extra MCP servers.

When To Use

  • The user says things like:
    • "watch the PR"
    • "handle PR comments as they come in"
    • "monitor this PR and tell me if CI fails"
    • "wait for comments, fix them, then keep watching"
  • A PR has already been created, or can be discovered from the current branch.

Inputs

Accept any of:

  • PR number
  • PR URL
  • current branch with an existing PR

If the PR is ambiguous, determine it with:

gh pr view --json number,url,title,headRefName,baseRefName

Scope

This skill should:

  1. Identify the PR for the current branch.
  2. Poll for new PR review comments.
  3. When comments appear, fetch the review threads and comment bodies.
  4. Present the new comments and ask the user whether to apply fixes.
  5. After fixes are validated, ask the user whether to resolve the addressed review threads.
  6. Use the gh-pr-comment-resolution workflow to resolve review threads after approval.
  7. Poll PR checks and notify on success or failure.

This skill should not:

  • invent a full CI self-healing flow from scratch
  • use unsupported interactive watch commands
  • force-push or skip hooks without user approval

Default Workflow

1. Identify the PR

Prefer the PR for the current branch:

gh pr view --json number,url,title,headRefName,baseRefName,statusCheckRollup

If that fails, ask the user which PR to monitor.

2. Establish a baseline snapshot

Capture these once at the start:

gh pr view <PR_NUMBER> --json reviewThreads,statusCheckRollup,url,title
gh pr checks <PR_NUMBER>

Track:

  • unresolved review thread ids
  • current failing checks

3. Poll for updates

Use a short repeated loop with one-time status calls, not --watch flags.

Recommended calls:

gh pr view <PR_NUMBER> --json reviewThreads,statusCheckRollup,url,title
gh pr checks <PR_NUMBER>

On each poll:

  • detect newly added unresolved review threads
  • detect newly failed checks
  • detect transition to all-green checks

4. Handle review comments

When new unresolved review threads appear, treat that as a trigger to enter this flow rather than a stop condition:

  1. Fetch full thread details with GraphQL, following the gh-pr-comment-resolution skill.
  2. Summarize the new comments to the user.
  3. Ask the user whether to apply fixes.
  4. If the user confirms, implement them.
  5. Re-run the smallest relevant validation.
  6. Ask the user whether to resolve the addressed review threads.
  7. If the user confirms, resolve them.

If you need owner and repo for GraphQL calls, derive them once with:

gh repo view --json owner,name

Use this GraphQL pattern:

gh api graphql -f query='query($owner:String!,$repo:String!,$number:Int!){repository(owner:$owner,name:$repo){pullRequest(number:$number){reviewThreads(first:50){nodes{id,isResolved,comments(first:20){nodes{id,body,author{login},path,position}}}}}}}' -f owner='<OWNER>' -f repo='<REPO>' -F number=<PR_NUMBER>

Resolve threads with:

gh api graphql -f query='mutation($threadId:ID!){resolveReviewThread(input:{threadId:$threadId}){thread{id,isResolved}}}' -F threadId='<THREAD_ID>'

5. Handle CI status

For CI, use read-only polling via gh pr checks <PR_NUMBER>.

Default behavior:

  • if checks are still pending, keep polling and report that the PR is still running
  • if any check fails, report which check failed and stop
  • if all required checks pass, report success and stop

If the user separately asks to investigate a failure, then pivot into a deeper CI workflow.

6. Stop conditions

Stop and report when any of these is true:

  • new review comments were found and surfaced to the user in watch-only mode
  • all checks passed
  • any check failed
  • polling timeout reached

Good Defaults

  • Poll every 60 to 120 seconds.
  • Default timeout: 30 minutes unless the user asks for longer.
  • Keep updates short and event-driven.
  • Only surface deltas since the last poll.

Reporting Format

When monitoring starts:

Watching PR #<number>: <title>

When new comments arrive:

New PR review comments detected on:
- <file/path>

Next step: inspect threads and ask whether to apply fixes.

When CI fails:

CI failed on PR #<number>.

Failed checks:
- <check name>

When CI succeeds:

PR #<number> checks passed.

Recommended Companion Skills

  • gh-pr-comment-resolution for thread fetch/resolve mechanics
  • create-pull-request-with-reviewers before this skill, when opening the PR
  • a separate CI investigation workflow only when the user explicitly wants deeper failure analysis or auto-fix behavior

Implementation Guidance

If you later automate this further, keep the separation clean:

  • this skill = PR comment + outcome watcher
  • gh-pr-comment-resolution = review-thread resolution workflow
  • deeper CI failure analysis = separate workflow if the repo later adds one

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.