word-zotero-track-changes
Use when editing an existing Word (.docx) manuscript so the edits appear as tracked changes, especially one with live Zotero citation fields or co-authors'…
от mronkko★ 34 звезды на GitHub
Установить word-zotero-track-changes в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Word + Zotero track changes
Edit a co-authored Word manuscript so that every change shows up in Word as an ordinary tracked change by one named author, Zotero citations stay live fields, and co-authors' pending changes survive untouched.
Word stores a .docx as zipped XML (OOXML). The tooling here edits
word/document.xml directly with w:ins / w:del tracked-change
markup. Generic "edit the XML" approaches break on run merging, on
nested insertions and on Zotero fields; the pitfalls below each caused a
real failure.
Companion skills
grounded-citations— every citation you insert follows its rules: consult the source first; it must support the claim in context.zotero-operations/ the Zotero MCP tools — item keys, and the item's Zotero JSON (format="json") for items not yet cited in the document.critic-loop— after an editing round, run the critics on the accepted-text previewcheck_docx.py --previewwrites. Their fixes come back through this skill.- Anthropic
docxskill (optional) —check_docx.pyruns itsvalidate.pywhen installed under~/.claude, verifying every change is tracked under the author. Without it that check is skipped with a warning. Use that skill for new documents, comments and PDF rendering.
Tools and requirements
Steps 2, 3 and 5 are tools of the plugin's MCP server:
track_changes_unpack, track_changes_inspect, track_changes_check.
In Claude Code their full names start
mcp__plugin_academic-research_academic-research__. Their paths are
project-relative and must stay inside the project. Use a work directory
such as .claude/redline/round1 (WORK below).
- Terminal equivalent. Use these commands only when the tools are
unavailable, or when the manuscript lives outside the project.
$Ris${CLAUDE_PLUGIN_ROOT}/scripts/track_changes:uv run $R/unpack_docx.py manuscript.docx WORKuv run $R/inspect_docx.py WORK/unpacked/word/document.xml [FROM [TO]] [--fields] [--authors]uv run $R/check_docx.py WORK/unpacked WORK/out.docx --original WORK/00_original.docx --author "…" --preview WORK/preview.md
- Step 4 has no tool: it runs your own Python through
uv run $R/run_edits.py. - Needs
uv.pandocis needed for the preview.
Workflow
Pre-flight.
- Confirm the author name to record. Use exactly the form already in
the document's tracked changes (e.g.
Surname, Given);track_changes_inspectwithauthorslists them after step 2. - In a synced folder (OneDrive, Dropbox), check that no
~$lock file exists and no co-author has the file open.
- Confirm the author name to record. Use exactly the form already in
the document's tracked changes (e.g.
Snapshot and unpack.
track_changes_unpack(docx,workdir) writesWORK/00_original.docxandWORK/unpacked/. Do not run run-merging scripts afterwards (see Pitfalls).Inspect.
track_changes_inspect(document_xml=WORK/unpacked/word/document.xml) lists the paragraphs in its log file (log_path); read the part you need. Each line is[index] (style) text, with 0-based indices and{+inserted+},{-deleted-}and[ZFIELD]marks.fieldsreports field balance, Zotero field types and the cited library:zotero.org/groups/<id>gives thelibrary_idandlibrary_typeforCiter.authorsreports tracked-change authors.Edit. Write an edit script (
edits.py) inWORK. Run it from there withuv run $R/run_edits.py edits.py, which makes the library importable. Paths in the script resolve against the current directory:from redline import Doc from zotero_fields import Citer d = Doc('unpacked/word/document.xml', author='Surname, Given') citer = Citer(open(d.path, encoding='utf8').read(), library_id='<group or user id>', library_type='groups') p = d.find_para('unique visible text') d.replace_text(p, 'old wording', [ 'new wording ', citer.cite('(Author, 2020, p. 5)', citer.item('ITEMKEY', locator='5')), '.']) d.save()Method Notes find_para(text)Matches visible (accepted) text. replace_text(p, old, pieces)oldmust not cross a field boundary;[]deletes.insert_text_after(p, after, pieces)Skips past a field the anchor lands in. insert_paragraph_after(anchor, pieces)Paragraph mark is tracked too. delete_paragraph(p)Tracked deletion of content and mark. move_paragraph(src, after)Delete + insert; renews copied citationIDs.delete_field(p, result_text)Removes a whole citation field. - Anchors (
find_para,old,after) match the visible text, citation results like(Smith, 2020)included.find_pararaises on several matches — lengthen the text or passoccurrence=k(1-based); the text methods takeoccurrence=too. - Pieces are
'text',('i', 'italic'), or aciter.cite(...)result. - The first argument of
citei
- Anchors (
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/zotero-fields.md
FAQ
Что делает скилл word-zotero-track-changes?
Use when editing an existing Word (.docx) manuscript so the edits appear as tracked changes, especially one with live Zotero citation fields or co-authors' pending changes. Trigger phrases "edit the manuscript with track changes", "redline the docx", "insert citations into the Word file". Do NOT use for a new Word document — use `docx`. Do NOT use for Quarto/Markdown manuscripts — use `manuscript-revision`. Do NOT use for choosing what to cite — use `grounded-citations`.
Как установить скилл word-zotero-track-changes?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл word-zotero-track-changes запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…