Generate data schema
Skill ScrapeOps/scrapeops-scraping-assistant-claude-plugin/skills/generate-data-schema
Use this skill to build a data-extraction schema JSON file that tells ScrapeOps what fields to extract. Trigger on phrases like "generate schema", "create schema", "data schema for X", "schema for crawler", "build a schema". Also invoked programmatically by other skills (e.g. generate-crawler-scraper) — in that case the args target_page_type, user_description, and output_path are passed in. The output is a JSON file in the Go backend's expected shape (fields with type, required, priority_level, null_value, description), ready to be sent via schema_json in scrapeops_submit_job. Do NOT trigger for requests to generate actual scraper code (use generate-scraper or generate-crawler-scraper instead).From its SKILL.md
npx -y skills add ScrapeOps/scrapeops-scraping-assistant-claude-plugin --skill generate-data-schemaAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 5 stars5 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
7.1 KB, as published. Nobody here has run it
Generate Data Schema Skill
Build a data-extraction schema JSON that the ScrapeOps Go backend accepts via schema_json in scrapeops_submit_job. The schema tells the extraction LLM and the code generator what fields to pull from a page. Each field has metadata: type, required, priority_level, refactoring_priority, null_value, plus nested items/properties for arrays/objects.
This skill has two usage modes:
- Standalone — user asks "create a schema for X". Skill collects inputs, emits
schema.json, and shows it. - Programmatic — another skill invokes this one passing
target_page_type,user_description,output_path. Skill builds the schema silently and writes to the path.
Inputs
| Slot | Required | Notes |
|---|---|---|
target_page_type | Yes | One of the known presets. Drives the starting template. See list below. |
user_description | Yes | Free-form text describing what to extract. E.g. "only product URLs and pagination", "product details with reviews and specs". |
output_path | Yes (programmatic) | File path to write the schema to. When invoked standalone, ask the user or default to ./schema.json. |
Known presets (target_page_type)
product_crawler— slim schema for a listing/category page used when the goal is to discover product URLs and pass them to a separate detail-page scraper. Extractsproducts[].url+pagination.nextPageUrl. Use this for crawlers.product_search_page— schema for a search results page scraped directly (no follow-up to detail pages). Extracts the data visible on each result card:products[].{url, name, price, image, rating, ...}+ pagination. Used bygenerate-scraperSearch Page Mode.product— full schema for a product detail page. Extracts name, price, brand, images, reviews, specifications, features, availability, etc.
Preset files live in presets/ relative to this SKILL.md (sibling directory).
Step 1 — Resolve inputs
- If args were passed programmatically (via Skill tool), use them directly.
- If invoked standalone and something is missing:
target_page_type: ask viaAskUserQuestionwith options from "Known presets" above.user_description: ask"Describe what you want to extract (e.g. product URLs + pagination; or name, price, reviews, images)".output_path: ask or default to./schema.json.
Step 2 — Load the preset
Read the preset JSON from <skill-dir>/presets/<target_page_type>.json. Use the Read tool. The preset is already in the exact Go format — this is the starting point.
If the preset doesn't exist for the given target_page_type, stop and report: "No preset available for '<X>'. Supported presets: product_crawler, product_search_page, product."
Step 3 — Customize based on user_description
Apply the user's intent to the preset. Examples:
- If
user_descriptionsays "only URLs and pagination" (or similar minimal intent) and the preset isproduct_crawler→ keep as-is, maybe dropproducts[].name(optional anyway). - If
user_descriptionsays "also want stock and rating" and the preset isproduct→ ensureavailabilityandratingare present. - If
user_descriptionmentions fields not in the preset (e.g. "gift-wrapping option"), add them with sensible defaults:"giftWrapAvailable": { "description": "Whether the product supports gift wrapping at checkout", "type": "boolean", "required": false, "priority_level": "low", "null_value": false } - If
user_descriptionsays to remove some fields ("no reviews"), delete them from the preset.
Don't over-engineer. The LLM will figure out sensible additions; only add fields the user explicitly asked for or that the preset clearly lacks for the stated use case.
Shape every field correctly
Every top-level property must have:
description(human-readable; the extraction LLM reads this)type:"string","number","boolean","object", or"array"(note: some existing schemas use"list"as a synonym for"array"— prefer"array"for new fields)required:trueorfalsepriority_level:"critical"|"high"|"medium"|"low"(affects which fields the Go backend's validation + refactoring loop prioritizes)refactoring_priority:true(add for anything important — the backend uses this to re-run the fix loop if the field is missing from output)null_value: type-appropriate default (""for string,0for number,falsefor boolean,[]for array,nullor{}for object)
For arrays: include items: { type, properties }.
For objects: include properties: { ... }.
Step 4 — Validate
Quick self-checks before writing:
- Every top-level key has a
type. requiredis present on every field (bool).- Arrays have
items; objects haveproperties. - For
product_crawler:products[].urlmust berequired: trueandpriority_level: "critical". - For
product_search_page:products[].urlANDproducts[].namemust both berequired: true, priority_level: "critical". - For
product: at leastnameandurlmust berequired: true, priority_level: "critical".
If any check fails, fix in place. Never emit an invalid schema.
Step 5 — Write and report
Write the customized schema to output_path using the Write tool. Then:
- Programmatic mode (args came in): emit a one-line text response:
Schema written to <output_path> (<N> top-level fields).Nothing else. - Standalone mode: show the path, the field count, and a short summary table:
✓ Schema written: ./schema.json (7 top-level fields) Fields: products[url, productId, name], pagination[currentPage, nextPageUrl, hasNextPage], searchMetadata
Notes
- The schema you emit will be sent as
schema_jsonin ascrapeops_submit_jobcall (by the caller). The Go backend uploads it to Digital Ocean Spaces and treats it as a "dynamic schema" — bypassing the built-indataSchema/*.jsonfiles. - Don't embed example values in the schema — this is a schema, not sample data. Only field definitions.
- Keep schemas reasonably sized. A product detail schema with ~15–25 top-level fields is normal. If you find yourself adding 40+ fields, the user probably asked for too much — ask them to prioritize.
- Don't ask permission to write the schema in programmatic mode — just do it and report.