[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AEXA794AFYF21DFWX5VECX":3,"skill-same:01M7AEXA794AFYF21DFWX5VECX":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7AEXA794AFYF21DFWX5VECX","word-odt-skill",null,"Create and read Word (.docx) and ODT (.odt) documents with companyFILES MCP tools. Use when asked to write a report, letter, or document in Word or OpenDocument format, convert Markdown or HTML to Word\u002FODT, extract text from a Word file, or create a document with headers, footers, table of contents, or page numbers. Also fills a corporate Word document or form that has no {{placeholders}} (sample text, text boxes, content controls, tables) with code execution.","innFactory-AI\u002Fcompany-ai-stack-skills","innFactory-AI","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F165681221?v=4","01M7AEC27VD0D1QX2XBX441MDW","innFactory AI","01M7AEC28G25HQ9H9SN58MNV27",0,"MIT","https:\u002F\u002Fgithub.com\u002FinnFactory-AI\u002Fcompany-ai-stack-skills\u002Fblob\u002Fmain\u002Fen\u002Fskills\u002Ffiles\u002Fword-odt-skill\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: word-odt-skill\ndescription: 'Create and read Word (.docx) and ODT (.odt) documents with companyFILES MCP tools. Use when asked to write a report, letter, or document in Word or OpenDocument format, convert Markdown or HTML to Word\u002FODT, extract text from a Word file, or create a document with headers, footers, table of contents, or page numbers. Also fills a corporate Word document or form that has no {{placeholders}} (sample text, text boxes, content controls, tables) with code execution.'\n---\n\n# Word & ODT Skill\n\nTools for creating Word (.docx) and ODT (.odt) documents, plus reading Word files.\n\n## Tools in This Skill\n\n| Tool                    | Purpose                                                                         |\n| ----------------------- | ------------------------------------------------------------------------------- |\n| `create_word`           | Create Word (.docx) from Markdown or plain text                                 |\n| `create_word_from_html` | Create Word from HTML with optional CSS                                         |\n| `create_word_from_json` | Dump JSON data into Word as a plain key\u002Fvalue listing                           |\n| `create_odt`            | Create ODT from Markdown (LibreOffice\u002FOpenOffice)                               |\n| `create_odt_from_html`  | Create ODT from HTML                                                            |\n| `read_word`             | Read a Word (.docx) file → text, HTML, Markdown (from base64 or LibreChat file) |\n| `read_word_content`     | Read stored Word document content by document_id → markdown-like string         |\n| `append_to_word`        | Append Markdown content to an existing stored Word document in-place            |\n| `replace_word_content`  | Replace entire content of an existing stored Word document in-place             |\n\n## Decision Guide\n\n```\nUser wants to create a Word document from...\n  Markdown \u002F plain text  → create_word          (most common)\n  HTML + CSS             → create_word_from_html\n  Raw JSON data (dump)   → create_word_from_json  (no layout control)\n  A template             → see templates-skill   (create_word_from_template)\n\nUser wants OpenDocument format (LibreOffice)...\n  From Markdown          → create_odt\n  From HTML              → create_odt_from_html\n  From template          → see templates-skill   (create_odt_from_template)\n\nUser wants to READ a Word file...\n  From base64 \u002F LibreChat attachment  → read_word\n  From stored document (document_id)  → read_word_content\n\nUser wants to EDIT an existing stored Word document...\n  Inspect current content first       → read_word_content\n  Add more content at the end         → append_to_word    (keeps existing content)\n  Rewrite the whole document          → replace_word_content\n\nUser wants to FILL a corporate document \u002F form in its own layout...\n  It has {{placeholders}}             → see templates-skill (create_word_from_template)\n  No {{}}: sample text, text boxes,   → \"Filling a corporate document without {{placeholders}}\"\n  content controls, empty tables         below (code execution)\n```\n\n## Tool Usage\n\n### create_word\n\n```json\n{\n  \"content\": \"# Annual Report\\n\\n## Summary\\n\\nThis year we achieved...\",\n  \"filename\": \"annual_report\",\n  \"title\": \"Annual Report 2025\",\n  \"page_size\": \"A4\",\n  \"page_orientation\": \"portrait\",\n  \"header_text\": \"Confidential\",\n  \"footer_text\": \"Acme Corp\",\n  \"show_page_numbers\": true,\n  \"page_number_position\": \"footer\",\n  \"page_number_format\": \"{page} \u002F {pages}\",\n  \"include_toc\": true\n}\n```\n\n`format` can be `\"markdown\"` (default) or `\"plain\"`. Note: `create_word` has **no `author` field** — only `create_word_from_html`, `create_odt` and `create_odt_from_html` accept `author`.\n\n### create_word_from_html\n\n```json\n{\n  \"html\": \"\u003Ch1>Report\u003C\u002Fh1>\u003Cp>Content here.\u003C\u002Fp>\u003Ctable>...\u003C\u002Ftable>\",\n  \"css\": \"h1 { color: #336699; } body { font-family: Arial; }\",\n  \"filename\": \"report\",\n  \"title\": \"My Report\",\n  \"show_page_numbers\": true\n}\n```\n\nSupports inline images via `doc:\u003CdocumentId>` (stored companyFILES doc), `lc:\u003Cfile_id>` (LibreChat attachment) or `img:\u003Cname>` (image library, see `list_image_templates` in **templates-skill**) URI: `\u003Cimg src=\"doc:abc123...\" \u002F>`. The same syntax works in Markdown for `create_word`: `![alt](doc:\u003Cuuid>)`, `![alt](lc:\u003Cfile_id>)` or `![alt](img:\u003Cname>)`. An unknown `img:` name fails the call with an error naming it.\n\n### create_word_from_json\n\n```json\n{\n  \"json_content\": \"{\\\"customer\\\":\\\"Acme Corp\\\",\\\"items\\\":[{\\\"name\\\":\\\"Widget\\\",\\\"qty\\\":2}]}\",\n  \"filename\": \"order_data\"\n}\n```\n\nWrites the JSON as a simple listing under the heading \"Document Generated from JSON\": one paragraph per field (`key: value`, key in bold); nested objects and arrays are indented, array items appear as `[0]`, `[1]`, …. There is no element schema (no headings, tables or styling from JSON) and no title, author or page options — only `json_content` and `filename`. For a designed document, turn the data into Markdown and use `create_word`.\n\n### create_odt\n\n```json\n{\n  \"content\": \"# Letter\\n\\nDear John,\\n\\nPlease find enclosed...\",\n  \"filename\": \"letter\",\n  \"title\": \"Formal Letter\",\n  \"author\": \"Jane\",\n  \"page_size\": \"A4\",\n  \"header_text\": \"Private & Confidential\",\n  \"show_page_numbers\": true\n}\n```\n\n### create_odt_from_html\n\n```json\n{\n  \"html\": \"\u003Ch1>Document\u003C\u002Fh1>\u003Cp>Content\u003C\u002Fp>\",\n  \"filename\": \"document\",\n  \"page_size\": \"A4\"\n}\n```\n\n### read_word\n\n```json\n{\n  \"file_content\": \"\u003Cbase64-encoded docx>\"\n}\n```\n\nAccepts any one of `file_content` (base64), `librechat_file_id` (LibreChat attachment), or `document_id` (stored companyFILES doc). Returns `{ text, html, markdown }`.\n\n### read_word_content\n\nRead the content of a stored Word document (created or uploaded via companyFILES). Accepts `document_id` **or** `librechat_file_id`. Returns a markdown-like string plus character count — use this before appending or replacing to understand the current state.\n\n```json\n{\n  \"document_id\": \"uuid-of-stored-word-doc\"\n}\n```\n\nReturns `{ document_id, librechat_file_id, filename, character_count, content }`.\n\n### append_to_word\n\nAppend Markdown (or plain text) to an existing Word document. Identify the target with `document_id` **or** `librechat_file_id`. A page break is inserted before the new content by default. The document is updated in-place — same `document_id`.\n\n```json\n{\n  \"document_id\": \"uuid-of-stored-word-doc\",\n  \"content\": \"## New Section\\n\\nAdditional content here...\",\n  \"format\": \"markdown\",\n  \"add_page_break\": true\n}\n```\n\n`add_page_break` defaults to `true`. Use `false` to continue on the same page.\n\n### replace_word_content\n\nReplace the entire content of an existing Word document with new Markdown. Identify the target with `document_id` **or** `librechat_file_id`. All page layout options (`page_size`, `header_text`, etc.) work the same as `create_word`. The document is updated in-place — same `document_id`.\n\n```json\n{\n  \"document_id\": \"uuid-of-stored-word-doc\",\n  \"content\": \"# Updated Report\\n\\nFully rewritten content...\",\n  \"format\": \"markdown\",\n  \"page_size\": \"A4\",\n  \"header_text\": \"Confidential\",\n  \"show_page_numbers\": true\n}\n```\n\n## Common Page Options (all create tools except `create_word_from_json`)\n\n| Parameter               | Values                              | Default            |\n| ----------------------- | ----------------------------------- | ------------------ |\n| `page_size`             | `A4`, `Letter`, `Legal`, `A3`, `A5` | `A4`               |\n| `page_orientation`      | `portrait`, `landscape`             | `portrait`         |\n| `page_number_position`  | `header`, `footer`                  | `footer`           |\n| `page_number_alignment` | `left`, `center`, `right`           | `center`           |\n| `page_number_format`    | string with `{page}` and `{pages}`  | `{page} \u002F {pages}` |\n\n## Iterative Document Editing Pattern\n\nFor long documents that exceed a single context window, build them section by section:\n\n1. `create_word` — create the document with the first section; note the returned `id` (pass it as `document_id`)\n2. `append_to_word` — call repeatedly for each additional section\n3. Optionally `read_word_content` to inspect the current state before continuing\n4. `replace_word_content` — if a section needs to be fully rewritten\n\nAll three in-place tools (`read_word_content`, `append_to_word`, `replace_word_content`) operate on existing documents identified by `document_id` **or** `librechat_file_id` (a LibreChat attachment, updated in-place on the shared volume), not on base64 file content.\n\n## Filling a corporate document without `{{placeholders}}`\n\nA letterhead, offer template, form or report template the user attached usually has no\n`{{placeholders}}`. Instead it has sample text (\"[Kunde]\", \"XXX\", \"Lorem ipsum\", \"Max Mustermann\"),\ntext boxes, content controls (\"Klicken oder tippen Sie hier, um Text einzugeben.\"), checkboxes and\ntables with an empty sample row. `replace_word_content` and `append_to_word` cannot fill such a\ndocument. They rewrite it in the companyFILES layout or append to its end, so the layout the user\nwanted is lost. Do not use them for this.\n\n### If code execution is available\n\nThe document is in the sandbox at `\u002Fmnt\u002Fdata\u002F\u003Cfilename>.docx`. This skill ships two scripts,\nunder `\u002Fmnt\u002Fdata\u002Fskills\u002Fword-odt-skill\u002Fscripts\u002F` when it was installed as a package:\n\n1. **Inventory**:\n\n   ```bash\n   python3 \u002Fmnt\u002Fdata\u002Fskills\u002Fword-odt-skill\u002Fscripts\u002Fdocx_inventory.py \"\u002Fmnt\u002Fdata\u002F\u003Cdoc>.docx\"\n   ```\n\n   It lists every non-empty paragraph with a key: `B12` (body), `H1.0` \u002F `F1.2` (header\u002Ffooter),\n   the table cell (`[T0r1c2]`), `textbox`, style. It lists tables (`BT0: 3 rows x 3 cols`) and\n   content controls with tag\u002Ftitle, type and whether they still show their placeholder. `!DUMMY`\n   marks sample text. Long documents: `--range B0-B150`; empty paragraphs: `--all`.\n\n2. **Fill**: plan and output in one call:\n\n   ```bash\n   cat > \u002Ftmp\u002Fplan.json \u003C\u003C'EOF'\n   {\n     \"paragraphs\": {\"B2\": \"Thank you for your enquiry.\", \"B3\": [\"Consulting\", \"Implementation\", \"Training\"],\n                    \"B18\": \"Erika Example\", \"B20\": null, \"H1.0\": \"Acme Corp | Offer 2026-117\"},\n     \"tables\": {\"BT0\": {\"start_row\": 1, \"rows\": [[\"Consulting\", \"2\", \"2,400 EUR\"], [\"Training\", \"1\", \"900 EUR\"]], \"trim\": true}},\n     \"content_controls\": {\"Customer\": \"Acme Corp\", \"Approved\": true},\n     \"replace\": {\"[Kunde]\": \"Acme Corp\"}\n   }\n   EOF\n   python3 \u002Fmnt\u002Fdata\u002Fskills\u002Fword-odt-skill\u002Fscripts\u002Fdocx_fill.py \"\u002Fmnt\u002Fdata\u002F\u003Cdoc>.docx\" \u002Ftmp\u002Fplan.json \"\u002Fmnt\u002Fdata\u002F\u003Cresult>.docx\"\n   ```\n\n   - `paragraphs`: key → text. A list or `\\n` adds paragraphs in the same style (e.g. more\n     bullets), `\u003Cbr>` is a line break, `null` deletes the paragraph. Images and text boxes anchored\n     in a paragraph stay.\n   - `tables`: fills rows from `start_row` (0 = header). More rows than the table has copy its\n     last row with its formatting. `null` keeps a cell, and `trim` removes unused sample rows.\n   - `content_controls`: by tag or title. `true`\u002F`false` ticks a checkbox. The placeholder style\n     (\"Klicken oder tippen…\") is removed.\n   - `replace`: substring everywhere: body, tables, text boxes, headers, footers.\n   - Text boxes are updated in both copies Word stores (otherwise older viewers show the old\n     text). Formatting comes from the paragraph and its first run.\n   - Keys always refer to the **source** document. The script resolves all of them before it\n     changes anything. Write the plan to `\u002Ftmp` in the same call, because files in `\u002Fmnt\u002Fdata`\n     become chat attachments.\n\n3. **Check**: the fill script ends with a check (exit code 2 and `CHECK FAILED` if sample text\n   or a content-control placeholder is left). `docx_inventory.py \"\u003Cresult>\" --check` checks on its\n   own. Deliberately empty fields (a signature line) are fine; name them in the answer.\n\n4. **Answer**: the result comes back as a chat attachment. Name what you filled and what stays\n   for the user to fill. You can only check the text, not the page layout. Ask the user to check\n   line and page breaks.\n\n**Without the scripts** (only `SKILL.md` was pasted): use python-docx (`import docx` first).\n\n- Walk all paragraphs, including table cells, text boxes (`w:txbxContent`), headers and footers.\n- Change text in the existing runs; setting `paragraph.text` wipes the formatting.\n- Copy a table row with `copy.deepcopy(row._tr)`.\n- Content controls are `w:sdt` elements. Remove `w:showingPlcHdr` after filling one.\n- See **templates-skill** (`references\u002Fcode-template-editing.md`) for the run-level replace recipe.\n\n**Limits:**\n\n- The sandbox has no LibreOffice, so there is no render and no PDF export of the result. For a\n  PDF, use `convert_document` (convert skill) on the finished DOCX if it is available.\n- ODT has no Python library in the sandbox.\n- Legacy form fields (`FORMTEXT`) and tracked changes are not handled; say so if the document\n  uses them.\n\n### Without code execution\n\nNo tool fills such a document in its own layout. Tell the user plainly, and offer:\n\n- Turn on code execution (chat\u002Fagent setting or the `RUN_CODE` permission from an admin).\n- Make the document a real template once: replace the sample text with `{{placeholders}}` in\n  Word and upload it as a template. After that, `create_word_from_template` fills it without code\n  (templates-skill).\n- The filled-in texts as a list to paste in, or a new document with `create_word` in the\n  companyFILES\u002FCI design, clearly labelled as not their template.\n\n## Key Notes\n\n- All create tools return `{id, filename, downloadUrl, markdownLink}` (plus `librechat_file_id` when the document is also stored as a chat file) — always render `markdownLink` in the reply.\n- In-place edit tools (`append_to_word`, `replace_word_content`) on a companyFILES document return the same `id` and an updated `markdownLink`. On a chat attachment (`librechat_file_id`) that was updated in place, they return only `{librechat_file_id, filename, message}` — there is no download link; tell the user the attached file was updated. If the attachment cannot be updated in place, the modified copy is saved as a **new** document and its new `id`\u002F`markdownLink` is returned — use that id from then on.\n- Inline images can be referenced via `doc:\u003CdocumentId>`, `lc:\u003Cfile_id>` or `img:\u003Cname>` (image library) in the Markdown or HTML of the create tools (`create_word`, `create_word_from_html`, `create_odt`, `create_odt_from_html`) — SVG is auto-converted to PNG for Word. `append_to_word` and `replace_word_content` do not resolve these references.\n- Unset page\u002Fheader\u002Ffooter options fall back to the org\u002Fuser theme defaults (e.g. `defaultPageSize`, `defaultHeaderText`, `defaultShowPageNumbers`) before the documented hard defaults apply.\n- For template-based Word creation (placeholders, loops, image injection), use the **templates-skill**. Image placeholders there are `{IMAGE name}` or `{%name}` (typed in one go); `width`\u002F`height` in cm form a box the image is fitted into without distortion (`fit`: `contain` default, `cover` crops, `stretch` only on request).\n- ODT files open natively in LibreOffice and Google Docs.\n- The org\u002Fuser CI is applied automatically when configured: colours, fonts and sizes, page format, header\u002Ffooter, page numbers and the logo at the configured position (header or footer, left\u002Fcenter\u002Fright). For a document you build yourself with code execution, `get_corporate_ci` returns the same values.\n","# Word & ODT Skill\n\nTools for creating Word (.docx) and ODT (.odt) documents, plus reading Word files.\n\n## Tools in This Skill\n\n| Tool                    | Purpose                                                                         |\n| ----------------------- | ------------------------------------------------------------------------------- |\n| `create_word`           | Create Word (.docx) from Markdown or plain text                                 |\n| `create_word_from_html` | Create Word from HTML with optional CSS                                         |\n| `create_word_from_json` | Dump JSON data into Word as a plain key\u002Fvalue listing                           |\n| `create_odt`            | Create ODT from Markdown (LibreOffice\u002FOpenOffice)                               |\n| `create_odt_from_html`  | Create ODT from HTML                                                            |\n| `read_word`             | Read a Word (.docx) file → text, HTML, Markdown (from base64 or LibreChat file) |\n| `read_word_content`     | Read stored Word document content by document_id → markdown-like string         |\n| `append_to_word`        | Append Markdown content to an existing stored Word document in-place            |\n| `replace_word_content`  | Replace entire content of an existing stored Word document in-place             |\n\n## Decision Guide\n\n```\nUser wants to create a Word document from...\n  Markdown \u002F plain text  → create_word          (most common)\n  HTML + CSS             → create_word_from_html\n  Raw JSON data (dump)   → create_word_from_json  (no layout control)\n  A template             → see templates-skill   (create_word_from_template)\n\nUser wants OpenDocument format (LibreOffice)...\n  From Markdown          → create_odt\n  From HTML              → create_odt_from_html\n  From template          → see templates-skill   (create_odt_from_template)\n\nUser wants to READ a Word file...\n  From base64 \u002F LibreChat attachment  → read_word\n  From stored document (document_id)  → read_word_content\n\nUser wants to EDIT an existing stored Word document...\n  Inspect current content first       → read_word_content\n  Add more content at the end         → append_to_word    (keeps existing content)\n  Rewrite the whole document          → replace_word_content\n\nUser wants to FILL a corporate document \u002F form in its own layout...\n  It has {{placeholders}}             → see templates-skill (create_word_from_template)\n  No {{}}: sample text, text boxes,   → \"Filling a corporate document without {{placeholders}}\"\n  content controls, empty tables         below (code execution)\n```\n\n## Tool Usage\n\n### create_word\n\n```json\n{\n  \"content\": \"# Annual Report\\n\\n## Summary\\n\\nThis year we achieved...\",\n  \"filename\": \"annual_report\",\n  \"title\": \"Annual Report 2025\",\n  \"page_size\": \"A4\",\n  \"page_orientation\": \"portrait\",\n  \"header_text\": \"Confidential\",\n  \"footer_text\": \"Acme Corp\",\n  \"show_page_numbers\": true,\n  \"page_number_position\": \"footer\",\n  \"page_number_format\": \"{page} \u002F {pages}\",\n  \"include_toc\": true\n}\n```\n\n`format` can be `\"markdown\"` (default) or `\"plain\"`. Note: `create_word` has **no `author` field** — only `create_word_from_html`, `create_odt` and `create_odt_from_html` accept `author`.\n\n### create_word_from_html\n\n```json\n{\n  \"html\": \"\u003Ch1>Report\u003C\u002Fh1>\u003Cp>Content here.\u003C\u002Fp>\u003Ctable>...\u003C\u002Ftable>\",\n  \"css\": \"h1 { color: #336699; } body { font-family: Arial; }\",\n  \"filename\": \"report\",\n  \"title\": \"My Report\",\n  \"show_page_numbers\": true\n}\n```\n\nSupports inline images via `doc:\u003CdocumentId>` (stored companyFILES doc), `lc:\u003Cfile_id>` (LibreChat attachment) or `img:\u003Cname>` (image library, see `list_image_templates` in **templates-skill**) URI: `\u003Cimg src=\"doc:abc123...\" \u002F>`. The same syntax works in Markdown for `create_word`: `![alt](doc:\u003Cuuid>)`, `![alt](lc:\u003Cfile_id>)` or `![alt](img:\u003Cname>)`. An unknown `img:` name fails the call with an error naming it.\n\n### create_word_from_json\n\n```json\n{\n  \"json_content\": \"{\\\"customer\\\":\\\"Acme Corp\\\",\\\"items\\\":[{\\\"name\\\":\\\"Widget\\\",\\\"qty\\\":2}]}\",\n  \"filename\": \"order_data\"\n}\n```\n\nWrites the JSON as a simple listing under the heading \"Document Generated from JSON\": one paragraph per field (`key: value`, key in bold); nested objects and arrays are indented, array items appear as `[0]`, `[1]`, …. There is no element schema (no headings, tables or styling from JSON) and no title, author or page options — only `json_content` and `filename`. For a designed document, turn the data into Markdown and use `create_word`.\n\n### create_odt\n\n```json\n{\n  \"content\": \"# Letter\\n\\nDear John,\\n\\nPlease find enclosed...\",\n  \"filename\": \"letter\",\n  \"title\": \"Formal Letter\",\n  \"author\": \"Jane\",\n  \"page_size\": \"A4\",\n  \"header_text\": \"Private & Confidential\",\n  \"show_page_numbers\": true\n}\n```\n\n### create_odt_from_html\n\n```json\n{\n  \"html\": \"\u003Ch1>Document\u003C\u002Fh1>\u003Cp>Content\u003C\u002Fp>\",\n  \"filename\": \"document\",\n  \"page_size\": \"A4\"\n}\n```\n\n### read_word\n\n```json\n{\n  \"file_content\": \"\u003Cbase64-encoded docx>\"\n}\n```\n\nAccepts any one of `file_content` (base64), `librechat_file_id` (LibreChat attachment), or `document_id` (stored companyFILES doc). Returns `{ text, html, markdown }`.\n\n### read_word_content\n\nRead the content of a stored Word document (created or uploaded via companyFILES). Accepts `document_id` **or** `librechat_file_id`. Returns a markdown-like string plus character count — use this before appending or replacing to understand the current state.\n\n```json\n{\n  \"document_id\": \"uuid-of-stored-word-doc\"\n}\n```\n\nReturns `{ document_id, librechat_file_id, filename, character_count, content }`.\n\n### append_to_word\n\nAppend Markdown (or plain text) to an existing Word document. Identify the target with `document_id` **or** `librechat_file_id`. A page break is inserted before the new content by default. The document is updated in-place — same `document_id`.\n\n```json\n{\n  \"document_id\": \"uuid-of-stored-word-doc\",\n  \"content\": \"## New Section\\n\\nAdditional content here...\",\n  \"format\": \"markdown\",\n  \"add_page_break\": true\n}\n```\n\n`add_page_break` defaults to `true`. Use `false` to continue on the same page.\n\n### replace_word_content\n\nReplace the entire content of an existing Word document with new Markdown. Identify the target with `document_id` **or** `librechat_file_id`. All page layout options (`page_size`, `header_text`, etc.) work the same as `create_word`. The document is updated in-place — same `document_id`.\n\n```json\n{\n  \"document_id\": \"uuid-of-stored-word-doc\",\n  \"content\": \"# Updated Report\\n\\nFully rewritten content...\",\n  \"format\": \"markdown\",\n  \"page_size\": \"A4\",\n  \"header_text\": \"Confidential\",\n  \"show_page_numbers\": true\n}\n```\n\n## Common Page Options (all create tools except `create_word_from_json`)\n\n| Parameter               | Values                              | Default            |\n| ----------------------- | ----------------------------------- | ------------------ |\n| `page_size`             | `A4`, `Letter`, `Legal`, `A3`, `A5` | `A4`               |\n| `page_orientation`      | `portrait`, `landscape`             | `portrait`         |\n| `page_number_position`  | `header`, `footer`                  | `footer`           |\n| `page_number_alignment` | `left`, `center`, `right`           | `center`           |\n| `page_number_format`    | string with `{page}` and `{pages}`  | `{page} \u002F {pages}` |\n\n## Iterative Document Editing Pattern\n\nFor long documents that exceed a single context window, build them section by section:\n\n1. `create_word` — create the document with the first section; note the returned `id` (pass it as `document_id`)\n2. `append_to_word` — call repeatedly for each additional section\n3. Optionally `read_word_content` to inspect the current state before continuing\n4. `replace_word_content` — if a section needs to be fully rewritten\n\nAll three in-place tools (`read_word_content`, `append_to_word`, `replace_word_content`) operate on existing documents identified by `document_id` **or** `librechat_file_id` (a LibreChat attachment, updated in-place on the shared volume), not on base64 file content.\n\n## Filling a corporate document without `{{placeholders}}`\n\nA letterhead, offer template, form or report template the user attached usually has no\n`{{placeholders}}`. Instead it has sample text (\"[Kunde]\", \"XXX\", \"Lorem ipsum\", \"Max Mustermann\"),\ntext boxes, content controls (\"Klicken oder tippen Sie hier, um Text einzugeben.\"), checkboxes and\ntables with an empty sample row. `replace_word_content` and `append_to_word` cannot fill such a\ndocument. They rewrite it in the companyFILES layout or append to its end, so the layout the user\nwanted is lost. Do not use them for this.\n\n### If code execution is available\n\nThe document is in the sandbox at `\u002Fmnt\u002Fdata\u002F\u003Cfilename>.docx`. This skill ships two scripts,\nunder `\u002Fmnt\u002Fdata\u002Fskills\u002Fword-odt-skill\u002Fscripts\u002F` when it was installed as a package:\n\n1. **Inventory**:\n\n   ```bash\n   python3 \u002Fmnt\u002Fdata\u002Fskills\u002Fword-odt-skill\u002Fscripts\u002Fdocx_inventory.py \"\u002Fmnt\u002Fdata\u002F\u003Cdoc>.docx\"\n   ```\n\n   It lists every non-empty paragraph with a key: `B12` (body), `H1.0` \u002F `F1.2` (header\u002Ffooter),\n   the table cell (`[T0r1c2]`), `textbox`, style. It lists tables (`BT0: 3 rows x 3 cols`) and\n   content controls with tag\u002Ftitle, type and whether they still show their placeholder. `!DUMMY`\n   marks sample text. Long documents: `--range B0-B150`; empty paragraphs: `--all`.\n\n2. **Fill**: plan and output in one call:\n\n   ```bash\n   cat > \u002Ftmp\u002Fplan.json \u003C\u003C'EOF'\n   {\n     \"paragraphs\": {\"B2\": \"Thank you for your enquiry.\", \"B3\": [\"Consulting\", \"Implementation\", \"Training\"],\n                    \"B18\": \"Erika Example\", \"B20\": null, \"H1.0\": \"Acme Corp | Offer 2026-117\"},\n     \"tables\": {\"BT0\": {\"start_row\": 1, \"rows\": [[\"Consulting\", \"2\", \"2,400 EUR\"], [\"Training\", \"1\", \"900 EUR\"]], \"trim\": true}},\n     \"content_controls\": {\"Customer\": \"Acme Corp\", \"Approved\": true},\n     \"replace\": {\"[Kunde]\": \"Acme Corp\"}\n   }\n   EOF\n   python3 \u002Fmnt\u002Fdata\u002Fskills\u002Fword-odt-skill\u002Fscripts\u002Fdocx_fill.py \"\u002Fmnt\u002Fdata\u002F\u003Cdoc>.docx\" \u002Ftmp\u002Fplan.json \"\u002Fmnt\u002Fdata\u002F\u003Cresult>.docx\"\n   ```\n\n   - `paragraphs`: key → text. A list or `\\n` adds paragraphs in the same style (e.g. more\n     bullets), `\u003Cbr>` is a line break, `null` deletes the paragraph. Images and text boxes anchored\n     in a paragraph stay.\n   - `tables`: fills rows from `start_row` (0 = header). More rows than the table has copy its\n     last row with its formatting. `null` keeps a cell, and `trim` removes unused sample rows.\n   - `content_controls`: by tag or title. `true`\u002F`false` ticks a checkbox. The placeholder style\n     (\"Klicken oder tippen…\") is removed.\n   - `replace`: substring everywhere: body, tables, text boxes, headers, footers.\n   - Text boxes are updated in both copies Word stores (otherwise older viewers show the old\n     text). Formatting comes from the paragraph and its first run.\n   - Keys always refer to the **source** document. The script resolves all of them before it\n     changes anything. Write the plan to `\u002Ftmp` in the same call, because files in `\u002Fmnt\u002Fdata`\n     become chat attachments.\n\n3. **Check**: the fill script ends with a check (exit code 2 and `CHECK FAILED` if sample text\n   or a content-control placeholder is left). `docx_inventory.py \"\u003Cresult>\" --check` checks on its\n   own. Deliberately empty fields (a signature line) are fine; name them in the answer.\n\n4. **Answer**: the result comes back as a chat attachment. Name what you filled and what stays\n   for the user to fill. You can only check the text, not the page layout. Ask the user to check\n   line and page breaks.\n\n**Without the scripts** (only `SKILL.md` was pasted): use python-docx (`import docx` first).\n\n- Walk all paragraphs, including table cells, text boxes (`w:txbxContent`), headers and footers.\n- Change text in the existing runs; setting `paragraph.text` wipes the formatting.\n- Copy a table row with `copy.deepcopy(row._tr)`.\n- Content controls are `w:sdt` elements. Remove `w:showingPlcHdr` after filling one.\n- See **templates-skill** (`references\u002Fcode-template-editing.md`) for the run-level replace recipe.\n\n**Limits:**\n\n- The sandbox has no LibreOffice, so there is no render and no PDF export of the result. For a\n  PDF, use `convert_document` (convert skill) on the finished DOCX if it is available.\n- ODT has no Python library in the sandbox.\n- Legacy form fields (`FORMTEXT`) and tracked changes are not handled; say so if the document\n  uses them.\n\n### Without code execution\n\nNo tool fills such a document in its own layout. Tell the user plainly, and offer:\n\n- Turn on code execution (chat\u002Fagent setting or the `RUN_CODE` permission from an admin).\n- Make the document a real template once: replace the sample text with `{{placeholders}}` in\n  Word and upload it as a template. After that, `create_word_from_template` fills it without code\n  (templates-skill).\n- The filled-in texts as a list to paste in, or a new document with `create_word` in the\n  companyFILES\u002FCI design, clearly labelled as not their template.\n\n## Key Notes\n\n- All create tools return `{id, filename, downloadUrl, markdownLink}` (plus `librechat_file_id` when the document is also stored as a chat file) — always render `markdownLink` in the reply.\n- In-place edit tools (`append_to_word`, `replace_word_content`) on a companyFILES document return the same `id` and an updated `markdownLink`. On a chat attachment (`librechat_file_id`) that was updated in place, they return only `{librechat_file_id, filename, message}` — there is no download link; tell the user the attached file was updated. If the attachment cannot be updated in place, the modified copy is saved as a **new** document and its new `id`\u002F`markdownLink` is returned — use that id from then on.\n- Inline images can be referenced via `doc:\u003CdocumentId>`, `lc:\u003Cfile_id>` or `img:\u003Cname>` (image library) in the Markdown or HTML of the create tools (`create_word`, `create_word_from_html`, `create_odt`, `create_odt_from_html`) — SVG is auto-converted to PNG for Word. `append_to_word` and `replace_word_content` do not resolve these references.\n- Unset page\u002Fheader\u002Ffooter options fall back to the org\u002Fuser theme defaults (e.g. `defaultPageSize`, `defaultHeaderText`, `defaultShowPageNumbers`) before the documented hard defaults apply.\n- For template-based Word creation (placeholders, loops, image injection), use the **templates-skill**. Image placeholders there are `{IMAGE name}` or `{%name}` (typed in one go); `width`\u002F`height` in cm form a box the image is fitted into without distortion (`fit`: `contain` default, `cover` crops, `stretch` only on request).\n- ODT files open natively in LibreOffice and Google Docs.\n- The org\u002Fuser CI is applied automatically when configured: colours, fonts and sizes, page format, header\u002Ffooter, page numbers and the logo at the configured position (header or footer, left\u002Fcenter\u002Fright). For a document you build yourself with code execution, `get_corporate_ci` returns the same values.\n",{"name":5,"description":7},"main","39e0752000720de2d20917bd46c1c5149c4a0221","en\u002Fskills\u002Ffiles\u002Fword-odt-skill","https:\u002F\u002Fgithub.com\u002FinnFactory-AI\u002Fcompany-ai-stack-skills","https:\u002F\u002Fgithub.com\u002FinnFactory-AI","https:\u002F\u002Finnfactory.ai","Engineering AI. Enabling Tomorrow.","2026-11-13 19:54:47",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add innFactory-AI\u002Fcompany-ai-stack-skills --skill word-odt-skill",{"tool":38,"command":39},"bunx","bunx skills add innFactory-AI\u002Fcompany-ai-stack-skills --skill word-odt-skill",{"tool":41,"command":42},"pnpm","pnpm dlx skills add innFactory-AI\u002Fcompany-ai-stack-skills --skill word-odt-skill","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FinnFactory-AI\u002Fcompany-ai-stack-skills\u002Fblob\u002Fmain\u002Fen\u002Fskills\u002Ffiles\u002Fword-odt-skill\u002FSKILL.md",true,[46,52],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"scripts\u002Fdocx_fill.py","SCRIPT","脚本",13446,"https:\u002F\u002Fgithub.com\u002FinnFactory-AI\u002Fcompany-ai-stack-skills\u002Fblob\u002Fmain\u002Fen\u002Fskills\u002Ffiles\u002Fword-odt-skill\u002Fscripts\u002Fdocx_fill.py",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"scripts\u002Fdocx_inventory.py",8058,"https:\u002F\u002Fgithub.com\u002FinnFactory-AI\u002Fcompany-ai-stack-skills\u002Fblob\u002Fmain\u002Fen\u002Fskills\u002Ffiles\u002Fword-odt-skill\u002Fscripts\u002Fdocx_inventory.py",[57,64,71,78,85,92],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7AF4HHK5B987T44HW7BZFVZ","sales-asset-skill","Produce tailored one-pagers, landing pages, case study drafts, and demo narratives personalised to a specific deal and buyer persona. Use when preparing collateral for a specific deal, building leave-behind materials, or customising standard assets for a prospect. Trigger with \"create a one-pager for\", \"sales deck for [deal]\", \"customise this asset for\".","https:\u002F\u002Fgithub.com\u002FinnFactory-AI\u002Fcompany-ai-stack-skills\u002Fblob\u002Fmain\u002Fen\u002Fskills\u002Fsales\u002Fsales-asset-skill\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7AF4D32V0FJE0QGCBZSQ7BW","pipeline-review-skill","Analyse deal health, surface stale or at-risk opportunities, and produce a prioritised weekly action plan. Use when preparing for a pipeline review meeting, assessing forecast accuracy, or identifying stuck deals. Trigger with \"review my pipeline\", \"pipeline health check\", \"deal risk analysis\".","https:\u002F\u002Fgithub.com\u002FinnFactory-AI\u002Fcompany-ai-stack-skills\u002Fblob\u002Fmain\u002Fen\u002Fskills\u002Fsales\u002Fpipeline-review-skill\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7AF48W7G8DMAHRAM125B192","outreach-skill","Research a prospect then draft personalised outreach with research-backed hooks, subject-line variants, and follow-up sequences. Use when cold-emailing a prospect, writing LinkedIn outreach, or building a multi-touch sequence. Trigger with \"draft outreach to [person\u002Fcompany]\", \"write cold email to\", \"outreach sequence for\".","https:\u002F\u002Fgithub.com\u002FinnFactory-AI\u002Fcompany-ai-stack-skills\u002Fblob\u002Fmain\u002Fen\u002Fskills\u002Fsales\u002Foutreach-skill\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7AF43VKNPQ7G1NTQ4MRH40J","forecast-skill","Build a weighted revenue forecast with risk flags, commit recommendations, and gap-to-quota analysis. Use when preparing for a forecast call, evaluating end-of-quarter projections, or assessing pipeline coverage. Trigger with \"build forecast\", \"forecast for this quarter\", \"where do I stand against quota\".","https:\u002F\u002Fgithub.com\u002FinnFactory-AI\u002Fcompany-ai-stack-skills\u002Fblob\u002Fmain\u002Fen\u002Fskills\u002Fsales\u002Fforecast-skill\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7AF3Z5N61VYSEJRYWXR4JP1","deal-strategy-skill","Map stakeholder power dynamics, surface deal risks, and recommend a step-by-step engagement strategy. Use when entering a complex deal, preparing for an executive sponsor meeting, or diagnosing a stuck opportunity. Trigger with \"plan deal strategy for\", \"stakeholder map\", \"how do I advance this deal\".","https:\u002F\u002Fgithub.com\u002FinnFactory-AI\u002Fcompany-ai-stack-skills\u002Fblob\u002Fmain\u002Fen\u002Fskills\u002Fsales\u002Fdeal-strategy-skill\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7AF3VGG29AX0T2X9WQ5MWDN","call-summary-skill","Extract action items, key topics, and objections from call notes or transcripts and draft a customer-facing follow-up email. Use after a sales call, demo, or discovery session. Trigger with \"summarise this call\", \"call notes from\", \"write follow-up for this meeting\".","https:\u002F\u002Fgithub.com\u002FinnFactory-AI\u002Fcompany-ai-stack-skills\u002Fblob\u002Fmain\u002Fen\u002Fskills\u002Fsales\u002Fcall-summary-skill\u002FSKILL.md",[],[]]