Agent skill

Jinja Codegen

by xberg-io in xberg-io/alef

Mechanics of alef's Minijinja template system: which templateenv module to call, how to register a template, inline-template rules, and engine settings.

MITAuto-check passedDevelopment

Install Jinja Codegen

skills CLI
$ npx skills add xberg-io/alef --skill jinja-codegen -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install xberg-io/alef jinja-codegen --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/xberg-io/alef.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.ai-rulez/skills/jinja-codegen .claude/skills/jinja-codegen && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
jinja-codegen
GitHub stars
100
Token cost
~735 tokens
SKILL.md length
267 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Mechanics of alef's Minijinja template system: which templateenv module to call, how to register a template, inline-template rules, and engine settings.

  • Changing generated-code templates in any backend
  • SKILL.md covers Which template_env to call, Registering a template, Engine settings and Inline templates, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • E2e generator module

What it does

Jinja Codegen is an agent skill from xberg-io/alef. Mechanics of alef's Minijinja template system: which templateenv module to call, how to register a template, inline-template rules, and engine settings. Use this skill when adding or changing generated-code templates in any backend, codegen, or e2e generator module.

Its SKILL.md is about 740 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Project scaffolding and End-to-end testing. It works with Rust. The repository describes itself as: Generate fully-typed, lint-clean language bindings for Rust libraries across 16 languages. The licence is MIT.

When your agent uses it

  • Changing generated-code templates in any backend
  • E2e generator module

Example prompts

  • “Use the jinja-codegen skill to mechanic of alef's Minijinja template system: which templateenv module to call, how to register a template…”
  • “/jinja-codegen”

What it can do on your machine

Read from SKILL.md and the folder at commit fc04366. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are rust).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Jinja Codegen loads about 735 tokens when it runs. Until then it costs about 70 tokens; SKILL.md has 267 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~70
When it runs · the whole SKILL.md, loaded when a task matches
~735

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from xberg-io/alef at commit fc04366, republished under its MIT licence (© xberg-io). 267 words, ~735 tokens.

