Skip to content
Back to skills

Docx Editor Zotero

ASecurity

Edit Word (.docx) documents — delete/reorder paragraphs, bulk text replacement — while preserving 100% of Zotero field codes, citations, and bibliography references. Use whenever a .docx to be edited contains Zotero citations, since normal paragraph deletion/reordering silently orphans or corrupts citation fields.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 15, 2026
developmentpython

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned October 15, 2026

npx -y skills add raktim-mondol/hermes-plugin-researchcraft --skill docx-editor-zotero --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docx Editor Zotero?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docx Editor Zotero
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/raktim-mondol-docx-editor-zotero/badge)](https://www.skillsdirectory.com/skills/raktim-mondol-docx-editor-zotero)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: docx-editor-zotero
description: Edit Word (.docx) documents — delete/reorder paragraphs, bulk text replacement — while preserving 100% of Zotero field codes, citations, and bibliography references. Use whenever a .docx to be edited contains Zotero citations, since normal paragraph deletion/reordering silently orphans or corrupts citation fields.
license: MIT
metadata:
  version: "1.0"
  skill-author: K-Dense Inc.
---

# docx-editor-zotero

## Overview

Editing a Word document that contains Zotero citations with ordinary XML
surgery (or by hand) easily orphans citation field codes or breaks the
bibliography. This skill wraps `python-docx`-level `.docx` edits — deleting
paragraphs, reordering paragraphs, bulk text replacement — with citation
tracking so every Zotero field code, in-text citation, and bibliography entry
survives the edit, and produces a JSON audit log of exactly what changed.

Zero external dependencies — pure Python 3.10+ standard library
(`xml.etree.ElementTree`, `zipfile`, `json`). Run it with `uv run python`
per this plugin's Python convention; no `uv add` needed.

## When to use this skill

Reach for this instead of hand-editing `.docx` XML or reaching for
`python-docx` directly whenever the document being edited has Zotero
citations and the task is: removing sections/paragraphs, reordering them, or
bulk text replacement (e.g. terminology changes across a manuscript) — not
for documents without Zotero fields, where the `docx` skill's normal tooling
is sufficient.

## Basic workflow

1. Load the input `.docx` with `WordEditor` (`scripts/word_editor.py`).
2. It extracts every Zotero citation and its position before any edit.
3. Apply structural modifications in this order: delete → reorder → replace.
4. It recalculates endnote/citation IDs and flags orphaned citations.
5. Validate document integrity, then save the edited `.docx` plus a
   `*_log.json` audit trail (timestamps, paragraphs deleted, citations
   orphaned/preserved, text replacements, validation results).

```python
from word_editor import WordEditor

editor = WordEditor("input.docx")
editor.delete_paragraphs([1, 3, 5])
editor.move_paragraph(2, 0)
editor.replace_text("HSG", "Tkk")
editor.save("output.docx")
```

Run it from inside `scripts/` (or add that directory to `sys.path`) since
`word_editor.py` imports `zotero_docx_preserver.py` as a sibling module —
both ship together in `scripts/`.

## Notes

- After editing, the user may need to refresh Zotero fields in Word via the
  Zotero menu (Word doesn't always auto-refresh field display after an
  out-of-band XML edit).
- Handles documents containing tables and complex nested elements.
- The original file is never modified in place — always writes a new output
  path, so edits are trivially reversible.
- See `references/EXAMPLES.md` for worked examples of each operation
  (delete, reorder, replace, and combinations) with expected output.

Files in this skill

  • SKILL.md2.9 KB
  • references/EXAMPLES.md8.3 KB
  • scripts/word_editor.py10.8 KB
  • scripts/zotero_docx_preserver.py20.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.