aperivue/medsci-skills/fill-protocol
- community
Checking that the SKILL.md file is still in the repository.
Use when an institutional Word form (.doc/.docx IRB protocol, ethics application, grant template) must be filled without breaking its styles, tables, fonts or page layout. Renders content drafted by /write-protocol into the template; CJK-aware.
Install
npx vskill@latest install aperivue/medsci-skills/fill-protocolSKILL.md
Fill-Protocol Skill
Core Principles (Do Not Violate)
- Open the existing template — never create from scratch. Use
Document(template_path), not
Document(): rebuilding loses the header logo, custom margins, footer placeholders and page numbering. Replace cell/paragraph text in place; never a single cell.text = "value" assignment, which erases run-level styles (bold, color, eastAsia font).
- Convert .doc → .docx via LibreOffice headless before any editing.
pandoc -f docis not
supported; textutil corrupts table structure (merged cells dropped).
- Match cells by left-label text, not row/column coordinates such as
table.cell(2, 1).
Templates evolve and coordinate matching breaks silently.
- Apply `cantSplit` to every filled row so a row never breaks across pages.
- For CJK languages, set the `eastAsia` font attribute, not just
run.font.name, or
Hangul/Kanji/Hanzi render in fallback fonts.
- Validate every fill operation: resolve every
[MISS]line and everyWARN:line
([TABLE-MISS], [SECTION-MISS], [RAW-NEWLINE]) before the filled form is submitted.
Dependencies
Python packages docxtpl python-docx pyyaml are always required. LibreOffice is needed only for a legacy .doc template (~700 MB on macOS). The bundled setup.sh detects what is missing:
When invoking this skill on behalf of a user:
- Skip LibreOffice entirely if the template is already
.docx. - Before calling `doc_to_docx.py`, run
setup.sh check. If LibreOffice is missing, **ask the
user** before installing, because the cask is ~700 MB.
- Never pass
--yestosetup.sh installunless the user has explicitly authorized
unattended installation in this session, because it installs without prompting.
- If the user declines, ask them to convert the
.docmanually (Word/LibreOffice/Pages → Save
As → .docx) and re-run with the converted file.
Workflow
Step 1 — Convert legacy .doc to .docx (if needed)
Step 2 — Inspect the template structure
It lists every table, every cell (coordinates and content preview) and every top-level paragraph. Take the exact labels for the YAML from this output.
Step 3 — Author a content YAML
Start from ${CLAUDE_SKILL_DIR}/examples/example_irb_template.yaml. Three fill modes; all keys are optional.
Read ${CLAUDE_SKILL_DIR}/references/best_practices.md (Readability knobs) before changing any readability option from its default.
Content rules: put a reference in only with a /search-lit-confirmed DOI or PMID, otherwise mark it [UNVERIFIED - NEEDS MANUAL CHECK]; mark any unconfirmed clinical definition, diagnostic criterion or guideline claim [VERIFY] and ask the user.
Step 4 — Run the fill
The CLI prints [OK] / [MISS] for every fill operation, a summary, then any WARN: lines. Investigate every [MISS] and WARN: before submitting (Principle 6).
Every value under table_kv, section_replace and paragraph_replace is written exactly as typed (012345, 12:30, 1.10, No stay text). An empty value or a list/mapping value stops the run with exit 2 and names the label; write '' to blank a field on purpose. A section_replace on a header with no later numbered header replaces everything to the end of the document, and its [OK] line says so with the number of paragraphs replaced. If a signature/date block or anything else follows the last section, bound it with section_end (header -> regex matched against the paragraph that starts the kept block):
Step 5 — Visual verification
Without LibreOffice (a .docx template skips it), export the PDF from Word instead. Open the PDF and confirm: page count is sensible, no table row was split across pages, no font fell back to Times New Roman, all required fields are populated.
Read ${CLAUDE_SKILL_DIR}/references/best_practices.md when a label or section header does not match, the template has no numbered section headers (section_end), a cell needs multi-line content, or cells are merged.
Known Limitations
- HWP / HWPX input is not handled directly — convert it to
.docxfirst. - Merged cells: filling a label cell that participates in a vertical merge may overwrite the
merged region's content. Test on a copy first.
- Embedded form fields (Word content controls): not supported; plain paragraph and table cell
content only.
- Right-to-left scripts (Arabic, Hebrew): untested.
- Last section with no later header: replaced through the end of the document unless a
section_end pattern is given; the filler cannot tell the section body from a trailing block.
Security
- Security scanPassed, 72 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/fill-protocol/SKILL.md
Popularity
- Repository stars
- 322
- Repository forks
- 78
- 7-day trend score
- 29
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/aperivue/medsci-skills/fill-protocol)