name: document-generator description: Generate professional business documents (.docx) in Thai with TH Sarabun New font. Supports Quotations, Invoices, Billing Notes, Receipts, and Purchase Orders (PO). Use this skill whenever the user asks to create any of these business documents. It reads details from a JSON file and outputs a cleanly formatted docx.
Document Generator
This skill generates professional business documents in .docx format, suitable for Thai businesses. It automatically calculates totals, VAT, and formats the document with corporate colors and "TH Sarabun New" font.
Supported Document Types
You can specify the document type in the JSON under document.type. Supported types are:
QUOTATION(ใบเสนอราคา) - DefaultINVOICE(ใบแจ้งหนี้)BILLING_NOTE(ใบวางบิล)RECEIPT(ใบเสร็จรับเงิน)PURCHASE_ORDERorPO(ใบสั่งซื้อ)PURCHASE_REQUISITIONorPR(ใบขออนุมัติสั่งซื้อ)PRICE_COMPARISON(จดหมายเปรียบเทียบราคาซัพพลายเออร์)
How to use
- Read the user's request to understand the document details (type, company info, customer info, items, prices).
- If the user hasn't provided all the details, you can use placeholder data or ask them for more info.
- Create a JSON file in the user's current directory (e.g.
document-data.json) using the format shown inassets/document-template.json. Be sure to setdocument.typecorrectly! - Ensure
docxis installed in the workspace (npm install docx). - Run the generator script passing the JSON file path:
node <path_to_this_skill>/scripts/create-document.js document-data.json - The script will generate a
.docxfile (default nameDocument_Output.docxor as specified in the JSONsettings.outputFileName).
JSON Data Structure
See assets/document-template.json for the exact schema. Make sure to fill out:
company: The issuing company's detailscustomer: The receiving customer's details (or vendor if PO)document: type, docNo, date, issuer, paymentTermsitems: Array of items withdescription,qty,pricetaxRate: Number (e.g., 7 for 7% VAT)notes: Array of string notessettings: Color and font preferences.