ai newsMi., 25. Nov.
EilmeldungYale’s Sonnenfeld: Nvidia is a ‘detriment’ to U.S. industrial might — not a champion

Saubere Markdown-Dokumentation für AI-Coding-Agenten: llms.txt und llms-full.txt

Wer SDKs oder Entwicklertools pflegt, kennt halluzinierte Parameter von KI-Coding-Assistenten, die gestylte HTML-Doku nicht korrekt parsen können. Saubere Markdown-Dateien lösen das Problem.

dev.toDienstag 09:24 · 24.11.DE2 Min. Lesezeit
Bild: dev.to

Wenn du ein SDK, eine API oder ein Entwickler-Tool pflegst, hast du wahrscheinlich schon erlebt, wie ein KI-Coding-Assistent veraltete Flags halluziniert, weil er versuchte, deine stark gestaltete HTML-Dokumentation zu parsen, oder wie er an clientseitigem Hydration scheiterte.

Auch wenn die Google-Suche llms.txt nicht für das Ranking verwendet, ist das Veröffentlichen eines sauberen /llms.txt-Index und eines /llms-full.txt-Markdown-Bundles für Entwickler und Coding-Agents, die deine Dokumentation in ihren Kontext laden, wirklich nützlich.

Der Haken: Die meisten Online-llms.txt-Generatoren funktionieren, indem sie einen Remote-Crawler auf deine öffentliche URL loslassen. Das bricht sofort zusammen, wenn:

Hier ist ein sauberer, local-first Workflow, um /llms.txt und /llms-full.txt in einem Next.js-App-Router-Projekt zu generieren, zu strukturieren und auszuliefern.

# AcmeSDK > TypeScript SDK für Echtzeit-Webhook-Verifizierung und idempotente Event-Queues. ## Core Documentation - [Quickstart](https://docs.example.com/quickstart): SDK installieren und die erste Webhook-Signatur in 5 Minuten verifizieren. - [Authentication](https://docs.example.com/auth): API-Key-Scoping, Rotation und HMAC-SHA256-Header-Verifizierung. ## API & SDK Reference - [Queues API](https://docs.example.com/api/queues): Jobs enqueuen, Retry-Backoff konfigurieren und Dead-Letter-Queues inspizieren. - [Error Codes](https://docs.example.com/api/errors): HTTP-Statuscodes sowie wiederholbare vs. terminale Error-Payloads. ## Optional - [Changelog](https://docs.example.com/changelog): Release Notes und Migrations-Guides. Enter fullscreen mode Exit fullscreen mode Drei Fehler, die du vermeiden solltest: niemals relative Pfade verwenden (immer vollständige kanonische https://-URLs nutzen), vage Link-Titel wie "Click here" oder "Learn more" vermeiden und Marketing-Superlative aus Beschreibungen entfernen, damit jedes Token technische Signale trägt.

Du kannst statische Dateien direkt in public/llms.txt ablegen oder sie über einen Route Handler mit expliziten text/plain; charset=utf-8-Headern und CDN-Caching ausliefern:

// app/llms.txt/route.ts import { NextResponse } from 'next/server'; const LLMS_TXT = `# AcmeSDK > TypeScript SDK für Echtzeit-Webhook-Verifizierung und idempotente Event-Queues. ## Core Documentation - [Quickstart](https://docs.example.com/quickstart): SDK installieren und die erste Webhook-Signatur in 5 Minuten verifizieren. - [Authentication](https://docs.example.com/auth): API-Key-Scoping, Rotation und HMAC-SHA256-Header-Verifizierung. ## Optional - [Changelog](https://docs.example.com/changelog): Release Notes und Migrations-Guides. `; export async function GET ( ) { return new NextResponse ( LLMS_TXT, { status: 200, headers: { 'Content-Type': 'text/plain; charset=utf-8', 'Cache-Control': 'public, max-age=3600, s-maxage=86400', }, } ); } Enter fullscreen mode Exit fullscreen mode 4. Vergiss den robots.txt-Cross-Check nicht. Vor dem Deployment zwei Dinge in /robots.txt bestätigen:

