How to Set Up the Chinese Patent Skill Tool: Complete Installation Guide

To set up the Chinese patent skill tool, clone the handsomestWei/patent-disclosure-skill repository into your Agent-Skills directory, install Python dependencies from requirements.txt, configure the Playwright browser, and optionally set up sub-skill-specific components for CNIPA crawling or OA embeddings.

The Chinese Patent Skill (patent-disclosure-skill) is an Agent-Skills-compatible package that bundles independent sub-skills for Chinese patent drafting, disclosure generation, docket handling, and examination workflows. This guide covers the complete setup process based on the actual source code structure found in the repository.

Prerequisites

Before installing the tool, ensure your environment meets these requirements:

  • Python 3.9+ installed system-wide
  • Git for cloning the repository
  • A compatible browser (Chrome, Edge, or Chromium) for web automation features
  • Approximately 500MB of disk space for dependencies and browser binaries

Step 1: Clone the Repository into an Agent-Skills Location

The repository must reside in a location where your AI agent can discover it. Choose one of two canonical locations:

Option A: Global skill directory (recommended)

mkdir -p ~/.cursor/skills
git clone https://github.com/handsomestWei/patent-disclosure-skill ~/.cursor/skills/patent-disclosure-skill

Option B: Project-local skill directory

mkdir -p ./.cursor/skills
git clone https://github.com/handsomestWei/patent-disclosure-skill ./.cursor/skills/patent-disclosure-skill

After cloning, verify that the root directory contains SKILL.md. This manifest file defines the skill name and enables discovery by Agent-Skills-compatible interfaces like Claude or Cursor.

Step 2: Install Core Python Dependencies

Navigate to the repository root and install the base requirements:

cd patent-disclosure-skill
pip install -r requirements.txt

This installs common libraries used across all sub-skills, including python-docx, playwright, and latex2mathml. According to the source code, these dependencies support document generation and browser automation features found in skills/patent-disclosure/tools/.

Step 3: Prepare the Playwright Browser

The tool requires a Chromium-based browser for rendering diagrams and crawling patent databases. First, probe for existing browser installations:

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

If the probe reports ok=false or no compatible browser is found, install the bundled Chromium:

python -m playwright install chromium

Successful probe output displays ok=true, confirming that browser.py can wrap Playwright operations for patent workflows.

Step 4: Install Sub-Skill-Specific Extras (Optional)

Depending on which patent workflows you intend to use, install additional dependencies for specific sub-skills:

CNIPA crawling (required for patent-search and disclosure novelty checks):

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

Obsidian integration (for patent-reader knowledge-base features):

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

OA examination assistance (for patent-oa embedding capabilities):

pip install -r skills/patent-oa/tools/requirements-oa.txt
export ZHIPUAI_API_KEY=YOUR_KEY
python skills/patent-oa/tools/config.py set --preset zhipu

These optional components enable specific capabilities like querying the China National Intellectual Property Administration database or generating examination answer embeddings.

Step 5: Verify the Installation

Confirm your setup by running a test command from any sub-skill. For example, test the disclosure skill's diagram rendering:

python skills/patent-disclosure/tools/mermaid_render.py --input demo.mmd --output demo.png

Successful execution indicates that Playwright and the Python environment are properly configured. You can also test the CNIPA search functionality:

python skills/patent-search/tools/cnipa_search.py \
    --inventor "张三" \
    --applicant "某公司" \
    --type utility_model \
    --max-pages 5

Results appear in outputs/patent-search/SEARCH-*.md if the installation is correct.

Step 6: Configure Environment Variables

Set optional environment variables to customize behavior without modifying source code:

  • PATENT_SKILL_SKIP_LINEART=1 — Disables automatic line-art generation in disclosure drafts
  • PATENT_READER_OBSIDIAN_VAULT — Absolute path to your Obsidian vault for the reader sub-skill
  • PATENT_OA_HOME — Overrides the default location for OA case storage

Add these to your shell profile or project .env file as needed.

Step 7: Start Using the Skill

Once configured, invoke the skill through any Agent-Skills-compatible interface. The root-level SKILL.md serves as the entry point. Trigger specific workflows using these keywords:

  • "交底书" — Launches the patent-disclosure workflow for drafting invention disclosures
  • "申请文件" — Runs the patent-application workflow for generating application documents
  • "著录检索" — Executes the patent-search workflow for bibliographic searches

Each trigger activates the corresponding prompt chain defined under skills/*/prompts/, utilizing the tools installed in skills/*/tools/.

Summary

  • Clone the handsomestWei/patent-disclosure-skill repository into ~/.cursor/skills/ or your project-local .cursor/skills/ directory
  • Install core dependencies via requirements.txt and verify Python 3.9+ compatibility
  • Configure the Playwright browser using browser.py --probe and install Chromium if needed
  • Extend functionality with optional requirements for CNIPA crawling, Obsidian integration, or OA embeddings
  • Verify installation by running test commands like mermaid_render.py or cnipa_search.py
  • Invoke the skill using Chinese trigger keywords that map to specific sub-skill workflows

Frequently Asked Questions

Where should I clone the patent-disclosure-skill repository?

Clone the repository into either ~/.cursor/skills/patent-disclosure-skill for global access across projects, or ./.cursor/skills/patent-disclosure-skill for project-local use. The parent directory must contain the root SKILL.md file so Agent-Skills interfaces can discover and load the tool.

What Python version is required to set up the Chinese patent skill tool?

The tool requires Python 3.9 or higher. This requirement ensures compatibility with the playwright and python-docx libraries used across sub-skills for browser automation and document generation.

How do I fix browser errors when running the patent disclosure skill?

Run python skills/patent-disclosure/tools/browser.py --probe to check for Chrome or Edge installations. If the probe fails, execute python -m playwright install chromium to download a compatible browser binary that the tool's Browser class can wrap.

Can I use only specific sub-skills without installing all dependencies?

Yes. While requirements.txt provides core functionality, each sub-skill in skills/*/tools/ may have specific requirement files (e.g., requirements-cnipa.txt for search, requirements-oa.txt for examination assistance). Install only the extras corresponding to the workflows you need.

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 →