agentsclimarketplace

Offer letter generation

Skill cxcscmu/SkillLearnBench/skills/b4-skill-creator-claude-haiku-4-5/offer-letter-generator/offer-letter-generation

Generate filled offer letters from a JSON employee data file and a Word template. Use this skill whenever you need to create offer letters by matching data fields to document placeholders, handling conditional relocation packages, and saving the final document.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill offer-letter-generation

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

SKILL.md

3.1 KB, 702 tokens by cl100k_base, as published. Nobody here has run it

Offer Letter Generation

This skill demonstrates the complete workflow for generating personalized offer letters from employee data and a template.

Workflow Overview

  1. Load employee data from JSON
  2. Load template Word document
  3. Map fields from JSON to template placeholders
  4. Handle conditionals (e.g., relocation packages)
  5. Fill template with data
  6. Save output document

Data Structure

Employee data should be in JSON format with these typical fields:

{
  "DOC_ID": "OFFER-2024-00847",
  "COMPANY_NAME": "Nexus Technologies Inc.",
  "CANDIDATE_FULL_NAME": "Sarah Chen",
  "POSITION": "Senior Software Engineer",
  "BASE_SALARY": "185,000",
  "RELOCATION_PACKAGE": "Yes",
  "RELOCATION_AMOUNT": "15,000",
  ...
}

Placeholder Mapping

Common placeholders in offer letter templates:

PlaceholderData FieldExample
{{CANDIDATE_FULL_NAME}}CANDIDATE_FULL_NAMESarah Chen
{{POSITION}}POSITIONSenior Software Engineer
{{COMPANY_NAME}}COMPANY_NAMENexus Technologies Inc.
{{BASE_SALARY}}BASE_SALARY185,000
{{START_DATE}}START_DATEFebruary 12, 2024
{{STREET_ADDRESS}}STREET_ADDRESS456 Oak Avenue, Apt 7B

Conditional Sections

Offer letters often have optional sections based on employee benefits:

{{IF_RELOCATION_PACKAGE}}
Our company is pleased to provide a relocation package of ${{RELOCATION_AMOUNT}}
to assist with your move. You have {{RELOCATION_DAYS}} days from your start date
to complete your relocation.
{{END_IF_RELOCATION_PACKAGE}}

Processing logic:

  • If RELOCATION_PACKAGE == "Yes": Keep the section, remove markers
  • If RELOCATION_PACKAGE != "Yes": Remove entire section including markers

Implementation Steps

  1. Load JSON data

    import json
    with open('employee_data.json') as f:
        data = json.load(f)
    
  2. Create mapping function

    • Map JSON keys to placeholder names (may differ)
    • Handle boolean conversions (Yes/No to True/False)
  3. Process conditionals

    • Identify condition name from IF_FIELDNAME pattern
    • Check if condition is true/false
    • Keep or remove section accordingly
  4. Fill and save

    • Replace all placeholders
    • Save to output path

Example Output Structure

The filled offer letter should:

  • Replace all {{FIELD}} markers with actual values
  • Either include the relocation section with clean text (no IF markers) OR exclude it entirely
  • Preserve all formatting from the template
  • Be saved as a valid .docx file

Validation Checklist

After generating the offer letter:

  • All placeholders replaced (no {{ remaining)
  • Conditional sections properly handled
  • Document opens without errors
  • Formatting is preserved
  • Address block is complete
  • Salary and benefits details correct

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.