Requirements for Running the Patent-Disclosure-Skill: Complete Setup Guide

Running the patent-disclosure-skill requires Python 3.9+, pip, dependencies from requirements.txt, and a Chromium-based browser (Chrome or Edge) with Playwright binaries installed.

The patent-disclosure-skill by handsomestWei is a Python-based Agent Skills package for automating patent disclosure drafting, prior-art searches, and Office Action responses. Before invoking capabilities like /交底书 or /patent-search, you must satisfy specific runtime requirements ranging from core Python dependencies to optional CAD and Obsidian integrations.

Core Runtime Requirements

Python 3.9 or Newer

All core logic, type hints, and command-line scripts in skills/patent-disclosure/ are written for Python 3.9+. Older versions lack syntax used throughout the codebase, as documented in INSTALL.md. The package will fail to import on Python 3.8 or earlier due to incompatible type-hint syntax.

Core Dependencies (requirements.txt)

The top-level requirements.txt pulls in critical runtime libraries:

  • python-docx for Word document generation
  • playwright for browser automation
  • latex2mathml for formula conversion
  • pymupdf for PDF handling

Install the core stack:

pip install -r requirements.txt

Browser and Rendering Dependencies

Chromium-Based Browser Requirement

The skill requires Google Chrome or Microsoft Edge for Playwright-driven operations. In skills/patent-disclosure/tools/browser.py, the Playwright wrapper drives the browser to render Mermaid diagrams, capture SVG/PNG line-art, and scrape the CNIPA EPUB site. Without a local browser, the skill outputs Markdown but fails at graphics generation and CNIPA crawling, as noted in the installation documentation.

Playwright Binaries Installation

After installing the Python package, you must install the browser binaries:

python -m playwright install chromium

Verify the installation using the probe command:

python skills/patent-disclosure/tools/browser.py --probe

Expected output includes "ok=true". If the probe returns false, the skill cannot generate visual diagrams or perform web scraping.

Optional Components and Advanced Features

CNIPA Crawling Dependencies

For prior-art searches using cnipa_epub_search.py or the full-record cnipa_search.py, install additional packages:

pip install -r skills/patent-disclosure/tools/crawl/requirements-cnipa.txt

This enables the lightweight prior-art search against the CNIPA EPUB database.

STEP and CAD Support

The "Step → views" pipeline for 3-D CAD models is disabled by default. To enable STEP parsing for multi-view generation, configure skills/patent-disclosure/tools/cad_venv.py and install CadQuery. This optional component is only required when explicitly requesting STEP file processing.

Office Action (OA) Embedding Dependencies

The "审查答复" workflow uses vector embeddings and requires separate dependencies:

pip install -r skills/patent-oa/tools/requirements-oa.txt

This supports Zhipu, DashScope, MiniMax, local models, or OpenAI for historical case indexing via skills/patent-oa/tools/ingest_case.py.

Obsidian Vault Integration

For "专利通俗解读" output to be stored in an Obsidian knowledge base with graph and canvas support, set the environment variable:

export PATENT_READER_OBSIDIAN_VAULT=/path/to/vault

Verify configuration using:

python skills/patent-reader/tools/vault/check_obsidian_env.py

Without this variable, the skill functions but loses the richer knowledge-graph experience.

Matplotlib for Formula Fallback

Matplotlib is used only when the native OMML conversion fails for complex LaTeX formulas in Word documents, serving as a PNG rendering fallback.

Installation Verification Workflow

Follow this sequence to validate your environment:

  1. Clone the repository into your Agent Skills layout (e.g., ~/.cursor/skills/patent-disclosure-skill)

  2. Create a virtual environment and activate it

  3. Install core dependencies:

pip install -r requirements.txt
  1. Verify browser availability:
python skills/patent-disclosure/tools/browser.py --probe
  1. (Optional) Install CNIPA crawling deps if performing prior-art searches:
pip install -r skills/patent-disclosure/tools/crawl/requirements-cnipa.txt
  1. (Optional) Configure Obsidian by setting PATENT_READER_OBSIDIAN_VAULT or running the check script

Summary

  • Python 3.9+ is mandatory for the patent-disclosure-skill's type-hinted codebase
  • Install core dependencies via requirements.txt including python-docx, playwright, and pymupdf
  • Chrome or Edge browser is required for Mermaid rendering and CNIPA crawling
  • Verify Playwright setup with python skills/patent-disclosure/tools/browser.py --probe
  • Optional features require additional configuration: requirements-cnipa.txt for crawling, requirements-oa.txt for Office Actions, and cad_venv.py for CAD support

Frequently Asked Questions

Can I run the patent-disclosure-skill without a browser installed?

Yes, but with limited functionality. Without Chrome or Edge, the skill generates Markdown disclosure documents but cannot render Mermaid diagrams as images or crawl CNIPA data. Graphics generation will fail silently, and the CNIPA EPUB search will error out. Run python skills/patent-disclosure/tools/browser.py --probe to verify your current status.

What Python version is strictly required?

Python 3.9 or newer is required. The codebase uses syntax and type hints incompatible with Python 3.8 and earlier, as defined in INSTALL.md and implemented across skills/patent-disclosure/tools/. Attempting to run on older versions will raise syntax errors during import.

How do I enable the CAD model visualization feature?

The STEP/CAD support is disabled by default to minimize dependency weight. To enable 3-D model parsing, install CadQuery and configure skills/patent-disclosure/tools/cad_venv.py. This optional component is only needed when processing .step files for multi-view generation in utility model disclosures.

Which file contains the core command definitions for the Agent?

The SKILL.md file at the repository root defines the natural-language commands (/交底书, /patent-search, /审查答复) that invoke scripts in skills/patent-disclosure/tools/. It serves as the Agent Skills entry point mapping user intents to Python tool executions, referencing mermaid_render.py and browser.py for document generation tasks.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →