Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.
HTML agent-skillsai-agentsarchitecture-diagramclaude-codeclaude-skillscodexcoding-agentsdeepseek-harnessdeveloper-toolsdiagramsdiagrams-as-codedsh-pluginflowchartllmmermaidopencodesequence-diagramsoftware-architecturesystem-designvisualization
fix(website): clarify gallery evidence and add life diagram entry links
tt-a1i9c4985a68b52
diff --git a/website/package.json b/website/package.jsonindex 0d3a6ee8..21343820 100644--- a/website/package.json+++ b/website/package.json@@ -12,7 +12,7 @@"preview": "astro preview","check": "astro check","test": "node --test test/*.test.mjs ../test/cloudflare-output.test.mjs",- "test:browser": "node --test --test-name-pattern=\"real Chrome\" ../test/site-language-continuity.test.mjs test/community-browser.test.mjs test/homepage-browser.test.mjs test/agent-diagrams-browser.test.mjs test/mco-source-case-browser.test.mjs"+ "test:browser": "node --test --test-name-pattern=\"real Chrome\" ../test/site-language-continuity.test.mjs test/community-browser.test.mjs test/homepage-browser.test.mjs test/agent-diagrams-browser.test.mjs test/mco-source-case-browser.test.mjs test/gallery-browser.test.mjs"},"dependencies": {"@astrojs/react": "^6.0.6",diff --git a/website/src/data/site-metadata.mjs b/website/src/data/site-metadata.mjsindex bb57e6bb..b98bf61e 100644--- a/website/src/data/site-metadata.mjs+++ b/website/src/data/site-metadata.mjs@@ -21,8 +21,8 @@ const descriptions = {zh: ['Archify 快速上手 — 创建第一张图', '为你的 AI Agent 安装 Archify 技能,从自然语言或代码仓库创建图表。选择 Agent、图表类型和输入方式,复制对应的命令与提示词。'],},gallery: {- en: ['Archify Proof Lab — Validated Diagram Gallery', 'Explore validated Archify diagrams with interactive HTML, JSON sources, and recorded checks. Automated validation and human visual review appear separately.'],- zh: ['Archify 验证作品集 — 可探索的图表成品', '探索经过验证的 Archify 图表,查看交互式 HTML 成品、对应 JSON 源码与检查记录。自动验证与人工视觉评审分别列出。'],+ en: ['Archify Proof Lab — Validated Diagram Gallery', 'Explore interactive Archify diagrams, their JSON sources, and automated structure and layout checks. These records do not establish human visual review.'],+ zh: ['Archify 验证作品集 — 可探索的图表成品', '探索 Archify 交互式图表、对应 JSON 源码及自动结构与布局检查记录。这些记录不代表已完成人工视觉评审。'],},community: {en: ['Archify Community — Packages Built on Archify', 'Explore independent packages built on Archify: skills, recipes, themes, locales, and CLI wrappers, with source, license, compatibility, and evidence.'],diff --git a/website/src/pages/gallery.astro b/website/src/pages/gallery.astroindex 70011908..f7d3c9a4 100644--- a/website/src/pages/gallery.astro+++ b/website/src/pages/gallery.astro@@ -22,6 +22,7 @@ const { lang = 'en' } = Astro.props;<div class="lead-label" data-en="Generated showcase / verified artifacts" data-zh="自动生成作品集 / 真实验证成品">Generated showcase / verified artifacts</div><h1 data-en="Proof,<br><em>not promises.</em>" data-zh="先看成品,<br><em>再谈能力。</em>">Proof,<br><em>not promises.</em></h1><p class="hero-copy" data-en="Every frame below is a live Archify artifact—not a mockup. Each one is regenerated from versioned JSON IR, checked for structural integrity, and linked to the exact source that produced it." data-zh="下面每一帧都是可运行的 Archify 成品,不是效果图。它们全部由版本化 JSON IR 重新生成、经过结构检查,并链接到产生它的精确源数据。">Every frame below is a live Archify artifact—not a mockup. Each one is regenerated from versioned JSON IR, checked for structural integrity, and linked to the exact source that produced it.</p>+ <p class="hero-copy" id="gallery-evidence-limit" data-en="The gallery records automated structure and layout checks, not human visual-review results. Open each artifact to assess its meaning and readability." data-zh="作品集记录自动结构与布局检查,不提供人工视觉评审结果。请打开成品,判断内容含义与可读性。">The gallery records automated structure and layout checks, not human visual-review results. Open each artifact to assess its meaning and readability.</p></div><div class="proof-board" aria-label="Gallery quality summary"><div class="proof-row"><span class="proof-value">{gallery.entryCount}</span><span class="proof-label" data-en="scenario proofs<br>from real IR" data-zh="个场景成品<br>来自真实 IR">scenario proofs<br>from real IR</span></div>@@ -73,25 +74,25 @@ const { lang = 'en' } = Astro.props;<a class="life-plate" href="cases/life/leave-plan.workflow.html?present=1" target="_blank" rel="noopener" aria-labelledby="life-q-leave-plan"><img src="assets/life/leave-plan.workflow.webp" alt="" loading="lazy" decoding="async" width="2160" height="1350"></a><div class="life-meta"><span class="life-lang">中文</span><span class="life-kind" data-en="Workflow" data-zh="工作流">Workflow</span></div><h3 class="life-q" id="life-q-leave-plan" data-en="How should I spread my leave across the year?" data-zh="一年的假怎么排最划算?">How should I spread my leave across the year?</h3>- <div class="life-links"><a class="card-link primary" href="cases/life/leave-plan.workflow.html?present=1" target="_blank" rel="noopener" data-en="Open artifact" data-zh="打开成品">Open artifact</a><a class="card-link" href="cases/life/leave-plan.workflow.json" target="_blank" rel="noopener">JSON</a></div>+ <div class="life-links"><a class="card-link primary" href="cases/life/leave-plan.workflow.html?present=1" target="_blank" rel="noopener" data-en="Open artifact" data-zh="打开成品">Open artifact</a><a class="card-link" href="cases/life/leave-plan.workflow.json" target="_blank" rel="noopener">JSON</a><a class="card-link create-link" href="start.html?type=workflow&input=description&source=gallery" data-en="Create this type" data-zh="按此类型开始">Create this type</a></div></article><article class="life-card"><a class="life-plate" href="cases/life/job-search.lifecycle.html?present=1" target="_blank" rel="noopener" aria-labelledby="life-q-job-search"><img src="assets/life/job-search.lifecycle.webp" alt="" loading="lazy" decoding="async" width="2160" height="1350"></a><div class="life-meta"><span class="life-lang">EN</span><span class="life-kind" data-en="Lifecycle" data-zh="生命周期">Lifecycle</span></div><h3 class="life-q" id="life-q-job-search" data-en="Where does each job application stand?" data-zh="每份求职申请走到哪一步了?">Where does each job application stand?</h3>- <div class="life-links"><a class="card-link primary" href="cases/life/job-search.lifecycle.html?present=1" target="_blank" rel="noopener" data-en="Open artifact" data-zh="打开成品">Open artifact</a><a class="card-link" href="cases/life/job-search.lifecycle.json" target="_blank" rel="noopener">JSON</a></div>+ <div class="life-links"><a class="card-link primary" href="cases/life/job-search.lifecycle.html?present=1" target="_blank" rel="noopener" data-en="Open artifact" data-zh="打开成品">Open artifact</a><a class="card-link" href="cases/life/job-search.lifecycle.json" target="_blank" rel="noopener">JSON</a><a class="card-link create-link" href="start.html?type=lifecycle&input=description&source=gallery" data-en="Create this type" data-zh="按此类型开始">Create this type</a></div></article><article class="life-card"><a class="life-plate" href="cases/life/monthly-money.dataflow.html?present=1" target="_blank" rel="noopener" aria-labelledby="life-q-monthly-money"><img src="assets/life/monthly-money.dataflow.webp" alt="" loading="lazy" decoding="async" width="2160" height="1350"></a><div class="life-meta"><span class="life-lang">EN</span><span class="life-kind" data-en="Data flow" data-zh="数据流">Data flow</span></div><h3 class="life-q" id="life-q-monthly-money" data-en="Where does my paycheck go each month?" data-zh="工资每个月都去哪了?">Where does my paycheck go each month?</h3>- <div class="life-links"><a class="card-link primary" href="cases/life/monthly-money.dataflow.html?present=1" target="_blank" rel="noopener" data-en="Open artifact" data-zh="打开成品">Open artifact</a><a class="card-link" href="cases/life/monthly-money.dataflow.json" target="_blank" rel="noopener">JSON</a></div>+ <div class="life-links"><a class="card-link primary" href="cases/life/monthly-money.dataflow.html?present=1" target="_blank" rel="noopener" data-en="Open artifact" data-zh="打开成品">Open artifact</a><a class="card-link" href="cases/life/monthly-money.dataflow.json" target="_blank" rel="noopener">JSON</a><a class="card-link create-link" href="start.html?type=dataflow&input=description&source=gallery" data-en="Create this type" data-zh="按此类型开始">Create this type</a></div></article><article class="life-card"><a class="life-plate" href="cases/life/renting.sequence.html?present=1" target="_blank" rel="noopener" aria-labelledby="life-q-renting"><img src="assets/life/renting.sequence.webp" alt="" loading="lazy" decoding="async" width="2160" height="1350"></a><div class="life-meta"><span class="life-lang">中文</span><span class="life-kind" data-en="Sequence" data-zh="时序图">Sequence</span></div><h3 class="life-q" id="life-q-renting" data-en="Who says what when I rent a flat?" data-zh="租房时,谁跟谁说了什么?">Who says what when I rent a flat?</h3>- <div class="life-links"><a class="card-link primary" href="cases/life/renting.sequence.html?present=1" target="_blank" rel="noopener" data-en="Open artifact" data-zh="打开成品">Open artifact</a><a class="card-link" href="cases/life/renting.sequence.json" target="_blank" rel="noopener">JSON</a></div>+ <div class="life-links"><a class="card-link primary" href="cases/life/renting.sequence.html?present=1" target="_blank" rel="noopener" data-en="Open artifact" data-zh="打开成品">Open artifact</a><a class="card-link" href="cases/life/renting.sequence.json" target="_blank" rel="noopener">JSON</a><a class="card-link create-link" href="start.html?type=sequence&input=description&source=gallery" data-en="Create this type" data-zh="按此类型开始">Create this type</a></div></article></div></div>diff --git a/website/src/styles/gallery.css b/website/src/styles/gallery.cssindex 443e01d1..91391aac 100644--- a/website/src/styles/gallery.css+++ b/website/src/styles/gallery.css@@ -236,7 +236,7 @@.life-lang { padding:.15rem .45rem; border-radius:999px; border:1px solid var(--line-hi); color:var(--text-2); }.life-kind { color:var(--accent); }.life-q { font-family:var(--font-title); font-size:1.125rem; font-weight:500; letter-spacing:-.02em; line-height:1.3; color:var(--text); text-wrap:balance; }- .life-links { display:flex; gap:.5rem; margin-top:auto; }+ .life-links { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:auto; }@media (max-width:1100px) { .life-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }@media (max-width:560px) { .life-grid { grid-template-columns:1fr; } }@media (prefers-reduced-motion:reduce) { .life-plate:hover { transform:none; } }diff --git a/website/test/gallery-browser.test.mjs b/website/test/gallery-browser.test.mjsnew file mode 100644index 00000000..353d31d3--- /dev/null+++ b/website/test/gallery-browser.test.mjs@@ -0,0 +1,130 @@+import { test } from 'node:test';+import assert from 'node:assert/strict';+import fs from 'node:fs';+import http from 'node:http';+import path from 'node:path';+import { fileURLToPath } from 'node:url';+import { execFileSync } from 'node:child_process';+import { ChromeVisualBrowser, findChrome } from '../../archify/bin/visual-check.mjs';++const website = fileURLToPath(new URL('../', import.meta.url));+const enabled = process.env.ARCHIFY_SITE_INTEGRATION === '1';+const root = path.resolve(process.env.ARCHIFY_SITE_ROOT || path.join(website, 'dist'));+const mount = process.env.ARCHIFY_SITE_BASE ?? '/archify';+const target = mount ? 'github' : 'cloudflare';+const output = path.join(website, '.browser-evidence', target);++test('real Chrome: gallery evidence limits and life-card entry points stay readable and usable', {+ skip: enabled ? false : 'Set ARCHIFY_SITE_INTEGRATION=1 and ARCHIFY_CHROME to run gallery browser evidence.',+ timeout: 180000,+}, async () => {+ const chrome = findChrome();+ assert.ok(chrome, 'The requested gallery gate requires usable Chrome.');+ const server = http.createServer((request, response) => {+ const url = new URL(request.url, 'http://127.0.0.1');+ if (mount && !url.pathname.startsWith(`${mount}/`)) return response.writeHead(404).end();+ let relative = url.pathname.slice(mount.length).replace(/^\/+/, '') || 'index.html';+ // Resolve actual static HTML routes, never an SPA fallback.+ if (!path.extname(relative) && fs.existsSync(path.join(root, `${relative}.html`))) relative += '.html';+ const file = path.resolve(root, relative);+ if (!file.startsWith(`${root}${path.sep}`)) return response.writeHead(404).end();+ try {+ const types = { '.html': 'text/html', '.js': 'text/javascript', '.css': 'text/css', '.svg': 'image/svg+xml', '.woff2': 'font/woff2' };+ response.setHeader('Content-Type', types[path.extname(file)] || 'application/octet-stream');+ response.end(fs.readFileSync(file));+ } catch { response.writeHead(404).end(); }+ });+ let browser;+ fs.mkdirSync(output, { recursive: true });+ const event = process.env.GITHUB_EVENT_PATH ? JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8')) : null;+ const manifest = {+ capturedAt: new Date().toISOString(), target,+ checkoutSha: execFileSync('git', ['rev-parse', 'HEAD'], { cwd: website, encoding: 'utf8' }).trim(),+ pullRequestHead: event?.pull_request?.head?.sha || null,+ runId: process.env.GITHUB_RUN_ID || null,+ screenshots: [], navigation: [],+ };+ const saveManifest = () => fs.writeFileSync(path.join(output, 'gallery-manifest.json'), JSON.stringify(manifest, null, 2));+ try {+ await new Promise(resolve => server.listen(0, '127.0.0.1', resolve));+ browser = new ChromeVisualBrowser(chrome);+ const session = await browser.sessionPromise;+ const evaluate = async expression => {+ const result = await browser.cdp.send('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true }, session);+ assert.ok(!result.exceptionDetails, JSON.stringify(result.exceptionDetails));+ return result.result.value;+ };+ const settled = () => evaluate('new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))');+ const loadedAction = async action => {+ const loaded = browser.cdp.waitFor('Page.loadEventFired', session);+ loaded.catch(() => {});+ await action();+ await loaded;+ await evaluate('document.fonts.ready');+ };+ const urlFor = lang => `http://127.0.0.1:${server.address().port}${mount}/${lang === 'zh' ? 'zh/' : ''}gallery${mount ? '.html' : ''}`;+ const navigate = url => loadedAction(() => browser.cdp.send('Page.navigate', { url }, session));+ await browser.cdp.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-reduced-motion', value: 'reduce' }] }, session);+ for (const width of [1440, 390, 320]) for (const lang of ['en', 'zh']) {+ await browser.cdp.send('Emulation.setDeviceMetricsOverride', { width, height: 1000, deviceScaleFactor: 1, mobile: width < 768 }, session);+ await navigate(urlFor(lang));+ for (const theme of ['light', 'dark']) {+ await evaluate(`(async () => {+ if (document.documentElement.dataset.theme !== ${JSON.stringify(theme)}) document.querySelector('[data-theme-toggle]').click();+ // Finish finite theme transitions before inspecting their actual appearance.+ await Promise.all(document.getAnimations().filter(a => Number.isFinite(a.effect.getComputedTiming().endTime)).map(a => a.finished.catch(() => {})));+ })()`);+ for (const region of ['limit', 'life-0', 'life-1', 'life-2', 'life-3']) {+ const selector = region === 'limit' ? '#gallery-evidence-limit' : `.life-card:nth-child(${Number(region.slice(-1)) + 1})`;+ await evaluate(`document.querySelector(${JSON.stringify(selector)}).scrollIntoView({block:'center',behavior:'instant'})`);+ await settled();+ const receipt = await evaluate(`(() => {+ const region = document.querySelector(${JSON.stringify(selector)});+ const nodes = ${JSON.stringify(region)} === 'limit' ? [region] : [...region.querySelectorAll('.life-q, .life-links a')];+ return { lang: document.documentElement.lang, theme: document.documentElement.dataset.theme, width: innerWidth, pageWidth: document.documentElement.scrollWidth,+ nodes: nodes.map(node => { const r = node.getBoundingClientRect(), style = getComputedStyle(node); return {+ text: node.innerText, href: node.getAttribute('href'), height: r.height,+ visible: style.visibility === 'visible' && Number(style.opacity) === 1 && r.width > 0 && r.height > 0,+ fits: r.left >= -1 && r.right <= innerWidth + 1 && r.top >= document.querySelector('.site-nav').getBoundingClientRect().bottom && r.bottom <= innerHeight,+ reachable: !node.href || document.elementFromPoint(r.x + r.width / 2, r.y + r.height / 2)?.closest('a') === node+ }; }) };+ })()`);+ const name = `gallery-${lang}-${width}-${theme}-${region}.png`;+ const image = await browser.cdp.send('Page.captureScreenshot', { format: 'png' }, session);+ fs.writeFileSync(path.join(output, name), Buffer.from(image.data, 'base64'));+ manifest.screenshots.push({ file: name, width, lang, theme, region, receipt }); saveManifest();+ assert.equal(receipt.lang, lang === 'zh' ? 'zh-Hans' : 'en');+ assert.equal(receipt.theme, theme);+ assert.ok(receipt.pageWidth <= width + 1, `${name}: no page overflow`);+ assert.equal(receipt.nodes.length, region === 'limit' ? 1 : 4);+ for (const node of receipt.nodes) {+ assert.ok(node.visible && node.fits && node.reachable, `${name}: readable and reachable ${node.text}`);+ if (node.href) assert.ok(node.height >= 44, `${name}: touch target`);+ }+ }+ }+ for (const [index, type] of ['workflow', 'lifecycle', 'dataflow', 'sequence'].entries()) {+ await navigate(urlFor(lang));+ const point = await evaluate(`(() => {+ const link = document.querySelectorAll('.life-card .create-link')[${index}];+ link.scrollIntoView({block:'center',behavior:'instant'});+ const r = link.getBoundingClientRect(); return { x:r.x+r.width/2, y:r.y+r.height/2 };+ })()`);+ await settled();+ await loadedAction(async () => {+ for (const eventType of ['mousePressed', 'mouseReleased']) await browser.cdp.send('Input.dispatchMouseEvent', { type:eventType, ...point, button:'left', clickCount:1 }, session);+ });+ const receipt = await evaluate(`(() => ({ lang:document.documentElement.lang, path:location.pathname, query:Object.fromEntries(new URL(location.href).searchParams), type:document.querySelector('[data-type][aria-selected="true"]').dataset.type, input:document.querySelector('[data-input][aria-selected="true"]').dataset.input, prompt:document.getElementById('recipe-prompt').innerText, expected:JSON.parse(document.getElementById('start-data').textContent)[${JSON.stringify(type)}][${JSON.stringify(lang)}].descriptionPrompt }))()`);+ manifest.navigation.push({ width, lang, type, receipt }); saveManifest();+ assert.equal(receipt.lang, lang === 'zh' ? 'zh-Hans' : 'en');+ assert.equal(receipt.path, `${mount}/${lang === 'zh' ? 'zh/' : ''}start${mount ? '.html' : ''}`);+ assert.equal(receipt.query.type, type); assert.equal(receipt.query.input, 'description'); assert.equal(receipt.query.source, 'gallery');+ assert.equal(receipt.type, type); assert.equal(receipt.input, 'description');+ assert.equal(receipt.prompt, receipt.expected, 'destination uses the existing generic type prompt, not a recreated life template');+ }+ }+ } finally {+ if (browser) await browser.close();+ await new Promise(resolve => server.close(resolve));+ }+});diff --git a/website/test/seo-content.test.mjs b/website/test/seo-content.test.mjsindex ffe58b12..ffcaf047 100644--- a/website/test/seo-content.test.mjs+++ b/website/test/seo-content.test.mjs@@ -124,3 +124,26 @@ for (const lang of ['en', 'zh']) {}});}++for (const lang of ['en', 'zh']) {+ test(`initial ${lang} gallery states its evidence limit and offers generic life-diagram starting points`, () => {+ const page = read('gallery', lang);+ const limit = clean(text(find(page, 'gallery-evidence-limit')));+ assert.ok(limit.includes(lang === 'zh' ? '不提供人工视觉评审结果' : 'not human visual-review results'));+ const description = (function walk(node) {+ return node.tagName === 'meta' && attr(node, 'name') === 'description' ? attr(node, 'content') : (node.childNodes || []).map(walk).find(Boolean);+ })(page);+ assert.ok(description.includes(lang === 'zh' ? '不代表已完成人工视觉评审' : 'do not establish human visual review'));+ const cards = byClass(page, 'life-card');+ assert.equal(cards.length, 4);+ for (const [index, type] of ['workflow', 'lifecycle', 'dataflow', 'sequence'].entries()) {+ const entryLinks = links(cards[index]);+ const create = entryLinks.find(link => (attr(link, 'class') || '').split(/\s+/).includes('create-link'));+ assert.ok(create, `${type}: a next step is available without JavaScript`);+ assert.equal(clean(text(create)), lang === 'zh' ? '按此类型开始' : 'Create this type');+ assert.equal(attr(create, 'href'), `${lang === 'zh' ? 'zh/' : ''}start${cloudflare ? '' : '.html'}?type=${type}&input=description&source=gallery`);+ assert.ok(entryLinks.some(link => attr(link, 'href').endsWith(`.${type}.html?present=1`)), 'existing artifact remains accessible');+ assert.ok(entryLinks.some(link => attr(link, 'href').endsWith(`.${type}.json`)), 'existing source remains accessible');+ }+ });+}