$npx -y skills add kostja94/marketing-skills --skill tocWhen the user wants to add, optimize, or audit table of contents (TOC) for long-form content. Also use when the user mentions "TOC," "table of contents," "table of contents for article," "article TOC," "jump links," "content outline," "article navigation," "in-page navigation," "
| 1 | # Components: Table of Contents (TOC) |
| 2 | |
| 3 | Guides TOC implementation for long-form articles, guides, and whitepapers. TOCs improve UX and SEO by enabling quick navigation and reducing bounce rates. |
| 4 | |
| 5 | **When invoking**: On **first use**, if helpful, open with 1-2 sentences on what this skill covers and why it matters, then provide the main output. On **subsequent use** or when the user asks to skip, go directly to the main output. |
| 6 | |
| 7 | ## Initial Assessment |
| 8 | |
| 9 | **Check for project context first:** If `.claude/project-context.md` or `.cursor/project-context.md` exists, read it for content structure. |
| 10 | |
| 11 | Identify: |
| 12 | 1. **Content type**: Blog article, guide, whitepaper, documentation |
| 13 | 2. **Length**: TOC most valuable for 1000+ word content |
| 14 | 3. **Platform**: Web, mobile, both |
| 15 | |
| 16 | ## Placement Strategies |
| 17 | |
| 18 | | Placement | Best For | Pros | Cons | |
| 19 | |-----------|----------|------|------| |
| 20 | | **After intro** | Most articles | Natural flow; visible early | Can scroll out of view | |
| 21 | | **Floating sidebar** | Very long content | Always visible | More complex; mobile challenges | |
| 22 | | **Collapsible** | Long articles | Less intrusive | May be overlooked | |
| 23 | | **Top of article** | Mobile-first | Accessible on all devices | Takes space | |
| 24 | |
| 25 | ## Technical Implementation |
| 26 | |
| 27 | ### Heading Structure |
| 28 | |
| 29 | - One `<h1>` per page |
| 30 | - `<h2>` for major sections |
| 31 | - `<h3>` for subsections; avoid skipping levels |
| 32 | - Headings >=15 characters for SEO |
| 33 | |
| 34 | ### Jump Links |
| 35 | |
| 36 | - Assign unique IDs to headings (e.g., `id="keyword-optimization"`) |
| 37 | - Use kebab-case for IDs |
| 38 | - Link TOC entries via anchor tags (`#section-id`) |
| 39 | - Descriptive anchor text; include target keywords naturally |
| 40 | |
| 41 | ### Semantic HTML |
| 42 | |
| 43 | ```html |
| 44 | <nav aria-label="Table of contents"> |
| 45 | <ol> |
| 46 | <li><a href="#section-1">Section Title</a></li> |
| 47 | </ol> |
| 48 | </nav> |
| 49 | ``` |
| 50 | |
| 51 | ## SEO Best Practices |
| 52 | |
| 53 | | Practice | Purpose | |
| 54 | |----------|---------| |
| 55 | | **Schema.org TableOfContents** | Help search engines understand structure | |
| 56 | | **Keywords in headings** | Natural integration; avoid stuffing | |
| 57 | | **Jump links in SERP** | Google may feature TOC links; increases CTR; see **serp-features** | |
| 58 | |
| 59 | ## UX Guidelines |
| 60 | |
| 61 | ### Visibility & Interaction |
| 62 | |
| 63 | - Clear visual hierarchy; indent nested items |
| 64 | - Highlight current section when scrolling (optional) |
| 65 | - Smooth scroll behavior for jump links |
| 66 | |
| 67 | ### Mobile |
| 68 | |
| 69 | - Minimum 16px font size |
| 70 | - Touch targets >=44x44px |
| 71 | - Responsive layout; consider collapsible on small screens |
| 72 | |
| 73 | ### Accessibility |
| 74 | |
| 75 | | Requirement | Practice | |
| 76 | |-------------|----------| |
| 77 | | **ARIA** | `aria-label="Table of contents"` on nav | |
| 78 | | **Keyboard** | All links keyboard-accessible | |
| 79 | | **Screen readers** | Proper heading structure; TOC aids skimming | |
| 80 | |
| 81 | ## Output Format |
| 82 | |
| 83 | - **TOC structure** (sections, nesting) |
| 84 | - **Heading/ID mapping** suggestions |
| 85 | - **HTML/ARIA** notes |
| 86 | - **SEO** checklist |
| 87 | |
| 88 | ## Related Skills |
| 89 | |
| 90 | - **tab-accordion**: Collapsible TOC uses same disclosure pattern; details/summary implementation |
| 91 | - **heading-structure**: TOC built from heading structure |
| 92 | - **content-optimization**: H2 structure, lists, tables for Featured Snippets |
| 93 | - **featured-snippet**: Featured Snippet optimization; TOC supports snippet structure |
| 94 | - **serp-features**: SERP features; jump links in results |
| 95 | - **article-page-generator**: TOC common in long-form article pages |