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

> Discover the requirements for running the patent-disclosure-skill. Learn about Python 3.9+, pip, dependencies, and browser setup in this complete guide.

- Repository: [handsomestWei/patent-disclosure-skill](https://github.com/handsomestWei/patent-disclosure-skill)
- Tags: getting-started
- Published: 2026-09-04

---

**Running the patent-disclosure-skill requires Python 3.9+, pip, dependencies from [`requirements.txt`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/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`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/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`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/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:

```bash
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`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/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:

```bash
python -m playwright install chromium

```

Verify the installation using the probe command:

```bash
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`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/cnipa_epub_search.py) or the full-record [`cnipa_search.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/cnipa_search.py), install additional packages:

```bash
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`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/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:

```bash
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`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/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:

```bash
export PATENT_READER_OBSIDIAN_VAULT=/path/to/vault

```

Verify configuration using:

```bash
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**:

```bash
pip install -r requirements.txt

```

4. **Verify browser availability**:

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

```

5. **(Optional) Install CNIPA crawling deps** if performing prior-art searches:

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

```

6. **(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`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/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`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/requirements-cnipa.txt) for crawling, [`requirements-oa.txt`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/requirements-oa.txt) for Office Actions, and [`cad_venv.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/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`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/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`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/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`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/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`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/mermaid_render.py) and [`browser.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/browser.py) for document generation tasks.