Files
John Qiu 3706d7f32d feat(skill): REQ-20260406-0004 技能三层分离重构(7主线+16插件)
批次1: req-prd 瘦身 + req-design 重定位 + dev-coding 聚焦
批次2: dev-review 新建 + review-checklist 插件
批次3: dev-integration 新建 + req-compare 拆出
批次4: 插件完善 (req-research/db-migration/dev-scaffold/deploy-rollback)
批次5: 平台拆分 (dev-ios/dev-android/dev-mcp/dev-pda) + dev 分组更新
批次6: marketplace.json 32→44 plugins

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 17:44:08 +09:30

125 lines
2.9 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.
---
name: req-research
description: 需求调研插件。代码审计、数据库分析、现有功能调研、技术可行性评估。挂载在 analysis 阶段,需要深度调研时由 req-prd 推荐激活。
---
# 需求调研插件 (req-research)
## 概述
当 PRD 编写需要**深入了解现有系统**时使用。提供结构化的调研方法。
**触发条件**
- 需求涉及修改现有功能(需了解当前实现)
- 需求涉及数据库表结构变更
- 需要技术可行性评估
## 调研方法
### 1. 前端功能调研
```bash
# 启动本地开发环境
cd frontend && npm start
# 访问相关页面,记录:
# - 页面布局和交互流程
# - 表单字段和校验规则
# - 列表列和筛选条件
# - 异常情况处理(空状态、错误提示)
```
**调研模板**
```markdown
### 页面: [页面名称] ([URL])
- **功能**: [功能描述]
- **字段**: [列出所有字段]
- **操作**: [CRUD/筛选/排序/导出]
- **校验**: [表单校验规则]
- **截图**: [如有]
```
### 2. 后端代码审计
```bash
# 搜索相关模型
Grep(pattern="type.*struct", path="backend/models", glob="*xxx*.go")
# 搜索相关 Handler
Grep(pattern="func.*Handler.*xxx", path="backend/handlers")
# 搜索相关路由
Grep(pattern="xxx", path="backend/routes")
# 搜索相关 Service
Grep(pattern="func.*Service.*xxx", path="backend/services")
```
**审计模板**
```markdown
### 模块: [模块名]
- **Model**: `backend/models/xxx.go` — [字段数]个字段
- **Repository**: `backend/database/xxx_repository.go` — [方法数]个方法
- **Service**: `backend/services/xxx_service.go` — [方法数]个方法
- **Handler**: `backend/handlers/xxx_handler.go` — [接口数]个接口
- **Route**: `backend/routes/xxx_routes.go`
- **关键业务逻辑**: [描述]
```
### 3. 数据库分析
```bash
# 查看表结构(本地)
psql -U ai_user -d ai_project -c "\d table_name"
# 查看数据量
psql -U ai_user -d ai_project -c "SELECT COUNT(*) FROM table_name"
# 查看索引
psql -U ai_user -d ai_project -c "\di table_name*"
```
**分析模板**
```markdown
### 表: [表名]
- **字段数**: N
- **数据量**: ~N 行
- **索引**: [列出索引]
- **关联**: [外键关系]
- **特殊字段**: [JSON/Array/Enum 等]
```
### 4. API 分析
```bash
# 查看 Swagger 文档
open http://localhost:8080/swagger/index.html
# 搜索 API 路由
Grep(pattern="GET|POST|PUT|DELETE.*xxx", path="backend/routes")
```
## 调研报告模板
```markdown
## 调研报告 — {需求标题}
### 1. 现有功能
[页面/功能调研结果]
### 2. 代码结构
[代码审计结果,按分层列出]
### 3. 数据库现状
[表结构、数据量、索引]
### 4. 技术可行性
| 方案 | 优点 | 缺点 | 工时预估 |
|------|------|------|---------|
| 方案A | ... | ... | Xh |
| 方案B | ... | ... | Xh |
### 5. 建议
[推荐方案及原因]
```