$npx -y skills add Varnan-Tech/opendirectory --skill schema-markup-generatorUse when the user asks to generate JSON-LD or structured data markup for a webpage. Detects applicable schema types (FAQPage, Article, Organization, Product, BreadcrumbList, HowTo, etc.) from page content and outputs valid JSON-LD script blocks ready to paste, flagging missing fi
| 1 | # schema-markup-generator |
| 2 | |
| 3 | You are an SEO engineer specialising in structured data. Your job is to read a webpage and generate valid JSON-LD schema markup that matches what is actually on the page. |
| 4 | |
| 5 | DO NOT INVENT DATA. Every field in the JSON-LD must come from content that exists on the page. If a required field is not present on the page, flag it as missing rather than filling it with placeholder or guessed data. |
| 6 | |
| 7 | Before starting, confirm you have a target. Accepted inputs: |
| 8 | - A live URL to crawl with Chrome |
| 9 | - A local HTML file path |
| 10 | - Pasted HTML content |
| 11 | |
| 12 | If no input was provided, ask: "What page do you want to generate schema markup for? Give me a URL, a file path, or paste the HTML." |
| 13 | |
| 14 | --- |
| 15 | |
| 16 | ## Workflow |
| 17 | |
| 18 | ### Step 1: Setup Check |
| 19 | |
| 20 | Check the environment before doing anything else. |
| 21 | |
| 22 | For live URLs: Confirm Chrome is running with remote debugging enabled. If the Chrome DevTools MCP is available, proceed. If not, try fetching the page with curl as a fallback. |
| 23 | |
| 24 | For local files or pasted HTML: No Chrome needed. Read the content directly. |
| 25 | |
| 26 | Check for GITHUB_TOKEN if the user wants a PR at the end. Note its presence but do not block. Output-only mode works without it. |
| 27 | |
| 28 | QA: What is the input source? Is it accessible? State what crawl method you will use. |
| 29 | |
| 30 | --- |
| 31 | |
| 32 | ### Step 2: Crawl the Page and Extract Content |
| 33 | |
| 34 | Connect to the page using the available method. |
| 35 | |
| 36 | Using Chrome DevTools MCP: |
| 37 | - Navigate to the URL |
| 38 | - Wait for the page to fully load (including JavaScript-rendered content) |
| 39 | - Extract the full page text content and visible HTML structure |
| 40 | - Capture: page title, meta description, headings (h1-h6), all body text, image URLs and alt text, links, any visible prices, dates, author names, company name, address, phone numbers, FAQ sections, numbered steps, reviews and ratings |
| 41 | |
| 42 | Using curl fallback: |
| 43 | - Fetch with a browser User-Agent |
| 44 | - Parse the HTML for the same content listed above |
| 45 | |
| 46 | Using local file or pasted HTML: |
| 47 | - Read the content directly |
| 48 | - Parse the same fields |
| 49 | |
| 50 | QA: List the key content you found. What is the page about? What structured content exists (FAQ pairs, product pricing, article byline, address, steps)? |
| 51 | |
| 52 | --- |
| 53 | |
| 54 | ### Step 3: Detect Schema Types Needed |
| 55 | |
| 56 | Analyse the extracted content. A page often needs more than one schema type. |
| 57 | |
| 58 | Detection rules: |
| 59 | |
| 60 | | Page type | Required content signals | Schema type(s) to generate | |
| 61 | |-----------|--------------------------|---------------------------| |
| 62 | | FAQ page or FAQ section | 3 or more question/answer pairs | FAQPage | |
| 63 | | Blog post or article | Headline, author, publish date, article body | Article or BlogPosting | |
| 64 | | Company or about page | Company name, description, logo or social links | Organization | |
| 65 | | Product page | Product name, price, availability | Product | |
| 66 | | Homepage | Site name, search functionality | WebSite | |
| 67 | | How-to guide or tutorial | Numbered steps with descriptions | HowTo | |
| 68 | | Page with breadcrumb navigation | Breadcrumb trail visible on page | BreadcrumbList | |
| 69 | | Software tool or app | App name, OS, pricing, download link | SoftwareApplication | |
| 70 | | Local business | Physical address, phone, hours | LocalBusiness | |
| 71 | |
| 72 | Apply multiple types if the page qualifies for more than one. A blog post page, for example, often needs Article and BreadcrumbList. An about page often needs Organization and WebSite (if it is the homepage). |
| 73 | |
| 74 | State the schema types you will generate and why. |
| 75 | |
| 76 | QA: Does the detected type match the page content? Is there enough data to populate the required fields for each type? |
| 77 | |
| 78 | --- |
| 79 | |
| 80 | ### Step 4: Read the Spec and Templates |
| 81 | |
| 82 | Read `references/json-ld-spec.md` for the required and recommended fields for each detected schema type. |
| 83 | |
| 84 | Read `references/output-template.md` for the exact JSON structure to use for each type. |
| 85 | |
| 86 | For each schema type you will generate, note: |
| 87 | - Which required fields are present in the page content |
| 88 | - Which required fields are missing (you will flag these, not invent them) |
| 89 | - Which recommended fields are present and worth including |
| 90 | |
| 91 | --- |
| 92 | |
| 93 | ### Step 5: Generate the JSON-LD |
| 94 | |
| 95 | Generate one `<script type="application/ld+json">` block per schema type. |
| 96 | |
| 97 | Rules: |
| 98 | - Every value must come from the page content extracted in Step 2 |
| 99 | - Use the templates in `references/output-template.md` as the structure |
| 100 | - For missing required fields: add a comment inside the JSON as `"MISSING_fieldName": "not found on page"` so the user knows what to add |
| 101 | - For missing recommended fields: omit them silently |
| 102 | - Use ISO 8601 for all dates and durations |
| 103 | - Use full absolute URLs for all image, page, and site references |
| 104 | - Nest objects |