📋 What This Does
Automatically creates a professional, numbered table of contents for Substack newsletter articles with working internal anchor links. Perfect for long-form content that needs clear navigation.
Key Features:
- Generates numbered TOC with clickable section links
- Formats entire article with consistent section numbering
- Uses Substack's auto-generated anchor system (no manual IDs needed)
- Adds proper horizontal rule separations between sections
- Preserves all original content while enhancing structure
🚀 How to Use
Simply say to your AI assistant:
- "Add a table of contents to this Substack article"
- "Create a TOC for my newsletter"
- "Add navigation to this article"
- "Generate section links for Substack"
What You'll Need
Required Information:
- Post ID - The numerical ID from your published Substack URL
Example:176830635fromhttps://yourname.substack.com/p/article-title-176830635 - Article Content - Your full article with section headings
- Substack Domain - Your full domain (e.g.,
username.substack.com)
💡 How It Works
Substack automatically generates anchor links for every heading using the format:
https://domain.substack.com/i/POST_ID/heading-in-kebab-case
Example Transformation
Before:
Hey Reader,
Intro paragraph here.
### Email triage and response
Content...
### Client presentations
Content...
After:
Hey Reader,
Intro paragraph here.
---
**Table of Contents:**
1. [Email triage and response](https://domain.com/i/176830635/email-triage-and-response)
2. [Client presentations](https://domain.com/i/176830635/client-presentations)
---
### 1. Email triage and response
Content...
---
### 2. Client presentations
Content...
⚙️ For LLM Integration
Add this skill to your AI assistant's system prompt:
<skill>
<name>substack-toc</name>
<description>Creates numbered table of contents for Substack articles with working internal anchor links</description>
<url>https://skills.masterymade.com/substack-toc.html</url>
</skill>
The AI will automatically fetch and execute this skill when triggered by relevant user requests.
Supported Platforms
- ✅ Claude (via web_fetch tool)
- ✅ ChatGPT (with browsing enabled)
- ✅ Gemini (with web access)
- ✅ Any LLM with web_fetch capability
📊 Technical Details
Anchor Link Generation
Substack converts heading text to anchor slugs using these rules:
- Convert to lowercase
- Replace spaces with hyphens
- Remove special characters (keep only letters, numbers, hyphens)
- Remove leading/trailing hyphens
Examples:
- "Email Triage and Response" →
email-triage-and-response - "Run Your Own Audit" →
run-your-own-audit - "What These Patterns Reveal" →
what-these-patterns-reveal
Best Practices
- Use H3 (
###) for all numbered sections - Add
---horizontal rules between sections - TOC link text must exactly match section headings (except numbers)
- Keep one short transition paragraph between TOC and first section
- Avoid "Back to top" links (creates clutter)
⚠️ Important: TOC links only work after publishing. You must get the POST_ID from your published article URL before generating the TOC.
📦 Skill Metadata
- Version:
- 1.0.0
- Author:
- MasteryMade
- License:
- MIT
- Dependencies:
- None
- Platform:
- Cross-platform (any LLM with web_fetch)
- Skill Type:
- Content formatting & navigation
🐛 Troubleshooting
Links Don't Work After Publishing
- Verify POST_ID matches your published URL exactly
- Check that heading text in links matches actual headings
- Confirm kebab-case conversion is correct (lowercase, hyphens only)
TOC Numbers Don't Match Section Numbers
- Audit both TOC and section headings for consistency
- Ensure sequential numbering with no gaps
- Verify no headings were accidentally skipped
Wrong Anchors Generated
- Remember: Substack auto-generates anchors from heading text
- You cannot use custom anchor IDs
- The heading text determines the anchor slug automatically