From e84908b6686e47919ffabbec1f9b3100674b8e7f Mon Sep 17 00:00:00 2001 From: XiaoDaiGua-Ray <51957438+XiaoDaiGua-Ray@users.noreply.github.com> Date: Tue, 3 Nov 2026 14:59:57 +0800 Subject: [PATCH] chore: add repository AI harness --- .cursor/rules/project.mdc | 6 -- .cursorrules | 1 - .dockerignore | 2 + .github/copilot-instructions.md | 3 - .github/pull_request_template.md | 4 +- .github/workflows/ci.yaml | 2 +- .gitignore | 1 + .npmignore | 4 +- .prettierignore | 1 + AGENTS.md | 48 ++------- CHANGELOG.md | 2 +- CLAUDE.md | 5 - README.md | 6 +- README.zh-CN.md | 6 +- __test__/harness/cli.spec.ts | 76 ++++++++++++++ docs/ai-development.md | 81 --------------- docs/architecture.md | 12 +++ docs/toolchain-upgrade.md | 10 +- eslint.config.mjs | 1 + harness/README.md | 54 ++++++++++ harness/plan.md | 13 +++ harness/run.mjs | 170 +++++++++++++++++++++++++++++++ harness/scopes.json | 68 +++++++++++++ package.json | 5 +- tsconfig.app.json | 2 +- tsconfig.node.json | 2 +- tsconfig.test.json | 2 +- vite.custom.config.ts | 2 +- 28 files changed, 434 insertions(+), 155 deletions(-) delete mode 100644 .cursor/rules/project.mdc delete mode 100644 .cursorrules delete mode 100644 .github/copilot-instructions.md delete mode 100644 CLAUDE.md create mode 100644 __test__/harness/cli.spec.ts delete mode 100644 docs/ai-development.md create mode 100644 harness/README.md create mode 100644 harness/plan.md create mode 100644 harness/run.mjs create mode 100644 harness/scopes.json diff --git a/.cursor/rules/project.mdc b/.cursor/rules/project.mdc deleted file mode 100644 index 834dfe52..00000000 --- a/.cursor/rules/project.mdc +++ /dev/null @@ -1,6 +0,0 @@ ---- -description: Ray Template 项目开发、维护和验证约定 -alwaysApply: true ---- - -先读取并遵循仓库根目录的 `AGENTS.md`。按任务需要查看 `docs/architecture.md` 和 `docs/ai-development.md`,不要在此复制项目规则。 diff --git a/.cursorrules b/.cursorrules deleted file mode 100644 index dc700eb2..00000000 --- a/.cursorrules +++ /dev/null @@ -1 +0,0 @@ -项目规则的唯一维护入口是根目录 AGENTS.md。开始任务时读取 AGENTS.md,并按其中链接查看 docs/architecture.md 与 docs/ai-development.md。 diff --git a/.dockerignore b/.dockerignore index 4f75c951..98f72ab2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,3 +3,5 @@ node_modules .gitignore *.md dist +.ai-local +.harness-local diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md deleted file mode 100644 index 06adc56c..00000000 --- a/.github/copilot-instructions.md +++ /dev/null @@ -1,3 +0,0 @@ -# Ray Template - -先阅读并遵循仓库根目录的 [AGENTS.md](../AGENTS.md)。架构与扩展入口见 [docs/architecture.md](../docs/architecture.md),开发和验收命令见 [docs/ai-development.md](../docs/ai-development.md)。这些文件为项目约定的唯一维护来源。 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9682f4cf..565c85cf 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,8 +4,8 @@ ## 验证 -- [ ] `pnpm check` +- [ ] `pnpm harness verify` 或 CI 的 `pnpm check` - [ ] 涉及页面时,验证对应路由、中文/英文与明暗主题 - [ ] 涉及持久化、权限或公共组件时,检查已有数据与调用方兼容性 - + diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 008aa2d2..a2ac7f9c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,7 +28,7 @@ jobs: - uses: pnpm/action-setup@v6.1.0 - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Typecheck, lint, format, test and build + - name: Validate harness, typecheck, lint, format, test and build run: pnpm check deploy: diff --git a/.gitignore b/.gitignore index 40a6d70e..cf7ebb5c 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ coverage/ .env.local .env.*.local .ai-local/ +.harness-local/ diff --git a/.npmignore b/.npmignore index 973e810e..d654cc96 100644 --- a/.npmignore +++ b/.npmignore @@ -2,6 +2,8 @@ node_modules/* dist/* visualizer.html .idea +.ai-local/ +.harness-local/ auto-imports.d.ts components.d.ts -visualizer.html \ No newline at end of file +visualizer.html diff --git a/.prettierignore b/.prettierignore index 8c1364e6..34d8821e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -12,6 +12,7 @@ visualizer.html coverage/ .husky/_/ .ai-local/ +.harness-local/ CHANGELOG.md src/icons/ src/app-config/echart-themes/ diff --git a/AGENTS.md b/AGENTS.md index 93baf15e..9a6e2966 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,43 +1,9 @@ -# Ray Template:AI 协作约定 +# Ray Template -本仓库是 Vue 3 + TSX 中后台模板。以当前代码、`package.json` 和锁文件为准;先阅读 `README.zh-CN.md` 与 [架构地图](docs/architecture.md),再按任务查看相应模块 README。不要为了每次任务扫描整个仓库。 +Vue 3 + TSX 中后台模板。项目协作、定向验证和交付证据统一从 [AI Harness](harness/README.md) 开始。按任务选择上下文,不必通读仓库。 -## 环境与命令 - -- 使用 `.nvmrc` 中的 Node.js 和 `packageManager` 中的 pnpm;只维护 `pnpm-lock.yaml`。 -- 首次执行 `pnpm install --frozen-lockfile`,然后 `pnpm env:check`。 -- `pnpm dev`:开发服务,默认 `http://127.0.0.1:9527/ray-template/`。 -- `pnpm typecheck`、`pnpm lint`、`pnpm format:check` 为只读检查;自动修复须明确调用 `pnpm lint:fix` 或 `pnpm format`。 -- `pnpm test:run` 单次执行单元测试;`pnpm test` 为交互监听。 -- 完成实现后运行 `pnpm check`,涵盖类型、代码规范、格式、测试和生产构建。记录实际结果与未验证项,不能把静态检查写成浏览器验收。 - -## 实现边界 - -- 保留 Vue 3 Composition API、`defineComponent` + TSX;已有 `.vue` 使用 `