⏳ This skill is pending AI review.

Scores will appear once the review pipeline completes.

v1.0.0

genpark-doc-processor

@alphaparkinc⭐ 9 stars

Intelligent document, PDF, and spreadsheet data extractor.

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

—/10

// RATINGS

⭐GitHub Stars
⭐ 9 on GitHubGitHub ↗

New / niche

🟢ProSkills Score
—
📍

Not yet listed on ClawHub or SkillsMP

// README

openclaw-genpark-doc-processor

Organization Model Context Protocol Zero-Dependency Python Version Security Rating License

Production-hardened OpenClaw GenPark Agent skill engineered strictly with Python standard library. Provides high-throughput deterministic execution, cryptographic security, and game-theoretic optimization via the Model Context Protocol (MCP).


Architecture & Data Flow

flowchart TD
    Input[Incoming Agent Telemetry / Task Input] --> Core["OpenClawGenParkDocProcessor"]
    Core --> Model[Mathematical Logic Engine]
    Model --> MCPResponse[Deterministic JSON Output / MCP Tool Result]

Quickstart & Usage

1. Direct Python Client Execution

python example_usage.py

2. Standalone MCP Server Launch

Run the native STDIO MCP server:

python mcp_server.py

License

This project is licensed under the MIT License - see the LICENSE file for details.

// HOW IT'S BUILT

// FILES

