Use when parsing or generating Markdown following the CommonMark specification - AST structure, block/inline elements, and extensions
Scanned 2/12/2026
Install via CLI
openskills install majiayu000/claude-skill-registry---
name: commonmark
# prettier-ignore
description: Use when parsing or generating Markdown following the CommonMark specification - AST structure, block/inline elements, and extensions
---
# CommonMark Markdown
## Quick Start
```typescript
import { Parser, HtmlRenderer } from 'commonmark';
const parser = new Parser();
const renderer = new HtmlRenderer();
const ast = parser.parse('# Hello\n\nWorld');
const html = renderer.render(ast);
```
## AST Node Types
### Block Elements
| Type | Description |
|------|-------------|
| `document` | Root node |
| `heading` | `# ` through `###### ` |
| `paragraph` | Text block |
| `code_block` | Fenced (```) or indented |
| `block_quote` | `> ` prefixed |
| `list` | Ordered or bullet list |
| `item` | List item |
| `thematic_break` | `---`, `***`, `___` |
### Inline Elements
| Type | Description |
|------|-------------|
| `text` | Plain text |
| `emph` | `*italic*` or `_italic_` |
| `strong` | `**bold**` or `__bold__` |
| `code` | `` `inline` `` |
| `link` | `[text](url)` |
| `image` | `` |
| `softbreak` | Line break in source |
| `hardbreak` | Two spaces + newline |
## Walking the AST
```typescript
const walker = ast.walker();
let event;
while ((event = walker.next())) {
const { node, entering } = event;
if (node.type === 'heading' && entering) {
console.log(`H${node.level}: ${node.firstChild?.literal}`);
}
}
```
## Key Parsing Rules
- Blank line separates paragraphs
- 4-space indent = code block (unless in list)
- Fenced code: 3+ backticks, optional info string
- Setext headings: `===` or `---` underline
- Links: `[text](url "title")` or `[text][ref]`
## Extensions (GFM)
GitHub Flavored Markdown adds:
- Tables: `| col | col |`
- Strikethrough: `~~text~~`
- Task lists: `- [ ]` and `- [x]`
- Autolinks: URLs become links automatically
## Tips
- Use `node.literal` for text content
- Use `node.destination` for link/image URLs
- `node.info` contains fenced code language
- Modify AST before rendering for transformations
No comments yet. Be the first to comment!
Create Mermaid diagrams for flowcharts, sequences, ERDs, and
Draft release notes and changelog entries from git history or merged PRs between two refs (tags/SHAs/branches), including breaking changes, migrations, and upgrade steps. Use when the user asks for release notes, changelog updates, or a GitHub Release draft.
Explain how claude-mem captures observations, when memory injection kicks in, and where data lives. Use when the user asks "how does claude-mem work?" or "what is this thing doing?".
Review a pull request or contribution deeply, explain it tutorial-style for a maintainer, and produce a polished report artifact such as HTML or Markdown. Use when asked to analyze a PR, explain a contributor's design decisions, compare it with similar systems, or prepare a merge recommendation.
Generate the stable Paperclip release changelog at releases/vYYYY.MDD.P.md by reading commits, changesets, and merged PR context since the last stable tag.