feishu-doc-to-dev-spec

Original🇨🇳 Chinese
Translated
2 scripts

Read Feishu Cloud Docs (supports multiple links), parse content such as text, tables, images in documents, and convert Product Requirement Documents (PRD) into structured development requirement documents according to the development language and storage structure selected by users

1installs
Added on

NPX Install

npx skill4agent add twwch/openskills feishu-doc-to-dev-spec

SKILL.md Content (Chinese)

View Translation Comparison →

Convert Feishu Cloud Docs to Development Requirement Documents

Task Objectives

This Skill is used to:
  1. Read Feishu Cloud Doc content (supports multiple document links)
  2. Fully parse all content in the documents: text, tables, images, code blocks, etc.
  3. Based on the development language and storage structure selected by users
  4. Convert Product Requirement Documents (PRD) into structured development requirement documents

Preparations

Feishu Application Configuration

You need to create a Feishu application and obtain credentials before use:
  1. Visit Feishu Open Platform
  2. Create an enterprise self-built application
  3. Get 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

bash
export FEISHU_APP_ID=your-app-id
export FEISHU_APP_SECRET=your-app-secret

Operation Steps

Standard Process

  1. Collect Document Links
    • Users provide 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 Selection
    • Ask users to select a development language (e.g., Python, Java, Go, Node.js, Rust, etc.)
    • Ask users to select a storage structure (e.g., PostgreSQL, MySQL, MongoDB, Redis, etc.)
    • Ask about other tech stack preferences (frameworks, deployment methods, etc.)
  3. Read Document Content
    • Call the
      [INVOKE:fetch_feishu_doc]
      script
    • Pass in the list of document links
    • The script will return the complete document content, including:
      • Text paragraphs
      • Table data (converted to Markdown tables)
      • Images (downloaded to local and return paths)
      • 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 Development Requirement Documents
    • Based on the tech stack selected by users
    • Generate development documents containing the following content:
      • Technical architecture design
      • Data model design (table structure)
      • API interface design
      • Core function implementation scheme
      • Technical risk assessment
  6. Output Results
    • Generate development requirement documents in Markdown format
    • Save to the
      ./output/
      directory

Resource Index

Scripts

  • Feishu Doc Reading:
    scripts/fetch_feishu_doc.py
    • Purpose: Read complete content of Feishu Cloud Docs
    • Input parameters (JSON format):
      json
      {
        "doc_urls": ["https://xxx.feishu.cn/docx/xxxxx"],
        "app_id": "Feishu App ID (optional, read from environment variables by default)",
        "app_secret": "Feishu App Secret (optional, read from environment variables by default)"
      }
    • Output: JSON structure of document content

Reference Documents

  • Development Document Template:
    references/dev-spec-template.md
    • When to read: When generating development requirement documents
    • Contains standard development document structure and examples
  • Tech Stack Guide:
    references/tech-stack-guide.md
    • When to read: When helping users select tech stacks
    • Contains characteristics and applicable scenarios of common tech stacks

Notes

Document Permissions

  • Ensure the Feishu application has permission to access the target documents
  • If the document is private, add the application as a document collaborator

Image Processing

  • Images in documents will be downloaded to the
    ./output/images/
    directory
  • Image links will be replaced with local relative paths

Multi-Document Merging

  • When users provide multiple document links, the content will be read and merged in order
  • Content of each document will be separated by a divider

Output Format

  • Development requirement documents use Markdown format
  • Tables use Markdown table syntax
  • Code blocks use syntax highlighting tags corresponding to the language

Usage Examples

Example 1: Single Document Conversion

User Input:
Please help me convert this product requirement document into a development requirement document:
https://example.feishu.cn/docx/abc123

Tech stack:
- Language: Python
- Framework: FastAPI
- Database: PostgreSQL
- Cache: Redis
Execution Process:
  1. Call
    [INVOKE:fetch_feishu_doc]
    to read the document
  2. Analyze requirement content
  3. Generate development documents based on Python + FastAPI + PostgreSQL tech stack
  4. Output to
    ./output/dev-spec.md

Example 2: Multi-Document Merging

User Input:
These are our product requirement documents, including multiple parts:
1. Overall Requirements: https://example.feishu.cn/docx/main
2. User Module: https://example.feishu.cn/docx/user
3. Order Module: https://example.feishu.cn/docx/order

Please generate development documents using Java + Spring Boot + MySQL
Execution Process:
  1. Read the three documents in sequence
  2. Merge and analyze requirements
  3. Generate development documents for Java tech stack

Development Document Output Structure

The generated development requirement documents include the following sections:
markdown
# Development Requirement Document

## 1. Project Overview
- Project Background
- Project Objectives
- Tech Stack Selection

## 2. System Architecture
- Overall Architecture Diagram
- Module Division
- Technical Components

## 3. Data Model Design
- ER Diagram
- Table Structure Definition
- Index Design

## 4. API Interface Design
- Interface List
- Request/Response Format
- Error Code Definition

## 5. Detailed Design of Functional Modules
- Module A
  - Function Description
  - Implementation Scheme
  - Key Code Examples
- Module B
  - ...

## 6. Non-Functional Requirements
- Performance Requirements
- Security Requirements
- Availability Requirements

## 7. Development Plan
- Milestones
- Task Decomposition
- Risk Assessment