How the AI Component of ai-job-search Works: A Technical Deep Dive

The AI component of ai-job-search leverages Claude Code and modular skill files to automate job fit evaluation, tailored document generation, and multi-agent review cycles while maintaining strict verification guardrails.

The ai-job-search repository by MadsLorentzen orchestrates a sophisticated LLM-driven workflow that transforms raw job postings into polished, personalized application materials. At its core, the system utilizes Claude Code, Anthropic's code-first LLM platform, executing a series of specialized prompts defined in hidden skill files under .claude/skills/. This architecture enables autonomous agents to evaluate job fit, draft LaTeX documents, and iteratively refine outputs through structured verification loops.

Architecture of the AI Component

The AI workflow consists of five distinct stages orchestrated by Claude Code commands located in .claude/commands/. Each stage invokes specific skill files that define prompts, data formats, and decision logic.

Fit Evaluation Stage

The process begins when the scoring-agent ingests a job posting URL or raw text. In .claude/skills/job-application-assistant/04-job-evaluation.md, the system defines a five-dimensional rubric covering skills, experience, culture, location, and career alignment. Claude Code receives a JSON payload containing the posting text and the candidate's profile (auto-populated from CLAUDE.md), then returns a structured verdict:

{
  "fit_score": 0.84,
  "deal_breakers": [],
  "language_gate": "pass"
}

The evaluation explicitly checks against deal-breakers and language requirements before permitting the workflow to continue.

Drafting Stage

Upon passing the fit evaluation, the drafter-agent generates tailored application materials using templates defined in .claude/skills/job-application-assistant/05-cv-templates.md and 06-cover-letter-templates.md. The agent injects role-specific content into LaTeX placeholder tokens while preserving syntax constraints. Claude Code is strictly instructed to maintain exactly two pages for CVs and exactly one page for cover letters, ensuring compliance with standard recruiting conventions.

Review and Revision Cycle

A reviewer-agent subsequently researches the target company and critiques the drafts using the prompt logic in .claude/skills/job-application-assistant/07-interview-prep.md. This agent verifies factual claims against independent web searches through the system's "WebFetch" guard, requiring external citations before accepting assertions. The drafter-agent then re-executes with the reviewer's feedback, iterating until all quality checks pass.

Final Verification

The compiled PDFs undergo mechanical validation through tools/verify_pdf.py. This Python utility checks page count validation, detects orphaned headings, and extracts the text layer for ATS (Applicant Tracking System) readability. If verification fails, the workflow re-invokes the drafter-agent automatically, creating a closed feedback loop that guarantees both token accuracy and machine readability.

Data Flow and Prompt Design

The system maintains strict data lineage through centralized profile management and structured prompt engineering.

Profile Ingestion and CLAUDE.md

The /setup command initializes CLAUDE.md at the repository root, capturing the candidate's identity, education, experience stack, languages, and behavioral traits. This file serves as the single source of truth for all downstream LLM requests, ensuring consistency across every generated application.

Scoring and Drafting Prompts

The scoring prompt references the evaluation rubric in 04-job-evaluation.md to enforce the five fit dimensions. For drafting, the system injects the fit verdict into LaTeX templates containing [PLACEHOLDER] tokens. The prompt explicitly instructs Claude Code to preserve LaTeX syntax and adhere to page-limit constraints, preventing formatting corruption during content generation.

Security Guardrails and Agentic Defenses

The AI component implements multiple defensive layers to ensure trustworthy output:

  • Agentic Defenses: The LLM treats raw job postings as immutable data rather than instruction sources, preventing prompt injection attacks embedded in posting descriptions.
  • WebFetch Verification: The reviewer-agent must cross-check company claims against external sources before acceptance, reducing hallucination risks.
  • Robots.txt Compliance: Before fetching job data, tools/robots_check.py validates target sites' robots.txt files, ensuring legal compliance with web scraping policies.

Invoking the AI Pipeline

Users interact with the AI component through Claude Code CLI commands that trigger the complete workflow:


# Initialize candidate profile (run once)

claude /setup

# Scrape configured job portals

claude /scrape

# Batch-rank postings by fit score

claude /rank

# Execute full AI pipeline for specific posting

claude /apply https://jobindex.dk/job/1234567

The /apply command internally executes the evaluation, drafting, review, and verification stages, depositing final PDFs into cv/ and cover_letters/ directories.

For direct access to individual agents without the full orchestration:


# Invoke scoring agent directly with custom input

claude --skill .claude/skills/job-application-assistant/04-job-evaluation.md \
       --input '{"posting":"...","profile":"..."}'

Summary

  • The ai-job-search AI component is built on Claude Code, utilizing modular skill files stored in .claude/skills/ and command definitions in .claude/commands/.
  • The workflow follows five stages: Fit Evaluation (04-job-evaluation.md), Drafting (05-cv-templates.md, 06-cover-letter-templates.md), Review (07-interview-prep.md), Revision, and Verification (tools/verify_pdf.py).
  • CLAUDE.md serves as the centralized candidate profile, fed into every LLM prompt to maintain consistency across documents.
  • Security mechanisms include prompt injection defenses, web-fetch verification for factual claims, and robots_check.py compliance validation.
  • The system enforces strict output constraints, including LaTeX syntax preservation and exact page limits verified through automated PDF inspection.

Frequently Asked Questions

What LLM platform powers the ai-job-search AI component?

The system utilizes Claude Code, Anthropic's code-first LLM platform. All AI operations— from job fit scoring to LaTeX document generation— are executed through Claude Code's CLI interface, which processes skill files containing specialized prompts and logic chains.

How does the system prevent prompt injection from job postings?

According to the repository's security architecture, the LLM treats raw job postings as pure data rather than executable instructions. This agentic defense prevents malicious text embedded in job descriptions from hijacking the AI's behavior, ensuring that only the predefined skill files in .claude/skills/ control the workflow logic.

What files control the AI's evaluation criteria?

The fit-scoring rubric is defined in .claude/skills/job-application-assistant/04-job-evaluation.md, which encodes five evaluation dimensions: skills, experience, culture, location, and career alignment. The candidate's baseline data lives in CLAUDE.md, while template constraints for document generation are specified in 05-cv-templates.md and 06-cover-letter-templates.md.

How does the verification script ensure document quality?

tools/verify_pdf.py performs mechanical validation on compiled LaTeX outputs, checking page count constraints (two pages for CVs, one for cover letters), detecting orphaned headings, and extracting the text layer to verify ATS compatibility. If checks fail, the script triggers the drafter-agent to regenerate the documents, creating an automated quality assurance loop.

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 →