Agent skill · writing content · aiskillstore

markdown-toc

Use when generating or updating Table of Contents in markdown files. Supports multiple files, glob patterns, configurable header levels, and various insertion modes. Triggered by "generate toc", "update toc", "table of contents", "add toc to markdown".

Why this skill is useful

Adds an executable script for generating and updating Table of Contents in markdown files, which is not commonly found in public documentation.

What it needs

Requires python installed locally. About 3k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Markdown Table of Contents Generator A universal TOC generator that works with any markdown file. Supports batch processing, configurable header levels, and smart insertion. Quick Start Note: You can also copy the script to your project and run it locally. Options Option Default Description -------- --------- ------------- --dry-run false Preview TOC without modifying files --min-level N 2 Minimum header level (1-6) --max-level N 3 Maximum header level (1-6) --title TEXT "Table of Contents" Custom TOC title --no-title false Omit TOC title --recursive, -r false Process .md files recursively --insert MODE auto Insertion mode: auto, top, marker --marker TEXT <!-- TOC --> Custom marker for marker mode Insertion Modes Auto Mode (default) Smart detection in this order: 1. Replace existing ## Table of Contents section 2. Insert after first --- separator (common README pattern) 3. Insert after YAML frontmatter 4. Insert after first header 5. Insert at top of file Top Mode Insert at top of file, respecting YAML frontmatter: Marker Mode Insert/replace between marker pairs: In your markdown file: Custom markers: Header Level Control Include only H2-H3 (default): Include H1-H4: Include only H2: Batch Processing Glob Patterns Recursive Multiple Paths Output Examples With Title (default) Without Title Custom Title Anchor Generation GitHub-compatible anchors: Lowercase conversion Spaces to hyphens Special characters removed Markdown formatting stripped (bold, code ) Emoji removed Multiple hyphens collapsed Header Anchor -------- -------- ## Getting Started #getting-started ## Bold Header #bold-header ## Header with code #header-with-code ## Header #1 #header-1 Skipped Content The script automatically skips: YAML frontmatter (between --- markers) Code blocks ( bash python scripts/generatetoc.py --dry-run README.md [INFO] Found 1 markdown file(s) ============================================================ File: README.md ============================================================ …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/markdown-toc

View the source on GitHub

Browse the @skills marketplace