Download SKILL.mdSave it as .claude/skills/jinja-codegen/SKILL.md (or your agent's skills folder).
name
jinja-codegen
description
Mechanics of alef's Minijinja template system: which template_env module to call, how to register a template, inline-template rules, and engine settings. Use this skill when adding or changing generated-code templates in any backend, codegen, or e2e generator module.
license
MIT

Jinja Codegen Mechanics

The jinja-templates rule states the invariant: all parameterized generated code goes through Minijinja templates, never raw format!/push_str/write! assembly. This skill covers the mechanics of doing that correctly.

Which template_env to call

There is no crate::template_env module. Each backend and generator owns its own template_env.rs:

  • src/backends/<lang>/template_env.rs — per-language backend templates
  • src/codegen/template_env.rs, src/core/template_env.rs, src/docs/template_env.rs, src/readme/template_env.rs, src/scaffold/template_env.rs, src/e2e/template_env.rs — shared/generator-specific templates

Call the one local to the code you are generating from:

rust
out.push_str(&crate::backends::<lang>::template_env::render("block_name.jinja", minijinja::context! {
    key => value,
}));

Registering a template

Register in the backend's template_env.rs via include_str!:

rust
("block_name.jinja", include_str!("templates/block_name.jinja")),

One template per logical unit (class header, method signature, enum variant, etc.) — do not create generic line/content passthrough templates to bypass the jinja-templates rule.

Engine settings

Set in each make_env(): trim_blocks = true, lstrip_blocks = true, keep_trailing_newline = true.

Inline templates

Allowed only for single-line fragments used inside a larger template or join operation. Inline renders must call .trim_end() or .trim_end_matches('\n') at the call site, because templates keep their trailing newline — omitting the trim doubles blank lines in the emitted output.

What Rust prepares vs. what the template owns

Rust prepares typed values, identifiers, escaped literals, symbol names, type names, file paths, enum/field metadata, booleans, comma-joined argument lists, and small expression fragments when they are not a logical emitted unit. Templates own generated-code structure, indentation, and multiline blocks.

Static push_str("literal\n") with no interpolation is fine to leave as-is — no template needed for non-parameterized strings.

Anti-patterns

  • push_str(&format!(...)), write!/writeln! for interpolated output, or multiline format!(...)/format!(r#"..."#) that emits target code.
  • format!(...) strings containing \n for generated code.
  • Catch-all passthrough templates (e.g. formatted_line.jinja receiving content => format!(...)) used to route around the templating requirement.
  • Calling crate::template_env::render — that module does not exist; use the local one.

© xberg-io, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .ai-rulez/skills/jinja-codegen of xberg-io/alef.

Open the folder on GitHubat commit fc04366

Compare with similar skills

Jinja Codegen next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Jinja Codegen compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Jinja Codegen this skillxberg-io/alef100—~735Automated safety check: PassMIT
Release WorkflowGoldziher/spikard123—~909Automated safety check: PassMIT
Add Full Slicefullstackhero/dotnet-starter-kit6.8k—~783Automated safety check: PassMIT
Rust Hygiene Audittsz-org/tsz577—~1.5kAutomated safety check: PassApache-2.0
New CrateDevolutions/IronRDP3.2k—~236Automated safety check: PassApache-2.0
Grindatgreen/Whistler101—~2.4kAutomated safety check: PassMIT

Similar skills

  • Release Workflow

    Goldziher/spikard

    Release/publish the spikard Rust core crate and CLI end-to-end.

    123 GitHub stars~909 tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • Add Full Slice

    fullstackhero/dotnet-starter-kit

    Build a capability end-to-end — backend vertical slice (Contracts→handler→validator→endpoint) AND the React page wired to it.

    6.8k GitHub stars~783 tokensUpdated 8 days ago
    Testing & QAAuto-check passed
  • Run a deep DRY + code-hygiene audit of the Rust workspace and turn the findings into verified, deduplicated, hierarchical GitHub tech-debt issues.

    577 GitHub stars~1.5k tokensUpdated 28 days ago
    DevelopmentAuto-check passed
  • New Crate

    Devolutions/IronRDP

    Create and integrate a new Rust crate in the IronRDP workspace.

    3.2k GitHub stars~236 tokensUpdated today
    DevelopmentAuto-check passed
  • Grind

    atgreen/Whistler

    Whistler-local autonomous work loop. An agent skill from atgreen/Whistler.

    101 GitHub stars~2.4k tokensUpdated 22 days ago
    DevelopmentAuto-check passed
  • Frb Code Generation

    fzyzcjy/flutter_rust_bridge

    A skill your agent uses when modifying Rust APIs, codegen, generated examples, or platform scaffolds in flutterrustbridge to select generation commands and preserve source-of-truth and convergence…

    5.4k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed

More from xberg-io/alef

  • Alef

    xberg-io/alef

    Use Alef correctly for Rust-to-polyglot binding generation. An agent skill from xberg-io/alef.

    100 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Binding Audit

    xberg-io/alef

    Audit bindings for coverage gaps — verify every public Rust item is exposed across all generated language bindings.

    100 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Regen Audit

    xberg-io/alef

    Treat running alef generate/alef all/alef verify in a consumer repo as an audit, not a build step.

    100 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Release Procedure

    xberg-io/alef

    Cut, tag, and publish an alef release end-to-end. An agent skill from xberg-io/alef.

    100 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Alef's dominant defect shape: two components read the same config or IR and act on it differently.

    100 GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Works with

Questions about Jinja Codegen

What does Jinja Codegen do?

Mechanics of alef's Minijinja template system: which templateenv module to call, how to register a template, inline-template rules, and engine settings. Jinja Codegen is an agent skill from xberg-io/alef. Mechanics of alef's Minijinja template system: which templateenv module to call, how to register a template, inline-template rules, and engine settings.

When should I use Jinja Codegen?

Jinja Codegen fits situations like: changing generated-code templates in any backend; E2e generator module.

How do I install Jinja Codegen in Claude Code?

Run `npx skills add xberg-io/alef --skill jinja-codegen -a claude-code`. Or copy the skill folder (.ai-rulez/skills/jinja-codegen in xberg-io/alef) into .claude/skills/jinja-codegen in your project. Claude Code loads it when a task matches its description.

How do I install Jinja Codegen in Codex?

Run `npx skills add xberg-io/alef --skill jinja-codegen -a codex`. Or copy the skill folder (.ai-rulez/skills/jinja-codegen in xberg-io/alef) into .agents/skills/jinja-codegen in your project. Codex loads it when a task matches its description.

Can I use Jinja Codegen in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add xberg-io/alef --skill jinja-codegen -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/jinja-codegen, .gemini/skills/jinja-codegen, .github/skills/jinja-codegen and .opencode/skills/jinja-codegen in your project.

What does Jinja Codegen need to run?

SKILL.md names no scripts, command-line tools or credentials: Jinja Codegen is instructions for the agent only.

Does Jinja Codegen access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Jinja Codegen safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Jinja Codegen use?

Jinja Codegen is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Jinja Codegen use?

About 735 tokens (SKILL.md is roughly 2.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Jinja Codegen?

Skills that share tags, products or a category with Jinja Codegen: Release Workflow (Goldziher/spikard, 123 stars), Add Full Slice (fullstackhero/dotnet-starter-kit, 6.8k stars), Rust Hygiene Audit (tsz-org/tsz, 577 stars) and New Crate (Devolutions/IronRDP, 3.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Jinja Codegen?

xberg-io (a GitHub organization) maintains it in xberg-io/alef, which has 100 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 8, 2026.

Source: xberg-io/alef on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.