Development · Prompt

Programmatic SEO Architecture and Refactor Prompt

System prompt to refactor web apps for 100k+ programmatic SEO pages

A detailed system prompt designed for large language models to audit and refactor web codebases for programmatic SEO. It instructs the AI to design scalable page templates, dynamic metadata, structured schema markup, and internal linking while preventing keyword cannibalization and thin content.

The prompt

Audit and refactor the entire codebase as a senior full-stack engineer and SEO architect with the explicit goal of safely scaling to 100,000+ programmatic SEO pages. Design a programmatic SEO system built on structured data that enables scalable page templates, dynamic routing, and unique intent-matched content per page, including titles, headings, descriptions, and FAQs, while avoiding thin content, duplication, and keyword cannibalization. Implement advanced SEO foundations such as fully dynamic metadata (title, description, canonical, Open Graph, Twitter), appropriate schema markup (Article, FAQ, Breadcrumb, Product, or context-specific types), and intelligent internal linking using hub-and-spoke structures, related pages, and breadcrumbs. Optimize the application for performance and scalability by prioritizing Core Web Vitals, leveraging static generation or incremental regeneration where possible, minimizing bundle size, and ensuring fast builds and effective caching even at very large page counts. Refactor the codebase for clarity, modularity, and long-term maintainability by introducing clean abstractions for SEO logic, data fetching, and page templates, with safeguards and conventions that allow future pages to be added at scale without regressions.

Resulting file structure (from quoted tweet image): src/ — lib/seo/ (index.ts, metadata.ts, schema.ts, linking.ts), lib/pseo/ (index.ts, types.ts, data.ts, uniqueness.ts, validation.ts, cannibalization.ts), data/ (keyword-matrix.ts, pseo/[category]/[slug].json), templates/ (ToolLandingTemplate.tsx, ComparisonTemplate.tsx, GuideTemplate.tsx, CategoryHubTemplate.tsx), components/seo/ (RelatedPages.tsx, Breadcrumbs.tsx, HubLinks.tsx), app/ (tools/[category]/[slug]/page.tsx, guides/[topic]/page.tsx, sitemap/[category]/route.ts).

What it's for

  • Refactor a Next.js or React codebase to support large-scale programmatic page generation
  • Establish automated schema markup, dynamic metadata, and canonical tag structures
  • Design hub-and-spoke internal linking architectures to avoid orphan pages and cannibalization
  • Structure data fetching and caching for scalable static or incremental builds

Key points

  • Instructs LLM to act as a senior full-stack engineer and technical SEO architect
  • Specifies requirements for dynamic metadata, Open Graph, and context-specific schema markup
  • Enforces uniqueness rules to prevent thin content, duplication, and keyword cannibalization
  • Guides the creation of modular templates (tool landings, comparisons, category hubs)
  • Includes architectural guidelines for hub-and-spoke internal linking and breadcrumbs
  • Focuses on build performance, caching strategies, and Core Web Vitals optimization

Pricing

Free

Details

Type
Prompt
Category
Development
Topic
Programmatic SEO
Open source
No
Platforms
Web
For
Full-stack developers, technical SEOs, and indie hackers building programmatic sites
Tags
seo, programmatic seo, prompts, claude, nextjs, architecture

Why it was saved

  • @kalashvasaniya, 15 January 2026: A battle-tested prompt with 850 likes / 2k bookmarks; its outcome (100k pages ranking) is visible in the quoted tweet.

Related

Updated