
On this page
llms.txt is a proposed standard (llmstxt.org (opens in a new tab)) for a plain Markdown file at the root of a site that tells AI assistants what the site is and where the important pages are. Think of it as a short, human-readable sitemap for language models.
This site has one at /llms.txt. Below is how it's built in the Next.js App Router, why it's generated instead of written by hand, and what you should and shouldn't expect from it.
First, the honest part
So why add it? It takes a few minutes, it costs nothing at runtime when it's static, and it gives any assistant or agent that does fetch it a clean summary of who you are and what you offer instead of a page full of navigation and markup. For a developer portfolio, that summary is exactly the information you'd want an assistant to repeat.
What goes in the file
The format is ordinary Markdown with a few conventions: an # title, a > one-line summary, then ## sections of links with a short description each.
# Muhammad Ahmad
> Full-Stack MERN Engineer with 4+ years of expertise delivering maintainable, production-ready web applications…
## Pages
- [About](https://builtbyahmad.com/about): experience, skills and education
- [Services](https://builtbyahmad.com/services): frontend, backend, full-stack, API, UI/UX and performance work
## Case studies
- [FoodHub: Building a White-Label Restaurant Ordering SaaS](https://builtbyahmad.com/case-studies/…): …
## Blog
- [How I Took My Next.js Portfolio from 79 to 99 on Lighthouse](https://builtbyahmad.com/blog/…): …Option 1: a static file in public/
The quickest version is public/llms.txt. Next.js serves it as-is. It works, but it goes stale: every new post or project means remembering to edit a second file. On a site with a blog, it will be out of date within a month.
Option 2: a route handler that reads your content
In the App Router, a folder named llms.txt with a route.ts inside serves /llms.txt. This site's handler builds the file from the same loader that feeds the blog, the RSS feed and the sitemap:
import { SITE_CONFIG } from "@/config";
import { profile } from "@/data";
import { getAllCaseStudies, getAllPosts } from "@/lib/content";
import { caseStudyPath, postPath } from "@/lib/content/format";
export function GET() {
const url = (path: string) => `${SITE_CONFIG.url}${path}`;
const posts = getAllPosts();
const studies = getAllCaseStudies();
const body = `# ${SITE_CONFIG.name}
> ${profile.objective}
## Pages
- [About](${url("/about")}): experience, skills and education
- [Services](${url("/services")}): frontend, backend, full-stack, API, UI/UX and performance work
- [Projects](${url("/projects")}): portfolio of web apps, SaaS platforms and websites
- [Contact](${url("/contact")}): hire me for a project
## Case studies
${studies.map((s) => `- [${s.title}](${url(caseStudyPath(s.slug))}): ${s.excerpt}`).join("\n")}
## Blog
${posts.map((p) => `- [${p.title}](${url(postPath(p.slug))}): ${p.excerpt}`).join("\n")}
`;
return new Response(body, {
headers: { "Content-Type": "text/plain; charset=utf-8" },
});
}- It can't go stale. A new blog post appears in
/llms.txton the next build, exactly like it appears in the sitemap. - Drafts stay out. The loader already hides
draft: trueposts in production, and the handler inherits that. - Full URLs. Links use the site's absolute URL, because the file is often read outside the browser, where relative links mean nothing.
text/plain; charset=utf-8. Markdown is plain text; the charset keeps names and symbols readable.
Is it static? Check the build output
Many llms.txt guides tell you to add export const dynamic = "force-static". On a Next.js 16 project with Cache Components on, that's not needed, and route segment configs like dynamic aren't allowed there anyway. A GET handler that doesn't read the request is prerendered at build time. The build output confirms it:
├ ○ /llms.txt
├ ○ /robots.txt
├ ○ /sitemap.xml
○ (Static) prerendered as static contentIf your handler reads request, cookies() or headers(), it becomes dynamic. For a file like this there is no reason to.
Optional: llms-full.txt
Some sites also serve /llms-full.txt with the full text of every page, so a tool can read everything in one request. The same pattern works: an app/llms-full.txt/route.ts that loops over posts and outputs their content as Markdown. For a small site I left it out; llms.txt with good one-line descriptions already says what each page is about.
What actually helps you show up in AI answers
If the goal is to be mentioned by ChatGPT, Perplexity or Google's AI features, llms.txt is the smallest lever. The bigger ones are the same things that help normal search:
- Pages that answer one question clearly, with the answer near the top.
- Real details only you have: numbers from your projects, errors you actually hit, code you actually ran.
- Clear entity information: who you are, what you do, where you are, linked consistently from your site, LinkedIn and GitHub.
- Crawlable HTML, a sitemap and structured data. The full list I used: Next.js 16 SEO checklist.
Frequently asked questions
What is llms.txt?
A proposed standard (llmstxt.org) for a Markdown file at the root of a website that summarises the site and links its important pages, so AI assistants can understand it quickly.
Does llms.txt help Google rankings?
No. Google has said it doesn't use llms.txt for Search. It's an optional extra for AI tools that choose to read it.
How do I add llms.txt in the Next.js App Router?
Either put a static llms.txt in public/, or create app/llms.txt/route.ts with a GET handler that returns Markdown with Content-Type text/plain. Generating it from your content keeps it up to date.
Do I need export const dynamic = "force-static" for llms.txt?
Not with Cache Components in Next.js 16. A GET handler that doesn't read the request is prerendered at build time; check that next build lists /llms.txt as ○ (Static).
- Next.js 16
- llms.txt
- AI search
- Route Handlers
Keep reading
Vizlio · Web design & development agency · Australia
Vizlio: A CMS-Powered Agency Website with a Custom AI Chatbot
The website, admin panel and AI assistant for Vizlio, an Australian web design and development agency. Every page is editable from the admin panel, and a custom-trained chatbot answers visitors' questions about the business. Built solo.
- Website, admin panel and AI chatbot
- 3 in 1
- Site content editable from the admin panel
- 100%

Speed & SEO6 min read
Next.js 16 SEO Checklist: What I Set Up and What Google Search Console Showed
The SEO setup behind this Next.js 16 site, item by item: titles and canonicals, icons, sitemap, robots, JSON-LD and headings, plus what Search Console reported after launch and the one check that fooled me.

AI Coding Tools7 min read
Agent Skills Explained: Write One SKILL.md for Claude Code, Codex, Cursor and Antigravity
Agent Skills are folders of instructions an AI coding agent loads only when a task needs them. What they are, why they beat a giant rules file, how to write your first SKILL.md, and the GitHub repos worth installing from.
