agentsclimarketplace

Docx conditionals

Skill cxcscmu/SkillLearnBench/skills/b1-one-shot-claude-opus-4-6/offer-letter-generator/docx-conditionals

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

Install
npx -y skills add cxcscmu/SkillLearnBench --skill docx-conditionals

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

0.8 KB, 149 tokens by cl100k_base, as published. Nobody here has run it

Conditional Sections in Word Templates

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.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.