schema-dts
Skill1 starsChanged 3 months agoMITView on GitHub
Build, review, debug, migrate, or plan Schema.org JSON-LD with Google schema-dts TypeScript types. Use for schema-dts, schema-dts-gen, schema-dts-lib, WithContext, Graph, IdReference, MergeLeafTypes, ProductLeaf and other *Leaf types, WithActionConstraints, JSON-LD script injection, structured data, Organization, WebSite, Product, Offer, FAQPage, Article, BreadcrumbList, react-schemaorg, and Schema.org v30 typing.
In this repository81 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agents-mdSkill
- base-uiSkill
- better-authSkill
- brainstormSkill
- bullmqSkill
- bunSkill
- clickhouseSkill
- clone-to-tempSkill
- compound-uiSkill
- copywritingSkill
- create-durable-planSkill
- d3Skill
- date-fnsSkill
- decimal-jsSkill
- deduplicateSkill
- design-engineerSkill
- designSkill
- drizzle-ormSkill
- effectSkill
- elysia-architectureSkill
- elysiaSkill
- evlogSkill
- feedsmithSkill
- grokSkill
- handoffSkill
- heyapiSkill
- impitSkill
- intlayerSkill
- jsdocSkill
- kafkaSkill
- kill-legacySkill
- legend-stateSkill
- loopSkill
- mantine-hooksSkill
- mobbinSkill
- motionSkill
- oxfmtSkill
- oxlintSkill
- permixSkill
- plain-languageSkill
- playwrightSkill
- react-boundariesSkill
- react-emailSkill
- reactSkill
- reorganizeSkill
- researchSkill
- sentrySkill
- seoSkill
- setup-competitors-mdSkill
- setup-copywriting-mdSkill
- setup-icp-mdSkill
- setup-project-mdSkill
- simplify-layoutSkill
- storybookSkill
- subagentsSkill
- tailwindSkill
- tailwind-variantsSkill
- takumiSkill
- tanstack-chartsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 1 is distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill when work touches schema-dts TypeScript types for Schema.org JSON-LD: building structured data objects, injecting <script …
- Very specific: line 25
Put @context: 'https://schema.org' only on the document root (WithContext or Graph).
- Very specific: line 26
Prefer bun / bunx in command examples when adding packages or running the generator.
- Very specific: line 32
Always use WithContext<T> (or Graph) for the top-level JSON-LD document so @context is required and locked to https://schema.org.
- Very specific: line 33
Prefer the narrowest type that matches the page (Product, Article, FAQPage) over typing everything as Thing.
- Very specific: line 34
Use *Leaf + MergeLeafTypes only when @type is genuinely an array of concrete types.
- Very specific: line 37
When injecting into HTML, escape <, >, &, ' in the JSON string (or use react-schemaorg's JsonLd).
- Very specific: line 38
Prefer absolute HTTPS URLs for url, image, logo, sameAs, and @id values that crawlers resolve.
- Distinctive: line 42
Prefer the repo's existing checks.
- Very specific: line 48
After upgrading to v2, re-check Role-shaped properties, Quantity assignments, multi-type nodes, and any custom schema-dts-gen output (now …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
schema-dts
Use this skill when work touches schema-dts TypeScript types for Schema.org JSON-LD: building structured data objects, injecting <script type="application/ld+json">, multi-typed nodes, @graph documents, action input/output constraints, or regenerating typings with schema-dts-gen.
Workflow
- Inspect the local surface before changing code:
- Packages:
schema-dts(and optionallyschema-dts-gen,schema-dts-lib,react-schemaorg). - Version: target v2 (
2.0.0= Schema.org v30). Treat1.xas legacy. - Role: type-only compile-time checking (no runtime Schema.org validation).
- Shape: single
WithContext<T>node vsGraphwith@idstubs vs multi-@typeviaMergeLeafTypes. - Injection path: React/
react-schemaorg, NextScript, Astro/set:html, Svelte head, or vanilla DOM.
- Packages:
- Refresh docs when the user asks for latest behavior, the installed major is unclear, or work touches v2 helpers / generator output. Start from source-map.md.
- For install,
WithContext,Thingdiscrimination, DataTypes, and type-only imports, use setup-core.md. - For
Graph,IdReference,*Leaf,MergeLeafTypes, andWithActionConstraints, use graphs-merge-actions.md. - For common page schemas, XSS-safe serialization, and framework wiring, use patterns-frameworks.md.
- For
schema-dts-genCLI / programmatic generation and v1→v2 breaks, use generator-migration.md. - Implement in the existing project style:
- Prefer
import type { … } from 'schema-dts'. - Put
@context: 'https://schema.org'only on the document root (WithContextorGraph). - Prefer
bun/bunxin command examples when adding packages or running the generator.
- Prefer
Judgment
- Types only.
schema-dtscatches wrong@type/ unknown properties at compile time. It does not validate against Google Rich Results or Schema.org at runtime. - Ship core Schema.org from the prebuilt package. Pending / experimental layers need a custom
schema-dts-genrun, not hand-rolledascasts. - Always use
WithContext<T>(orGraph) for the top-level JSON-LD document so@contextis required and locked tohttps://schema.org. - Prefer the narrowest type that matches the page (
Product,Article,FAQPage) over typing everything asThing. - Use
*Leaf+MergeLeafTypesonly when@typeis genuinely an array of concrete types. Never pass union aliases likeProductintoMergeLeafTypes. - Cross-link repeated entities with
@id+IdReferencestubs inside aGraphinstead of duplicating nested objects. - For sitelinks search box / Action markup, wrap or cast with
WithActionConstraintssoquery-input(and other*-input/*-output) type-check. - When injecting into HTML, escape
<,>,&,'in the JSON string (or usereact-schemaorg'sJsonLd). - Prefer absolute HTTPS URLs for
url,image,logo,sameAs, and@idvalues that crawlers resolve.
Verification
Prefer the repo's existing checks. For meaningful schema-dts work, include the relevant subset:
- Typecheck the JSON-LD builders and any framework wrappers.
- Confirm root objects use
WithContext/Graphand nested nodes omit@context. - Smoke-render the page and inspect the
application/ld+jsonscript(s) in the DOM / view-source. - Optionally paste output into Google Rich Results Test or Schema Markup Validator when SEO eligibility matters.
- After upgrading to v2, re-check Role-shaped properties,
Quantityassignments, multi-type nodes, and any customschema-dts-genoutput (now importsschema-dts-lib).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

