From 004b446de533873b2cbf20245fa0f730419a309a Mon Sep 17 00:00:00 2001 From: czm Date: Tue, 8 Sep 2026 17:14:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=B0=86=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=9C=8B=E6=9D=BF=E7=94=9F=E6=88=90=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E4=BB=8E=20index.html=20=E6=94=B9=E4=B8=BA=20board.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 避免在用户现有前端工程中意外冲掉项目入口 index.html - 同步更新 package.json、SKILL.md 与 Pages 部署工作流 Co-Authored-By: Claude --- .github/workflows/deploy-pages.yml | 3 ++- SKILL.md | 6 +++--- index.html => board.html | 0 package.json | 4 ++-- scripts/build-board.ts | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) rename index.html => board.html (100%) diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 3d212c3..3667ac7 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -31,7 +31,8 @@ jobs: - name: Prepare Pages Directory run: | mkdir -p _site - cp index.html _site/ + cp board.html _site/ + cp board.html _site/index.html cp demo.html _site/ 2>/dev/null || true cp -r assets _site/ 2>/dev/null || true diff --git a/SKILL.md b/SKILL.md index 72ba66f..7e9528a 100644 --- a/SKILL.md +++ b/SKILL.md @@ -115,7 +115,7 @@ Status: <状态> npm run verify-agent-note-tree # 校验目录合法性、分类、文件名及相对 Markdown 链接有效性 npm run verify-agent-note-format # 校验头块、状态、必选节(Alternatives)与现在时禁令 npm run archive-agent-note # 方案被取代时一键归档并提示修复入站相对死链 -npm run init-board # [日常开发] 生成 ~69KB 轻量直连看板 index.html(推荐) +npm run init-board # [日常开发] 生成 ~69KB 轻量直连看板 board.html(推荐) npm run bundle-board # [脱机打包] 生成内嵌全量数据的自包含演示看板 demo.html ``` @@ -126,7 +126,7 @@ npx tsx scripts/verify-agent-note-tree.ts npx tsx scripts/verify-agent-note-format.ts npx tsx scripts/archive-agent-note.ts -# 日常开发(轻量直连,推荐):在工作目录快速生成轻量看板 index.html (仅 ~69KB) +# 日常开发(轻量直连,推荐):在工作目录快速生成轻量看板 board.html (仅 ~69KB) npx tsx scripts/build-board.ts --init [targetPath] [projectName] # 静态打包(脱机大单体):生成包含全量内嵌笔记数据的单文件 demo.html (供脱机分发或 GitHub Pages) @@ -136,7 +136,7 @@ npx tsx scripts/build-board.ts --bundle [notesDir] [outputPath] [projectName] ### 💡 工程决策看板运行机制 (Agent Notes Board) **1. 日常开发模式(推荐):** -- 运行 `npx tsx /scripts/build-board.ts --init index.html "项目决策看板"` 生成约 69KB 的纯模板文件; +- 运行 `npx tsx /scripts/build-board.ts --init board.html "项目决策看板"` 生成约 69KB 的纯模板文件; - 用浏览器打开后,点击右上角 **「连接本地目录」** 授权选择 `.agents/notes`,浏览器通过 File System Access API 直读本地; - **零构建、零大单体冗余**:开发或 Agent 增删改 Note 后,只要切回浏览器窗口立刻自动静默热更新! diff --git a/index.html b/board.html similarity index 100% rename from index.html rename to board.html diff --git a/package.json b/package.json index 62289f1..34ccda5 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,9 @@ "verify-agent-note-tree": "npx tsx scripts/verify-agent-note-tree.ts", "verify-agent-note-format": "npx tsx scripts/verify-agent-note-format.ts", "archive-agent-note": "npx tsx scripts/archive-agent-note.ts", - "init-board": "npx tsx scripts/build-board.ts --init index.html '工程决策看板'", + "init-board": "npx tsx scripts/build-board.ts --init board.html '工程决策看板'", "bundle-board": "npx tsx scripts/build-board.ts --bundle .agents/notes demo.html '工程决策看板'", - "build-board": "npx tsx scripts/build-board.ts --init index.html '工程决策看板'", + "build-board": "npx tsx scripts/build-board.ts --init board.html '工程决策看板'", "import-dsh-notes": "npx tsx scripts/import-dsh-notes.ts" } } diff --git a/scripts/build-board.ts b/scripts/build-board.ts index 0eb8075..f16385b 100644 --- a/scripts/build-board.ts +++ b/scripts/build-board.ts @@ -36,7 +36,7 @@ function checkTargetSafety(targetPath: string) { } if (isInitMode) { - const targetPath = cleanArgs[0] ? resolve(cleanArgs[0]) : resolve(process.cwd(), 'index.html'); + const targetPath = cleanArgs[0] ? resolve(cleanArgs[0]) : resolve(process.cwd(), 'board.html'); const projectName = cleanArgs[1] || '工程决策看板'; checkTargetSafety(targetPath);