9 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.

  • SKILL.md1.0 KBcfaf277cfa52upstream ↗
    ---
    name: genpark-doc-processor
    description: Intelligent document, PDF, and spreadsheet data extractor.
    version: 1.0.0
    ---
    
    # genpark-doc-processor
    
    ## Overview
    This skill mitigates the "messy data" problem. It takes unstructured or poorly formatted documents, PDFs, or raw data feeds and outputs clean, structured tables, summaries, or presentation outlines.
    
    ## Capabilities
    1. **Data Structuring**: Turn messy conversational data or raw text dumps into clean CSV/Markdown tables.
    2. **Report Summarization**: Take long business reports and extract only action items, financial figures, and core arguments.
    3. **Presentation Generation**: Draft complete slide-by-slide outlines for business presentations based on raw notes.
    
    ## Usage Instructions
    When a user provides raw data or asks to process a document:
    - First, clarify the desired output format (Table, JSON, Slide Outline).
    - Strip out all irrelevant fluff and directly address the structured data output.
    - If data is ambiguous, create a "Needs Clarification" column or section in the output.
    
  • README.md1.4 KB9913b5567812upstream ↗
    # openclaw-genpark-doc-processor
    
    [![Organization](https://img.shields.io/badge/AlphaPark-OpenSource-blue.svg)](https://github.com/alphaparkinc)
    [![Model Context Protocol](https://img.shields.io/badge/MCP-Standard-orange.svg)](https://modelcontextprotocol.io)
    [![Zero-Dependency](https://img.shields.io/badge/Dependencies-Zero_External-brightgreen.svg)](#)
    [![Python Version](https://img.shields.io/badge/Python-3.9%2B-blue.svg)](#)
    [![Security Rating](https://img.shields.io/badge/Status-Grade_A_Production-success.svg)](#)
    [![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
    
    Production-hardened OpenClaw GenPark Agent skill engineered strictly with Python standard library. Provides high-throughput deterministic execution, cryptographic security, and game-theoretic optimization via the Model Context Protocol (MCP).
    
    ---
    
    ## Architecture & Data Flow
    
    ```mermaid
    flowchart TD
        Input[Incoming Agent Telemetry / Task Input] --> Core["OpenClawGenParkDocProcessor"]
        Core --> Model[Mathematical Logic Engine]
        Model --> MCPResponse[Deterministic JSON Output / MCP Tool Result]
    ```
    
    ---
    
    ## Quickstart & Usage
    
    ### 1. Direct Python Client Execution
    ```bash
    python example_usage.py
    ```
    
    ### 2. Standalone MCP Server Launch
    Run the native STDIO MCP server:
    ```bash
    python mcp_server.py
    ```
    
    ---
    
    ## License
    
    This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
    
  • .gitignore64 Bed8ae579cca3upstream ↗
    __pycache__/\n*.py[cod]\n.env\n.venv/\nvenv/\n*.log\n.DS_Store\n
  • client.py7.5 KBb4605811dde9upstream ↗
    # -*- coding: utf-8 -*-
    """
    OpenClaw GenPark Doc Processor Client
    Pure Python Standard Library (Zero External Dependencies)
    Implements recursive sliding-window boundary chunking, Markdown header hierarchy DAG parsing,
    and lexical token-budget packing.
    """
    
    import math
    import re
    import hashlib
    from typing import Dict, Any, List, Optional
    
    class OpenClawGenParkDocProcessor:
        """
        Algorithmic document parsing and context packaging engine for autonomous LLM agents.
        """
    
        def __init__(self):
            pass
    
        def partition_document_by_sliding_window(
            self,
            text: str,
            chunk_size_words: int = 200,
            overlap_words: int = 40
        ) -> Dict[str, Any]:
            """
            Partitions text into overlapping sliding-window chunks with SHA-256 fingerprints
            and boundary preservation.
            
            Formula:
              stride = chunk_size - overlap
              num_chunks = ceil((total_words - overlap) / stride)
            """
            if not text or not text.strip():
                return {
                    "total_words": 0,
                    "total_chunks": 0,
                    "chunks": [],
                    "overlap_retention_ratio": 0.0
                }
    
            words = text.split()
            total_words = len(words)
            
            chunk_size = max(10, chunk_size_words)
            overlap = min(max(0, overlap_words), chunk_size - 1)
            stride = chunk_size - overlap
    
            chunks = []
            start_idx = 0
            chunk_id = 0
    
            while start_idx < total_words:
                end_idx = min(start_idx + chunk_size, total_words)
                chunk_words = words[start_idx:end_idx]
                chunk_content = " ".join(chunk_words)
                
                # SHA-256 fingerprint
                fp = hashlib.sha256(chunk_content.encode("utf-8")).hexdigest()[:16]
                
                chunks.append({
                    "chunk_id": chunk_id,
                    "start_word_index": start_idx,
                    "end_word_index": end_idx,
                    "word_count": len(chunk_words),
                    "fingerprint": fp,
                    "text": chunk_content
                })
                
                chunk_id += 1
                start_idx += stride
                if end_idx >= total_words:
                    break
    
            retention_ratio = round((overlap / chunk_size) if chunk_size > 0 else 0.0, 4)
    
            return {
                "total_words": total_words,
                "chunk_size_words": chunk_size,
                "overlap_words": overlap,
                "total_chunks": len(chunks),
                "overlap_retention_ratio": retention_ratio,
                "chunks": chunks
            }
    
        def parse_markdown_header_hierarchy_dag(self, markdown_text: str) -> Dict[str, Any]:
            """
            Parses Markdown text into a directed hierarchical DAG of sections (H1 -> H2 -> H3)
            tracking byte offsets, word counts, and structural balance metrics.
            """
            lines = markdown_text.splitlines()
            nodes = []
            stack = []  # stack of (level, node_idx)
            
            current_header = "Root / Preamble"
            current_level = 0
            current_content_lines = []
            
            for line in lines:
                header_match = re.match(r"^(#{1,6})\s+(.+)$", line.strip())
                if header_match:
                    # Flush previous section
                    if current_content_lines or current_header != "Root / Preamble":
                        sec_text = chr(10).join(current_content_lines).strip()
                        nodes.append({
                            "id": len(nodes),
                            "title": current_header,
                            "level": current_level,
                            "word_count": len(sec_text.split()) if sec_text else 0,
                            "character_length": len(sec_text),
                            "parent_id": stack[-1][1] if stack else None
                        })
                    
                    h_level = len(header_match.group(1))
                    h_title = header_match.group(2).strip()
                    
                    # Maintain hierarchy stack
                    while stack and stack[-1][0] >= h_level:
                        stack.pop()
                    
                    parent_id = stack[-1][1] if stack else None
                    node_idx = len(nodes)
                    stack.append((h_level, node_idx))
                    
                    current_header = h_title
                    current_level = h_level
                    current_content_lines = []
                else:
                    current_content_lines.append(line)
                    
            # Flush final section
            if current_content_lines or current_header:
                sec_text = chr(10).join(current_content_lines).strip()
                nodes.append({
                    "id": len(nodes),
                    "title": current_header,
                    "level": current_level,
                    "word_count": len(sec_text.split()) if sec_text else 0,
                    "character_length": len(sec_text),
                    "parent_id": stack[-1][1] if stack else None
                })
    
            total_nodes = len(nodes)
            max_depth = max([n["level"] for n in nodes], default=0)
            total_doc_words = sum([n["word_count"] for n in nodes])
            
            return {
                "total_sections": total_nodes,
                "max_header_depth": max_depth,
                "total_document_words": total_doc_words,
                "sections": nodes
            }
    
        def compute_lexical_token_budget_packing(
            self,
            chunks: List[Dict[str, Any]],
            max_context_budget_words: int = 800
        ) -> Dict[str, Any]:
            """
            Greedy first-fit bin-packing of document chunks into context windows,
            maximizing token utilization while maintaining sequential ordering.
            """
            if not chunks:
                return {
                    "total_windows": 0,
                    "budget_limit_words": max_context_budget_words,
                    "average_utilization_pct": 0.0,
                    "packed_windows": []
                }
    
            windows = []
            current_window_chunks = []
            current_window_words = 0
    
            for ch in chunks:
                ch_words = ch.get("word_count", len(ch.get("text", "").split()))
                
                if current_window_words + ch_words <= max_context_budget_words:
                    current_window_chunks.append(ch)
                    current_window_words += ch_words
                else:
                    if current_window_chunks:
                        windows.append({
                            "window_index": len(windows),
                            "chunk_count": len(current_window_chunks),
                            "allocated_words": current_window_words,
                            "utilization_pct": round((current_window_words / max_context_budget_words) * 100.0, 2),
                            "chunk_ids": [c.get("chunk_id", i) for i, c in enumerate(current_window_chunks)]
                        })
                    current_window_chunks = [ch]
                    current_window_words = ch_words
    
            if current_window_chunks:
                windows.append({
                    "window_index": len(windows),
                    "chunk_count": len(current_window_chunks),
                    "allocated_words": current_window_words,
                    "utilization_pct": round((current_window_words / max_context_budget_words) * 100.0, 2),
                    "chunk_ids": [c.get("chunk_id", i) for i, c in enumerate(current_window_chunks)]
                })
    
            avg_util = round(sum(w["utilization_pct"] for w in windows) / len(windows), 2) if windows else 0.0
    
            return {
                "total_windows": len(windows),
                "budget_limit_words": max_context_budget_words,
                "average_utilization_pct": avg_util,
                "packed_windows": windows
            }
    
  • example_usage.py1.3 KB5370400ac12cupstream ↗
    # -*- coding: utf-8 -*-
    from client import OpenClawGenParkDocProcessor
    
    proc = OpenClawGenParkDocProcessor()
    
    doc = """# Agentic Commerce Protocol
    Autonomous trading network built upon Model Context Protocol.
    
    ## Architecture
    The system employs decentralized smart contracts and off-chain state channels.
    Agents communicate via standardized JSON-RPC protocols.
    
    ### Security
    Zero-knowledge proofs verify execution state without revealing trade secrets.
    Multi-signature escrows lock collateral securely.
    """
    
    # 1. Markdown Hierarchy DAG
    dag = proc.parse_markdown_header_hierarchy_dag(doc)
    print(f"Hierarchy DAG: {dag['total_sections']} sections parsed (Max depth={dag['max_header_depth']})")
    for s in dag['sections']:
        print(f"  Level {s['level']}: {s['title']} ({s['word_count']} words)")
    
    # 2. Sliding Window Chunking
    chunks_res = proc.partition_document_by_sliding_window(doc, chunk_size_words=15, overlap_words=3)
    print(); print(f"Sliding Window: {chunks_res['total_chunks']} chunks generated (Overlap={chunks_res['overlap_retention_ratio']})")
    
    # 3. Context Budget Packing
    packing = proc.compute_lexical_token_budget_packing(chunks_res['chunks'], max_context_budget_words=25)
    print(); print(f"Token Budget Packing: {packing['total_windows']} windows (Avg Utilization: {packing['average_utilization_pct']}%)")
    
  • LICENSE1.0 KBbafb53b2fc92upstream ↗
    MIT License
    
    Copyright (c) 2026 AlphaPark Inc.
    
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    
    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.
    
  • mcp_server.py1.9 KB00e910ed45eeupstream ↗
    # -*- coding: utf-8 -*-
    """
    OpenClaw GenPark Doc Processor MCP Server
    FastMCP standard interface for recursive document chunking and hierarchy DAG synthesis.
    """
    
    import json
    from typing import Dict, Any, List
    from client import OpenClawGenParkDocProcessor
    
    try:
        from mcp.server.fastmcp import FastMCP
        mcp = FastMCP("openclaw-genpark-doc-processor")
    except ImportError:
        class MockFastMCP:
            def __init__(self, name):
                self.name = name
            def tool(self):
                def decorator(f):
                    return f
                return decorator
        mcp = MockFastMCP("openclaw-genpark-doc-processor")
    
    processor = OpenClawGenParkDocProcessor()
    
    @mcp.tool()
    def partition_document_by_sliding_window(
        text: str,
        chunk_size_words: int = 200,
        overlap_words: int = 40
    ) -> str:
        """
        Partitions text into overlapping sliding-window chunks with SHA-256 fingerprints.
        """
        res = processor.partition_document_by_sliding_window(text, chunk_size_words, overlap_words)
        return json.dumps(res, indent=2)
    
    @mcp.tool()
    def parse_markdown_header_hierarchy_dag(markdown_text: str) -> str:
        """
        Parses Markdown text into a directed hierarchical DAG of sections (H1 -> H2 -> H3).
        """
        res = processor.parse_markdown_header_hierarchy_dag(markdown_text)
        return json.dumps(res, indent=2)
    
    @mcp.tool()
    def compute_lexical_token_budget_packing(
        chunks: List[Dict[str, Any]],
        max_context_budget_words: int = 800
    ) -> str:
        """
        Greedy first-fit bin-packing of document chunks into context windows.
        """
        res = processor.compute_lexical_token_budget_packing(chunks, max_context_budget_words)
        return json.dumps(res, indent=2)
    
    def main():
        sample = "# Header 1\nIntro text\n## Subheader\nDetailed specifications."
        print("Testing Doc Processor:")
        print(partition_document_by_sliding_window(sample, 10, 2))
    
    if __name__ == "__main__":
        main()
    
  • requirements.txt76 B0528add65f81upstream ↗
    # Zero external dependencies required -- Python 3.9+ standard library only\n
  • skill.json405 Bf81c4138ebafupstream ↗
    {
      "name": "openclaw-genpark-doc-processor",
      "version": "1.0.0",
      "description": "OpenClaw GenPark Doc Processor - Recursive boundary chunking, Markdown header hierarchy DAG synthesis, and lexical token-budget packing with zero external dependencies.",
      "tools": [
        "partition_document_by_sliding_window",
        "parse_markdown_header_hierarchy_dag",
        "compute_lexical_token_budget_packing"
      ]
    }

Plain-text copy, no login: /skill-bundles/alphaparkinc-openclaw-genpark-doc-processor.md

// REPO STATS

9 stars