SKILL.md
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:
-
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)
-
Buffering — for all other lines, append the line's text to the current buffer (joining with a single space, trimming leading/trailing whitespace from each line).
