About docx-contracts
docx-contracts is a skill for filling DOCX contract and form templates with data. It extracts the template schema, maps supplied information to its fields, and requires missing or uncertain values to be clarified rather than guessed.
Key features
- 01Extract template variables and schema
- 02Match context data to schema fields
- 03Flag missing or uncertain required values
- 04Fill Jinja2-based DOCX templates
Use cases
- 01Populating a contract from supplied details
- 02Filling a form while checking required fields
- 03Generating a DOCX from a Jinja2 template
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ artwist-polyakov/ polyakov-claude-skills --skill docx-contractsAfter installing, type/docx-contractsin Claude Code to confirm it loaded.
Bundled filesscripts/extract_schema.pyscripts/fill_template.py
Details
From the project READMEdocx-contracts
Automated contract and form filling using docxtpl library.
Workflow
Be shure, that you recieve docx file. Don't try to read it.
- Extract schema: Run
scripts/extract_schema.py <template.docx>to get variables list and JSON schema. Don't read file. Just launch script. - Gather data: Extract values from user message context, matching schema fields. Use Claude completion for extraction if needed
- Handle missing data: If any required field is missing or uncertain, ask user directly. Do not guess
- Fill template: Create JSON file with data, then run
scripts/fill_template.py <template.docx> <data.json> <output.docx> - Deliver: Move result to
/mnt/user-data/outputs/and provide download link. Please don't read output file.
Key Points
- Template must use Jinja2 syntax:
{{VARIABLE_NAME}} - All required fields from schema must be filled
- Ask user for missing data - never invent values
- Install docxtpl if needed:
pip install docxtpl --break-system-packages
Comments
Markdown supported