Guidance for AI coding agents (Claude, Copilot, etc.) working in this repository. Human contributors should read docs/README.md instead.
- Next.js + TypeScript app under
src/ - Markdown content under
content/(posts, pages, employees, …) - Two locales:
en(default, no prefix) andde(/de/prefix) - Blog posts live in
content/posts/*.md(EN) andcontent/posts/*.de.md(DE) - Post URLs are canonically
/posts/YYYY/MM/DD/<slug>(+/de/…for German)
- Add a page → docs/03-adding-pages.md
- Add a blog post → docs/04-adding-blog-post.md
- Testing / QA → docs/06-testing-and-quality-checks.md
The URL slug for a post is resolved in this order (see generatePostSlug() in src/lib/markdown.ts):
- Explicit
slug:in the post's frontmatter (highest priority — protects legacy URLs). - Filename stem with the
YYYY-MM-DD-date prefix and.md/.de.mdextension stripped. This is the canonical default for new posts.
content/posts/2026-02-27-dependency-health.md -> /posts/2026/02/27/dependency-health
content/posts/2026-03-19-container-gov.de.md -> /de/posts/2026/03/19/container-gov
Rules:
- New posts should not set
slug:. Pick a short, kebab-case, ASCII filename (YYYY-MM-DD-<short-slug>.md) and the filename becomes the URL. - Only set
slug:explicitly when you need to override the filename (e.g. keeping backward compatibility with a legacy URL). - If you do set
slug:, keep it short (1–4 words), kebab-case, ASCII. - Never change the filename or
slug:of an already-published post — either moves the URL and breaks backlinks. - Legacy posts carry an explicit
slug:(often long, sometimes with umlauts) that pins them to their historical URL. Do not "clean these up" — those values are load-bearing for existing links.
Full rules and rationale: docs/04-adding-blog-post.md § Slug convention.
Every post is also reachable via /posts/<filename-without-extension> (the legacy Hugo-style alias, produced by getAllPostSlugs()). This alias is intentional backward-compat plumbing — do not remove it, and do not use it in new links.
- Read the referenced
docs/*.mdbefore making structural changes to content or routing. - When touching slug logic in
src/lib/markdown.ts, dump every URL thatgetAllPostSlugs()emits before and after your change and diff — the diff must be empty unless the change is intended to move URLs. - Preserve line-ending style when editing legacy markdown files (some are CRLF).
- Don't remove or rewrite the legacy filename-based alias in
getAllPostSlugs()without explicit sign-off — it protects old inbound links. - Don't run
matter.stringify()(gray-matter) to rewrite existing post frontmatter. It reorders keys, changes quoting, and reformats dates. Do targeted line-level edits on the raw text instead. - Don't strip the explicit
slug:from legacy posts as a "cleanup" — those slugs are pinned to already-indexed URLs and must not change.