# How to Integrate with Obsidian for Patent Analysis: A Complete Guide to the Patent-Disclosure-Skill

> Integrate Obsidian for patent analysis with Patent-Disclosure-Skill. Automate note writing, create linked knowledge bases, and visualize patent data with Canvas and graph views.

- Repository: [handsomestWei/patent-disclosure-skill](https://github.com/handsomestWei/patent-disclosure-skill)
- Tags: how-to-guide
- Published: 2026-09-08

---

**The Patent-Disclosure-Skill automatically writes patent-reading notes directly into your Obsidian vault, transforming raw patent documents into a linked knowledge base with Canvas visualizations and color-coded graph views.**

The **Patent-Disclosure-Skill** streamlines patent analysis by generating structured markdown notes, claim trees, and interactive diagrams inside an Obsidian vault. This integration turns complex patent data into a searchable, interconnected knowledge base without manual copying or formatting. By leveraging functions in [`shared/common.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/shared/common.py) and [`vault/obsidian.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/vault/obsidian.py), the skill automates vault detection, bootstrapping, and note enrichment.

## How the Integration Architecture Works

The integration relies on a three-stage pipeline that moves from configuration detection to visual output generation.

### Vault Detection and Path Resolution

The skill locates your Obsidian vault using `resolve_obsidian_vault` defined in [`skills/patent-reader/tools/shared/common.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-reader/tools/shared/common.py). This function checks two locations in order of priority:

- The environment variable `PATENT_READER_OBSIDIAN_VAULT`
- The persistent configuration file at `~/.patent-disclosure-skill/obsidian_vault.txt`

If neither is set, the skill prompts for configuration during the first run.

### Automated Vault Bootstrapping

When writing the first note, the `bootstrap_vault` function in [`skills/patent-reader/tools/vault/obsidian.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-reader/tools/vault/obsidian.py) automatically creates required Obsidian infrastructure:

- `.obsidian/snippets/` for custom CSS
- [`.obsidian/core-plugins.json`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/.obsidian/core-plugins.json) for feature flags
- [`.obsidian/graph.json`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/.obsidian/graph.json) for color-group definitions
- Template files copied from `assets/obsidian/*.base.yaml`

This eliminates manual setup of folder structures or configuration files.

### Note Generation and Canvas Creation

The [`write_patent_obsidian_note.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/write_patent_obsidian_note.py) script serves as the primary entry point for converting patent data into Obsidian-compatible markdown. This script:

1. Sanitizes LLM-generated markdown content
2. Enriches frontmatter with patent metadata and claim-summary tables
3. Writes files to `Research/Patents/<publication_number>/`
4. Updates the global index at `_专利解读索引.md`

Simultaneously, the script invokes `build_canvas` and `claim_tree_to_mermaid` from [`obsidian.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/obsidian.py) to generate:

- A Canvas file (`<pub>_图谱.canvas`) showing claim relationships
- Mermaid diagrams embedded within notes for visual claim hierarchies

### CLI Property Assignment

For users with the Obsidian CLI installed, `try_obsidian_cli_property` assigns custom properties (e.g., "patent", "evidence") that enable advanced filtering and querying through plugins like Dataview.

## Configuring Your Obsidian Vault Path

Before running patent analyses, you must specify where the skill should write files.

### Method 1: Environment Variable (Temporary)

Set the vault path for the current session:

```powershell
$env:PATENT_READER_OBSIDIAN_VAULT = "C:\Users\<username>\Documents\ObsidianVault"

```

### Method 2: Persistent Configuration (Recommended)

Use the provided helper script to store the path permanently:

```powershell
python skills/patent-reader/tools/vault/check_obsidian_env.py --set "C:\Users\<username>\Documents\ObsidianVault" --setx

```

The `--setx` flag writes to the system environment variables, while `--set` updates the configuration file. You can verify detection by running the script without arguments to check `OBSIDIAN_INSTALLED` status.

## Running Patent Analysis and Generating Notes

Once configured, execute a patent-reading skill to automatically populate your vault:

```bash
python -m skills.patent-reader.run --pdf path/to/patent.pdf

```

This command triggers the following sequence:

1. Parses the PDF into claim trees, figures, and metadata
2. Calls [`write_patent_obsidian_note.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/write_patent_obsidian_note.py) with the extracted data
3. Creates the note at `Research/Patents/<pub>/20231111234567_解读_主稿.md`
4. Generates the corresponding Canvas file
5. Updates the master index

After execution, press **Ctrl+R** in Obsidian to reload the vault and render new notes, tags, and graph nodes.

### Manual Note Generation (Advanced)

For custom workflows, invoke the writer directly:

```bash
python skills/patent-reader/tools/vault/write_patent_obsidian_note.py \
  --content-file note.md \
  --manifest manifest.json \
  --lint-json lint.json \
  --workdir outputs/patent_reader/RUN \
  --include-review

```

## Enhancing Visualization with Community Plugins

While the core integration functions without additional software, these community plugins enhance the patent analysis experience:

- **Dataview**: Enables dynamic tables and queries against the index page using the custom properties set by `try_obsidian_cli_property`
- **Colored Tags**: Provides visual color groups for tag-based graph nodes defined in [`graph.json`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/graph.json)
- **Colored Bases Properties**: Renders property pills with distinct colors for patent classifications
- **Iconize**: Adds sidebar icons for faster navigation between patent notes
- **Supercharged Links**: Highlights links based on patent attributes

Install these through Obsidian's Settings → Community plugins. The skill does not auto-install plugins for security and stability reasons.

## Troubleshooting Common Integration Issues

| Symptom | Likely Cause | Solution |
|---------|--------------|----------|
| Notes appear grey without color coding | Vault not reloaded after initial write | Press **Ctrl+R** in Obsidian to refresh the graph view |
| [`check_obsidian_env.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/check_obsidian_env.py) reports "OBSIDIAN_INSTALLED: False" | Obsidian CLI not on system PATH | Add Obsidian's installation directory to PATH or use `--auto-accept` flag |
| No `Research/Patents/` folder created | Vault path misconfiguration | Verify `PATENT_READER_OBSIDIAN_VAULT` points to the vault root containing `.obsidian/` |
| Canvas files not rendering | Canvas core plugin disabled | Enable Canvas in Settings → Core plugins |
| Missing claim diagrams | Mermaid plugin conflicts | Ensure Graph view is enabled and reload the vault |

## Summary

- The Patent-Disclosure-Skill integrates with Obsidian through `resolve_obsidian_vault` and automated bootstrapping in [`vault/obsidian.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/vault/obsidian.py).
- Configure your vault path via `PATENT_READER_OBSIDIAN_VAULT` or [`check_obsidian_env.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/check_obsidian_env.py) before running analyses.
- Notes generate automatically in `Research/Patents/<pub>/` with enriched frontmatter, Canvas files, and Mermaid diagrams.
- Reload the vault (**Ctrl+R**) after each analysis to visualize new knowledge graph nodes and color-coding.
- Optional plugins like Dataview and Colored Tags enhance query capabilities and visual organization.

## Frequently Asked Questions

### How does the Patent-Disclosure-Skill locate my Obsidian vault?

The skill uses `resolve_obsidian_vault` from [`shared/common.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/shared/common.py) to check the `PATENT_READER_OBSIDIAN_VAULT` environment variable first, then falls back to `~/.patent-disclosure-skill/obsidian_vault.txt`. If neither exists, it prompts for the path during execution. Use `check_obsidian_env.py --set` to persist the location permanently.

### What files are created when analyzing a patent?

The skill generates a markdown note (e.g., `20231111234567_解读_主稿.md`) in `Research/Patents/<publication_number>/`, a Canvas file (`<pub>_图谱.canvas`) for visual claim mapping, and updates `_专利解读索引.md` in the vault root. The `bootstrap_vault` function also creates [`.obsidian/graph.json`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/.obsidian/graph.json) and CSS snippets during the first run.

### Can I integrate the skill with an existing Obsidian vault?

Yes. The `bootstrap_vault` function in [`obsidian.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/obsidian.py) safely merges required files into existing vaults without overwriting user data. It only creates missing configuration files in `.obsidian/` and template directories. Point `PATENT_READER_OBSIDIAN_VAULT` to your existing vault path and run the skill normally.

### Why are my patent notes not showing color-coded relationships?

Color coding requires the vault reload (**Ctrl+R**) after the first write to load [`graph.json`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/graph.json) group definitions. Additionally, ensure the **Colored Tags** plugin is installed if using community color schemes, or verify that Obsidian's built-in Graph view has "Color groups" enabled in the display settings.