skills/22-christopherkenny-skills/skills/pseudo-merge/SKILL.md
Takes a proofread or apsa-style report file (or any markdown file using **Original:** / **Recommended:** syntax) and rewrites the original source file with git merge conflict markers so the user can accept or reject each suggested edit using VS Code or Positron's built-in merge conflict UI. Branch names are "original" and "claude-edits". Use when asked to apply edits, insert conflict markers, or set up merge resolution for a copy-edit report. Supports an optional @sec-label argument to restrict markers to one section.
npx skillsauth add brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research pseudo-mergeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You take a copy-edit report (produced by the proofread or apsa-style skills, or any markdown file using the same **Original:** / **Recommended:** syntax) and rewrite the original source file with git merge conflict markers. This lets the user accept or reject each suggested edit individually using VS Code or Positron's merge conflict UI.
The fake branch names are always:
<<<<<<< original — the current text>>>>>>> claude-edits — the suggested replacementThis skill modifies the original source file in place. Inform the user of the path before writing, and remind them that git diff or file history can recover the pre-merge state.
| Position | Required | Description |
|----------|----------|-------------|
| 1 | Yes | Path to the report file (e.g., paper/paper-copy-edits.md or paper/paper-style-edits.md) |
| 2 | No | Path to the original source file to modify. If omitted, derived automatically (see below). |
| @sec-label | No | Quarto section reference (e.g., @sec-intro). Detected by the leading @. If supplied, only conflict markers within that section are inserted. May appear in any argument position. |
Example invocations:
/pseudo-merge paper/paper-copy-edits.md
/pseudo-merge paper/paper-copy-edits.md @sec-intro
/pseudo-merge paper/paper-style-edits.md paper/paper.qmd @sec-data
/pseudo-merge reviews/my-edits.md src/manuscript.qmd
@sec-label)Scan all arguments for one that begins with @. That is the section filter. Strip the leading @ to get the Quarto label (e.g., @sec-intro → sec-intro).
In Quarto, section labels are attached to headings with {#label} syntax:
# Introduction {#sec-intro}
## Data and Methods {#sec-data}
Find the heading line in the source file whose {#…} attribute matches the label. The section spans from that heading line to (but not including) the next heading of equal or higher level. Track the line range of that span.
When matching (Original, Recommended) pairs against the source file, only accept matches whose position falls within that line range. Skip pairs that match outside the section without warning — they are intentionally out of scope.
If no heading with that label is found in the source file, stop and tell the user. List all {#sec-*} labels found in the file.
-copy-edits, -style-edits, or -edits from the report filename stem..qmd.Examples:
paper/paper-copy-edits.md → paper/paper.qmdpaper/paper-style-edits.md → paper/paper.qmddrafts/ch2-edits.md → drafts/ch2.qmdIf the derived path does not exist and no second argument was given, stop and ask the user for the source file path.
The skill reads any markdown file that contains issue blocks of this shape (produced by proofread and apsa-style):
**Original:** Full original sentence here.
**Recommended:** Full corrected sentence here.
These may appear inside a section heading block like:
### [CRITICAL · Grammar] Subject-verb disagreement
**Original:** The results shows that incumbents win more often in low-turnout elections.
**Recommended:** The results show that incumbents win more often in low-turnout elections.
**Reason:** ...
Extract every (Original, Recommended) pair in order from top to bottom.
Replace each matched original sentence in the source file with:
<<<<<<< original
The results shows that incumbents win more often in low-turnout elections.
=======
The results show that incumbents win more often in low-turnout elections.
>>>>>>> claude-edits
Rules:
<<<<<<< original and the original text.======= and the recommended text.>>>>>>> claude-edits.=======), not after >>>>>>> claude-edits.Read the report file using the Read tool. Extract all (Original, Recommended) pairs in document order.
Resolve the source file path — use arg 2 if given, otherwise derive it from the report filename. Confirm the file exists.
Inform the user — before making any changes, tell them:
<path>git diff or file history can restore the originalRead the source file using the Read tool.
Match and replace — for each (Original, Recommended) pair, working top to bottom:
a. Exact match — search for the original sentence verbatim in the source text. If found, replace with the conflict block.
b. Fuzzy match — if exact match fails (likely due to line wrapping or minor whitespace differences), extract the longest distinctive substring (usually 8+ consecutive words) from the original sentence and search for it. Once located, expand the match to the full surrounding sentence before replacing.
c. Skip and warn — if neither match works, record the pair as unmatched. Do not insert a conflict block for it. Continue with the remaining pairs.
Avoid matching inside fenced code blocks (``` or ~~~ delimiters) or inside Quarto shortcode spans ({{< >}}).
Write the modified source file using the Edit tool (preferred, to minimize diff) or the Write tool. Apply all successful replacements.
Report results to the user:
| Situation | Behaviour | |-----------|-----------| | Same original sentence appears more than once in the source | Insert a conflict marker at every occurrence. Each will be independently resolvable. | | Original sentence spans a line break in the source | Fuzzy-match on the longest phrase that fits on a single line, then expand to the sentence boundary. | | Report lists the same original sentence twice (two different recommendations) | Apply them in report order; the first match consumes the first occurrence of the sentence. | | Source file has already been partially edited (some originals no longer present) | Skip silently, include in the unmatched summary. | | Conflict block would appear inside a Quarto code chunk | Skip and warn — never insert markers inside code fences. |
.qmd file)Before:
The results shows that incumbents win more often in low-turnout elections.
After:
<<<<<<< original
The results shows that incumbents win more often in low-turnout elections.
=======
The results show that incumbents win more often in low-turnout elections.
>>>>>>> claude-edits
The user then sees inline diff UI in Positron / VS Code:
Accept Current Change | Accept Incoming Change | Accept Both | Compare Changes
Accepting "Current Change" keeps the original; accepting "Incoming Change" applies the recommendation.
development
Conduct rigorous thematic analysis (TA) of qualitative data following Braun and Clarke's (2006) six-phase framework. Use whenever the user mentions 'thematic analysis', 'TA', 'Braun and Clarke', 'qualitative coding', 'identifying themes', or asks for help analysing interviews, focus groups, open-ended survey responses, or transcripts to identify patterns. Also trigger for questions about inductive vs theoretical coding, semantic vs latent themes, essentialist vs constructionist epistemology, building a thematic map, or writing up a qualitative findings section. Covers all six phases, the four upfront analytic decisions, the 15-point quality checklist, and the five common pitfalls. Produces a Word document write-up and an annotated thematic map. Does NOT cover IPA, grounded theory, discourse analysis, conversation analysis, or narrative analysis — use a different method for those.
development
Guide users through writing a systematic literature review (SLR) following the PRISMA 2020 framework. Use this skill whenever the user mentions 'systematic review', 'systematic literature review', 'SLR', 'PRISMA', 'PRISMA 2020', 'PRISMA flow diagram', 'PRISMA checklist', or asks for help writing, structuring, or auditing a literature review that follows reporting guidelines. Also trigger when the user asks about inclusion/exclusion criteria for a review, search strategies for databases like Scopus/WoS/PubMed, study selection processes, risk of bias assessment, or narrative synthesis for a review paper. This skill covers the full PRISMA 2020 checklist (27 items), produces a Word document manuscript in strict journal article format, generates an annotated PRISMA flow diagram, and enforces APA 7th Edition referencing throughout. It does NOT cover meta-analysis or statistical pooling. By Chuah Kee Man.
testing
Performs placebo-in-time sensitivity analysis with hierarchical null model and optional Bayesian assurance. Use when checking model robustness, verifying lack of pre-intervention effects, or estimating study power.
data-ai
Fit, summarize, plot, and interpret a chosen CausalPy experiment. Use after the causal method has been selected, including when configuring PyMC/sklearn models and scale-aware custom priors.