Skip to content
Back to skills

Prompt Template Rendering

ASecurity

Render PromptSource-style Jinja prompt templates into natural-language input/target pairs with answer choices, deterministic choices, skip handling, and structured diagnostics.

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
toolspythonbash

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill prompt_template_rendering --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Prompt Template Rendering?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Prompt Template Rendering
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-prompt-template-rendering-arex-skill/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-prompt-template-rendering-arex-skill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: prompt_template_rendering
description: Render PromptSource-style Jinja prompt templates into natural-language input/target pairs with answer choices, deterministic choices, skip handling, and structured diagnostics.
---

# Prompt Template Rendering

Use this skill when you need to apply a PromptSource-style prompt template to dataset example dictionaries without depending on the original PromptSource repository.

## Inputs

- `example`: JSON object containing dataset fields.
- `template`: string with exactly one `|||` separator between input and target halves.
- `answer_choices`: optional JSON list exposed to the template.
- `choice_index`: optional deterministic index for the `choice()` helper.

## Outputs

A JSON object with `ok`, `input`, `target`, `skipped`, and `errors` fields.

## Workflow

1. Validate that the template contains exactly one `|||` separator.
2. Render the two halves with Jinja2 using strict undefined variables.
3. Add `answer_choices` and a deterministic `choice()` helper to the rendering context.
4. Strip rendered input and target text.
5. Mark the result as skipped if either rendered half is empty.
6. Return structured diagnostics instead of raising uncaught rendering errors.

## Validation

Run:

```bash
python tests/test_prompt_template_rendering.py
python scripts/render_prompt.py --example-json '{"premise":"A dog runs.","hypothesis":"An animal moves.","label":0}' --answer-choices-json '["Yes","No","Maybe"]' --template '{{premise}} Is it true that {{hypothesis}}? ||| {{answer_choices[label]}}'
```

## Limitations

This skill renders templates and validates prompt boundaries. It does not load Hugging Face datasets, run the PromptSource UI, or evaluate model predictions.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…