Installable skillMIT

Generate Markdown tables of contents before publishing docs or README updates

Runs DocToc to insert or refresh navigable tables of contents inside Markdown files after headings already exist. Use it when an agent is preparing README or docs updates and needs reliable intra-document navigation, not when it is generating the documentation itself.

BY agentskillexchangeUPDATED Oct 28, 2026
INTENDED FOR>_Codex◎ChatGPTInstall in a listed agent.

instructions.md

---
name: generate-markdown-tables-of-contents-before-publish-310ec0a3ca8c
slug: "generate-markdown-tables-of-contents-before-publishing-docs-or-readme-updates"
description: "Runs DocToc to insert or refresh navigable tables of contents inside Markdown files after headings already exist. Use it when an agent is preparing README or docs updates and needs reliable intra-document navigation, not when it is generating the documentation itself."
github_stars: 4432
verification: "security_reviewed"
source: "https://github.com/thlorenz/doctoc"
author: "Thorsten Lorenz"
category: "Content Writing & SEO"
framework: "Multi-Framework"
tool_ecosystem:
  github_repo: "thlorenz/doctoc"
  github_stars: 4432
  npm_package: "doctoc"
  npm_weekly_downloads: 1025939
---

# Generate Markdown tables of contents before publishing docs or README updates

Runs DocToc to insert or refresh navigable tables of contents inside Markdown files after headings already exist. Use it when an agent is preparing README or docs updates and needs reliable intra-document navigation, not when it is generating the documentation itself.

## Prerequisites

Node.js, npm, command line

## Installation

Use the upstream install or setup path that matches your environment:
- npm install -g doctoc

Requirements and caveats from upstream:
- # DocToc [![Node.js CI](https://github.com/thlorenz/doctoc/actions/workflows/node.js.yml/badge.svg)](https://github.com/thlorenz/doctoc/actions/workflows/node.js.yml)
- [Docker image](#docker-image)
- ### Docker image

Basic usage or getting-started notes:
- <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Usage](#usage)
- [Example](#example)

- Source: https://github.com/thlorenz/doctoc
- Extracted from upstream docs: https://raw.githubusercontent.com/thlorenz/doctoc/HEAD/README.md

## Documentation

- https://github.com/thlorenz/doctoc#readme

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/generate-markdown-tables-of-contents-before-publishing-docs-or-readme-updates/)
COMPATIBILITY & REFERENCES

Platform guidance

Imported from the listed AgentSkill.sh category. Complete supplied package files and notices are retained. Required external tools and credentials are not installed. No bundled code was executed during import. Individual agent task behavior has not been tested.