# Application Document Workflow in the Patent Disclosure Skill: 6 Steps Explained

> Understand the application document workflow for patent disclosures. Explore 6 key steps from intake to final document emission in this comprehensive guide.

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

---

**The application document workflow follows six sequential stages—guardrails and intake, optional iteration, material validation, core content generation, design patent handling, and final document emission—to transform a raw invention disclosure into a complete Chinese patent filing package (四件套).**

The `handsomestWei/patent-disclosure-skill` repository automates patent preparation through a deterministic orchestration defined in [`skills/patent-application/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-application/SKILL.md). This application document workflow validates inputs, chains specialized prompts, and executes Python tools to generate claims, specifications, figures, and a formatted Word manuscript.

## Step-by-Step Breakdown of the Application Document Workflow

### Step 1: Guardrails and Intake

The workflow begins by loading safety constraints and collecting parameters. According to [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) lines 14–15, the system first reads [`prompts/guardrails.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/prompts/guardrails.md) to establish safety boundaries, then executes [`prompts/intake.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/prompts/intake.md) to capture the disclosure directory path and case metadata. This ensures all required context is present before processing begins.

### Step 2: Iteration Path for Existing Applications

If the user provides an existing application requiring updates (rather than a full rewrite), the workflow enters a short-circuit branch. The system reads [`prompts/iteration_context.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/prompts/iteration_context.md) followed by [`prompts/iteration.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/prompts/iteration.md), creates a new timestamped output folder under `outputs/patent-application/`, regenerates the Word document, and produces a fresh issue list (`问题清单.md`). **The workflow terminates here**; steps 3 through 5 are skipped entirely when this path is taken.

### Step 3: Material Gate Validation

Before content generation, the workflow executes [`tools/material_gate.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/material_gate.py) to verify that all source assets—such as technical drawings, CAD exports, and schema files—are present in the disclosure directory. If validation fails, the script exits with code **2**, aborting the entire workflow immediately. A zero exit code permits progression to content generation.

### Step 4: Core Content Generation for Invention and Utility Models

For standard invention patents (发明专利) and utility models, the workflow chains six sequential prompts to build the technical document:

1. **claim_strategy.md** – Establishes claim breadth and dependency strategy
2. **claims_builder.md** – Drafts independent and dependent claims
3. **figures.md** – Generates numbered technical drawings
4. **specification_builder.md** – Composes the detailed description
5. **numeral_register.md** – Registers reference numerals for figures
6. **consistency.md** – Validates internal consistency between claims and specification

This sequence ensures that claims, figures, and specification remain synchronized before final assembly.

### Step 5: Design Patent Branch

When processing design patents (外观设计), the workflow diverges after material validation. Instead of the six-step core chain, the system reads [`references/design_view_cnipa.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/references/design_view_cnipa.md) to load CNIPA figure requirements, then executes [`prompts/design_application.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/prompts/design_application.md). Notably, this branch **does not invoke** the figure composition scripts used for invention patents.

### Step 6: Emission of Word Document and Issue List

The final stage executes [`tools/emit_application_docx.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/emit_application_docx.py) to render the completed Markdown components into a formatted Word manuscript. Subsequently, the workflow reads [`prompts/issues.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/prompts/issues.md) to compile ambiguities or missing disclosures into `问题清单.md`. The script appends the issue list path and a brief summary to the final response, completing the four-piece deliverable stored under `outputs/patent-application/{case_id}_{timestamp}/`.

## Implementation Commands

Below are the command-line invocations that implement each stage of the application document workflow. These commands reference the Python tools located in `skills/patent-application/tools/`:

```bash

# Step 1: UTF-8 I/O enforcement (handled automatically during intake)

python -m skills.patent-application.tools.stdin_utf8

# Step 2: Optional iteration for existing cases

python skills/patent-application/tools/iteration_dialog_log.py \
    --case-dir outputs/patent-application/案_20231101091523

# Step 3: Material gate validation

python skills/patent-application/tools/material_gate.py \
    --case-dir outputs/patent-application/案_20231101091523

# Exit codes: 0 (continue) or 2 (abort)

# Step 4: Core content generation sequence

python skills/patent-application/tools/claims_builder.py
python skills/patent-application/tools/figures.py
python skills/patent-application/tools/specification_builder.py
python skills/patent-application/tools/numeral_register.py
python skills/patent-application/tools/consistency.py

# Step 5: Design patent processing (if applicable)

python skills/patent-application/tools/design_application.py

# Step 6: Final document emission and issue tracking

python skills/patent-application/tools/emit_application_docx.py \
    --dir outputs/patent-application/案_20231101091523

```

## Summary

- The workflow is defined in [`skills/patent-application/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-application/SKILL.md) and produces a **four-piece deliverable** (Word document, claims, specification, and figures) under timestamped directories.
- **Iteration mode** provides an early exit path for updating existing applications without regenerating core content.
- The **material gate** ([`tools/material_gate.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/material_gate.py)) enforces asset completeness with exit code 2 as a hard failure signal.
- Content generation follows a strict prompt chain: claim strategy → claims → figures → specification → numeral register → consistency check.
- **Design patents** bypass the core chain in favor of a specialized two-step prompt sequence.
- Final output is assembled by [`tools/emit_application_docx.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/emit_application_docx.py), which also generates the mandatory issue list (`问题清单.md`).

## Frequently Asked Questions

### What triggers the early exit in the application document workflow?

The iteration path triggers an early exit when updating an existing application. When the workflow detects a revision request (rather than new drafting), it executes [`iteration_context.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/iteration_context.md) and [`iteration.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/iteration.md), regenerates the Word document in a new timestamped folder, and stops before reaching the material gate or content generation stages.

### How does the material gate enforce requirements?

The material gate runs [`tools/material_gate.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/tools/material_gate.py) to inspect the disclosure directory for required assets. If any mandatory files—such as technical drawings or schema diagrams—are missing, the script exits with code **2**, immediately halting the workflow. A zero exit code confirms asset presence and permits progression to Step 4.

### What distinguishes the design patent branch from standard invention patents?

Design patents follow a simplified two-step sequence using [`references/design_view_cnipa.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/references/design_view_cnipa.md) and [`design_application.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_application.md), whereas invention patents execute a six-step prompt chain including claim strategy, claims building, figure generation, and specification drafting. The design branch specifically omits the figure composition scripts invoked for utility models.

### Where are the final deliverables stored?

The workflow deposits all outputs into `outputs/patent-application/{case_id}_{timestamp}/`, including the Word manuscript generated by [`emit_application_docx.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/emit_application_docx.py), the Markdown source files, and the `问题清单.md` issue list. This path structure ensures version control through timestamped subdirectories.