Logo Docx

Docx

Tổ chức
Navinspire-ia
docx

Works on existing Word (.docx) files at the package level with python-docx and lxml. Dumps and replaces text while keeping run formatting, adds or lists comments, accepts, rejects or creates tracked changes, unpacks, repacks and validates the OOXML package, converts with headless LibreOffice. Use when the user asks to "edit this Word file", "add comments to the docx", "accept all tracked changes", "replace the text in the contract" or "check why this docx is corrupted". In French "modifie ce fichier Word", "ajoute des commentaires dans ce document", "accepte les modifications suivies" or "remplace le texte du contrat". New documents from scratch belong to docx-generator.

Add to TypingMind

Tổng quan

Nhà phát hànhNavinspire-ia
Kho mãnavin
Tên kỹ năngdocx
Sao
37
Bản fork
5
Tệp đi kèm
6
Giấy phépAGPL-3.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 6 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được Navinspire-ia công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Docx trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/Navinspire-ia/navin/tree/main/navin/skills/docx
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Navinspire-ia/navin.git /tmp/navin
mkdir -p .claude/skills
cp -r /tmp/navin/navin/skills/docx .claude/skills/docx
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Docx trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Docx ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Docx với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

DOCX Toolkit

Overview

This skill edits Word files that already exist: contracts, reports, templates sent by the user. It preserves what is there (styles, numbering, headers, images, revision history) and changes only what was asked. All scripts run with exec and the bundled libraries (python-docx, lxml); nothing has to be installed first.

Pick the sibling skill when the job is different:

  • docx-generator: write a new report, letter or proposal from a brief or an HTML template.
  • pdf-generator: the deliverable must be a PDF rendered from HTML.
  • pdf: the input is a PDF, not a Word file.

Workflow

1. Read before touching

  1. Dump the text with python3 navin/skills/docx/scripts/docx_text.py dump input.docx --format markdown (or --format json for paragraph indexes, style names and table flags). Read the result with read_file when it is long.
  2. Count revisions and comments: python3 navin/skills/docx/scripts/docx_track.py count input.docx --json and python3 navin/skills/docx/scripts/docx_comments.py list input.docx. A document with pending revisions must be accepted or rejected first when the user wants a clean copy.
  3. Validate the package when Word complains or when the file comes from an unknown generator: python3 navin/skills/docx/scripts/office_pkg.py validate input.docx --json.

2. Edit

Always write to a new file with --out edited.docx unless the user explicitly wants the original overwritten.

  • Plain text replacement that keeps bold, italics and fonts of the matched run: docx_text.py replace input.docx --find "Old name" --with "New name" --all --out edited.docx.
  • Legal or review context, where the change must stay visible: docx_track.py replace input.docx --find "30 days" --with "45 days" --author "Navin" --out edited.docx records a tracked deletion followed by a tracked insertion.
  • Comments for a reviewer: docx_comments.py add input.docx --anchor "Payment terms" --text "Confirm the due date with finance." --author "Navin" --out edited.docx anchors the comment on the first paragraph containing the anchor text.
  • Accept or reject everything: docx_track.py accept input.docx --out clean.docx keeps insertions and drops deletions; reject does the opposite. Both clear formatting-change records in body, headers, footers, footnotes and endnotes.

3. Package-level surgery

When python-docx has no API for the change (content controls, custom XML, numbering restart, header images, broken relationships):

  1. office_pkg.py unpack input.docx work/ extracts the parts with pretty-printed XML.
  2. Edit work/word/document.xml (or styles.xml, numbering.xml, header1.xml) with edit_file. Keep w:r runs intact; a text node always lives inside w:t inside w:r inside w:p.
  3. office_pkg.py pack work/ output.docx zips the folder back with [Content_Types].xml first and minified XML.
  4. office_pkg.py validate output.docx before delivering: zip integrity, every content type and relationship target present, well-formed XML, python-docx round trip.

Read references/ooxml-anatomy.md first: it maps the parts, the paragraph and run model, tracked-change and comment markup, and the pitfalls that break Word.

4. Convert

python3 navin/skills/docx/scripts/office_convert.py edited.docx --to pdf --out-dir out/ drives headless LibreOffice. The script exits with a clear message when soffice is missing: say so instead of silently skipping the PDF, and offer the pdf-generator route if the content can be re-rendered from HTML.

5. Deliver

Re-run docx_text.py dump on the result and quote the changed paragraphs to the user. Attach the file. State what was not changed (styles, images, other sections) so the user knows the scope.

Scripts

ScriptCommand
scripts/docx_text.pydump FILE [--format json|markdown] [--no-tables]; replace FILE --find T --with T [--all] [--out F]
scripts/docx_comments.pylist FILE; add FILE --anchor T --text T [--author A] [--initials I] [--out F]
scripts/docx_track.pyaccept|reject FILE [--out F]; replace FILE --find T --with T [--author A] [--all] [--out F]; count FILE [--json]
scripts/office_pkg.pyunpack ARCHIVE DIR [--no-pretty]; pack DIR ARCHIVE [--no-minify]; validate ARCHIVE [--json] [--no-roundtrip]
scripts/office_convert.pySOURCE --to pdf|docx|html|pptx|xlsx [--out-dir D] [--timeout S] [--json]

Exit codes: 0 success, 1 nothing matched or validation failed, 2 usage or I/O error, 3 LibreOffice missing.

Rules

  • Language gate: when new text is written into the document (comments, inserted sentences, headings), ask for the document language if the user did not state it, and keep the language of the surrounding text.
  • Never put em dashes (U+2014) or en dashes (U+2013) in produced text. Use "-" or rephrase.
  • Keep the file editable: no screenshots pasted in place of text, no flattening to PDF unless asked.
  • Preserve run formatting: replace inside runs, do not rebuild paragraphs from scratch.
  • Tracked changes are the default in legal, HR and contract documents; silent edits are the default in drafts and templates. Ask when unsure.
  • Validate every file produced by package-level edits before delivering it; a corrupted docx is worse than no file.
  • Report partial results honestly: exit 1 from replace means the text was not found; say it and show the closest paragraphs from the dump.

References

  • references/ooxml-anatomy.md: package parts, paragraph and run model, styles and numbering, headers and footers, tracked changes and comments markup, common pitfalls.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Docx làm được gì?

Works on existing Word (.docx) files at the package level with python-docx and lxml. Dumps and replaces text while keeping run formatting, adds or lists comments, accepts, rejects or creates tracked changes, unpacks, repacks and validates the OOXML package, converts with headless LibreOffice. Use when the user asks to "edit this Word file", "add comments to the docx", "accept all tracked changes", "replace the text in the contract" or "check why this docx is corrupted". In French "modifie ce fichier Word", "ajoute des commentaires dans ce document", "accepte les modifications suivies" or "r...

Vì sao nên dùng Docx trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Docx là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Docx trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Navinspire-ia/navin/tree/main/navin/skills/docx. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Docx?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Docx với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Docx với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Docx có miễn phí không?

Có. Kỹ năng này được Navinspire-ia phát hành trên GitHub theo giấy phép AGPL-3.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