anonymity-hub/realisticeditbench/pr-subedit-workflow
Claude Code and agent skill by anonymity-hub/realisticeditbench
- community
Checking that the SKILL.md file is still in the repository.
Automatically split a PR instance under patch_histories from whole.diff into an ordered sequence of sub-edits, such as 1.diff and 2.diff. Use this when the user asks to split patch_histories tasks, run the sub-edit workflow, or mentions run_split, quick_diff, or validation.
Install
npx vskill@latest install anonymity-hub/realisticeditbench/pr-subedit-workflowSKILL.md
PR Sub-Edit Splitting Workflow
Goal: convert patch_histories/{instance_id}/ from a PR-level whole.diff into a verifiable and predictable sub-edit sequence: 1.diff, 2.diff, and later steps. For splitting principles, see pr-subedit-principles.
There are three core constraints:
- Treat each file directory's
whole.diffas authoritative;whole-N.diffis only commit-chain reference. - Choose the shortest sequence that preserves semantic predictability; normal PRs often land around 4-5 steps, while 6+ is reserved for genuinely large refactors, long verified commit chains, or clearly separable edit phases.
- Every
N.diffmust apply after global stepN-1, and the final result must matchfinal.*.
Directory Prerequisites
run_split has already produced this structure:
Strict validation usually uses:
A. Read the Global Diff and Plan
Read patch_histories/{instance_id}/whole.diff before entering individual file directories. Determine:
- what problem the PR solves;
- how many narrative lines exist, and which files depend on each other;
- which files repeat the same pattern, and which changes are unrelated parallel edits;
- whether
whole-N.diffcommit references are present.
Write a global timeline before splitting:
Step-numbering rules:
- Unrelated narrative lines start in parallel at the same
1.diff; later steps continue independently. - When definition and use have a dependency, the definition comes first.
- Do not split repeated-pattern files in parallel. Let the demonstration file run through
1..k, then continue later files atk+1... - Generated files lag behind source files: edit lexer/parser sources first, then update
*_lextab.py,*_parsetab.py, or similar generated files.
B. Initialize File Splitting
For each changed file, start from authoritative whole.diff by default:
If whole-1.diff, whole-2.diff, and later commit references exist, run compose validation first. Reuse whole-N.diff directly only when validation passes and the commit chain is semantically coherent.
Run this inside the file directory:
If validation fails, do not copy whole-N.diff. You may use commit order to understand the narrative, but actual hunks must be split from whole.diff or rebased onto the correct intermediate state.
C. Use quick_diff to Split One File Iteratively
quick_diff works as follows: manually shrink the current complete diff into {N-1}.t.diff; the tool saves that as {N-1}.diff and writes the remaining changes into {N}.diff.
Command:
To generate step 2:
- Confirm
{file}/1.diffis the current complete segment. - Keep only the hunks that belong in step 1 and save them as
1.t.diff. - Ensure only this file directory in the instance contains
1.t.diff. - Run
quick_diff --step_index 2. - Check that
1.diff + 2.diffstill covers the originalwhole.diff.
To generate step 3, repeat the same process on 2.diff, save 2.t.diff, and run --step_index 3.
While splitting, prioritize these checks:
- Step 1 must be a semantic code edit, not import-only, docs-only, comments-only, or formatting-only.
- New
def, class, or method edits should not be filled all at once; start with the signature or first real body fragment, then fill the body. - Place imports after first use when possible; merge them into the first-use step only when necessary.
- Docs and comments should not stand alone, especially not as the first or final step.
- If a step adds more than about 15 net lines or contains two natural phases, split it further.
- Intermediate states may be syntactically incomplete; do not add
passor...that is absent from the final file.
quick_diff scans all {N-1}.t.diff files under the instance. Keep a .t.diff in only one file directory at a time to avoid accidentally processing other files.
D. Align Global Step Numbers
After each file is split, local numbers may need to be renamed into global step numbers.
Common patterns:
When renaming, move from larger numbers to smaller numbers to avoid overwrites. Keep whole.diff, whole-N.diff, original.*, and final.*. Remove temporary files such as *.t.diff, _old.*, and _new.*.
E. Run Strict Validation
Preferred command:
This applies diffs by global step number in the testbed using git apply, then compares final files against final.*.
A coarse per-file check is available:
However, --per-file does not replace strict validation because it cannot catch cross-file global-step conflicts.
Passing criteria:
- Every changed file has correctly numbered numeric diffs matching the global timeline.
- Strict validation reports no
patch failed,corrupt patch, orversion error. - Applying the full chain produces files identical to all
final.*files. - No
.t.diffor temporary diff-generation files remain.
Common Failures
| Symptom | Fix | |
|---|---|---|
whole-N does not apply on original.* | Expected in some cases; split from authoritative whole.diff | |
whole-1...whole-N does not equal whole.diff | Do not copy whole-N.diff; re-split from whole.diff | |
| Per-file validation passes but strict validation fails | Some N.diff was not generated from the global N-1 state; regenerate from the intermediate state | |
corrupt patch | Check hunk headers, context, and final newline | |
Final result differs from final.* | A hunk is missing, duplicated, or overwritten by step numbering |
Deliverable Checklist
Finally, perform a manual predictability check: given 1..N-1, is step N a natural next edit? If not, adjust the narrative order or split the step further.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/pr-subedit-workflow/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/anonymity-hub/realisticeditbench/pr-subedit-workflow)