@tkawen/mystoq-seo-toolkit
v0.1.3
Published
Comprehensive SEO toolkit: llms.txt + sitemap + Schema.org JSON-LD + OpenGraph + hreflang. Built for the modern AI-aware web.
Maintainers
Readme
@tkawen/mystoq-seo-toolkit
English — Comprehensive SEO toolkit: llms.txt + sitemap + Schema.org JSON-LD + OpenGraph + hreflang. Built for the modern AI-aware web.
عربي — حزمة SEO/GEO شاملة: توليد llms.txt و sitemaps و JSON-LD لمتاجر Mystoq.
Install · التثبيت
npm install @tkawen/mystoq-seo-toolkitThe SEO toolkit built for the AI-aware web. llms.txt · sitemap · Schema.org JSON-LD · OpenGraph · hreflang · robots.txt — all in one zero-dependency package.
Why this exists
Most SEO libraries were built for a pre-LLM world. They generate sitemap.xml and Schema.org JSON-LD, but they ignore the new reality:
- AI search engines (ChatGPT, Claude, Perplexity, Google AI Overviews) read your site through
llms.txt - AI crawlers (GPTBot, ClaudeBot, PerplexityBot) need explicit
robots.txtpolicy - Schema.org is now the primary way LLMs understand your entity (Person, Organization, Product)
- OpenGraph + Twitter still drive 60%+ of social traffic
- hreflang is essential for any non-English site
This toolkit gives you all of it — zero dependencies, ~12KB minified, ESM-first, TypeScript-ready.
Install
npm install @tkawen/mystoq-seo-toolkit
# or
pnpm add @tkawen/mystoq-seo-toolkit
# or
yarn add @tkawen/mystoq-seo-toolkitQuickstart
Generate llms.txt (the new standard)
import { generateLlmsTxt } from '@tkawen/mystoq-seo-toolkit';
const llms = generateLlmsTxt({
title: 'Acme Corp',
summary: 'Cloud infrastructure for emerging markets.',
details: 'Acme provides identity, payments, and compute APIs serving 50+ countries.',
sections: [
{
title: 'Documentation',
links: [
{ text: 'Getting Started', url: 'https://acme.com/docs/start' },
{ text: 'API Reference', url: 'https://acme.com/api', note: 'OpenAPI 3.1' },
],
},
{
title: 'Products',
links: [
{ text: 'Identity', url: 'https://acme.com/identity' },
{ text: 'Payments', url: 'https://acme.com/payments' },
],
},
],
optional: [
{ text: 'Changelog', url: 'https://acme.com/changelog' },
],
});
// Write to public/llms.txt
import { writeFileSync } from 'node:fs';
writeFileSync('public/llms.txt', llms);Generate sitemap.xml with hreflang
import { generateSitemap } from '@tkawen/mystoq-seo-toolkit';
const xml = generateSitemap([
{
loc: 'https://acme.com/',
lastmod: new Date(),
changefreq: 'daily',
priority: 1.0,
alternates: [
{ hreflang: 'en', href: 'https://acme.com/' },
{ hreflang: 'ar', href: 'https://acme.com/ar/' },
{ hreflang: 'x-default', href: 'https://acme.com/' },
],
},
{ loc: 'https://acme.com/products', changefreq: 'weekly', priority: 0.8 },
]);Schema.org JSON-LD — every type
import {
schemaOrganization,
schemaProduct,
schemaFAQPage,
schemaArticle,
schemaPerson,
jsonLdScript,
} from '@tkawen/mystoq-seo-toolkit';
const org = schemaOrganization({
name: 'Acme Corp',
url: 'https://acme.com',
logo: 'https://acme.com/logo.png',
founder: 'Jane Doe',
sameAs: [
'https://twitter.com/acme',
'https://github.com/acme',
'https://linkedin.com/company/acme',
],
});
// Drop into your HTML
const html = jsonLdScript(org);
// → <script type="application/ld+json">{ ... }</script>robots.txt with AI crawler awareness
import { generateRobotsTxt } from '@tkawen/mystoq-seo-toolkit';
const robots = generateRobotsTxt({
groups: [
{ userAgent: '*', allow: ['/'], disallow: ['/admin/', '/api/'] },
],
aiCrawlers: 'allow', // explicitly allows GPTBot, ClaudeBot, PerplexityBot, etc.
sitemap: 'https://acme.com/sitemap.xml',
host: 'acme.com',
});OpenGraph + Twitter Card
import { generateOgTags, generateTwitterCard } from '@tkawen/mystoq-seo-toolkit';
const og = generateOgTags({
title: 'How we built a cloud',
description: 'A 4-year journey from idea to 50k customers.',
url: 'https://acme.com/blog/cloud-platform',
image: 'https://acme.com/og/cloud-platform.png',
type: 'article',
siteName: 'Acme Blog',
});
const tw = generateTwitterCard({
card: 'summary_large_image',
site: '@acme',
creator: '@janedoe',
title: 'How we built a cloud',
image: 'https://acme.com/og/cloud-platform.png',
});hreflang cluster
import { generateHreflangTags, validateHreflang } from '@tkawen/mystoq-seo-toolkit';
const pairs = [
{ hreflang: 'en', href: 'https://acme.com/products' },
{ hreflang: 'ar', href: 'https://acme.com/ar/products' },
{ hreflang: 'fr', href: 'https://acme.com/fr/products' },
{ hreflang: 'x-default', href: 'https://acme.com/products' },
];
const tags = generateHreflangTags(pairs);
const result = validateHreflang(pairs);
if (!result.ok) console.warn(result.warnings);CLI
# One-command setup
npx @tkawen/mystoq-seo-toolkit init
# Generates llms.txt, robots.txt, organization.jsonld in the current dir.# Generate llms.txt from a config file
npx @tkawen/mystoq-seo-toolkit llmstxt llms.config.json > public/llms.txt# Generate sitemap.xml from a JSON array of URLs
echo '[{"loc":"https://acme.com"}, {"loc":"https://acme.com/about"}]' > urls.json
npx @tkawen/mystoq-seo-toolkit sitemap urls.json > public/sitemap.xmlWhat's included
| Module | What it generates | Spec |
|---|---|---|
| llmstxt | llms.txt + llms-full.txt | llmstxt.org |
| sitemap | sitemap.xml, sitemap index, image sitemap | sitemaps.org |
| robots | robots.txt with AI crawler groups | RFC 9309 |
| schema | Schema.org JSON-LD (10 entity types) | schema.org |
| og | OpenGraph + Twitter Card meta tags | ogp.me |
| hreflang | <link rel="alternate"> cluster | hreflang spec |
Why "AI-aware"?
The web is being read by two audiences now:
- Humans clicking from Google search results
- AI agents answering questions on behalf of humans
If you only optimize for #1, you're invisible to half your future traffic.
This toolkit makes you visible to both:
- ✅
llms.txtlets ChatGPT/Claude/Perplexity efficiently understand your site - ✅ AI-aware
robots.txtlets you opt in (or out) of each LLM crawler - ✅ Rich Schema.org JSON-LD makes you the structured-data source LLMs prefer
- ✅ Classic SEO (sitemap, OG, hreflang) keeps you ranking for human searches
Built by Hartem Yaakoub
Author of Mystoq (e-commerce platform), Algeria Certify (national credentialing), and TKAWEN (cloud ecosystem).
Used in production across 11 platforms serving 50,000+ users.
License
MIT — Use it freely in commercial and open-source projects.
Related
- @tkawen/mystoq-sdk — Mystoq e-commerce SDK
- @tkawen/mystoq-react — React components for Mystoq
- @tkawen/mystoq-mcp-server — MCP server for AI agents
Contributing
PRs welcome. See CONTRIBUTING.md for guidelines.
Sponsoring
If this saves you time, sponsor the project or contribute back.
🏛️ TKAWEN Ecosystem · منظومة تكوّن
EN — Part of TKAWEN, Algeria's software ecosystem: commerce, certification, meetings and AI infrastructure. One organisation, one trust layer.
عربي — جزء من تكوّن، المنظومة البرمجية الجزائرية: تجارة، توثيق، اجتماعات، وبنية ذكاء اصطناعي. مؤسّسة واحدة، طبقة ثقة واحدة.
Packages · الحزم: @tkawen/mystoq-sdk · @tkawen/mystoq-react · @tkawen/mystoq-mcp-server · @tkawen/mystoq-seo-toolkit · @tkawen/mystoq-maystro-bridge · @tkawen/mystoq-whatsapp-bridge · @tkawen/mystoq-yalidine-bridge · @tkawen/liqaa-js · @tkawen/liqaa-react
MCP Gateway: mcp.tkawen.com — official in the Model Context Protocol Registry (com.tkawen/intelligence-gateway)
Web: tkawen.com · Author · المؤلّف: Hartem Yaakoub · License: MIT
