SkillsGrove
SkillsGrove/Bürodokumente/OICWS/Coscribe/Word Documents

Word Documents

Installation

$npx skills add https://github.com/OICWS/Coscribe --skill 'Word Documents'
$git clone --depth 1 https://github.com/OICWS/Coscribe.git /tmp/Coscribe && mkdir -p ~/.claude/skills && cp -r /tmp/Coscribe/office-agent/src/coscribe/builtin_skills/word ~/.claude/skills/Word-Documents
Bitte installiere diesen Agent Skill für mich: https://github.com/OICWS/Coscribe/tree/cf9a00cd7333f2318db917713fbe12c3f6a96079/office-agent/src/coscribe/builtin_skills/word – lies zuerst seine SKILL.md und seine Skripte und installiere ihn erst dann in meinen Skills-Ordner, wenn du bestätigt hast, dass er sicher ist.

Zusammenfassung

Originalbeschreibung · MITWhen and how to use write_docx's table-of-contents, comments, tracked-changes, and template features -- load before writing a Word (.docx) file the person asked for by name, built on their template, or with tracked changes; other documents are Docs.
Die folgende SKILL.md ist aus OICWS/Coscribe (Commit cf9a00c) unter der Lizenz MIT wiedergegeben. Der Text ist unverändert; lediglich die Metadaten im Dateikopf sind weggelassen, Bilder werden als Links angezeigt und sehr lange Dateien werden gekürzt. Copyright 2026 OICWS. Lizenz: LICENSE. Es wird nur die Anleitungsdatei angezeigt; etwaige Skripte finden Sie im Original-Repository.

Deeper guidance for write_docx/read_docx -- on top of what's already in your base instructions (the markdown subset, and the "no partial editing, rewrite the whole content and overwrite=True" rule).

A new document

Without template_path, write_docx lays the document out itself: fonts for the document's language, heading styles, A4, page numbers, and tables with a shaded header row; a last row whose first cell is "Total" or "合计" is set bold. Pass language as the language the person wants the document in (usually the one they write to you in). Spend the effort on content and structure instead:

  • Decide who reads it and what they must see first. The opening says what the document is, for whom, and its point in two lines.
  • # once for the title, ## for sections; put figures a reader compares in a table, not in sentences.
  • Every figure, date and name exactly as in the sources. Add nothing they do not contain: no attendees, roles or budget lines the notes don't give.

Page breaks and finishing

A line that is exactly [PAGEBREAK] starts the next block on a new page (a cover page, a template that is to stand alone on its page). Layout the subset cannot say (a font size, an indent, a column) is not worth a script: write the document once, look at the rendered preview_path once, fix what the tools can fix, and tell the person what could not be done. Every Word write (accepting or rejecting tracked changes and review edits too) returns page_check: what the office program's layout showed (an empty page, a table past the paper's edge, a last page of a line or two): fix those and write again; when it says "not checked", say so rather than call the layout fine. Do not convert the file to PDF and read it page by page again and again, and do not patch the .docx with a script to polish it.

Changing an existing document's structure

To add a section, a list, a table or a contents list to a user's document, move a section or delete one, use edit_docx_structure -- one call with a list of operations -- not a script and not write_docx (which would rebuild the file and lose what the markdown subset can't hold). For example, a contents list after the introduction and a section moved to the front:

[{"op": "insert", "after": "<first words of the intro>", "content": "# Contents\n\n[TOC]"},
 {"op": "move_section", "section": "Safety", "before": "Onboarding"}]

after_section places content after everything under a heading. Pass output_path when the user wants a new file. Everything the operations don't name is kept as it is, and the result's document lists the new headings, tables, pictures, header and footer: check the edit there, not with a script. Before editing, read_docx(path, view="structure") shows each block's style, the tables with their styles, the pictures, and the header and footer -- what the markdown view leaves out -- without a script. Use replace_docx_text and friends for wording inside paragraphs.

Table of contents

A line that is exactly [TOC] inserts a real Word TOC field, built from the document's own heading levels (#/##/###). It only works if the document actually uses headings for its sections -- a document written as plain paragraphs with bold text standing in for headings produces an empty or missing TOC, since Word has no way to tell that text is structural. For any document long enough to want a TOC, use real #/##/### lines for every section and subsection, not just for the ones that happen to need one. The list shows the headings without page numbers: only Word can paginate, and the person adds them with right-click, Update Field. Don't describe it as broken, and don't write page numbers or page breaks into it with a script. A heading written just above [TOC] reading "Contents" is the list's title and stays out of it.

A cover page and a contents list suit a document of about six pages or more. A shorter one gets neither unless the person asks, since each takes a nearly empty page. Headline figures go in a short table or a list, not in large type in a table of many columns: the numbers break across lines.

Comments vs. tracked changes -- pick the one that matches the ask

These are two different things and answer different requests:

  • {{comment: your comment text}} at the end of a heading/paragraph/ bullet/numbered-item line attaches a real Word comment anchored to that line, visible in Word's Comments pane. Use this for feedback on content that isn't changing -- a note, a question, a flag for the reader. Not recognized inside table cells.
  • track_changes=True marks everything this call writes as a tracked insertion instead of final content, and (with template_path) marks the template's old body as a tracked deletion instead of removing it outright. Use this when the document itself should change and the change is what needs review -- a redline the user can accept or reject in Word.

Don't reach for track_changes=True when what's actually wanted is a comment on unchanged text, or vice versa -- they produce visibly different documents and Word review workflows expect the right one.

To review a document that already has changes or comments -- accept or reject a change, answer or resolve a comment, comment on some words -- use read_docx_review for the ids, then edit_docx_review, rather than a script.

Templates

template_path carries over an existing document's styles and page setup (useful for matching a user's letterhead or house style) but its own body content is removed (or tracked-deleted, with track_changes=True) before your new content is added -- it is a style source, not something your new content gets appended to. Tables in a template are always removed outright, tracked changes or not, since table-level tracked deletions aren't supported.

Charts and pictures

write_docx has no syntax for them. Write the document first, then call add_docx_chart(path, chart_type, data, title=..., after_text="<heading>") for a bar/line/pie chart from a pipe-table -- it is a native Word chart, so the reader can edit its data, and it needs no plotting library. Use add_docx_image for an existing PNG/JPEG. Both put the item after the paragraph named by after_text (or at the end) and leave the rest of the file alone. Writing the document again with write_docx discards them, so make text changes with replace_docx_text/insert_docx_text afterwards. Give a caption when the text refers to the figure.

Before finishing

For a document with real structure (a TOC, multiple sections, a template applied, tracked changes), look at the rendered preview_path or consider asking review_work to check it -- whether that extra step is worth it is your judgment call for the specific document, not a fixed rule. A one- paragraph memo doesn't need it; a multi-section report going to someone else usually does.

Vollständigen Lizenztext ansehen (MIT)
MIT License

Copyright (c) 2026 OICWS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.