# KI-Codierungsregeln für SEO-Inhaltsseiten

> AGENTS.md-Regeln für SEO-fokussierte Inhaltsseiten, die doppelte Metadaten verhindern, strukturierte Daten erzwingen und Agenten daran hindern, die Crawlbarkeit zu beeinträchtigen.

**Type:** Rule  
**Tools:** Cursor, Claude Code, Codex, Windsurf  
**Stack:** Astro, Next.js, TypeScript  
**Updated:** 2026-06-08

---

Fügen Sie dies als `AGENTS.md` in Ihr Repository-Root ein. Es richtet sich an inhaltsreiche Seiten, bei denen der organische Suchverkehr der primäre Wachstumshebel ist — Blogs, Dokumentationsseiten, Marketingseiten und Ressourcenbibliotheken.

## AGENTS.md

```md title="AGENTS.md"
# Project Rules — SEO Content Site

## Stack
- Astro (static) or Next.js (App Router, static export or ISR).
- TypeScript strict. Content schema enforced via Zod (content collections or manual).
- Tailwind CSS for styling.

## Hard rules — SEO correctness
- Every page MUST have a unique `<title>` (50–60 chars) and a unique
  `<meta name="description">` (120–160 chars). Duplicate titles and descriptions
  cause Google to de-rank or rewrite them. Check both before marking a task done.
- Every page MUST render a `<link rel="canonical" href="...">` pointing to its own
  canonical URL. This is required even on pages that are not duplicated — it is a
  signal, not just a deduplication tool.
- Never generate two pages with the same slug or URL path. Before adding a new content
  file or route, confirm the path does not already exist in `src/pages/` or the
  content collection.
- Every blog post or article MUST include JSON-LD structured data: at minimum
  `Article` with `headline`, `datePublished`, `dateModified`, and `author`.
  Product pages need `Product` schema. FAQ pages need `FAQPage` schema.
- Open Graph tags (`og:title`, `og:description`, `og:image`, `og:url`) must be
  present on every page. The `og:image` must be an absolute URL (not a relative path).
- Do NOT use `noindex` on pages that should rank. Do NOT remove `noindex` from pages
  in `src/pages/api/`, `src/pages/admin/`, or any route that should not be crawled.

## URL and routing conventions
- URLs are lowercase, hyphen-separated, no trailing slashes (or consistently with
  trailing slash if the framework default — pick one and enforce it with a redirect).
- Never rename a published URL without adding a 301 redirect from the old path.
  Broken inbound links are ranking signals that are lost permanently.
- Paginated series use `/page/2/` style paths, not query strings (`?page=2`).
  Query-string pagination is not indexed by Google.

## Content and performance
- All images must have descriptive `alt` text that includes the target keyword where
  natural. Empty `alt=""` is only correct for decorative images.
- Images must be served in WebP or AVIF format. No JPEG or PNG without a `<picture>`
  element providing a next-gen fallback.
- Every page must load without render-blocking scripts. No `<script>` without `defer`
  or `async` in the `<head>` unless it is a critical inline script.
- Internal links must use the full path and must not 404. Before adding a link, verify
  the target page exists.

## Definition of done
- `astro check` or `tsc --noEmit` passes.
- `astro build` completes without warnings.
- Running a spot-check: `curl -s <page-url> | grep -c 'canonical'` returns 1.
- No duplicate `<title>` values across built HTML (run `grep -r '<title>'` on dist/).
- JSON-LD is present and valid (use schema.org validator).
```

## Warum diese Regeln

- **Einzigartiger Titel und Beschreibung pro Seite** ist die wirkungsvollste SEO-Regel für Inhaltsseiten. Agenten, die Inhaltsseiten in großen Mengen generieren, verwenden oft dieselbe Metadatenvorlage, wodurch Dutzende von Seiten entstehen, die technisch unterschiedlich sind, aber für Crawler identisch erscheinen — was weiche Deduplizierungsstrafen auslöst.
- **Kanonischer Link auf jeder Seite, nicht nur bei Duplikaten** wird häufig missverstanden. Agenten, die SEO-Dokumentation lesen, fügen oft nur dann kanonische Links hinzu, wenn Inhalte eindeutig dupliziert sind (z. B. Paginierung). In der Praxis sollte jede Seite auf ihren eigenen kanonischen Link verweisen, um zu verhindern, dass parameterinjizierte Crawl-Varianten das Linkkapital aufteilen.

## Geeignet für

- Blogs, Dokumentationsseiten, SEO-Inhaltshubs und Marketingseiten, bei denen der organische Suchverkehr der primäre Akquisitionskanal ist.

## Nicht geeignet für

- Interne Tools, Dashboards oder Anwendungen, bei denen SEO irrelevant ist — die Anforderungen an kanonische Links/strukturierte Daten fügen Overhead hinzu, ohne Nutzen zu bringen.