Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 16 additions & 28 deletions .agent/CURRENT_STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

## Current Focus

迁移已完成并上线(2026-09-04)。PR #26 已 merge,Astro 站点部署到 `html` 分支,
线上 https://www.jackzhu.top/ 已切换为新站并回归验证通过(首页/路由/旧 URL/静态资源/署名清除/Pagefind 全绿)。
剩余:Phase J 稳定期清理 + `/photos/` 摄影页(范围变更)。
迁移已上线(PR #26 merged,2026-09-04)。当前工作树有**未提交**改动(`/photos/` 页、`src/lib/site-config.ts` + `site.config.yaml` 配置重构、footer/header/about/link/blog 分页等多处调整),尚未反映到本文件——需要先确认这批改动的内容与验收状态,再推进 Phase J 清理。

## Last Updated

2026-09-04
2026-09-04(本文件为重构后初版,待同步未提交改动)

## Done

Expand All @@ -17,41 +15,30 @@
- 保留 CNAME、robots.txt、百度/Google 站点验证文件到 `public/`,新增 `public/.nojekyll`
- 配置 astro.config.mjs(site=https://www.jackzhu.top)、package.json(engines ≥22.12)、.nvmrc、.editorconfig、.gitignore
- CI:astro_ci.yml(PR 只构建)+ astro_build_deploy.yml(仅 main,dist→html)
- 文档:docs/design-spec.md、.agent/ 三件套、AGENTS.md/CLAUDE.md
- 裁剪模板:blog 单集合新 schema、consts/types 对齐、删示例/项目/giscus/tags/rss.xml
- 建页面与路由:文章日期 URL、首页/列表+分页/关于/友链/分类/atom.xml/404、legacyPath 解析、zh-CN
- 视觉样式:Demo 设计系统(CSS 变量浅/深两套)、Header/Footer/文章页等按 Demo 观感重写、浅色默认
- 视觉样式:Demo 设计系统(CSS 变量浅/深两套)、Header/Footer/文章页按 Demo 观感重写、浅色默认
- 迁移脚本与清单(Phase B):`scripts/*.mjs` + `migration/*.json`(54 篇四分类已批准)
- 批量迁移 54 篇(Phase D):frontmatter 转换、清署名、数学三件套、build 通过
- 图片处置(Phase E):66 条失效 `cdn.noedgeai.com` 图按 `note` 删除并加注;`cdn.nlark.com` 5 条实测 200 保留
- 旧 URL/SEO/订阅兼容(Phase F):百度统计、robots→sitemap-index、canonical/CNAME/.nojekyll/验证文件/atom.xml
- 8 篇课程报告历史格式修复:目录列表化、公式 `$...$`/`$$...$$`、代码围栏+缩进恢复
- Header/favicon:`.site-header` 占满 1080px 防重叠、导航分文字组与图标组、`J` 矢量 `public/favicon.svg` 替换模板显微镜、删除三按钮死代码
- **Phase H 本地验证**:新增 `scripts/verify-build.mjs` 静态审计(10 类)与 Playwright E2E(13 用例),
`npm ci` / `npm run build` / `npm run test` / `npm run test:e2e` 全绿
- 清理未引用依赖 `@fontsource/geist-mono`、`@fontsource/geist-sans`
- `npm audit fix`:兼容范围内降 17 → 5 项
- 站点图标替换为 bloggallery `art_favicon.webp`(1024×1024 webp)→ 本地 `favicon.png`(32)+`apple-touch-icon.png`(180)+`og-image.png`(1024),移除自造 `favicon.svg`
- push `migration/astro` 到 origin,开 PR #26(CI build 通过)
- Header/favicon:`.site-header` 占满 1080px 防重叠、导航分文字组与图标组、`J` 矢量 favicon 替换模板显微镜
- Phase H 本地验证:`scripts/verify-build.mjs` 静态审计(10 类)+ Playwright E2E(13 用例),`npm ci`/`npm run build`/`npm run test`/`npm run test:e2e` 全绿
- 清理未引用依赖 `@fontsource/geist-mono`、`@fontsource/geist-sans`;`npm audit fix` 降 17 → 5 项
- 站点图标替换为 bloggallery `art_favicon.webp`(1024×1024)→ 本地 `favicon.png`(32)+`apple-touch-icon.png`(180)+`og-image.png`(1024)
- push `migration/astro` 到 origin,开 PR #26(CI build 通过),merge 并部署到 `html` 分支,线上回归验证通过

## In Progress

- 无(迁移已完成上线)

## Next Recommended Task

- Phase J 稳定期清理(可选):`migration/*.json`、`scripts/*.mjs` 是否保留/归档;npm audit 剩余 5 项是否升 Astro 7。
- `/photos/` 极简摄影页(范围变更,需单独设计)。
- 工作树未提交改动(`git status` 可见):`package.json`/`package-lock.json`、`Footer.astro`、`Header.astro`、`consts.ts`、`links.ts`、`about.astro`、`blog/[page].astro`、`blog/index.astro`、`link.astro`、`global.css`、`tests/e2e/blog.spec.ts`,新增 `site.config.yaml`、`src/lib/site-config.ts`、`src/pages/photos.astro`

## Known Issues

- 剩余 5 项 npm 审计(1 low / 2 moderate / 2 high,无 critical)需 `npm audit fix --force`
升级到 Astro 7(breaking change)。静态站点实际风险面受限,但不应在上线前无计划硬升;
建议上线后单独评估 Astro 7 升级任务。
- 剩余 5 项 npm 审计(1 low / 2 moderate / 2 high,无 critical)需 `npm audit fix --force` 升 Astro 7(breaking),上线前无计划硬升,建议单独评估。
- `/atom.xml` 用 `@astrojs/rss` 输出 RSS 2.0 非严格 Atom;URL 已保留,格式对齐未做。
- About 文案为草稿,用户逐字审阅(Phase G 文案验收门)。
- 首页/关于/友链等页面结构与事实已自动验证,最终文案仍待用户本轮预览确认。
- `/photos/` 极简摄影页仍待单独设计(范围变更,非本轮核心迁移)。
- 未提交改动(见 In Progress)尚未跑验证,状态未知。

## Important Context

Expand All @@ -60,14 +47,15 @@
- 设计规范:`docs/design-spec.md`(唯一设计事实来源)
- 视觉参考 Demo(已批准):`/Users/jackzhu/Documents/blog-style-demos/jack-blog-recommended-demo.html`
- 原站源码(只读):`/Users/jackzhu/projects/blog`(main),文章 `source/_posts/*.md`(54 篇)
- 当前依赖:astro 6.4.8、@astrojs/mdx 5.x、@astrojs/rss 4.0.19、@astrojs/markdown-remark(直接依赖,供 `unified()`)
- 实施 worker:Codex CLI;Hermes 负责范围控制/diff 审查/测试复验。本轮 Codex 曾挂死,余下定点修复与全量复验由 Hermes 直接完成。
- 实施 worker:Codex CLI;Hermes 负责范围控制/diff 审查/测试复验。

## Verification

Last verified at: 2026-09-04

Commit: `a1dfb0d`(HEAD);注意工作树有未提交改动,下列验证针对 HEAD 提交状态
Command: `npm run build` / `npm run test` / `npm run test:e2e`
Result:
- `npm ci` → exit 0(5 vulnerabilities,需 Astro 7 的强制升级未做)
- `npm run build` → exit 0,astro check 0 errors,67 page(s) built,Pagefind 索引 69 pages,无 markdown/弃用告警
- `npm run build` → exit 0,astro check 0 errors,67 page(s) built,Pagefind 索引 69 pages
- `npm run test` → 10/10 PASS(54 篇一致、54 URL、1156 内链、署名清除、favicon、CNAME/验证文件、sitemap/atom/canonical、Pagefind、代表文章、无凭证)
- `npm run test:e2e` → 13/13 passed(360/390/768/1440 响应式、首页/分页/关于/友链/404、代码/数学/原始 HTML/多图、搜索、主题、键盘、360px 溢出、favicon)
61 changes: 0 additions & 61 deletions .agent/PROJECT_BRIEF.md

This file was deleted.

22 changes: 6 additions & 16 deletions .agent/TASKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,18 @@

## Now

- [x] 裁剪模板:删示例文章/项目/giscus/模板身份,改 `content.config.ts`(blog 单集合 + 新 schema)、`consts.ts`、`types.ts`
- [x] 建页面与路由:首页、`/blog/` 列表+分页、文章日期 URL `[year]/[month]/[day]/[...slug]`、关于、友链、分类结果、`atom.xml`、404
- [x] 视觉样式落到 Astro(克制现代刊物风格,浅色默认+深色,来自 `docs/design-spec.md` §5)
- [x] 迁移脚本与清单(Phase B):`scripts/*.mjs` + `migration/*.json`(54 篇 → 四分类映射、URL 清单、图片审计、友链审计)
- [x] 批量迁移 54 篇(Phase D):frontmatter 转换 + 清除 `Jack Zhu` 署名 + 特殊语法人工处理(含 remark-math/rehype-katex/katex 数学渲染)
- [x] 图片处置实现(Phase E 第二步):8 篇课程报告 66 条失效 `cdn.noedgeai.com` 图引用全部按 `note` 删除并加注「(原图已失效)」,`npm run build` 通过
- [x] 修复 8 篇课程报告历史格式错误:7 篇 TOC 列表化、正文公式改 `$...$`/`$$...$$`、FCM/MIMC 未围栏代码补 ```python 围栏,`npm run build` 通过
- [x] 修复桌面 Header 导航重叠并恢复站点标识:稳定双组导航、SVG 图标按钮、主题死代码清理、设计事实源更新;站点图标最终用 bloggallery 的 `art_favicon.webp`(转 PNG 本地托管 favicon/apple-touch-icon/og-image)
(迁移已上线,无进行中任务)

## Next

- [x] 图片与静态资源(Phase E 剩余):`cdn.nlark.com` 5 条实测 200 有效;gcore 56 张保留确认
- [x] 旧 URL/SEO/订阅兼容(Phase F):百度统计入 head、robots→sitemap-index、canonical/sitemap/CNAME/.nojekyll/验证文件/atom.xml 全部验证通过
- [x] 本地完整验证(Phase H):`npm ci` + `npm run build` + `npm run test`(10/10) + `npm run test:e2e`(13/13),Playwright 矩阵 360/390/768/1440px 全通过
- [ ] 稳定期清理(Phase J)—— 验收:对 `migration/*.json`、`scripts/*.mjs` 逐项给出保留或归档结论并落地;剩余 npm audit 5 项给出处置方案
- [ ] 评估 Pages artifact 模式 —— 验收:写清从 `html` 分支发布迁移到官方 Pages artifact 模式的收益/成本与迁移步骤,给出 Go/No-Go

## Later

- [x] GitHub 审阅与上线(Phase I):PR #26 已 merge,`astro_build_deploy.yml` 部署 dist 到 `html` 分支,线上 www.jackzhu.top 已切换为 Astro 新站并回归验证通过
- [ ] 稳定期清理(Phase J)
- [ ] 评估从 `html` 分支发布迁移到官方 Pages artifact 模式
- [ ] 新建 `/photos/` 极简摄影页(仅放用户自拍照片,不放文章插图;范围变更,需单独设计)。cover→og:image 已接线完成
- [ ] `/photos/` 极简摄影页(范围变更,需单独设计)—— 验收:`npm run build` exit 0、`npm run test:e2e` 全绿、仅放用户自拍照片不放文章插图
- [ ] npm audit 剩余 5 项(1 low / 2 moderate / 2 high)—— 验收:评估 Astro 7 升级(breaking)的必要性并给出结论,不擅自 `--force`

## Backlog

- [ ] npm audit 剩余 5 项(1 low / 2 moderate / 2 high,需 `npm audit fix --force` 升 Astro 7 breaking)评估与处置
- [ ] Astro 7 升级结论落地(如评估批准)
39 changes: 30 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
# Project Agent Protocol
# Blog Astro Migration

项目协议在 `.agent/` 目录下。
## Goal

每次开始前必须读取:
1. `.agent/PROJECT_BRIEF.md`
2. `.agent/CURRENT_STATE.md`
3. `.agent/TASKS.md`
把 Hexo + Butterfly 博客(54 篇,六年)迁移为基于 Astro Micro 的克制现代独立博客,替换线上唯一站点 `www.jackzhu.top`,保留全部旧文章日期型 URL、公开身份信息与订阅地址。已于 2026-09-04 上线(PR #26 merged)。

按 `.agent/PROJECT_BRIEF.md` 中的 Working Rules 执行。
`TASKS.md` 是唯一任务源,不要使用其他 todo 工具。
## Stack & Commands

设计事实来源以 `docs/design-spec.md` 为准。
- Astro 6.4.8 + @astrojs/mdx 5.x + @astrojs/rss 4.0.19 + @astrojs/markdown-remark(供 `unified()`)
- Node 22(≥22.12);Astro Micro 锁 commit `af69926c87341719846fe0e7a415483deb4e05ee`
- 安装:`npm ci`
- 构建:`npm run build`(astro check + 构建 + Pagefind 索引)
- 静态审计:`npm run test`(10 用例,`scripts/verify-build.mjs`)
- E2E:`npm run test:e2e`(13 用例,Playwright 矩阵 360/390/768/1440px)

## Conventions & Gotchas

- 工作目录:`/Users/jackzhu/projects/blog-astro-migration`(branch `migration/astro`)
- 设计事实来源:`docs/design-spec.md`(唯一)
- 视觉参考 Demo(已批准):`/Users/jackzhu/Documents/blog-style-demos/jack-blog-recommended-demo.html`
- 原站源码(只读):`/Users/jackzhu/projects/blog`(main),文章 `source/_posts/*.md`
- 迁移计划(7 阶段):`/Users/jackzhu/projects/blog/.hermes/plans/2026-09-03_195621-astro-blog-migration.md`
- 部署:GitHub Pages artifact 模式,CI `astro_build_deploy.yml`(仅 main,dist→html 分支)

## Project Rules

1. 公开署名只写 `Jack` / `Jack's Blog`,不写真名、公司履历、非公开项目细节。
2. 不自动 git commit / push / deploy / publish——本地验证 + 用户批准后才 push。
3. 迁移期间只读旧内容 `main` 工作树的源 Markdown(正文改动另立编辑任务)。
4. 文章优先,不是作品集/仪表盘;不设评论、独立归档、标签云、Projects/Publications。

## Continuation

每次继续前先读 `.agent/TASKS.md` 和 `.agent/CURRENT_STATE.md`。
15 changes: 2 additions & 13 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,2 @@
# Project Agent Protocol

项目协议在 `.agent/` 目录下。

每次开始前必须读取:
1. `.agent/PROJECT_BRIEF.md`
2. `.agent/CURRENT_STATE.md`
3. `.agent/TASKS.md`

按 `.agent/PROJECT_BRIEF.md` 中的 Working Rules 执行。
`TASKS.md` 是唯一任务源,不要使用其他 todo 工具。

设计事实来源以 `docs/design-spec.md` 为准。
<!-- 本项目面向 AI 助手的说明统一维护在 AGENTS.md;本文件仅作引用,请勿在此单独维护内容。 -->
@AGENTS.md
54 changes: 0 additions & 54 deletions docs/CONTENT_MAP.md

This file was deleted.

Loading
Loading