Package Exports
- @sophonn/sophon
Readme
Sophon
Sophon is an open-source programmatic SEO toolkit. It turns a seed keyword or entity list into framework-specific landing pages, sitemaps, schema markup, OG/Twitter cards, internal linking data, and optional AI-enriched content.
Install from npm:
npm install @sophonn/sophonFramework adapters:
| Framework | Output |
|---|---|
| Next.js | app/[slug]/page.tsx |
| Astro | src/pages/[slug].astro |
| Nuxt 3 | pages/[slug].vue |
| SvelteKit | src/routes/[slug]/+page.svelte + +page.ts |
| Remix | app/routes/[slug].tsx |
Who This Is For
Indie hackers π
Go from a niche keyword to dozens of long-tail landing pages without building a custom pipeline from scratch.
Agencies π€
Standardize pSEO execution across client projects with a repeatable discovery-to-publish workflow.
Enterprise teams π’
Use Sophon as a controlled scaffolding layer for large SEO surfaces, while keeping routing, data, and review workflows inside your existing codebase.
Core Workflow βοΈ
- Discover π β normalize entities from a CSV or seed keyword into
data/entities.json - Generate π§± β scaffold one page per entity with OG/Twitter cards, canonical, and YMYL warnings baked in
- Technical π οΈ β emit
sitemap.xml,robots.txt, JSON-LD schema, internal link graph, and hreflang scaffold - Enrich β¨ β use Claude to fill TODO sections with grounded, structured content
Repository Structure π
.
βββ AGENT.md
βββ README.md
βββ src/
β βββ adapters/
β βββ cli.ts
β βββ core/
β βββ index.ts
β βββ types.ts
βββ source/skills/
βββ package.json
βββ tsconfig.json
βββ tsup.config.tsQuickstart β‘
1. Install π¦
npm install @sophonn/sophon2. Run the onboarding interview π§
Ask your AI agent to run sophon teach. It will walk through three groups of questions β project basics, content strategy, technical setup β and save answers to .sophon.md. Every skill references this file before running.
3. Discover entities π
From a seed keyword:
npx @sophonn/sophon discover --seed "best payroll software"With custom expansion patterns:
npx @sophonn/sophon discover \
--seed "best payroll software" \
--pattern "{seed} alternatives" \
--pattern "{seed} pricing" \
--pattern "best {seed}"From a CSV file:
npx @sophonn/sophon discover --csv ./input/entities.csvWrites normalized entities to data/entities.json by default. Extra CSV columns are preserved in metadata.attributes for downstream use.
4. Generate pages π§©
npx @sophonn/sophon generate --framework nextjsOne file per entity. Duplicate slugs are skipped with a warning. Pages with YMYL keywords (health, legal, financial) get editorial warnings. Thin pages are flagged as TODOs. All pages include:
- OG and Twitter card meta tags π·οΈ
- Canonical URL π
- Generated comment block reminding editors not to invent facts π
5. Generate technical SEO assets πΊοΈ
npx @sophonn/sophon technical --site https://example.comOutputs:
| File | Description |
|---|---|
sitemap.xml |
All entity URLs with lastmod, changefreq, priority |
robots.txt |
Allow: * + sitemap pointer |
public/sophon/schema.json |
JSON-LD per entity (WebPage, LocalBusiness, Product, SoftwareApplication) |
public/sophon/internal-links.json |
Related entity pairs scored by shared tags and seed keyword |
public/sophon/hreflang.txt |
<link rel="alternate"> scaffold β wire into your framework manually |
6. Enrich with AI π€
npx @sophonn/sophon enrichRequires ANTHROPIC_API_KEY. Calls Claude to generate structured content per entity: intro, sections, FAQs, comparisons. Uses TODO markers instead of invented content when data is missing. Writes one JSON file per entity to data/enriched/.
7. Run the full pipeline π
npx @sophonn/sophon run --seed "best payroll software" --framework nextjs --site https://example.comPer-step output overrides:
npx @sophonn/sophon run \
--seed "best payroll software" \
--framework sveltekit \
--site https://example.com \
--discover-output ./data/payroll-entities.json \
--generate-output ./src/routes \
--technical-output ./static \
--enrich-output ./data/enriched8. Audit existing SEO setup β
npx @sophonn/sophon auditThis checks common SEO implementations (sitemap, robots, canonical tags, OG/Twitter cards, schema, redirects, 404 handling) and reports what is already in place versus missing.
Safeproof behavior (skip if already implemented) π‘οΈ
Generation and technical commands now skip existing non-Sophon files by default and print a reminder that something is already in place.
Use --force only when you intentionally want to overwrite:
npx @sophonn/sophon generate --framework nextjs --force
npx @sophonn/sophon technical --site https://example.com --forceProgrammatic API π§ͺ
import { discover, generate, technical, enrich } from "@sophonn/sophon";
const result = await discover({ seed: "best payroll software" });
await generate({
entities: result.entities,
framework: "nextjs",
output: "app",
});
await technical({
entities: result.entities,
site: "https://example.com",
output: "public",
});
await enrich({
entities: result.entities,
output: "data/enriched",
});Agent Skills π€
Sophon ships a multi-provider agent skill system. Skills are defined once in source/skills/ and distributed to:
.claude/β Claude Code π¬.agents/β VS Code Copilot agent mode π§.cursor/β Cursor π±οΈ.codex/β Codex CLI β¨οΈ
Six skills: sophon (master context + teach), discover, generate, technical, enrich, run.
All step skills enforce a preparation check: confirm instructions exist β check .sophon.md β run sophon teach if missing.
Typical prompt:
Use Sophon to add a programmatic SEO surface to this Next.js app for the niche "best employee scheduling software". Discover entities, generate the route scaffold, and wire the technical SEO outputs into this codebase.Current Scope π
What Sophon does β :
- Entity ingestion from CSV or seed keyword
- Multi-framework page scaffolding (Next.js, Astro, Nuxt 3, SvelteKit, Remix)
- OG + Twitter card meta tags on every generated page
- Canonical URL per page
- YMYL detection with editorial warnings
- Duplicate slug detection (skips with warning)
sitemap.xmlwithlastmod,changefreq,priorityrobots.txtwith sitemap pointer- JSON-LD schema inference (
WebPage,LocalBusiness,Product,SoftwareApplication) - Internal link graph scored by shared tags and seed keyword
- Hreflang scaffold for multilingual setups
- AI content enrichment via Claude (no-hallucination prompt, TODO markers for missing data)
sophon teachonboarding flow that writes project context to.sophon.md- Multi-provider agent skill system (Claude, Cursor, Codex, VS Code)
What Sophon does not do β:
- OG image generation or responsive image handling
- Actual hreflang implementation (scaffold only β wire it yourself)
- Multilingual content or i18n routing
- Live SERP scraping or real-time data fetching
- Keyword research (seed keywords are user-supplied)
- Deployment or CI integration
- Analytics or tracking tag injection
- Core Web Vitals or page speed optimization
- CMS sync (Contentful, Sanity, etc.)
- Content freshness management or scheduled re-enrichment
- A/B testing or variant generation
What Is Not Part of This pSEO Yet (Coming Soon) β³
These capabilities are intentionally out of scope today and planned for upcoming versions:
- AI-assisted entity expansion and SERP-backed discovery providers
- OG image generation per entity
- First-class multilingual support (not just hreflang scaffold output)
- Pagination and faceted navigation handling helpers
- 404 and redirect helpers (including 301 mapping outputs)
- CMS connectors (Contentful, Sanity)
- Content freshness workflows and scheduled re-enrichment
- Performance-focused generation defaults for Core Web Vitals
Design Principles π§
- Framework agnostic core, Next.js first output π§©
- Minimal config to get started πͺΆ
- Agent-native workflow π€
- Built for scale across hundreds or thousands of pages π
Roadmap π£οΈ
- Pluggable entity discovery providers (SERP APIs, AI expansion)
- OG image generation per entity
- Niche-aware schema presets replacing heuristic inference
- Review and approval workflow before publishing
- Content freshness management and scheduled re-enrichment
- CMS connector (Contentful, Sanity)