# thyaen/flexi-cv architecture

> Architecture diagram of the GitHub repository thyaen/flexi-cv, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thyaen/flexi-cv
- Repository: https://github.com/thyaen/flexi-cv

## Overview

cv-tailor turns a master YAML CV and job posting into a tailored, validated application CV and PDF. The main workflow is an AI-assisted tailoring session through the MCP server, followed by schema and fabrication checks, application-file storage, template rendering, and PDF compilation. The graph also shows preference editing, job-posting retrieval, and application listing. Source excerpts establish the Python call paths; some prompt and template behavior is documented by the README or evident from the tree, so unsampled details are omitted.

Main entry points: [`mcp-server/server.py`](https://github.com/thyaen/flexi-cv/blob/main/mcp-server/server.py) (MCP tools), [`src/build.py`](https://github.com/thyaen/flexi-cv/blob/main/src/build.py) (Application builder), [`src/render.py`](https://github.com/thyaen/flexi-cv/blob/main/src/render.py) (LaTeX renderer), [`master/cv.yaml`](https://github.com/thyaen/flexi-cv/blob/main/master/cv.yaml) (Master CV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_session["Tailoring session"]
  node_mcp["MCP tools<br/>[server.py]"]
  node_guidance["Tailoring guidance<br/>[tailoring.md]"]
  node_system_prompt["System guidance<br/>[system.md]"]
end

subgraph group_data["CV data and checks"]
  node_master["Master CV<br/>[cv.yaml]"]
  node_preferences["Preferences<br/>[preferences.yaml]"]
  node_schema["CV schema and checks<br/>[schema.py]"]
  node_applications["Saved applications"]
end

subgraph group_output["PDF generation"]
  node_builder["Application builder<br/>[build.py]"]
  node_renderer["LaTeX renderer<br/>[render.py]"]
  node_jinja["LaTeX templates"]
  node_awesome["Awesome CV class"]
  node_pdf["Application PDF"]
end

node_user(("User"))
node_assistant(("AI assistant"))
node_job_site["Job posting site"]
node_xelatex["XeLaTeX"]

node_user -->|"requests tailoring"| node_assistant
node_assistant -->|"uses tools"| node_mcp
node_mcp -->|"loads prompt steps"| node_guidance
node_mcp -->|"loads system prompt"| node_system_prompt
node_assistant -->|"reads master"| node_mcp
node_mcp -->|"reads"| node_master
node_assistant -->|"reads and saves preferences"| node_mcp
node_mcp -->|"reads and writes"| node_preferences
node_user -->|"provides job URL"| node_mcp
node_mcp -->|"fetches posting"| node_job_site
node_assistant -->|"submits tailored CV"| node_mcp
node_mcp -->|"parses and checks"| node_schema
node_mcp -->|"checks facts against"| node_master
node_mcp -->|"saves application files"| node_applications
node_assistant -->|"requests PDF build"| node_mcp
node_mcp -->|"calls build"| node_builder
node_builder -->|"loads CV and writes PDF"| node_applications
node_builder -->|"loads and validates data"| node_schema
node_builder -->|"checks facts against"| node_master
node_builder -->|"loads settings"| node_preferences
node_builder -->|"renders CV"| node_renderer
node_renderer -->|"uses CV model"| node_schema
node_renderer -->|"renders templates"| node_jinja
node_builder -->|"stages template files"| node_awesome
node_builder -->|"compiles LaTeX"| node_xelatex
node_builder -->|"copies compiled PDF"| node_pdf
node_user -->|"lists applications"| node_mcp
node_mcp -->|"lists folders"| node_applications

click node_mcp "https://github.com/thyaen/flexi-cv/blob/main/mcp-server/server.py"
click node_guidance "https://github.com/thyaen/flexi-cv/blob/main/prompts/tailoring.md"
click node_system_prompt "https://github.com/thyaen/flexi-cv/blob/main/prompts/system.md"
click node_master "https://github.com/thyaen/flexi-cv/blob/main/master/cv.yaml"
click node_preferences "https://github.com/thyaen/flexi-cv/blob/main/master/preferences.yaml"
click node_schema "https://github.com/thyaen/flexi-cv/blob/main/src/schema.py"
click node_builder "https://github.com/thyaen/flexi-cv/blob/main/src/build.py"
click node_renderer "https://github.com/thyaen/flexi-cv/blob/main/src/render.py"
click node_jinja "https://github.com/thyaen/flexi-cv/tree/main/template/jinja"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mcp,node_guidance,node_system_prompt,node_user toneBlue
class node_master,node_preferences,node_schema,node_applications toneAmber
class node_builder,node_renderer,node_jinja,node_awesome,node_pdf toneMint
class node_assistant,node_job_site,node_xelatex toneIndigo
```

## Components

### Tailoring session

- [MCP tools](https://github.com/thyaen/flexi-cv/blob/main/mcp-server/server.py): `mcp-server/server.py`
- [Tailoring guidance](https://github.com/thyaen/flexi-cv/blob/main/prompts/tailoring.md): `prompts/tailoring.md`
- [System guidance](https://github.com/thyaen/flexi-cv/blob/main/prompts/system.md): `prompts/system.md`

### CV data and checks

- [Master CV](https://github.com/thyaen/flexi-cv/blob/main/master/cv.yaml): `master/cv.yaml`
- [Preferences](https://github.com/thyaen/flexi-cv/blob/main/master/preferences.yaml): `master/preferences.yaml`
- [CV schema and checks](https://github.com/thyaen/flexi-cv/blob/main/src/schema.py): `src/schema.py`
- **Saved applications**

### PDF generation

- [Application builder](https://github.com/thyaen/flexi-cv/blob/main/src/build.py): `src/build.py`
- [LaTeX renderer](https://github.com/thyaen/flexi-cv/blob/main/src/render.py): `src/render.py`
- [LaTeX templates](https://github.com/thyaen/flexi-cv/tree/main/template/jinja): `template/jinja`
- **Awesome CV class**
- **Application PDF**

### Other components

- **User**
- **AI assistant**
- **Job posting site**
- **XeLaTeX**

## Connections

- User → AI assistant: requests tailoring (evidence: `README.md`)
- AI assistant → MCP tools: uses tools (evidence: `README.md`)
- MCP tools → Tailoring guidance: loads prompt steps (evidence: `mcp-server/server.py`)
- MCP tools → System guidance: loads system prompt (evidence: `mcp-server/server.py`)
- AI assistant → MCP tools: reads master (evidence: `mcp-server/server.py`)
- MCP tools → Master CV: reads (evidence: `mcp-server/server.py`)
- AI assistant → MCP tools: reads and saves preferences (evidence: `mcp-server/server.py`)
- MCP tools → Preferences: reads and writes (evidence: `mcp-server/server.py`)
- User → MCP tools: provides job URL (evidence: `README.md`)
- MCP tools → Job posting site: fetches posting (evidence: `mcp-server/server.py`)
- AI assistant → MCP tools: submits tailored CV (evidence: `README.md`)
- MCP tools → CV schema and checks: parses and checks (evidence: `mcp-server/server.py`)
- MCP tools → Master CV: checks facts against (evidence: `mcp-server/server.py`)
- MCP tools → Saved applications: saves application files (evidence: `mcp-server/server.py`)
- AI assistant → MCP tools: requests PDF build (evidence: `README.md`)
- MCP tools → Application builder: calls build (evidence: `mcp-server/server.py`)
- Application builder → Saved applications: loads CV and writes PDF (evidence: `src/build.py`)
- Application builder → CV schema and checks: loads and validates data (evidence: `src/build.py`)
- Application builder → Master CV: checks facts against (evidence: `src/build.py`)
- Application builder → Preferences: loads settings (evidence: `src/build.py`)
- Application builder → LaTeX renderer: renders CV (evidence: `src/build.py`)
- LaTeX renderer → CV schema and checks: uses CV model (evidence: `src/render.py`)
- LaTeX renderer → LaTeX templates: renders templates (evidence: `src/render.py`)
- Application builder → Awesome CV class: stages template files (evidence: `src/build.py`)
- Application builder → XeLaTeX: compiles LaTeX (evidence: `src/build.py`)
- Application builder → Application PDF: copies compiled PDF (evidence: `src/build.py`)
- User → MCP tools: lists applications (evidence: `mcp-server/server.py`)
- MCP tools → Saved applications: lists folders (evidence: `mcp-server/server.py`)
