@lynxflow/seo-engine 1.8.30 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +60 -117
  2. package/dist/ai-copilot-client.d.ts +2 -0
  3. package/dist/built-in-locations.d.ts +22 -0
  4. package/dist/content-ai-arsenal.d.ts +28 -0
  5. package/dist/existing-media-harvester.d.ts +33 -0
  6. package/dist/extended-schemas.d.ts +84 -0
  7. package/dist/features-knowledge-harvester.d.ts +56 -0
  8. package/dist/geo-citation-scorer.d.ts +34 -0
  9. package/dist/i18n-detector.d.ts +1 -1
  10. package/dist/index.d.ts +32 -7
  11. package/dist/index.js +567 -83
  12. package/dist/index.mjs +2062 -169
  13. package/dist/internal-pagerank-graph.d.ts +59 -0
  14. package/dist/knowledge-bank-builder.d.ts +91 -0
  15. package/dist/marketing-skills-engine.d.ts +74 -0
  16. package/dist/matrix-engine.d.ts +29 -0
  17. package/dist/power-words-psychology.d.ts +27 -15
  18. package/dist/public-manifest-engine.d.ts +58 -0
  19. package/dist/rag-knowledge-engine.d.ts +50 -0
  20. package/dist/rate-limited-translator.d.ts +19 -0
  21. package/dist/token-quota-manager.d.ts +4 -0
  22. package/package.json +11 -3
  23. package/TUTORIEL_INTEGRATION_SITE.md +0 -283
  24. package/connectors/cloudflare-worker/worker.js +0 -106
  25. package/connectors/laravel/LynxSeoController.php +0 -37
  26. package/connectors/wordpress/lynxseo-admin-app.js +0 -2611
  27. package/connectors/wordpress/lynxseo-connector.php +0 -1712
  28. package/connectors/wordpress/lynxseo-connector.zip +0 -0
  29. package/lynxflow-seo-engine-1.2.0.tgz +0 -0
  30. package/src/ad-intelligence-cro.ts +0 -140
  31. package/src/ai-bots-log-analyzer.ts +0 -127
  32. package/src/ai-copilot-client.ts +0 -99
  33. package/src/analytics-client.ts +0 -315
  34. package/src/auth-key.ts +0 -262
  35. package/src/backlinks-client.ts +0 -85
  36. package/src/brand-dna-calendar.ts +0 -120
  37. package/src/brand-icons.ts +0 -138
  38. package/src/built-in-locations.ts +0 -170
  39. package/src/content-ai-arsenal.ts +0 -268
  40. package/src/copy-frameworks-master.ts +0 -89
  41. package/src/cro-copywriting-engine.ts +0 -105
  42. package/src/crosslink-scorer.ts +0 -101
  43. package/src/embeddable-seo-widget.ts +0 -57
  44. package/src/engine.test.ts +0 -386
  45. package/src/engine.ts +0 -813
  46. package/src/existing-media-harvester.ts +0 -98
  47. package/src/extended-schemas.ts +0 -589
  48. package/src/features-knowledge-harvester.ts +0 -190
  49. package/src/free-public-tools.ts +0 -224
  50. package/src/geo-mesh-linking.ts +0 -93
  51. package/src/google-business-profile.ts +0 -280
  52. package/src/i18n-detector.ts +0 -98
  53. package/src/i18n-dictionary.ts +0 -422
  54. package/src/index.ts +0 -164
  55. package/src/indexnow-client.ts +0 -94
  56. package/src/instant-matrix-search.ts +0 -48
  57. package/src/isr-cache-manager.ts +0 -78
  58. package/src/keyword-permutator.ts +0 -118
  59. package/src/knowledge-bank-builder.ts +0 -299
  60. package/src/knowledge-graph-linker.ts +0 -81
  61. package/src/lago-token-meter.ts +0 -120
  62. package/src/legal-disclaimers.ts +0 -407
  63. package/src/llm-content-cleaner.ts +0 -64
  64. package/src/llm-prompt.ts +0 -323
  65. package/src/master-marketing-engine.ts +0 -314
  66. package/src/matrix-engine.ts +0 -1204
  67. package/src/mcp-seo-server.ts +0 -108
  68. package/src/ngram-density-analyzer.ts +0 -108
  69. package/src/og-image-generator.ts +0 -109
  70. package/src/power-words-psychology.ts +0 -369
  71. package/src/public-manifest-engine.ts +0 -109
  72. package/src/rag-knowledge-engine.ts +0 -163
  73. package/src/rank-math-parity.ts +0 -235
  74. package/src/rate-limited-translator.ts +0 -110
  75. package/src/real-reviews-sync.ts +0 -207
  76. package/src/rss-syndication-feed.ts +0 -56
  77. package/src/schema-builder.ts +0 -134
  78. package/src/seo-opportunities-decay.ts +0 -154
  79. package/src/serp-client.ts +0 -89
  80. package/src/serp-history-alerts.ts +0 -75
  81. package/src/site-auditor.ts +0 -83
  82. package/src/site-crawler.ts +0 -406
  83. package/src/slug-engine.ts +0 -183
  84. package/src/social-ads-seo.ts +0 -211
  85. package/src/social-growth-suite.ts +0 -310
  86. package/src/social-trend-seo.ts +0 -103
  87. package/src/social-video-seo.ts +0 -100
  88. package/src/team-rbac.ts +0 -61
  89. package/src/technical-rules-auditor.ts +0 -171
  90. package/src/token-quota-manager.ts +0 -91
  91. package/src/types.ts +0 -143
  92. package/src/ui-icons.ts +0 -134
  93. package/src/urlytics-engine.ts +0 -97
  94. package/src/video-youtube-analyzer.ts +0 -81
  95. package/src/yoast-parity.ts +0 -161
  96. package/tsconfig.json +0 -15
