# Hiring-Agent Prompt Templates Schema: How JSON Structures Are Embedded in Jinja Templates

> Discover the Hiring-Agent prompt templates schema. Learn how JSON structures are embedded within Jinja templates in the interviewstreet/hiring-agent repository for defined prompt creation.

- Repository: [HackerRank/hiring-agent](https://github.com/interviewstreet/hiring-agent)
- Tags: internals
- Published: 2026-07-04

---

**Yes, the interviewstreet/hiring-agent repository defines section-specific JSON schemas by embedding hard-coded JSON skeletons directly within Jinja template files located in `prompts/templates/`.**

The hiring-agent project implements a tightly coupled prompt engineering approach where the **prompt templates schema** lives inside the template files themselves rather than in separate validation files. Each Jinja template in `prompts/templates/` contains a structured JSON skeleton that instructs Large Language Models (LLMs) exactly which fields to return when parsing resume sections.

## How Schemas Are Defined in Jinja Templates

Instead of referencing external JSON Schema files, the repository uses inline JSON skeletons within `.jinja` files to define the expected output structure. The `TemplateManager` class treats these embedded structures as the canonical schemas that downstream evaluation code expects.

### Section-Specific Schema Examples

Each resume section has its own template file containing a specific JSON structure:

**Basics Section** (`prompts/templates/basics.jinja`):

```json
{
  "basics": {
    "name": "...",
    "email": "...",
    "phone": "...",
    "url": null,
    "summary": null,
    "location": {
      "city": "...",
      "countryCode": "..."
    },
    "profiles": [{
      "network": "...",
      "url": "...",
      "username": "..."
    }]
  }
}

```

**Work Experience** (`prompts/templates/work.jinja`):

```json
{
  "work": [
    {
      "name": "...",
      "position": "...",
      "startDate": "...",
      "endDate": "...",
      "summary": "...",
      "highlights": ["..."]
    }
  ]
}

```

**Education** (`prompts/templates/education.jinja`):

```json
{
  "education": [
    {
      "institution": "...",
      "area": "...",
      "studyType": "...",
      "startDate": "...",
      "endDate": "...",
      "score": "..."
    }
  ]
}

```

**Skills** (`prompts/templates/skills.jinja`):

```json
{
  "skills": [
    {
      "name": "...",
      "level": null,
      "keywords": ["..."]
    }
  ]
}

```

Additional templates like `projects.jinja` and `awards.jinja` follow the same pattern, embedding their respective JSON schemas directly in the prompt text.

## The TemplateManager Loading Mechanism

The `TemplateManager` class in [`prompts/template_manager.py`](https://github.com/interviewstreet/hiring-agent/blob/main/prompts/template_manager.py) orchestrates the schema enforcement pipeline. During initialization, it configures a Jinja environment with `FileSystemLoader(template_dir)` pointing to the templates directory.

The loading process works as follows:

1. **Initialization** – `TemplateManager.__init__` sets up the Jinja environment and calls `_load_templates`, which iterates over a hard-coded mapping (`template_files`) to register each available template.
2. **Registration** – Each `.jinja` file is loaded into memory, making its embedded JSON schema available for rendering.
3. **Rendering** – The `render_template(section, text_content=resume_md)` method injects the raw resume markdown into the template via the `text_content` variable.

## Rendering Templates with Schema Enforcement

When processing resumes, the `TemplateManager` binds content to templates and returns JSON-formatted strings that strictly follow the embedded schemas. The template instructs the LLM to output **only** the JSON matching the provided skeleton.

```python
from prompts.template_manager import TemplateManager

# Initialize manager (templates loaded from prompts/templates/)

tm = TemplateManager()

# Resume markdown content (normally extracted from PDF)

resume_md = """
John Doe
john.doe@example.com | +1-555-123-4567 | New York, USA
GitHub: https://github.com/johndoe

## Work Experience

Acme Corp – Senior Engineer (Jan 2020 – Present)
Led backend development team...
"""

# Render specific sections - returns JSON matching embedded schemas

basics_json = tm.render_template("basics", text_content=resume_md)
work_json = tm.render_template("work", text_content=resume_md)

```

## Downstream Consumption and Validation

After rendering, the returned JSON strings flow to evaluation components such as [`transform.py`](https://github.com/interviewstreet/hiring-agent/blob/main/transform.py) or [`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py). These modules parse the JSON and feed structured data into the evaluation pipeline. Because the **prompt templates schema** is embedded directly in the Jinja files, any change to the expected output format requires modifying the corresponding `.jinja` template and updating the consuming code accordingly.

## Summary

- The **prompt templates schema** in hiring-agent is embedded as hard-coded JSON skeletons within Jinja template files, not in separate schema files.
- Each resume section (basics, work, education, skills) has its own template in `prompts/templates/` containing a specific JSON structure.
- The `TemplateManager` class in [`prompts/template_manager.py`](https://github.com/interviewstreet/hiring-agent/blob/main/prompts/template_manager.py) uses `FileSystemLoader` to load templates and `render_template()` to inject resume content via the `text_content` variable.
- Downstream code expects LLM responses to match the JSON structure defined in the template files.

## Frequently Asked Questions

### Where is the prompt templates schema defined in the hiring-agent repository?

The schema is defined within individual Jinja template files located in the `prompts/templates/` directory. Each file contains a hard-coded JSON skeleton that specifies the exact fields and structure the LLM must return for that specific resume section.

### How does TemplateManager enforce the JSON schema?

The `TemplateManager` class uses Jinja's `FileSystemLoader` to load templates from `prompts/templates/`. When `render_template()` is called, it injects the resume content into the template, and the embedded JSON skeleton in the template instructs the LLM to return data in that specific format. The enforcement happens through prompt engineering rather than external validation.

### What happens if I need to modify the schema for a specific section?

You must edit the corresponding `.jinja` file in `prompts/templates/`. For example, to change the work experience structure, modify `prompts/templates/work.jinja`. Since the schema is tightly coupled with the prompt template, changes must be synchronized with downstream code in modules like [`transform.py`](https://github.com/interviewstreet/hiring-agent/blob/main/transform.py) or [`score.py`](https://github.com/interviewstreet/hiring-agent/blob/main/score.py) that parse the returned JSON.

### Are there separate schema files for different resume sections?

No, there are no separate `.json` schema files. Each section's schema is embedded as a JSON skeleton within its respective Jinja template file (e.g., `basics.jinja`, `education.jinja`, `projects.jinja`). This design keeps the prompt instructions and output format specifications together in one location.