@lynxflow/seo-engine 1.5.2 → 1.5.3
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.
- package/dist/index.js +113 -6
- package/dist/index.mjs +113 -6
- package/package.json +1 -1
- package/src/llm-prompt.ts +113 -6
package/dist/index.js
CHANGED
|
@@ -3649,10 +3649,10 @@ When discovering or listing product modules, features, or services to build the
|
|
|
3649
3649
|
- DO NOT create programmatic pages for internal plumbing like: \`/api/stripe\`, \`/api/resend\`, \`/api/auth\`, \`/api/d1\`, \`/api/webhooks\`, \`/api/openai\`.
|
|
3650
3650
|
- 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.
|
|
3651
3651
|
- **✅ ALWAYS inspect the FRONTEND user-facing interface & commercial value propositions:**
|
|
3652
|
-
-
|
|
3653
|
-
-
|
|
3654
|
-
-
|
|
3655
|
-
-
|
|
3652
|
+
- **Step 1A - Marketing Navbars & Dropdowns:** Scan \`components/Navbar.tsx\`, \`components/Header.tsx\`, \`components/Navigation.tsx\` to list all primary product modules.
|
|
3653
|
+
- **Step 1B - Marketing Feature Pages & Pricing:** Scan \`app/(marketing)/*\`, \`pages/features/*\`, \`app/pricing/*\` to list commercial feature names and pricing tiers.
|
|
3654
|
+
- **Step 1C - Dashboard Navigation & User Tools:** Scan \`components/dashboard/*\`, \`components/sidebar/*\` to find actual user workflows.
|
|
3655
|
+
- **Step 1D - Extraction Requirement:** For EACH discovered module (or major product branch), create at least 1 programmatic service entry with \`slug\`, \`name\`, \`category\`, \`description\`, \`keyFeatures\`, and \`priceMonthly\`.
|
|
3656
3656
|
|
|
3657
3657
|
---
|
|
3658
3658
|
|
|
@@ -3689,7 +3689,114 @@ How category leaders generate millions of high-converting pages without server s
|
|
|
3689
3689
|
|
|
3690
3690
|
---
|
|
3691
3691
|
|
|
3692
|
-
### \
|
|
3692
|
+
### \uD83D\uDEE0️ 4. AI AGENT IMPLEMENTATION PROTOCOL (STEP-BY-STEP)
|
|
3693
|
+
|
|
3694
|
+
When setting up programmatic SEO in any codebase, the AI Agent MUST generate these exact 4 files:
|
|
3695
|
+
|
|
3696
|
+
#### File 1: Configuration & Dataset (\`lib/seo.ts\`)
|
|
3697
|
+
\`\`\`typescript
|
|
3698
|
+
import { PseoMatrixEngine } from "@lynxflow/seo-engine";
|
|
3699
|
+
|
|
3700
|
+
export const matrixEngine = new PseoMatrixEngine();
|
|
3701
|
+
|
|
3702
|
+
export const SEO_CONFIG = {
|
|
3703
|
+
brandName: "Acme",
|
|
3704
|
+
language: "en",
|
|
3705
|
+
minPopulationToIndex: 15_000,
|
|
3706
|
+
};
|
|
3707
|
+
|
|
3708
|
+
// Discovered EXCLUSIVELY from Frontend UI components
|
|
3709
|
+
export const PSEO_DATASET = {
|
|
3710
|
+
services: [
|
|
3711
|
+
// 1 per major frontend feature branch
|
|
3712
|
+
{ slug: "crm-pipeline", name: "Visual CRM Pipeline", category: "Sales", keyFeatures: ["Kanban", "Lead scoring"], description: "Visual deal tracking" },
|
|
3713
|
+
],
|
|
3714
|
+
targets: [
|
|
3715
|
+
{ slug: "law-firms", name: "Law Firms", type: "industry", painPoints: ["Billing"], benefits: ["Compliance"] },
|
|
3716
|
+
],
|
|
3717
|
+
integrations: [
|
|
3718
|
+
{ slug: "shopify", name: "Shopify", category: "E-Commerce", syncFeatures: ["Order sync"] },
|
|
3719
|
+
],
|
|
3720
|
+
templates: [
|
|
3721
|
+
{ slug: "sales-tracker-excel", title: "Sales Tracker", topic: "Sales", format: "excel", benefits: ["Instant setup"] },
|
|
3722
|
+
],
|
|
3723
|
+
glossaryTerms: [
|
|
3724
|
+
{ slug: "mrr", term: "MRR", shortDefinition: "Monthly Recurring Revenue" },
|
|
3725
|
+
],
|
|
3726
|
+
};
|
|
3727
|
+
\`\`\`
|
|
3728
|
+
|
|
3729
|
+
#### File 2: Universal Dynamic Catch-All Route (\`app/[...slug]/page.tsx\`)
|
|
3730
|
+
\`\`\`tsx
|
|
3731
|
+
import { notFound } from "next/navigation";
|
|
3732
|
+
import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
|
|
3733
|
+
|
|
3734
|
+
export async function generateMetadata({ params }: { params: { slug: string[] } }) {
|
|
3735
|
+
const path = "/" + params.slug.join("/");
|
|
3736
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
3737
|
+
const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
|
|
3738
|
+
const page = pages.find((p) => p.urlPath === path);
|
|
3739
|
+
if (!page) return {};
|
|
3740
|
+
return { title: page.title, description: page.description, alternates: { canonical: page.canonicalUrl }, robots: page.robots };
|
|
3741
|
+
}
|
|
3742
|
+
|
|
3743
|
+
export default async function ProgrammaticPage({ params }: { params: { slug: string[] } }) {
|
|
3744
|
+
const path = "/" + params.slug.join("/");
|
|
3745
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
3746
|
+
const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
|
|
3747
|
+
const page = pages.find((p) => p.urlPath === path);
|
|
3748
|
+
if (!page) notFound();
|
|
3749
|
+
|
|
3750
|
+
return (
|
|
3751
|
+
<article className="max-w-4xl mx-auto py-12 px-6">
|
|
3752
|
+
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(page.schemaGraph) }} />
|
|
3753
|
+
<h1 className="text-4xl font-extrabold">{page.h1}</h1>
|
|
3754
|
+
<p className="mt-4 text-xl text-gray-600">{page.description}</p>
|
|
3755
|
+
{page.disclaimerText && <aside className="mt-8 p-4 bg-gray-50 border rounded text-xs text-gray-500">{page.disclaimerText}</aside>}
|
|
3756
|
+
</article>
|
|
3757
|
+
);
|
|
3758
|
+
}
|
|
3759
|
+
\`\`\`
|
|
3760
|
+
|
|
3761
|
+
#### File 3: Dynamic XML Sitemap (\`app/sitemap.ts\`)
|
|
3762
|
+
\`\`\`typescript
|
|
3763
|
+
import { MetadataRoute } from "next";
|
|
3764
|
+
import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
|
|
3765
|
+
|
|
3766
|
+
export default function sitemap(): MetadataRoute.Sitemap {
|
|
3767
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
3768
|
+
const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
|
|
3769
|
+
return pages.filter((p) => p.robots.includes("index")).map((p) => ({
|
|
3770
|
+
url: p.canonicalUrl,
|
|
3771
|
+
lastModified: new Date(),
|
|
3772
|
+
changeFrequency: "weekly",
|
|
3773
|
+
priority: 0.8,
|
|
3774
|
+
}));
|
|
3775
|
+
}
|
|
3776
|
+
\`\`\`
|
|
3777
|
+
|
|
3778
|
+
#### File 4: Dynamic AI Search Markdown Feed (\`app/llms.txt/route.ts\`)
|
|
3779
|
+
\`\`\`typescript
|
|
3780
|
+
import { NextResponse } from "next/server";
|
|
3781
|
+
import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
|
|
3782
|
+
|
|
3783
|
+
export async function GET() {
|
|
3784
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
3785
|
+
const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
|
|
3786
|
+
const markdown = [
|
|
3787
|
+
\`# \${SEO_CONFIG.brandName} Solutions Index\`,
|
|
3788
|
+
\`> Structured knowledge feed for LLMs and AI search engines (ChatGPT, Perplexity).\`,
|
|
3789
|
+
\`\`,
|
|
3790
|
+
\`## Solutions & Matrices\`,
|
|
3791
|
+
...pages.map((p) => \`- [\${p.h1}](\${p.canonicalUrl}): \${p.description}\`),
|
|
3792
|
+
].join("\\n");
|
|
3793
|
+
return new NextResponse(markdown, { headers: { "Content-Type": "text/plain; charset=utf-8" } });
|
|
3794
|
+
}
|
|
3795
|
+
\`\`\`
|
|
3796
|
+
|
|
3797
|
+
---
|
|
3798
|
+
|
|
3799
|
+
### \uD83C\uDFDB️ 5. MATRIX ARCHITECTURE: 10 ROOT PILLARS & 50+ SPECIALIZED SUB-MATRICES
|
|
3693
3800
|
|
|
3694
3801
|
1. **10 Canonical Root Pillars:**
|
|
3695
3802
|
- Comparisons: \`/vs/{competitor}\`
|
|
@@ -3714,7 +3821,7 @@ How category leaders generate millions of high-converting pages without server s
|
|
|
3714
3821
|
|
|
3715
3822
|
---
|
|
3716
3823
|
|
|
3717
|
-
### \uD83E\uDDF9
|
|
3824
|
+
### \uD83E\uDDF9 6. URL SLUG INTEGRITY & SCHEMA.ORG
|
|
3718
3825
|
|
|
3719
3826
|
- Use \`cleanSeoSlug(text, { language })\` to strip accents, dates, and stop words.
|
|
3720
3827
|
- Use \`ExtendedSchemaGraphBuilder\` to output valid JSON-LD graphs (\`SoftwareApplication\`, \`LocalBusiness\`, \`HowTo\`, \`FAQPage\`, \`BreadcrumbList\`, \`Organization\`).
|
package/dist/index.mjs
CHANGED
|
@@ -3551,10 +3551,10 @@ When discovering or listing product modules, features, or services to build the
|
|
|
3551
3551
|
- DO NOT create programmatic pages for internal plumbing like: \`/api/stripe\`, \`/api/resend\`, \`/api/auth\`, \`/api/d1\`, \`/api/webhooks\`, \`/api/openai\`.
|
|
3552
3552
|
- 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.
|
|
3553
3553
|
- **✅ ALWAYS inspect the FRONTEND user-facing interface & commercial value propositions:**
|
|
3554
|
-
-
|
|
3555
|
-
-
|
|
3556
|
-
-
|
|
3557
|
-
-
|
|
3554
|
+
- **Step 1A - Marketing Navbars & Dropdowns:** Scan \`components/Navbar.tsx\`, \`components/Header.tsx\`, \`components/Navigation.tsx\` to list all primary product modules.
|
|
3555
|
+
- **Step 1B - Marketing Feature Pages & Pricing:** Scan \`app/(marketing)/*\`, \`pages/features/*\`, \`app/pricing/*\` to list commercial feature names and pricing tiers.
|
|
3556
|
+
- **Step 1C - Dashboard Navigation & User Tools:** Scan \`components/dashboard/*\`, \`components/sidebar/*\` to find actual user workflows.
|
|
3557
|
+
- **Step 1D - Extraction Requirement:** For EACH discovered module (or major product branch), create at least 1 programmatic service entry with \`slug\`, \`name\`, \`category\`, \`description\`, \`keyFeatures\`, and \`priceMonthly\`.
|
|
3558
3558
|
|
|
3559
3559
|
---
|
|
3560
3560
|
|
|
@@ -3591,7 +3591,114 @@ How category leaders generate millions of high-converting pages without server s
|
|
|
3591
3591
|
|
|
3592
3592
|
---
|
|
3593
3593
|
|
|
3594
|
-
### \
|
|
3594
|
+
### \uD83D\uDEE0️ 4. AI AGENT IMPLEMENTATION PROTOCOL (STEP-BY-STEP)
|
|
3595
|
+
|
|
3596
|
+
When setting up programmatic SEO in any codebase, the AI Agent MUST generate these exact 4 files:
|
|
3597
|
+
|
|
3598
|
+
#### File 1: Configuration & Dataset (\`lib/seo.ts\`)
|
|
3599
|
+
\`\`\`typescript
|
|
3600
|
+
import { PseoMatrixEngine } from "@lynxflow/seo-engine";
|
|
3601
|
+
|
|
3602
|
+
export const matrixEngine = new PseoMatrixEngine();
|
|
3603
|
+
|
|
3604
|
+
export const SEO_CONFIG = {
|
|
3605
|
+
brandName: "Acme",
|
|
3606
|
+
language: "en",
|
|
3607
|
+
minPopulationToIndex: 15_000,
|
|
3608
|
+
};
|
|
3609
|
+
|
|
3610
|
+
// Discovered EXCLUSIVELY from Frontend UI components
|
|
3611
|
+
export const PSEO_DATASET = {
|
|
3612
|
+
services: [
|
|
3613
|
+
// 1 per major frontend feature branch
|
|
3614
|
+
{ slug: "crm-pipeline", name: "Visual CRM Pipeline", category: "Sales", keyFeatures: ["Kanban", "Lead scoring"], description: "Visual deal tracking" },
|
|
3615
|
+
],
|
|
3616
|
+
targets: [
|
|
3617
|
+
{ slug: "law-firms", name: "Law Firms", type: "industry", painPoints: ["Billing"], benefits: ["Compliance"] },
|
|
3618
|
+
],
|
|
3619
|
+
integrations: [
|
|
3620
|
+
{ slug: "shopify", name: "Shopify", category: "E-Commerce", syncFeatures: ["Order sync"] },
|
|
3621
|
+
],
|
|
3622
|
+
templates: [
|
|
3623
|
+
{ slug: "sales-tracker-excel", title: "Sales Tracker", topic: "Sales", format: "excel", benefits: ["Instant setup"] },
|
|
3624
|
+
],
|
|
3625
|
+
glossaryTerms: [
|
|
3626
|
+
{ slug: "mrr", term: "MRR", shortDefinition: "Monthly Recurring Revenue" },
|
|
3627
|
+
],
|
|
3628
|
+
};
|
|
3629
|
+
\`\`\`
|
|
3630
|
+
|
|
3631
|
+
#### File 2: Universal Dynamic Catch-All Route (\`app/[...slug]/page.tsx\`)
|
|
3632
|
+
\`\`\`tsx
|
|
3633
|
+
import { notFound } from "next/navigation";
|
|
3634
|
+
import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
|
|
3635
|
+
|
|
3636
|
+
export async function generateMetadata({ params }: { params: { slug: string[] } }) {
|
|
3637
|
+
const path = "/" + params.slug.join("/");
|
|
3638
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
3639
|
+
const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
|
|
3640
|
+
const page = pages.find((p) => p.urlPath === path);
|
|
3641
|
+
if (!page) return {};
|
|
3642
|
+
return { title: page.title, description: page.description, alternates: { canonical: page.canonicalUrl }, robots: page.robots };
|
|
3643
|
+
}
|
|
3644
|
+
|
|
3645
|
+
export default async function ProgrammaticPage({ params }: { params: { slug: string[] } }) {
|
|
3646
|
+
const path = "/" + params.slug.join("/");
|
|
3647
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
3648
|
+
const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
|
|
3649
|
+
const page = pages.find((p) => p.urlPath === path);
|
|
3650
|
+
if (!page) notFound();
|
|
3651
|
+
|
|
3652
|
+
return (
|
|
3653
|
+
<article className="max-w-4xl mx-auto py-12 px-6">
|
|
3654
|
+
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(page.schemaGraph) }} />
|
|
3655
|
+
<h1 className="text-4xl font-extrabold">{page.h1}</h1>
|
|
3656
|
+
<p className="mt-4 text-xl text-gray-600">{page.description}</p>
|
|
3657
|
+
{page.disclaimerText && <aside className="mt-8 p-4 bg-gray-50 border rounded text-xs text-gray-500">{page.disclaimerText}</aside>}
|
|
3658
|
+
</article>
|
|
3659
|
+
);
|
|
3660
|
+
}
|
|
3661
|
+
\`\`\`
|
|
3662
|
+
|
|
3663
|
+
#### File 3: Dynamic XML Sitemap (\`app/sitemap.ts\`)
|
|
3664
|
+
\`\`\`typescript
|
|
3665
|
+
import { MetadataRoute } from "next";
|
|
3666
|
+
import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
|
|
3667
|
+
|
|
3668
|
+
export default function sitemap(): MetadataRoute.Sitemap {
|
|
3669
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
3670
|
+
const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
|
|
3671
|
+
return pages.filter((p) => p.robots.includes("index")).map((p) => ({
|
|
3672
|
+
url: p.canonicalUrl,
|
|
3673
|
+
lastModified: new Date(),
|
|
3674
|
+
changeFrequency: "weekly",
|
|
3675
|
+
priority: 0.8,
|
|
3676
|
+
}));
|
|
3677
|
+
}
|
|
3678
|
+
\`\`\`
|
|
3679
|
+
|
|
3680
|
+
#### File 4: Dynamic AI Search Markdown Feed (\`app/llms.txt/route.ts\`)
|
|
3681
|
+
\`\`\`typescript
|
|
3682
|
+
import { NextResponse } from "next/server";
|
|
3683
|
+
import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
|
|
3684
|
+
|
|
3685
|
+
export async function GET() {
|
|
3686
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
3687
|
+
const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
|
|
3688
|
+
const markdown = [
|
|
3689
|
+
\`# \${SEO_CONFIG.brandName} Solutions Index\`,
|
|
3690
|
+
\`> Structured knowledge feed for LLMs and AI search engines (ChatGPT, Perplexity).\`,
|
|
3691
|
+
\`\`,
|
|
3692
|
+
\`## Solutions & Matrices\`,
|
|
3693
|
+
...pages.map((p) => \`- [\${p.h1}](\${p.canonicalUrl}): \${p.description}\`),
|
|
3694
|
+
].join("\\n");
|
|
3695
|
+
return new NextResponse(markdown, { headers: { "Content-Type": "text/plain; charset=utf-8" } });
|
|
3696
|
+
}
|
|
3697
|
+
\`\`\`
|
|
3698
|
+
|
|
3699
|
+
---
|
|
3700
|
+
|
|
3701
|
+
### \uD83C\uDFDB️ 5. MATRIX ARCHITECTURE: 10 ROOT PILLARS & 50+ SPECIALIZED SUB-MATRICES
|
|
3595
3702
|
|
|
3596
3703
|
1. **10 Canonical Root Pillars:**
|
|
3597
3704
|
- Comparisons: \`/vs/{competitor}\`
|
|
@@ -3616,7 +3723,7 @@ How category leaders generate millions of high-converting pages without server s
|
|
|
3616
3723
|
|
|
3617
3724
|
---
|
|
3618
3725
|
|
|
3619
|
-
### \uD83E\uDDF9
|
|
3726
|
+
### \uD83E\uDDF9 6. URL SLUG INTEGRITY & SCHEMA.ORG
|
|
3620
3727
|
|
|
3621
3728
|
- Use \`cleanSeoSlug(text, { language })\` to strip accents, dates, and stop words.
|
|
3622
3729
|
- Use \`ExtendedSchemaGraphBuilder\` to output valid JSON-LD graphs (\`SoftwareApplication\`, \`LocalBusiness\`, \`HowTo\`, \`FAQPage\`, \`BreadcrumbList\`, \`Organization\`).
|
package/package.json
CHANGED
package/src/llm-prompt.ts
CHANGED
|
@@ -17,10 +17,10 @@ When discovering or listing product modules, features, or services to build the
|
|
|
17
17
|
- DO NOT create programmatic pages for internal plumbing like: \`/api/stripe\`, \`/api/resend\`, \`/api/auth\`, \`/api/d1\`, \`/api/webhooks\`, \`/api/openai\`.
|
|
18
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
19
|
- **✅ ALWAYS inspect the FRONTEND user-facing interface & commercial value propositions:**
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
20
|
+
- **Step 1A - Marketing Navbars & Dropdowns:** Scan \`components/Navbar.tsx\`, \`components/Header.tsx\`, \`components/Navigation.tsx\` to list all primary product modules.
|
|
21
|
+
- **Step 1B - Marketing Feature Pages & Pricing:** Scan \`app/(marketing)/*\`, \`pages/features/*\`, \`app/pricing/*\` to list commercial feature names and pricing tiers.
|
|
22
|
+
- **Step 1C - Dashboard Navigation & User Tools:** Scan \`components/dashboard/*\`, \`components/sidebar/*\` to find actual user workflows.
|
|
23
|
+
- **Step 1D - Extraction Requirement:** For EACH discovered module (or major product branch), create at least 1 programmatic service entry with \`slug\`, \`name\`, \`category\`, \`description\`, \`keyFeatures\`, and \`priceMonthly\`.
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
@@ -57,7 +57,114 @@ How category leaders generate millions of high-converting pages without server s
|
|
|
57
57
|
|
|
58
58
|
---
|
|
59
59
|
|
|
60
|
-
###
|
|
60
|
+
### 🛠️ 4. AI AGENT IMPLEMENTATION PROTOCOL (STEP-BY-STEP)
|
|
61
|
+
|
|
62
|
+
When setting up programmatic SEO in any codebase, the AI Agent MUST generate these exact 4 files:
|
|
63
|
+
|
|
64
|
+
#### File 1: Configuration & Dataset (\`lib/seo.ts\`)
|
|
65
|
+
\`\`\`typescript
|
|
66
|
+
import { PseoMatrixEngine } from "@lynxflow/seo-engine";
|
|
67
|
+
|
|
68
|
+
export const matrixEngine = new PseoMatrixEngine();
|
|
69
|
+
|
|
70
|
+
export const SEO_CONFIG = {
|
|
71
|
+
brandName: "Acme",
|
|
72
|
+
language: "en",
|
|
73
|
+
minPopulationToIndex: 15_000,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// Discovered EXCLUSIVELY from Frontend UI components
|
|
77
|
+
export const PSEO_DATASET = {
|
|
78
|
+
services: [
|
|
79
|
+
// 1 per major frontend feature branch
|
|
80
|
+
{ slug: "crm-pipeline", name: "Visual CRM Pipeline", category: "Sales", keyFeatures: ["Kanban", "Lead scoring"], description: "Visual deal tracking" },
|
|
81
|
+
],
|
|
82
|
+
targets: [
|
|
83
|
+
{ slug: "law-firms", name: "Law Firms", type: "industry", painPoints: ["Billing"], benefits: ["Compliance"] },
|
|
84
|
+
],
|
|
85
|
+
integrations: [
|
|
86
|
+
{ slug: "shopify", name: "Shopify", category: "E-Commerce", syncFeatures: ["Order sync"] },
|
|
87
|
+
],
|
|
88
|
+
templates: [
|
|
89
|
+
{ slug: "sales-tracker-excel", title: "Sales Tracker", topic: "Sales", format: "excel", benefits: ["Instant setup"] },
|
|
90
|
+
],
|
|
91
|
+
glossaryTerms: [
|
|
92
|
+
{ slug: "mrr", term: "MRR", shortDefinition: "Monthly Recurring Revenue" },
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
\`\`\`
|
|
96
|
+
|
|
97
|
+
#### File 2: Universal Dynamic Catch-All Route (\`app/[...slug]/page.tsx\`)
|
|
98
|
+
\`\`\`tsx
|
|
99
|
+
import { notFound } from "next/navigation";
|
|
100
|
+
import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
|
|
101
|
+
|
|
102
|
+
export async function generateMetadata({ params }: { params: { slug: string[] } }) {
|
|
103
|
+
const path = "/" + params.slug.join("/");
|
|
104
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
105
|
+
const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
|
|
106
|
+
const page = pages.find((p) => p.urlPath === path);
|
|
107
|
+
if (!page) return {};
|
|
108
|
+
return { title: page.title, description: page.description, alternates: { canonical: page.canonicalUrl }, robots: page.robots };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export default async function ProgrammaticPage({ params }: { params: { slug: string[] } }) {
|
|
112
|
+
const path = "/" + params.slug.join("/");
|
|
113
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
114
|
+
const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
|
|
115
|
+
const page = pages.find((p) => p.urlPath === path);
|
|
116
|
+
if (!page) notFound();
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<article className="max-w-4xl mx-auto py-12 px-6">
|
|
120
|
+
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(page.schemaGraph) }} />
|
|
121
|
+
<h1 className="text-4xl font-extrabold">{page.h1}</h1>
|
|
122
|
+
<p className="mt-4 text-xl text-gray-600">{page.description}</p>
|
|
123
|
+
{page.disclaimerText && <aside className="mt-8 p-4 bg-gray-50 border rounded text-xs text-gray-500">{page.disclaimerText}</aside>}
|
|
124
|
+
</article>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
\`\`\`
|
|
128
|
+
|
|
129
|
+
#### File 3: Dynamic XML Sitemap (\`app/sitemap.ts\`)
|
|
130
|
+
\`\`\`typescript
|
|
131
|
+
import { MetadataRoute } from "next";
|
|
132
|
+
import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
|
|
133
|
+
|
|
134
|
+
export default function sitemap(): MetadataRoute.Sitemap {
|
|
135
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
136
|
+
const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
|
|
137
|
+
return pages.filter((p) => p.robots.includes("index")).map((p) => ({
|
|
138
|
+
url: p.canonicalUrl,
|
|
139
|
+
lastModified: new Date(),
|
|
140
|
+
changeFrequency: "weekly",
|
|
141
|
+
priority: 0.8,
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
144
|
+
\`\`\`
|
|
145
|
+
|
|
146
|
+
#### File 4: Dynamic AI Search Markdown Feed (\`app/llms.txt/route.ts\`)
|
|
147
|
+
\`\`\`typescript
|
|
148
|
+
import { NextResponse } from "next/server";
|
|
149
|
+
import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
|
|
150
|
+
|
|
151
|
+
export async function GET() {
|
|
152
|
+
const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://example.com";
|
|
153
|
+
const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
|
|
154
|
+
const markdown = [
|
|
155
|
+
\`# \${SEO_CONFIG.brandName} Solutions Index\`,
|
|
156
|
+
\`> Structured knowledge feed for LLMs and AI search engines (ChatGPT, Perplexity).\`,
|
|
157
|
+
\`\`,
|
|
158
|
+
\`## Solutions & Matrices\`,
|
|
159
|
+
...pages.map((p) => \`- [\${p.h1}](\${p.canonicalUrl}): \${p.description}\`),
|
|
160
|
+
].join("\\n");
|
|
161
|
+
return new NextResponse(markdown, { headers: { "Content-Type": "text/plain; charset=utf-8" } });
|
|
162
|
+
}
|
|
163
|
+
\`\`\`
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
### 🏛️ 5. MATRIX ARCHITECTURE: 10 ROOT PILLARS & 50+ SPECIALIZED SUB-MATRICES
|
|
61
168
|
|
|
62
169
|
1. **10 Canonical Root Pillars:**
|
|
63
170
|
- Comparisons: \`/vs/{competitor}\`
|
|
@@ -82,7 +189,7 @@ How category leaders generate millions of high-converting pages without server s
|
|
|
82
189
|
|
|
83
190
|
---
|
|
84
191
|
|
|
85
|
-
### 🧹
|
|
192
|
+
### 🧹 6. URL SLUG INTEGRITY & SCHEMA.ORG
|
|
86
193
|
|
|
87
194
|
- Use \`cleanSeoSlug(text, { language })\` to strip accents, dates, and stop words.
|
|
88
195
|
- Use \`ExtendedSchemaGraphBuilder\` to output valid JSON-LD graphs (\`SoftwareApplication\`, \`LocalBusiness\`, \`HowTo\`, \`FAQPage\`, \`BreadcrumbList\`, \`Organization\`).
|