Human docx

From ksmaster03/claude-canfly-skill · View interactive version

Human docx is an AI agent skill from the GitHub repository ksmaster03/claude-canfly-skill. Draft Word (.docx) documents that read as genuinely written by a person — formal letters, company/HR announcements, memos (บันทึกข้อความ), general correspondence — in Thai or English, instead of the emoji-headers-and-color-tables look AI output defaults to. Trigger this whenever the user asks for a

How to use this skill

Skill file

Writing documents that read as human-written

AI-generated Word documents have a recognizable tell: emoji stapled onto every heading, bullet lists standing in for paragraphs, colored highlight tables for anything resembling a schedule, and horizontal rules chopping the page into little dashboard cards. A person writing a real letter, announcement, or memo doesn't do any of that — they write in sentences, group related sentences into paragraphs, and use a bold word or two only where it actually helps the reader find something later.

This skill produces the second kind of document. Use the bundled helper script rather than hand-rolling python-docx calls each time — it already has the Thai font plumbing worked out (see "Common pitfall" below), and reusing it means every document this skill produces looks consistent.

The rules, and why they matter

None of this means the document should look bare or unstructured — it means the structure is the kind a human writer produces: a clear opening line, one paragraph per idea, and a closing line, the same shape as an email you'd actually receive from a colleague.

Workflow

  1. Confirm the content first, formatting second. Get (or infer from the conversation) what the document needs to say: who it's to, the core fact/decision/date, any actions the reader needs to take, who signs it. Don't ask the user to specify formatting preferences unless they've given contradictory signals — the plain-prose style is the default for this skill, not one option among several.
  2. Pick the font and register.
  1. Build the document with the bundled script, not raw python-docx boilerplate. From a scratch Python file:

```python

import sys

sys.path.insert(0, r"~\.claude\skills\human-docx\scripts")

from human_docx import new_document, add_para, add_rich, add_page_break, save

doc = new_document()

add_para(doc, "เรียน เพื่อนพนักงานทุกท่าน", space_after=10)

add_para(doc, "ย่อหน้าที่อธิบายเนื้อหาหลัก เขียนต่อเนื่องเป็นประโยคสมบูรณ์ ...", space_after=10)

add_rich(doc, [("ส่วนที่อยากเน้น เช่นวันที่ ", False), ("25 กันยายน 2569", True), (" เขียนแทรกในประโยคได้เลย", False)])

add_para(doc, "ขอแสดงความนับถือ", space_after=2)

add_para(doc, "[ชื่อผู้ลงนาม]", space_after=0)

save(doc, r"<path>\to\output.docx")

```

add_para covers a single-run paragraph (size, bold, color, italic, spacing). add_rich covers a paragraph that mixes bold/plain runs in one sentence — use it instead of breaking a sentence across paragraphs just to bold part of it. See the docstrings in scripts/human_docx.py for the full parameter list.

  1. Common structure for a formal letter/announcement/memo, adapt as needed — this is a shape, not a template to fill in mechanically:
  1. Before declaring done, check the output against the rules above — search your own draft mentally for emoji, bullet-heavy sections that are really prose, and any table/shading you added out of habit rather than because the content is tabular.

Common pitfall: Thai text in a raw string / docstring

If you write your own script instead of importing the helpers, remember that a Windows path like C:\Users\... inside a normal (non-raw) Python string will choke on sequences like \U (interpreted as the start of an 8-hex-digit unicode escape) — prefix the string with r (r"C:\Users\..." or r"""...""") whenever it contains a Windows path or arbitrary backslashes. The bundled script already does this.

If the file won't save

save() raises a clear PermissionError if the target path is open in Word — this happens often when you're re-generating a file you just sent the user for review. Ask the user to close it, or write to a new filename, rather than guessing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.