Wenn du ein lokales Sitemap-XML oder rohe HTML-Seiten einfügen möchtest (mit automatischem Entfernen von <nav>, <script> und <footer>), BPE-Token-Anzahlen über GPT/Claude/Gemini/DeepSeek prüfen, llms.txt und robots.txt gemeinsam linten und fertige Next.js-Routen zum direkten Einfügen exportieren willst, ohne private Dokumentation an einen externen Crawler zu schicken: KivaroTools' In-Browser-llms.txt-Studio verarbeitet die gesamte Pipeline lokal und ohne Registrierung. Du kannst auch die Haupt-Browser-Suite von KivaroTools durchstöbern, falls du local-first Entwickler-Utilities bevorzugst.

Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.

Original (Englisch) anzeigen

If you maintain an SDK, API, or developer tool, you've probably watched an AI coding assistant hallucinate outdated flags because it tried to parse your heavily styled HTML docs—or got tripped up by client-side hydration.

Even though Google Search does not use llms.txt for ranking, publishing a clean /llms.txt index and /llms-full.txt Markdown bundle is genuinely useful for developers and coding agents pulling your docs into context.

The catch: most online llms.txt generators work by pointing a remote crawler at your public URL. That breaks immediately if:

Here is a clean, local-first workflow to generate, structure, and serve /llms.txt and /llms-full.txt in a Next.js App Router project.

# AcmeSDK > TypeScript SDK for real-time webhook verification and idempotent event queues. ## Core Documentation - [Quickstart](https://docs.example.com/quickstart): Install the SDK and verify your first webhook signature in 5 minutes. - [Authentication](https://docs.example.com/auth): API key scoping, rotation, and HMAC-SHA256 header verification. ## API & SDK Reference - [Queues API](https://docs.example.com/api/queues): Enqueue jobs, configure retry backoff, and inspect dead-letter queues. - [Error Codes](https://docs.example.com/api/errors): HTTP status codes and retryable vs. terminal error payloads. ## Optional - [Changelog](https://docs.example.com/changelog): Release notes and migration guides. Enter fullscreen mode Exit fullscreen mode Three mistakes to avoid: never use relative paths (always use full https:// canonical URLs), avoid vague link titles like "Click here" or "Learn more," and strip marketing superlatives from descriptions so every token carries technical signal.

You can drop static files straight into public/llms.txt, or serve them via a route handler with explicit text/plain; charset=utf-8 headers and CDN caching:

// app/llms.txt/route.ts import { NextResponse } from 'next/server'; const LLMS_TXT = `# AcmeSDK > TypeScript SDK for real-time webhook verification and idempotent event queues. ## Core Documentation - [Quickstart](https://docs.example.com/quickstart): Install the SDK and verify your first webhook signature in 5 minutes. - [Authentication](https://docs.example.com/auth): API key scoping, rotation, and HMAC-SHA256 header verification. ## Optional - [Changelog](https://docs.example.com/changelog): Release notes and migration guides. `; export async function GET ( ) { return new NextResponse ( LLMS_TXT, { status: 200, headers: { 'Content-Type': 'text/plain; charset=utf-8', 'Cache-Control': 'public, max-age=3600, s-maxage=86400', }, } ); } Enter fullscreen mode Exit fullscreen mode 4. Don't Forget Your robots.txt Cross-Check Before deploying, confirm two things in /robots.txt:

If you want to paste a local Sitemap XML or raw HTML pages (automatically stripping <nav>, <script>, and <footer> ), check BPE token counts across GPT/Claude/Gemini/DeepSeek, lint both llms.txt and robots.txt together, and export ready-to-paste Next.js routes without sending private docs to an external crawler, KivaroTools' in-browser llms.txt studio handles the whole pipeline locally with no sign-up. You can also browse the main KivaroTools browser suite if you prefer local-first developer utilities.

Originaltitel: How to Ship Clean Markdown Docs for AI Coding Agents (llms.txt, llms-full.txt & Next.js Routes Without External Crawlers)Quelle: dev.to (dev.to). Original öffnen