Markdown formatting

From athola/claude-night-market · View interactive version

Markdown formatting is an AI agent skill from the GitHub repository athola/claude-night-market. Enforces markdown line-wrap and structure rules for clean git diffs. Use when writing or editing any committed markdown documentation or skill file.

How to use this skill

Skill file

Markdown Formatting Conventions

When To Use

When NOT To Use

their own formatting rules)

These conventions apply to all markdown documentation generated

or modified by any plugin. The goal: produce prose that creates

clean, reviewable git diffs and reads well on mobile devices.

Quick Reference

When writing or editing markdown prose:

  1. Wrap prose at 80 chars using hybrid wrapping (prefer

sentence/clause boundaries over arbitrary word breaks)

  1. Blank line before and after every heading
  2. ATX headings only (# Heading, never setext underlines)
  3. Blank line before every list
  4. Reference-style links when inline links push lines

beyond 80 chars

What to Wrap

Wrap these content types at 80 characters:

What NOT to Wrap

Never wrap or reflow these content types:

Wrapping Algorithm (Summary)

For each prose paragraph:

  1. If a sentence fits within 80 chars, keep it on one line
  2. If a sentence exceeds 80 chars, break at the nearest

sentence boundary (. ! ? ) before column 80

  1. If no sentence boundary, break at the nearest **clause

boundary** (, ; : ) before column 80

  1. If no clause boundary, break before a conjunction

(and but or ) before column 80

  1. If none of the above, break at the last word boundary

before column 80

  1. Never break inside backtick spans, link text, or URLs

See modules/wrapping-rules.md for the full algorithm with

examples.

Structural Rules

Blank Lines Around Headings

WRONG:
Some text.
## Heading
More text.

RIGHT:
Some text.

## Heading

More text.

Exception: the first line of a file may be a heading without

a preceding blank line.

ATX Headings Only

WRONG:
Heading
=======

WRONG:
Subheading
----------

RIGHT:
# Heading

RIGHT:
## Subheading

Blank Line Before Lists

WRONG:
Some introductory text:
- Item one
- Item two

RIGHT:
Some introductory text:

- Item one
- Item two

Reference-Style Links for Long URLs

When an inline link pushes a line beyond 80 characters, use

reference-style syntax:

WRONG (line too long):
See the [formatting guide](https://google.github.io/styleguide/docguide/style.html) for details.

RIGHT:
See the [formatting guide][fmt-guide] for details.

[fmt-guide]: https://google.github.io/styleguide/docguide/style.html

Place link definitions at the end of the current section or

at the end of the document. When the same URL appears multiple

times, use a single shared reference definition.

Short inline links that keep the line under 80 chars are fine:

OK:
See [the guide](https://example.com) for details.

Exit Criteria

fewer; verified with awk 'length>80' <file> returning no

matches on prose blocks (tables, code, headings, frontmatter

excluded)

the first line of a file); no setext-style underline headings

present

converted to reference-style syntax with the URL definition at

the end of the section or document

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.