template-processing

template-processing is a skill for Claude Code, Codex from cxcscmu/SkillLearnBench. It costs 11 tokens per session (1,473 once invoked), scanned A, original, MIT.

A guide to filling templates by replacing placeholders such as names or dates and showing or hiding conditional sections. It applies to text and document templates.

In plain words
What is it for?
Use it to generate documents from JSON or other structured data, including optional sections controlled by conditions.
Why use it?
It removes repetitive manual editing and prevents leftover template markers from appearing in finished documents.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to generate documents from JSON or other structured data, including optional sections controlled by conditions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cxcscmu/skilllearnbench/template-processing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cxcscmu/SkillLearnBench --skill template-processing
Clone the repo
git clone --depth 1 https://github.com/cxcscmu/SkillLearnBench

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for template-processing

README.md
[![agentmods](https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/template-processing/github.svg)](https://agentmods.dev/skills/cxcscmu/skilllearnbench/template-processing)
Your own site
<a href="https://agentmods.dev/skills/cxcscmu/skilllearnbench/template-processing"><img src="https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/template-processing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for template-processing

Your own site · 80×15
<a href="https://agentmods.dev/skills/cxcscmu/skilllearnbench/template-processing"><img src="https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/template-processing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,473 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00011 $0.01473
Opus 5.5 $0.00004 $0.00589
Sonnet 5.5 $0.00002 $0.00295
Haiku 4.5 $0.00001 $0.00147

Measured 3mo ago against content hash 2877912314af, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

template-processing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/b1-one-shot-claude-haiku-4-5/offer-letter-generator/template-processing/SKILL.md · 226 lines

How it starts

The opening of the file, as written. The whole thing — 226 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Template Processing: Placeholders and Conditionals

Overview

When filling document templates, you often need to:

  1. Replace placeholders like {{PLACEHOLDER}} with actual data
  2. Handle conditional sections (show/hide content based on data)
  3. Clean up formatting markers

This skill covers patterns for template processing in both text and document contexts.

Placeholder Patterns

Basic Placeholders

{{CANDIDATE_FULL_NAME}}
{{POSITION}}
{{START_DATE}}
{{BASE_SALARY}}

Parsing from JSON

import json

with open('employee_data.json', 'r') as f:
    data = json.load(f)

# Access placeholder values
name = data['CANDIDATE_FULL_NAME']
position = data['POSITION']

Conditional Section Pattern

Template Format

{{IF_CONDITION_NAME}}
  Content to show if CONDITION_NAME is "Yes"
{{END_IF_CONDITION_NAME}}

Processing Conditionals

def process_conditional_section(text, condition_key, condition_value):
    """Remove conditional markers based on condition value"""
    start_marker = f'{{{{IF_{condition_key}}}}}'
    end_marker = f'{{{{END_IF_{condition_key}}}}}'

    # Find section
    start_idx = text.find(start_marker)
    end_idx = text.find(end_marker)

    if start_idx == -1 or end_idx == -1:
        return text  # No conditional section found

    # Extract the content between markers
    before = text[:start_idx]
    content = text[start_idx + len(start_marker):end_idx]
    after = text[end_idx + len(end_marker):]

    if condition_value.lower() == 'yes':
        # Keep content, remove markers
        return before + content + after
    else:
        # Remove entire section
        return before + after

Workflow for Template Processing

Step 1: Load Data

import json
from docx import Document

with open('employee_data.json', 'r') as f:
    data = json.load(f)

doc = Document('template.docx')

Step 2: Replace Basic Placeholders

def replace_placeholders(doc, data):
    """Replace all {{PLACEHOLDER}} with data values"""

    # Replace in paragraphs
    for para in doc.paragraphs:
        para_text = para.text
        for key, value in data.items():
            placeholder = f'{{{{{key}}}}}'
            para_text = para_text.replace(placeholder, str(value))

        # Update paragraph (handle text fragmentation)
        if para_text != para.text:
            for run in para.runs:
                run.text = ''
            para.text = para_text

    # Replace in tables
    for table in doc.tables:
        for row in table.rows:
            for cell in row.cells:
                cell_text = cell.text
                for key, value in data.items():
                    placeholder = f'{{{{{key}}}}}'
                    cell_text = cell_text.replace(placeholder, str(value))

                if cell_text != cell.text:
                    for para in cell.paragraphs:
                        for run in para.runs:
                            run.text = ''
                        para.text = cell_text
                    cell_text = cell.text  # Reset after first cell

Read the full file on GitHub · 226 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 226 lines · 11 tokens per session scan A 2877912314af

Subscribe to this mod's changes

template-processing is a skill published in the GitHub repository cxcscmu/SkillLearnBench (93 stars, last pushed 1mo ago), licensed MIT. It adds 11 tokens to every session and 1,473 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

template-processing compared with skills from other repositories

template-processing next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
template-processingcxcscmu/SkillLearnBenchSkill931mo agoMITA11Claude Code, Codex
image-ocrbenchflow-ai/skillsbenchSkill1.9k6d agoApache-2.0A16Claude Code, Codex
pdfbenchflow-ai/skillsbenchSkill1.9k6d agoApache-2.0A29Claude Code, Codex
pdf-editingbenchflow-ai/skillsbenchSkill1.9k6d agoApache-2.0A17Claude Code, Codex
docxbenchflow-ai/skillsbenchSkill1.9k6d agoApache-2.0A22Claude Code, Codex
exoplanet-workflowsbenchflow-ai/skillsbenchSkill1.9k6d agoApache-2.0A45Claude Code, Codex
xlsx-parsingbenchflow-ai/skillsbenchSkill1.9k6d agoApache-2.0A83Claude Code, Codex