迁移 Claude/Codex/Cursor 开发环境与追溯资产
Co-Authored-By: OpenAI Codex <codex@openai.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
12
.cursor/rules/admin-web.mdc
Normal file
12
.cursor/rules/admin-web.mdc
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
description: admin-web 规则:React/Vite/AntD、AI 管理套件与前端验证。
|
||||
globs: apps/admin-web/**
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# admin-web 规则
|
||||
|
||||
- `admin-web` 是开发/运维后台,不是租户后台。
|
||||
- 遵循 React + Vite + Ant Design 现有页面和 API 封装风格。
|
||||
- AI 管理相关改动先查 2026-04-21、2026-04-30 审计记录。
|
||||
- 前端逻辑改动后优先运行 `pnpm test` / `pnpm lint`,无法运行需说明原因。
|
||||
11
.cursor/rules/audit-history.mdc
Normal file
11
.cursor/rules/audit-history.mdc
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
description: 历史追溯规则:优先使用精简索引、审计记录和当前代码。
|
||||
globs: docs/**
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# 历史追溯规则
|
||||
|
||||
- 日常追溯先查 `docs/ai-env-history/README.md`、`docs/claude-history/`、`docs/audit/changes/`。
|
||||
- 历史摘要只解释来龙去脉,编码前仍以当前文件、当前 diff、当前测试为准。
|
||||
- 原始 JSONL 可用于追查细节,但不要把密钥、DSN、token 原文写入仓库文档。
|
||||
14
.cursor/rules/backend-fastapi.mdc
Normal file
14
.cursor/rules/backend-fastapi.mdc
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
description: FastAPI 后端规则:响应包装、认证、AI 集成、RLS 与测试库。
|
||||
globs: apps/backend/**
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# 后端规则
|
||||
|
||||
- 2xx 响应经 `ResponseWrapperMiddleware` 包装为 `{ "code": 0, "data": <payload> }`。
|
||||
- 后端内部使用 snake_case,JSON 输出通过 `CamelModel` 转 camelCase。
|
||||
- admin、miniapp、tenant-admin 三类 JWT aud 不可混用。
|
||||
- 访问 ETL FDW/RLS 视图前必须设置 `app.current_site_id`。
|
||||
- AI 集成涉及 DashScope、熔断、限流、预算、缓存和运行日志,改动后必须查审计历史。
|
||||
- 后端验证默认在 `apps/backend` 下运行,使用测试库,禁止连正式库。
|
||||
13
.cursor/rules/database.mdc
Normal file
13
.cursor/rules/database.mdc
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
description: 数据库规则:schema 变更、RLS 双 schema、文档同步和验证 SQL。
|
||||
globs: db/**,docs/database/**
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# 数据库规则
|
||||
|
||||
- 任何 PostgreSQL schema/迁移/DDL/ORM 结构变更必须同步 `docs/database/`。
|
||||
- 新建 DWS/DWD RLS 视图必须同时创建原 schema 和 `app` schema 视图。
|
||||
- 回滚需逆序 DROP/ALTER,并提供至少 3 条验证 SQL。
|
||||
- 默认使用 `TEST_DB_DSN` / `TEST_APP_DB_DSN`,禁止连正式库。
|
||||
- DDL 基线变更后运行 `tools/db/gen_consolidated_ddl.py` 并同步权威 DDL。
|
||||
11
.cursor/rules/demo-miniprogram-protect.mdc
Normal file
11
.cursor/rules/demo-miniprogram-protect.mdc
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
description: demo-miniprogram 保护规则:假数据标杆,不删除不迁移到 _DEL。
|
||||
globs: apps/demo-miniprogram/**
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# demo-miniprogram 保护
|
||||
|
||||
- 本目录是假数据 MOCK 版小程序,用于页面样式和展示格式标杆校对。
|
||||
- 禁止删除、移入 `_DEL/` 或改造成真实 API 驱动。
|
||||
- 只有在用户明确要求校正 demo 标杆时才修改。
|
||||
14
.cursor/rules/etl-feiqiu.mdc
Normal file
14
.cursor/rules/etl-feiqiu.mdc
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
description: 飞球 ETL 规则:DWD-DOC 优先、金额口径、DWS 优先、禁止归档目录。
|
||||
globs: apps/etl/connectors/feiqiu/**
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# ETL 飞球规则
|
||||
|
||||
- 金额、支付、消费链路、字段语义优先参考 `apps/etl/connectors/feiqiu/docs/reports/DWD-DOC/`。
|
||||
- `consume_money` 禁止直接用于计算,使用 `items_sum` 拆分字段。
|
||||
- 助教费用必须区分 `assistant_pd_money` 和 `assistant_cx_money`。
|
||||
- 正向结算使用 `settle_type IN (1, 3)`,禁止随意读取 ODS 做业务计算。
|
||||
- DWS/DWD 汇总默认保持幂等,禁止 `TRUNCATE`。
|
||||
- 所有 `_archived/` 目录禁止读取或参考。
|
||||
12
.cursor/rules/miniprogram.mdc
Normal file
12
.cursor/rules/miniprogram.mdc
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
description: 微信小程序规则:生产小程序、Donut/TDesign、demo 标杆对齐。
|
||||
globs: apps/miniprogram/**
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# 小程序规则
|
||||
|
||||
- `apps/miniprogram` 是生产小程序,数据来自后端 API。
|
||||
- UI 样式和展示格式需要参考 `apps/demo-miniprogram` 的 MOCK 标杆。
|
||||
- 改动关键交互、鉴权、API 字段或页面跳转后必须说明验证路径。
|
||||
- 涉及微信开发者工具时优先使用 `weixin-devtools-mcp` 或记录手工验证步骤。
|
||||
18
.cursor/rules/neozqyy-core.mdc
Normal file
18
.cursor/rules/neozqyy-core.mdc
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
description: NeoZQYY 核心工作规范:中文、调研、验证、审计、dirty tree 保护。
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# NeoZQYY 核心规范
|
||||
|
||||
- 始终使用中文交流、解释、审计和文档;命令、API 字段、变量名保持原文。
|
||||
- 以 `AGENTS.md` 为权威规则;历史 `CLAUDE.md` 已并入 `AGENTS.md`,需考古时查 git 历史或 `docs/ai-env-history/`。
|
||||
- 逻辑改动前先做需求审问和前置调研;用户明确跳过时除外。
|
||||
- 逻辑改动后运行相关验证,输出 diff 摘要和未覆盖风险。
|
||||
- 不回滚用户已有改动,不使用破坏性 git 命令,除非用户明确要求。
|
||||
- 审计记录统一写入 `docs/audit/changes/`,`docs/audit/audit_dashboard.md` 只由脚本生成。
|
||||
- 历史追溯优先查 `docs/ai-env-history/`、`docs/claude-history/`、`docs/audit/`,再查原始对话。
|
||||
- 用户偏好模型为 GPT 5.5 与 Claude 4.7;模型选择由 Cursor UI/会话设置控制,规则只保留偏好。
|
||||
- CLI / Shell 中文处理必须优先确保 UTF-8:Python 用 `encoding="utf-8"` / `PYTHONUTF8=1`,CSV 给 Excel 用 `utf-8-sig`,PowerShell/Node 避免依赖系统默认 ANSI 编码。
|
||||
- 遇到中文乱码时,不要把乱码输出当作事实;先调整编码重跑,或明确说明终端编码异常并转述可确认的信息。
|
||||
- Shell 路径和参数含中文、空格或特殊字符时必须正确加引号;复杂中文输出优先用脚本或结构化 API,避免手写脆弱转义。
|
||||
Reference in New Issue
Block a user