How to Integrate patent-disclosure-skill with Claude Code or Cursor: A Complete AgentSkills Setup Guide
You can integrate patent-disclosure-skill with Claude Code or Cursor by pointing the host to the repository root containing the SKILL.md manifest, which automatically exposes sub-skill slash commands for patent disclosure generation, search, and analysis.
The patent-disclosure-skill repository by handsomestWei implements a modular AgentSkills architecture that enables AI coding assistants to handle complex patent workflows. By leveraging manifest-based discovery through SKILL.md files, both Claude Code and Cursor can load this open-source toolkit to generate invention disclosures, search patent databases, and analyze office actions directly from chat interfaces. This guide covers the exact steps to configure your environment and invoke the five built-in patent capabilities without writing additional glue code.
Understanding the AgentSkills Architecture
The repository organizes functionality as independent AgentSkills that hosts discover through manifest files. This design ensures clean isolation between capabilities while providing a unified interface for Claude Code and Cursor.
Root Manifest and Routing
The [SKILL.md](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) file at the repository root serves as the primary entry point. It defines routing rules that forward requests to specific sub-skills based on the command issued. According to the manifest structure, no cross-package tool calls are permitted; each sub-skill operates with its own isolated Python environment under skills/*/tools/.
Sub-Skill Organization
The repository contains five functional areas, each with its own manifest:
- patent-disclosure: Generates invention disclosure documents via [
skills/patent-disclosure/SKILL.md](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/SKILL.md) - patent-search: Executes bibliographic searches via [
skills/patent-search/SKILL.md](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-search/SKILL.md) - patent-reader: Handles patent reading and note-taking via [
skills/patent-reader/SKILL.md](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-reader/SKILL.md) - patent-oa: Manages office-action responses via [
skills/patent-oa/SKILL.md](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-oa/SKILL.md) - patent-exam-policy: Generates examination policy briefs via [
skills/patent-exam-policy/SKILL.md](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-exam-policy/SKILL.md)
Each sub-skill directory contains a tools/ folder with standalone Python scripts. For example, the disclosure functionality resides in skills/patent-disclosure/tools/, ensuring that dependencies remain encapsulated per capability.
Prerequisites and Installation
Before configuring Claude Code or Cursor, prepare the local environment to support Python 3.9+ and the required automation libraries.
Clone the Repository
git clone https://github.com/handsomestWei/patent-disclosure-skill.git
cd patent-disclosure-skill
Install Python Dependencies
The [requirements.txt](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/requirements.txt) file lists required packages including Playwright for browser automation and pandas for data processing. Install these once per machine:
pip install -r requirements.txt
Verify that Playwright browsers are installed if you plan to use the search functionality that relies on skills/patent-search/tools/cnipa_crawler.py.
Configuring Claude Code for patent-disclosure-skill
Claude Code automatically discovers capabilities by reading SKILL.md manifests in designated skill directories.
Add the Local Skill
- Open the Skills panel in Claude Code.
- Click Add Local Skill.
- Select the repository root folder containing the root
SKILL.md.
Claude Code parses the manifest and exposes five slash commands:
/patent-disclosure-skillor/交底书for disclosure generation/patent-searchor/检索for patent searches/patent-readfor document analysis/patent-oafor office-action assistance/patent-exam-policyfor policy briefs
Execute Commands in Chat
Once loaded, invoke the skill directly in any Claude Code session:
/交底书 项目路径 /home/user/my_project
Claude parses the arguments, executes the underlying Python script at skills/patent_disclosure/tools/disclosure_cli.py, and streams the generated markdown disclosure back into the chat interface.
Configuring Cursor for patent-disclosure-skill
Cursor integrates the skill through its AgentSkill system, offering both UI buttons and programmatic access via Python notebooks.
Add the AgentSkill
- Open the Extensions view in Cursor.
- Choose Add Local AgentSkill.
- Navigate to the repository root folder.
Cursor generates Run buttons for each command defined in the sub-skill manifests. You can trigger capabilities by clicking the button next to 交底书 or other available actions.
Import from Python Notebooks
For scripted workflows inside Cursor, import the CLI modules directly:
from skills.patent_disclosure.tools import disclosure_cli
from pathlib import Path
project_dir = Path("/path/to/my_project")
disclosure_cli.main(["--project", str(project_dir)])
This approach bypasses the chat interface and executes the disclosure generation logic against the specified project directory, outputting results to the console.
Running Patent Workflows
After configuration, both hosts execute the Python toolchains located in skills/*/tools/ directories, writing all artifacts to an outputs/ folder in the current working directory.
Generating Invention Disclosures
In Claude Code:
/patent-disclosure-skill 项目路径 /path/to/project
In Cursor (Notebook):
import subprocess
from pathlib import Path
cmd = [
"python",
"-m",
"skills.patent_disclosure.tools.disclosure_cli",
"--project",
"/path/to/project"
]
result = subprocess.run(cmd, capture_output=True, text=True)
print(result.stdout) # Generated markdown disclosure
Executing Patent Searches
To search CNIPA databases for inventor "张三":
/patent-search 发明人 张三
This command triggers the skills/patent-search/tools/cnipa_crawler.py script, which uses Playwright to scrape bibliographic data and saves results to outputs/patent-search/.
Output Locations
All generated artifacts follow a consistent directory structure:
- Disclosure documents:
outputs/patent_reader/ - Search results:
outputs/patent-search/ - Analysis files: Subdirectories under
outputs/corresponding to the invoked skill
Environment Variables and Advanced Configuration
Certain sub-skills read environment variables to access external systems. The Obsidian reader in the patent-reader skill requires PATENT_READER_OBSIDIAN_VAULT to locate your vault path.
Define these in a .env file at the repository root:
PATENT_READER_OBSIDIAN_VAULT=/path/to/obsidian/vault
Export variables in your shell before launching Claude Code or Cursor to ensure the tools inherit the configuration.
Summary
- Clone the repository to a local directory accessible by your AI host.
- Install Python 3.9+ dependencies from
requirements.txt, including Playwright binaries. - Configure Claude Code via Add Local Skill or Cursor via Add Local AgentSkill, pointing both to the repository root containing
SKILL.md. - Invoke capabilities using slash commands (
/交底书,/patent-search) in chat or import Python modules directly in Cursor notebooks. - Locate outputs in the
outputs/directory, with subdirectories organized by skill name. - Set environment variables like
PATENT_READER_OBSIDIAN_VAULTin a root.envfile for external integrations.
Frequently Asked Questions
What Python version does patent-disclosure-skill require?
The repository requires Python 3.9 or higher, as specified in the dependency specifications and tool implementations. All scripts in skills/*/tools/ directories use modern Python features compatible with 3.9+ while maintaining compatibility with standard data science stacks including pandas and Playwright.
Can I use patent-disclosure-skill without Claude Code or Cursor?
Yes. The repository functions as a standalone CLI toolkit. Each sub-skill in skills/*/tools/ contains executable Python scripts that accept command-line arguments directly. For example, you can run python -m skills.patent_disclosure.tools.disclosure_cli --project /path/to/project from any terminal with the dependencies installed, bypassing the AgentSkills manifest system entirely.
Where are the generated patent documents saved?
All artifacts are written to an outputs/ directory created in the current working directory where the command executes. Specific subdirectories follow the pattern outputs/<skill-name>/, such as outputs/patent_reader/ or outputs/patent-search/, keeping deliverables organized by capability type.
How do I add custom environment variables for specific tools?
Create a .env file at the repository root and define variables there, or export them in your shell session before launching the host. The tools read standard environment variables; for instance, the Obsidian integration checks for PATENT_READER_OBSIDIAN_VAULT to determine the vault location. This configuration applies to both Claude Code and Cursor execution contexts.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →