SuperAPI AI Directory

feishu-doc-to-dev-spec

General & other

View repository

Updated 10-16 06:23

About this skill

Convert Feishu Cloud Documents to R&D Requirements Documents

Task Objectives

This Skill is used to:

  1. Read Feishu cloud document content (supports multiple document links)
  2. Fully parse all content in the document: text, tables, images, code blocks, etc.
  3. Based on the development language and storage structure selected by the user
  4. 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:

  1. Visit Feishu Open Platform
  2. Create a custom enterprise application
  3. Obtain the App ID and App Secret
  4. Configure application permissions:
    • docx:document:readonly - Read document content
    • drive:drive:readonly - Read cloud space files
    • wiki: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

  1. Collect document links

    • The user provides one or more Feishu document links
    • Supported link formats:
      • https://xxx.feishu.cn/docx/xxxxx - New version documents
      • https://xxx.feishu.cn/docs/xxxxx - Old version documents
      • https://xxx.feishu.cn/wiki/xxxxx - Knowledge base documents
  2. 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.)
  3. 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
  4. Analyze requirement content

    • Identify functional requirements and non-functional requirements
    • Extract business rules and constraints
    • Organize user stories and acceptance criteria
  5. 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
  6. 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:

  1. Call [INVOKE:fetch_feishu_doc] to read the document
  2. Analyze the requirements content
  3. Generate the development document based on the Python + FastAPI + PostgreSQL technology stack
  4. 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:

  1. Read the three documents in sequence
  2. Merge and analyze the requirements
  3. 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. 开发计划
- 里程碑
- 任务分解
- 风险评估