Agent skill · writing content · aiskillstore
ai-chapter-consolidate
Use AI to merge individual page HTML files into a unified chapter document. Creates continuous document format for improved reading experience and semantic consistency.
Why this skill is useful
Adds a specific AI-driven workflow for merging HTML documents that optimizes content structure and flow, which the AI wouldn't reliably generate on its own.
What it needs
Requires claude account access. About 6k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
AI Chapter Consolidate Skill Purpose This skill uses AI to intelligently merge individual page HTML files into a single, continuous chapter document. Rather than simple concatenation, the AI: Removes duplicate headers/footers from continuation pages Ensures consistent heading hierarchy across pages Maintains semantic structure throughout Preserves all content without loss or repetition Creates smooth content flow (no page breaks) The result is a unified chapter document in the continuous format (single page-container, single page-content). What to Do 1. Collect all page HTML files for chapter Gather 04pageXX.html files for all pages in chapter Verify all files exist and are valid Sort by page number (ascending) 2. Extract content from each page Load each HTML file Extract main content from <main class="page-content"> Preserve semantic classes and structure 3. Prepare consolidation inputs for AI Page 1: Full content including chapter header Pages 2+: Extract content sections, remove chapter header/nav Preserve all text and structure Note any special sections (exhibits, tables, etc.) 4. Invoke AI consolidation Send all page contents to Claude Request merging into single continuous document Specify structural requirements Request heading hierarchy normalization 5. Process AI output Extract consolidated HTML from response Verify structure integrity Ensure all pages represented Check heading hierarchy 6. Save consolidated document Save to: output/chapterXX/chapterartifacts/chapterXX.html Create metadata/log file Calculate statistics Input Files Per-page HTML files (validated by previous gate): output/chapterXX/pageartifacts/page16/04page16.html (Chapter opening) output/chapterXX/pageartifacts/page17/04page17.html (Continuation) output/chapterXX/pageartifacts/page18/04page18.html (Continuation) ... …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/ai-chapter-consolidate