# IGNY8 Phase 2: Rich Schema & SERP Enhancement (02G) ## JSON-LD Schema Generation & On-Page SERP Element Injection **Document Version:** 1.0 **Date:** 2026-03-23 **Phase:** IGNY8 Phase 2 — Feature Expansion **Status:** Build Ready **Source of Truth:** Codebase at `/data/app/igny8/` **Audience:** Claude Code, Backend Developers, Architects --- ## 1. CURRENT STATE ### Schema Markup Today The `Content` model (app_label=`writer`, db_table=`igny8_content`) has a `schema_markup` JSONField that stores raw JSON-LD. The AI function `generate_content` occasionally includes basic Article schema, but the output is inconsistent and unvalidated. ### What Works Now - `Content.schema_markup` — JSONField exists, sometimes populated during generation - `generate_content` AI function — may produce rudimentary Article schema as part of content output - `ContentTypeTemplate` model (added by 02A) defines section layouts and presets per content type - 02A added `Content.structured_data` JSONField for type-specific data (product specs, service steps, etc.) ### What Does Not Exist - No systematic schema generation by content type - No on-page SERP element injection (TL;DR, TOC, Key Takeaways, etc.) - No schema validation against Google Rich Results requirements - No retroactive enhancement of already-published content - No SchemaTemplate model, no SERPEnhancement model, no validation records - No SERP element tracking per content ### Phase 1 & 2A Foundation Available - `SAGCluster.cluster_type` choices: `product_category`, `condition_problem`, `feature`, `brand`, `informational`, `comparison` - 01E blueprint-aware pipeline provides `blueprint_context` with `cluster_type`, `content_structure`, `content_type` - 02A content type routing provides type-specific generation with section layouts - `Content.content_type` choices: `post`, `page`, `product`, `taxonomy` - `Content.content_structure` choices: 14 structure types including `cluster_hub`, `product_page`, `service_page`, `comparison`, `review` --- ## 2. WHAT TO BUILD ### Overview Build a schema generation and SERP enhancement system that: 1. Generates correct JSON-LD structured data for 10 schema types, mapped to content type/structure 2. Injects 8 on-page SERP elements into `content_html` to improve rich snippet eligibility 3. Validates schema against Google Rich Results requirements 4. Retroactively enhances existing published content with missing schema and SERP elements ### 2.1 JSON-LD Schema Types (10 Types) Each schema type maps to specific `content_type` + `content_structure` combinations: | # | Schema Type | Applies To | Key Fields | |---|------------|-----------|------------| | 1 | **Article / BlogPosting** | `post` (all structures) | headline, datePublished, dateModified, author (Person/Organization), publisher, image, description, mainEntityOfPage, wordCount, articleSection | | 2 | **Product** | `product` / `product_page` | name, description, image, brand, offers (price, priceCurrency, availability, url), aggregateRating, review, sku, gtin | | 3 | **Service** | `page` / `service_page` | name, description, provider (Organization), serviceType, areaServed, hasOfferCatalog, offers | | 4 | **LocalBusiness** | Sites with physical location (site-level config) | name, address, telephone, openingHours, geo, image, priceRange, sameAs, hasMap | | 5 | **Organization** | Site-wide (homepage schema) | name, url, logo, sameAs[], contactPoint, foundingDate, founders | | 6 | **BreadcrumbList** | All pages | itemListElement [{position, name, item(URL)}] — auto-generated from SAG hierarchy or WP breadcrumb trail | | 7 | **FAQPage** | Content with FAQ sections (auto-detected from H2/H3 question patterns) | mainEntity [{@type: Question, name, acceptedAnswer: {text}}] | | 8 | **HowTo** | Step-by-step content (detected from ordered lists with process indicators) | name, step [{@type: HowToStep, name, text, image, url}], totalTime, estimatedCost | | 9 | **VideoObject** | Content with video embeds (02I integration) | name, description, thumbnailUrl, uploadDate, duration, contentUrl, embedUrl | | 10 | **WebSite + SearchAction** | Site-wide (homepage) | name, url, potentialAction (SearchAction with query-input) | **Auto-Detection Rules:** - FAQPage: detected when content has H2/H3 headings matching question patterns (starts with "What", "How", "Why", "When", "Is", "Can", "Does", "Should") or explicit `
` blocks - HowTo: detected when content has ordered lists (`
    `) combined with process language ("Step 1", "First", "Next", etc.) - VideoObject: detected when `