skrift-theming

Resolve per-request theme overrides for Skrift templates via the RESOLVE_THEME hook.

1|3|Updated Jun 17, 2025
One-click install
npx skills add https://github.com/Smarter-Dev/smarter-dev --skill skrift-theming
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: skrift-theming
Source: https://github.com/Smarter-Dev/smarter-dev/tree/main/smarter_dev/.claude/skills/skrift-theming
Command: npx skills add https://github.com/Smarter-Dev/smarter-dev --skill skrift-theming

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Skrift theming addresses the challenge of managing multiple visual themes and consistent template overrides in Skrift-based projects. It provides a centralized discovery, resolution order, and per-request switching to adapt the UI to context or user preferences.

Core Features & Use Cases

  • Theme discovery API with ThemeInfo metadata (directory_name, name, description, version, author, templates_dir, static_dir, screenshot)
  • Three-tier template and static file resolution: active theme templates, project overrides, and package defaults
  • Per-request theme switching via a hook-based system (RESOLVE_THEME) to apply user- or request-specific themes
  • Admin and setup integration for theme selection, with dynamic updates to template directories
  • Create, override, and distribute themes under themes/<name>/templates/ plus optional static, theme.yaml, and screenshot

Quick Start

Install a theme under themes/<name>/templates, set site_theme to the desired name, and render a page to verify the themed templates.

Frequently Asked Questions about skrift-theming

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

FAQPage Schema
How do I implement per-request theming for frontend templates?

Per-request theming for frontend templates applies user or request-specific theme overrides using a hook-based system. The RESOLVE_THEME hook dynamically switches the active theme during rendering, allowing contextual UI adaptations with a predictable fallback path.

What is the resolution order for template and static file overrides?

Template and static file resolution follows a three-tier fallback order: active theme templates first, then project overrides, and finally package defaults. This ensures customized theme templates take precedence while maintaining baseline package functionality.

How do I set up a custom theme directory structure?

Set up a custom theme by creating a directory under themes/<name>/templates and adding an optional theme.yaml file for metadata. Include optional static and screenshot directories to provide theme assets and visual previews for admin selection.

Does Skrift theming support dynamic admin integration for theme selection?

Skrift theming supports admin and setup integration for theme selection, dynamically updating template directories when a theme is chosen. The admin interface uses ThemeInfo metadata to display available themes and apply site_theme configurations.

Why are my theme template overrides not rendering correctly?

Template overrides may not render if the active theme directory structure is incorrect or the site_theme setting is mismatched. Verify the theme.yaml metadata and ensure templates reside under themes/<name>/templates to proper resolution path alignment.

Can I distribute custom themes with metadata for discovery?

Custom themes can be distributed using the theme discovery API which reads ThemeInfo metadata like directory_name, version, author, and screenshot. This allows themes to be packaged, shared, and automatically discovered by the admin setup interface.