[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EJSGAC48S56QH7FJYPSTK6":3,"skill-same:01M6EJSGAC48S56QH7FJYPSTK6":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":46,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M6EJSGAC48S56QH7FJYPSTK6","html-structure-validate",null,"Validate HTML5 structure and basic syntax. BLOCKING quality gate - stops pipeline if validation fails. Ensures deterministic output quality.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fabejitsu\u002Fhtml-structure-validate\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35],"validate","html","structure","html structure validate","quality gate","validation","pipeline","quality","syntax","gate","deterministic","basic","2026-11-10 10:12:30",false,"---\nname: html-structure-validate\ndescription: Validate HTML5 structure and basic syntax. BLOCKING quality gate - stops pipeline if validation fails. Ensures deterministic output quality.\n---\n\n# HTML Structure Validate Skill\n\n## Purpose\n\nThis skill is a **BLOCKING quality gate** that ensures generated HTML meets minimum structural requirements. It is the **first deterministic validation** of probabilistic AI-generated output.\n\nThe skill checks:\n- **HTML5 compliance** - Proper DOCTYPE, tags\n- **Tag closure** - All tags properly closed\n- **Required elements** - Meta tags, stylesheet links\n- **Well-formedness** - Valid structure\n\nIf validation fails, the pipeline **STOPS** and triggers a hook to notify the user.\n\nThis enforces the principle: **Python validates, ensuring deterministic quality**.\n\n## What to Do\n\n1. **Load HTML file to validate**\n   - Read `04_page_XX.html` generated by AI skill\n   - Verify file exists and is readable\n   - Confirm file is text (not binary)\n\n2. **Run validation checks**\n   - Check HTML5 structure compliance\n   - Verify tag closure\n   - Validate head section\n   - Check required CSS link\n   - Validate page container structure\n\n3. **Generate validation report**\n   - Document all checks performed\n   - List any errors found\n   - Note warnings (non-blocking)\n   - Record informational findings\n\n4. **Save validation report** as JSON\n   - Save to: `output\u002Fchapter_XX\u002Fpage_artifacts\u002Fpage_YY\u002F06_validation_structure.json`\n   - Include timestamp\n   - Include all check results\n\n5. **Exit with appropriate code**\n   - Return 0 if VALID (continue pipeline)\n   - Return 1 if INVALID (STOP pipeline, trigger hook)\n\n## Input Parameters\n\n```\nhtml_file: \u003Cstr>         - Path to 04_page_XX.html\noutput_dir: \u003Cstr>        - Directory for validation report\nstrict_mode: \u003Cbool>      - If true, warnings also fail (default: false)\npage_number: \u003Cint>       - Page number (for reporting)\nchapter: \u003Cint>           - Chapter number (for reporting)\n```\n\n## Validation Checks\n\n### Check 1: DOCTYPE Declaration\n\n**Requirement**: File must start with proper DOCTYPE\n```html\n\u003C!DOCTYPE html>\n```\n\n**Check**:\n- [ ] File contains `\u003C!DOCTYPE html>` (case-insensitive)\n- [ ] DOCTYPE appears before any tags\n- [ ] DOCTYPE is on first line or near beginning\n\n**Error if**: Missing or incorrect DOCTYPE\n\n### Check 2: HTML Tags\n\n**Requirement**: Proper `\u003Chtml>` opening and closing tags\n```html\n\u003Chtml lang=\"en\">\n    ...\n\u003C\u002Fhtml>\n```\n\n**Checks**:\n- [ ] `\u003Chtml>` tag present\n- [ ] `\u003C\u002Fhtml>` closing tag present\n- [ ] Tags are properly paired\n- [ ] No unclosed `\u003Chtml>` tags\n\n**Error if**: Missing either tag or improperly paired\n\n### Check 3: Head Section\n\n**Requirement**: Complete `\u003Chead>` section with metadata\n```html\n\u003Chead>\n    \u003Cmeta charset=\"UTF-8\">\n    \u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    \u003Ctitle>...\u003C\u002Ftitle>\n    \u003Clink rel=\"stylesheet\" href=\"..\u002F..\u002Fstyles\u002Fmain.css\">\n\u003C\u002Fhead>\n```\n\n**Checks**:\n- [ ] `\u003Chead>` and `\u003C\u002Fhead>` tags present\n- [ ] `\u003Cmeta charset=\"UTF-8\">` present\n- [ ] `\u003Cmeta name=\"viewport\">` present (warning if missing)\n- [ ] `\u003Ctitle>` tag with content present\n- [ ] CSS `\u003Clink>` tag present with href attribute\n\n**Error if**: Missing charset, title, or CSS link\n**Warning if**: Missing viewport meta tag\n\n### Check 4: Body Section\n\n**Requirement**: Proper `\u003Cbody>` tags with content\n```html\n\u003Cbody>\n    \u003Cdiv class=\"page-container\">\n        \u003Cmain class=\"page-content\">\n            ...\n        \u003C\u002Fmain>\n    \u003C\u002Fdiv>\n\u003C\u002Fbody>\n```\n\n**Checks**:\n- [ ] `\u003Cbody>` and `\u003C\u002Fbody>` tags present\n- [ ] `\u003Cdiv class=\"page-container\">` present\n- [ ] `\u003Cmain class=\"page-content\">` present inside container\n- [ ] Body contains substantial content (> 100 bytes)\n\n**Error if**: Missing tags or required container divs\n\n### Check 5: Tag Closure Validation\n\n**Requirement**: All tags must be properly closed\n\n**Checks for**:\n- Unmatched opening tags (e.g., `\u003Cp>` without `\u003C\u002Fp>`)\n- Improper nesting (e.g., `\u003Cp>\u003Ch2>text\u003C\u002Fh2>\u003C\u002Fp>`)\n- Self-closing tags used correctly (e.g., `\u003Cbr\u002F>`, `\u003Cimg\u002F>`)\n- Comment blocks properly formatted (`\u003C!-- -->`)\n\n**Validation method**:\n- Parse HTML into tree structure\n- Verify all nodes properly matched\n- Check nesting doesn't violate HTML5 rules\n\n**Error if**: Any unmatched or improperly nested tags\n\n### Check 6: Heading Tags (h1-h6)\n\n**Requirement**: Valid heading hierarchy\n```html\n\u003Ch1>Chapter Title\u003C\u002Fh1>\n\u003Ch2>Section Heading\u003C\u002Fh2>\n\u003Ch3>Subsection\u003C\u002Fh3>\n```\n\n**Checks**:\n- [ ] All heading tags properly closed\n- [ ] First heading should be h1 (warning if not)\n- [ ] Heading levels don't skip dramatically (h1 → h4 is suspicious)\n- [ ] All headings have text content (not empty)\n\n**Error if**: Heading tags improperly closed\n**Warning if**: Suspicious hierarchy\n\n### Check 7: Content Structure\n\n**Requirement**: Meaningful content in page container\n\n**Checks**:\n- [ ] `\u003Cmain class=\"page-content\">` contains elements\n- [ ] Content includes headings or paragraphs\n- [ ] No completely empty content area\n- [ ] Text nodes or elements present (> 100 words total)\n\n**Error if**: No content or empty structure\n\n### Check 8: List Integrity\n\n**Requirement**: All lists properly structured\n\n**Checks** for each `\u003Cul>` or `\u003Col>`:\n- [ ] List opening and closing tags matched\n- [ ] List contains `\u003Cli>` elements\n- [ ] All `\u003Cli>` tags properly closed\n- [ ] `\u003Cli>` count matches opening\u002Fclosing pairs\n- [ ] No nested `\u003Cul>` or `\u003Col>` improperly closed\n\n**Error if**: Empty lists or unmatched `\u003Cli>` tags\n\n### Check 9: Image and Link Tags\n\n**Requirement**: Self-closing tags properly formatted\n\n**Checks**:\n- [ ] All `\u003Cimg>` tags have `src` and `alt` attributes\n- [ ] All `\u003Ca>` tags have valid `href` attributes\n- [ ] Image paths don't have obvious errors (no broken syntax)\n- [ ] Self-closing tags use proper syntax\n\n**Warning if**: Images missing alt text or links missing href\n\n### Check 10: Table Tags (if present)\n\n**Requirement**: Proper table structure\n\n**Checks**:\n- [ ] `\u003Ctable>`, `\u003Ctr>`, `\u003Ctd>`, `\u003Cth>` tags properly nested\n- [ ] All rows have consistent column counts\n- [ ] Table headers and body properly structured\n\n**Error if**: Malformed table structure\n\n## Validation Report Format\n\n### Output: `06_validation_structure.json`\n\n```json\n{\n  \"page\": 16,\n  \"book_page\": 17,\n  \"chapter\": 2,\n  \"validation_type\": \"structure\",\n  \"validation_timestamp\": \"2025-11-08T14:34:00Z\",\n  \"overall_status\": \"PASS\",\n  \"error_count\": 0,\n  \"warning_count\": 1,\n  \"checks_performed\": [\n    {\n      \"check_name\": \"DOCTYPE Declaration\",\n      \"status\": \"PASS\",\n      \"details\": \"Valid HTML5 DOCTYPE found\"\n    },\n    {\n      \"check_name\": \"HTML Tags\",\n      \"status\": \"PASS\",\n      \"details\": \"Proper \u003Chtml> opening and closing tags\"\n    },\n    {\n      \"check_name\": \"Head Section\",\n      \"status\": \"PASS\",\n      \"details\": \"All required meta tags and title present\"\n    },\n    {\n      \"check_name\": \"Body Section\",\n      \"status\": \"PASS\",\n      \"details\": \"Body and content structure valid\"\n    },\n    {\n      \"check_name\": \"Tag Closure\",\n      \"status\": \"PASS\",\n      \"details\": \"All tags properly matched and closed\"\n    },\n    {\n      \"check_name\": \"Heading Hierarchy\",\n      \"status\": \"PASS\",\n      \"details\": \"4 headings found, proper h1-h4 hierarchy\"\n    },\n    {\n      \"check_name\": \"Content Structure\",\n      \"status\": \"PASS\",\n      \"details\": \"Main content area contains 245 words across 3 paragraphs\"\n    },\n    {\n      \"check_name\": \"List Integrity\",\n      \"status\": \"PASS\",\n      \"details\": \"1 list with 3 items, all properly formed\"\n    },\n    {\n      \"check_name\": \"Image Tags\",\n      \"status\": \"PASS\",\n      \"details\": \"No images on this page\"\n    },\n    {\n      \"check_name\": \"Table Tags\",\n      \"status\": \"PASS\",\n      \"details\": \"No tables on this page\"\n    }\n  ],\n  \"errors\": [],\n  \"warnings\": [\n    {\n      \"check\": \"Heading Hierarchy\",\n      \"message\": \"First heading is h2, typically should be h1 for page opening\",\n      \"severity\": \"LOW\"\n    }\n  ],\n  \"summary\": {\n    \"total_checks\": 10,\n    \"passed\": 9,\n    \"failed\": 0,\n    \"warnings\": 1,\n    \"html_valid\": true,\n    \"tags_matched\": true,\n    \"content_substantial\": true\n  }\n}\n```\n\n## Validation Rules\n\n### PASS Criteria\n- DOCTYPE present and valid\n- All required tags (`html`, `head`, `body`, `main`, `div.page-container`) present\n- All tags properly closed and matched\n- Title tag with content\n- CSS stylesheet link present\n- Content structure valid\n- No structural errors\n\n### FAIL Criteria (BLOCKS PIPELINE)\n- Missing DOCTYPE\n- Missing required tags\n- Unmatched or improperly nested tags\n- Missing title or CSS link\n- Empty content\n- Malformed lists or tables\n\n### WARNING (Logged but doesn't block)\n- Missing viewport meta tag\n- First heading is not h1\n- Large heading jumps (h1 → h4)\n- Missing alt text on images\n- Missing href on links\n\n## Implementation: Using Python Script\n\nThis validation is performed by existing `validate_html.py` tool, run in **structure validation mode**:\n\n```bash\ncd Calypso\u002Ftools\n\n# Validate single page HTML\npython3 validate_html.py \\\n  ..\u002Foutput\u002Fchapter_02\u002Fpage_artifacts\u002Fpage_16\u002F04_page_16.html \\\n  --output-json ..\u002Foutput\u002Fchapter_02\u002Fpage_artifacts\u002Fpage_16\u002F06_validation_structure.json \\\n  --strict-structure\n\n# Exit code:\n# 0 = VALID (continue to next skill)\n# 1 = INVALID (STOP pipeline)\n```\n\n## Hook Integration\n\nWhen validation **FAILS**:\n\n```bash\n# Trigger hook: .claude\u002Fhooks\u002Fvalidate-structure.sh\n# Receives:\n#   - Page number\n#   - HTML file path\n#   - Validation report path\n#   - Error details\n\n# Hook behavior:\n# - Log failure with details\n# - Save error report\n# - Notify user\n# - STOP pipeline (no further processing)\n```\n\n## Error Recovery\n\n**If validation fails**:\n1. User reviews validation report\n2. User identifies issue in AI-generated HTML\n3. Options:\n   - Fix HTML manually and re-validate\n   - Re-run AI generation with improved prompt\n   - Review source extraction data for errors\n   - Proceed with caution (expert override)\n\n## Quality Metrics\n\nValidation provides metrics:\n- Percentage of checks passing\n- Error severity levels\n- Content size (word count, element count)\n- Structure complexity\n\nThese metrics feed into final quality reports.\n\n## Success Criteria\n\n✓ Validation completes successfully\n✓ All structural checks pass (0 errors)\n✓ Validation report saved in JSON format\n✓ Exit code 0 returned (or 1 if invalid)\n✓ Clear error messages if validation fails\n\n## Next Steps After PASS\n\nIf validation passes:\n1. All pages of chapter processed through this gate\n2. **Skill 4** (consolidate pages) merges individual page HTMLs\n3. **Quality Gate 2** (semantic validate) checks semantic structure\n4. Continue through validation pipeline\n\n## Next Steps After FAIL\n\nIf validation fails:\n1. **PIPELINE STOPS**\n2. Hook `validate-structure.sh` triggered\n3. User receives error report with details\n4. User must fix issues and retry\n\n## Design Notes\n\n- This is the **first deterministic quality gate**\n- Uses proven `validate_html.py` tool\n- Catches structural issues before semantic analysis\n- Provides clear, actionable error messages\n- Essential for ensuring pipeline reliability\n\n## Testing\n\nTo test structure validation:\n\n```bash\n# Test with known-good HTML\npython3 validate_html.py ..\u002Foutput\u002Fchapter_01\u002Fchapter_01.html\n\n# Should show: ✓ VALID\n\n# Test with invalid HTML (if needed)\npython3 validate_html.py broken_html.html\n\n# Should show: ✗ INVALID with specific errors\n```\n","# HTML Structure Validate Skill\n\n## Purpose\n\nThis skill is a **BLOCKING quality gate** that ensures generated HTML meets minimum structural requirements. It is the **first deterministic validation** of probabilistic AI-generated output.\n\nThe skill checks:\n- **HTML5 compliance** - Proper DOCTYPE, tags\n- **Tag closure** - All tags properly closed\n- **Required elements** - Meta tags, stylesheet links\n- **Well-formedness** - Valid structure\n\nIf validation fails, the pipeline **STOPS** and triggers a hook to notify the user.\n\nThis enforces the principle: **Python validates, ensuring deterministic quality**.\n\n## What to Do\n\n1. **Load HTML file to validate**\n   - Read `04_page_XX.html` generated by AI skill\n   - Verify file exists and is readable\n   - Confirm file is text (not binary)\n\n2. **Run validation checks**\n   - Check HTML5 structure compliance\n   - Verify tag closure\n   - Validate head section\n   - Check required CSS link\n   - Validate page container structure\n\n3. **Generate validation report**\n   - Document all checks performed\n   - List any errors found\n   - Note warnings (non-blocking)\n   - Record informational findings\n\n4. **Save validation report** as JSON\n   - Save to: `output\u002Fchapter_XX\u002Fpage_artifacts\u002Fpage_YY\u002F06_validation_structure.json`\n   - Include timestamp\n   - Include all check results\n\n5. **Exit with appropriate code**\n   - Return 0 if VALID (continue pipeline)\n   - Return 1 if INVALID (STOP pipeline, trigger hook)\n\n## Input Parameters\n\n```\nhtml_file: \u003Cstr>         - Path to 04_page_XX.html\noutput_dir: \u003Cstr>        - Directory for validation report\nstrict_mode: \u003Cbool>      - If true, warnings also fail (default: false)\npage_number: \u003Cint>       - Page number (for reporting)\nchapter: \u003Cint>           - Chapter number (for reporting)\n```\n\n## Validation Checks\n\n### Check 1: DOCTYPE Declaration\n\n**Requirement**: File must start with proper DOCTYPE\n```html\n\u003C!DOCTYPE html>\n```\n\n**Check**:\n- [ ] File contains `\u003C!DOCTYPE html>` (case-insensitive)\n- [ ] DOCTYPE appears before any tags\n- [ ] DOCTYPE is on first line or near beginning\n\n**Error if**: Missing or incorrect DOCTYPE\n\n### Check 2: HTML Tags\n\n**Requirement**: Proper `\u003Chtml>` opening and closing tags\n```html\n\u003Chtml lang=\"en\">\n    ...\n\u003C\u002Fhtml>\n```\n\n**Checks**:\n- [ ] `\u003Chtml>` tag present\n- [ ] `\u003C\u002Fhtml>` closing tag present\n- [ ] Tags are properly paired\n- [ ] No unclosed `\u003Chtml>` tags\n\n**Error if**: Missing either tag or improperly paired\n\n### Check 3: Head Section\n\n**Requirement**: Complete `\u003Chead>` section with metadata\n```html\n\u003Chead>\n    \u003Cmeta charset=\"UTF-8\">\n    \u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    \u003Ctitle>...\u003C\u002Ftitle>\n    \u003Clink rel=\"stylesheet\" href=\"..\u002F..\u002Fstyles\u002Fmain.css\">\n\u003C\u002Fhead>\n```\n\n**Checks**:\n- [ ] `\u003Chead>` and `\u003C\u002Fhead>` tags present\n- [ ] `\u003Cmeta charset=\"UTF-8\">` present\n- [ ] `\u003Cmeta name=\"viewport\">` present (warning if missing)\n- [ ] `\u003Ctitle>` tag with content present\n- [ ] CSS `\u003Clink>` tag present with href attribute\n\n**Error if**: Missing charset, title, or CSS link\n**Warning if**: Missing viewport meta tag\n\n### Check 4: Body Section\n\n**Requirement**: Proper `\u003Cbody>` tags with content\n```html\n\u003Cbody>\n    \u003Cdiv class=\"page-container\">\n        \u003Cmain class=\"page-content\">\n            ...\n        \u003C\u002Fmain>\n    \u003C\u002Fdiv>\n\u003C\u002Fbody>\n```\n\n**Checks**:\n- [ ] `\u003Cbody>` and `\u003C\u002Fbody>` tags present\n- [ ] `\u003Cdiv class=\"page-container\">` present\n- [ ] `\u003Cmain class=\"page-content\">` present inside container\n- [ ] Body contains substantial content (> 100 bytes)\n\n**Error if**: Missing tags or required container divs\n\n### Check 5: Tag Closure Validation\n\n**Requirement**: All tags must be properly closed\n\n**Checks for**:\n- Unmatched opening tags (e.g., `\u003Cp>` without `\u003C\u002Fp>`)\n- Improper nesting (e.g., `\u003Cp>\u003Ch2>text\u003C\u002Fh2>\u003C\u002Fp>`)\n- Self-closing tags used correctly (e.g., `\u003Cbr\u002F>`, `\u003Cimg\u002F>`)\n- Comment blocks properly formatted (`\u003C!-- -->`)\n\n**Validation method**:\n- Parse HTML into tree structure\n- Verify all nodes properly matched\n- Check nesting doesn't violate HTML5 rules\n\n**Error if**: Any unmatched or improperly nested tags\n\n### Check 6: Heading Tags (h1-h6)\n\n**Requirement**: Valid heading hierarchy\n```html\n\u003Ch1>Chapter Title\u003C\u002Fh1>\n\u003Ch2>Section Heading\u003C\u002Fh2>\n\u003Ch3>Subsection\u003C\u002Fh3>\n```\n\n**Checks**:\n- [ ] All heading tags properly closed\n- [ ] First heading should be h1 (warning if not)\n- [ ] Heading levels don't skip dramatically (h1 → h4 is suspicious)\n- [ ] All headings have text content (not empty)\n\n**Error if**: Heading tags improperly closed\n**Warning if**: Suspicious hierarchy\n\n### Check 7: Content Structure\n\n**Requirement**: Meaningful content in page container\n\n**Checks**:\n- [ ] `\u003Cmain class=\"page-content\">` contains elements\n- [ ] Content includes headings or paragraphs\n- [ ] No completely empty content area\n- [ ] Text nodes or elements present (> 100 words total)\n\n**Error if**: No content or empty structure\n\n### Check 8: List Integrity\n\n**Requirement**: All lists properly structured\n\n**Checks** for each `\u003Cul>` or `\u003Col>`:\n- [ ] List opening and closing tags matched\n- [ ] List contains `\u003Cli>` elements\n- [ ] All `\u003Cli>` tags properly closed\n- [ ] `\u003Cli>` count matches opening\u002Fclosing pairs\n- [ ] No nested `\u003Cul>` or `\u003Col>` improperly closed\n\n**Error if**: Empty lists or unmatched `\u003Cli>` tags\n\n### Check 9: Image and Link Tags\n\n**Requirement**: Self-closing tags properly formatted\n\n**Checks**:\n- [ ] All `\u003Cimg>` tags have `src` and `alt` attributes\n- [ ] All `\u003Ca>` tags have valid `href` attributes\n- [ ] Image paths don't have obvious errors (no broken syntax)\n- [ ] Self-closing tags use proper syntax\n\n**Warning if**: Images missing alt text or links missing href\n\n### Check 10: Table Tags (if present)\n\n**Requirement**: Proper table structure\n\n**Checks**:\n- [ ] `\u003Ctable>`, `\u003Ctr>`, `\u003Ctd>`, `\u003Cth>` tags properly nested\n- [ ] All rows have consistent column counts\n- [ ] Table headers and body properly structured\n\n**Error if**: Malformed table structure\n\n## Validation Report Format\n\n### Output: `06_validation_structure.json`\n\n```json\n{\n  \"page\": 16,\n  \"book_page\": 17,\n  \"chapter\": 2,\n  \"validation_type\": \"structure\",\n  \"validation_timestamp\": \"2025-11-08T14:34:00Z\",\n  \"overall_status\": \"PASS\",\n  \"error_count\": 0,\n  \"warning_count\": 1,\n  \"checks_performed\": [\n    {\n      \"check_name\": \"DOCTYPE Declaration\",\n      \"status\": \"PASS\",\n      \"details\": \"Valid HTML5 DOCTYPE found\"\n    },\n    {\n      \"check_name\": \"HTML Tags\",\n      \"status\": \"PASS\",\n      \"details\": \"Proper \u003Chtml> opening and closing tags\"\n    },\n    {\n      \"check_name\": \"Head Section\",\n      \"status\": \"PASS\",\n      \"details\": \"All required meta tags and title present\"\n    },\n    {\n      \"check_name\": \"Body Section\",\n      \"status\": \"PASS\",\n      \"details\": \"Body and content structure valid\"\n    },\n    {\n      \"check_name\": \"Tag Closure\",\n      \"status\": \"PASS\",\n      \"details\": \"All tags properly matched and closed\"\n    },\n    {\n      \"check_name\": \"Heading Hierarchy\",\n      \"status\": \"PASS\",\n      \"details\": \"4 headings found, proper h1-h4 hierarchy\"\n    },\n    {\n      \"check_name\": \"Content Structure\",\n      \"status\": \"PASS\",\n      \"details\": \"Main content area contains 245 words across 3 paragraphs\"\n    },\n    {\n      \"check_name\": \"List Integrity\",\n      \"status\": \"PASS\",\n      \"details\": \"1 list with 3 items, all properly formed\"\n    },\n    {\n      \"check_name\": \"Image Tags\",\n      \"status\": \"PASS\",\n      \"details\": \"No images on this page\"\n    },\n    {\n      \"check_name\": \"Table Tags\",\n      \"status\": \"PASS\",\n      \"details\": \"No tables on this page\"\n    }\n  ],\n  \"errors\": [],\n  \"warnings\": [\n    {\n      \"check\": \"Heading Hierarchy\",\n      \"message\": \"First heading is h2, typically should be h1 for page opening\",\n      \"severity\": \"LOW\"\n    }\n  ],\n  \"summary\": {\n    \"total_checks\": 10,\n    \"passed\": 9,\n    \"failed\": 0,\n    \"warnings\": 1,\n    \"html_valid\": true,\n    \"tags_matched\": true,\n    \"content_substantial\": true\n  }\n}\n```\n\n## Validation Rules\n\n### PASS Criteria\n- DOCTYPE present and valid\n- All required tags (`html`, `head`, `body`, `main`, `div.page-container`) present\n- All tags properly closed and matched\n- Title tag with content\n- CSS stylesheet link present\n- Content structure valid\n- No structural errors\n\n### FAIL Criteria (BLOCKS PIPELINE)\n- Missing DOCTYPE\n- Missing required tags\n- Unmatched or improperly nested tags\n- Missing title or CSS link\n- Empty content\n- Malformed lists or tables\n\n### WARNING (Logged but doesn't block)\n- Missing viewport meta tag\n- First heading is not h1\n- Large heading jumps (h1 → h4)\n- Missing alt text on images\n- Missing href on links\n\n## Implementation: Using Python Script\n\nThis validation is performed by existing `validate_html.py` tool, run in **structure validation mode**:\n\n```bash\ncd Calypso\u002Ftools\n\n# Validate single page HTML\npython3 validate_html.py \\\n  ..\u002Foutput\u002Fchapter_02\u002Fpage_artifacts\u002Fpage_16\u002F04_page_16.html \\\n  --output-json ..\u002Foutput\u002Fchapter_02\u002Fpage_artifacts\u002Fpage_16\u002F06_validation_structure.json \\\n  --strict-structure\n\n# Exit code:\n# 0 = VALID (continue to next skill)\n# 1 = INVALID (STOP pipeline)\n```\n\n## Hook Integration\n\nWhen validation **FAILS**:\n\n```bash\n# Trigger hook: .claude\u002Fhooks\u002Fvalidate-structure.sh\n# Receives:\n#   - Page number\n#   - HTML file path\n#   - Validation report path\n#   - Error details\n\n# Hook behavior:\n# - Log failure with details\n# - Save error report\n# - Notify user\n# - STOP pipeline (no further processing)\n```\n\n## Error Recovery\n\n**If validation fails**:\n1. User reviews validation report\n2. User identifies issue in AI-generated HTML\n3. Options:\n   - Fix HTML manually and re-validate\n   - Re-run AI generation with improved prompt\n   - Review source extraction data for errors\n   - Proceed with caution (expert override)\n\n## Quality Metrics\n\nValidation provides metrics:\n- Percentage of checks passing\n- Error severity levels\n- Content size (word count, element count)\n- Structure complexity\n\nThese metrics feed into final quality reports.\n\n## Success Criteria\n\n✓ Validation completes successfully\n✓ All structural checks pass (0 errors)\n✓ Validation report saved in JSON format\n✓ Exit code 0 returned (or 1 if invalid)\n✓ Clear error messages if validation fails\n\n## Next Steps After PASS\n\nIf validation passes:\n1. All pages of chapter processed through this gate\n2. **Skill 4** (consolidate pages) merges individual page HTMLs\n3. **Quality Gate 2** (semantic validate) checks semantic structure\n4. Continue through validation pipeline\n\n## Next Steps After FAIL\n\nIf validation fails:\n1. **PIPELINE STOPS**\n2. Hook `validate-structure.sh` triggered\n3. User receives error report with details\n4. User must fix issues and retry\n\n## Design Notes\n\n- This is the **first deterministic quality gate**\n- Uses proven `validate_html.py` tool\n- Catches structural issues before semantic analysis\n- Provides clear, actionable error messages\n- Essential for ensuring pipeline reliability\n\n## Testing\n\nTo test structure validation:\n\n```bash\n# Test with known-good HTML\npython3 validate_html.py ..\u002Foutput\u002Fchapter_01\u002Fchapter_01.html\n\n# Should show: ✓ VALID\n\n# Test with invalid HTML (if needed)\npython3 validate_html.py broken_html.html\n\n# Should show: ✗ INVALID with specific errors\n```\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Fabejitsu\u002Fhtml-structure-validate",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill html-structure-validate",{"tool":56,"command":57},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill html-structure-validate",{"tool":59,"command":60},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill html-structure-validate","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fabejitsu\u002Fhtml-structure-validate\u002FSKILL.md",true,[64],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"skill-report.json","REFERENCE","参考文档",17012,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fabejitsu\u002Fhtml-structure-validate\u002Fskill-report.json",[71,83,93,102,108,115],{"skillNo":72,"name":73,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":79,"publishedAt":36},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[76],{"categoryNo":77,"categoryName":78,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[80,81,82],"model","model hierarchy","model hierarchy skill",{"skillNo":84,"name":85,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":89,"publishedAt":36},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[88],{"categoryNo":77,"categoryName":78,"taxonomyType":21,"taxonomyTypeDesc":22},[90,91,92],"MCP","zoom","zoom mcp",{"skillNo":94,"name":95,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":36},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[99,100,101,91],"sdk","zoom apps sdk","apps",{"skillNo":103,"name":104,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":36},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[104],{"skillNo":109,"name":110,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":114,"publishedAt":36},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[113],{"categoryNo":77,"categoryName":78,"taxonomyType":21,"taxonomyTypeDesc":22},[110],{"skillNo":116,"name":117,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":36},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[117]]