Receber por email
← Voltar para o catálogo

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.

367estrelas
Atualizado há 4 meses

Ver no GitHub ↗

Como adicionar

/plugin marketplace add aiskillstore/marketplace

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/ai-chapter-consolidate/svg)](https://www.skillteca.com.br/skills/ai-chapter-consolidate)
#ai

Skills relacionadas

Ver todas de Segurança →

Alerta por categoria

Receba novas skills de Segurança toda segunda

1 email curto, só com as skills novas de Segurança. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

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
  2. Gather 04_page_XX.html files for all pages in chapter
  3. Verify all files exist and are valid
  4. Sort by page number (ascending)
  1. Extract content from each page
  2. Load each HTML file
  3. Extract main content from <main class="page-content">
  4. Preserve semantic classes and structure
  1. Prepare consolidation inputs for AI
  2. Page 1: Full content including chapter header
  3. Pages 2+: Extract content sections, remove chapter header/nav
  4. Preserve all text and structure
  5. Note any special sections (exhibits, tables, etc.)
  1. Invoke AI consolidation
  2. Send all page contents to Claude
  3. Request merging into single continuous document
  4. Specify structural requirements
  5. Request heading hierarchy normalization
  1. Process AI output
  2. Extract consolidated HTML from response
  3. Verify structure integrity
  4. Ensure all pages represented
  5. Check heading hierarchy
  1. Save consolidated document
  2. Save to: output/chapter_XX/chapter_artifacts/chapter_XX.html
  3. Create metadata/log file
  4. Calculate statistics

Input Files

Per-page HTML files (validated by previous gate):

  • output/chapter_XX/page_artifacts/page_16/04_page_16.html (Chapter opening)
  • output/chapter_XX/page_artifacts/page_17/04_page_17.html (Continuation)
  • output/chapter_XX/page_artifacts/page_18/04_page_18.html (Continuation)
  • ... (all pages in chapter)

Chapter metadata (from analysis):

  • Page range (first and last page of chapter)
  • Chapter number
  • Chapter title
  • Expected page count

AI Consolidation Prompt

The prompt sent to Claude:

You are merging individual page HTML documents into a single, continuous chapter.

INPUT PAGES:

Page 1 (Opening - include chapter header):
[HTML content from page 1]

Page 2 (Continuation):
[HTML content from page 2]

Page 3 (Continuation):
[HTML content from page 3]

... (all pages)

TASK:
Merge these pages into a single HTML document that reads as one continuous chapter.

REQUIREMENTS:

1. Structure:
   - Create single <div class="page-container"> wrapping everything
   - Create single <main class="page-content"> for all content
   - Remove page-break indicators or comments
   - Create truly continuous document (no paginated elements)

2. Chapter Header:
   - Keep chapter header from Page 1 (chapter number, title)
   - Remove chapter headers/titles from continuation pages
   - Keep section navigation if present on Page 1
   - Remove duplicate navigation from other pages

3. Content Preservation:
   - Include ALL text content from all pages
   - Preserve exact wording (no paraphrasing)
   - Maintain all lists, paragraphs, tables
   - Include all semantic classes
   - Keep all HTML structure

4. Heading Hierarchy:
   - Normalize heading levels across merged pages
   - Page 1 h1 = Chapter title (stays as h1)
   - First section in each page = h2 (main sections)
   - Sub-sections = h3 or h4 as needed
   - Ensure no hierarchy jumps (h1 → h3 without h2)
   - Number consecutive headings logically

5. Content Flow:
   - Remove page-specific headers/footers
   - Merge seamlessly so content flows naturally
   - No artificial breaks or transitions
   - Paragraphs continue logically
   - Lists maintain coherence

6. Exhibits and Images:
   - Preserve all tables and figures
   - Keep exhibit titles and captions
   - Include all images with proper paths
   - Maintain table of contents if present

7. CSS Classes:
   - Preserve all semantic classes (section-heading, paragraph, etc.)
   - Keep consistent class usage throughout
   - Ensure classes match chapter opening page style
   - Do not add or remove classes

8. Metadata:
   - Include title tag: "Chapter N: Title - Pages X-Y"
   - Keep meta charset and viewport
   - Link stylesheet: <link rel="stylesheet" href="../../styles/main.css">

OUTPUT:

Return ONLY a single, valid HTML5 document:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Chapter [N]: [Title] - Pages [X-Y]</title> <link rel="stylesheet" href="../../styles/main.css"> </head> <body> <div class="page-container"> <main class="page-content"> <!-- All content from all pages, merged seamlessly --> </main> </div> </body> </html>


VALIDATION:
- Single HTML5 document
- All pages represented
- No page breaks or transitions
- Proper heading hierarchy
- All text preserved

Page Content Extraction Logic

Before sending to AI, extract content strategically:

Page 1 (Opening):

  • Include: Entire page HTML content
  • Reason: Contains chapter header, navigation, first section
  • Preserve: All elements (header, nav, dividers, content)

Pages 2-N (Continuation):

  • Extract: Only content after chapter header
  • Skip: Chapter number, chapter title, section navigation
  • Preserve: Section headings, paragraphs, lists, exhibits
  • Include: All semantic content sections

Example extraction:

<!-- Page 1: Keep everything -->
<div class="chapter-header">
    <span class="chapter-number">2</span>
    <h1 class="chapter-title">Rights in Real Estate</h1>
</div>
<nav class="section-navigation">...</nav>
<h2 class="section-heading">REAL PROPERTY RIGHTS</h2>
<p class="paragraph">...</p>

<!-- Page 2: Skip header, keep content -->
<!-- <div class="chapter-header">...</div> SKIPPED -->
<!-- <nav class="section-navigation">...</nav> SKIPPED -->
<h4 class="subsection-heading">Physical characteristics.</h4>
<p class="paragraph">...</p>
<ul class="bullet-list">...</ul>

<!-- Page 3: Continue same pattern -->
<h4 class="subsection-heading">Interdependence.</h4>
<p class="paragraph">...</p>

Output File

Consolidated Chapter HTML

Path: output/chapter_XX/chapter_artifacts/chapter_XX.html

Structure:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Chapter 2: Rights in Real Estate - Pages 16-29</title>
    <link rel="stylesheet" href="../../styles/main.css">
</head>
<body>
    <div class="page-container">
        <main class="page-content">
            <!-- Chapter header (from page 1) -->
            <div class="chapter-header">...</div>
            <nav class="section-navigation">...</nav>
            <hr class="section-divider">

            <!-- Page 1 content -->
            <h2 class="section-heading">REAL PROPERTY RIGHTS</h2>
            <p class="paragraph">...</p>

            <!-- Page 2 content (seamlessly merged) -->
            <h4 class="subsection-heading">Physical characteristics.</h4>
            <p class="paragraph">...</p>
            <ul class="bullet-list">...</ul>

            <!-- Page 3 content (continuing flow) -->
            <h4 class="subsection-heading">Interdependence.</h4>
            <p class="paragraph">...</p>

            <!-- ... more content from remaining pages ... -->

            <!-- Final page content -->
            <h2 class="section-heading">REGULATIONS AND LICENSING</h2>
            <p class="paragraph">...</p>
        </main>
    </div>
</body>
</html>

Consolidation Log

Path: output/chapter_XX/chapter_artifacts/consolidation_log.json

{
  "chapter": 2,
  "title": "Rights
Compartilhar X LinkedIn