/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
$ npx -y skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill markdown-unwrap --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/markdown-unwrap
Context preview
The summary Claude sees to decide when to auto-load this skill.
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
SKILL.md
markdown-unwrap.SKILL.mdname: markdown-unwrap
description: '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.'
metadata:
author: Christopher T. Kenny
version: 1.0
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, append the line's text to the current buffer (joining with a single space, trimming leading/trailing whitespace from each line).
3. **Flushing** — when a pass-through line (or end-of-file) is encountered, flush the buffer:
- Split the accumulated text into sentences at `(?<=[.!?])\s+` — i.e., after a sentence-ending punctuation mark followed by whitespace.
- Emit each sentence on its own line.
- Clear the buffer.
4. Write the result to the output path (or overwrite the input if no output path was given).
What Is Preserved
- Blank lines (paragraph separators)
- Fenced code blocks (contents unchanged)
- YAML front matter
- Headings, list items, and block quotes (each kept on its own line)
- All text content — only whitespace between words is affected
What Changes
- Mid-sentence hard-wrap newlines are removed
- Each sentence ends with exactly one newline
- Trailing spaces within paragraphs are removed
Implementation Notes
Implement the algorithm directly in your response — read the file, process it line-by-line following the rules above, and write the result. No external script is needed.
The sentence-split heuristic: a period followed by whitespace and an uppercase letter is a sentence boundary **unless** the word immediately before the period is a known abbreviation. Maintain a blocklist of common abbreviations that should never trigger a split:
- Titles: `Mr`, `Mrs`, `Ms`, `Dr`, `Prof`, `Sr`, `Jr`, `Rev`, `Gov`
- Latin: `e.g`, `i.e`, `et al`, `vs`, `etc`
- Academic: `Fig`, `Eq`, `Sec`, `Ch`, `Vol`, `No`, `pp`
When the token before the period matches one of these (case-insensitively), do not split. For `?` and `!` there is no abbreviation concern — always split.
Read more
name: markdown-unwrap description: '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.' metadata: author: Christopher T. Kenny version: 1.0
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, append the line's text to the current buffer (joining with a single space, trimming leading/trailing whitespace from each line).
3. **Flushing** — when a pass-through line (or end-of-file) is encountered, flush the buffer:
- Split the accumulated text into sentences at `(?<=[.!?])\s+` — i.e., after a sentence-ending punctuation mark followed by whitespace.
- Emit each sentence on its own line.
- Clear the buffer.
4. Write the result to the output path (or overwrite the input if no output path was given).
What Is Preserved
- Blank lines (paragraph separators)
- Fenced code blocks (contents unchanged)
- YAML front matter
- Headings, list items, and block quotes (each kept on its own line)
- All text content — only whitespace between words is affected
What Changes
- Mid-sentence hard-wrap newlines are removed
- Each sentence ends with exactly one newline
- Trailing spaces within paragraphs are removed
Implementation Notes
Implement the algorithm directly in your response — read the file, process it line-by-line following the rules above, and write the result. No external script is needed.
The sentence-split heuristic: a period followed by whitespace and an uppercase letter is a sentence boundary **unless** the word immediately before the period is a known abbreviation. Maintain a blocklist of common abbreviations that should never trigger a split:
- Titles: `Mr`, `Mrs`, `Ms`, `Dr`, `Prof`, `Sr`, `Jr`, `Rev`, `Gov`
- Latin: `e.g`, `i.e`, `et al`, `vs`, `etc`
- Academic: `Fig`, `Eq`, `Sec`, `Ch`, `Vol`, `No`, `pp`
When the token before the period matches one of these (case-insensitively), do not split. For `?` and `!` there is no abbreviation concern — always split.
📌 文档结构(2026-07-22 起): 本文件是中文默认入口 —— banner + badges + 信任面 + 9 阶段流水线速览 + 76 行合集总表。 每个合集的完整描述、按用途分组、精确数字、验证方法在 docs/CONTENT_ZH.md(扩展正文,总表行内的 → 直接跳转到对应锚点)。 English version: README-en.md · 中文扩展正文:docs/CONTENT_ZH.md · README-zh-CN.md 已弃用(重定向占位) 🌐 语言: English |
Other skills on auto-empirical-research-skills.
- /pipeline
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest + rdrobust + econml + causalml + matplotlib/seaborn. **Defaults to economics empirical-paper style** (AER / QJE / AEJ) —
Open skill - /pipeline
Classical end-to-end empirical analysis workflow in the modern tidyverse + econometrics R ecosystem — dplyr + tidyr + haven + fixest + sandwich + lmtest + clubSandwich + AER + ivreg + did + bacondecomp + HonestDiD + eventstudyr + rdrobust + rddensity + Synth + gsynth + synthdid
Open skill - /pipeline
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid + did_imputation + eventstudyinteract + sdid + rdrobust + rddensity + synth + synth_runner + psmatch2 + teffects + ebalance + coefplot + esttab + asdoc +
Open skill - /00-Full-empirical-analysis-skill_StatsPAI
Use when the user asks to run a full empirical / causal analysis in Python — by default in the style of an applied economics paper (AER / QJE / JPE / ReStud / AEJ) with DID / RD / IV / SCM / DML / matching, written-out estimating equation + identifying assumption, Table 1 /
Open skill - /00.1-Full-empirical-analysis-skill_Python
Classical end-to-end empirical analysis workflow in the traditional Python econometric stack — pandas + numpy + scipy + statsmodels + linearmodels + pyfixest + rdrobust + econml + causalml + matplotlib/seaborn. **Defaults to economics empirical-paper style** (AER / QJE / AEJ) —
Open skill - /00.2-Full-empirical-analysis-skill_Stata
Classical end-to-end empirical analysis workflow in the traditional Stata ecosystem — native Stata + reghdfe + ivreg2 + csdid + did_imputation + eventstudyinteract + sdid + rdrobust + rddensity + synth + synth_runner + psmatch2 + teffects + ebalance + coefplot + esttab + asdoc +
Open skill

