From d98b0aefb0814ce3dcb034094f1dbe8795cd85da Mon Sep 17 00:00:00 2001 From: jacy <18049821889@163.com> Date: Sun, 23 Aug 2026 14:37:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=B8=8A=E4=B8=8B=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cursor/rules/dukang-core.mdc | 55 ------------------------ .cursor/rules/git-conventions.mdc | 34 +++------------ .cursor/skills/dukang-coding/SKILL.md | 2 +- .cursor/skills/dukang-prev1/SKILL.md | 1 + .cursor/skills/dukang-release/SKILL.md | 1 + .cursor/skills/dukang-task-card/SKILL.md | 1 + 6 files changed, 10 insertions(+), 84 deletions(-) delete mode 100644 .cursor/rules/dukang-core.mdc diff --git a/.cursor/rules/dukang-core.mdc b/.cursor/rules/dukang-core.mdc deleted file mode 100644 index cd16226..0000000 --- a/.cursor/rules/dukang-core.mdc +++ /dev/null @@ -1,55 +0,0 @@ ---- -description: 杜康好客全局约束 — Monorepo 布局、文档优先级、2 人 OWNER 边界 -alwaysApply: true ---- - -# 杜康好客 · 核心规则 - -## Monorepo 布局 - -- `apps/` — preV1:`h5-user`、`h5-shop`、`h5-partner`、`admin-web` -- `packages/` — `shared-types`、`domain`、`shared-ui` -- `server/dukang-api/` — NestJS 单体 API -- `pages/` — UI 原型(**只读参照**) - -> V2 目标为 Taro 四端(`mini-user` 等),编码以 **当前实际目录** 为准。 - -## 文档 - -- **V3.0 业务事实源**:`杜康好客-v3-PRD.md` -- V3 实现验收:`杜康好客-v3编码手册.md` -- V2 蓝图:`杜康好客-V2编码手册.md`(与 V3 冲突时 V3 PRD 优先) -- preV1 裁剪:`杜康好客-preV1编码手册.md` -- 协作:`conventions.md` · AI 入口:`AGENTS.md` - -**禁止**:编码时修改业务规则;需求变更只改 `杜康好客-v3-PRD.md`。 - -## 边界(2 人团队) - -> **临时(2026-07)**:刘京尧任务由 `jacy-dukang` 代管,B+D 路径可改。 - -| 负责人 | 路径 | -|--------|------| -| jacy-dukang | `apps/*`, `packages/`, `callbacks/`, `jobs/`, `common/`, `integrations/`, 全部 `modules/*` | -| ~~刘京尧~~ | ~~`apps/h5-partner/`, `apps/h5-shop/`, `modules/{store,redeem}/`~~(暂代管) | - -- 跨模块只 inject **exported Service**,禁止 `prisma` 写他人表 -- `apps/*` 禁止 import `server/*` 或其他 app -- Mock 只在 `integrations/*`,不在业务 Service 散落 - -## 共享契约 - -- 枚举/DTO → `packages/shared-types` -- 纯规则 → `packages/domain`(无 IO) - -## 核心业务常量 - -- 权益额 = `benefit_amount ?? price` -- 核销:直接核销 `0 < amount ≤ 全部 ACTIVE 权益总余额`;带单据核销 `0 < amount ≤ 该单据可用金额`;Redis 码 3 分钟 -- 订单 Tab(V3.0):`待付款 | 已付款 | 已完成` -- API:`/api/v1`,响应 `{ code, message, data }` - -## 提交 - -- Conventional Commits:`feat(trade):` 等 -- 不提交 `.env` diff --git a/.cursor/rules/git-conventions.mdc b/.cursor/rules/git-conventions.mdc index a788ac3..e469d7e 100644 --- a/.cursor/rules/git-conventions.mdc +++ b/.cursor/rules/git-conventions.mdc @@ -1,33 +1,11 @@ --- -description: Git 提交与 PR 协作规范 +description: 杜康提交 scope 与发版默认(生产) alwaysApply: true --- -# Git 规范 +# Git / 发版(杜康专属) -## 提交格式 - -Conventional Commits,scope = 端或模块名: - -``` -feat(trade): add order preview API -fix(redeem): validate redeem amount against balance -chore(shared-types): add OrderStatus enum -``` - -## 禁止提交 - -- `.env`、`.env.local` 等敏感配置 -- `node_modules/`、`dist/`(已在 .gitignore) - -## PR 与 Review - -- feature 分支 + 小步 PR -- 跨模块改动需相关双 Owner Review -- Prisma 迁移必须多 Owner Review - -## Agent 行为 - -- **仅用户明确要求时** 才执行 git commit / push -- 不 amend 已推送的 commit,不 force push main/master/dev -- 发版:`dev`→测试(staging),`main`→生产;用户只说「发布/发版」默认发**生产**(见 dukang-release skill);明确说「发测试」才发 staging +- Conventional Commits,scope = 端或模块:`feat(trade):`、`fix(redeem):` +- 只说「发布/发版」→ 生产(`main` + `deploy-prod.sh`);明确说「发测试」才 staging。流程见 `/dukang-release` +- 改 API/表 → 同步 v3-PRD + v3编码手册 + `shared-types` +- Prisma 迁移须 Review diff --git a/.cursor/skills/dukang-coding/SKILL.md b/.cursor/skills/dukang-coding/SKILL.md index c3af638..b2b2417 100644 --- a/.cursor/skills/dukang-coding/SKILL.md +++ b/.cursor/skills/dukang-coding/SKILL.md @@ -21,7 +21,7 @@ disable-model-invocation: true ## 会话启动(按序) 1. 确认阶段:**V3.0** → 读 `杜康好客-v3-PRD.md` + `@dukang-v3`;preV1 → preV1 手册;V2 蓝图 → V2 手册 -2. 读 [`AGENTS.md`](../../AGENTS.md) OWNER 表 → **只改本 OWNER 路径** +2. 读 [`AGENTS.md`](../../AGENTS.md) OWNER 段 + 对应 `apps/` 或 `server/dukang-api/AGENTS.md` → **只改本 OWNER 路径** 3. 有任务卡 ID → 配合 `dukang-task-card` skill 或查 preV1 §9 / V2 §七 4. UI 任务 → `pages/ROUTE_MAP.md` + 对应 `pages/{端}/` 原型 5. 编码前过一遍下方 Checklist diff --git a/.cursor/skills/dukang-prev1/SKILL.md b/.cursor/skills/dukang-prev1/SKILL.md index 3ab1915..4e39dcd 100644 --- a/.cursor/skills/dukang-prev1/SKILL.md +++ b/.cursor/skills/dukang-prev1/SKILL.md @@ -5,6 +5,7 @@ description: >- MOCK_SMS/MOCK_PAY/MOCK_DELIVERY flags, Seed data, and V2 upgrade path. Use when working on Mock providers, feature flags, preV1 task cards P1-*, or smoke tests — not for V2 WeChat/payment production integration. +disable-model-invocation: true --- # 杜康好客 · preV1 Mock Skill diff --git a/.cursor/skills/dukang-release/SKILL.md b/.cursor/skills/dukang-release/SKILL.md index 673d8a7..855c54c 100644 --- a/.cursor/skills/dukang-release/SKILL.md +++ b/.cursor/skills/dukang-release/SKILL.md @@ -4,6 +4,7 @@ description: >- 杜康好客发布流程:dev→测试(staging),main→生产;同机双栈。 Use when the user says 发布、上传、deploy、上线、发版、发测试、发生产, or @杜康发布 / @dukang-release. +disable-model-invocation: true --- # 杜康发布 diff --git a/.cursor/skills/dukang-task-card/SKILL.md b/.cursor/skills/dukang-task-card/SKILL.md index 94320c2..1aecad3 100644 --- a/.cursor/skills/dukang-task-card/SKILL.md +++ b/.cursor/skills/dukang-task-card/SKILL.md @@ -4,6 +4,7 @@ description: >- Executes Dukang Haoke task cards (P1-M* or M0-M6) one at a time with DoD verification. Use when the user provides a task ID like P1-M2-002 or M2-FE-U-003, or asks to start/implement a milestone card from the coding manuals. +disable-model-invocation: true --- # 杜康好客 · 任务卡 Skill