python-docx-style-id-mismatch

Community

Fix Word styles in python-docx

Authorhubeiqiao
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill resolves issues where paragraphs in Word documents created with python-docx's OxmlElement API incorrectly default to the "Normal" style, even when a specific style like "Heading 2" is set. It also addresses the loss of section breaks during paragraph removal.

Core Features & Use Cases

  • Correct Style Application: Ensures paragraphs created via OxmlElement use the intended styles by mapping display names to their correct XML IDs.
  • Preserve Section Breaks: Prevents the accidental deletion of section breaks when removing paragraphs.
  • Use Case: When programmatically generating reports or documents with python-docx, this Skill guarantees that headings and other styled text appear correctly, and that document structure (like page numbering restarts) is maintained.

Quick Start

Use the python-docx-style-id-mismatch skill to fix style ID issues when creating a 'Heading 2' paragraph with OxmlElement.

Dependency Matrix

Required Modules

None required

Components

scripts

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: python-docx-style-id-mismatch
Download link: https://github.com/hubeiqiao/skills/archive/main.zip#python-docx-style-id-mismatch

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.