sscgen-dsl

Generate lint-clean KDL Schema DSL v2.1 configurations for HTML scraping using CSS-selector pipelines.

3|Updated Nov 9, 2023
One-click install
npx skills add https://github.com/vypivshiy/selector_schema_codegen --skill sscgen-dsl
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sscgen-dsl
Source: https://github.com/vypivshiy/selector_schema_codegen/tree/main/.agents/skills/sscgen-dsl
Command: npx skills add https://github.com/vypivshiy/selector_schema_codegen --skill sscgen-dsl

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Turn an HTML scraping intent into a valid, lint-clean KDL Schema DSL that extracts the right fields reliably, without hand-writing fragile parser code.

Core Features & Use Cases

  • Declarative HTML scraping DSL generation: produces KDL v2.1 schemas for (item)struct, (list)struct, (flat)struct, (table)struct, and (dict)struct using CSS-selector pipelines.
  • Schema lint loop for correctness: iteratively fixes parse/type/struct issues based on linter output (text or JSON) until the schema is clean.
  • Structured extraction patterns: supports table-style key/value extraction with @table, @rows, @match, @value, and dynamic maps with @key/@value.
  • Type conversions and fallbacks: enforces string/number/boolean flows using conversions like to-int, to-float, to-bool, plus typed fallback for robustness.
  • LLM-friendly workflow: guides schema iteration by mapping HTML structure to selectors and by using lint feedback as a tight validation mechanism.

Quick Start

Generate a lint-clean KDL HTML scraping schema by analyzing my provided HTML and extraction requirements, outputting a complete .kdl file that passes ssc-gen check -f json with no errors.

Frequently Asked Questions about sscgen-dsl

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a schema for HTML scraping without writing fragile parser code?▼

To generate an HTML scraping schema without writing fragile parser code, you can declaratively map extraction requirements to CSS-selector pipelines using KDL Schema DSL. This approach outputs valid, lint-clean configurations that reliably extract fields from HTML pages.

How do I extract table-style key-value pairs from HTML using CSS selectors?▼

Extracting table-style key-value pairs from HTML is done using the `(table)struct` and `(dict)struct` patterns in KDL Schema DSL. You can define structured extraction routes with `@table`, `@rows`, `@match`, `@value`, and dynamic maps using `@key` and `@value`.

What is the best way to validate and repair an HTML scraper schema?▼

The best way to validate and repair an HTML scraper schema is by running a lint loop that iteratively fixes parse, type, and struct issues based on linter output. The schema is adjusted repeatedly until `ssc-gen check` passes with zero errors.

Does the KDL Schema DSL support typed conversions and fallbacks for missing HTML elements?▼

Yes, KDL Schema DSL supports typed conversions and fallbacks for missing HTML elements by enforcing string, number, and boolean flows. It uses conversions like `to-int`, `to-float`, `to-bool`, alongside typed `fallback` values to maintain extraction robustness.

Can I use REST struct definitions within my KDL HTML scraping schema?▼

No, you cannot use REST struct definitions within a KDL HTML scraping schema because the DSL applies HTML-only constraints. Schema generation strictly maps extraction requirements to CSS-selector pipelines and does not support REST structs.

How do I scrape a flat collection of items from a single HTML page?▼

To scrape a flat collection of items from a single HTML page, you generate a `(flat)struct` configuration in KDL Schema DSL. This maps the HTML structure to CSS selectors, creating a pipeline that extracts repeated elements efficiently.