Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use AI to create ASCII text-based preview of PDF page layout. Transforms visual and extracted data into structured ASCII representation for HTML generation.
.claude/skills/aiskillstore-ascii-preview-generate/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-16 | ✗→✓ | ▲ Improved | 116% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 112% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 117% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 195% | 0% |
This skill uses AI to create a meaningful ASCII text-based representation of the PDF page layout. The AI:
The ASCII preview serves as a structured representation of page layout, enabling the downstream AI-HTML generator to understand both visual layout and content structure.
02_page_XX.png (visual reference)01_rich_extraction.json (text spans with metadata)output/chapter_XX/page_artifacts/page_YY/03_page_XX_ascii.txtrich_extraction_file: <str> - Path to 01_rich_extraction.json
page_png: <str> - Path to 02_page_XX.png (optional, for visual validation)
output_file: <str> - Path to save ASCII preview
book_page: <int> - Book page number (for display)
chapter: <int> - Chapter number (for display)The ASCII preview uses this structure:
================================================================================
PAGE XX ASCII LAYOUT PREVIEW
================================================================================
Book Page: YY | Chapter: Z | PDF Index: XX | Dimensions: 612x792px
--------------------------------------------------------------------------------
[PAGE CONTENT WITH ASCII ART AND ANNOTATIONS]
STRUCTURE SUMMARY:
[Element counts and types]
================================================================================================================================================================
PAGE 16 ASCII LAYOUT PREVIEW
================================================================================
Book Page: 17 | Chapter: 2 | PDF Index: 16 | Dimensions: 612x792px
--------------------------------------------------------------------------------
┌─────────────────────────────────────────────────────────────────────────┐
│ │
│ [H1 Heading - 27pt Bold] │
│ ████████████████████████████████ │
│ █ Rights in Real Estate █ │
│ ████████████████████████████████ │
│ │
│ ───────────────────────────────────────────────────────────────── │
│ [Divider] │
│ │
│ [H2 Section Heading - 11pt Bold All-Caps] │
│ REAL PROPERTY RIGHTS │
│ │
│ [Paragraph 1 - 11pt Regular] │
│ Real property consists of physical land and the legal rights │
│ associated with ownership. These rights form what is commonly │
│ referred to as the "bundle of rights." │
│ │
│ [H4 Subsection - 11pt Bold] │
│ Physical characteristics. │
│ │
│ [Paragraph 2 - 11pt Regular] │
│ Land has unique physical characteristics that distinguish it from │
│ other types of assets. The most important characteristics include: │
│ │
│ [Bullet List - 3 items] │
│ ▶ Immobility - Land cannot be moved from one location to │
│ another. This fact has significant legal and economic │
│ implications. │
│ ▶ Indestructibility - Land is permanent and cannot be │
│ destroyed. Although structures on land can be destroyed, │
│ the land itself endures. │
│ ▶ Uniqueness - Each parcel of land is unique due to its │
│ location. "Not two parcels of land are exactly alike due to │
│ their geographic location." │
│ │
│ [H4 Subsection - 11pt Bold] │
│ Interdependence. │
│ │
│ [Paragraph 3 - 11pt Regular] │
│ All land exists in relation to other land. Therefore, the value │
│ of land is dependent on the land around it... │
│ │
└─────────────────────────────────────────────────────────────────────────┘
STRUCTURE SUMMARY:
─────────────────
Page Type: Chapter Continuation
Total Elements: 12
Headings (3):
• H1: 1 instance (27pt, bold) - "Rights in Real Estate"
• H2: 1 instance (11pt, bold, all-caps) - "REAL PROPERTY RIGHTS"
• H4: 2 instances (11pt, bold) - "Physical characteristics", "Interdependence"
Paragraphs (3):
• Body text: 3 paragraphs total
• Average paragraph length: ~45 words
• Text flow: Top to bottom, left to right
Lists (1):
• Bullet list with 3 items
• Indentation: 2em from left margin
• Separator: "▶" character
Tables: 0
Images: 0
Font Summary:
• 27pt: 1 instance (heading)
• 11pt: 7 instances (body, subsections, lists)
• Total unique fonts: 2 (Arial-Bold, Times-Regular)
Confidence Assessment:
• Heading hierarchy: 100% confident
• Element types: 95% confident
• Content flow: 90% confident
• (Lower confidence = ambiguous or unusual formatting)
================================================================================The prompt sent to Claude to generate ASCII preview:
You are creating an ASCII text-based layout preview of a PDF page.
VISUAL REFERENCE (PDF Page):
[PNG Image Attached]
EXTRACTED TEXT DATA:
[JSON Attached]
TASK:
Generate an ASCII text representation of this page's layout and structure.
REQUIREMENTS:
1. ASCII Format:
- Use box drawing characters for visual clarity (┌─┐│└┘)
- Show page boundaries
- Use spacing to represent actual layout
2. Element Representation:
- Headings: Show in ASCII, mark with [H1], [H2], [H3], [H4]
- Paragraphs: Show first line, indicate continuation
- Lists: Use ▶ or • characters, maintain structure
- Tables: Show column alignment and structure
- Spacing: Represent actual gaps between elements
3. Annotations:
- Label each element type [Heading], [Paragraph], [List], etc.
- Show font size context (11pt, 27pt, etc.)
- Note text styling (Bold, All-Caps, etc.)
4. Summary Statistics:
- Count headings by level (h1, h2, h3, h4)
- Count paragraphs
- Count lists and items
- Note any tables or images
5. Readability:
- Keep lines under 80 characters
- Use clear visual separation
- Make structure obvious at a glance
OUTPUT:
================================================================================ PAGE XX ASCII LAYOUT PREVIEW ================================================================================ Book Page: YY | Chapter: Z | PDF Index: XX
ASCII representation with visual structure]
STRUCTURE SUMMARY: Element counts and types] ================================================================================
VALIDATION:
- ASCII must be readable text
- All major content elements must be represented
- Structure must be clear and logical
- Total elements count must match data02_page_XX.png - Visual reference01_rich_extraction.json - Text spans with metadataoutput/chapter_XX/page_artifacts/page_YY/03_page_XX_ascii.txtBefore declaring ASCII preview complete:
json{ "preview_file": "03_page_16_ascii.txt", "page": 16, "book_page": 17, "chapter": 2, "generated_at": "2025-11-08T14:31:00Z", "source_file": "01_rich_extraction.json", "elements_detected": { "headings": 4, "paragraphs": 3, "lists": 1, "tables": 0, "images": 0 }, "confidence_scores": { "overall": 0.93, "heading_hierarchy": 1.0, "element_types": 0.95, "content_flow": 0.90 } }
The ASCII preview is used by Skill 3 (ai-html-generate) as one of three inputs:
02_page_XX.png - Visual reference (pixel data)01_rich_extraction.json - Parsed text with metadata03_page_XX_ascii.txt - Structural representation ← This skill createsTogether, these three inputs give the AI complete context for accurate HTML generation.
If PNG image fails to load:
If rich_extraction.json is invalid:
If AI response is not valid text:
If ASCII structure seems incomplete:
✓ ASCII preview file created successfully ✓ File contains all page elements in structured format ✓ Heading hierarchy is clear and logical ✓ All text content included and readable ✓ Summary statistics accurate ✓ File is well-formatted and unambiguous ✓ Ready for AI HTML generation with complete context
Once ASCII preview is complete:
ASCII preview is incomplete: Check source rich_extraction.json has all text spans Heading hierarchy looks wrong: Verify font sizes in extraction data Lists not detected: Check for bullet character encoding issues Spacing is off: Ensure coordinate system matches PDF (top-left origin)
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-16 | fail→pass | 15,625 | 15,347 | -2% | 1 | 1 | 0% | 2,543 | 5,486 | +116% | 0 | 0 | — |
case-17 | fail→pass | 12,583 | 6,316 | -50% | 1 | 1 | 0% | 1,963 | 4,155 | +112% | 0 | 0 | — |
case-01 | fail→pass | 17,950 | 8,472 | -53% | 1 | 1 | 0% | 3,545 | 4,950 | +40% | 0 | 0 | — |
case-02 | fail→pass | 13,758 | 12,578 | -9% | 1 | 1 | 0% | 2,489 | 5,410 | +117% | 0 | 0 | — |
case-03 | fail→fail | 15,230 | 10,433 | -31% | 1 | 1 | 0% | 2,806 | 5,042 | +80% | 0 | 0 | — |
case-04 | pass→pass | 11,316 | 6,681 | -41% | 1 | 1 | 0% | 1,872 | 4,254 | +127% | 0 | 0 | — |
case-05 | fail→pass | 9,845 | 7,863 | -20% | 1 | 1 | 0% | 1,518 | 4,471 | +195% | 0 | 0 | — |
case-06 | pass→pass | 8,841 | 5,671 | -36% | 1 | 1 | 0% | 1,604 | 4,123 | +157% | 0 | 0 | — |
case-07 | fail→pass | 9,244 | 6,813 | -26% | 1 | 1 | 0% | 1,731 | 4,534 | +162% | 0 | 0 | — |
case-08 | pass→pass | 7,946 | 5,901 | -26% | 1 | 1 | 0% | 1,428 | 4,156 | +191% | 0 | 0 | — |
case-09 | fail→fail | 16,004 | 11,806 | -26% | 1 | 1 | 0% | 2,460 | 5,018 | +104% | 0 | 0 | — |
case-10 | fail→pass | 21,181 | 8,629 | -59% | 1 | 1 | 0% | 3,422 | 4,554 | +33% | 0 | 0 | — |
case-11 | fail→fail | 24,497 | 8,345 | -66% | 1 | 1 | 0% | 1,471 | 4,601 | +213% | 0 | 0 | — |
case-12 | fail→pass | 9,111 | 4,284 | -53% | 1 | 1 | 0% | 1,393 | 3,907 | +180% | 0 | 0 | — |
case-13 | pass→pass | 11,537 | 6,300 | -45% | 1 | 1 | 0% | 1,847 | 4,028 | +118% | 0 | 0 | — |
case-14 | fail→pass | 10,673 | 9,775 | -8% | 1 | 1 | 0% | 1,778 | 4,809 | +170% | 0 | 0 | — |
case-15 | fail→pass | 17,866 | 8,944 | -50% | 1 | 1 | 0% | 2,794 | 4,515 | +62% | 0 | 0 | — |
case-18 | fail→pass | 10,933 | 2,771 | -75% | 1 | 1 | 0% | 1,912 | 3,537 | +85% | 0 | 0 | — |
case-19 | pass→pass | 17,132 | 8,893 | -48% | 1 | 1 | 0% | 2,735 | 4,560 | +67% | 0 | 0 | — |
case-20 | fail→fail | 14,710 | 7,313 | -50% | 1 | 1 | 0% | 2,956 | 4,711 | +59% | 0 | 0 | — |
case-21 | fail→fail | 14,154 | 18,346 | +30% | 1 | 1 | 0% | 2,882 | 7,311 | +154% | 0 | 0 | — |
case-22 | fail→fail | 29,017 | 28,096 | -3% | 1 | 1 | 0% | 6,033 | 9,268 | +54% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +50 percentage points is the difference between those two pass rates over the 21 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.