Files
John Qiu 23ea8fdca5 feat: 融合 devflow-claude P0 批机制 (REQ-20260416-0017)
P0-1: SessionStart Hook — hooks/session-context.sh
  从分支名解析 REQ-ID,调 MCP API 查询需求详情注入 system-reminder

P0-2: PreToolUse Hook — hooks/pre-tool-confirm.sh
  拦截生产推送、force push、docker prod 容器操作、git reset --hard 等

P0-3: Release Draft 闸门设计文档 — docs/design/release-draft-gate.md
  完整架构 + 渐进式落地路径(拆 7 个子任务延后)
  附最小可用脚本 hooks/release-draft.sh 创建 Gitea draft release

P0-4: Memory 隔离规则 — 写入 req-prd / req-design / req-workflow
  禁止 auto-memory 污染模板产出物(章节结构、字段定义、文档结构)

P0-5: CLAUDE.md 架构检查 + 架构片段库
  dev-coding skill 执行前检查架构关键词
  新增 templates/claude-md-snippets/ 含 Go+Gin / React+AntD / Vue+Element /
  MCP+TS / generic 五套骨架

P0-6: /commit 分支保护自动化 — 新 skill dev-commit-plugin
  保护分支自动建功能分支 + Conventional Commits + REQ-XXX 自动关联

安装:
  bash hooks/install.sh

后续:
  P0-3 完整实现拆 7 个子任务(P0-3.1 ~ P0-3.7)
  建议先部署 hooks 跑 1-2 周观察,再推进 Release 机制落地
2026-04-16 21:02:29 +09:30

68 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- 复制此片段到项目根 CLAUDE.md 的 "## Architecture" 章节 -->
## Architecture
### 目录结构Vue 3 + TypeScript + Element Plus
```
src/
├── views/ # 页面级组件(路由对应)
├── components/ # 可复用组件
├── api/ # API 封装
├── stores/ # Pinia stores
├── composables/ # 组合式函数use* hooks
├── utils/ # 工具函数
├── types/ # TypeScript 类型定义
└── router/ # Vue Router 配置
```
### 状态管理
- **Pinia**(官方推荐)
- 每个业务模块一个 store`stores/user.ts``stores/order.ts`
- 禁止直接在组件里写持久状态
### 路由
- Vue Router 4
- 路由守卫统一在 `router/guards.ts`
- 懒加载:`component: () => import('@/views/...')`
### Composition API
- **强制使用 `<script setup>`**,禁止 Options API
- Props 用 `defineProps<T>()`Emits 用 `defineEmits<T>()`
### API 调用
- `api/` 下按模块划分:`api/user.ts``api/order.ts`
- 每个函数返回类型明确
- 错误由 axios 拦截器统一处理
### 命名规范
| 类型 | 约定 | 示例 |
|------|------|------|
| 组件文件 | PascalCase | `UserProfile.vue` |
| Composable | camelCase + use 前缀 | `useAuth.ts` |
| Store | camelCase | `useUserStore` |
| API 文件 | kebab-case | `user-api.ts` |
| 工具函数 | camelCase | `formatDate` |
### 样式
- SCSS + Element Plus 主题
- scoped style避免全局污染
- 全局变量走 SCSS 变量或 CSS Variables
### 国际化
- 使用 vue-i18n
- 消息文件:`src/locales/zh.json` / `en.json`
- 禁止硬编码文本:用 `t('path.to.key')`
### 测试
- 单测Vitest + Vue Test Utils
- E2EPlaywright / Cypress