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
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- autorag-querySkill
- create-generation-pluginSkill
- create-ingestor-pluginSkill
- create-metric-pluginSkill
- create-retrieval-pluginSkill
- refactorSkill
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
- Distinctive: line 28
If the command fails, exit immediately:
- Distinctive: line 40
Run these commands in parallel:
- Distinctive: line 53
Run a single GraphQL query to fetch all review threads with their comments:
- Distinctive: line 84
If the query fails, exit immediately:
- Very specific: line 96
Precedence rule: If a thread has both [APPROVE] and [IGNORE] in different replies, [APPROVE] takes precedence.
- Distinctive: line 100
If no actionable threads are found, exit immediately:
- Distinctive: line 118
If the target file no longer exists:
- Very specific: line 125
Read the target file using the Read tool
- Very specific: line 127
Run make check to validate
- Distinctive: line 163
If any fixes were successfully applied (not reverted) in Step 5:
- Distinctive: line 174
If no fixes were applied (all were IGNORE or all APPROVE fixes failed validation):
- Distinctive: line 198
If any fixes failed validation, list them:
- Distinctive: line 204
If any files no longer exist, list them:
≈ “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.
Files
/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,baseRefNameIf 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 numberPR_URL-- the PR URLPR_TITLE-- the PR titleHEAD_REF-- head branch nameBASE_REF-- base branch name
Step 2: Get Repository Identity
Run these commands in parallel:
git remote get-url origin
git rev-parse HEADParse the remote URL to extract OWNER/REPO (handle both HTTPS and SSH formats).
Store:
OWNER_REPO-- e.g.owner/repoHEAD_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:
- Thread is unresolved (
isResolved == false) - 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 threadline/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
- Read the target file using the
Readtool - Apply the suggested fix using the
Edittool - Run
make checkto 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 pushIf git push fails:
- Inform user: "Commit created locally but push failed. Run
git pushmanually."
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
| Scenario | Action |
| No PR found | Exit with message |
| GraphQL query fails | Exit with message |
| No actionable threads | Exit with message |
make check fails after fix | Revert file, still resolve thread, note in report |
| Resolve mutation fails | Log error, continue with remaining |
git push fails | Inform user to push manually |
| File no longer exists | Skip fix, still resolve, note in report |
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
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.

