Conditional Sections in Word Templates

SkillDocs & knowledge

Handle conditional sections in Word templates with IF/END_IF markers, removing or keeping content based on data values.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Conditional Sections in Word Templates skill

What this skill tells your AI

The instructions your AI receives, as published by cxcscmu/skilllearnbench in skills/b1-one-shot-claude-opus-4-6/offer-letter-generator/docx-conditionals/SKILL.md and read by ahel’s review.

Pattern

Templates use {{IF_TAG}}content{{END_IF_TAG}} to mark conditional content.

Logic

  1. Check the data field (e.g., RELOCATION_PACKAGE) for "Yes"/"No"
  2. If "Yes": strip the {{IF_RELOCATION}} and {{END_IF_RELOCATION}} markers, keep inner content
  3. If "No": remove the entire block including markers and content
  4. Handle the case where conditional markers and content may span a single paragraph or multiple paragraphs

Implementation Note

Process conditionals BEFORE placeholder replacement, since the conditional content may itself contain placeholders that should only be replaced if the section is kept.

Signals

GitHub stars
83
Forks
5
Last commit
Jul 2026
Advanced
Catalog kind
skill
Gateway key
docx-conditionals
Source
github.com/cxcscmu/skilllearnbench