Rules for Drafting Claims in Patent-Disclosure-Skill: 8 Enforced Guidelines
The patent-disclosure-skill enforces eight strict rules for drafting claims, requiring one claim per JSON node, mandatory preamble and technical features fields, automatic legal referencing for dependents, and automated auditing before export.
Drafting patent claims requires precision and consistency. The handsomestWei/patent-disclosure-skill repository implements a programmatic approach to claim drafting through a structured JSON-based claim tree system. These rules for drafting claims are hard-coded into the Python utilities, ensuring every claim meets legal and technical standards before export to Markdown or Word documents.
Structural Requirements for Claim Drafting
The foundation of the system rests on a hierarchical tree structure that strict enforces separation between independent and dependent claims while preventing duplication.
One Claim Per JSON Node
The system stores claims as a hierarchical "claim tree" where each node represents a single, distinct claim. In skills/patent-reader/tools/vault/write_patent_obsidian_note.py, the normalize_claim_tree function processes raw input and builds a normalized tree structure. This ensures that every claim occupies exactly one node in the JSON tree before rendering to the vault.
Independent vs. Dependent Claim Hierarchy
Independent claims function as root nodes, while dependent claims attach as children to their parent claims. The claim_tree_to_mermaid function in skills/patent-reader/tools/vault/obsidian.py traverses these roots and nodes to generate Mermaid diagrams that visually separate independent claims from their dependent counterparts. When a claim includes a parent field referencing another claim number, the system automatically recognizes it as dependent.
Deduplication and Unique Identifiers
Duplicate claim numbers are prohibited. The claim_deltas_from_tree utility in skills/patent-reader/tools/vault/obsidian.py checks for duplicate claim keys during processing. Additionally, the merge_claim_summaries function ensures each claim appears exactly once in the final markdown output, preventing accidental redundancies in the patent draft.
Content and Formatting Standards
Every claim must contain specific fields and follow standardized legal formatting, enforced through schema validation and rendering logic.
Mandatory Preamble and Technical Features
The claim-tree schema requires two critical fields: a preamble field (the introductory portion) and a features list (the technical specifics). The rendering pipeline in skills/patent-reader/tools/vault/write_patent_obsidian_note.py, specifically the render_claim_tree_markdown function, concatenates these components into a single claim sentence. The preamble introduces the invention, while the features list details the novel technical elements.
Automatic Legal Referencing for Dependents
When rendering dependent claims, the system automatically prefixes them with the legal reference "根据权利要求 X" (according to claim X). This occurs in render_claim_tree_markdown within write_patent_obsidian_note.py, which detects the parent relationship and inserts the proper Chinese legal language, ensuring compliance with patent formatting standards without manual intervention.
Schema Enforcement for Consistent Terminology
All claim-related utilities read from and write to a canonical JSON schema defined in skills/patent-reader/tools/vault/schema_vault.py. This schema enforces consistent field names including claim, preamble, features, and delta, preventing vocabulary mixing across different modules and ensuring interoperability between the reading, auditing, and export tools.
Validation and Quality Assurance
Before claims reach the export stage, they undergo automated validation to catch structural and syntactic errors.
Automated Claim Auditing
The audit_claims function in skills/patent-application/tools/audit_claims.py performs comprehensive validation checks on each claim. It verifies claim length, screens for forbidden characters, and confirms the presence of required elements (both preamble and features). If a claim violates any rule, the auditor raises an error and lists specific violations, blocking export until resolved.
Export and Documentation
Once validated, claims move through the final output pipeline that preserves formatting across document types.
Markdown and Word Document Generation
The skill outputs claims as a Markdown file (draft.md) through the rendering pipeline. For Word document generation, skills/patent-disclosure/tools/md_to_docx.py processes the markdown while preserving the critical formatting rule: one claim per paragraph. This conversion maintains the hierarchical structure and legal formatting established during the drafting phase.
Working with the Claim Tree Programmatically
The following example demonstrates building a claim tree that satisfies all eight rules:
from tools.patent_reader.vault.write_patent_obsidian_note import (
normalize_claim_tree,
render_claim_tree_markdown,
)
# Define a claim tree with one independent and one dependent claim
raw_tree = {
"roots": [1],
"nodes": [
{
"claim": 1,
"preamble": "一种用于电动汽车的动力系统",
"features": ["包括电池组", "以及控制单元"]
},
{
"claim": 2,
"parent": 1,
"features": ["其中所述电池组为锂离子电池"]
},
],
}
# Normalize and render
claim_tree = normalize_claim_tree(raw_tree)
markdown = render_claim_tree_markdown(claim_tree, pub=False)
print(markdown)
This produces legally formatted markdown output:
1. 一种用于电动汽车的动力系统,包括电池组,以及控制单元。
2. 根据权利要求 1,其中所述电池组为锂离子电池。
To validate the tree against drafting rules before export, run the audit tool:
python skills/patent-application/tools/audit_claims.py --claim-tree claim_tree.json
# Output: "All claims pass audit" or a list of specific violations
Summary
The patent-disclosure-skill implements a rigorous, code-enforced framework for patent claim drafting:
- One claim per node: Each JSON node represents exactly one claim via
normalize_claim_tree - Hierarchical structure: Independent claims are roots; dependent claims are children with
parentreferences - Mandatory fields: Every claim requires a
preambleandfeatureslist - Legal formatting: Dependent claims automatically receive "根据权利要求 X" prefixes
- Schema consistency:
schema_vault.pyenforces uniform field names across all utilities - Deduplication:
claim_deltas_from_treeprevents duplicate claim numbers - Automated validation:
audit_claims.pychecks length, characters, and required elements - Multi-format export:
md_to_docx.pypreserves formatting when converting to Word documents
Frequently Asked Questions
How does the claim tree structure work in patent-disclosure-skill?
The claim tree consists of a roots array containing claim numbers of independent claims and a nodes array containing claim objects. Each node includes a claim number, optional parent reference for dependents, a preamble string, and a features list. The normalize_claim_tree function in write_patent_obsidian_note.py validates this structure before rendering.
What validation does audit_claims.py perform?
The audit_claims function in skills/patent-application/tools/audit_claims.py validates that each claim contains both a preamble and features, checks for forbidden characters that could corrupt patent documents, verifies claim lengths are within acceptable bounds, and ensures no duplicate claim numbers exist in the tree.
How does the system handle dependent claims differently from independent claims?
In the JSON structure, independent claims appear in the roots array and omit the parent field. Dependent claims include a parent field referencing their parent claim number. During rendering in render_claim_tree_markdown, dependent claims automatically receive the "根据权利要求 X" prefix, while independent claims stand alone. The claim_tree_to_mermaid function visualizes this relationship by placing dependent claims as child nodes in the diagram.
Can I export the drafted claims to formats other than Markdown?
Yes. While the primary output is Markdown (draft.md), the skills/patent-disclosure/tools/md_to_docx.py utility converts the final markdown to Word document format. This conversion specifically preserves the one-claim-per-paragraph rule and maintains the hierarchical formatting established during the drafting phase, ensuring the Word document matches the validated markdown structure.
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 →