difit-resolve
Skill2 starsChanged 3 months agoMITView on GitHub
Apply the fixes proposed in a REVIEW.md (written by /difit-review), merge any new user replies from a running difit instance, write Claude's replies back into REVIEW.md, and best-effort echo them to difit if it's running. REVIEW.md is the source of truth; difit is an optional UI we sync to when available.
In this repository8 other files it gives its agents.
- comment-cleanupSkill
- commitSkill
- difit-openSkill
- difit-reviewSkill
- refactor-proseSkill
- refine-skillsSkill
- squashSkill
- ste-writingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 7 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
If REVIEW_MD is missing, error out with Run /difit-review <name> first.
- Very specific: line 48
Ask via AskUserQuestion — don't guess.
- Very specific: line 72
If author == "User" AND no message in REVIEW.md for this thread has a matching (author=User, body, createdAt) — it's new.
- Very specific: line 75
If a difit thread exists for a (filePath, position) that REVIEW.md doesn't have — surface as a warning (User added a comment difit didn't …
- Distinctive: line 84
Read the referenced file at the cited line range.
- Very specific: line 90
If the OP severity was must-fix and you skipped, surface it in the final report — don't bury it.
- Distinctive: line 92
Keep edits tight. Do not refactor surrounding code or "improve" things the comment didn't ask for.
- Very specific: line 98
Run any obvious type checker / linter (ruff check, tsc --noEmit, cargo check, etc.).
- Distinctive: line 99
Run tests adjacent to what you touched.
- Very specific: line 102
If verification surfaces a problem caused by your edit, downgrade that thread's reply status to applied-with-issue and quote the error in …
- Distinctive: line 123
Write the entire augmented REVIEW.md (frontmatter unchanged, threads with new replies).
- Very specific: line 127
Use the packaged helper sync_replies.py (sits next to this SKILL.md):
- Distinctive: line 141
Verify after the helper succeeds:
- Distinctive: line 147
Should equal the count you intended.
- Distinctive: line 156
If the difit sync was attempted and short / failed: surface the count mismatch + the warnings.
≈ “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
Difit Resolve Skill
Read REVIEW.md, pull any new user replies from a running difit (if there is one), apply the fixes, append Claude replies into REVIEW.md, push the augmented state back to difit (if still reachable). REVIEW.md is authoritative — every reply lands in the file. Difit is best-effort: if it's running we sync, if it's not we don't; if it's running but rejects messages we fail loud.
Arguments
name(optional, positional): which review to resolve. Defaultdefault.--port <port>(optional): difit instance to sync to. If omitted, auto-discover a single running instance.--no-difit(optional): skip the difit sync entirely. Useful when you only want to fix fromREVIEW.mdwithout touching the browser session.--commented-only(optional): act only on threads where the user left a reply. Give every other thread statusskippedwith a one-line reason.
Paths
PROJECT_DIR="$HOME/.claude/projects/$(pwd | sed 's:/:-:g')"
REVIEW_MD="$PROJECT_DIR/reviews/<name>/REVIEW.md"If REVIEW_MD is missing, error out with Run /difit-review <name> first.
Verified facts about difit (v5.0.1)
difit comment get --format json --port <port>reads current state.--portis required (not auto-discovered).difit comment add --type replyis a silent no-op. Always use the frontend POST for replies.POST http://localhost:<port>/api/comments(NO query params) with{threads: [...]}is how replies persist. Returns{"success":true}on a 200.- Critical: do not add
?base=<sha>&target=<sha>to the POST URL. difit keys sessions by full SHAs internally, and short SHAs in query params spawn a fresh empty session your write silently lands in — the server still returns{"success":true}and the GET (which uses the active session) shows nothing changed. Omit the query params; the server uses its current selection. - difit's session storage is in-memory and lives per
(base, target)selection. A fresh--backgroundinstance for the same ref reuses its session as long as the process is up.
Step 1 — Read REVIEW.md
Parse the frontmatter and threads same as /difit-open does. Stash port (from frontmatter), base, target, and the parsed thread list (including any prior replies).
A thread is resolved when its last message is a Claude reply with status applied or skipped. Skip resolved threads in Step 3.
difit stores no resolved flag, so the only signal of user intent is a reply. If the user replied to some threads and left others untouched, say so and ask before you act on the untouched ones.
Step 2 — Pull difit state (unless --no-difit)
Port resolution order:
--port <port>argument.port:field from the REVIEW.md frontmatter (written by/difit-open).- Ask via
AskUserQuestion— don't guess.
Verify:
DIFIT_STATE=$(difit comment get --port <port> --format json 2>&1)Outcomes:
| Result | Action |
| Valid JSON with threads | Proceed to merge new user replies. |
| Connection refused / port unreachable | If the port came from the frontmatter, treat as "difit not running" (the user killed it); continue without sync. If the user gave the port explicitly, fail loud. |
| Any other error | Fail loud — print the stderr verbatim and stop. |
Track which case we're in as DIFIT_AVAILABLE (yes / no).
2a. Merge new user replies into REVIEW.md (only when DIFIT_AVAILABLE)
Index difit threads by (filePath, position). For each thread in REVIEW.md:
- Find the matching difit thread by the same key.
- For every message in the difit thread:
- If
author == "User"AND no message in REVIEW.md for this thread has a matching(author=User, body, createdAt)— it's new. - Append it to REVIEW.md as a
> **User · <createdAt>**block.
- If
If a difit thread exists for a (filePath, position) that REVIEW.md doesn't have — surface as a warning (User added a comment difit didn't seed). Don't drop it; record it as a thread under a ## New (from difit) section in REVIEW.md so the user knows it landed.
Re-read your own REVIEW.md after writing so the rest of the skill sees the merged state.
Step 3 — Apply each unresolved fix
For each unresolved thread, in file-then-line order:
- The authoritative instruction is the last User reply (if any), otherwise the OP body. Quote it in your reply if it differs from the OP (e.g. OP said "add a TimeoutError handler" but User said "actually just propagate"; you follow User).
- Read the referenced file at the cited line range.
- Decide:
- Actionable → apply with Edit. Status:
applied. - Partial (multi-ask comment where part is in scope and part needs design) → apply what you can. Status:
partial. Spell out in the reply which parts landed and which you deferred. - Skip (vague / conflicts with another fix / asks for something you can't do safely) → don't edit. Status:
skipped. Quote the reason. - Question (genuinely ambiguous, needs human direction) → don't edit. Status:
question.
- Actionable → apply with Edit. Status:
- If the OP severity was
must-fixand youskipped, surface it in the final report — don't bury it.
Keep edits tight. Do not refactor surrounding code or "improve" things the comment didn't ask for.
Step 4 — Verify edits
After all fixes:
- Run any obvious type checker / linter (
ruff check,tsc --noEmit,cargo check, etc.). Skip if no obvious command. - Run tests adjacent to what you touched.
- Re-read each touched file once.
If verification surfaces a problem caused by your edit, downgrade that thread's reply status to applied-with-issue and quote the error in the body. Don't hide it.
Step 5 — Append Claude replies to REVIEW.md
For every thread you handled (applied / partial / skipped / question), append a reply block:
> **Claude · 2026-05-27T15:42Z · applied**
> Replaced fallback with direct access at L34-L35; also dropped now-unused
> `import os` at L7.Status values:
applied: fix landed clean.partial: some of the asks landed; quote which.skipped: nothing changed; quote the reason.question: needs human input; quote what.applied-with-issue: edit landed but Step 4 found a regression.
Reply body is one short paragraph. Reference file:line if helpful. Quote the user's reasoning when honoring a User directive that overrode the OP.
Write the entire augmented REVIEW.md (frontmatter unchanged, threads with new replies). This is the only durable record — get it right.
Step 6 — Sync back to difit (when DIFIT_AVAILABLE)
Use the packaged helper sync_replies.py (sits next to this SKILL.md):
SKILL_DIR="$HOME/.claude/skills/difit-resolve"
python3 "$SKILL_DIR/sync_replies.py" --port "$PORT" --replies /tmp/claude/replies.jsonThe replies JSON is a list of {filePath, position, body} objects, one per Claude reply you wrote in Step 5. position matches the format in REVIEW.md ({"line": 42} or {"line": {"start": 12, "end": 18}}). body is the markdown reply text — the **applied** ... / **skipped** ... / etc. tag goes at the start so the next /difit-resolve run can parse it back.
Exit codes:
0— all replies appended (or already present and skipped as duplicates).1— difit unreachable, or POST rejected. Fail loud — surface stderr.2— one or more replies didn't match a thread on the server (server-side thread missing). Print which and continue, but flag in Step 7.
Verify after the helper succeeds:
LIVE_CLAUDE_REPLIES=$(difit comment get --port "$PORT" --format text | grep -c '^Reply [0-9]* (Claude)')Should equal the count you intended. If short, fail loud and report the discrepancy in Step 7.
Step 7 — Report
Tell the user:
- How many threads were processed: counts for
applied,partial,skipped,question,applied-with-issue. - For each
must-fixyou skipped: file:line and one-line reason. - For each
question: file:line and the question — they need to reply and re-run. - The state of the difit sync: synced N, or "difit not running so REVIEW.md is the only record".
- If the difit sync was attempted and short / failed: surface the count mismatch + the warnings.
- The path to
REVIEW.mdis always sufficient as the audit trail.
Example (difit running):
Resolved 11/17 threads (4 applied, 2 partial, 5 skipped, 1 question). All Claude replies written to
~/.claude/projects/.../reviews/default/REVIEW.md. Synced to difit (11/11 replies live).Skipped (must-fix):
src/api.ts:88— comment asked to "rework error handling"; needs your shape decisionQuestion:
src/auth.ts:23— "is this intentional or leftover from the old flow?"
Example (difit not running):
Resolved 11/17 threads (4 applied, 2 partial, 5 skipped, 1 question). All replies in REVIEW.md. difit not running; reopen with
/difit-open defaultto see the audit trail in browser.
What this skill does not do
- Doesn't start difit (use
/difit-open). - Doesn't trust difit replies that aren't already in REVIEW.md without writing them through (Step 2a copies them into the file before acting on them).
- Doesn't silently drop a difit failure when difit is reachable. If
comment getworks but the POST doesn't, that's a loud error.
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.

