Skip to content

Releases: Vusys/cm-tools

v0.3.0

Choose a tag to compare

@Vusys Vusys released this 09 Aug 21:05

One new command. An assistant only reaches for a tool it knows exists, so install-skill writes a Claude Code skill describing what cm-tools does and when to use it — turning "explain the tool again this session" into one command.

Added

  • cm-tools install-skill writes ./.claude/skills/cm-tools/SKILL.md, or the same path under $HOME with --user. Parent directories are created as needed and the resolved path is printed, so the winning scope is visible. An existing file is left alone unless --force is passed; --print emits the skill to stdout and touches nothing. (#4)

The skill covers the four document commands, what each dialect rejects, and the things that actually go wrong when an agent edits Markdown — that a lint failure is a target-compatibility result rather than a parse error, that lint has no fixer, and that hard line breaks are two trailing spaces that must survive any post-processing.

Its dialect table is checked cell-for-cell against RuleSetRegistry and each RuleSet in the test suite, so a future dialect or construct fails the build rather than quietly leaving the skill stale.

Full changelog: v0.2.0...v0.3.0

v0.2.0

Choose a tag to compare

@Vusys Vusys released this 09 Aug 17:56

Five reflow correctness fixes. Each one caused wrap/unwrap to emit a document that parsed differently from its input — not a formatting nit but silent corruption, in most cases with no visible sign that anything had gone wrong.

If you have run wrap or unwrap over documents with 0.1.0, it is worth re-checking anything containing a multi-block blockquote or a nested list.

Fixed

  • Blank lines inside a blockquote keep their > marker. Previously emitted bare, which ends a quote — so one quote containing several paragraphs (or a code block, list, or nested quote) came back out as several separate quotes. Across a 232-file corpus this was the single largest cause of corruption. (#5)
  • Wrapping no longer turns prose into block markup. A line break that pushed a -, +, #, 1., 1), or a ---/=== run to the start of a line reinterpreted the text as a list, heading, or setext underline. Because it depended on where the break landed, the same document could round-trip cleanly at --width=80 and corrupt at 79. Also fixes markers the author escaped in the source, which were unescaped on output at every width. (#6)
  • A tight list containing a nested sublist stays tight. A blank line before the sublist promoted the whole list to loose, wrapping every item's content in a <p> — including siblings that had no sublist at all. (#7)
  • An empty list item keeps its marker instead of being dropped. The item disappeared, leaving a stray blank line, and an ordered list renumbered around the gap so surviving items silently changed number. (#8)
  • A literal U+0001 is no longer turned into a hard line break. That byte is the in-band sentinel used to mark a real hard break, so an occurrence in the document was indistinguishable from one. It is now stripped before parsing — note this means the byte is dropped rather than preserved. (#9)

Added

  • DocumentParser::environment() exposes the shared CommonMark environment, so callers needing a renderer rather than a parser get the identical extension set instead of a copy that can drift.
  • A fixture catalogue for reflow round-trips (tests/Fixtures/Reflow). Every case must match its expected output, be unchanged by a second pass, and render to the same HTML as its input. That last property is what all five bugs above broke, and it is now enforced across 45 cases.

Full changelog: v0.1.0...v0.2.0

v0.1.0

Choose a tag to compare

@Vusys Vusys released this 09 Aug 16:08

First release of cm-tools — CommonMark tools shipped as a single binary.

Added

  • Fixed-width reflow — wrap reflows a document's prose to a column width; unwrap collapses it back to one line per block.
  • Dialect validation — lint checks a document against a target dialect (strict CommonMark, GitHub Flavored Markdown, JIRA Cloud) and exits non-zero on unsupported constructs; detect reports which dialects a document is compatible with.
  • Symfony Console-based CLI, shipped as a standalone .phar built with Box.

Install

Download cm-tools below and put it on your PATH:

chmod +x cm-tools
mv cm-tools /usr/local/bin/

Or via Composer:

composer global require vusys/cm-tools

Requires PHP 8.4+ with ext-mbstring. The phar is GZ-compressed, so ext-zlib is required to execute it.