Multi-Agent Collaboration for Team and Friends
TypeScript agent-automationagent-orchestrationagent-workflowai-agentsai-collaborationai-memoryai-workforceautonomous-agentsclaude-codeclaude-code-skillscodexcoding-agentmulti-agentmultiple-agentone-person-businessone-person-companyone-person-teamopencodesolopreneur
feat(web): add /llms.txt agent discovery map (#385)
LindsayLiu7770c7011f362ff
diff --git a/src/web/src/app/blog/page.tsx b/src/web/src/app/blog/page.tsxindex fb3d48d06..e4fcfc6c2 100644--- a/src/web/src/app/blog/page.tsx+++ b/src/web/src/app/blog/page.tsx@@ -12,7 +12,10 @@ export const metadata: Metadata = {description,alternates: {canonical: "https://alook.ai/blog",- types: { "application/rss+xml": "/blog/feed.xml" },+ types: {+ "application/rss+xml": "/blog/feed.xml",+ "text/markdown": "/llms.txt",+ },},openGraph: {title: pageTitle,@@ -60,6 +63,18 @@ export default async function BlogPage() {<p className="mt-4 text-[1.0625rem] text-muted-foreground font-sans leading-relaxed max-w-xl">{description}</p>+ <p className="mt-4 text-xs font-mono uppercase tracking-[0.15em] text-muted-foreground/60">+ <a+ href="/blog/feed.xml"+ className="transition-opacity hover:opacity-70"+ >+ RSS+ </a>+ <span className="mx-2 opacity-40">·</span>+ <a href="/llms.txt" className="transition-opacity hover:opacity-70">+ llms.txt+ </a>+ </p></header>{featured && (diff --git a/src/web/src/app/layout.tsx b/src/web/src/app/layout.tsxindex f4bccdd92..06b1a4d2c 100644--- a/src/web/src/app/layout.tsx+++ b/src/web/src/app/layout.tsx@@ -115,6 +115,9 @@ export const metadata: Metadata = {},alternates: {canonical: SITE_URL,+ types: {+ "text/markdown": "/llms.txt",+ },},};diff --git a/src/web/src/app/llms.txt/route.test.ts b/src/web/src/app/llms.txt/route.test.tsnew file mode 100644index 000000000..722a8e3e4--- /dev/null+++ b/src/web/src/app/llms.txt/route.test.ts@@ -0,0 +1,38 @@+import { beforeEach, describe, expect, it, vi } from "vitest";++vi.mock("@/lib/blog/posts", () => ({+ getAllPosts: vi.fn(),+}));++import { getAllPosts } from "@/lib/blog/posts";+import { GET } from "./route";++describe("GET /llms.txt", () => {+ beforeEach(() => {+ vi.mocked(getAllPosts).mockReset();+ });++ it("returns markdown with blog posts and correct content type", async () => {+ vi.mocked(getAllPosts).mockResolvedValue([+ {+ slug: "why-we-built-alook",+ title: "Why We Built Alook",+ date: "2026-05-15",+ author: "Gus",+ excerpt: "Origin story excerpt.",+ readingTime: "5 min read",+ },+ ]);++ const res = await GET();+ const body = await res.text();++ expect(res.headers.get("Content-Type")).toBe(+ "text/markdown; charset=utf-8"+ );+ expect(body).toContain("# Alook");+ expect(body).toContain(+ "[Why We Built Alook](https://alook.ai/blog/why-we-built-alook)"+ );+ });+});diff --git a/src/web/src/app/llms.txt/route.ts b/src/web/src/app/llms.txt/route.tsnew file mode 100644index 000000000..465da3106--- /dev/null+++ b/src/web/src/app/llms.txt/route.ts@@ -0,0 +1,14 @@+import { getAllPosts } from "@/lib/blog/posts";+import { buildLlmsTxt, LLMS_TXT_SITE_URL } from "@/lib/blog/llms-txt";++export async function GET() {+ const posts = await getAllPosts();+ const body = buildLlmsTxt(posts, LLMS_TXT_SITE_URL);++ return new Response(body, {+ headers: {+ "Content-Type": "text/markdown; charset=utf-8",+ "Cache-Control": "public, max-age=3600",+ },+ });+}diff --git a/src/web/src/app/robots.ts b/src/web/src/app/robots.tsdeleted file mode 100644index e2eb3c76f..000000000--- a/src/web/src/app/robots.ts+++ /dev/null@@ -1,14 +0,0 @@-import type { MetadataRoute } from "next";--export default function robots(): MetadataRoute.Robots {- return {- rules: [- {- userAgent: "*",- allow: "/",- disallow: ["/w/", "/workspaces", "/api/"],- },- ],- sitemap: "https://alook.ai/sitemap.xml",- };-}diff --git a/src/web/src/app/robots.txt/route.test.ts b/src/web/src/app/robots.txt/route.test.tsnew file mode 100644index 000000000..fc3e0cd82--- /dev/null+++ b/src/web/src/app/robots.txt/route.test.ts@@ -0,0 +1,14 @@+import { describe, expect, it } from "vitest";+import { GET } from "./route";++describe("GET /robots.txt", () => {+ it("keeps crawl rules and points agents at llms.txt", async () => {+ const res = await GET();+ const body = await res.text();++ expect(res.headers.get("Content-Type")).toBe("text/plain; charset=utf-8");+ expect(body).toContain("Disallow: /api/");+ expect(body).toContain("Sitemap: https://alook.ai/sitemap.xml");+ expect(body).toContain("https://alook.ai/llms.txt");+ });+});diff --git a/src/web/src/app/robots.txt/route.ts b/src/web/src/app/robots.txt/route.tsnew file mode 100644index 000000000..00e055047--- /dev/null+++ b/src/web/src/app/robots.txt/route.ts@@ -0,0 +1,22 @@+export function GET() {+ const body = [+ "User-agent: *",+ "Allow: /",+ "Disallow: /w/",+ "Disallow: /workspaces",+ "Disallow: /api/",+ "",+ "Sitemap: https://alook.ai/sitemap.xml",+ "",+ "# Agent discovery map (https://llmstxt.org/)",+ "# https://alook.ai/llms.txt",+ "",+ ].join("\n");++ return new Response(body, {+ headers: {+ "Content-Type": "text/plain; charset=utf-8",+ "Cache-Control": "public, max-age=3600",+ },+ });+}diff --git a/src/web/src/app/sitemap.ts b/src/web/src/app/sitemap.tsindex c79b16d1e..313c9aa0e 100644--- a/src/web/src/app/sitemap.ts+++ b/src/web/src/app/sitemap.ts@@ -40,6 +40,12 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {changeFrequency: "weekly",priority: 0.8,},+ {+ url: `${SITE_URL}/llms.txt`,+ lastModified: new Date(),+ changeFrequency: "weekly",+ priority: 0.7,+ },...blogEntries,{url: `${SITE_URL}/privacy`,diff --git a/src/web/src/components/home/marketing-footer.tsx b/src/web/src/components/home/marketing-footer.tsxindex 30e69f64f..4ec0da81c 100644--- a/src/web/src/components/home/marketing-footer.tsx+++ b/src/web/src/components/home/marketing-footer.tsx@@ -12,6 +12,7 @@ gsap.registerPlugin(ScrollTrigger);const footerLinks = [{ href: "/templates", label: "Templates" },{ href: "/blog", label: "Blog" },+ { href: "/llms.txt", label: "llms.txt" },{ href: "https://github.com/alookai/alook", label: "GitHub", external: true },{ href: "https://discord.alook.ai", label: "Discord", external: true },{ href: "https://x.com/alook_ai", label: "X", external: true },diff --git a/src/web/src/components/public-layout.tsx b/src/web/src/components/public-layout.tsxindex 317c7c0e7..7a56bcb01 100644--- a/src/web/src/components/public-layout.tsx+++ b/src/web/src/components/public-layout.tsx@@ -4,6 +4,7 @@ import Image from "next/image";const footerLinks = [{ href: "/templates", label: "Templates" },{ href: "/blog", label: "Blog" },+ { href: "/llms.txt", label: "llms.txt" },{ href: "https://github.com/alookai/alook", label: "GitHub", external: true },{ href: "https://discord.alook.ai", label: "Discord", external: true },{ href: "https://x.com/alook_ai", label: "X", external: true },diff --git a/src/web/src/lib/blog/llms-txt.test.ts b/src/web/src/lib/blog/llms-txt.test.tsnew file mode 100644index 000000000..bfcce9ecc--- /dev/null+++ b/src/web/src/lib/blog/llms-txt.test.ts@@ -0,0 +1,81 @@+import { describe, expect, it } from "vitest";+import { buildLlmsTxt } from "./llms-txt";+import type { BlogPost } from "./types";++const samplePosts: BlogPost[] = [+ {+ slug: "why-we-built-alook",+ title: "Why We Built Alook",+ date: "2026-05-15",+ author: "Gus",+ excerpt: "Human excerpt for the post.",+ readingTime: "5 min read",+ agentSummary: "Read when you want the origin story of Alook coordination.",+ },+ {+ slug: "ai-agent-team",+ title: "How to Build an AI Agent Team",+ date: "2026-06-08",+ author: "Alook Team",+ excerpt: "Fallback excerpt when agentSummary is missing.",+ readingTime: "8 min read",+ },+];++describe("buildLlmsTxt", () => {+ it("includes required sections and product facts", () => {+ const text = buildLlmsTxt(samplePosts);++ expect(text.startsWith("# Alook\n")).toBe(true);+ expect(text).toContain(+ "> Connect your own agents and run them as one coordinated team."+ );+ expect(text).toContain("## Key pages");+ expect(text).toContain("## Blog posts");+ expect(text).toContain("## Machine-readable surfaces");+ expect(text).toContain("## How Alook fits");+ expect(text).toContain("## Contact");+ expect(text).toContain("Claude Code, Codex, and OpenCode");+ expect(text).toContain("https://github.com/alookai/alook");+ expect(text).toContain("https://alook.ai/llms.txt");+ });++ it("lists posts with absolute blog URLs, author, and date", () => {+ const text = buildLlmsTxt(samplePosts);++ expect(text).toContain(+ "[Why We Built Alook](https://alook.ai/blog/why-we-built-alook)"+ );+ expect(text).toContain("Gus, published May 15, 2026");+ expect(text).toContain(+ "[How to Build an AI Agent Team](https://alook.ai/blog/ai-agent-team)"+ );+ expect(text).toContain("Alook Team, published June 8, 2026");+ });++ it("prefers agentSummary over excerpt", () => {+ const text = buildLlmsTxt(samplePosts);++ expect(text).toContain(+ "Read when you want the origin story of Alook coordination."+ );+ expect(text).not.toContain("Human excerpt for the post.");+ expect(text).toContain("Fallback excerpt when agentSummary is missing.");+ });++ it("allows a custom site URL", () => {+ const text = buildLlmsTxt(samplePosts, "http://localhost:3000");++ expect(text).toContain(+ "[Why We Built Alook](http://localhost:3000/blog/why-we-built-alook)"+ );+ expect(text).toContain("http://localhost:3000/llms.txt");+ });++ it("handles an empty post list", () => {+ const text = buildLlmsTxt([]);++ expect(text).toContain("- No published posts yet.");+ expect(text).toContain("## Blog posts");+ });+});diff --git a/src/web/src/lib/blog/llms-txt.ts b/src/web/src/lib/blog/llms-txt.tsnew file mode 100644index 000000000..71af6af4e--- /dev/null+++ b/src/web/src/lib/blog/llms-txt.ts@@ -0,0 +1,72 @@+import type { BlogPost } from "./types";++export const LLMS_TXT_SITE_URL = "https://alook.ai";++function formatPostDate(date: string): string {+ return new Date(date).toLocaleDateString("en-US", {+ year: "numeric",+ month: "long",+ day: "numeric",+ timeZone: "UTC",+ });+}++function postSummary(post: BlogPost): string {+ const summary = post.agentSummary?.trim() || post.excerpt.trim();+ return summary;+}++export function buildLlmsTxt(+ posts: BlogPost[],+ siteUrl: string = LLMS_TXT_SITE_URL+): string {+ const blogLines =+ posts.length === 0+ ? ["- No published posts yet."]+ : posts.map((post) => {+ const summary = postSummary(post);+ return `- [${post.title}](${siteUrl}/blog/${post.slug}) — ${post.author}, published ${formatPostDate(post.date)}. ${summary}`;+ });++ return [+ "# Alook",+ "",+ "> Connect your own agents and run them as one coordinated team.",+ "",+ "Alook is an open-source, self-hosted platform that turns local AI agents into a collaborating team. Give agents roles, email addresses, tasks, and shared coordination so you stop routing context by hand. Sign up at alook.ai and connect your local runtime, or self-host.",+ "",+ "Supported agent runtimes today: Claude Code, Codex, and OpenCode.",+ "",+ "## Key pages",+ "",+ `- [Home](${siteUrl}/): Product overview and onboarding`,+ `- [Blog](${siteUrl}/blog): Essays and guides on agent teams and coordination`,+ `- [Blog RSS](${siteUrl}/blog/feed.xml): Machine-readable post feed`,+ `- [GitHub](https://github.com/alookai/alook): Source code and self-host path`,+ `- [Discord](https://discord.alook.ai): Community`,+ "",+ "## Blog posts",+ "",+ ...blogLines,+ "",+ "## Machine-readable surfaces",+ "",+ `- This index: ${siteUrl}/llms.txt`,+ `- Blog RSS: ${siteUrl}/blog/feed.xml`,+ "",+ "## How Alook fits",+ "",+ "1. Bring agents you already run (Claude Code, Codex, OpenCode, …)",+ "2. Connect your local runtime (online signup or self-host)",+ "3. Coordinate as a team: roles, handoffs, email reachability, human review",+ "",+ "## Contact",+ "",+ `- Website: ${siteUrl}`,+ "- GitHub: https://github.com/alookai/alook",+ "- Discord: https://discord.alook.ai",+ "- X: https://x.com/alook_ai",+ "- Support: [email protected]",+ "",+ ].join("\n");+}diff --git a/src/web/src/lib/blog/types.ts b/src/web/src/lib/blog/types.tsindex 5183257d1..a057121af 100644--- a/src/web/src/lib/blog/types.ts+++ b/src/web/src/lib/blog/types.ts@@ -9,4 +9,5 @@ export type BlogPost = {readingTime: string;image?: string;draft?: boolean;+ agentSummary?: string;};