pickstack

Astro + AI visibility (AIO)

llms.txt and AI crawler rules: allow AI search, opt out of training. This page shows exactly what pickstack adds to a Astro project for AI visibility (AIO): the packages, the new files and the changes to existing ones. Every combination is installed, built, linted and tested in CI.

$ npm create pickstack@latest my-app -- --framework astro --modules aio --yes
Customize in the configurator

Packages it adds

PackageVersionType
@astrojs/sitemap^3.7.6runtime

New files

src/pages/llms.txt.ts
import type { APIRoute } from "astro";

export const GET: APIRoute = ({ site }) => {
  const siteUrl = (site?.href ?? "/").replace(/\/$/, "");
  return new Response(`# my-app

> my-app: a web app.

## Pages

- [Home](${siteUrl}/)
- [About](${siteUrl}/about)

## Optional

- [Sitemap](${siteUrl}/sitemap.xml)
`);
};
src/pages/robots.txt.ts
import type { APIRoute } from "astro";

export const GET: APIRoute = ({ site }) => {
  const siteUrl = (site?.href ?? "/").replace(/\/$/, "");
  return new Response(`User-agent: *
Content-Signal: search=yes, ai-input=yes, ai-train=no
Allow: /

User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: meta-externalagent
User-agent: CCBot
User-agent: Bytespider
Disallow: /

Sitemap: ${siteUrl}/sitemap-index.xml
`);
};

Changes to existing files

astro.config.mjs (changed)
 // @ts-check+import sitemap from "@astrojs/sitemap"; import { defineConfig } from "astro/config";   // https://astro.build/config+export default defineConfig({+  site: process.env.SITE_URL ?? "https://example.com",+  integrations: [sitemap()],+});−export default defineConfig({});  
src/layouts/Layout.astro (changed)
⋯ 5 unchanged lines }   const { title } = Astro.props;+const canonical = new URL(Astro.url.pathname, Astro.site);+const jsonLd = JSON.stringify({+  "@context": "https://schema.org",+  "@type": "WebSite",+  name: "my-app",+  url: Astro.site?.href,+}); ---   <html lang="en">⋯ 2 unchanged lines     <meta name="viewport" content="width=device-width" />     <meta name="generator" content={Astro.generator} />     <title>{title}</title>+    <meta name="description" content="my-app: a web app." />+    <link rel="canonical" href={canonical} />+    <link rel="sitemap" href="/sitemap-index.xml" />+    <meta property="og:type" content="website" />+    <meta property="og:title" content={title} />+    <meta property="og:url" content={canonical} />+    <meta name="twitter:card" content="summary" />+    <script type="application/ld+json" set:html={jsonLd} />   </head>   <body>     <main class="app">⋯ 13 unchanged lines
src/pages/about.astro (changed)
⋯ 4 unchanged lines <Layout title="About">   <section class="page">     <h1 class="title">About</h1>+    <p class="text">Built with Astro, TypeScript, SEO, llms.txt.</p>−    <p class="text">Built with Astro, TypeScript.</p>   </section> </Layout>  

Project files

Related templates