Skip to content
OpenSmartRoute
Skillv1.0.0

doc-pipeline

Chain document operations into reusable pipelines

by claude-office-skills(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from claude-office-skills/skills (doc-pipeline/SKILL.md) via skills.sh. Install upstream with npx skills add claude-office-skills/skills --skill doc-pipeline. Copyright stays with the author (MIT).

Doc Pipeline Skill

Overview

This skill enables building document processing pipelines - chain multiple operations (extract, transform, convert) into reusable workflows with data flowing between stages.

How to Use

  1. Describe what you want to accomplish
  2. Provide any required input data or files
  3. I'll execute the appropriate operations

Example prompts:

  • "PDF → Extract Text → Translate → Generate DOCX"
  • "Image → OCR → Summarize → Create Report"
  • "Excel → Analyze → Generate Charts → Create PPT"
  • "Multiple inputs → Merge → Format → Output"

Domain Knowledge

Pipeline Architecture

Stage 1      Stage 2      Stage 3      Stage 4
┌──────┐    ┌──────┐    ┌──────┐    ┌──────┐
│Extract│ → │Transform│ → │ AI   │ → │Output│
│ PDF  │    │  Data  │    │Analyze│   │ DOCX │
└──────┘    └──────┘    └──────┘    └──────┘
     │           │           │           │
     └───────────┴───────────┴───────────┘
                 Data Flow

Pipeline DSL (Domain Specific Language)

# pipeline.yaml
name: contract-review-pipeline
description: Extract, analyze, and report on contracts

stages:
  - name: extract
    operation: pdf-extraction
    input: $input_file
    output: $extracted_text
    
  - name: analyze
    operation: ai-analyze
    input: $extracted_text
    prompt: "Review this contract for risks..."
    output: $analysis
    
  - name: report
    operation: docx-generation
    input: $analysis
    template: templates/review_report.docx
    output: $output_file

Python Implementation

from typing import Callable, Any
from dataclasses import dataclass

@dataclass
class Stage:
    name: str
    operation: Callable
    
class Pipeline:
    def __init__(self, name: str):
        self.name = name
        self.stages: list[Stage] = []
    
    def add_stage(self, name: str, operation: Callable):
        self.stages.append(Stage(name, operation))
        return self  # Fluent API
    
    def run(self, input_data: Any) -> Any:
        data = input_data
        for stage in self.stages:
            print(f"Running stage: {stage.name}")
            data = stage.operation(data)
        return data

# Example usage
pipeline = Pipeline("contract-review")
pipeline.add_stage("extract", extract_pdf_text)
pipeline.add_stage("analyze", analyze_with_ai)
pipeline.add_stage("generate", create_docx_report)

result = pipeline.run("/path/to/contract.pdf")

Advanced: Conditional Pipelines

class ConditionalPipeline(Pipeline):
    def add_conditional_stage(self, name: str, condition: Callable, 
                               if_true: Callable, if_false: Callable):
        def conditional_op(data):
            if condition(data):
                return if_true(data)
            return if_false(data)
        return self.add_stage(name, conditional_op)

# Usage
pipeline.add_conditional_stage(
    "ocr_if_needed",
    condition=lambda d: d.get("has_images"),
    if_true=run_ocr,
    if_false=lambda d: d
)

Best Practices

  1. Keep stages focused (single responsibility)
  2. Use intermediate outputs for debugging
  3. Implement stage-level error handling
  4. Make pipelines configurable via YAML/JSON

Installation

# Install required dependencies
pip install python-docx openpyxl python-pptx reportlab jinja2

Resources

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/claude-office-skills-skills-doc-pipeline/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

claude-office-skills-skills-doc-pipeline.ocm.jsonjson
{
  "ocm": "1",
  "id": "claude-office-skills-skills-doc-pipeline",
  "kind": "skill",
  "name": "doc-pipeline",
  "description": "Chain document operations into reusable pipelines",
  "publisher": "claude-office-skills",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "pipeline",
      "workflow",
      "document",
      "automation",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Chain document operations into reusable pipelines"
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/claude-office-skills/skills",
      "path": "doc-pipeline/SKILL.md",
      "ref": "HEAD",
      "url": "https://www.skills.sh/claude-office-skills/skills/doc-pipeline",
      "key": "claude-office-skills/skills/doc-pipeline/SKILL.md"
    },
    "license": "MIT"
  },
  "instructions": "# Doc Pipeline Skill\n\n## Overview\n\nThis skill enables building document processing pipelines - chain multiple operations (extract, transform, convert) into reusable workflows with data flowing between stages.\n\n## How to Use\n\n1. Describe what you want to accomplish\n2. Provide any required input data or files\n3. I'll execute the appropriate operations\n\n**Example prompts:**\n- \"PDF → Extract Text → Translate → Generate DOCX\"\n- \"Image → OCR → Summarize → Create Report\"\n- \"Excel → Analyze → Generate Charts → Create PPT\"\n- \"Multiple inputs → Merge → Format → Output\"\n\n## Domain Knowledge\n\n\n### Pipelin",
  "cost": {
    "context_tokens": 874
  }
}

Fetch it by URL: GET /api/v1/registry/claude-office-skills-skills-doc-pipeline/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.