/** * 圖解版總覽網頁:模板本身,以及兩份正本裡產生它、把網址寫回議題的規則。 */ import test from 'node:test'; import assert from 'node:assert/strict'; import { promptStep, readPrompt, readTemplateFile } from './helpers/prompt-doc.js'; const template = readTemplateFile('overview-artifact.html'); const planPrompt = readPrompt('sdlc-plan'); const analyzePrompt = readPrompt('sdlc-analyze'); /** 只看產生總覽那一步,避免拿整份正本的任何一處來充數 */ const planStep = promptStep(planPrompt, '產生圖解版總覽'); /** 分析版的那一步,同樣只看它自己 */ const analyzeStep = promptStep(analyzePrompt, '產生分析版的圖解總覽'); /** 模板要填的欄位 */ const PLACEHOLDERS = ['標題', '來源議題', '總覽', '目標', '流程圖', '工作包全景', '頁尾']; // ── 模板 ─────────────────────────────────────────────────────────── test('模板以 {{變數}} 佔位,欄位齊全', () => { const found = new Set([...template.matchAll(/\{\{([^}]+)\}\}/g)].map((m) => m[1])); for (const name of PLACEHOLDERS) { assert.ok(found.has(name), `模板缺少佔位 {{${name}}}`); } }); test('樣式與內容分離:樣式集中在 style 區塊,內文不帶 style 屬性', () => { const styleBlocks = template.match(/