一键导入
jinja2-atomic-design
Jinja2 + HTMX component patterns. Triggers on: jinja, html, template, macro, atom, molecule, htmx, ssr, tailwind, caller.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Jinja2 + HTMX component patterns. Triggers on: jinja, html, template, macro, atom, molecule, htmx, ssr, tailwind, caller.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Hexagonal Architecture (Ports & Adapters) for the video publishing pipeline. Triggers on: VideoPublisher, TrendingVideoFetcher, TimeSeriesReader, VideoMetadataReader, AuthCredentialStore, ReleaseDateValidator, OAuthProvider, publisher_registry, ports, adapters, domain, hexagonal, build_publishers, TaskGroup publish.
Type hint patterns for this repo: Protocol, TypeVar, TypedDict, Literal, Final, and strict ty usage. Triggers on: type hints, typing, TypeVar, Protocol, Generic, TypedDict, ty check.
Design, review, and optimize Dockerfiles, Docker images, and Docker Compose configurations for production, performance, and maintainability. Use when auditing Docker configurations, creating production-ready images, designing multi-container architectures, or implementing container orchestration with focus on security, reproducibility, minimal attack surface, build optimization, and observability.
Best practices for modeling, ingesting, querying, and analyzing time-series data with TinyFlux. Use when designing TinyFlux Point schemas, implementing query patterns, managing retention and partitioning, or integrating TinyFlux with pandas/NumPy for analysis and forecasting workflows.
Video processing migration (C1 split): guidelines for decomposing src/video_processing.py into src/infrastructure/video/. Triggers on: video_processing, VideoAssetManager, VideoRenderer, ThumbnailGenerator, VideoCompositor, moviepy, CompositeVideoClip, PIL Image.
Structured logging with structlog. Triggers on: log, logger, exception, structlog, observe, print, logging.
| name | jinja2-atomic-design |
| description | Jinja2 + HTMX component patterns. Triggers on: jinja, html, template, macro, atom, molecule, htmx, ssr, tailwind, caller. |
| compatibility | Jinja2 3+, HTMX 1.9+, jinja2-fragments. |
templates/common/partials/. Domain-specific components go in templates/{domain}/partials/.hx-get, hx-post, hx-swap, hx-target). Avoid custom JS.Never pass raw Tailwind classes for core styling. Use variant mappings and accept generic hx_attrs.
{% macro button(text, variant='primary', hx_attrs={}) -%}
{% set styles = {
'primary': 'bg-blue-600 hover:bg-blue-700 text-white',
'ghost': 'bg-transparent hover:bg-gray-100 text-gray-800'
} %}
<button class="btn {{ styles.get(variant, styles['primary']) }}"
{% for attr, value in hx_attrs.items() %} {{ attr }}="{{ value }}" {% endfor %}>
{{ text }}
</button>
{%- endmacro %}
{# Usage: {{ button('Save', hx_attrs={'hx-post': '/save', 'hx-target': '#res'}) }} #}
Use caller() when a component wraps arbitrary inner content. Do not pass HTML strings as macro parameters.
{% macro card(title) -%}
<div class="card border rounded-lg">
<div class="card-header border-b p-4">{{ title }}</div>
<div class="card-body p-4">
{{ caller() }}
</div>
</div>
{%- endmacro %}
{# Usage: #}
{% call card(title='File Details') %}
<p>Inner content here</p>
{{ file_source_icon('youtube') }}
{% endcall %}
For top-level organisms that genuinely need request or current_user (like Navbars), use with context. Do not prop-drill these objects through multiple layers.
{% macro main_nav() %}
<nav>
<a href="/files" class="{% if '/files' in request.url.path %}active{% endif %}">Files</a>
</nav>
{% endmacro %}
{# Usage in base.html.jinja #}
{% from 'common/partials/main_navigation.html.jinja' import main_nav with context %}
{{ main_nav() }}
When one action updates multiple parts of the UI, use jinja2-fragments blocks and hx-swap-oob="true".
{# In the partial template returned by the backend #}
{% block status_pill %}
<span id="status-{{ file.id }}" class="pill-approved">Approved</span>
{% endblock %}
{% block file_count %}
<div id="file-count" hx-swap-oob="true">{{ total_files }} files</div>
{% endblock %}
| ❌ Anti-pattern | ✅ Correct |
|---|---|
Hardcoding logic in parameters: {{ icon(color='text-red-500') }} | Pass semantic variants: {{ icon(variant='danger') }} |
Prop drilling: {{ row(item, request, user) }} | Use {% from ... import ... with context %} if global state is required |
| Heavy JS logic for loading states | Render async_content(state='loading') and let HTMX replace it |
Writing inline <svg> in multiple files | Extract to common/partials/icons.html.jinja atom |