What it does
Scans a post's existing H2 and H3 headings, generates anchor IDs for any that lack one, and builds a jump-link list at the top of the post so readers can skip to a section. It only acts on posts long enough to benefit (a rough word-count or heading-count threshold) rather than adding a table of contents to every short post.
Install
This skill isn't packaged in an installable registry. It's a plain SKILL.md file you can copy directly. Copy it from the SKILL.md tab and save it at the path for your assistant:
Use it in your AI assistant
Claude Code
.claude/skills/toc-builder/ (or ~/.claude/skills/toc-builder/ for all projects)
GitHub Copilot (VS Code)
.github/skills/toc-builder/
OpenAI Codex
.codex/skills/toc-builder/
Cursor
.cursor/skills/toc-builder/ (or ~/.cursor/skills/toc-builder/ globally)
Compatibility
Any WordPress site. No special plugin required for the anchor-link approach, though it will use a dedicated TOC block or plugin instead if one is already active on the site.
The complete SKILL.md for this skill:
---
name: toc-builder
description: Use when a user wants a table of contents added to a long post, or asks for jump links to sections. Triggers on "add a table of contents", "add jump links", or "this post is long, can readers skip to a section".
---
# Table of Contents Builder
## When to use
A post is long enough (roughly 1200+ words, or has 5 or more headings) that readers would benefit from jumping straight to a section instead of scrolling.
## Procedure
1. Check the post's word count and heading structure; if it's short with few headings, tell the user a table of contents isn't likely to help rather than adding one anyway.
2. Extract all H2 and H3 headings in order, assigning a URL-safe anchor ID to any heading that doesn't already have one.
3. Build a jump-link list reflecting the heading hierarchy (H3s nested under their parent H2), placed after the intro paragraph, not before the title.
4. If the site already has a table-of-contents block or plugin active, use that instead of hand-rolled anchor links, so the output matches the site's existing pattern.
5. Show the generated list and anchor IDs before inserting, so the user can catch a heading that reads oddly as a link label.
## Guardrails
- Do not add a table of contents to a short post just because it was asked for generic post help; only add it when the length or heading count genuinely warrants it, and say so.
- Do not overwrite existing anchor IDs on headings that already have them, doing so can break existing external links or bookmarks pointing at that section.