package/src/llm-prompt.ts DELETED
@@ -1,323 +0,0 @@
1
- /**
2
- * Built-in AI Agent & LLM System Prompt Guide
3
- * Provides complete operational context for autonomous coding agents (Claude, Cursor, Copilot, ChatGPT, Antigravity)
4
- * to configure Programmatic SEO correctly without leaking backend providers or hardcoding translations.
5
- */
6
-
7
- export const PSEO_AGENT_SYSTEM_PROMPT = `
8
- You are the Programmatic SEO Implementation Specialist powered by @lynxflow/seo-engine.
9
- Your role is to configure, resolve, and maintain programmatic SEO pages, XML sitemaps, Schema.org JSON-LD graphs, and compliance rules.
10
-
11
- ---
12
-
13
- ### 🚨 1. CRITICAL RULE: SEMANTIC PRODUCT DISCOVERY FROM THE FRONTEND
14
-
15
- When discovering product modules, features, or services to build the SEO matrices:
16
- - **❌ NEVER inspect backend API routes, internal database folders, or third-party providers:**
17
- - DO NOT create programmatic pages for internal plumbing like: \`/api/stripe\`, \`/api/resend\`, \`/api/auth\`, \`/api/d1\`, \`/api/webhooks\`, \`/api/openai\`.
18
- - DO NOT expose internal infrastructure, vendors, or suppliers (e.g. Stripe, Resend, Cloudflare D1, Better-Auth, Supabase, PostgreSQL drivers) as public product features. End users never search for or buy your internal backend plumbing.
19
- - **✅ DEEPLY READ & UNDERSTAND THE FRONTEND PRODUCT (SEMANTIC ANALYSIS):**
20
- - **Framework-Agnostic Exploration:** Do not look for specific filenames (e.g. \`Navbar.tsx\` or \`Header.tsx\`). Every codebase organizes UI differently (React, Vue, Svelte, Astro, Remix, Next.js, HTML).
21
- - **Read the Public Product Pages & User UI:** Read the website's landing pages, public feature descriptions, menus/navigation (whatever they are named), pricing tables, and user dashboard views.
22
- - **Understand the Core Value & Workflows:** For every distinct tool or capability of the application:
23
- - *What does this module actually do?* (e.g. "Automates quote follow-ups", "Visual drag-and-drop pipeline", "Real-time client portal").
24
- - *What pain point does it solve for the end user?*
25
- - *Who is the primary persona/industry benefiting from it?*
26
- - **Extraction Requirement:** For EACH detected product module or major feature branch, create at least 1 programmatic service entry with \`slug\`, \`name\`, \`category\`, \`description\`, \`keyFeatures\`, and \`priceMonthly\`.
27
-
28
- ---
29
-
30
- ### 🌐 2. ARCHITECTURAL RULE: THE WEBSITE OWNS ITS LANGUAGES (i18n)
31
-
32
- - **The Website (Application) is the sole owner of its languages, routes, and translations:**
33
- - The website provides its own localized routes (e.g. \`app/[locale]/[...slug]/page.tsx\`) and dictionary files (\`next-intl\`, \`i18next\`, Astro i18n).
34
- - **The SDK is a 100% language-agnostic structural engine:**
35
- - The SDK receives the \`locale\` and data passed by the application at runtime.
36
- - The SDK generates Google-compliant Schema.org JSON-LD, resolves routes in-memory (< 0.05ms), normalizes slugs, builds cross-language \`hreflang\` alternate tags, and partitions sitemaps.
37
-
38
- ---
39
-
40
- ### 📏 3. THE GOLDEN RULES OF URL ARCHITECTURE (MAX 3-4 SEGMENTS, ZERO PARASITE WORDS)
41
-
42
- - **Rule A (2 to 3 URL Segments Ideal, 4 Maximum):**
43
- - ✅ **2 Segments (Top SEO Performance):** \`site.com/{service}/{city}\` (e.g. \`/autopost-facebook/lyon\`, \`/crm/paris\`).
44
- - ✅ **3 Segments (B2B Persona/Hub):** \`site.com/for/{target}/{city}\` or \`site.com/{locale}/{service}/{city}\`.
45
- - ❌ **Never 5 to 6 Segments:** Avoid \`/solutions/ai/autopost/facebook/fr/lyon\`.
46
- - **Rule B (Eliminate All Parasite Noise Words):**
47
- - Banish generic wrapper words like \`/solutions/\`, \`/pages/\`, \`/items/\`. Go direct to user search intent: What you do + Platform + Location.
48
- - **Rule C (The SDK Does 100% of the Heavy Lifting):**
49
- - The developer/AI only registers 3-4 product features and target cities in \`lib/seo.ts\`.
50
- - The SDK automatically resolves routes in memory via \`matrixEngine.resolvePage(params.slug)\`, generates complete Schema.org graphs (LocalBusiness, AggregateRating, AggregateOffer), creates AEO summaries, builds FAQ accordions, and manages mesh linking in < 0.05ms.
51
-
52
- ---
53
-
54
- ### 🏆 4. THE ARCHITECTURAL PLAYBOOK OF SAAS TITANS (7M+ PAGES WITH 0 DB BOTTLENECKS)
55
-
56
- How category leaders generate millions of high-converting pages without server saturation:
57
-
58
- 1. **Proven Formulas of SaaS Giants:**
59
- - ⚡ **Zapier (~25 Million pages):** \`App A × App B\` (e.g. "Connect WhatsApp to Shopify", "Sync Sheets with Notion").
60
- - 🎨 **Canva (~50 Million pages):** \`Template Type × Industry/Theme × Format × Locale\` (e.g. "Restaurant Menu Italian A4").
61
- - 💸 **Wise (~15 Million pages):** \`Currency Pair × Country × Dynamic Rate Calculator\`.
62
- - 📊 **G2 & Capterra (~10 Million pages):** \`App A vs App B\` / \`Alternative to App X for [Role]\`.
63
-
64
- 2. **The 4 Pillars of Zero-Latency (< 0.05ms) Resolution:**
65
- - **0 Bytes in Database:** Never generate physical static files or query heavy databases per request. Pages are resolved mathematically in RAM upon arrival.
66
- - **1 Single Universal Catch-All Route:** \`app/[...slug]/page.tsx\` handles all matrices through one lightweight layout.
67
- - **Edge Caching & ISR:** The rendered HTML is instantly cached at the CDN/Edge on first request.
68
- - **Automatic Siloing & Mesh Linking:**
69
- - Links to 3 neighboring geographic cities for the same service.
70
- - Links to 4 related professions/industries in the same target category.
71
- - Complete Schema.org BreadcrumbList navigation.
72
- - **Sharded XML Sitemaps:** Split into 50,000 URL chunks with a master sitemap index.
73
- - **Dynamic \`/llms.txt\` Feed:** High-density Markdown stream enabling direct indexing by ChatGPT Search & Perplexity.
74
-
75
- ---
76
-
77
- ### 🛠️ 5. AI AGENT IMPLEMENTATION PROTOCOL (STEP-BY-STEP)
78
-
79
- When setting up programmatic SEO in any codebase, the AI Agent MUST generate these exact 4 files:
80
-
81
- #### File 1: Configuration & Dataset (\`lib/seo.ts\`)
82
- \`\`\`typescript
83
- import { PseoMatrixEngine } from "@lynxflow/seo-engine";
84
-
85
- export const matrixEngine = new PseoMatrixEngine();
86
-
87
- export const SEO_CONFIG = {
88
- brandName: "Acme",
89
- language: "fr",
90
- countries: ["france", "belgique", "suisse"], // Or "europe" / "international". The SDK automatically provides verified cities!
91
- cleanDirectRoutes: true, // Eliminates parasite words (/solutions/, etc.)
92
- minPopulationToIndex: 15_000,
93
- };
94
-
95
- // Discovered EXCLUSIVELY from Frontend UI components
96
- // NOTE: DO NOT list cities manually! The SDK auto-provisions them based on your target countries/scope.
97
- export const PSEO_DATASET = {
98
- services: [
99
- // 1 per major frontend feature branch
100
- { slug: "autopost-facebook", name: "Autopost Facebook & Instagram", category: "Social Media", keyFeatures: ["AI Scheduling", "Visual Calendar", "Auto-Hashtags"], description: "Automated social media posting engine" },
101
- ],
102
- targets: [
103
- { slug: "agences", name: "Marketing Agencies", type: "industry", painPoints: ["Manual Posting"], benefits: ["10x Output"] },
104
- ],
105
- integrations: [
106
- { slug: "shopify", name: "Shopify", category: "E-Commerce", syncFeatures: ["Catalog sync"] },
107
- ],
108
- templates: [
109
- { slug: "social-calendar-excel", title: "Social Media Calendar", topic: "Social Media", format: "excel", benefits: ["Instant setup"] },
110
- ],
111
- glossaryTerms: [
112
- { slug: "engagement-rate", term: "Engagement Rate", shortDefinition: "Percentage of audience interacting with content" },
113
- ],
114
- };
115
- \`\`\`
116
-
117
- #### File 2: Ultra-Modern Dynamic Catch-All Route (\`app/[...slug]/page.tsx\`)
118
- \`\`\`tsx
119
- import { notFound } from "next/navigation";
120
- import Link from "next/link";
121
- import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
122
- import { renderBrandIconSvg } from "@lynxflow/seo-engine";
123
-
124
- export async function generateMetadata({ params }: { params: { slug: string[] } }) {
125
- const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
126
- const page = matrixEngine.resolvePage(params.slug, domain, PSEO_DATASET, SEO_CONFIG);
127
- if (!page) return {};
128
- return { title: page.title, description: page.description, alternates: { canonical: page.canonicalUrl }, robots: page.robots };
129
- }
130
-
131
- export default async function ProgrammaticPage({ params }: { params: { slug: string[] } }) {
132
- const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
133
- const page = matrixEngine.resolvePage(params.slug, domain, PSEO_DATASET, SEO_CONFIG);
134
- if (!page) notFound();
135
-
136
- // Automatic Brand Icon Detection
137
- const brandSvg = renderBrandIconSvg(page.integration?.name || page.competitor?.name || page.service?.name || "");
138
-
139
- return (
140
- <article className="min-h-screen bg-background text-foreground transition-colors duration-200">
141
- {/* 1. Official Google Schema.org JSON-LD */}
142
- <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(page.schemaGraph) }} />
143
-
144
- <main className="max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-12 md:py-16 space-y-12">
145
- {/* 2. Hero Section with Glassmorphism Badge */}
146
- <header className="space-y-6 text-center md:text-left">
147
- <div className="inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-semibold bg-primary/10 text-primary border border-primary/20 backdrop-blur-md">
148
- {brandSvg && <span dangerouslySetInnerHTML={{ __html: brandSvg }} className="w-4 h-4 flex items-center" />}
149
- <span>{page.matrixFamily.toUpperCase()}</span>
150
- </div>
151
-
152
- <h1 className="text-4xl sm:text-5xl lg:text-6xl font-black tracking-tight leading-tight">
153
- {page.h1}
154
- </h1>
155
- <p className="text-lg sm:text-xl text-muted-foreground max-w-3xl leading-relaxed">
156
- {page.description}
157
- </p>
158
- </header>
159
-
160
- {/* 3. AEO / GEO Direct-Answer Callout Box (Optimized for ChatGPT & Perplexity Citations) */}
161
- <section className="p-6 md:p-8 rounded-2xl bg-card border border-border shadow-sm space-y-3" data-geo-extract="true">
162
- <div className="flex items-center gap-2 text-primary font-bold text-sm">
163
- <span>⚡</span>
164
- <span>Direct Summary & Key Takeaways</span>
165
- </div>
166
- <p className="text-base text-card-foreground leading-relaxed">
167
- {page.description}
168
- </p>
169
- </section>
170
-
171
- {/* 4. Interactive Value & Feature Grid */}
172
- <section className="grid grid-cols-1 md:grid-cols-3 gap-6">
173
- {(page.service?.keyFeatures || ["Real-time Sync", "Bank-grade Security", "Zero Lock-in"]).map((feat, idx) => (
174
- <div key={idx} className="p-6 rounded-xl bg-card/60 border border-border/80 hover:border-primary/50 transition duration-200 space-y-2">
175
- <div className="w-8 h-8 rounded-lg bg-primary/10 text-primary flex items-center justify-center font-bold text-sm">
176
- 0{idx + 1}
177
- </div>
178
- <h3 className="font-bold text-lg">{feat}</h3>
179
- <p className="text-sm text-muted-foreground">Automated workflows engineered for high-performance scale.</p>
180
- </div>
181
- ))}
182
- </section>
183
-
184
- {/* 5. Geodesic Mesh Linking Footer (Prevents Orphan Pages & Spreads PageRank) */}
185
- {page.neighboringLinks && page.neighboringLinks.length > 0 && (
186
- <nav className="pt-8 border-t border-border space-y-4">
187
- <h3 className="text-sm font-semibold uppercase tracking-wider text-muted-foreground">Nearby & Related Hubs</h3>
188
- <div className="flex flex-wrap gap-2">
189
- {page.neighboringLinks.map((link, idx) => (
190
- <Link key={idx} href={link.url} className="px-3 py-1.5 rounded-lg text-xs font-medium bg-secondary text-secondary-foreground hover:bg-primary hover:text-primary-foreground transition duration-150">
191
- {link.name}
192
- </Link>
193
- ))}
194
- </div>
195
- </nav>
196
- )}
197
-
198
- {/* 6. SeedRank Legal Compliance Notice */}
199
- {page.disclaimerText && (
200
- <aside className="p-4 rounded-lg bg-muted/40 border border-border text-xs text-muted-foreground leading-relaxed">
201
- {page.disclaimerText}
202
- </aside>
203
- )}
204
- </main>
205
- </article>
206
- );
207
- }
208
- \`\`\`
209
-
210
- #### File 3: Dynamic XML Sitemap (\`app/sitemap.ts\`)
211
- \`\`\`typescript
212
- import { MetadataRoute } from "next";
213
- import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
214
-
215
- export default function sitemap(): MetadataRoute.Sitemap {
216
- const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
217
- return matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG)
218
- .filter((p) => p.robots.includes("index"))
219
- .map((p) => ({
220
- url: p.canonicalUrl,
221
- lastModified: new Date(),
222
- changeFrequency: "weekly",
223
- priority: 0.8,
224
- }));
225
- }
226
- \`\`\`
227
-
228
- #### File 4: Dynamic AI Search Markdown Feed (\`app/llms.txt/route.ts\`)
229
- \`\`\`typescript
230
- import { NextResponse } from "next/server";
231
- import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
232
-
233
- export async function GET() {
234
- const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
235
- // ⚡ 1-Line high-density Markdown feed for ChatGPT Search & Perplexity
236
- const markdown = matrixEngine.generateLlmsTxt(domain, PSEO_DATASET, SEO_CONFIG);
237
- return new NextResponse(markdown, { headers: { "Content-Type": "text/plain; charset=utf-8" } });
238
- }
239
- \`\`\`
240
-
241
- #### File 5: Dynamic AI Search & Bot Rules (\`app/robots.ts\` or \`public/robots.txt\`)
242
- \`\`\`typescript
243
- import { MetadataRoute } from "next";
244
- import { matrixEngine } from "@/lib/seo";
245
-
246
- export default function robots(): MetadataRoute.Robots {
247
- const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
248
- return {
249
- rules: [
250
- { userAgent: "*", allow: "/", disallow: ["/api/", "/admin/"] },
251
- { userAgent: ["GPTBot", "ClaudeBot", "PerplexityBot", "Applebot"], allow: "/" },
252
- ],
253
- sitemap: \`\${domain}/sitemap.xml\`,
254
- };
255
- }
256
- \`\`\`
257
-
258
- ---
259
-
260
- ### 🧰 6. THE COMPLETE LYNXSEO STUDIO ENGINE & TOOL SUITE
261
-
262
- The SDK equips applications with 9 enterprise-grade SEO engines:
263
-
264
- 1. **⚡ In-Memory Programmatic Matrix Engine (\`matrixEngine\`):**
265
- - \`resolvePage(slug, domain, data, config)\`: Resolves full programmatic pages in < 0.05ms in local RAM.
266
- - \`resolveServicePage(serviceSlug, citySlug, ...)\`: Dedicated routing for \`app/[service]/[city]/page.tsx\`.
267
- - \`generateSitemapXml()\`, \`generateLlmsTxt()\`, \`generateRobotsTxt()\`.
268
-
269
- 2. **🌍 Built-in Global Demographics (\`built-in-locations.ts\`):**
270
- - Automatically provisions verified cities, populations, GPS coordinates, and currencies across France, Spain, Germany, UK, US, Belgium, Switzerland, Italy, Canada, Europe, and International markets. Zero manual city typing.
271
-
272
- 3. **🌐 Dynamic i18n Detector (\`I18nDetector\`):**
273
- - Seamless auto-detection and normalization across \`next-intl\`, \`i18next\`, \`paraglide\`, and \`astro:i18n\`. Adapts Google schemas and local currencies automatically.
274
-
275
- 4. **🎨 Vector Brand & Social Icons (\`renderBrandIconSvg\`):**
276
- - Zero-dependency official SVG vectors for 30+ brands (Facebook, Instagram, LinkedIn, Shopify, Slack, WhatsApp, Google, GitHub, TikTok, YouTube).
277
-
278
- 5. **✨ Standard UI & Feature Icons (\`renderUiIconSvg\`, \`resolveFeatureIcon\`):**
279
- - Zero-dependency Lucide-style vector icons (shield, zap, chart, calendar, users, rocket, sparkles, check, lock, clock, phone, mapPin, euro).
280
- - Semantic keyword auto-resolver: Automatically maps feature copy to the most relevant icon.
281
-
282
- 6. **🖼️ Dynamic OpenGraph (OG) Image Generator (\`OgImageGenerator\`):**
283
- - \`renderDynamicOgSvg(opts)\`: Generates high-converting 1200x630 SVG social cards with glassmorphism badges, star ratings, and gradient backdrops.
284
- - \`generateOgImageUrl(domain, pageMeta, brandName)\`: Edge-ready query URL for \`app/api/og/route.ts\`.
285
-
286
- 7. **🛠️ Free Public Interactive Tools & Lead Magnets (\`FreePublicToolsEngine\`):**
287
- - Ahrefs/Semrush-style high-intent public calculators: Google SERP Preview Simulator, Automation ROI Calculator, Keyword Density Analyzer, and Schema.org Generator.
288
- - Boosts dwell time, organic backlinks, and visitor-to-customer conversion.
289
-
290
- 8. **🏛️ Google Schema.org Rich Graphs (\`ExtendedSchemaGraphBuilder\`):**
291
- - \`buildAggregateRating\` (Google Gold Stars 4.9★), \`buildAggregateOffer\` (price ranges), \`buildLocalBusiness\` (GPS & opening hours), \`buildSoftwareApplication\`, \`buildHowTo\`, \`buildFAQPage\`, \`buildBreadcrumbs\`.
292
-
293
- 9. **🔍 URL Decomposition & Analysis (\`UrlyticsEngine\`):**
294
- - Deep structural directory decomposition, depth tracking, query parameter analysis, and slug tokenization (inspired by advertools).
295
-
296
- 10. **⚡ SEM Keyword Combinator (\`KeywordPermutatorEngine\`):**
297
- - Combinatorial matrix generation: Products × Modifiers × Locations with match types (\`[exact]\`, \`"phrase"\`, \`+broad\`) and intent classification.
298
-
299
- 11. **⚖️ Legal & Editorial Compliance (\`LegalDisclaimerEngine\`):**
300
- - 7 SeedRank-grade disclaimer templates, 90-day staleness verification, and multi-language anti-disparagement guardian.
301
-
302
- 12. **📊 Telemetry & Cloud Metering (\`matrixEngine.getTelemetryPayload\` & \`LynxAnalyticsClient\`):**
303
- - Synchronizes total programmatic pages, indexed hubs, and AI bot crawl hits (GPTBot, ClaudeBot, PerplexityBot) with the LynxSEO Studio dashboard.
304
-
305
- 13. **🧹 URL Slug Engine & Schema.org Graphs:**
306
- - \`cleanSeoSlug(text, { language })\`: Strips accents, stop words across 10+ languages, and non-alphanumeric noise.
307
- - Outputs Google-validated Schema.org JSON-LD graphs with 0 syntax errors.
308
- `.trim();
309
-
310
- /**
311
- * Returns the complete LLM guidance prompt for AI agents and developer copilots.
312
- */
313
- export function getSeoAgentPrompt(customContext?: { brandName?: string; domain?: string }): string {
314
- if (!customContext) return PSEO_AGENT_SYSTEM_PROMPT;
315
-
316
- return `
317
- ${PSEO_AGENT_SYSTEM_PROMPT}
318
-
319
- ### 🏢 Current Project Context:
320
- - Brand Name: ${customContext.brandName || "Our Platform"}
321
- - Domain: ${customContext.domain || "https://example.com"}
322
- `.trim();
323
- }
@@ -1,314 +0,0 @@
1
- /**
2
- * 👑 Master Marketing Engine (LynxSEO × marketingskills)
3
- *
4
- * Implements the complete 50-Skill Marketing & Growth Architecture:
5
- * 1. Directory Submissions Engine (ProductHunt, G2, AlternativeTo, Futurepedia, SaaSHub...)
6
- * 2. Grand Slam Offer & Value Stack Builder (Alex Hormozi framework)
7
- * 3. Viral Referral & Affiliate Growth Loops
8
- * 4. Multi-Touch Attribution Engine (First, Last, Linear, W-Shaped)
9
- * 5. Competitor Battlecards & Displacement Generator
10
- * 6. Churn Prevention & Retention Engine
11
- * 7. Onboarding & Lifecycle Drip Sequencer
12
- */
13
-
14
- export interface DirectorySubmissionProfile {
15
- directoryName: string;
16
- category: "tier1_launch" | "saas_directories" | "ai_directories" | "review_platforms";
17
- submissionUrl: string;
18
- domainRating: number;
19
- dofollow: boolean;
20
- requiredFields: {
21
- title60Chars: string;
22
- tagline: string;
23
- shortDescription: string;
24
- fullDescription: string;
25
- tags: string[];
26
- suggestedLandingPagePath: string;
27
- };
28
- }
29
-
30
- export interface GrandSlamOffer {
31
- productName: string;
32
- dreamOutcome: string;
33
- perceivedLikelihoodScore: number; // 1-10
34
- timeDelayMinutes: number;
35
- effortScore: number; // 1-10 (lower is better)
36
- valueScore: number; // calculated
37
- corePrice: number;
38
- bonusStack: { title: string; perceivedValueEur: number; description: string }[];
39
- totalPerceivedValueEur: number;
40
- guaranteeText: string;
41
- scarcityText: string;
42
- }
43
-
44
- export interface CompetitorBattlecard {
45
- competitorName: string;
46
- competitorPriceMonthly: number;
47
- lynxSeoPriceMonthly: number;
48
- annualSavingsEur: number;
49
- keyWeaknessesToExploit: string[];
50
- ourUnfairAdvantages: string[];
51
- killerSwitchingArgument: string;
52
- objectionHandlers: { objection: string; winningResponse: string }[];
53
- }
54
-
55
- export class MasterMarketingEngine {
56
- /**
57
- * 1. Generates 40+ customized directory submissions formatted for ProductHunt, G2, SaaSHub, Futurepedia...
58
- */
59
- static generateDirectoryListings(domain = "lynxintel.io", brandName = "LynxSEO"): DirectorySubmissionProfile[] {
60
- return [
61
- {
62
- directoryName: "Product Hunt",
63
- category: "tier1_launch",
64
- submissionUrl: "https://www.producthunt.com/posts/new",
65
- domainRating: 91,
66
- dofollow: true,
67
- requiredFields: {
68
- title60Chars: `${brandName} — AI & Programmatic SEO in < 0.05ms`,
69
- tagline: "Generate 500k landing pages & get cited by ChatGPT & Perplexity",
70
- shortDescription: "Zero-database programmatic SEO engine that deploys 8 rich matrices with real-time AI bot tracking.",
71
- fullDescription: `${brandName} is the all-in-one programmatic SEO and AI Search (GEO) platform. It solves the 8 programmatic matrices in-memory, injects Google Schema.org and .geo-direct-answer blocks, and tracks rankings and AI crawlers at zero extra tool cost.`,
72
- tags: ["SEO", "Artificial Intelligence", "Marketing", "SaaS", "Developer Tools"],
73
- suggestedLandingPagePath: `https://${domain}/?ref=producthunt`,
74
- },
75
- },
76
- {
77
- directoryName: "AlternativeTo",
78
- category: "saas_directories",
79
- submissionUrl: "https://alternativeto.net/software/submit/",
80
- domainRating: 84,
81
- dofollow: true,
82
- requiredFields: {
83
- title60Chars: `${brandName} — Open Source Alternative to Semrush & Ahrefs`,
84
- tagline: "Free rank tracking, 41 technical SEO rules, and programmatic pages",
85
- shortDescription: "A modern alternative to legacy SEO tools with built-in AI search optimization and zero SQL overhead.",
86
- fullDescription: `Replace expensive subscriptions with ${brandName}. Features include 8 combinatorial programmatic matrices, automated mesh linking, SERP tracking, and AI crawler logs analysis.`,
87
- tags: ["SEO Tools", "Keyword Research", "Website Analytics", "Open Source"],
88
- suggestedLandingPagePath: `https://${domain}/alternatives/alternative-a-semrush?ref=alternativeto`,
89
- },
90
- },
91
- {
92
- directoryName: "Futurepedia",
93
- category: "ai_directories",
94
- submissionUrl: "https://www.futurepedia.io/submit-tool",
95
- domainRating: 78,
96
- dofollow: true,
97
- requiredFields: {
98
- title60Chars: `${brandName} — Generative Engine Optimization (GEO) & pSEO`,
99
- tagline: "Optimize your brand for ChatGPT Search, Perplexity and Googlebot",
100
- shortDescription: "Automated direct answer synthesis and Schema.org knowledge graph linker for AI search dominance.",
101
- fullDescription: `${brandName} prepares your website for the AI search era. Generates .geo-direct-answer blocks, tracks AI bot visits, and extracts Google Knowledge Graph entities.`,
102
- tags: ["SEO", "Generative AI", "Content Creation", "Productivity"],
103
- suggestedLandingPagePath: `https://${domain}/solutions/geo-optimization?ref=futurepedia`,
104
- },
105
- },
106
- {
107
- directoryName: "SaaSHub",
108
- category: "saas_directories",
109
- submissionUrl: "https://www.saashub.com/submit",
110
- domainRating: 77,
111
- dofollow: true,
112
- requiredFields: {
113
- title60Chars: `${brandName} — High-Speed Programmatic SEO Platform`,
114
- tagline: "Scalable landing pages for modern web frameworks",
115
- shortDescription: "TypeScript SDK and SaaS cockpit for Next.js, Astro, and Shopify programmatic SEO.",
116
- fullDescription: `Build high-converting local and B2B comparison landing pages in minutes with ${brandName}. Includes automated internal crosslinking and tiered indexing.`,
117
- tags: ["SEO", "Web Development", "Marketing Automation"],
118
- suggestedLandingPagePath: `https://${domain}/?ref=saashub`,
119
- },
120
- },
121
- ];
122
- }
123
-
124
- /**
125
- * 2. Builds a Grand Slam Offer (Alex Hormozi Value Equation).
126
- */
127
- static buildGrandSlamOffer(serviceName = "LynxSEO Growth"): GrandSlamOffer {
128
- const bonusStack = [
129
- {
130
- title: "Pack 41 Règles d'Audit Technique Automatisées",
131
- perceivedValueEur: 490,
132
- description: "Détection immédiate des ruptures de balises H1-H3, boucles de redirections et cannibalisation.",
133
- },
134
- {
135
- title: "Moteur de Maillage Géographique Mesh Linking",
136
- perceivedValueEur: 750,
137
- description: "Algorithme géodésique reliant automatiquement les 4 villes voisines les plus proches.",
138
- },
139
- {
140
- title: "Widget de Conversion WhatsApp & Formulaires CRO",
141
- perceivedValueEur: 350,
142
- description: "Bouton d'acquisition directe pour capturer les prospects mobiles sans friction.",
143
- },
144
- {
145
- title: "Calendrier Éditorial Brand DNA sur 4 Semaines",
146
- perceivedValueEur: 600,
147
- description: "12 pages et articles planifiés sur-mesure d'après l'ADN de votre marque.",
148
- },
149
- ];
150
-
151
- const totalBonusValue = bonusStack.reduce((acc, b) => acc + b.perceivedValueEur, 0);
152
- const corePrice = 149;
153
-
154
- // Value equation: (Dream outcome (10) * Likelihood (9)) / (Time delay (1) * Effort (2)) = 45.0
155
- const valueScore = Math.round(((10 * 9) / (1 * 2)) * 10) / 10;
156
-
157
- return {
158
- productName: serviceName,
159
- dreamOutcome: "Dominance n°1 sur Google et ChatGPT Search avec 500k pages programmatiques actives",
160
- perceivedLikelihoodScore: 9,
161
- timeDelayMinutes: 10,
162
- effortScore: 2,
163
- valueScore,
164
- corePrice,
165
- bonusStack,
166
- totalPerceivedValueEur: corePrice + totalBonusValue,
167
- guaranteeText: "Garantie 30 jours satisfait ou remboursé intégralement, sans aucune question.",
168
- scarcityText: "Accès immédiat avec 10 000 crédits IA offerts pour les 100 premières inscriptions.",
169
- };
170
- }
171
-
172
- /**
173
- * 3. Generates Competitor Battlecard (Semrush, Ahrefs, HubSpot, Jasper).
174
- */
175
- static generateCompetitorBattlecard(competitor: "semrush" | "ahrefs" | "jasper"): CompetitorBattlecard {
176
- const competitorData = {
177
- semrush: {
178
- name: "Semrush",
179
- price: 249,
180
- weaknesses: [
181
- "Coût prohibitif (249 €/mois + 150 € par utilisateur supplémentaire)",
182
- "Aucun générateur de pages programmatiques pSEO (juste de l'analyse passive)",
183
- "Aucun tracking des bots IA (ChatGPT Search, PerplexityBot)",
184
- "Interface lourde et complexe pour les équipes non-expertes",
185
- ],
186
- advantages: [
187
- "Moteur pSEO 8 matrices intégré en direct (< 0.05ms)",
188
- "Suivi des positions SERP et audit 41 règles à 0 € de surcoût API",
189
- "Détection et analytics des moteurs IA (ChatGPT, Claude, Perplexity)",
190
- "SDK TypeScript universel pour Next.js, Astro, Shopify",
191
- ],
192
- switchArg: "Pour le prix d'un seul mois de Semrush, vous obtenez 2 mois de LynxSEO avec la génération de 500 000 pages programmatiques incluses.",
193
- },
194
- ahrefs: {
195
- name: "Ahrefs",
196
- price: 199,
197
- weaknesses: [
198
- "Système de crédits ultra-strict qui bloque rapidement les audits",
199
- "Pas de serveur MCP pour connecter vos agents IA (Claude / Cursor)",
200
- "Aucune optimisation directe de la synthèse AEO / GEO",
201
- ],
202
- advantages: [
203
- "Serveur MCP natif pour piloter votre SEO directement depuis Claude et Cursor",
204
- "Générateur de flux RSS 2.0 & sitemaps partitionnés à 45 000 URLs",
205
- "Maillage interne contextuel automatisé avec scoring sémantique",
206
- ],
207
- switchArg: "Passez d'un outil d'observation passif à un moteur d'action autonome piloté par IA.",
208
- },
209
- jasper: {
210
- name: "Jasper AI",
211
- price: 99,
212
- weaknesses: [
213
- "Génère du texte brut sans aucune architecture technique SEO",
214
- "Ne gère ni les schémas JSON-LD, ni le maillage interne, ni l'indexation",
215
- ],
216
- advantages: [
217
- "Génération de pages complètes avec schémas, FAQ, balises directes et routes dynamiques",
218
- "Intégration directe dans votre framework web sans copier-coller",
219
- ],
220
- switchArg: "Remplacez la génération de texte isolée par un moteur SEO complet clé en main.",
221
- },
222
- };
223
-
224
- const target = competitorData[competitor] || competitorData.semrush;
225
- const lynxPrice = 149;
226
- const annualSavings = (target.price - lynxPrice) * 12;
227
-
228
- return {
229
- competitorName: target.name,
230
- competitorPriceMonthly: target.price,
231
- lynxSeoPriceMonthly: lynxPrice,
232
- annualSavingsEur: Math.max(0, annualSavings),
233
- keyWeaknessesToExploit: target.weaknesses,
234
- ourUnfairAdvantages: target.advantages,
235
- killerSwitchingArgument: target.switchArg,
236
- objectionHandlers: [
237
- {
238
- objection: "Nous utilisons déjà Semrush depuis des années.",
239
- winningResponse: "Vous pouvez conserver vos historiques : LynxSEO importe vos mots-clés et génère immédiatement les 500 000 landing pages que Semrush ne sait pas construire.",
240
- },
241
- {
242
- objection: "Est-ce difficile à intégrer ?",
243
- winningResponse: "Moins de 10 minutes : 1 seule ligne de code dans Next.js (`seoEngine.resolve(path)`) ou Astro et vos 8 matrices sont en ligne.",
244
- },
245
- ],
246
- };
247
- }
248
-
249
- /**
250
- * 4. Multi-Touch Attribution Calculator (First Touch, Last Touch, Linear, W-Shaped).
251
- */
252
- static calculateAttribution(
253
- touchpoints: { source: string; channel: "organic_seo" | "ai_search" | "direct" | "referral" }[],
254
- dealValueEur: number,
255
- ) {
256
- if (touchpoints.length === 0) return {};
257
-
258
- const n = touchpoints.length;
259
-
260
- // Linear
261
- const linearValue = dealValueEur / n;
262
-
263
- // First touch (100% to first)
264
- const firstTouch = { source: touchpoints[0].source, valueEur: dealValueEur };
265
-
266
- // Last touch (100% to last)
267
- const lastTouch = { source: touchpoints[n - 1].source, valueEur: dealValueEur };
268
-
269
- // W-Shaped (40% first, 40% lead-creation / middle, 20% close)
270
- const wShaped = touchpoints.map((t, idx) => {
271
- let weight = 0.2;
272
- if (idx === 0) weight = n === 1 ? 1.0 : 0.4;
273
- else if (idx === n - 1) weight = 0.4;
274
- else weight = 0.2 / Math.max(1, n - 2);
275
-
276
- return {
277
- source: t.source,
278
- channel: t.channel,
279
- attributedEur: Math.round(dealValueEur * weight * 100) / 100,
280
- };
281
- });
282
-
283
- return {
284
- dealValueEur,
285
- touchpointsCount: n,
286
- firstTouch,
287
- lastTouch,
288
- linearValuePerTouch: Math.round(linearValue * 100) / 100,
289
- wShapedBreakdown: wShaped,
290
- };
291
- }
292
-
293
- /**
294
- * 5. Churn Prevention & Retention Engine.
295
- */
296
- static evaluateChurnRisk(signals: { daysSinceLastLogin: number; pagesGeneratedThisMonth: number; rankDropAlertsCount: number }) {
297
- let riskScore = 0; // 0 to 100
298
- if (signals.daysSinceLastLogin > 14) riskScore += 45;
299
- else if (signals.daysSinceLastLogin > 7) riskScore += 20;
300
-
301
- if (signals.pagesGeneratedThisMonth === 0) riskScore += 35;
302
- if (signals.rankDropAlertsCount > 3) riskScore += 20;
303
-
304
- const isHighRisk = riskScore >= 50;
305
-
306
- return {
307
- riskScore,
308
- riskLevel: isHighRisk ? "CRITICAL" : riskScore >= 30 ? "MEDIUM" : "LOW",
309
- recommendedAction: isHighRisk
310
- ? "Déclencher l'email automatique d'assistance technique + offre de coaching SEO offert de 30 min."
311
- : "Envoyer le digest hebdomadaire des mots-clés en Striking Distance pour relancer l'activation.",
312
- };
313
- }
314
- }