jx

Validate Jinja-based server-rendered components with jx check and collect_assets workflows.

Updated Nov 24, 2025
One-click install
npx skills add https://github.com/oornnery/portfolio --skill jx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jx
Source: https://github.com/oornnery/portfolio/tree/main/.agents/skills/jx
Command: npx skills add https://github.com/oornnery/portfolio --skill jx

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

JX provides clear patterns and validation for building reusable Jinja-based components so teams avoid brittle templates, missing imports, inconsistent assets, and per-request Catalog construction that causes performance and correctness issues.

Core Features & Use Cases

  • Catalog best practices: guidance to create a shared Catalog singleton, register folders and packages, and reuse a Jinja environment.
  • Component conventions: explicit import rules, TitleCased component filenames, a single def block, implicit content and attrs, named slots, and runtime type validation.
  • Asset and integration workflows: declare CSS/JS per component, render assets from layouts, collect package assets at build time, and integrate with FastAPI, Flask, Django, HTMX, Alpine.js, and Stimulus.
  • Validation and migration: use jx check for static template validation and follow a documented migration path from JinjaX to JX.

Quick Start

Render a page using a shared Catalog singleton and run jx check against your catalog to validate imports and templates.

Frequently Asked Questions about jx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build reusable Jinja components for FastAPI without brittle templates?

Reusable Jinja components are built using explicit imports, TitleCased filenames, a single def block, and implicit content with attrs passthrough. This pattern prevents brittle templates and missing imports by enforcing consistent structure and runtime validation across your Python web application.

What is the best way to manage CSS and JS assets for server-rendered Jinja components?

Asset management for Jinja components involves declaring CSS and JS files per component and rendering them from layouts. You can collect package assets at build time using the jx collect_assets workflow, ensuring consistent asset delivery and preventing missing stylesheets or scripts.

Why should I use a shared Catalog singleton instead of constructing it per request in Jinja?

A shared Catalog singleton reuses a single Jinja environment across requests, preventing per-request construction that causes performance and correctness issues. It registers folders and packages once, ensuring optimal resource utilization and consistent component rendering throughout the application lifecycle.

How do I validate Jinja template imports and structure in CI?

Template validation is performed using the jx check command, which statically analyzes your catalog to validate imports, def blocks, and slot patterns. Running this in CI prevents inconsistent assets, missing imports, and structural template errors from reaching production.

Can I migrate existing JinjaX projects to this Jinja component pattern?

Migration from JinjaX is supported through a documented path that transitions existing templates to the new component conventions. This involves adopting explicit imports, TitleCased filenames, and the jx check validation workflow to ensure structural correctness during the migration process.