chore: 移除 LeetCode 笔记并加入站点验证与 Agent 工作流规则

- 从 collections、导航移除 LeetCode,删除 docs/notes/programming/leetcode 下页面

- devDependencies 显式加入 @vuepress/helper@rc.123,配合 overrides 降低 Vite 预构建白屏风险

- 新增 npm run docs:verify 与 scripts/verify-site.mjs(构建后检查首页 hero)

- .cursor/rules/agent-workflow-verify-and-git.mdc:每次修改须验证;用户未明确说不要提交时默认 commit

Made-with: Cursor
This commit is contained in:
祀梦
2026-03-29 10:05:49 +08:00
parent f50d8ef8c2
commit 2d5b8c35b8
8 changed files with 60 additions and 74 deletions

View File

@@ -0,0 +1,30 @@
---
description: 每次站点相关修改后须本地构建/启动并验证Git 提交默认策略(除非用户明确不要提交)
alwaysApply: true
---
# Agent 工作流:验证站点与 Git 提交
## 修改后必须自行验证(硬性要求)
凡改动 **VuePress / Plume 配置、`docs/` 下内容与主题相关代码** 等会影响站点展示或 dev/build 的行为时,**在本轮任务结束前必须**完成下列至少一项,并确认 **首页等主要页面非白屏**、**无控制台致命报错**(开发模式下可 F12 查看):
1. **推荐(与线上最接近)**:在项目根执行
`npm run docs:build`
然后执行
`npm run docs:verify`
(会检查 `docs/.vuepress/dist/index.html` 是否包含首页 hero 结构。)
2. **若重点验证热更新 / 开发体验**:执行
`npm run docs:dev-clean`
`--clean-cache --clean-temp` 可避免 **Vite 预构建缓存** 仍指向旧版 `@vuepress/helper`,从而触发 **`encodeSVG` 导出缺失、整站白屏**。)
在浏览器打开本地地址,确认首页 hero 与导航正常。
**白屏常见原因速记**`@vuepress/plugin-markdown-chart` 等依赖需要 `@vuepress/helper/client` 导出 `encodeSVG`;若 `docs/.vuepress/.cache` 里预打包了过旧的 helper会出现 **仅 dev 白屏、build 正常**。处理:删缓存或用 `docs:dev-clean` / `docs:build`(脚本已带 clean
## Git 提交策略
- **默认**:在用户**未**于本轮对话中明确要求 **「不要提交」「暂不 commit」「仅改代码不要 git」** 等前提下,在 **验证通过** 后 **应执行 `git add` + `git commit`**,用清晰的中文说明提交内容。
- **例外**:用户明确只要改代码、**由其本人审核后再提交**时,**不执行** commit。
**注意**:构建产物目录 **`docs/.vuepress/dist`**、缓存 **`.cache` / `.temp`** 已在 `.gitignore` 中,**不要**将编译输出提交进源码仓。