How to Add Custom LaTeX CV and Cover Letter Templates Using the `/add-template` Command
The /add-template command in the AI-Job-Search framework initiates an interactive interview that registers your LaTeX files, validates them through a mandatory test compile, and stores the metadata in managed registry blocks for automatic use by the /apply workflow.
The MadsLorentzen/ai-job-search repository provides a structured workflow for job applications where custom LaTeX styling is essential for maintaining professional document standards. When you need to move beyond the stock templates, the /add-template command serves as the primary entry point for registering your own CV and cover letter designs.
Interactive Template Registration Process
Running /add-template launches an interactive interview that collects critical metadata about your LaTeX source files. This process ensures that the framework understands how to compile and render your documents correctly before they enter the active workflow.
Metadata Collection and Validation
The command gathers specific configuration details required for successful compilation:
- Compile engine:
lualatexfor CV templates orxelatexfor cover letter templates - Auxiliary files: Any custom
.clsor.stystyle files required by your template - Font dependencies: Specific font files such as Lato or Raleway that must be available to the compiler
- Page constraints: Rules like "CV must be ≤ 2 pages" or "Cover letter must be 1 page"
- Layout preservation: Hints about sections that must stay on a single page to maintain visual integrity
After collecting this data, the system performs a mandatory test compile to verify that the template renders without errors before registration completes.
Engine Selection and Page Limits
The framework distinguishes between document types through engine selection. According to the source code in .claude/commands/add-template.md, CV templates typically use lualatex while cover letters default to xelatex. The interview explicitly asks for page-limit rules, storing these constraints alongside the template metadata to enforce formatting standards during the /apply workflow.
Template Storage and Registry Management
Once validation succeeds, the system organizes your files and updates the central registries that control which templates are active for document generation.
The templates/ Directory Structure
Physical template files are stored in the templates/ directory at the repository root. As documented in templates/README.md, this location holds:
- Main
.texsource files - Custom
.clsand.styclass and style files - Font files and other assets required for compilation
When you register a template named fancy-cv, the system copies your files into templates/fancy-cv/ to isolate dependencies and ensure reproducible builds.
Managed Blocks in Registry Files
Template activation is recorded in managed markdown blocks within the skills directory. The /add-template command updates either .claude/skills/job-application-assistant/05-cv-templates.md (for CVs) or .claude/skills/job-application-assistant/06-cover-letter-templates.md (for cover letters).
These files contain specially marked blocks that the command manages automatically:
<!-- BEGIN ACTIVE-TEMPLATE (managed by /add-template - do not edit by hand) -->
name: my-fancy-template
engine: xelatex
...
<!-- END ACTIVE-TEMPLATE -->
Do not edit these blocks manually—the /add-template command maintains this metadata to prevent configuration drift and syntax errors.
Switching and Listing Templates
The command provides helper flags for template management beyond initial registration.
Activating Custom Templates
To switch between registered templates without re-registering them, use the --use flag:
# Activate a custom template for subsequent /apply runs
/add-template --use fancy-cv
This updates the ACTIVE-TEMPLATE block in the appropriate registry file. The next invocation of /apply (defined in .claude/commands/apply.md) automatically reads this metadata and sources files from templates/fancy-cv/ instead of the default locations.
Reverting to Default Templates
To return to the stock templates provided by the framework:
/add-template --use default
This restores the built-in moderncv class for CVs and cover.cls for cover letters, bypassing any custom templates in the templates/ directory.
Listing Available Templates
To view all registered templates including the default options:
/add-template --list
This outputs a summary such as:
default– stock moderncv / cover.clsfancy-cv– custom moderncv-style templatesleek-letter– minimal cover-letter class
Integration with the Apply Workflow
The /apply workflow depends on the registry metadata set by /add-template. When generating application documents, the workflow:
- Reads the active template name from the managed block in
05-cv-templates.mdor06-cover-letter-templates.md - Locates the corresponding files in the
templates/directory - Compiles the CV or cover letter using the specified engine (
lualatexorxelatex) - Runs ATS (Applicant Tracking System) checks against the rendered output
This integration ensures that once you add custom LaTeX CV and cover letter templates, they become seamlessly available for all future job applications without manual file path configuration.
Summary
- The
/add-templatecommand orchestrates an interactive interview defined in.claude/commands/add-template.mdthat captures compile engines, fonts, and page limits. - Custom files are stored in the
templates/directory and validated through a mandatory test compile before activation. - Template metadata is written to managed blocks in
05-cv-templates.md(CVs) or06-cover-letter-templates.md(cover letters) and should never be edited by hand. - Use
/add-template --use <name>to switch templates and/add-template --use defaultto revert to stockmoderncvandcover.clstemplates. - The
/applyworkflow automatically detects the active template and compiles documents using the specified engine and constraints.
Frequently Asked Questions
What file types should I prepare before running /add-template?
Prepare your main .tex source file along with any custom .cls or .sty files that define your document class or styling. If your template uses non-standard fonts (such as Lato or Raleway), ensure those font files are accessible. The interactive interview will prompt you for the paths to these dependencies and copy them into the templates/ directory during registration.
How does the framework handle compilation errors during template registration?
The /add-template command performs a mandatory test compile immediately after collecting your metadata. If the LaTeX engine encounters errors—whether from missing packages, font issues, or syntax problems—the registration aborts and the template is not added to the active registry. You must fix the underlying LaTeX errors and rerun the command to successfully register the template.
Can I use different templates for my CV and cover letter simultaneously?
Yes. The framework maintains separate registries in 05-cv-templates.md and 06-cover-letter-templates.md. You can activate a custom template for your CV (using lualatex) while using a different template—or the default cover.cls—for your cover letter (using xelatex). The /apply workflow reads both registries independently when generating application materials.
What happens to my existing templates when I register a new one?
Registering a new template with /add-template does not delete or overwrite previously registered templates in the templates/ directory. The command simply adds a new subdirectory and updates the active template pointer in the managed registry block. You can switch back to any previously registered template at any time using /add-template --use <name>, provided the template files remain in the templates/ directory.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →