Yesterday a small side project landed in r/PromptEngineering, and it quietly changes what a “Skill” can be. U/oleg_ivye built a way to write Skills as Jinja templates. They run in any harness or dev tool without a single plugin or extension.
Here’s the twist. Most Skills are static instructions: a block of text an agent reads and follows once. This one turns a Skill into something closer to a small program. You get variables, loops, “if” conditions, sub-agents, and composition with other Skills, all inside the same file. One commenter on the thread, u/bewitched_paul, put it well: it makes Skill composition feel like writing small programs instead of just chaining prompts.
Take the example from the post. It defines a list of planets and loops through each one. For every planet it spins up a sub-agent to ask “how many moons does this planet have.” It only writes a note down if the count clears a threshold set by the user’s input. Then it hands everything off to a final stage that drafts a bulletin in whatever tone you ask for. That’s four Skill-building techniques (loops, conditionals, sub-agents, and staged output) stacked in about fifteen lines.
Here’s how the mini-workflow actually runs, step by step:
- 📝 Write your Skill’s frontmatter like normal (name, description), then drop into a Jinja block underneath it.
- 🔁 Use
{% for %}to loop over a list of inputs instead of copy-pasting the same instructions five times. - 🤖 Call
{% agent %}blocks to spin up sub-agents mid-template, each with named outputs you can reference later. - Wrap logic in
{% if %}checks so the Skill only fires certain instructions when a condition is met. - 🎯 Close with a
{% stage %}block that pulls all the accumulated notes into one final output, styled by input like tone or audience.
The prompt inside each stage still reads like a normal instruction to the model. The difference sits around it. That part now behaves like real code: it branches, it loops, it reuses variables, and it composes with other Skills instead of living in isolation.
A few things worth knowing before you try this yourself. The project is early, so expect rough edges around error handling when a sub-agent output doesn’t match the expected type. It also assumes you’re comfortable reading Jinja syntax. That’s not hard, but it’s one more thing to learn on top of prompt writing. And because it’s harness-agnostic by design, you’ll still need to wire it into whatever tool you’re using yourself. There’s no plugin doing that step for you, which is the whole point, but it does mean a bit of setup work upfront.
Compared to standard Skill formats that treat each file as one fixed instruction block, this approach is closer to templating engines used in web development. Think Django or Flask templates, except the output is a prompt instead of HTML. If you’ve ever wished a Skill could “remember” a variable across steps, this solves it directly. No more writing five near-duplicate Skills just to cover five near-duplicate inputs.
Here’s a pro tip if you’re going to test this: start small. Take one repetitive Skill you already maintain, one where you’re manually duplicating instructions for different inputs, and rebuild just that piece as a loop. You’ll feel the difference immediately. It’s a much better first project than converting your most complex Skill on day one.
A second pro tip: use the “if” blocks sparingly at first. It’s tempting to build a huge branching tree the moment you realize you can. But a Skill with ten nested conditions is harder to debug than five smaller Skills chained together. Composition beats complexity here.
One more small thing worth noting: sub-agent outputs get named and stored as variables. That means you can build multi-step research or analysis Skills where later stages reference earlier findings by name, not by re-reading the whole conversation. That’s a quiet but useful upgrade for anything that needs to synthesize several findings into one final answer.
The repo is still young, so bugs are likely and the API may shift. But the core idea is solid: treat a Skill less like a script and more like a template. It’s one of those ideas that feels obvious once you see it, and hard to unsee afterward.
Worth a look if you build or maintain Skills regularly. 🚀 Go poke at the example in the repo, swap in your own agent calls, and watch a repetitive Skill turn into a five-line loop.
Frequently Asked Questions
Q: How is this different from traditional prompt chains?
Rather than stringing prompts together sequentially, Jinja templates let you write skills like actual programs with loops, conditionals, and variables built right in. One commenter nailed it: this feels like writing small programs instead of just chaining prompts, which makes complex orchestration so much more intuitive.
Q: Do I need to learn Jinja syntax to use this?
If you’ve worked with Python or any template language, Jinja clicks instantly. The core syntax ({% for %} loops, {% if %} conditionals, variable assignment) is straightforward. You’ll pick it up as you build.
Q: Can I use this with my existing tools without special setup?
That’s the design goal. It works with any harness or dev tool without plugins or extensions, so there’s basically zero friction to get started.
Q: What kinds of workflows can I actually build?
Beyond the space example, you could iterate over inputs and run different agents on each, branch skill execution based on prior outputs, or shape workflows dynamically based on context. Basically anything you’d code with real logic, just expressed as a skill template.
Skill that let’s you run other Skills as Jinja templates.
by u/oleg_ivye in PromptEngineering