SuperAPI AI Directory

prd-generator

Writing & research

View repository

Updated 10-15 08:01

About this skill

PRD Generator - Product Requirements Document Generator

This skill helps quickly generate professional-grade Product Requirements Documents (PRDs), adopting a UML use case-driven methodology, and outputs documents with a complete structure that can be directly used for team collaboration.

Trigger Conditions

Use this skill when the user mentions the following scenarios:

  • Writing a PRD, writing a product requirements document
  • Writing a product specification document
  • Product design, product planning
  • New feature requirements analysis
  • Use case analysis, use case modeling
  • Generating requirements documents

Workflow

  1. Requirements gathering: Confirm the product background, core functions, and target users with the user
  2. Use case modeling: Identify actors → sort out use cases → establish relationships (Include/Extend)
  3. Specification writing: Write detailed specifications for each use case according to the template (preconditions/postconditions, event flows, alternative flows)
  4. Interaction design: Draw flowcharts, sequence diagrams, state machines
  5. UI specifications: Define layout, components, colors, fonts
  6. Non-functional requirements: Specify performance, security, and compatibility requirements
  7. Document integration: Generate a complete PRD document

Document Structure

The generated PRD contains the following sections:

1. 产品概述
   ├── 产品背景
   ├── 产品目标
   └── 系统范围(含组件定义表)

2. UML用例模型
   ├── 系统用例图(ASCII 图形)
   ├── 参与者定义
   ├── 用例列表(编号-名称-参与者)
   └── 用例关系图

3. 详细用例规格说明
   └── 每个用例包含:
       ├── 基本信息(编号/名称/参与者/优先级)
       ├── 前置/后置条件
       ├── 基本事件流
       ├── 备选事件流
       ├── 业务规则
       ├── 数据说明表(字段定义)
       └── 接口说明

4. 详细交互设计
   ├── 页面整体交互流程
   ├── 子流程图(如文件上传)
   ├── 状态机图
   ├── 时序图(数据流转)
   └── 追问/多轮对话流程

5. UI设计规范
   ├── 页面整体布局(ASCII 线框图)
   ├── 核心组件设计(ASCII 示意)
   ├── 色彩规范(色板+色值)
   ├── 字体规范(字号层级)
   ├── 间距规范(基础单位)
   └── 组件状态规范

6. 非功能需求
   ├── 性能需求
   ├── 兼容性需求
   ├── 安全需求
   └── 可靠性需求

7. 附录
   ├── 术语表
   └── 参考资料

Core Templates

Use Case Specification Template

### UC-XX [用例名称]

| 项目 | 内容 |
|------|------|
| **用例编号** | UC-XX |
| **用例名称** | [用例名称] |
| **参与者** | [参与者列表] |
| **前置条件** | [前置条件描述] |
| **后置条件** | [后置条件描述] |
| **基本事件流** | 1. [步骤1]<br>2. [步骤2]<br>3. [步骤3] |
| **备选事件流** | 1a. [异常1]:系统[处理方式]<br>2a. [异常2]:系统[处理方式] |
| **业务规则** | 1. [规则1]<br>2. [规则2] |

#### 数据说明表

**[表名](table_name)**

| 字段名 | 字段中文名 | 数据类型 | 取值范围 | 是否必填 | 备注说明 |
|--------|------------|----------|----------|----------|----------|
| field_name | 字段中文名 | VARCHAR(100) | 任意字符串 | 是/否 | 字段说明 |

| **优先级** | [高/中/低] |
|------------|----|

Sequence Diagram Template

┌─────────────────────────────────────────────────────────────────┐
│                          [标题]                                  │
└─────────────────────────────────────────────────────────────────┘

  参与者A                   参与者B                    参与者C
     │                         │                          │
     │  1. [操作描述]          │                          │
     │ ───────────────────────►                          │
     │                         │  2. [处理操作]            │
     │                         │ ───────────►             │
     │                         │                          │
     │  3. [返回结果]          │                          │
     │ ◄───────────────────────                          │
     │                         │                          │

Data Dictionary Template

**字段类型枚举**:
- STRING/VARCHAR: 字符串类型
- INT/BIGINT: 整数类型
- DECIMAL: 小数类型
- BOOLEAN: 布尔类型
- DATETIME: 日期时间类型
- JSON: JSON 对象/数组
- UUID: 唯一标识符

**状态字段枚举**:
- PENDING: 待处理
- PROCESSING: 处理中
- COMPLETED: 已完成
- ERROR/FAILED: 错误/失败
- ACTIVE: 活跃
- INACTIVE: 未激活

Common Intent Types (Data Analysis Products)

Intent Type Description Associated Chart
BAR Bar chart intent Bar chart
LINE Line chart intent Line chart
PIE Pie chart intent Pie chart
SCATTER Scatter plot intent Scatter plot
TABLE Table display intent Data table
FILTER Data filtering intent Filter conditions
AGREGATE Aggregation query intent Statistical results
CONDITION Conditional judgment intent Judgment results

Output Format

The generated PRD document should:

  • Use Markdown format
  • Include complete ASCII graphics (use case diagrams, flowcharts, sequence diagrams)
  • Display data fields clearly using tables
  • Code blocks use ``` markers
  • The document header includes version, date, and status information

Example Output

See references/examples.md