mcpField
D
document-extraction

document-extraction

github.com/melodic-software文档处理2845 次安装今天更新
代码仓库

关于 document-extraction

Document Extraction Skill 用于从现有文档中系统提取并整理需求,适合处理需求文档、会议记录和法规材料的分析人员。它按文档类型匹配需求模式,并支持分类、去重及不同程度的人工审阅。

主要功能

  1. 01支持 Markdown、文本、PDF 和 Word
  2. 02识别显式及 EARS 需求模式
  3. 03提取并记录需求来源位置
  4. 04按类别整理需求
  5. 05语义去重并标记审阅项

适用场景

  1. 01从会议记录整理需求和行动项
  2. 02将旧版文档转换为结构化需求
  3. 03从法规材料提取合规要求
  4. 04分析竞品文档中的功能要求

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/melodic-software/claude-code-plugins --skill document-extraction

安装后在 Claude Code 中输入/document-extraction确认已加载。

附带文件references/document-types.mdreferences/extraction-prompts.md

详细介绍

文档提取技能

从现有文档源中提取需求,以便系统地挖掘需求。

何时使用此技能

关键词: 提取需求、文档挖掘、PDF 需求、转录分析、解析文档、现有文档、遗留需求、竞品分析

在以下情况调用此技能:

  • 从现有文档中挖掘需求
  • 处理会议转录内容以提取需求
  • 从竞品中提取需求
  • 分析监管文件以提取合规要求
  • 将遗留文档转换为结构化需求

支持的文档类型

类型扩展名提取方法
Markdown.md直接读取
文本.txt直接读取
PDF.pdfRead 工具(支持 PDF)
Word.docxRead 工具
网页URLWebFetch 工具
会议记录.md, .txt转录模式
规范.md, .docx需求模式

提取工作流

第 1 步:文档评估

分析文档以确定提取策略:

document_assessment:
  path: "{file path or URL}"
  type: "{detected document type}"
  size: "{approximate size}"
  structure:
    has_sections: true|false
    has_lists: true|false
    has_tables: true|false
  quality:
    formal_language: true|false
    clear_requirements: true|false
    needs_interpretation: true|false
第 2 步:模式匹配

应用需求检测模式:

显式需求标记:

- "The system shall..."
- "The system must..."
- "Users should be able to..."
- "REQ-XXX:"
- Numbered requirements (1.1, 1.2, etc.)

EARS 模式:

- "When [trigger], the [system] shall [response]"
- "While [state], the [system] shall [behavior]"
- "Where [feature], the [system] shall [behavior]"
- "If [condition], then the [system] shall [response]"

隐式需求指示词:

- "It is important that..."
- "We need..."
- "The goal is to..."
- "Users expect..."
- "Performance should..."
第 3 步:需求提取

对于每项已识别的需求:

extracted_requirement:
  id: REQ-{sequence}
  text: "{cleaned requirement statement}"
  source: document
  source_file: "{file path}"
  source_location: "{section/page/line}"
  original_text: "{exact text from document}"
  type: functional|non-functional|constraint|assumption
  confidence: high|medium|low
  extraction_method: explicit|pattern|inferred
  needs_review: true|false
  review_notes: "{why review needed}"
第 4 步:分类

对提取的需求进行分类:

categories:
  functional:
    - features
    - behaviors
    - interactions
  non_functional:
    - performance
    - security
    - usability
    - reliability
    - scalability
  constraints:
    - technical
    - business
    - regulatory
  assumptions:
    - environmental
    - user_behavior
    - dependencies
第 5 步:去重

识别并合并重复的需求:

deduplication:
  strategy: semantic_similarity
  threshold: 0.8
  action: merge|flag_for_review
  merged_requirements:
    - id: REQ-merged-001
      sources: [REQ-001, REQ-015]
      text: "{consolidated requirement}"

特定文档策略

会议转录
transcript_extraction:
  focus_on:
    - Action items
    - Decisions made
    - Requirements discussed
    - Concerns raised
  patterns:
    - "We decided that..."
    - "The requirement is..."
    - "Action item:"
    - "TODO:"
    - "Need to..."
  speaker_context:
    - Note who said what
    - Weight by speaker role
监管文件
regulatory_extraction:
  focus_on:
    - Mandatory requirements ("shall", "must")
    - Prohibited actions ("shall not", "must not")
    - Conditional requirements ("if...then")
  compliance_mapping:
    - Reference section numbers
    - Note effective dates
    - Track version/revision
竞品分析
competitor_extraction:
  focus_on:
    - Feature descriptions
    - User capabilities
    - Unique selling points
  output:
    - Feature requirements
    - Differentiation opportunities
    - Gap identification
  confidence: low  # Based on external observation
遗留规范
legacy_extraction:
  focus_on:
    - Existing requirements
    - System behaviors
    - Integration points
  modernization:
    - Update terminology
    - Convert to EARS format
    - Flag deprecated requirements

输出格式

单文档输出
extraction_result:
  source:
    file: "{path or URL}"
    type: "{document type}"
    extraction_date: "{ISO-8601}"
    confidence: high|medium|low

  statistics:
    total_candidates: {number}
    extracted: {number}
    filtered: {number}
    needs_review: {number}

  requirements:
    - id: REQ-{number}
      text: "{requirement}"
      type: functional|non-functional|constraint
      source_location: "{section/page}"
      confidence: high|medium|low
      original_text: "{exact source text}"

  review_items:
    - requirement_id: REQ-{number}
      reason: "{why review needed}"
      suggestion: "{proposed action}"

  metadata:
    sections_processed: {number}
    extraction_patterns_used: ["{pattern names}"]

自主性级别

引导模式
guided_behavior:
  document_selection: Human selects
  extraction_strategy: AI suggests, human approves
  each_requirement: AI highlights, human confirms
  categorization: AI suggests, human validates
半自主模式
semi_auto_behavior:
  document_selection: AI suggests priority, human approves list
  extraction_strategy: AI chooses autonomously
  requirements: AI extracts all, human reviews in batches
  categorization: AI categorizes, human spot-checks
全自主模式
full_auto_behavior:
  document_selection: AI processes all relevant
  extraction_strategy: AI optimizes per document
  requirements: AI extracts, deduplicates, categorizes
  output: Full extraction report for final review

质量指标

高置信度提取
  • 显式需求标记(“shall”“must”)
  • 匹配 EARS 模式
  • 带编号的需求列表
  • 清晰的祈使句陈述
中置信度提取
  • 隐式指示词(“should”“needs to”)
  • 依赖上下文的解释
  • 部分匹配模式
  • 需要领域知识
低置信度提取
  • 根据描述推断
  • 解释叙述文本
  • 竞品分析
  • 基于上下文的假设

委派

对于相关任务,委派给:

  • gap-analysis:检查提取的需求是否完整
  • domain-research:研究不熟悉的术语或概念
  • elicitation-methodology:返回以选择技术

输出位置

将提取结果保存到:

.requirements/{domain}/documents/DOC-{filename}-{timestamp}.yaml

相关内容

  • elicitation-methodology - 父级中心技能
  • gap-analysis - 提取后的完整性检查
  • interview-conducting - 与利益相关者澄清提取的需求

评论

支持 Markdown