Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
lovstudio avatar

Lovstudio:Fill Form

  • 2 installs
  • Updated May 7, 2026
  • lovstudio/fill-form-skill

Fills Word (.docx) form templates with user data by detecting label-to-value table cells and outputting a completed document.

About

Reads a .docx template with label-value table cells, detects fillable fields, and outputs a completed document with proper CJK/Latin font switching. A user uses it to auto-fill application, registration, or Word table forms.

  • Detects label-to-value cell pairs in Word table forms
  • Handles CJK/Latin mixed text with font switching

Lovstudio:Fill Form by the numbers

  • 2 all-time installs (skills.sh)
  • Ranked #548 of 688 Office & Documents skills by installs in the Skillselion catalog
  • Data as of Jul 25, 2026 (Skillselion catalog sync)
npx skills add https://github.com/lovstudio/fill-form-skill --skill lovstudiofill-form

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2
Last updatedMay 7, 2026
Repositorylovstudio/fill-form-skill

What it does

Fills Word (.docx) form templates with user data by detecting label-to-value table cells and outputting a completed document.

Files

SKILL.mdMarkdownGitHub ↗

fill-form — Fill Word Form Templates

This skill fills in Word document form templates (.docx) with user-provided data. It detects table-based form fields (label in one cell, value in the adjacent cell) and populates them automatically.

When to Use

  • User has a .docx form template with blank fields to fill
  • User wants to fill in an application form, registration form, etc.
  • Document uses Word tables for form layout (label | value cell pairs)
  • User mentions 填表, 申请表, 登记表, or wants to automate form filling

Workflow (MANDATORY)

You MUST follow these steps in order:

Step 1: Scan the template

Discover all fillable fields:

python lovstudio-fill-form/scripts/fill_form.py --template <path> --scan

Step 2: Pre-fill from known context

Before asking the user, try to fill as many fields as possible from: 1. User memory — name, title, organization, etc. 2. Context files — if the user provides reference documents (e.g. STARTER-PROMPT.md, project docs), extract relevant info to fill content-heavy fields 3. Conversation context — anything already mentioned

For content-heavy fields (e.g. "主要内容/简介/摘要"), actively compose the content by synthesizing from context files, user's known expertise, and the topic/title.

Step 3: Ask only what you don't know

Use `AskUserQuestion` to collect ONLY the fields you cannot fill from context.

  • Group fields into a single question
  • If ALL fields are unknown, list them all
  • If the user says some fields can be left blank (e.g. "其他朋友会帮我填"),

respect that and leave those empty

  • Do NOT force the user to provide every field

Step 4: Fill and save

Write a JSON data file (avoids shell escaping issues with long text), then run:

python lovstudio-fill-form/scripts/fill_form.py \
  --template <path> \
  --data-file /tmp/form_data.json

Output path rules:

  • Default: <template_dir>/<name>_filled.docx (same directory as the template)
  • If the template is in a temp directory or system path, save to user's document

directory or ask the user where to save

  • Use --output to override explicitly

CLI Reference

ArgumentDefaultDescription
--template(required)Path to template .doc/.docx file
--output<template_dir>/<name>_filled.docxOutput .docx path
--scanfalseList all detected form fields
--data""JSON string with field→value mapping
--data-file""Path to JSON file with field→value mapping
--fontPlatform CJK serifFont name for filled text
--font-size11Font size in points

How Field Detection Works

1. Table-based (primary): Scans all tables for rows with label→value cell pairs. A label cell contains short text (CJK or Latin); the adjacent cell is the value field. 2. Merged rows: Detects full-width merged cells with "Label:" pattern as large text areas. 3. Paragraph fallback: If no tables found, detects "Label:value" patterns in paragraphs.

Limitations

  • .doc files are auto-converted to .docx via macOS textutil, which loses table structure.

For best results, use .docx templates directly. If you only have .doc, convert with LibreOffice first: libreoffice --headless --convert-to docx file.doc

  • Fields are matched by normalized label text (whitespace removed). If a label contains

unusual formatting, the match may fail — use --scan to verify detection.

Dependencies

pip install python-docx --break-system-packages

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.