本文へ移動
cccskills
無料GitHub で公開

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.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md3.4 KB

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

PositionRequiredDescription
1YesPath to the input .md or .qmd file
2NoOutput 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.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

APSA style checker for Quarto (.qmd) files. Checks numbers, capitalization, abbreviations, italics, in-text citations, titles of works, neutral and unbiased language, and APSA-specific terminology against the APSA Style Manual for Political Science (2018, updated 2023). Produces a structured markdown report organized by document section — never modifies the source file. Use when asked to check APSA style, fix citations, review capitalization, check number formatting, or flag biased language in a .qmd document. For grammar, spelling, and punctuation, use the proofread skill instead. Supports an optional output-file argument and an optional @sec-label argument to restrict checking to one section.

日本語の概要は準備中です。原文の説明を表示しています。

christopherkenny/skills262026年7月9日 更新

Assesses a research paper outline (.qmd file) against structured criteria from Kosuke Imai's empirical research guide. Evaluates the abstract and section outline for: research question clarity, stated contributions, hypotheses and testable implications, data description, planned results and inferential approach, and robustness checks. Detects causal papers from the abstract and conditionally assesses identification strategy only when causal framing is present. Produces a structured markdown report with PASS/PARTIAL/FAIL assessments and actionable suggestions. Use when asked to assess, evaluate, review, or check a paper outline, abstract-and-outline, or research plan in a .qmd file.

日本語の概要は準備中です。原文の説明を表示しています。

christopherkenny/skills262026年7月9日 更新

Converts LaTeX article-class .tex documents to Quarto .qmd format for multi-format publishing (HTML, PDF, Word). Use when asked to convert, port, migrate, or translate a .tex LaTeX file to Quarto; when porting an academic paper or manuscript from LaTeX to Quarto; when a .tex document needs to render to HTML, Word, or Typst PDF. Covers preamble → YAML front matter, section headings, text formatting, math, citations (natbib/biblatex), cross-references, figures, tables, lists, footnotes, hyperlinks, and special characters.

日本語の概要は準備中です。原文の説明を表示しています。

christopherkenny/skills262026年7月9日 更新

Translates LaTeX documents (.tex) to Typst (.typ), focusing on article-class documents. Use when asked to convert, port, migrate, or translate LaTeX to Typst. Covers document structure, text formatting, page layout, math equations and symbols, figures, tables, TikZ-to-CeTZ diagrams, bibliography, cross-references, footnotes, and code blocks. Includes comprehensive symbol mapping tables.

日本語の概要は準備中です。原文の説明を表示しています。

christopherkenny/skills262026年7月9日 更新

Writes expert academic paper summaries for social science research, particularly political science and applied statistics. Use when asked to summarize, review, or create a reading summary of an academic paper, PDF, or research article. Accepts a file (PDF or text format) or a directory of papers. Produces a structured markdown summary — approximately 400–600 words — covering primary contributions, major questions and answers with point estimates, methods and data, and limitations and robustness. Includes BibTeX citation retrieved from Google Scholar and keyword metadata.

日本語の概要は準備中です。原文の説明を表示しています。

christopherkenny/skills262026年7月9日 更新

proofread

無料

Expert copy editor for Quarto (.qmd) files. Checks grammar, spelling, punctuation, and academic writing quality. Produces a structured markdown report organized by document section — never modifies the source file. Use when asked to proofread, check grammar, fix typos, or review prose in a .qmd document. For APSA style rules (numbers, citations, capitalization, abbreviations, neutral language), use the apsa-style skill instead. Supports an optional output-file argument and an optional @sec-label argument to restrict checking to one section.

日本語の概要は準備中です。原文の説明を表示しています。

christopherkenny/skills262026年7月9日 更新

christopherkenny のスキルをすべて見る

このスキルの問題を報告する