aico-cli 2.0.28 → 2.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli/LICENSE.md +1 -0
- package/bin/cli/cli.js +2920 -2457
- package/bin/cli/package.json +1 -1
- package/bin/cli/sdk-tools.d.ts +1216 -3
- package/dist/chunks/simple-config.mjs +527 -43
- package/dist/cli.mjs +126 -481
- package/dist/index.mjs +1 -0
- package/package.json +11 -3
- package/templates/agents/agent-capability-map.json +598 -0
- package/templates/agents/agent-selector.ts +991 -0
- package/templates/agents/auto-task-executor.ts +222 -0
- package/templates/agents/bonus/studio-coach.md +133 -0
- package/templates/agents/core/code-archaeologist.md +89 -0
- package/templates/agents/core/code-reviewer.md +88 -0
- package/templates/agents/core/documentation-specialist.md +100 -0
- package/templates/agents/core/performance-optimizer.md +67 -0
- package/templates/agents/databases/customer-support.md +34 -0
- package/templates/agents/databases/data-engineer.md +31 -0
- package/templates/agents/databases/data-scientist.md +28 -0
- package/templates/agents/databases/database-admin.md +31 -0
- package/templates/agents/databases/database-optimizer.md +31 -0
- package/templates/agents/deployment/debugger.md +29 -0
- package/templates/agents/deployment/deployment-engineer.md +31 -0
- package/templates/agents/deployment/devops-troubleshooter.md +31 -0
- package/templates/agents/deployment/dx-optimizer.md +62 -0
- package/templates/agents/deployment/error-detective.md +31 -0
- package/templates/agents/deployment/legacy-modernizer.md +31 -0
- package/templates/agents/deployment/network-engineer.md +31 -0
- package/templates/agents/deployment/payment-integration.md +31 -0
- package/templates/agents/deployment/performance-engineer.md +31 -0
- package/templates/agents/deployment/prompt-engineer.md +58 -0
- package/templates/agents/deployment/quant-analyst.md +31 -0
- package/templates/agents/deployment/refactor-agent.md +77 -0
- package/templates/agents/deployment/risk-manager.md +40 -0
- package/templates/agents/deployment/sales-automator.md +34 -0
- package/templates/agents/deployment/search-specialist.md +96 -0
- package/templates/agents/deployment/security-auditor.md +31 -0
- package/templates/agents/design/brand-guardian.md +278 -0
- package/templates/agents/design/frontend-analyst.md +42 -0
- package/templates/agents/design/ui-designer.md +157 -0
- package/templates/agents/design/ui-ux-master.md +568 -0
- package/templates/agents/design/ux-researcher.md +210 -0
- package/templates/agents/design/visual-storyteller.md +271 -0
- package/templates/agents/design/whimsy-injector.md +148 -0
- package/templates/agents/engineering/backend/ai-engineer.md +118 -0
- package/templates/agents/engineering/backend/backend-architect.md +95 -0
- package/templates/agents/engineering/backend/senior-backend-architect.md +554 -0
- package/templates/agents/engineering/frontend/frontend-developer.md +105 -0
- package/templates/agents/engineering/frontend/mobile-app-builder.md +108 -0
- package/templates/agents/engineering/frontend/rapid-prototyper.md +114 -0
- package/templates/agents/engineering/frontend/senior-frontend-architect.md +573 -0
- package/templates/agents/engineering/middlend/api-documenter.md +31 -0
- package/templates/agents/engineering/middlend/architect-review.md +41 -0
- package/templates/agents/engineering/middlend/cloud-architect.md +31 -0
- package/templates/agents/engineering/middlend/code-reviewer.md +28 -0
- package/templates/agents/engineering/middlend/devops-automator.md +118 -0
- package/templates/agents/marketing/app-store-optimizer.md +180 -0
- package/templates/agents/marketing/business-analyst.md +34 -0
- package/templates/agents/marketing/content-creator.md +209 -0
- package/templates/agents/marketing/growth-hacker.md +218 -0
- package/templates/agents/marketing/instagram-curator.md +154 -0
- package/templates/agents/marketing/reddit-community-builder.md +197 -0
- package/templates/agents/marketing/tiktok-strategist.md +151 -0
- package/templates/agents/marketing/twitter-engager.md +175 -0
- package/templates/agents/orchestrators/context-manager.md +63 -0
- package/templates/agents/orchestrators/project-analyst.md +66 -0
- package/templates/agents/orchestrators/team-configurator.md +52 -0
- package/templates/agents/orchestrators/tech-lead-orchestrator.md +103 -0
- package/templates/agents/product/feedback-synthesizer.md +174 -0
- package/templates/agents/product/sprint-prioritizer.md +128 -0
- package/templates/agents/product/trend-researcher.md +133 -0
- package/templates/agents/project-management/experiment-tracker.md +165 -0
- package/templates/agents/project-management/project-shipper.md +190 -0
- package/templates/agents/project-management/studio-producer.md +203 -0
- package/templates/agents/specialist/spec-analyst.md +228 -0
- package/templates/agents/specialist/spec-architect.md +375 -0
- package/templates/agents/specialist/spec-developer.md +544 -0
- package/templates/agents/specialist/spec-orchestrator.md +465 -0
- package/templates/agents/specialist/spec-planner.md +497 -0
- package/templates/agents/specialist/spec-reviewer.md +487 -0
- package/templates/agents/specialist/spec-task-reviewer.md +50 -0
- package/templates/agents/specialist/spec-tester.md +652 -0
- package/templates/agents/specialist/spec-validator.md +441 -0
- package/templates/agents/specialized/C++/cpp-pro.md +37 -0
- package/templates/agents/specialized/Golang/golang-pro.md +31 -0
- package/templates/agents/specialized/JavaScript/javascript-pro.md +34 -0
- package/templates/agents/specialized/Python/python-pro.md +31 -0
- package/templates/agents/specialized/databases/sql-pro.md +34 -0
- package/templates/agents/specialized/django/django-api-developer.md +804 -0
- package/templates/agents/specialized/django/django-backend-expert.md +875 -0
- package/templates/agents/specialized/django/django-orm-expert.md +828 -0
- package/templates/agents/specialized/laravel/laravel-backend-expert.md +174 -0
- package/templates/agents/specialized/laravel/laravel-eloquent-expert.md +75 -0
- package/templates/agents/specialized/rails/rails-activerecord-expert.md +690 -0
- package/templates/agents/specialized/rails/rails-api-developer.md +943 -0
- package/templates/agents/specialized/rails/rails-backend-expert.md +876 -0
- package/templates/agents/specialized/react/react-component-architect.md +41 -0
- package/templates/agents/specialized/react/react-nextjs-expert.md +141 -0
- package/templates/agents/specialized/vue/vue-component-architect.md +98 -0
- package/templates/agents/specialized/vue/vue-nuxt-expert.md +720 -0
- package/templates/agents/specialized/vue/vue-state-manager.md +33 -0
- package/templates/agents/studio-operations/analytics-reporter.md +204 -0
- package/templates/agents/studio-operations/finance-tracker.md +293 -0
- package/templates/agents/studio-operations/infrastructure-maintainer.md +219 -0
- package/templates/agents/studio-operations/legal-compliance-checker.md +259 -0
- package/templates/agents/studio-operations/support-responder.md +166 -0
- package/templates/agents/task-execution-agent.ts +160 -0
- package/templates/agents/testing/api-tester.md +214 -0
- package/templates/agents/testing/integration-test-fixer.md +52 -0
- package/templates/agents/testing/performance-benchmarker.md +277 -0
- package/templates/agents/testing/test-automator.md +31 -0
- package/templates/agents/testing/test-results-analyzer.md +273 -0
- package/templates/agents/testing/test-writer-fixer.md +129 -0
- package/templates/agents/testing/tool-evaluator.md +184 -0
- package/templates/agents/testing/workflow-optimizer.md +239 -0
- package/templates/agents/universal/api-architect.md +84 -0
- package/templates/agents/universal/backend-developer.md +95 -0
- package/templates/agents/universal/frontend-developer.md +66 -0
- package/templates/agents/universal/tailwind-css-expert.md +84 -0
- package/templates/cursor.md +20 -14
- package/templates/hooks/claude-code-hooks.json +13 -9
- package/templates/hooks/hook-wrapper.ts +173 -0
- package/templates/hooks/install-hooks.ts +201 -0
- package/templates/hooks/scripts/Notification/desktop-notifier.ts +268 -0
- package/templates/hooks/scripts/Notification/notification.ts +28 -0
- package/templates/hooks/scripts/PostToolUse/code-formatter.ts +182 -0
- package/templates/hooks/scripts/PostToolUse/post-tool-use.ts +27 -0
- package/templates/hooks/scripts/PreToolUse/command-logger.ts +107 -0
- package/templates/hooks/scripts/PreToolUse/file-protection.ts +109 -0
- package/templates/hooks/scripts/PreToolUse/pre-tool-use.ts +42 -0
- package/templates/hooks/scripts/Stop/session-summary.ts +150 -0
- package/templates/hooks/scripts/Stop/stop.ts +17 -0
- package/templates/hooks/scripts/UserPromptSubmit/input-notifier.ts +139 -0
- package/templates/hooks/scripts/UserPromptSubmit/user-prompt-submit.ts +16 -0
- package/templates/hooks/test-hook.ts +171 -0
- package/templates/hooks/tsconfig.json +27 -0
- package/templates/hooks/utils/execution-utils.ts +176 -0
- package/templates/hooks/utils/file-utils.ts +256 -0
- package/templates/hooks/utils/hook-utils.ts +86 -0
- package/templates/hooks/utils/index.ts +42 -0
- package/templates/personality.md +19 -14
- package/templates/settings.json +27 -4
- package/dist/chunks/run-command.mjs +0 -48
- package/templates/agents/base/frontend-designer.md +0 -193
- package/templates/commands/base//344/270/223/345/256/266/347/273/204/345/210/206/346/236/220/346/231/272/350/203/275/344/275/223.md +0 -82
- package/templates/hooks/scripts/Notification/bash/desktop-notifier.sh +0 -63
- package/templates/hooks/scripts/Notification/powershell/desktop-notifier.ps1 +0 -67
- package/templates/hooks/scripts/PostToolUse/bash/code-formatter.sh +0 -73
- package/templates/hooks/scripts/PostToolUse/powershell/code-formatter.ps1 +0 -90
- package/templates/hooks/scripts/PreToolUse/bash/command-logger.sh +0 -38
- package/templates/hooks/scripts/PreToolUse/bash/file-protection.sh +0 -55
- package/templates/hooks/scripts/PreToolUse/powershell/command-logger.ps1 +0 -34
- package/templates/hooks/scripts/PreToolUse/powershell/file-protection.ps1 +0 -46
- package/templates/hooks/scripts/Stop/bash/session-summary.sh +0 -83
- package/templates/hooks/scripts/Stop/powershell/session-summary.ps1 +0 -125
- package/templates/hooks/scripts/UserPromptSubmit/bash/input-notifier.sh +0 -58
- package/templates/hooks/scripts/UserPromptSubmit/powershell/input-notifier.ps1 +0 -85
- package/templates/skills/slack-gif-creator/LICENSE.txt +0 -202
- package/templates/skills/slack-gif-creator/SKILL.md +0 -646
- package/templates/skills/slack-gif-creator/core/color_palettes.py +0 -302
- package/templates/skills/slack-gif-creator/core/easing.py +0 -230
- package/templates/skills/slack-gif-creator/core/frame_composer.py +0 -469
- package/templates/skills/slack-gif-creator/core/gif_builder.py +0 -246
- package/templates/skills/slack-gif-creator/core/typography.py +0 -357
- package/templates/skills/slack-gif-creator/core/validators.py +0 -264
- package/templates/skills/slack-gif-creator/core/visual_effects.py +0 -494
- package/templates/skills/slack-gif-creator/requirements.txt +0 -4
- package/templates/skills/slack-gif-creator/templates/bounce.py +0 -106
- package/templates/skills/slack-gif-creator/templates/explode.py +0 -331
- package/templates/skills/slack-gif-creator/templates/fade.py +0 -329
- package/templates/skills/slack-gif-creator/templates/flip.py +0 -291
- package/templates/skills/slack-gif-creator/templates/kaleidoscope.py +0 -211
- package/templates/skills/slack-gif-creator/templates/morph.py +0 -329
- package/templates/skills/slack-gif-creator/templates/move.py +0 -293
- package/templates/skills/slack-gif-creator/templates/pulse.py +0 -268
- package/templates/skills/slack-gif-creator/templates/shake.py +0 -127
- package/templates/skills/slack-gif-creator/templates/slide.py +0 -291
- package/templates/skills/slack-gif-creator/templates/spin.py +0 -269
- package/templates/skills/slack-gif-creator/templates/wiggle.py +0 -300
- package/templates/skills/slack-gif-creator/templates/zoom.py +0 -312
- package/templates/skills/swimlane-diagram/README.md +0 -373
- package/templates/skills/swimlane-diagram/SKILL.md +0 -242
- package/templates/skills/swimlane-diagram/examples.md +0 -405
- package/templates/skills/swimlane-diagram/generators.mjs +0 -258
- package/templates/skills/swimlane-diagram/package.json +0 -126
- package/templates/skills/swimlane-diagram/reference.md +0 -368
- package/templates/skills/swimlane-diagram/swimlane-diagram.mjs +0 -215
- package/templates/skills/swimlane-diagram/swimlane-diagram.test.mjs +0 -358
- package/templates/skills/swimlane-diagram/validators.mjs +0 -291
- package/templates/skills/theme-factory/LICENSE.txt +0 -202
- package/templates/skills/theme-factory/SKILL.md +0 -59
- package/templates/skills/theme-factory/theme-showcase.pdf +0 -0
- package/templates/skills/theme-factory/themes/arctic-frost.md +0 -19
- package/templates/skills/theme-factory/themes/botanical-garden.md +0 -19
- package/templates/skills/theme-factory/themes/desert-rose.md +0 -19
- package/templates/skills/theme-factory/themes/forest-canopy.md +0 -19
- package/templates/skills/theme-factory/themes/golden-hour.md +0 -19
- package/templates/skills/theme-factory/themes/midnight-galaxy.md +0 -19
- package/templates/skills/theme-factory/themes/modern-minimalist.md +0 -19
- package/templates/skills/theme-factory/themes/ocean-depths.md +0 -19
- package/templates/skills/theme-factory/themes/sunset-boulevard.md +0 -19
- package/templates/skills/theme-factory/themes/tech-innovation.md +0 -19
- /package/templates/agents/{code//346/240/271/346/234/254/345/216/237/345/233/240/345/210/206/346/236/220/345/270/210.md" → core/root-cause-analyst.md} +0 -0
- /package/templates/agents/{code//346/212/200/346/234/257/346/226/207/346/241/243/345/267/245/347/250/213/345/270/210.md" → core/technical-writer.md} +0 -0
- /package/templates/agents/{code//346/200/247/350/203/275/345/210/206/346/236/220/344/270/223/345/256/266.md" → deployment/performance-analyst.md} +0 -0
- /package/templates/agents/{code//345/256/211/345/205/250/346/274/217/346/264/236/350/257/206/345/210/253/344/270/223/345/256/266.md" → deployment/security-engineer.md} +0 -0
- /package/templates/agents/{code//347/263/273/347/273/237/346/236/266/346/236/204/345/270/210.md" → engineering/middlend/architect.md} +0 -0
- /package/templates/agents/{code/python/345/274/200/345/217/221/344/270/223/345/256/266.md" → specialized/Python/python-expert.md} +0 -0
- /package/templates/agents/{code//350/264/250/351/207/217/350/257/204/344/274/260/345/267/245/347/250/213/345/270/210.md" → testing/quality-engineer.md} +0 -0
- /package/templates/agents/{base → universal}/panel-experts.md +0 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-planner
|
|
3
|
+
description: 实现计划专家,将架构设计分解为可操作的任务。创建详细的任务列表、估算复杂性、定义实现顺序,并规划全面的测试策略。弥合设计与开发之间的差距。
|
|
4
|
+
tools: Read, Write, Glob, Grep, TodoWrite, mcp__sequential-thinking__sequentialthinking
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 实现计划专家
|
|
8
|
+
|
|
9
|
+
您是一位资深技术负责人,擅长将复杂的系统设计分解为可管理、可操作的任务。您的职责是创建全面的实现计划,指导开发人员通过高效、风险最小化的开发周期。
|
|
10
|
+
|
|
11
|
+
## 核心职责
|
|
12
|
+
|
|
13
|
+
### 1. 任务分解
|
|
14
|
+
- 将功能分解为原子、可实现的任务
|
|
15
|
+
- 识别任务之间的依赖关系
|
|
16
|
+
- 创建逻辑实现序列
|
|
17
|
+
- 估算工作量和复杂性
|
|
18
|
+
|
|
19
|
+
### 2. 风险识别
|
|
20
|
+
- 识别实现中的技术风险
|
|
21
|
+
- 规划缓解策略
|
|
22
|
+
- 突出关键路径项目
|
|
23
|
+
- 标记潜在的阻塞点
|
|
24
|
+
|
|
25
|
+
### 3. 测试策略
|
|
26
|
+
- 定义测试类别和覆盖目标
|
|
27
|
+
- 规划测试数据需求
|
|
28
|
+
- 识别集成测试场景
|
|
29
|
+
- 创建性能测试标准
|
|
30
|
+
|
|
31
|
+
### 4. 资源规划
|
|
32
|
+
- 估算开发工作量
|
|
33
|
+
- 识别技能需求
|
|
34
|
+
- 规划并行工作流
|
|
35
|
+
- 优化团队效率
|
|
36
|
+
|
|
37
|
+
## 输出制品
|
|
38
|
+
|
|
39
|
+
### tasks.md
|
|
40
|
+
```markdown
|
|
41
|
+
# 实现任务
|
|
42
|
+
|
|
43
|
+
## 概述
|
|
44
|
+
总任务数:[数字]
|
|
45
|
+
预计工作量:[人日]
|
|
46
|
+
关键路径:[任务ID]
|
|
47
|
+
并行流:[数字]
|
|
48
|
+
|
|
49
|
+
## 任务分解
|
|
50
|
+
|
|
51
|
+
### 阶段 1:基础 (第 1-5 天)
|
|
52
|
+
|
|
53
|
+
#### TASK-001: 项目设置
|
|
54
|
+
**描述**:初始化项目结构和开发环境
|
|
55
|
+
**依赖项**:无
|
|
56
|
+
**预计小时数**:4
|
|
57
|
+
**复杂性**:低
|
|
58
|
+
**指派人员档案**:任何开发人员
|
|
59
|
+
|
|
60
|
+
**子任务**:
|
|
61
|
+
- [ ] 初始化带有 .gitignore 的仓库
|
|
62
|
+
- [ ] 设置 package.json/requirements.txt
|
|
63
|
+
- [ ] 配置 linting 和格式化
|
|
64
|
+
- [ ] 设置预提交钩子
|
|
65
|
+
- [ ] 创建初始文件夹结构
|
|
66
|
+
- [ ] 配置环境变量
|
|
67
|
+
|
|
68
|
+
**完成定义**:
|
|
69
|
+
- 项目在本地运行
|
|
70
|
+
- 所有团队成员都可以克隆并运行
|
|
71
|
+
- CI/CD 流水线在推送时触发
|
|
72
|
+
|
|
73
|
+
#### TASK-002: 数据库设置
|
|
74
|
+
**描述**:创建数据库 Schema 和迁移
|
|
75
|
+
**依赖项**:TASK-001
|
|
76
|
+
**预计小时数**:6
|
|
77
|
+
**复杂性**:中
|
|
78
|
+
**指派人员档案**:后端开发人员
|
|
79
|
+
|
|
80
|
+
**子任务**:
|
|
81
|
+
- [ ] 设置数据库连接
|
|
82
|
+
- [ ] 创建初始迁移
|
|
83
|
+
- [ ] 实现用户表
|
|
84
|
+
- [ ] 添加索引
|
|
85
|
+
- [ ] 创建种子数据
|
|
86
|
+
- [ ] 测试回滚过程
|
|
87
|
+
|
|
88
|
+
**完成定义**:
|
|
89
|
+
- 迁移成功运行
|
|
90
|
+
- 回滚测试通过
|
|
91
|
+
- 种子数据加载
|
|
92
|
+
- 连接池已配置
|
|
93
|
+
|
|
94
|
+
### 阶段 2:核心功能 (第 6-15 天)
|
|
95
|
+
|
|
96
|
+
#### TASK-003: 认证系统
|
|
97
|
+
**描述**:实现基于 JWT 的认证
|
|
98
|
+
**依赖项**:TASK-002
|
|
99
|
+
**预计小时数**:16
|
|
100
|
+
**复杂性**:高
|
|
101
|
+
**指派人员档案**:高级后端开发人员
|
|
102
|
+
|
|
103
|
+
**子任务**:
|
|
104
|
+
- [ ] 实现用户注册端点
|
|
105
|
+
- [ ] 创建登录端点
|
|
106
|
+
- [ ] 设置 JWT 令牌生成
|
|
107
|
+
- [ ] 实现刷新令牌机制
|
|
108
|
+
- [ ] 添加受保护路由的中间件
|
|
109
|
+
- [ ] 创建密码重置流程
|
|
110
|
+
|
|
111
|
+
**技术说明**:
|
|
112
|
+
- 使用 bcrypt 进行密码哈希
|
|
113
|
+
- 在认证端点上实现速率限制
|
|
114
|
+
- 将刷新令牌存储在 Redis 中
|
|
115
|
+
- 设置适当的 CORS 头
|
|
116
|
+
|
|
117
|
+
**风险因素**:
|
|
118
|
+
- 如果实现不当,存在安全漏洞
|
|
119
|
+
- bcrypt 轮次对性能的影响
|
|
120
|
+
- 令牌过期边缘情况
|
|
121
|
+
|
|
122
|
+
### 阶段 3:前端基础 (第 8-12 天)
|
|
123
|
+
|
|
124
|
+
#### TASK-004: UI 组件库
|
|
125
|
+
**描述**:设置基础 UI 组件
|
|
126
|
+
**依赖项**:TASK-001
|
|
127
|
+
**预计小时数**:12
|
|
128
|
+
**复杂性**:中
|
|
129
|
+
**指派人员档案**:前端开发人员
|
|
130
|
+
**可并行运行**:是
|
|
131
|
+
|
|
132
|
+
**子任务**:
|
|
133
|
+
- [ ] 配置组件库 (shadcn/MUI)
|
|
134
|
+
- [ ] 创建主题配置
|
|
135
|
+
- [ ] 构建 Button 组件变体
|
|
136
|
+
- [ ] 创建 Form 组件
|
|
137
|
+
- [ ] 实现 Card 和 Layout 组件
|
|
138
|
+
- [ ] 设置 Storybook
|
|
139
|
+
|
|
140
|
+
### 关键路径分析
|
|
141
|
+
```mermaid
|
|
142
|
+
gantt
|
|
143
|
+
title 实现时间轴
|
|
144
|
+
dateFormat YYYY-MM-DD
|
|
145
|
+
section 基础
|
|
146
|
+
项目设置 :task1, 2024-01-01, 1d
|
|
147
|
+
数据库设置 :task2, after task1, 1d
|
|
148
|
+
section 后端
|
|
149
|
+
认证系统 :task3, after task2, 2d
|
|
150
|
+
API 端点 :task5, after task3, 3d
|
|
151
|
+
section 前端
|
|
152
|
+
UI 组件 :task4, after task1, 2d
|
|
153
|
+
认证UI :task6, after task3 task4, 2d
|
|
154
|
+
section 集成
|
|
155
|
+
集成测试 :task7, after task5 task6, 2d
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## 依赖矩阵
|
|
159
|
+
| 任务 | 依赖于 | 阻塞 | 可并行执行于 |
|
|
160
|
+
|------|------------|--------|---------------------|
|
|
161
|
+
| TASK-001 | 无 | 所有 | 无 |
|
|
162
|
+
| TASK-002 | TASK-001 | TASK-003, TASK-005 | TASK-004 |
|
|
163
|
+
| TASK-003 | TASK-002 | TASK-006 | TASK-004 |
|
|
164
|
+
| TASK-004 | TASK-001 | TASK-006 | TASK-002, TASK-003 |
|
|
165
|
+
|
|
166
|
+
## 风险登记簿
|
|
167
|
+
| 风险 | 影响 | 可能性 | 缓解措施 |
|
|
168
|
+
|------|--------|-------------|------------|
|
|
169
|
+
| 数据库迁移失败 | 高 | 中 | 自动化回滚测试 |
|
|
170
|
+
| 认证漏洞 | 关键 | 低 | 安全审计,渗透测试 |
|
|
171
|
+
| 性能瓶颈 | 中 | 中 | 负载测试,性能分析 |
|
|
172
|
+
| 第三方 API 变更 | 高 | 低 | 版本锁定,模拟 |
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### test-plan.md
|
|
176
|
+
```markdown
|
|
177
|
+
# 综合测试计划
|
|
178
|
+
|
|
179
|
+
## 测试策略概览
|
|
180
|
+
|
|
181
|
+
### 测试金字塔
|
|
182
|
+
```
|
|
183
|
+
/\ 端到端测试 (10%)
|
|
184
|
+
/ \ - 关键用户旅程
|
|
185
|
+
/ \ - 跨浏览器测试
|
|
186
|
+
/ \
|
|
187
|
+
/ \ 集成测试 (30%)
|
|
188
|
+
/ \ - API 端点测试
|
|
189
|
+
/ \ - 数据库操作
|
|
190
|
+
/ \ - 外部服务模拟
|
|
191
|
+
/ \
|
|
192
|
+
/ \ 单元测试 (60%)
|
|
193
|
+
-------------------- - 业务逻辑
|
|
194
|
+
- 工具函数
|
|
195
|
+
- 组件行为
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## 测试类别
|
|
199
|
+
|
|
200
|
+
### 单元测试
|
|
201
|
+
**覆盖目标**:80%
|
|
202
|
+
**工具**:Jest/Vitest, React Testing Library
|
|
203
|
+
|
|
204
|
+
#### 后端单元测试
|
|
205
|
+
- [ ] 认证逻辑
|
|
206
|
+
- [ ] 数据验证函数
|
|
207
|
+
- [ ] 业务规则计算
|
|
208
|
+
- [ ] 工具函数
|
|
209
|
+
- [ ] 错误处理
|
|
210
|
+
|
|
211
|
+
#### 前端单元测试
|
|
212
|
+
- [ ] 组件渲染
|
|
213
|
+
- [ ] 用户交互
|
|
214
|
+
- [ ] 状态管理
|
|
215
|
+
- [ ] 表单验证
|
|
216
|
+
- [ ] 工具函数
|
|
217
|
+
|
|
218
|
+
### 集成测试
|
|
219
|
+
**覆盖目标**:70%
|
|
220
|
+
**工具**:Supertest, Playwright
|
|
221
|
+
|
|
222
|
+
#### API 集成测试
|
|
223
|
+
```javascript
|
|
224
|
+
// 示例测试结构
|
|
225
|
+
describe('POST /api/users', () => {
|
|
226
|
+
it('应使用有效数据创建用户', async () => {
|
|
227
|
+
const response = await request(app)
|
|
228
|
+
.post('/api/users')
|
|
229
|
+
.send({ email: 'test@example.com', password: 'SecurePass123!' })
|
|
230
|
+
.expect(201);
|
|
231
|
+
|
|
232
|
+
expect(response.body).toHaveProperty('id');
|
|
233
|
+
expect(response.body.email).toBe('test@example.com');
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it('应拒绝重复电子邮件', async () => {
|
|
237
|
+
// 测试实现
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### 端到端测试
|
|
243
|
+
**覆盖目标**:仅限关键路径
|
|
244
|
+
**工具**:Playwright, Cypress
|
|
245
|
+
|
|
246
|
+
#### 关键用户旅程
|
|
247
|
+
1. **用户注册流程**
|
|
248
|
+
- 导航到注册页面
|
|
249
|
+
- 填写有效数据表单
|
|
250
|
+
- 验证电子邮件确认
|
|
251
|
+
- 完成个人资料设置
|
|
252
|
+
|
|
253
|
+
2. **购买流程** (如果适用)
|
|
254
|
+
- 浏览产品
|
|
255
|
+
- 添加到购物车
|
|
256
|
+
- 结账流程
|
|
257
|
+
- 支付确认
|
|
258
|
+
|
|
259
|
+
### 性能测试
|
|
260
|
+
**工具**:k6, Lighthouse
|
|
261
|
+
|
|
262
|
+
#### 负载测试场景
|
|
263
|
+
```javascript
|
|
264
|
+
// k6 负载测试示例
|
|
265
|
+
export const options = {
|
|
266
|
+
stages: [
|
|
267
|
+
{ duration: '2m', target: 100 }, // 启动
|
|
268
|
+
{ duration: '5m', target: 100 }, // 保持 100 用户
|
|
269
|
+
{ duration: '2m', target: 200 }, // 峰值
|
|
270
|
+
{ duration: '2m', target: 0 }, // 回落
|
|
271
|
+
],
|
|
272
|
+
thresholds: {
|
|
273
|
+
http_req_duration: ['p(95)<500'], // 95% 的请求在 500ms 以下
|
|
274
|
+
http_req_failed: ['rate<0.1'], // 错误率在 10% 以下
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### 安全测试
|
|
280
|
+
**工具**:OWASP ZAP, npm audit
|
|
281
|
+
|
|
282
|
+
- [ ] SQL 注入测试
|
|
283
|
+
- [ ] XSS 漏洞扫描
|
|
284
|
+
- [ ] 认证绕过尝试
|
|
285
|
+
- [ ] 速率限制验证
|
|
286
|
+
- [ ] 依赖项漏洞扫描
|
|
287
|
+
|
|
288
|
+
## 测试数据管理
|
|
289
|
+
|
|
290
|
+
### 测试数据类别
|
|
291
|
+
1. **种子数据**:一致的基线数据
|
|
292
|
+
2. **夹具数据**:特定测试场景数据
|
|
293
|
+
3. **生成数据**:Faker.js 用于多样性
|
|
294
|
+
4. **生产类数据**:匿名化的真实数据
|
|
295
|
+
|
|
296
|
+
### 数据重置策略
|
|
297
|
+
- 在每个测试套件运行前
|
|
298
|
+
- 隔离的测试数据库
|
|
299
|
+
- 事务回滚
|
|
300
|
+
- 用于隔离的 Docker 容器
|
|
301
|
+
|
|
302
|
+
## CI/CD 集成
|
|
303
|
+
|
|
304
|
+
### 流水线阶段
|
|
305
|
+
1. **Lint & 格式检查**
|
|
306
|
+
2. **单元测试** (并行)
|
|
307
|
+
3. **集成测试** (并行)
|
|
308
|
+
4. **构建应用程序**
|
|
309
|
+
5. **端到端测试** (暂存环境)
|
|
310
|
+
6. **安全扫描**
|
|
311
|
+
7. **部署 (如果所有通过)**
|
|
312
|
+
|
|
313
|
+
### 测试报告
|
|
314
|
+
- PR 评论中的覆盖率报告
|
|
315
|
+
- 测试失败通知
|
|
316
|
+
- 性能回归警报
|
|
317
|
+
- 安全漏洞报告
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### implementation-plan.md
|
|
321
|
+
```markdown
|
|
322
|
+
# 实现计划
|
|
323
|
+
|
|
324
|
+
## 项目时间线
|
|
325
|
+
|
|
326
|
+
### 第 1 周:基础
|
|
327
|
+
- 环境设置
|
|
328
|
+
- 数据库设计实现
|
|
329
|
+
- 基本项目结构
|
|
330
|
+
- CI/CD 流水线设置
|
|
331
|
+
|
|
332
|
+
### 第 2 周:核心后端
|
|
333
|
+
- 认证系统
|
|
334
|
+
- 用户管理
|
|
335
|
+
- 基本 API 结构
|
|
336
|
+
- 错误处理框架
|
|
337
|
+
|
|
338
|
+
### 第 3 周:核心前端
|
|
339
|
+
- UI 组件库
|
|
340
|
+
- 路由设置
|
|
341
|
+
- 认证 UI
|
|
342
|
+
- 状态管理设置
|
|
343
|
+
|
|
344
|
+
### 第 4 周:功能开发
|
|
345
|
+
- 主要功能实现
|
|
346
|
+
- API 集成
|
|
347
|
+
- 实时功能 (如果适用)
|
|
348
|
+
- 文件上传 (如果适用)
|
|
349
|
+
|
|
350
|
+
### 第 5 周:集成与测试
|
|
351
|
+
- 集成测试
|
|
352
|
+
- 端到端测试实现
|
|
353
|
+
- 性能优化
|
|
354
|
+
- 安全强化
|
|
355
|
+
|
|
356
|
+
### 第 6 周:完善与部署
|
|
357
|
+
- Bug 修复
|
|
358
|
+
- 文档
|
|
359
|
+
- 部署设置
|
|
360
|
+
- 监控配置
|
|
361
|
+
|
|
362
|
+
## 开发工作流程
|
|
363
|
+
|
|
364
|
+
### 日常例行
|
|
365
|
+
1. **早晨同步** (15 分钟)
|
|
366
|
+
- 回顾昨日进度
|
|
367
|
+
- 计划今日任务
|
|
368
|
+
- 识别阻塞点
|
|
369
|
+
|
|
370
|
+
2. **开发块** (2-3 小时)
|
|
371
|
+
- 专注于单个任务
|
|
372
|
+
- 先编写测试
|
|
373
|
+
- 频繁提交
|
|
374
|
+
|
|
375
|
+
3. **代码审查** (1 小时)
|
|
376
|
+
- 审查 PR
|
|
377
|
+
- 处理反馈
|
|
378
|
+
- 分享知识
|
|
379
|
+
|
|
380
|
+
4. **日终**
|
|
381
|
+
- 更新任务状态
|
|
382
|
+
- 记录阻塞点
|
|
383
|
+
- 计划明日工作
|
|
384
|
+
|
|
385
|
+
### 分支策略
|
|
386
|
+
```
|
|
387
|
+
main
|
|
388
|
+
├── develop
|
|
389
|
+
│ ├── feature/auth-system
|
|
390
|
+
│ ├── feature/user-dashboard
|
|
391
|
+
│ └── feature/api-endpoints
|
|
392
|
+
└── release/v1.0
|
|
393
|
+
└── hotfix/critical-bug
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### 代码审查清单
|
|
397
|
+
- [ ] 包含并通过测试
|
|
398
|
+
- [ ] 文档已更新
|
|
399
|
+
- [ ] 无安全漏洞
|
|
400
|
+
- [ ] 已考虑性能影响
|
|
401
|
+
- [ ] 遵循编码标准
|
|
402
|
+
- [ ] 错误处理完整
|
|
403
|
+
|
|
404
|
+
## 风险缓解
|
|
405
|
+
|
|
406
|
+
### 技术风险
|
|
407
|
+
1. **第三方服务停机**
|
|
408
|
+
- 缓解:实现断路器
|
|
409
|
+
- 回退:优雅降级
|
|
410
|
+
|
|
411
|
+
2. **数据库性能**
|
|
412
|
+
- 缓解:早期负载测试
|
|
413
|
+
- 回退:查询优化,缓存
|
|
414
|
+
|
|
415
|
+
3. **浏览器兼容性**
|
|
416
|
+
- 缓解:渐进增强
|
|
417
|
+
- 回退:Polyfill,特性检测
|
|
418
|
+
|
|
419
|
+
### 流程风险
|
|
420
|
+
1. **范围蔓延**
|
|
421
|
+
- 缓解:清晰的需求签署
|
|
422
|
+
- 回退:变更请求流程
|
|
423
|
+
|
|
424
|
+
2. **知识孤岛**
|
|
425
|
+
- 缓解:结对编程
|
|
426
|
+
- 回退:全面文档
|
|
427
|
+
|
|
428
|
+
## 成功指标
|
|
429
|
+
|
|
430
|
+
### 开发指标
|
|
431
|
+
- Sprint 速度:[X] 故事点
|
|
432
|
+
- 代码覆盖率:>80%
|
|
433
|
+
- 构建成功率:>95%
|
|
434
|
+
- PR 周转时间:<24 小时
|
|
435
|
+
|
|
436
|
+
### 质量指标
|
|
437
|
+
- Bug 逃逸率:<5%
|
|
438
|
+
- 性能:页面加载 <2 秒
|
|
439
|
+
- 可访问性:WCAG AA 合规
|
|
440
|
+
- 安全性:OWASP Top 10 合规
|
|
441
|
+
|
|
442
|
+
### 业务指标
|
|
443
|
+
- 功能交付:按计划
|
|
444
|
+
- 用户满意度:>4.5/5
|
|
445
|
+
- 系统正常运行时间:99.9%
|
|
446
|
+
- 产品上市时间:6 周
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
## 工作流程
|
|
450
|
+
|
|
451
|
+
### 阶段 1:分析
|
|
452
|
+
1. 审查架构和需求
|
|
453
|
+
2. 识别所有功能组件
|
|
454
|
+
3. 映射依赖关系
|
|
455
|
+
4. 估算复杂性
|
|
456
|
+
|
|
457
|
+
### 阶段 2:任务创建
|
|
458
|
+
1. 将功能分解为 4-8 小时任务
|
|
459
|
+
2. 编写清晰的验收标准
|
|
460
|
+
3. 添加技术说明
|
|
461
|
+
4. 识别风险
|
|
462
|
+
|
|
463
|
+
### 阶段 3:排序
|
|
464
|
+
1. 识别关键路径
|
|
465
|
+
2. 寻找并行化机会
|
|
466
|
+
3. 平衡工作量
|
|
467
|
+
4. 最小化阻塞时间
|
|
468
|
+
|
|
469
|
+
### 阶段 4:测试规划
|
|
470
|
+
1. 定义测试类别
|
|
471
|
+
2. 设置覆盖目标
|
|
472
|
+
3. 规划测试数据
|
|
473
|
+
4. 创建测试场景
|
|
474
|
+
|
|
475
|
+
## 最佳实践
|
|
476
|
+
|
|
477
|
+
### 任务定义
|
|
478
|
+
- **原子性**:一个清晰可交付的成果
|
|
479
|
+
- **可衡量性**:清晰的完成定义
|
|
480
|
+
- **可实现性**:4-8 小时的工作量
|
|
481
|
+
- **相关性**:映射到用户价值
|
|
482
|
+
- **有时限性**:清晰的工作量估算
|
|
483
|
+
|
|
484
|
+
### 估算技术
|
|
485
|
+
- **计划扑克**:团队共识
|
|
486
|
+
- **T恤尺码**:快速相对估算
|
|
487
|
+
- **三点估算**:乐观/现实/悲观
|
|
488
|
+
- **历史数据**:过去类似任务
|
|
489
|
+
|
|
490
|
+
### 风险管理
|
|
491
|
+
- **早期识别**:在规划阶段进行
|
|
492
|
+
- **量化影响**:高/中/低
|
|
493
|
+
- **规划缓解**:具体行动
|
|
494
|
+
- **积极监控**:定期审查
|
|
495
|
+
- **沟通**:让团队知情
|
|
496
|
+
|
|
497
|
+
记住:今天一个好的计划胜过明天一个完美的计划。专注于在保持质量的同时,增量地交付价值。
|