# What Is the /add-template Command in the AI Job Search Framework?

> Discover the /add-template command in the AI Job Search framework. Easily register custom CV and cover-letter templates to replace defaults and generate your own PDF designs.

- Repository: [Mads Lorentzen/ai-job-search](https://github.com/MadsLorentzen/ai-job-search)
- Tags: how-to-guide
- Published: 2026-08-29

---

**The `/add-template` command registers custom CV or cover-letter templates with the AI Job Search framework, enabling you to replace default LaTeX templates with your own PDF-producing designs through a five-step validation and storage workflow.**

The `/add-template` command is a core configuration utility in the MadsLorentzen/ai-job-search repository that extends the framework beyond its built-in ModernCV and cover-cls defaults. By registering your own LaTeX, Typst, or other compiled document designs, you ensure AI-generated application materials render using your specific typography, layout rules, and branding requirements.

## How the /add-template Command Works

According to the source specification in [`.claude/commands/add-template.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/commands/add-template.md), the command executes a strict five-step pipeline that validates, stores, and activates template configurations for use with the `/apply` workflow.

### Step 1: Parse Arguments

The command accepts optional flags to manage existing templates rather than initiate new registrations. Supply `--list` to enumerate all registered templates, or use `--use <name>` to switch the active template without running the full setup flow.

### Step 2: Collect Template Metadata

Interactive prompts capture essential configuration parameters: **template type** (CV versus cover letter), source file extension, **compile command**, engine/toolchain, required fonts, style rules, page limits, and known formatting pitfalls. This metadata ensures the AI respects your design constraints when generating content.

### Step 3: Store the Template

The framework creates a dedicated folder under `templates/cv/<name>/` or `templates/cover_letters/<name>/`, copies the skeleton source file, bundles companion assets and fonts, and writes a [`TEMPLATE.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/TEMPLATE.md) manifest documenting the complete configuration.

### Step 4: Verify Compilation

Before activation, the framework compiles a test document populated with dummy data. This verification step confirms the template builds successfully and respects the declared **page limit**, preventing broken or malformed application submissions.

### Step 5: Activate the Template

The command inserts a **managed block** into [`05-cv-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/05-cv-templates.md) or [`06-cover-letter-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/06-cover-letter-templates.md). The `/apply` command subsequently reads these guidance files to determine which template to use when rendering final PDFs.

## Practical Usage Examples

### List All Registered Templates

To view available templates without changing the active state:

```bash
/add-template --list

```

### Register a New Template

Initiate the interactive registration flow by providing the path to your source file:

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

```

### Switch Between Templates

Activate a previously registered template by name, or revert to the framework defaults:

```bash
/add-template --use awesome-cv
/add-template --use default

```

## File Structure and Storage Locations

Understanding where the command writes data assists with manual troubleshooting and version control. The framework maintains strict separation between CV and cover-letter assets:

- [`.claude/commands/add-template.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/commands/add-template.md) – Command specification, argument parsing logic, and workflow definition.
- `templates/cv/<name>/` – CV template directory containing `template.tex`, the [`TEMPLATE.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/TEMPLATE.md) manifest, bundled fonts, and dependency files.
- `templates/cover_letters/<name>/` – Cover-letter template directory with identical structure.
- [`05-cv-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/05-cv-templates.md) – Active CV template configuration consumed by the `/apply` command.
- [`06-cover-letter-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/06-cover-letter-templates.md) – Active cover-letter template configuration consumed by the `/apply` command.

The system guarantees only one managed block exists per guidance file, ensuring clean, reversible configuration states.

## Summary

- The `/add-template` command registers custom CV and cover-letter templates in the AI Job Search framework, replacing default ModernCV/cover-cls designs with your own PDF-compiling systems.
- The process follows five steps: argument parsing, metadata collection, template storage, compilation verification, and activation via guidance files.
- Template assets reside in `templates/cv/` or `templates/cover_letters/` subdirectories, each containing a [`TEMPLATE.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/TEMPLATE.md) manifest and source files.
- Use `--list` to view templates, `--use <name>` to switch, and `--use default` to restore built-in templates.
- The command updates [`05-cv-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/05-cv-templates.md) and [`06-cover-letter-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/06-cover-letter-templates.md), which the `/apply` command references during final PDF generation.

## Frequently Asked Questions

### What file formats does the /add-template command support?

The command supports any PDF-producing template system, including **LaTeX** (.tex), **Typst** (.typ), and other compiled document formats. The framework stores your source file, associated fonts, and compilation instructions, then executes your specified build command during the verification step to ensure compatibility.

### How do I revert to the default templates after registering a custom one?

Run `/add-template --use default` to restore the built-in ModernCV and cover-cls templates. This command removes the active managed block from [`05-cv-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/05-cv-templates.md) and [`06-cover-letter-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/06-cover-letter-templates.md), reverting the system to its original configuration without deleting your custom template files from the `templates/` directories.

### Where does the /add-template command store configuration data?

Template metadata lives in [`TEMPLATE.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/TEMPLATE.md) files within subdirectories of `templates/cv/` or `templates/cover_letters/`. The active template references are written as **managed blocks** to [`05-cv-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/05-cv-templates.md) and [`06-cover-letter-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/06-cover-letter-templates.md) in the repository root, ensuring the `/apply` command can locate the correct compile instructions and source files.

### How does custom template registration affect the /apply workflow?

When you execute `/apply`, the framework reads the managed blocks in [`05-cv-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/05-cv-templates.md) and [`06-cover-letter-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/06-cover-letter-templates.md) to identify the active template directory. It injects your AI-generated content into the stored source files and executes the registered compile command to produce the final PDF, applying your custom fonts and layout rules automatically.