logicsrc/apps/logicsrc-web/src/app/llms.txt/route.ts
Anthony Ettinger eee9ce09c5
Site IA: broad sidebar, four spec families, one registry (#169)
Anthony: "that site needs better information architecture, it's impossible
to find anything", "start broad in sidebar and drill down with dedicated
pages, not all one page", and "I see none of our specs" on the home page.

One registry, lib/specs.ts, now lists every specification in four
families (people and agents; access and credentials; catalogs a site
serves about itself; agents and process), with a landing path, a
specification path and, for OpenServer's blocks, a parent. Everything
that lists specs reads it: the sidebar (lib/nav.ts, four groups: Start,
Specs, Tools, Company, rendered by SiteShell and by the home page string
from the same array), /specs and /specs/<family>, the home page's
Standards Surface grid (families with their specs, replacing the five
abstract primitives), /docs (grouped by family, then guides), the sitemap
and llms.txt. DOC_SLUGS is derived from the registry. Adding a spec is
one entry plus its files; the four hand-kept lists are gone.


Claude-Session: https://claude.ai/code/session_014cmNRtR2vL1p89dbVQ7FZJ

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-12 20:38:28 -07:00

57 lines
2.3 KiB
TypeScript

import { FAMILIES, GUIDES, familyTree } from "@/lib/specs";
const SITE_URL = (process.env.PUBLIC_URL ?? "https://logicsrc.com").replace(/\/$/, "");
// GET /llms.txt — concise, link-rich orientation for LLM crawlers
// (https://llmstxt.org spec). The spec sections are generated from the
// registry in lib/specs.ts, so a new spec appears here without a hand edit.
export function GET(): Response {
const families = FAMILIES.map((family) => {
const lines = familyTree(family).flatMap(({ spec, children }) => {
const url = `${SITE_URL}${spec.landing ?? spec.doc ?? ""}`;
const doc = spec.doc && spec.landing ? ` Specification: ${SITE_URL}${spec.doc}.` : "";
const head = `- [${spec.name}](${url}): ${spec.line}.${doc}`;
const kids = children.map(
(c) => ` - [${c.name}](${SITE_URL}${c.landing ?? c.doc ?? ""}): ${c.line}.`
);
return [head, ...kids];
});
return `## ${family.name}\n\n${family.line}. Family page: ${SITE_URL}/specs/${family.slug}\n\n${lines.join("\n")}`;
});
const guides = GUIDES.map((g) => `- [${g.name}](${SITE_URL}/docs/${g.slug})`).join("\n");
const body = `# LogicSRC
> Open schemas, primitives, and conventions for coordination between humans, AI agents, plugins, payment systems, and hosted products. LogicSRC defines the shared language; products can implement it without owning the standard. A Profullstack, Inc. open-specification project. Every specification is CC BY 4.0.
## Start
- [Home](${SITE_URL}/): Overview.
- [Specs](${SITE_URL}/specs): Every specification, in four families.
- [Docs](${SITE_URL}/docs): Specification text and guides.
- [Blog](${SITE_URL}/blog): Project notes and release announcements.
- [Blog RSS](${SITE_URL}/blog/rss.xml): Machine-readable feed of posts.
- [This site's OpenProfile.md](${SITE_URL}/.well-known/openprofile.md)
${families.join("\n\n")}
## Guides
${guides}
## Company & legal
- [About](${SITE_URL}/about): What LogicSRC is and who maintains it (Profullstack, Inc.).
- [Hire Us](${SITE_URL}/hire-us): Implementation help at $400/hour for accepted LogicSRC work.
- [Pricing](${SITE_URL}/pricing)
- [Terms](${SITE_URL}/terms)
- [Privacy](${SITE_URL}/privacy)
`;
return new Response(body, {
headers: {
"content-type": "text/plain; charset=utf-8",
"cache-control": "public, max-age=3600",
},
});
}