Markdown TOC

v1.0.0

Generate a table of contents from Markdown headings with configurable levels, formats, and unique anchors, excluding headings inside code blocks.

0· 148·0 current·0 all-time
byhaidong@harrylabsj

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for harrylabsj/markdown-toc.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Markdown TOC" (harrylabsj/markdown-toc) from ClawHub.
Skill page: https://clawhub.ai/harrylabsj/markdown-toc
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install markdown-toc

ClawHub CLI

Package manager switcher

npx clawhub@latest install markdown-toc
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description align with the included script and README. The Python script implements heading extraction, slug generation, duplicate handling, and output formatting as described.
Instruction Scope
SKILL.md instructs running the included Python script against a user-supplied file and only reads/writes the specified input/output paths. It explicitly avoids headings inside code blocks. Minor note: the instructions reference an installation path (~/.openclaw/skills/markdown-toc/markdown_toc.py) which assumes the skill is installed there; otherwise README uses a relative invocation. No instructions ask the agent to read unrelated files or env vars.
Install Mechanism
There is no install spec (instruction-only) and the repository contains a single small Python script. No downloads or external installers are used.
Credentials
The skill declares no required environment variables or credentials. Minor inconsistency: SKILL.md/README show invoking the script with the 'python' command but required-binaries lists none; the platform will need Python available to run the script.
Persistence & Privilege
always is false and the skill does not request persistent system modifications or access to other skills/configs. disable-model-invocation is false (normal) so the agent could invoke it autonomously, but that is expected for user-invocable skills.
Assessment
This skill appears to do exactly what it says: local processing of Markdown files to generate a TOC. Before installing, ensure your environment has Python available (the SKILL.md calls 'python'), and only pass files you trust (the script will read the input file and optionally write the output path you provide). There are no network calls or secret/env var requirements. If you want to be extra cautious, inspect the included markdown_toc.py (present here) and run it manually on a sample file to confirm behavior before allowing autonomous agent invocation.

Like a lobster shell, security has layers — review code before you run it.

latestvk972swn68dbvfjymnhzh7w9c75839d7d
148downloads
0stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

markdown-toc

Generate a Table of Contents (TOC) from Markdown headings.

Description

This skill extracts headings from Markdown files and generates a well-formatted table of contents. It supports standard Markdown heading syntax (#, ##, ###, etc.) and outputs a clean, indented TOC that can be inserted back into your document.

Usage

# Generate TOC from a markdown file
python ~/.openclaw/skills/markdown-toc/markdown_toc.py <input-file> [options]

# Options:
#   --output, -o    Output file (default: stdout)
#   --min-level     Minimum heading level to include (default: 1)
#   --max-level     Maximum heading level to include (default: 6)
#   --format        Output format: "list" or "links" (default: list)

Examples

# Basic usage - print TOC to stdout
python ~/.openclaw/skills/markdown-toc/markdown_toc.py README.md

# Save TOC to a file
python ~/.openclaw/skills/markdown-toc/markdown_toc.py README.md -o toc.md

# Include only level 2-3 headings
python ~/.openclaw/skills/markdown-toc/markdown_toc.py README.md --min-level 2 --max-level 3

# Generate TOC with anchor links
python ~/.openclaw/skills/markdown-toc/markdown_toc.py README.md --format links

Features

  • Extracts headings from # to ###### (levels 1-6)
  • Supports both bullet list and linked TOC formats
  • Configurable heading level filtering
  • Handles duplicate headings with unique anchors
  • Preserves heading text formatting (bold, italic, code)
  • Skips headings inside code blocks

Output Formats

List Format (default)

- Heading 1
  - Heading 2
    - Heading 3

Links Format

- [Heading 1](#heading-1)
  - [Heading 2](#heading-2)
    - [Heading 3](#heading-3)

Comments

Loading comments...