How to Register Custom CV or Cover Letter Templates with `/add-template` in AI Job Search

The /add-template command registers custom LaTeX or Typst templates by copying files to a dedicated folder, creating a manifest, verifying compilation, and inserting an activation block into the guidance files.

The AI Job Search repository provides a streamlined workflow for job application generation, and the /add-template command is the central mechanism for replacing the default templates with your own professionally-designed CV or cover letter layouts. This command handles the entire lifecycle: ingestion, validation, storage, and activation.

What /add-template Does

When you invoke /add-template, the system executes a five-phase pipeline defined in .claude/commands/add-template.md:

  1. Argument parsing – Detects flags (--list, --use <name>) or interprets a file path as a new template source.
  2. Metadata capture – Collects template type, compile command, fonts, style constraints, and known issues.
  3. Storage – Creates a subdirectory under templates/cv/ or templates/cover_letters/ with the skeleton file, dependencies, and a TEMPLATE.md manifest.
  4. Verification – Compiles a dummy document to confirm the template works and respects page limits.
  5. Activation – Inserts a managed <!-- ACTIVE-TEMPLATE: ... --> block into 05-cv-templates.md or 06-cover-letter-templates.md for use by the /apply command.

The command is idempotent: re-running with the same name updates the existing template rather than creating duplicates.

Command Syntax and Options

Register a New Template

/add-template path/to/my-cv.tex

This starts the interactive registration flow for a CV or cover letter template.

List Registered Templates

/add-template --list

Displays all templates stored in templates/cv/ and templates/cover_letters/ with their current status.

Switch Between Templates

/add-template --use modern-blue

Activates the template named modern-blue by updating the managed block in the appropriate guidance file.

Revert to Built-in Defaults

/add-template --use default

Removes custom template activation, falling back to the stock moderncv (CV) or cover.cls (cover letter) templates.

Interactive Registration Flow

When you provide a file path, the command guides you through:

Prompt Purpose
Template type Distinguishes CV from cover letter for correct folder placement.
Short name Creates a kebab-case identifier (e.g., awesome-cv) for the folder and manifest.
Compile command Suggests lualatex -interaction=nonstopmode <file>.tex or typst compile <file>.typ based on extension.
Font dependencies Records required system or bundled fonts for reproducibility.
Style rules Documents formatting constraints the AI must respect.
Page limit Enforced during verification; compilation fails if exceeded.
Known pitfalls Captures workarounds for template-specific issues.

File Structure and Key Paths

The template system uses these locations as implemented in MadsLorentzen/ai-job-search:

Each template folder contains:

  • template.<ext> – The skeleton file with [PLACEHOLDER] tokens for AI population.
  • TEMPLATE.md – Manifest documenting metadata, compile command, and constraints.
  • Auxiliary files – .cls, .sty, .ttf, or .otf dependencies.

Verification and Safety

The test compile phase generates _compile_test.tex (or equivalent) containing placeholder content. The command:

  • Runs your declared compile command in a temporary environment.
  • Checks that PDF output exists and page count ≤ declared limit.
  • Fails registration if verification fails, preventing broken templates from entering the workflow.

Template Activation Mechanism

The managed block inserted into guidance files follows this pattern:

<!-- ACTIVE-TEMPLATE: awesome-cv -->
<!-- Template: templates/cv/awesome-cv/ -->
<!-- Compile: lualatex -interaction=nonstopmode template.tex -->
<!-- DO NOT EDIT ABOVE THIS LINE -->

The /apply command reads this block to locate and use your active template. The surrounding content in 05-cv-templates.md or 06-cover-letter-templates.md remains intact, preserving any custom advice you've added.

Requirements for Compatible Templates

To register custom CV or cover letter templates successfully:

  • Source format: LaTeX (.tex), Typst (.typ), or any compile-to-PDF system.
  • Placeholder tokens: Must include [PLACEHOLDER] or similar markers where AI-generated content inserts.
  • Self-contained: All dependencies (classes, packages, fonts) must be present or documented.
  • Deterministic: Compile command must produce consistent output without interactive prompts.

Summary

  • /add-template <path> registers new templates through an interactive five-phase workflow.
  • Storage location distinguishes CVs (templates/cv/) from cover letters (templates/cover_letters/).
  • --list, --use <name>, and --use default manage template selection without re-registration.
  • Verification via test compile ensures templates work before activation.
  • Managed activation blocks in guidance files enable seamless /apply integration while preserving custom content.

Frequently Asked Questions

What file formats does /add-template support?

The command accepts any compile-to-PDF format. LaTeX (.tex) and Typst (.typ) are explicitly handled with suggested compile commands, but you can specify custom commands for other systems like ConTeXt or R Markdown.

Can I edit a template after registration?

Yes. Run /add-template with the same name and updated source files. The idempotent design replaces the existing template folder and re-runs verification. Your activation in the guidance files remains unchanged.

Where does the AI insert my content when generating applications?

The AI replaces [PLACEHOLDER] tokens in template.<ext> with generated content, then executes your declared compile command. The placeholder convention is documented in the TEMPLATE.md manifest for reference.

What happens if my template compilation fails during verification?

Registration aborts without modifying the guidance files. The error output from the compile command displays for debugging. Fix your template source, dependencies, or compile command, then retry registration.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →