agentleFS
NomaDamasNomaDamas/AutoRAG-Research/.claude/skills/resolve-conversation/SKILL.md

resolve-conversation

Skill149 starsChanged 8 months agoApache-2.0View on GitHub

Process [APPROVE] and [IGNORE] replies on /refactor review threads. Applies approved fixes to the codebase, resolves all responded threads on GitHub, commits and pushes changes. Sequential single-agent workflow. All output is in English.

  • Commits and pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 10 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the command fails, exit immediately:

    line 28
  2. Distinctive:

    Run these commands in parallel:

    line 40
  3. Distinctive:

    Run a single GraphQL query to fetch all review threads with their comments:

    line 53
  4. Distinctive:

    If the query fails, exit immediately:

    line 84
  5. Very specific:

    Precedence rule: If a thread has both [APPROVE] and [IGNORE] in different replies, [APPROVE] takes precedence.

    line 96
  6. Distinctive:

    If no actionable threads are found, exit immediately:

    line 100
  7. Distinctive:

    If the target file no longer exists:

    line 118
  8. Very specific:

    Read the target file using the Read tool

    line 125
  9. Very specific:

    Run make check to validate

    line 127
  10. Distinctive:

    If any fixes were successfully applied (not reverted) in Step 5:

    line 163
  11. Distinctive:

    If no fixes were applied (all were IGNORE or all APPROVE fixes failed validation):

    line 174
  12. Distinctive:

    If any fixes failed validation, list them:

    line 198
  13. Distinctive:

    If any files no longer exist, list them:

    line 204

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

/resolve-conversation -- Process /refactor Review Thread Replies

You process human replies on /refactor inline PR comments. Follow these 8 steps exactly.

Step 1: Verify PR Exists

Run:

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

If the command fails, exit immediately:

No PR found on the current branch. Create a PR first.

Extract and remember these values:

  • PR_NUMBER -- the PR number
  • PR_URL -- the PR URL
  • PR_TITLE -- the PR title
  • HEAD_REF -- head branch name
  • BASE_REF -- base branch name

Step 2: Get Repository Identity

Run these commands in parallel:

git remote get-url origin
git rev-parse HEAD

Parse the remote URL to extract OWNER/REPO (handle both HTTPS and SSH formats). Store:

  • OWNER_REPO -- e.g. owner/repo
  • HEAD_SHA -- current HEAD commit SHA

Step 3: Fetch All Review Threads via GraphQL

Run a single GraphQL query to fetch all review threads with their comments:

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

Replace {OWNER}, {REPO}, and {PR_NUMBER} with the values from Steps 1-2.

If the query fails, exit immediately:

GraphQL query failed. Check your GitHub authentication and permissions.

Step 4: Identify Actionable Threads

From the GraphQL response, filter threads that meet ALL of these criteria:

  1. Thread is unresolved (isResolved == false)
  2. A reply exists with a human action -- any comment after the first contains:
    • [APPROVE] -- human approves the suggested fix
    • [IGNORE] -- human wants to ignore this finding

Precedence rule: If a thread has both [APPROVE] and [IGNORE] in different replies, [APPROVE] takes precedence.

Classify each actionable thread as either APPROVE or IGNORE.

If no actionable threads are found, exit immediately:

No actionable threads found. Reply with [APPROVE] or [IGNORE] on /refactor review comments first.

Step 5: Process APPROVE Threads

For each thread classified as APPROVE, in order:

5a. Extract the Suggested Fix

From the first comment (the /refactor comment), extract the text after **Suggested Fix**:. This is the code change to apply.

Also extract:

  • path -- the file path from the thread
  • line / startLine -- the line number(s) from the thread

5b. Check File Exists

If the target file no longer exists:

  • Note in report: "File {path} no longer exists, skipping fix"
  • Still mark this thread for resolution in Step 6
  • Continue to next thread

5c. Apply the Fix

  1. Read the target file using the Read tool
  2. Apply the suggested fix using the Edit tool
  3. Run make check to validate

5d. Validate

If make check fails:

  • Revert the file: git checkout -- {path}
  • Note in report: "Fix for {path}:{line} failed validation, reverted"
  • Still mark this thread for resolution in Step 6

If make check passes:

  • Note in report: "Fix applied to {path}:{line}"

Step 6: Resolve All Actionable Threads

For EVERY actionable thread (both APPROVE and IGNORE), resolve it via GraphQL mutation:

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

Replace {THREAD_ID} with the thread's id from the GraphQL response.

Process all threads. If a resolve mutation fails for a specific thread:

  • Log the error
  • Continue with remaining threads
  • Note in report: "Failed to resolve thread for {path}:{line}"

Step 7: Commit and Push

If any fixes were successfully applied (not reverted) in Step 5:

git add <list of fixed files>
git commit -m "fix: apply approved review suggestions from /resolve-conversation"
git push

If git push fails:

  • Inform user: "Commit created locally but push failed. Run git push manually."

If no fixes were applied (all were IGNORE or all APPROVE fixes failed validation):

  • Skip this step entirely

Step 8: Report to User

Print a final summary to the console. No emojis. Include:

/resolve-conversation complete.

Threads processed: {total_actionable}
  APPROVE: {approve_count} ({fixes_applied} applied, {fixes_failed} failed validation)
  IGNORE: {ignore_count}
Threads resolved: {resolved_count} ({resolve_failed} failed to resolve)

{If fixes_applied > 0:}
Changes committed and pushed.

{If fixes_applied > 0 and push_failed:}
Changes committed locally. Run `git push` manually.

PR: {PR_URL}

If any fixes failed validation, list them:

Failed fixes:
  - {path}:{line}: {reason}

If any files no longer exist, list them:

Skipped (file missing):
  - {path}

Error Handling

ScenarioAction
No PR foundExit with message
GraphQL query failsExit with message
No actionable threadsExit with message
make check fails after fixRevert file, still resolve thread, note in report
Resolve mutation failsLog error, continue with remaining
git push failsInform user to push manually
File no longer existsSkip fix, still resolve, note in report

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.