markdown-unwrap
Unwraps hard-wrapped markdown files so that each sentence ends with a newline instead of mid-sentence line breaks. Joins continuation lines within a paragraph into single lines, then re-breaks at sentence boundaries (period, question mark, exclamation point). Preserves blank lines, headings, fenced code blocks, block quotes, and list items. Use when asked to unwrap text, fix line breaks, reflow sentences, or clean up hard-wrapped markdown or .qmd files.
npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill markdown-unwrap --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Markdown Unwrap Reflow a markdown (or `.qmd`) file so that each **sentence** occupies its own line. This is the inverse of hard-wrapping: mid-sentence newlines are removed and the text is re-broken only at sentence endings. ## Input Arguments | Position | Required | Description | |----------|----------|-------------| | 1 | **Yes** | Path to the input `.md` or `.qmd` file | | 2 | No | Output path. Defaults to overwriting the input file in-place | **Example invocations:** ``` /markdown-unwrap paper/paper.qmd /markdown-unwrap README.md README-unwrapped.md ``` ## Algorithm Process the file line-by-line, maintaining a **current paragraph buffer**: 1. **Pass-through lines** — output immediately, do not buffer: - Blank lines (flush the buffer first, then emit the blank line) - ATX headings (`#`, `##`, …) - Fenced code block delimiters (` ``` ` or `~~~`); toggle a *in-code-block* flag and pass all lines through until the closing fence - Block-quote lines starting with `>` - List item lines starting with `-`, `*`, `+`, or a digit followed by `.`/`)` - YAML front-matter delimiters `---` / `...` (pass the entire front-matter block through unchanged) 2. **Buffering** — for all other lines, a
- Input Arguments
- Algorithm
- What Is Preserved
- What Changes
- Implementation Notes
What does the markdown-unwrap skill do?
Unwraps hard-wrapped markdown files so that each sentence ends with a newline instead of mid-sentence line breaks. Joins continuation lines within a paragraph into single lines, then re-breaks at sentence boundaries (period, question mark, exclamation point). Preserves blank lines, headings, fenced code blocks, block quotes, and list items. Use when asked to unwrap text, fix line breaks, reflow sentences, or clean up hard-wrapped markdown or .qmd files.
How do I install it?
Run `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill markdown-unwrap --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From brycewang-stanford/Auto-Empirical-Research-Skills, a repository with 3,244 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.