Task Objectives
This Skill is used to:
- Read Feishu cloud document content (supports multiple document links)
- Fully parse all content in the document: text, tables, images, code blocks, etc.
- Based on the development language and storage structure selected by the user
- Convert the product requirements document (PRD) into a structured R&D development requirements document
Prerequisites
Feishu Application Configuration
Before use, you need to create a Feishu application and obtain credentials:
- Visit Feishu Open Platform
- Create a custom enterprise application
- Obtain the App ID and App Secret
- Configure application permissions:
docx:document:readonly- Read document contentdrive:drive:readonly- Read cloud space fileswiki:wiki:readonly- Read knowledge base (if needed)
Environment Variables
export FEISHU_APP_ID=your-app-id
export FEISHU_APP_SECRET=your-app-secret
Operation Steps
Standard Process
-
Collect document links
- The user provides one or more Feishu document links
- Supported link formats:
https://xxx.feishu.cn/docx/xxxxx- New version documentshttps://xxx.feishu.cn/docs/xxxxx- Old version documentshttps://xxx.feishu.cn/wiki/xxxxx- Knowledge base documents
-
Confirm technical stack
- Ask the user to choose a development language (e.g., Python, Java, Go, Node.js, Rust, etc.)
- Ask about the storage structure (e.g., PostgreSQL, MySQL, MongoDB, Redis, etc.)
- Ask about other technical stack preferences (framework, deployment method, etc.)
-
Read document content
- Call
[INVOKE:fetch_feishu_doc]script - Pass in the document link list
- The script will return the complete document content, including:
- Text paragraphs
- Table data (converted to Markdown tables)
- Images (downloaded locally and paths returned)
- Code blocks
- Ordered/unordered lists
- Call
-
Analyze requirement content
- Identify functional requirements and non-functional requirements
- Extract business rules and constraints
- Organize user stories and acceptance criteria
-
Generate R&D requirements document
- Based on the technical stack selected by the user
- Generate an R&D document containing the following content:
- Technical architecture design
- Data model design (table structure)
- API interface design
- Core function implementation plan
- Technical risk assessment
-
Output results
- Generate an R&D requirements document in Markdown format
- Save to
./output/directory
Resource Index
Scripts
- Feishu document reading:
scripts/fetch_feishu_doc.py- Purpose: Read the complete content of a Feishu cloud document
- Input parameters (JSON format):
{ "doc_urls": ["https://xxx.feishu.cn/docx/xxxxx"], "app_id": "飞书应用ID(可选,默认从环境变量读取)", "app_secret": "飞书应用密钥(可选,默认从环境变量读取)" } - Output: JSON structure of the document content
Reference documents
-
R&D document template:
references/dev-spec-template.md- When to read: When generating a development requirements document
- Contains the standard development document structure and examples
-
Technology Selection Guide:
references/tech-stack-guide.md- When to read: When helping users choose a technology stack
- Contains the characteristics and applicable scenarios of common technology stacks
Notes
Document Permissions
- Ensure the Feishu app has permission to access the target document
- If the document is private, the app needs to be added as a document collaborator
Image Handling
- Images in the document will be downloaded to the
./output/images/directory - Image links will be replaced with local relative paths
Multi-Document Merging
- When the user provides multiple document links, the content will be read and merged in order
- The content of each document will be separated by a divider line
Output Format
- The development requirements document uses Markdown format
- Tables use Markdown table syntax
- Code blocks use syntax highlighting markers for the corresponding language
Usage Examples
Example 1: Single Document Conversion
User Input:
请帮我把这个产品需求文档转换为研发需求文档:
https://example.feishu.cn/docx/abc123
技术栈:
- 语言:Python
- 框架:FastAPI
- 数据库:PostgreSQL
- 缓存:Redis
Execution Flow:
- Call
[INVOKE:fetch_feishu_doc]to read the document - Analyze the requirements content
- Generate the development document based on the Python + FastAPI + PostgreSQL technology stack
- Output to
./output/dev-spec.md
Example 2: Merging Multiple Documents
User Input:
这是我们的产品需求文档,包含多个部分:
1. 总体需求:https://example.feishu.cn/docx/main
2. 用户模块:https://example.feishu.cn/docx/user
3. 订单模块:https://example.feishu.cn/docx/order
请使用 Java + Spring Boot + MySQL 生成研发文档
Execution Flow:
- Read the three documents in sequence
- Merge and analyze the requirements
- Generate the development document for the Java technology stack
Development Document Output Structure
The generated development requirements document contains the following sections:
# 研发需求文档
## 1. 项目概述
- 项目背景
- 项目目标
- 技术栈选型
## 2. 系统架构
- 整体架构图
- 模块划分
- 技术组件
## 3. 数据模型设计
- ER 图
- 表结构定义
- 索引设计
## 4. API 接口设计
- 接口列表
- 请求/响应格式
- 错误码定义
## 5. 功能模块详设
- 模块 A
- 功能描述
- 实现方案
- 关键代码示例
- 模块 B
- ...
## 6. 非功能需求
- 性能要求
- 安全要求
- 可用性要求
## 7. 开发计划
- 里程碑
- 任务分解
- 风险评估