{"id":"62b9c6a0-b067-45d1-94f5-0d5453be8f6a","shortId":"vRBBdb","kind":"skill","title":"lovstudio:fill-form","tagline":"Fill in Word document form templates (.docx) with user-provided data. Reads a template containing tables with label→value cell pairs, detects all fillable fields, and outputs a completed document. Handles CJK/Latin mixed text with proper font switching. Use this skill when the us","description":"# fill-form — Fill Word Form Templates\n\nThis skill fills in Word document form templates (.docx) with user-provided data.\nIt detects table-based form fields (label in one cell, value in the adjacent cell)\nand populates them automatically.\n\n## When to Use\n\n- User has a `.docx` form template with blank fields to fill\n- User wants to fill in an application form, registration form, etc.\n- Document uses Word tables for form layout (label | value cell pairs)\n- User mentions 填表, 申请表, 登记表, or wants to automate form filling\n\n## Workflow (MANDATORY)\n\n**You MUST follow these steps in order:**\n\n### Step 1: Scan the template\n\nDiscover all fillable fields:\n\n```bash\npython lovstudio-fill-form/scripts/fill_form.py --template <path> --scan\n```\n\n### Step 2: Pre-fill from known context\n\nBefore asking the user, try to fill as many fields as possible from:\n1. **User memory** — name, title, organization, etc.\n2. **Context files** — if the user provides reference documents (e.g. STARTER-PROMPT.md,\n   project docs), extract relevant info to fill content-heavy fields\n3. **Conversation context** — anything already mentioned\n\nFor content-heavy fields (e.g. \"主要内容/简介/摘要\"), actively compose the content\nby synthesizing from context files, user's known expertise, and the topic/title.\n\n### Step 3: Ask only what you don't know\n\n**Use `AskUserQuestion` to collect ONLY the fields you cannot fill from context.**\n\n- Group fields into a single question\n- If ALL fields are unknown, list them all\n- If the user says some fields can be left blank (e.g. \"其他朋友会帮我填\"),\n  respect that and leave those empty\n- Do NOT force the user to provide every field\n\n### Step 4: Fill and save\n\nWrite a JSON data file (avoids shell escaping issues with long text), then run:\n\n```bash\npython lovstudio-fill-form/scripts/fill_form.py \\\n  --template <path> \\\n  --data-file /tmp/form_data.json\n```\n\n**Output path rules:**\n- Default: `<template_dir>/<name>_filled.docx` (same directory as the template)\n- If the template is in a temp directory or system path, save to user's document\n  directory or ask the user where to save\n- Use `--output` to override explicitly\n\n## CLI Reference\n\n| Argument | Default | Description |\n|----------|---------|-------------|\n| `--template` | (required) | Path to template .doc/.docx file |\n| `--output` | `<template_dir>/<name>_filled.docx` | Output .docx path |\n| `--scan` | false | List all detected form fields |\n| `--data` | `\"\"` | JSON string with field→value mapping |\n| `--data-file` | `\"\"` | Path to JSON file with field→value mapping |\n| `--font` | Platform CJK serif | Font name for filled text |\n| `--font-size` | `11` | Font size in points |\n\n## How Field Detection Works\n\n1. **Table-based** (primary): Scans all tables for rows with label→value cell pairs.\n   A label cell contains short text (CJK or Latin); the adjacent cell is the value field.\n2. **Merged rows**: Detects full-width merged cells with \"Label：\" pattern as large text areas.\n3. **Paragraph fallback**: If no tables found, detects \"Label：value\" patterns in paragraphs.\n\n## Limitations\n\n- `.doc` files are auto-converted to `.docx` via macOS `textutil`, which **loses table structure**.\n  For best results, use `.docx` templates directly. If you only have `.doc`, convert with\n  LibreOffice first: `libreoffice --headless --convert-to docx file.doc`\n- Fields are matched by normalized label text (whitespace removed). If a label contains\n  unusual formatting, the match may fail — use `--scan` to verify detection.\n\n## Dependencies\n\n```bash\npip install python-docx --break-system-packages\n```","tags":["fill","form","skills","lovstudio","agent-skills","ai-coding-assistant","cjk","claude-code","cursor","gemini-cli","markdown-to-docx","markdown-to-pdf"],"capabilities":["skill","source-lovstudio","skill-fill-form","topic-agent-skills","topic-ai-coding-assistant","topic-cjk","topic-claude-code","topic-cursor","topic-gemini-cli","topic-markdown-to-docx","topic-markdown-to-pdf"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/lovstudio/skills/fill-form","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add lovstudio/skills","source_repo":"https://github.com/lovstudio/skills","install_from":"skills.sh"}},"qualityScore":"0.470","qualityRationale":"deterministic score 0.47 from registry signals: · indexed on github topic:agent-skills · 40 github stars · SKILL.md body (3,565 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T00:56:34.420Z","embedding":null,"createdAt":"2026-04-18T22:18:57.330Z","updatedAt":"2026-04-22T00:56:34.420Z","lastSeenAt":"2026-04-22T00:56:34.420Z","tsv":"'/scripts/fill_form.py':162,333 '/tmp/form_data.json':338 '1':148,186,441 '11':432 '2':166,193,472 '3':215,247,488 '4':309 'activ':230 'adjac':85,466 'alreadi':219 'anyth':218 'applic':111 'area':487 'argument':380 'ask':174,248,367 'askuserquest':256 'auto':506 'auto-convert':505 'autom':135 'automat':90 'avoid':318 'base':75,444 'bash':156,327,565 'best':518 'blank':101,290 'break':572 'break-system-packag':571 'cannot':263 'cell':25,81,86,125,454,458,467,480 'cjk':422,462 'cjk/latin':37 'cli':378 'collect':258 'complet':34 'compos':231 'contain':20,459,552 'content':212,223,233 'content-heavi':211,222 'context':172,194,217,237,266 'convers':216 'convert':507,529,536 'convert-to':535 'data':16,70,316,336,402,410 'data-fil':335,409 'default':342,381 'depend':564 'descript':382 'detect':27,72,399,439,475,495,563 'direct':523 'directori':345,356,365 'discov':152 'doc':205,502,528 'doc/.docx':388 'document':8,35,62,116,201,364 'docx':11,65,97,393,509,521,538,570 'e.g':202,226,291 'empti':298 'escap':320 'etc':115,192 'everi':306 'expertis':242 'explicit':377 'extract':206 'fail':558 'fallback':490 'fals':396 'field':30,77,102,155,182,214,225,261,268,275,286,307,401,406,417,438,471,540 'file':195,238,317,337,389,411,415,503 'file.doc':539 'fill':3,5,51,53,59,104,108,137,160,169,179,210,264,310,331,427 'fill-form':2,50 'fillabl':29,154 'filled.docx':343,391 'first':532 'follow':142 'font':42,420,424,430,433 'font-siz':429 'forc':301 'form':4,9,52,55,63,76,98,112,114,121,136,161,332,400 'format':554 'found':494 'full':477 'full-width':476 'group':267 'handl':36 'headless':534 'heavi':213,224 'info':208 'instal':567 'issu':321 'json':315,403,414 'know':254 'known':171,241 'label':23,78,123,452,457,482,496,545,551 'larg':485 'latin':464 'layout':122 'leav':296 'left':289 'libreoffic':531,533 'limit':501 'list':278,397 'long':323 'lose':514 'lovstudio':1,159,330 'lovstudio-fill-form':158,329 'maco':511 'mandatori':139 'mani':181 'map':408,419 'match':542,556 'may':557 'memori':188 'mention':128,220 'merg':473,479 'mix':38 'must':141 'name':189,425 'normal':544 'one':80 'order':146 'organ':191 'output':32,339,374,390,392 'overrid':376 'packag':574 'pair':26,126,455 'paragraph':489,500 'path':340,359,385,394,412 'pattern':483,498 'pip':566 'platform':421 'point':436 'popul':88 'possibl':184 'pre':168 'pre-fil':167 'primari':445 'project':204 'proper':41 'provid':15,69,199,305 'python':157,328,569 'python-docx':568 'question':272 'read':17 'refer':200,379 'registr':113 'relev':207 'remov':548 'requir':384 'respect':293 'result':519 'row':450,474 'rule':341 'run':326 'save':312,360,372 'say':284 'scan':149,164,395,446,560 'serif':423 'shell':319 'short':460 'singl':271 'size':431,434 'skill':46,58 'skill-fill-form' 'source-lovstudio' 'starter-prompt.md':203 'step':144,147,165,246,308 'string':404 'structur':516 'switch':43 'synthes':235 'system':358,573 'tabl':21,74,119,443,448,493,515 'table-bas':73,442 'temp':355 'templat':10,19,56,64,99,151,163,334,348,351,383,387,522 'text':39,324,428,461,486,546 'textutil':512 'titl':190 'topic-agent-skills' 'topic-ai-coding-assistant' 'topic-cjk' 'topic-claude-code' 'topic-cursor' 'topic-gemini-cli' 'topic-markdown-to-docx' 'topic-markdown-to-pdf' 'topic/title':245 'tri':177 'unknown':277 'unusu':553 'us':49 'use':44,93,117,255,373,520,559 'user':14,68,94,105,127,176,187,198,239,283,303,362,369 'user-provid':13,67 'valu':24,82,124,407,418,453,470,497 'verifi':562 'via':510 'want':106,133 'whitespac':547 'width':478 'word':7,54,61,118 'work':440 'workflow':138 'write':313 '主要内容':227 '其他朋友会帮我填':292 '填表':129 '摘要':229 '申请表':130 '登记表':131 '简介':228","prices":[{"id":"f2fd4ab3-6782-49f7-9ab8-e2fa3f703424","listingId":"62b9c6a0-b067-45d1-94f5-0d5453be8f6a","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"lovstudio","category":"skills","install_from":"skills.sh"},"createdAt":"2026-04-18T22:18:57.330Z"}],"sources":[{"listingId":"62b9c6a0-b067-45d1-94f5-0d5453be8f6a","source":"github","sourceId":"lovstudio/skills/fill-form","sourceUrl":"https://github.com/lovstudio/skills/tree/main/skills/fill-form","isPrimary":false,"firstSeenAt":"2026-04-18T22:18:57.330Z","lastSeenAt":"2026-04-22T00:56:34.420Z"}],"details":{"listingId":"62b9c6a0-b067-45d1-94f5-0d5453be8f6a","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"lovstudio","slug":"fill-form","github":{"repo":"lovstudio/skills","stars":40,"topics":["agent-skills","ai-coding-assistant","cjk","claude-code","cursor","gemini-cli","markdown-to-docx","markdown-to-pdf"],"license":"mit","html_url":"https://github.com/lovstudio/skills","pushed_at":"2026-04-21T15:57:51Z","description":"Agent skills for AI coding assistants — Markdown to PDF/DOCX with 14 themes, CJK support","skill_md_sha":"d1e9a2aec24a5897171f88e38f8b978b13c240c2","skill_md_path":"skills/fill-form/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/lovstudio/skills/tree/main/skills/fill-form"},"layout":"multi","source":"github","category":"skills","frontmatter":{"name":"lovstudio:fill-form","license":"MIT","description":"Fill in Word document form templates (.docx) with user-provided data. Reads a template containing tables with label→value cell pairs, detects all fillable fields, and outputs a completed document. Handles CJK/Latin mixed text with proper font switching. Use this skill when the user wants to fill in a form template, complete an application form, populate a Word table form, or automate document filling. Also trigger when the user mentions \"填表\", \"填写表格\", \"fill form\", \"fill template\", \"表格填写\", \"申请表\", \"登记表\", or has a .docx template with blank fields to fill.","compatibility":"Requires Python 3.8+ and python-docx (`pip install python-docx`). Cross-platform: macOS, Windows, Linux. Input must be .docx (recommended) or .doc (auto-converted via textutil on macOS, but table structure may be lost — use .docx when possible)."},"skills_sh_url":"https://skills.sh/lovstudio/skills/fill-form"},"updatedAt":"2026-04-22T00:56:34.420Z"}}