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
fix(blog): enforce publishing checks and prepare article images (#905)
Gustavo Ye65f8387d7856
diff --git a/.gitignore b/.gitignoreindex cdebc1a47..08d702e93 100644--- a/.gitignore+++ b/.gitignore@@ -31,3 +31,5 @@ src/videos/**/out/.lighthouseci/src/daemon/LICENSE.superpowers/++src/web/blog/public/blog/_generated/diff --git a/src/web/blog/AGENTS.md b/src/web/blog/AGENTS.mdindex 643577dfa..7b19f9743 100644--- a/src/web/blog/AGENTS.md+++ b/src/web/blog/AGENTS.md@@ -7,3 +7,7 @@ This version has breaking changes — APIs, conventions, and file structure mayThis block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.<!-- END:nextjs-agent-rules -->++## Blog publishing contract++Read [README.md](README.md) before adding or revising articles. It defines required metadata, images, links, editorial review, and the checks enforced by Blog build. Keep the documentation and build checks in sync when changing this contract.diff --git a/src/web/blog/README.md b/src/web/blog/README.mdnew file mode 100644index 000000000..0e3666e40--- /dev/null+++ b/src/web/blog/README.md@@ -0,0 +1,71 @@+# Publishing an Alook Blog article++Blog is an independently built Next.js/MDX app. Author articles in `src/content/<slug>.mdx` and keep their images in `public/blog/<slug>/`. Keep the existing article URL when revising a post; use the redirect registry for an intentional URL move.++## Required article elements++Use an exported JavaScript metadata object, **not YAML frontmatter**:++```mdx+export const metadata = {+ slug: "example-guide",+ title: "A clear title that describes the article",+ date: "2026-10-09",+ author: "Alook Team",+ excerpt: "A useful description of the question this article answers.",+ readingTime: "5 min read",+ image: "/blog/example-guide/hero.webp",+};++Answer the reader's question before expanding on it.++++## A descriptive section heading++Include useful explanations, evidence, and relevant links.+```++- Required metadata: `slug`, `title`, `date`, `author`, `excerpt`, `readingTime`. Slug must match the filename, using lowercase words separated by hyphens. Dates use valid `YYYY-MM-DD`; reading time uses `N min read`.+- Optional: `seoTitle` (nonempty when supplied), `dateModified`, `image`, `draft`, `agentSummary`. `seoTitle` changes search/social titles, not the visible H1. Set `dateModified` only for a substantive revision, never earlier than `date`.+- The template owns the single H1. Start body sections at `##`, then use `###` for subsections. Do not add another `# Title`.+- Register every published article once in `src/lib/blog/topics.ts`, with its real topic and reader job. A draft uses `draft: true` and must stay out of public discovery/navigation.+- Use valid article paths and existing heading fragments for internal links. Prefer links that help the reader over a required link count. When publishing, check whether a relevant older article should link to this one.++## Images and sharing++Use normal Markdown image syntax and an existing local `/blog/<slug>/...` URL. Supported source formats are PNG, JPEG, WebP and SVG. Each referenced source must be at most 2 MiB; this ceiling is not a recommended target. Keep whole-article image cost low, especially on mobile. Preserve legibility in screenshots and diagrams.++Use meaningful alt text for informative images. An explicitly empty alt is appropriate only for a decorative image. Do not put keywords into alt text just to influence search.++The build reads real dimensions and generates `src/lib/blog/image-assets.json`; do not hand-edit this manifest. It also generates responsive WebP files in `public/blog/_generated/` (gitignored). The MDX transform emits width/height, responsive sources and decoding hints. The first body image loads eagerly; subsequent images are lazy. Put the intended leading image first. Explicit JSX image markup must meet the same rendered requirements; ordinary Markdown is the supported default.++The OG metadata uses the same asset dimensions as the article. Without `metadata.image`, the existing `/og/blog/<slug>` route supplies a generated sharing image. Do not declare a fixed 1200×630 size for a differently sized source file. Check the final sharing image, not just the metadata string.++## What Blog build checks++From the repository root, run:++```sh+pnpm --filter @alook/web build:blog+```++This includes source validation, image preparation, Next compilation, and rendered article validation before Worker packaging. `build:blog:next` is the internal Next/standalone preparation step used by that command. `validate:blog` alone checks source files; it is not the full publishing gate.++Build errors include missing/invalid required metadata, invalid optional SEO title, duplicate H1 in Markdown, invalid/missing/oversized source images; then, in rendered articles: missing body/title/description, a missing or extra H1, incorrect canonical, noindex, duplicate heading IDs, conflicting/unparseable BlogPosting JSON-LD, missing local article/fragment/image resources, and inconsistent image or OG dimensions. Generated responsive resources must exist. Drafts must not become prerendered public articles. The published article set must match topics, the built index, RSS and discovery manifest (the manifest supplies the main site sitemap).++The existing topic tests compare published MDX and the topic registry in both directions. Run related tests when changing templates or publication behavior; negative fixtures must demonstrate that invalid output actually fails. Keep `image-assets.json` regenerated with any source-image change so a clean checkout can typecheck before its first build.++## Editorial review is still required++These checks do not evaluate truth, search intent, image legibility or originality. Before publication:++1. State which reader question the article answers and how it differs from existing posts; update an older post when that serves readers better.+2. Verify product steps against the current UI. Cite sources for external claims; distinguish tested behavior from documentation-based comparison, and record when volatile facts were checked.+3. Use a real person or team byline. Add author/reviewer context only when accurate. Do not invent expertise or refresh dates to simulate freshness.+4. Check long/multi-image articles at desktop and mobile sizes, including light and dark. Inspect image text, links, anchors and sharing metadata.+5. Follow the existing content and deployment ownership. After deployment, check the public article, images and discovery entries. A successful build or merge is not proof that production has updated.++Title/description length, related-link opportunities and article image budgets are editorial decisions, not fixed ranking rules. Do not pad keywords or add FAQs solely for rich results. Google no longer shows FAQ or HowTo rich results; retain structured data only when it describes real visible content. Review Search Console page/query data when available to prioritize updates; HTTP 200 does not prove indexing or ranking.++References: [Google Article metadata](https://developers.google.com/search/docs/appearance/structured-data/article), [Google image guidance](https://developers.google.com/search/docs/appearance/google-images), [Search feature updates](https://developers.google.com/search/updates).diff --git a/src/web/blog/next.config.ts b/src/web/blog/next.config.tsindex 93c0c0e7c..bd3482d6e 100644--- a/src/web/blog/next.config.ts+++ b/src/web/blog/next.config.ts@@ -3,6 +3,7 @@ import { initOpenNextCloudflareForDev } from "@opennextjs/cloudflare";import type { NextConfig } from "next";import { readFileSync } from "node:fs";import path from "node:path";+import { createRequire } from "node:module";const blogRedirectRules = JSON.parse(readFileSync(path.resolve(__dirname, "src/lib/blog/redirects.json"), "utf8"),@@ -26,6 +27,7 @@ const withMDX = createMDX({options: {remarkPlugins: ["remark-gfm"],rehypePlugins: [+ path.resolve(__dirname, "rehype-blog-images.mjs"),"rehype-slug",["rehype-autolink-headings", { behavior: "wrap" }],["rehype-external-links", { target: "_blank", rel: ["noopener", "noreferrer"] }],@@ -34,7 +36,11 @@ const withMDX = createMDX({},});-export default withMDX(nextConfig);+export default async function blogConfig() {+ const { prepareBlogImages } = createRequire(path.resolve(__dirname, "next.config.ts"))("./scripts/prepare-images.mjs");+ await prepareBlogImages(__dirname);+ return withMDX(nextConfig);+}initOpenNextCloudflareForDev({configPath: path.resolve(__dirname, "wrangler.toml"),diff --git a/src/web/blog/public/blog/ai-team-vs-ai-tools/hero.webp b/src/web/blog/public/blog/ai-team-vs-ai-tools/hero.webpnew file mode 100644index 000000000..8f7229194Binary files /dev/null and b/src/web/blog/public/blog/ai-team-vs-ai-tools/hero.webp differdiff --git a/src/web/blog/public/blog/ai-team-vs-ai-tools/three-advantages.webp b/src/web/blog/public/blog/ai-team-vs-ai-tools/three-advantages.webpnew file mode 100644index 000000000..e5b267961Binary files /dev/null and b/src/web/blog/public/blog/ai-team-vs-ai-tools/three-advantages.webp differdiff --git a/src/web/blog/public/blog/ai-team-vs-ai-tools/workflow.webp b/src/web/blog/public/blog/ai-team-vs-ai-tools/workflow.webpnew file mode 100644index 000000000..9ad4d1a9cBinary files /dev/null and b/src/web/blog/public/blog/ai-team-vs-ai-tools/workflow.webp differdiff --git a/src/web/blog/public/blog/multi-agent-collaboration-without-code/collaboration-mechanisms.webp b/src/web/blog/public/blog/multi-agent-collaboration-without-code/collaboration-mechanisms.webpnew file mode 100644index 000000000..b1fa77686Binary files /dev/null and b/src/web/blog/public/blog/multi-agent-collaboration-without-code/collaboration-mechanisms.webp differdiff --git a/src/web/blog/public/blog/multi-agent-collaboration-without-code/hero.webp b/src/web/blog/public/blog/multi-agent-collaboration-without-code/hero.webpnew file mode 100644index 000000000..18281056aBinary files /dev/null and b/src/web/blog/public/blog/multi-agent-collaboration-without-code/hero.webp differdiff --git a/src/web/blog/public/blog/multi-agent-collaboration-without-code/single-agent-vs-multi-agent-workflow.webp b/src/web/blog/public/blog/multi-agent-collaboration-without-code/single-agent-vs-multi-agent-workflow.webpnew file mode 100644index 000000000..524e56645Binary files /dev/null and b/src/web/blog/public/blog/multi-agent-collaboration-without-code/single-agent-vs-multi-agent-workflow.webp differdiff --git a/src/web/blog/rehype-blog-images.mjs b/src/web/blog/rehype-blog-images.mjsnew file mode 100644index 000000000..564dfdc04--- /dev/null+++ b/src/web/blog/rehype-blog-images.mjs@@ -0,0 +1,32 @@+import { readFileSync } from "node:fs";++export default function rehypeBlogImages() {+ const assets = JSON.parse(readFileSync(new URL("./src/lib/blog/image-assets.json", import.meta.url), "utf8"));+ return (tree) => {+ let first = true;+ function visit(node) {+ const jsx = node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement";+ const tag = jsx ? node.name : node.tagName;+ if (tag === "img" || tag === "source") {+ const properties = jsx ? Object.fromEntries(node.attributes.filter((a) => a.type === "mdxJsxAttribute").map((a) => [a.name, a.value])) : node.properties;+ const src = tag === "img" ? properties.src : properties.srcSet?.split?.(/[,\s]/)[0];+ const asset = assets[src];+ if (!asset) throw new Error(`Unprepared Blog image: ${src}`);+ const values = { width: asset.width, height: asset.height };+ if (tag === "img") {+ Object.assign(values, {+ loading: first ? "eager" : "lazy", decoding: "async",+ ...(asset.srcSet ? { srcSet: asset.srcSet, sizes: "(max-width: 768px) calc(100vw - 48px), 720px" } : {}),+ });+ first = false;+ }+ if (jsx) {+ node.attributes = node.attributes.filter((a) => !(a.name in values));+ node.attributes.push(...Object.entries(values).map(([name, value]) => ({ type: "mdxJsxAttribute", name, value: String(value) })));+ } else Object.assign(node.properties, values);+ }+ for (const child of node.children ?? []) visit(child);+ }+ visit(tree);+ };+}diff --git a/src/web/blog/rehype-blog-images.test.ts b/src/web/blog/rehype-blog-images.test.tsnew file mode 100644index 000000000..68b510df2--- /dev/null+++ b/src/web/blog/rehype-blog-images.test.ts@@ -0,0 +1,28 @@+import { describe, expect, it } from "vitest";+import rehypeBlogImages from "./rehype-blog-images.mjs";++const image = (src = "/blog/ai-agent-team/hero.webp") => ({ type: "element", tagName: "img", properties: { src, alt: "Diagram" } as Record<string, unknown> });+describe("Blog image transform", () => {+ it("reserves true size and keeps first image eager, later images lazy on each article", () => {+ const transform = rehypeBlogImages();+ for (let index = 0; index < 2; index++) {+ const first = image(), second = image();+ transform({ children: [first, { children: [second] }] });+ expect(first.properties).toMatchObject({ width: 1200, height: 800, loading: "eager", alt: "Diagram" });+ expect(second.properties.loading).toBe("lazy");+ expect(first.properties.srcSet).toContain("480w");+ }+ });+ it("rejects assets that were not prepared", () => expect(() => rehypeBlogImages()({ children: [image("/missing.webp")] })).toThrow("Unprepared"));+ it("preserves picture art direction and adds dimensions to JSX sources and images", () => {+ const attr = (name: string, value: string) => ({ type: "mdxJsxAttribute", name, value });+ const source = { type: "mdxJsxFlowElement", name: "source", attributes: [attr("srcSet", "/blog/introducing-alook/local-first-mobile.webp"), attr("media", "(max-width: 640px)")] };+ const img = { type: "mdxJsxFlowElement", name: "img", attributes: [attr("src", "/blog/introducing-alook/local-first.png"), attr("alt", "")] };+ rehypeBlogImages()({ children: [{ type: "mdxJsxFlowElement", name: "picture", attributes: [], children: [source, img] }] });+ expect(source.attributes).toContainEqual(attr("media", "(max-width: 640px)"));+ expect(source.attributes.some(a => a.name === "height" && Number(a.value) > 0)).toBe(true);+ expect(img.attributes).toContainEqual(attr("loading", "eager"));+ expect(img.attributes).toContainEqual(attr("alt", ""));+ });++});diff --git a/src/web/blog/scripts/frontend-version.test.ts b/src/web/blog/scripts/frontend-version.test.tsindex e813d51f6..05ddb94a9 100644--- a/src/web/blog/scripts/frontend-version.test.ts+++ b/src/web/blog/scripts/frontend-version.test.ts@@ -7,7 +7,8 @@ vi.mock("@opennextjs/cloudflare", () => ({ initOpenNextCloudflareForDev: vi.fn()it("injects the same shared frontend package version into the Blog build", async () => {const pkg = JSON.parse(readFileSync(fileURLToPath(new URL("../../package.json", import.meta.url)), "utf8"))- const { default: config } = await import("../next.config")+ const { default: loadConfig } = await import("../next.config")+ const config = await loadConfig()expect(config.env?.NEXT_PUBLIC_APP_VERSION).toBe(pkg.version)expect(config.assetPrefix).toBe("/blog-static")})diff --git a/src/web/blog/scripts/prepare-images.mjs b/src/web/blog/scripts/prepare-images.mjsnew file mode 100644index 000000000..a2dd9810c--- /dev/null+++ b/src/web/blog/scripts/prepare-images.mjs@@ -0,0 +1,52 @@+import { createHash } from "node:crypto";+import { mkdir, readFile, readdir, writeFile } from "node:fs/promises";+import { dirname, resolve } from "node:path";+import sharp from "sharp";+export async function prepareBlogImages(blogRoot) {+ const sources = new Set();+ const contentDir = resolve(blogRoot, "src/content");+ for (const file of (await readdir(contentDir)).filter((file) => file.endsWith(".mdx")).sort()) {+ const content = await readFile(resolve(contentDir, file), "utf8");+ const image = /\bimage:\s*["']([^"']+)["']/.exec(content);+ if (image)+ sources.add(image[1]);+ for (const match of content.matchAll(/<source[^>]+srcSet=["']([^"']+)["']/g)) {+ for (const candidate of match[1].split(",")) sources.add(candidate.trim().split(/\s+/)[0]);+ }+ for (const match of content.matchAll(/!\[[^\]]*\]\(([^)\s]+)(?:\s+[^)]*)?\)|<img[^>]+src=["']([^"']*)["'][^>]*>/g)) {+ sources.add(match[1] || match[2]);+ }+ }+ const assets = {};+ const publicRoot = resolve(blogRoot, "public");+ const outputRoot = resolve(publicRoot, "blog/_generated");+ await mkdir(outputRoot, { recursive: true });+ for (const src of [...sources].sort()) {+ if (!src.startsWith("/blog/") || src.split("/").includes(".."))+ throw new Error(`Invalid Blog image: ${src}`);+ const buffer = await readFile(resolve(publicRoot, `.${src}`));+ const metadata = await sharp(buffer).metadata();+ const { width, height } = metadata.autoOrient ?? metadata;+ if (!width || !height)+ throw new Error(`Missing Blog image dimensions: ${src}`);+ const asset = { width, height };+ if (metadata.format !== "svg" && (!metadata.pages || metadata.pages === 1)) {+ const hash = createHash("sha256").update(buffer).update("webp:85:v1").digest("hex").slice(0, 16);+ const variants = [];+ for (const size of [480, 960].filter((size) => size < width)) {+ const url = `/blog/_generated/${hash}-${size}.webp`;+ await sharp(buffer).autoOrient().resize({ width: size }).webp({ quality: 85 }).toFile(resolve(publicRoot, `.${url}`));+ variants.push(`${url} ${size}w`);+ }+ if (variants.length)+ asset.srcSet = [...variants, `${src} ${width}w`].join(", ");+ }+ assets[src] = asset;+ }+ const manifestPath = resolve(blogRoot, "src/lib/blog/image-assets.json");+ await mkdir(dirname(manifestPath), { recursive: true });+ const json = `{\n${Object.entries(assets).map(([src, value]) => ` ${JSON.stringify(src)}: ${JSON.stringify(value)}`).join(",\n")}\n}\n`;+ if (await readFile(manifestPath, "utf8").catch(() => "") !== json)+ await writeFile(manifestPath, json);+ return assets;+}diff --git a/src/web/blog/scripts/prepare-images.test.ts b/src/web/blog/scripts/prepare-images.test.tsnew file mode 100644index 000000000..05d5522e4--- /dev/null+++ b/src/web/blog/scripts/prepare-images.test.ts@@ -0,0 +1,43 @@+import { mkdtemp, mkdir, writeFile, readFile, rm } from "node:fs/promises";+import { tmpdir } from "node:os";+import { join } from "node:path";+import sharp from "sharp";+import { describe, expect, it, vi } from "vitest";+import { prepareBlogImages } from "./prepare-images.mjs";++describe("Blog image preparation", () => {+ it("reads actual dimensions, emits responsive files, and fails on missing sources", async () => {+ const root = await mkdtemp(join(tmpdir(), "blog-images-"));+ try {+ await mkdir(join(root, "src/content"), { recursive: true });+ await mkdir(join(root, "public/blog/example"), { recursive: true });+ await sharp({ create: { width: 1200, height: 800, channels: 3, background: "white" } }).png().toFile(join(root, "public/blog/example/hero.png"));+ await writeFile(join(root, "src/content/example.mdx"), 'export const metadata = { image: "/blog/example/hero.png" };\n');+ const assets = await prepareBlogImages(root);+ expect(assets["/blog/example/hero.png"]).toMatchObject({ width: 1200, height: 800 });+ const srcSet = assets["/blog/example/hero.png"].srcSet!;+ const first = srcSet.split(" ")[0];+ expect((await sharp(await readFile(join(root, "public", first))).metadata()).width).toBe(480);+ expect(JSON.parse(await readFile(join(root, "src/lib/blog/image-assets.json"), "utf8"))).toEqual(assets);+ await writeFile(join(root, "src/content/example.mdx"), '');+ await expect(prepareBlogImages(root)).rejects.toThrow();+ } finally { await rm(root, { recursive: true, force: true }); }+ });+ it("preserves SVG picture sources and rejects unsafe paths or dimensionless metadata", async () => {+ const root = await mkdtemp(join(tmpdir(), "blog-images-picture-"));+ try {+ await mkdir(join(root, "src/content"), { recursive: true });+ await mkdir(join(root, "public/blog/example"), { recursive: true });+ await writeFile(join(root, "public/blog/example/hero.svg"), '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"/>');+ const source = join(root, "src/content/example.mdx");+ await writeFile(source, '<picture><source srcSet="/blog/example/hero.svg 1200w" /><img src="/blog/example/hero.svg" alt="" /></picture>');+ expect(await prepareBlogImages(root)).toEqual({ "/blog/example/hero.svg": { width: 1200, height: 800 } });+ const probe = vi.spyOn(sharp.prototype, "metadata").mockResolvedValueOnce({} as sharp.Metadata);+ await expect(prepareBlogImages(root)).rejects.toThrow("Missing Blog image dimensions");+ probe.mockRestore();+ await writeFile(source, '');+ await expect(prepareBlogImages(root)).rejects.toThrow("Invalid Blog image");+ } finally { vi.restoreAllMocks(); await rm(root, { recursive: true, force: true }); }+ });++});diff --git a/src/web/blog/scripts/validate-rendered.test.ts b/src/web/blog/scripts/validate-rendered.test.tsnew file mode 100644index 000000000..85fd4bf65--- /dev/null+++ b/src/web/blog/scripts/validate-rendered.test.ts@@ -0,0 +1,87 @@+import { describe, expect, it, vi } from "vitest";+import { validateBlogBuild, validateRenderedPosts } from "./validate-rendered";+import { readBlogMetadata } from "../src/lib/blog/validate-assets";++const metadata = { slug: "example", title: "Example", date: "2026-10-09", author: "Alook Team", excerpt: "Example article", readingTime: "5 min read", image: "/blog/example/hero.webp" };+const assets = { "/blog/example/hero.webp": { width: 1200, height: 800 } };+const html = `<title>Example — Alook</title><meta name="description" content="Example article">+<link rel="canonical" href="https://alook.ai/blog/example">+<meta property="og:image" content="https://alook.ai/blog/example/hero.webp">+<meta property="og:image:width" content="1200"><meta property="og:image:height" content="800">+<h1>Example</h1><div class="blog-content"><h2 id="section">Section</h2><p>Actual body</p>+<img src="/blog/example/hero.webp" alt="" width="1200" height="800"><a href="#section">Section</a></div>+<script type="application/ld+json">${JSON.stringify({ "@type": "BlogPosting", url: "https://alook.ai/blog/example", headline: "Example", datePublished: metadata.date, author: { name: metadata.author } })}</script>`;+const validate = (body = html) => validateRenderedPosts([{ metadata, html: body }], (src) => src in assets, assets);++describe("rendered article contract", () => {+ it("accepts a real body, matching metadata, an anchor and explicitly decorative alt", () => expect(validate()).toEqual([]));+ it.each([+ ["<h1>Example</h1>", "", "one H1"],+ ["<h1>Example</h1>", "<h1>Example</h1><h1>Duplicate</h1>", "one H1"],+ ["Example — Alook", " ", "title"],+ ['content="Example article"', 'content=" "', "description"],+ ['href="https://alook.ai/blog/example"', 'href="https://alook.ai/blog/wrong"', "canonical"],+ ["<title>", '<meta name="robots" content="noindex"><title>', "noindex"],+ ['href="#section"', 'href="/blog/missing"', "missing article"],+ ['href="#section"', 'href="#missing"', "missing fragment"],+ ['width="1200"', 'width="1"', "image dimensions"],+ ['alt=""', "", "missing alt"],+ ['src="/blog/example/hero.webp"', 'src="/blog/example/missing.webp"', "missing image"],+ ['property="og:image:height" content="800"', 'property="og:image:height" content="630"', "OG dimensions"],+ ['"headline":"Example"', '"headline":"Wrong"', "BlogPosting"],+ ['{"@type":"BlogPosting"', '{broken:"BlogPosting"', "invalid JSON-LD"],+ ])("rejects mutation %s", (from, to, expected) => {+ expect(validate(html.replace(from, to)).join("\n")).toContain(expected);+ });+ it("accepts canonical redirects and index links while rejecting bad fragments and articles", () => {+ for (const href of ["/blog", "/blog/", "/blog/example/", "/blog/example/#section"]) {+ expect(validate(html.replace('href="#section"', `href="${href}"`))).toEqual([]);+ }+ expect(validateRenderedPosts([{ metadata, html: html.replace('href="#section"', 'href="/blog/old/#section"') }], (src) => src in assets, assets, { "/blog/old": "/blog/example" })).toEqual([]);+ expect(validate(html.replace('href="#section"', 'href="/blog/example/#missing"')).join()).toContain("missing fragment");+ expect(validate(html.replace('href="#section"', 'href="/blog/missing/"')).join()).toContain("missing article");+ });+ it("rejects duplicated canonical tags and missing responsive resources", () => {+ expect(validate(html + '<link rel="canonical" href="https://alook.ai/blog/example">').join()).toContain("canonical");+ expect(validate(html.replace('alt=""', 'alt="" srcset="/blog/_generated/missing.webp 480w"')).join()).toContain("responsive image");+ });+ it("rejects an explicitly blank seoTitle at source validation", () => {+ expect(readBlogMetadata('export const metadata = { seoTitle: " " }', "example").errors.join()).toContain("seoTitle");+ });+});++vi.mock("../src/lib/blog/topics", () => ({ blogTopics: [{ entries: [{ slug: "example" }] }] }));++import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from "node:fs";+import { join, dirname } from "node:path";+import { tmpdir } from "node:os";++describe("Blog build gate", () => {+ it("checks the built article and discovery outputs, including draft leaks", () => {+ const root = mkdtempSync(join(tmpdir(), "blog-build-gate-"));+ const put = (path: string, content: string) => { mkdirSync(dirname(join(root, path)), { recursive: true }); writeFileSync(join(root, path), content); };+ const source = (data: Record<string, unknown>) => `export const metadata = {${Object.entries(data).map(([key,value]) => `${key}: ${JSON.stringify(value)}`).join(",")}};`;+ try {+ put("src/content/example.mdx", source(metadata));+ put(".next/server/app/blog/example.html", html);+ put("src/lib/blog/image-assets.json", JSON.stringify(assets));+ put("src/lib/blog/redirects.json", "[]");+ put("public/blog/example/hero.webp", "fixture resource");+ const { readingTime: _readingTime, image: _image, ...discoveryPost } = metadata;+ put(".next/server/app/internal/blog-discovery.body", JSON.stringify({ version: 1, posts: [discoveryPost] }));+ put(".next/server/app/blog/feed.xml.body", "<rss><channel><item><link>https://alook.ai/blog/example</link></item></channel></rss>");+ put(".next/server/app/blog.html", '<a href="/blog/example">Example</a>');+ expect(() => validateBlogBuild(root)).not.toThrow();+ put(".next/server/app/blog/example.html", html.replace("<h1>Example</h1>", ""));+ expect(() => validateBlogBuild(root)).toThrow("one H1");+ put(".next/server/app/blog/example.html", html);+ put(".next/server/app/blog.html", '<a href="/blog/draft">Draft</a>');+ expect(() => validateBlogBuild(root)).toThrow("Blog index differs");+ put(".next/server/app/blog.html", '<a href="/blog/example">Example</a>');+ put("src/content/draft.mdx", source({ ...metadata, slug: "draft", draft: true }));+ expect(() => validateBlogBuild(root)).not.toThrow();+ put(".next/server/app/blog/draft.html", html);+ expect(() => validateBlogBuild(root)).toThrow("Draft was prerendered");+ } finally { rmSync(root, { recursive: true, force: true }); }+ });+});diff --git a/src/web/blog/scripts/validate-rendered.ts b/src/web/blog/scripts/validate-rendered.tsnew file mode 100644index 000000000..4a38cce97--- /dev/null+++ b/src/web/blog/scripts/validate-rendered.ts@@ -0,0 +1,115 @@+import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";+import { resolve } from "node:path";+import { fileURLToPath } from "node:url";+import { createRequire } from "node:module";+const { JSDOM } = createRequire(import.meta.url)("jsdom") as { JSDOM: new (html: string, options?: { contentType: string }) => { window: { document: Document } } };+import { blogTopics } from "../src/lib/blog/topics";+import { parseBlogDiscoveryManifest } from "../../src/lib/blog-discovery-manifest";+import { isDraftBlogPost, readBlogMetadata, type BlogMetadata } from "../src/lib/blog/validate-assets";++const origin = "https://alook.ai";+export type RenderedPost = { metadata: BlogMetadata; html: string };++export function validateRenderedPosts(+ posts: RenderedPost[],+ resourceExists: (pathname: string) => boolean,+ imageAssets: Record<string, { width: number; height: number }>,+ redirects: Record<string, string> = {},+): string[] {+ const errors: string[] = [];+ const documents = new Map(posts.map(({ metadata, html }) => [`/blog/${metadata.slug}`, new JSDOM(html).window.document]));+ const titles = new Set<string>();+ for (const { metadata: post } of posts) {+ const pathname = `/blog/${post.slug}`;+ const doc = documents.get(pathname)!;+ const fail = (message: string) => errors.push(`${pathname}: ${message}`);+ const meta = (name: string) => doc.querySelector(`meta[name="${name}"],meta[property="${name}"]`)?.getAttribute("content");+ const title = doc.querySelector("title")?.textContent?.trim();+ if (!title || titles.has(title)) fail("missing or duplicate title");+ if (title) titles.add(title);+ if (!meta("description")?.trim()) fail("missing description");+ const h1 = doc.querySelectorAll("h1");+ if (h1.length !== 1 || h1[0].textContent?.trim() !== post.title) fail("expected one H1 matching the article title");+ if (!doc.querySelector(".blog-content")?.textContent?.trim()) fail("missing article body");+ const canonical = doc.querySelectorAll('link[rel="canonical"]');+ if (canonical.length !== 1 || canonical[0].getAttribute("href") !== origin + pathname) fail("invalid canonical");+ if ([...doc.querySelectorAll('meta[name="robots"],meta[name="googlebot"]')].some((node) => /\b(noindex|none)\b/i.test(node.getAttribute("content") ?? ""))) fail("article is noindex");+ const ids = [...doc.querySelectorAll("[id]")].map((node) => node.id);+ if (new Set(ids).size !== ids.length) fail("duplicate anchor id");+ const entities: Record<string, unknown>[] = [];+ for (const script of doc.querySelectorAll('script[type="application/ld+json"]')) {+ try {+ const data = JSON.parse(script.textContent ?? "");+ entities.push(...(Array.isArray(data) ? data : [data]));+ } catch { fail("invalid JSON-LD"); }+ }+ const articles = entities.filter((entity) => entity?.["@type"] === "BlogPosting");+ if (articles.length !== 1 || articles[0].url !== origin + pathname || articles[0].headline !== post.title || articles[0].datePublished !== post.date || articles[0].dateModified !== post.dateModified || (articles[0].author as { name?: string } | undefined)?.name !== post.author) fail("BlogPosting conflicts with article metadata");+ const og = meta("og:image");+ if (!og) fail("missing OG image");+ if (og) {+ const url = new URL(og, origin);+ if (url.origin !== origin || url.pathname !== (post.image ?? `/og/blog/${encodeURIComponent(post.slug)}`)) fail("OG image conflicts with article metadata");+ const asset = imageAssets[url.pathname];+ if (url.origin === origin && !url.pathname.startsWith("/og/blog/") && !resourceExists(url.pathname)) fail(`missing OG resource ${url.pathname}`);+ if (asset && (Number(meta("og:image:width")) !== asset.width || Number(meta("og:image:height")) !== asset.height)) fail("OG dimensions conflict with resource");+ }+ for (const img of doc.querySelectorAll<HTMLImageElement>(".blog-content img")) {+ const src = img.getAttribute("src") ?? "";+ const asset = imageAssets[src];+ if (!resourceExists(src)) fail(`missing image ${src}`);+ if (!img.hasAttribute("alt")) fail(`missing alt ${src}`);+ if (!asset || Number(img.getAttribute("width")) !== asset.width || Number(img.getAttribute("height")) !== asset.height) fail(`invalid image dimensions ${src}`);+ for (const candidate of (img.getAttribute("srcset") ?? "").split(",").filter(Boolean)) {+ if (!resourceExists(candidate.trim().split(/\s+/)[0])) fail(`missing responsive image ${candidate}`);+ }+ }+ for (const link of doc.querySelectorAll<HTMLAnchorElement>("a[href]")) {+ const url = new URL(link.getAttribute("href")!, origin + pathname);+ if (url.origin !== origin) continue;+ const normalizedPath = url.pathname.replace(/\/+$/, "");+ const target = (redirects[normalizedPath] ?? normalizedPath).replace(/\/+$/, "");+ if (!target.startsWith("/blog/")) continue;+ const targetDoc = documents.get(target);+ if (!targetDoc) { if (!resourceExists(target)) fail(`missing article/link ${target}`); continue; }+ if (url.hash && !targetDoc.getElementById(decodeURIComponent(url.hash.slice(1)))) fail(`missing fragment ${target}${url.hash}`);+ }+ }+ return errors;+}++export function validateBlogBuild(blogRoot: string): void {+ const content = resolve(blogRoot, "src/content");+ const output = resolve(blogRoot, ".next/server/app/blog");+ const posts: RenderedPost[] = [];+ for (const file of readdirSync(content).filter((file) => file.endsWith(".mdx"))) {+ const source = readFileSync(resolve(content, file), "utf8");+ const { metadata } = readBlogMetadata(source, file.slice(0, -4));+ const builtFile = resolve(output, `${metadata.slug}.html`);+ if (isDraftBlogPost(source)) {+ if (existsSync(builtFile)) throw new Error(`Draft was prerendered: ${metadata.slug}`);+ continue;+ }+ posts.push({ metadata, html: readFileSync(builtFile, "utf8") });+ }+ const expected = posts.map(({ metadata }) => metadata.slug).sort();+ const samePosts = (label: string, slugs: string[]) => {+ if (JSON.stringify([...slugs].sort()) !== JSON.stringify(expected)) throw new Error(`${label} differs from published articles`);+ };+ samePosts("Topics", blogTopics.flatMap((topic) => topic.entries.map((entry) => entry.slug)));+ const serverRoot = resolve(blogRoot, ".next/server/app");+ const discovery = parseBlogDiscoveryManifest(JSON.parse(readFileSync(resolve(serverRoot, "internal/blog-discovery.body"), "utf8")));+ samePosts("Discovery manifest", discovery.posts.map((post) => post.slug));+ const feed = new JSDOM(readFileSync(resolve(serverRoot, "blog/feed.xml.body"), "utf8"), { contentType: "application/xml" });+ samePosts("RSS", [...feed.window.document.querySelectorAll("item > link")].map((link) => link.textContent?.split("/blog/")[1] ?? ""));+ const index = new JSDOM(readFileSync(resolve(serverRoot, "blog.html"), "utf8"));+ samePosts("Blog index", [...new Set([...index.window.document.querySelectorAll<HTMLAnchorElement>('a[href^="/blog/"]')].map((link) => link.getAttribute("href")!.slice(6)).filter((slug) => !slug.includes("/") && slug !== "feed.xml"))]);+ const imageAssets = JSON.parse(readFileSync(resolve(blogRoot, "src/lib/blog/image-assets.json"), "utf8"));+ const redirects = JSON.parse(readFileSync(resolve(blogRoot, "src/lib/blog/redirects.json"), "utf8")) as { source: string; destination: string }[];+ const errors = validateRenderedPosts(posts, (pathname) => { const file = resolve(blogRoot, "public", `.${pathname}`); return existsSync(file) && statSync(file).isFile(); }, imageAssets, Object.fromEntries(redirects.map(({ source, destination }) => [source, destination])));+ if (errors.length) throw new Error(errors.join("\n"));+ console.log(`Validated rendered HTML for ${posts.length} Blog articles.`);+}++/* istanbul ignore if */+if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) validateBlogBuild(resolve(import.meta.dirname, ".."));diff --git a/src/web/blog/src/app/blog/[slug]/article-meta.dom.test.ts b/src/web/blog/src/app/blog/[slug]/article-meta.dom.test.tsindex bc052805e..993f43991 100644--- a/src/web/blog/src/app/blog/[slug]/article-meta.dom.test.ts+++ b/src/web/blog/src/app/blog/[slug]/article-meta.dom.test.ts@@ -1,15 +1,14 @@import { createElement } from "react";-import { describe, expect, it, vi } from "vitest";+import { describe, expect, it } from "vitest";import type { BlogPost } from "@blog/lib/blog/posts";import { render } from "@/test/react-dom-harness";import { BlogPostByline, buildBlogPostMetadata } from "./article-meta";-vi.mock("./og-image", () => ({- getBlogOgImage: () => "/blog/example/hero.webp",-}));+const post: BlogPost = {- slug: "example",+ slug: "ai-agent-team",+ image: "/blog/ai-agent-team/hero.webp",title: "Visible article title",seoTitle: "Search article title",date: "2026-08-20",@@ -30,15 +29,20 @@ describe("article metadata", () => {modifiedTime: "2026-09-01",images: [{- url: "/blog/example/hero.webp",+ url: "/blog/ai-agent-team/hero.webp",width: 1200,- height: 630,+ height: 800,alt: "Search article title",},],});});+ it("uses the generated OG route dimensions without a custom image", () => {+ expect(buildBlogPostMetadata({ ...post, image: undefined }).openGraph).toMatchObject({ images: [{ url: "/og/blog/ai-agent-team", width: 1200, height: 630 }] });+ expect(() => buildBlogPostMetadata({ ...post, image: "/blog/missing.webp" })).toThrow("Unprepared");+ });+it("omits revision metadata and copy when the post has not been revised", () => {const unmodifiedPost = { ...post };delete unmodifiedPost.dateModified;diff --git a/src/web/blog/src/app/blog/[slug]/article-meta.tsx b/src/web/blog/src/app/blog/[slug]/article-meta.tsxindex 6ae5056d9..ce7567149 100644--- a/src/web/blog/src/app/blog/[slug]/article-meta.tsx+++ b/src/web/blog/src/app/blog/[slug]/article-meta.tsx@@ -2,10 +2,13 @@ import type { Metadata } from "next";import type { BlogPost } from "@blog/lib/blog/posts";import { getBlogSearchTitle } from "@blog/lib/blog/metadata";import { getBlogOgImage } from "./og-image";+import imageAssets from "@blog/lib/blog/image-assets.json";export function buildBlogPostMetadata(post: BlogPost): Metadata {const ogImage = getBlogOgImage(post);const searchTitle = getBlogSearchTitle(post);+ const imageSize = (imageAssets as Record<string, { width: number; height: number }>)[ogImage];+ if (post.image && !imageSize) throw new Error(`Unprepared Blog OG image: ${ogImage}`);return {title: searchTitle,@@ -22,8 +25,8 @@ export function buildBlogPostMetadata(post: BlogPost): Metadata {images: [{url: ogImage,- width: 1200,- height: 630,+ width: imageSize?.width ?? 1200,+ height: imageSize?.height ?? 630,alt: searchTitle,},],diff --git a/src/web/blog/src/content/ai-team-vs-ai-tools.mdx b/src/web/blog/src/content/ai-team-vs-ai-tools.mdxindex 9729ab2e5..ca9cbb5b2 100644--- a/src/web/blog/src/content/ai-team-vs-ai-tools.mdx+++ b/src/web/blog/src/content/ai-team-vs-ai-tools.mdx@@ -7,7 +7,7 @@ export const metadata = {readingTime: '8 min read'};-+You start a project in Claude Code. It builds the initial architecture beautifully.@@ -52,7 +52,7 @@ This is where it got ridiculous. Pasted both versions. Windsurf found security i### What Should Actually Happen (AI Team Reality)-+Here's what happens when you have an actual AI team instead of isolated tools.@@ -80,7 +80,7 @@ Another team lead described the before-and-after this way: four coding assistant## What Tools Literally Cannot Provide-+### Persistent Collective Memorydiff --git a/src/web/blog/src/content/multi-agent-collaboration-without-code.mdx b/src/web/blog/src/content/multi-agent-collaboration-without-code.mdxindex a67f85427..26ec6327f 100644--- a/src/web/blog/src/content/multi-agent-collaboration-without-code.mdx+++ b/src/web/blog/src/content/multi-agent-collaboration-without-code.mdx@@ -12,7 +12,7 @@ AI agents keep getting more capable. Better reasoning, longer context, more toolMulti-agent collaboration means agents that coordinate through shared rooms and explicit operating rules. You define roles, relationships, and handoff expectations. The agents communicate through persistent channels and DMs without you writing orchestration code or wiring workflow builders.-+## The single-agent ceiling@@ -20,7 +20,7 @@ One agent processes one task at a time. While it writes your newsletter, your cuAt five tasks a day, this feels productive. At twenty, you've spent your morning dispatching work instead of doing the thinking that actually moves your business forward. The agent is fast. You're the bottleneck.-+## What breaks when you run multiple agents without coordination@@ -44,7 +44,7 @@ You don't need to write orchestration scripts or build workflow diagrams to getNo workflow builders. No if-then logic. No API connections to maintain. You set up roles, write operating rules, and the agents communicate through persistent rooms.-+For a deeper look at coordination patterns, see our guide on [AI agent orchestration](/blog/ai-agent-orchestration).diff --git a/src/web/blog/src/lib/blog/image-assets.json b/src/web/blog/src/lib/blog/image-assets.jsonnew file mode 100644index 000000000..98783edc6--- /dev/null+++ b/src/web/blog/src/lib/blog/image-assets.json@@ -0,0 +1,73 @@+{+ "/blog/ai-agent-communication/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/6e5d9f15472ace7d-480.webp 480w, /blog/_generated/6e5d9f15472ace7d-960.webp 960w, /blog/ai-agent-communication/hero.webp 1200w"},+ "/blog/ai-agent-identity/addressing-vs-authority.webp": {"width":800,"height":400,"srcSet":"/blog/_generated/ed9ebc59c302fb86-480.webp 480w, /blog/ai-agent-identity/addressing-vs-authority.webp 800w"},+ "/blog/ai-agent-identity/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/f4c286b3e19e9e72-480.webp 480w, /blog/_generated/f4c286b3e19e9e72-960.webp 960w, /blog/ai-agent-identity/hero.webp 1200w"},+ "/blog/ai-agent-identity/session-vs-identity.webp": {"width":800,"height":400,"srcSet":"/blog/_generated/bafb00f3faebb295-480.webp 480w, /blog/ai-agent-identity/session-vs-identity.webp 800w"},+ "/blog/ai-agent-orchestration/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/2c086595e4e88bb5-480.webp 480w, /blog/_generated/2c086595e4e88bb5-960.webp 960w, /blog/ai-agent-orchestration/hero.webp 1200w"},+ "/blog/ai-agent-orchestration/how-orchestration-works.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/03eb8ca3c6da84a6-480.webp 480w, /blog/_generated/03eb8ca3c6da84a6-960.webp 960w, /blog/ai-agent-orchestration/how-orchestration-works.webp 1200w"},+ "/blog/ai-agent-orchestration/single-agent-vs-orchestration.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/b8b3255a24e5fe0f-480.webp 480w, /blog/_generated/b8b3255a24e5fe0f-960.webp 960w, /blog/ai-agent-orchestration/single-agent-vs-orchestration.webp 1200w"},+ "/blog/ai-agent-orchestration/what-to-orchestrate-first.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/03eb8ca3c6da84a6-480.webp 480w, /blog/_generated/03eb8ca3c6da84a6-960.webp 960w, /blog/ai-agent-orchestration/what-to-orchestrate-first.webp 1200w"},+ "/blog/ai-agent-team/handoff-contract.webp": {"width":1200,"height":800,"srcSet":"/blog/_generated/63b5240ea3d59932-480.webp 480w, /blog/_generated/63b5240ea3d59932-960.webp 960w, /blog/ai-agent-team/handoff-contract.webp 1200w"},+ "/blog/ai-agent-team/hero.webp": {"width":1200,"height":800,"srcSet":"/blog/_generated/f1536ec288910608-480.webp 480w, /blog/_generated/f1536ec288910608-960.webp 960w, /blog/ai-agent-team/hero.webp 1200w"},+ "/blog/ai-agent-team/roles-structure.webp": {"width":1200,"height":800,"srcSet":"/blog/_generated/c75a14b32161e6b2-480.webp 480w, /blog/_generated/c75a14b32161e6b2-960.webp 960w, /blog/ai-agent-team/roles-structure.webp 1200w"},+ "/blog/ai-agent-team/team-vs-single.webp": {"width":1200,"height":800,"srcSet":"/blog/_generated/b27a32c0928962e8-480.webp 480w, /blog/_generated/b27a32c0928962e8-960.webp 960w, /blog/ai-agent-team/team-vs-single.webp 1200w"},+ "/blog/ai-agent-team/walkthrough-brief-handoff.webp": {"width":1200,"height":891,"srcSet":"/blog/_generated/dc83a57fa037335b-480.webp 480w, /blog/_generated/dc83a57fa037335b-960.webp 960w, /blog/ai-agent-team/walkthrough-brief-handoff.webp 1200w"},+ "/blog/ai-agent-team/walkthrough-calendar.webp": {"width":1200,"height":769,"srcSet":"/blog/_generated/3838c1afd83dda84-480.webp 480w, /blog/_generated/3838c1afd83dda84-960.webp 960w, /blog/ai-agent-team/walkthrough-calendar.webp 1200w"},+ "/blog/ai-agent-team/walkthrough-org-chart.webp": {"width":1200,"height":892,"srcSet":"/blog/_generated/66ce1fae6cc7ac6b-480.webp 480w, /blog/_generated/66ce1fae6cc7ac6b-960.webp 960w, /blog/ai-agent-team/walkthrough-org-chart.webp 1200w"},+ "/blog/ai-agent-vs-chatbot/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/a8876fc70fd5dd6b-480.webp 480w, /blog/_generated/a8876fc70fd5dd6b-960.webp 960w, /blog/ai-agent-vs-chatbot/hero.webp 1200w"},+ "/blog/ai-team-vs-ai-tools/hero.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/7be5b55c1edfeb3c-480.webp 480w, /blog/_generated/7be5b55c1edfeb3c-960.webp 960w, /blog/ai-team-vs-ai-tools/hero.webp 1536w"},+ "/blog/ai-team-vs-ai-tools/three-advantages.webp": {"width":1774,"height":887,"srcSet":"/blog/_generated/e8cefdcba7474d37-480.webp 480w, /blog/_generated/e8cefdcba7474d37-960.webp 960w, /blog/ai-team-vs-ai-tools/three-advantages.webp 1774w"},+ "/blog/ai-team-vs-ai-tools/workflow.webp": {"width":1448,"height":1086,"srcSet":"/blog/_generated/63cb3449d20526de-480.webp 480w, /blog/_generated/63cb3449d20526de-960.webp 960w, /blog/ai-team-vs-ai-tools/workflow.webp 1448w"},+ "/blog/alook-vs-buzz/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/7ad3c64530ce46cc-480.webp 480w, /blog/_generated/7ad3c64530ce46cc-960.webp 960w, /blog/alook-vs-buzz/hero.webp 1200w"},+ "/blog/alook-vs-buzz/work-records.webp": {"width":1200,"height":1200,"srcSet":"/blog/_generated/c7ebb313a0a787ed-480.webp 480w, /blog/_generated/c7ebb313a0a787ed-960.webp 960w, /blog/alook-vs-buzz/work-records.webp 1200w"},+ "/blog/alook-vs-grok-bot/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/0ad07ea283c60e4b-480.webp 480w, /blog/_generated/0ad07ea283c60e4b-960.webp 960w, /blog/alook-vs-grok-bot/hero.webp 1200w"},+ "/blog/alook-vs-grok-bot/sharing.webp": {"width":1200,"height":1200,"srcSet":"/blog/_generated/4c548f58ddd99181-480.webp 480w, /blog/_generated/4c548f58ddd99181-960.webp 960w, /blog/alook-vs-grok-bot/sharing.webp 1200w"},+ "/blog/claude-code-and-codex-same-team/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/d533b2f3c720a020-480.webp 480w, /blog/_generated/d533b2f3c720a020-960.webp 960w, /blog/claude-code-and-codex-same-team/hero.webp 1200w"},+ "/blog/claude-code-subagents-vs-independent-agents/architecture-compare.webp": {"width":1400,"height":933,"srcSet":"/blog/_generated/5898f03690f372b0-480.webp 480w, /blog/_generated/5898f03690f372b0-960.webp 960w, /blog/claude-code-subagents-vs-independent-agents/architecture-compare.webp 1400w"},+ "/blog/claude-code-subagents-vs-independent-agents/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/2a0837c3d61bfdca-480.webp 480w, /blog/_generated/2a0837c3d61bfdca-960.webp 960w, /blog/claude-code-subagents-vs-independent-agents/hero.webp 1200w"},+ "/blog/claude-code-subagents-vs-independent-agents/three-layers.webp": {"width":1400,"height":933,"srcSet":"/blog/_generated/622dcce0a4478293-480.webp 480w, /blog/_generated/622dcce0a4478293-960.webp 960w, /blog/claude-code-subagents-vs-independent-agents/three-layers.webp 1400w"},+ "/blog/how-to-delegate-tasks-to-ai-agents/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/98e567ac5790158d-480.webp 480w, /blog/_generated/98e567ac5790158d-960.webp 960w, /blog/how-to-delegate-tasks-to-ai-agents/hero.webp 1200w"},+ "/blog/humans-and-ai-agents-in-one-room/access-vs-attention.png": {"width":800,"height":400,"srcSet":"/blog/_generated/a4db6813ec454187-480.webp 480w, /blog/humans-and-ai-agents-in-one-room/access-vs-attention.png 800w"},+ "/blog/humans-and-ai-agents-in-one-room/addressing-vs-authority.png": {"width":800,"height":400,"srcSet":"/blog/_generated/ec65ca77fb3cd87e-480.webp 480w, /blog/humans-and-ai-agents-in-one-room/addressing-vs-authority.png 800w"},+ "/blog/humans-and-ai-agents-in-one-room/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/85c112903f9988f4-480.webp 480w, /blog/_generated/85c112903f9988f4-960.webp 960w, /blog/humans-and-ai-agents-in-one-room/hero.webp 1200w"},+ "/blog/introducing-alook/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/49becde1c9acd55d-480.webp 480w, /blog/_generated/49becde1c9acd55d-960.webp 960w, /blog/introducing-alook/hero.webp 1200w"},+ "/blog/introducing-alook/local-first-mobile.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/aac695e53e357e95-480.webp 480w, /blog/_generated/aac695e53e357e95-960.webp 960w, /blog/introducing-alook/local-first-mobile.webp 1536w"},+ "/blog/introducing-alook/local-first.png": {"width":1280,"height":720,"srcSet":"/blog/_generated/90988206c09344e9-480.webp 480w, /blog/_generated/90988206c09344e9-960.webp 960w, /blog/introducing-alook/local-first.png 1280w"},+ "/blog/introducing-alook/one-identity.png": {"width":1280,"height":720,"srcSet":"/blog/_generated/a351d3127506fb08-480.webp 480w, /blog/_generated/a351d3127506fb08-960.webp 960w, /blog/introducing-alook/one-identity.png 1280w"},+ "/blog/introducing-alook/overview.png": {"width":2364,"height":1594,"srcSet":"/blog/_generated/ca6cff5c8ff128f8-480.webp 480w, /blog/_generated/ca6cff5c8ff128f8-960.webp 960w, /blog/introducing-alook/overview.png 2364w"},+ "/blog/keep-context-across-coding-agent-sessions/carrier-map.webp": {"width":1643,"height":1155,"srcSet":"/blog/_generated/7800dade1d6c805d-480.webp 480w, /blog/_generated/7800dade1d6c805d-960.webp 960w, /blog/keep-context-across-coding-agent-sessions/carrier-map.webp 1643w"},+ "/blog/keep-context-across-coding-agent-sessions/handoff-template.webp": {"width":1698,"height":1186,"srcSet":"/blog/_generated/4e5268fd68e01667-480.webp 480w, /blog/_generated/4e5268fd68e01667-960.webp 960w, /blog/keep-context-across-coding-agent-sessions/handoff-template.webp 1698w"},+ "/blog/keep-context-across-coding-agent-sessions/hero-og.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/20dd77821c7f5d15-480.webp 480w, /blog/_generated/20dd77821c7f5d15-960.webp 960w, /blog/keep-context-across-coding-agent-sessions/hero-og.webp 1200w"},+ "/blog/keep-context-across-coding-agent-sessions/hero.webp": {"width":1570,"height":1080,"srcSet":"/blog/_generated/12fb868c45fe8df0-480.webp 480w, /blog/_generated/12fb868c45fe8df0-960.webp 960w, /blog/keep-context-across-coding-agent-sessions/hero.webp 1570w"},+ "/blog/local-ai-agents/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/f901a75453510ab0-480.webp 480w, /blog/_generated/f901a75453510ab0-960.webp 960w, /blog/local-ai-agents/hero.webp 1200w"},+ "/blog/local-ai-agents/layers.webp": {"width":800,"height":400,"srcSet":"/blog/_generated/f46615718dfc065a-480.webp 480w, /blog/local-ai-agents/layers.webp 800w"},+ "/blog/local-ai-agents/team-handoff.webp": {"width":800,"height":400,"srcSet":"/blog/_generated/b30c566b2ef58788-480.webp 480w, /blog/local-ai-agents/team-handoff.webp 800w"},+ "/blog/multi-agent-collaboration-without-code/collaboration-mechanisms.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/c5faf269cd2b2858-480.webp 480w, /blog/_generated/c5faf269cd2b2858-960.webp 960w, /blog/multi-agent-collaboration-without-code/collaboration-mechanisms.webp 1536w"},+ "/blog/multi-agent-collaboration-without-code/hero.webp": {"width":1642,"height":656,"srcSet":"/blog/_generated/0fa4e0fd886510c7-480.webp 480w, /blog/_generated/0fa4e0fd886510c7-960.webp 960w, /blog/multi-agent-collaboration-without-code/hero.webp 1642w"},+ "/blog/multi-agent-collaboration-without-code/single-agent-vs-multi-agent-workflow.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/c60055b5afc54aa0-480.webp 480w, /blog/_generated/c60055b5afc54aa0-960.webp 960w, /blog/multi-agent-collaboration-without-code/single-agent-vs-multi-agent-workflow.webp 1536w"},+ "/blog/multi-agent-workflow-patterns/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/b647c073109677cb-480.webp 480w, /blog/_generated/b647c073109677cb-960.webp 960w, /blog/multi-agent-workflow-patterns/hero.webp 1200w"},+ "/blog/multiple-ai-agents-edit-same-repository/four-failures.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/ab11a40c2aa9bc48-480.webp 480w, /blog/_generated/ab11a40c2aa9bc48-960.webp 960w, /blog/multiple-ai-agents-edit-same-repository/four-failures.webp 1536w"},+ "/blog/multiple-ai-agents-edit-same-repository/git-handles.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/070c822fb230caef-480.webp 480w, /blog/_generated/070c822fb230caef-960.webp 960w, /blog/multiple-ai-agents-edit-same-repository/git-handles.webp 1536w"},+ "/blog/multiple-ai-agents-edit-same-repository/hero.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/a7f3a407c17b234e-480.webp 480w, /blog/_generated/a7f3a407c17b234e-960.webp 960w, /blog/multiple-ai-agents-edit-same-repository/hero.webp 1536w"},+ "/blog/no-code-automation-ai-agents/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/014f046b2b151b54-480.webp 480w, /blog/_generated/014f046b2b151b54-960.webp 960w, /blog/no-code-automation-ai-agents/hero.webp 1200w"},+ "/blog/personal-ai-company/comparison.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/c013b6a1e62aa7d7-480.webp 480w, /blog/_generated/c013b6a1e62aa7d7-960.webp 960w, /blog/personal-ai-company/comparison.webp 1200w"},+ "/blog/personal-ai-company/hero.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/00a72af97ff1a5f3-480.webp 480w, /blog/_generated/00a72af97ff1a5f3-960.webp 960w, /blog/personal-ai-company/hero.webp 1200w"},+ "/blog/personal-ai-company/timeline.webp": {"width":1200,"height":630,"srcSet":"/blog/_generated/5408f87223e0696c-480.webp 480w, /blog/_generated/5408f87223e0696c-960.webp 960w, /blog/personal-ai-company/timeline.webp 1200w"},+ "/blog/prevent-coding-agents-duplicating-work/four-duplicates.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/7c7b498ba795f73e-480.webp 480w, /blog/_generated/7c7b498ba795f73e-960.webp 960w, /blog/prevent-coding-agents-duplicating-work/four-duplicates.webp 1536w"},+ "/blog/prevent-coding-agents-duplicating-work/handoff-five.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/324365e41410efb9-480.webp 480w, /blog/_generated/324365e41410efb9-960.webp 960w, /blog/prevent-coding-agents-duplicating-work/handoff-five.webp 1536w"},+ "/blog/prevent-coding-agents-duplicating-work/hero.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/d2a9d2aa0dd8ab63-480.webp 480w, /blog/_generated/d2a9d2aa0dd8ab63-960.webp 960w, /blog/prevent-coding-agents-duplicating-work/hero.webp 1536w"},+ "/blog/run-ai-agent-team-that-stays-on-track/hero.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/99433e5015bdce05-480.webp 480w, /blog/_generated/99433e5015bdce05-960.webp 960w, /blog/run-ai-agent-team-that-stays-on-track/hero.webp 1536w"},+ "/blog/run-ai-agent-team-that-stays-on-track/one-brief-travels.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/160971eba8f6c63a-480.webp 480w, /blog/_generated/160971eba8f6c63a-960.webp 960w, /blog/run-ai-agent-team-that-stays-on-track/one-brief-travels.webp 1536w"},+ "/blog/run-ai-agent-team-that-stays-on-track/operating-rules.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/0590da7f67fe1a85-480.webp 480w, /blog/_generated/0590da7f67fe1a85-960.webp 960w, /blog/run-ai-agent-team-that-stays-on-track/operating-rules.webp 1536w"},+ "/blog/shared-context-between-agents/handoff-minimum.webp": {"width":1400,"height":933,"srcSet":"/blog/_generated/26e007b369f1b7bc-480.webp 480w, /blog/_generated/26e007b369f1b7bc-960.webp 960w, /blog/shared-context-between-agents/handoff-minimum.webp 1400w"},+ "/blog/shared-context-between-agents/hero.webp": {"width":1400,"height":737,"srcSet":"/blog/_generated/f4b4e971be20fa1f-480.webp 480w, /blog/_generated/f4b4e971be20fa1f-960.webp 960w, /blog/shared-context-between-agents/hero.webp 1400w"},+ "/blog/shared-context-between-agents/memory-layers.webp": {"width":1400,"height":933,"srcSet":"/blog/_generated/162696f252ff4722-480.webp 480w, /blog/_generated/162696f252ff4722-960.webp 960w, /blog/shared-context-between-agents/memory-layers.webp 1400w"},+ "/blog/what-makes-a-shared-ai-workspace-usable/alook-local-first.webp": {"width":1200,"height":675,"srcSet":"/blog/_generated/a292d29eb1fa283e-480.webp 480w, /blog/_generated/a292d29eb1fa283e-960.webp 960w, /blog/what-makes-a-shared-ai-workspace-usable/alook-local-first.webp 1200w"},+ "/blog/what-makes-a-shared-ai-workspace-usable/alook-overview.webp": {"width":1200,"height":810,"srcSet":"/blog/_generated/ef9ccf9f0b161128-480.webp 480w, /blog/_generated/ef9ccf9f0b161128-960.webp 960w, /blog/what-makes-a-shared-ai-workspace-usable/alook-overview.webp 1200w"},+ "/blog/what-makes-a-shared-ai-workspace-usable/exact-work.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/3b9c69200b811c1a-480.webp 480w, /blog/_generated/3b9c69200b811c1a-960.webp 960w, /blog/what-makes-a-shared-ai-workspace-usable/exact-work.webp 1536w"},+ "/blog/what-makes-a-shared-ai-workspace-usable/hero.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/a0c531ffe4632d35-480.webp 480w, /blog/_generated/a0c531ffe4632d35-960.webp 960w, /blog/what-makes-a-shared-ai-workspace-usable/hero.webp 1536w"},+ "/blog/what-makes-a-shared-ai-workspace-usable/reliability-map.webp": {"width":1536,"height":1024,"srcSet":"/blog/_generated/a87e5c4155fe6708-480.webp 480w, /blog/_generated/a87e5c4155fe6708-960.webp 960w, /blog/what-makes-a-shared-ai-workspace-usable/reliability-map.webp 1536w"},+ "/blog/why-we-built-alook/agent-company.svg": {"width":800,"height":400},+ "/blog/why-we-built-alook/hero.svg": {"width":800,"height":400},+ "/blog/why-we-built-alook/wrong-axis.svg": {"width":800,"height":400}+}diff --git a/src/web/blog/src/lib/blog/validate-assets.ts b/src/web/blog/src/lib/blog/validate-assets.tsindex 31e0db4c6..8f3a31fb9 100644--- a/src/web/blog/src/lib/blog/validate-assets.ts+++ b/src/web/blog/src/lib/blog/validate-assets.ts@@ -25,7 +25,7 @@ const REQUIRED_METADATA_FIELDS = ["excerpt","readingTime",] as const;-const OPTIONAL_METADATA_FIELDS = ["dateModified", "image"] as const;+const OPTIONAL_METADATA_FIELDS = ["dateModified", "image", "seoTitle"] as const;const ALLOWED_IMAGE_EXTENSIONS = new Set([".jpg", ".jpeg", ".png", ".svg", ".webp"]);const MAX_IMAGE_BYTES = 2 * 1024 * 1024;@@ -121,6 +121,10 @@ export function readBlogMetadata(if (value !== null) metadata[field] = value;}+ if (/(?:^|[,\n])\s*seoTitle\s*:/.test(object) && !metadata.seoTitle?.trim()) {+ errors.push(`[post: ${fileSlug}] Optional seoTitle must be a non-empty string.`);+ }+for (const field of REQUIRED_METADATA_FIELDS) {if (!metadata[field]?.trim()) {errors.push(`[post: ${fileSlug}] Missing or empty metadata field "${field}".`);diff --git a/src/web/package.json b/src/web/package.jsonindex e11ed16be..7f18259ab 100644--- a/src/web/package.json+++ b/src/web/package.json@@ -9,7 +9,7 @@"dev:auth": "wrangler dev --config auth/wrangler.toml","dev:zones:worker": "node scripts/dev-zones.mjs --worker","build": "next build && tsx scripts/stage-service-worker.ts",- "build:blog:next": "tsx blog/scripts/stage-shared-assets.ts && next build blog && tsx blog/scripts/prepare-open-next-standalone.ts",+ "build:blog:next": "pnpm validate:blog && tsx blog/scripts/stage-shared-assets.ts && next build blog && tsx blog/scripts/validate-rendered.ts && tsx blog/scripts/prepare-open-next-standalone.ts","build:blog": "tsx blog/scripts/stage-shared-assets.ts && opennextjs-cloudflare build --config blog/wrangler.toml --openNextConfigPath blog/open-next.config.ts","build:auth": "wrangler deploy --dry-run --config auth/wrangler.toml --outdir dist","validate:blog": "tsx blog/scripts/validate-blog-assets.ts",