# Requirements for Generating Patent Application Documents with the Patent-Application Skill

> Learn the requirements for generating patent application documents with the patent application skill. Discover the necessary artifacts and patent types for successful document creation.

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

---

**To generate patent application documents with the patent-application skill, you must explicitly invoke the skill by name, provide a disclosure directory containing three mandatory artifacts (交底书, schema file, and line drawings), and select the patent type (invention, utility model, or design).**

The patent-application skill in the `handsomestWei/patent-disclosure-skill` repository transforms prepared technical disclosures into complete patent-application packages, including claims, specifications, abstracts, and drawings. Understanding the strict requirements encoded in [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) and enforced by the validation tools ensures successful document generation without runtime failures.

## Prerequisites and Pre-Conditions

The skill enforces a rigorous set of pre-conditions before entering the document generation pipeline. These requirements are defined in [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) and validated by [`tools/material_gate.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/material_gate.py).

### Mandatory Artifact Requirements

The disclosure directory must contain three specific files. The skill cannot fabricate missing data and aborts with **exit code 2** if any are absent, prompting you to run the *patent-disclosure* skill first:

- **Disclosure document** (`交底书.md`) – The core technical disclosure content
- **Schema file** (`*.schema.yaml`) – Structured metadata defining the technical fields
- **Line-drawing(s)** (`line_drawings/`) – Black-and-white technical diagrams required for the application

According to the source code in [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) (lines 9-10), the material gate explicitly checks for these artifacts before proceeding.

### Explicit User Invocation and Patent Type Selection

You must **explicitly name** the skill during invocation (e.g., "申请文件" or "patent-application") to prevent accidental execution.

Additionally, you must specify the **patent type**, which determines the downstream pipeline:

- **Invention / Utility Model**: Triggers the full pipeline ([`claim_strategy.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/claim_strategy.md) → [`claims_builder.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/claims_builder.md) → [`figures.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/figures.md) → [`specification_builder.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/specification_builder.md))
- **Design**: Executes only [`design_application.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_application.md) for design-only applications

## Execution Workflow and Pipeline

The skill follows a deterministic workflow defined in [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md), ensuring reproducible outputs and proper error handling.

### Material Gate Validation

Before any document generation, the skill runs [`tools/material_gate.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/material_gate.py) to enforce isolation and verify inputs:

```bash
python skills/patent-application/tools/material_gate.py \
    --case-dir outputs/<case-id>

```

If validation fails, the script exits with **code 2**, requiring you to complete the disclosure phase first.

### Document Generation Pipeline

For invention and utility model patents, the skill orchestrates a multi-stage pipeline:

1. **Guardrails & Intake** – Processes [`prompts/guardrails.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/prompts/guardrails.md) → [`intake.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/intake.md)
2. **Iteration Handling** – If revising existing output, reads [`iteration_context.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/iteration_context.md) and creates a new timestamped folder
3. **Claim Strategy** – Executes [`claim_strategy.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/claim_strategy.md) → [`claims_builder.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/claims_builder.md)
4. **Figure Processing** – Runs [`figures.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/figures.md) and [`numeral_register.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/numeral_register.md)
5. **Specification Building** – Generates technical content via [`specification_builder.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/specification_builder.md)
6. **Consistency Checks** – Validates cross-references through [`consistency.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/consistency.md)
7. **Design Pipeline** – For design patents, only [`design_application.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_application.md) executes

### Output Structure and Versioning

Results are written to immutable, timestamped directories to prevent overwrites and maintain audit trails:

```

outputs/patent-application/{case-id}_{timestamp}/

```

As implemented in [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) (lines 15-16, 21-22), each run generates a new folder rather than modifying existing outputs, supporting proper versioning.

## Command Examples for Generating Patent Documents

Below are practical commands that satisfy all requirements for generating complete patent application packages.

### Validate Disclosure Directory Structure

Ensure your disclosure directory contains the required artifacts before invocation:

```bash
tree outputs/案件A

# Expected layout:

# ├─ 交底书.md

# ├─ schema.yaml

# └─ line_drawings/

#     └─ fig1.png

```

### Run Material Gate Validation

Verify all prerequisites are met before generating documents:

```bash
python skills/patent-application/tools/material_gate.py \
    --case-dir outputs/案件A

# Exit code 0 → all artifacts present

# Exit code 2 → missing required files → run patent-disclosure first

```

### Generate Full Application Package (Invention)

Execute the complete pipeline and emit the Word document:

```bash
python skills/patent-application/tools/emit_application_docx.py \
    --dir outputs/patent-application/案件A_$(date +%Y%m%d%H%M%S)

```

This command orchestrates the full workflow, performs consistency checks, renders the `.docx` file, and produces `问题清单.md` (problem list) if ambiguities arise.

### Generate Design Application Only

For design patents, the skill internally invokes the design-specific pipeline:

```bash
python skills/patent-application/tools/design_application.py \
    --case-dir outputs/案件B

```

## Summary

- **Three mandatory artifacts** (交底书, schema, line drawings) must exist in the disclosure directory, or the skill exits with code 2.
- **Explicit invocation** by skill name and patent type selection are required to trigger the appropriate pipeline.
- **Material gate validation** ([`tools/material_gate.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/material_gate.py)) enforces pre-conditions before document generation begins.
- **Timestamped output folders** ensure immutable, versioned results in `outputs/patent-application/`.
- **Problem list generation** (`问题清单.md`) captures content ambiguities without blocking the main workflow.

## Frequently Asked Questions

### What happens if the disclosure directory is missing required files?

The skill aborts immediately. [`tools/material_gate.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/material_gate.py) checks for the presence of `交底书.md`, [`schema.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/schema.yaml), and line drawings, exiting with **code 2** if any are missing. You must run the patent-disclosure skill first to generate these prerequisite artifacts.

### Can I overwrite an existing patent application output?

No. According to [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) lines 15-16, the skill enforces immutability by creating a new timestamped folder for each run. If you are revising an existing application, the skill reads [`iteration_context.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/iteration_context.md) and generates a fresh output directory rather than overwriting previous results.

### What is the difference between invention and design patent generation workflows?

Invention and utility model patents trigger a comprehensive pipeline ([`claim_strategy.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/claim_strategy.md) → [`claims_builder.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/claims_builder.md) → [`figures.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/figures.md) → [`specification_builder.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/specification_builder.md) → [`numeral_register.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/numeral_register.md) → [`consistency.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/consistency.md)), while design patents execute only [`design_application.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_application.md). The patent type selection in [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) (lines 17-18) determines which sub-pipeline runs.

### Where are content issues or ambiguities recorded during generation?

Any content-level disputes are recorded in `问题清单.md` within the output directory. As specified in [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) (lines 10-11), the skill surfaces the path to this problem list along with a short summary at the end of the dialogue, allowing you to address issues without interrupting document generation.