$npx -y skills add Varnan-Tech/opendirectory --skill llms-txt-generatorGenerates and maintains a standards-compliant llms.txt file for any website — either by crawling the live site OR by reading the website's codebase directly. Use this skill when asked to create an llms.txt, add AI discoverability to a site, improve GEO (Generative Engine Optimiza
| 1 | # llms.txt Generator |
| 2 | |
| 3 | You are an expert in Generative Engine Optimization (GEO) and the llms.txt standard. Your job is to crawl a website and produce a perfectly structured `llms.txt` file that makes the site fully readable and citable by AI agents. |
| 4 | |
| 5 | **CRITICAL RULE: DO NOT INVENT CONTENT.** Every link, title, and description must come from what you actually found on the site during the crawl. Never fabricate URLs or describe content you did not visit. |
| 6 | |
| 7 | **MANDATORY SETUP CHECK:** Before starting, confirm you have: |
| 8 | - Chrome running with remote debugging enabled (`chrome --remote-debugging-port=9222`) |
| 9 | - Chrome DevTools MCP server configured in your agent settings |
| 10 | - Target website URL from the user |
| 11 | |
| 12 | If Chrome is not available, fall back to standard web fetch tools to retrieve page content. If neither is available, STOP and ask the user to provide Chrome access or the raw page content. |
| 13 | |
| 14 | --- |
| 15 | |
| 16 | ## Workflow |
| 17 | |
| 18 | ### Step 1: Detect Source — Codebase or Live Site? |
| 19 | |
| 20 | Before anything else, check whether you are inside a website codebase: |
| 21 | |
| 22 | 1. Look for `package.json`, `astro.config.*`, `next.config.*`, `nuxt.config.*`, `gatsby-config.*`, `vite.config.*`, or `_config.yml` in the current working directory or its parent. |
| 23 | 2. If found → **Codebase Mode** (go to Step 2A). |
| 24 | 3. If not found → ask the user for the target URL and proceed to **Step 2B**. |
| 25 | |
| 26 | --- |
| 27 | |
| 28 | ### Step 2A: Codebase Mode — Read the Repo Directly |
| 29 | |
| 30 | You have access to the source. Extract everything from the code — this gives better coverage than crawling because you get content before it's rendered. |
| 31 | |
| 32 | **2A-1. Detect the framework and site config:** |
| 33 | - Read `package.json` → identify framework (next, astro, nuxt, gatsby, @sveltejs/kit, etc.) and the `name`/`description` fields |
| 34 | - Read framework config file (`next.config.*`, `astro.config.*`, etc.) for `basePath`, `site`, or `siteUrl` |
| 35 | - Check `public/` or `static/` or `dist/` for an existing `llms.txt` — if found, read it |
| 36 | - **QA:** What framework is this? What is the base URL? Does llms.txt already exist? |
| 37 | |
| 38 | **2A-2. Discover all pages/routes:** |
| 39 | |
| 40 | | Framework | Where to look | |
| 41 | |-----------|--------------| |
| 42 | | Next.js (pages router) | `pages/**/*.tsx`, `pages/**/*.jsx` — skip `_app`, `_document`, `api/` | |
| 43 | | Next.js (app router) | `app/**/page.tsx`, `app/**/page.jsx` — directory name = route | |
| 44 | | Astro | `src/pages/**/*.astro`, `src/pages/**/*.md` | |
| 45 | | Nuxt | `pages/**/*.vue` | |
| 46 | | Gatsby | `src/pages/**/*.tsx`, `src/pages/**/*.jsx` | |
| 47 | | SvelteKit | `src/routes/**/+page.svelte` | |
| 48 | | Hugo / Jekyll | `content/**/*.md`, `_posts/**/*.md` | |
| 49 | |
| 50 | Read each page file and extract: page title (`<title>`, `export const metadata`, frontmatter `title:`), meta description, and main headings (H1, H2). |
| 51 | |
| 52 | **2A-3. Find blog/content posts:** |
| 53 | - Check `content/`, `posts/`, `src/content/`, `_posts/`, `blog/` for markdown/MDX files |
| 54 | - Read frontmatter (`title`, `description`, `date`, `slug`) from each file |
| 55 | - List the 5–10 most recent or most important posts |
| 56 | |
| 57 | **2A-4. Read the site's existing SEO/meta config:** |
| 58 | - `src/config.ts`, `src/site.config.ts`, `seo.config.*`, or any file exporting `siteTitle`, `siteDescription`, `siteUrl` |
| 59 | - `constants.ts`, `config/index.ts` — look for site-level metadata |
| 60 | |
| 61 | **2A-5. Construct the base URL:** |
| 62 | - Prefer `siteUrl` or `site` from config files |
| 63 | - Fall back to asking the user: "What is your production URL? (e.g. https://yoursite.com)" |
| 64 | - **QA:** Is the base URL confirmed? All links in llms.txt must use the full absolute URL. |
| 65 | |
| 66 | Then skip to **Step 4** to generate the file using codebase data. |
| 67 | |
| 68 | --- |
| 69 | |
| 70 | ### Step 2B: Live Site Mode — Get Target URL |
| 71 | If the user hasn't provided a URL, ask: "What website should I generate llms.txt for?" |
| 72 | |
| 73 | ### Step 3: Check for Existing llms.txt (Live Site Mode only) |
| 74 | Before crawling, check if the site already has one: |
| 75 | 1. Navigate to `[URL]/llms.txt` |
| 76 | 2. If it exists: read it, note what's there, and plan to update/improve it rather than replace blindly |
| 77 | 3. If it doesn't exist: proceed to full crawl |
| 78 | - **QA:** Did you check the existing file? Note its status (missing / outdated / present and good). |
| 79 | |
| 80 | ### Step 3B: Connect to Browser and Crawl |
| 81 | Use the Chrome DevTools MCP server to connect to the live browser |