modus-themes-solidjs

modus-themes-solidjs is a cursor rule for Cursor from julianoczkowski/create-trimble-app. It costs 0 tokens per session (3,278 once invoked), scanned A, a copy of modus-themes-react, MIT.

A set of rules for adding six Modus themes to a SolidJS and Vite application, including theme switching and saving the selected theme.

In plain words
What is it for?
Use it when building or maintaining a SolidJS interface that supports Modus or Connect light and dark themes.
Why use it?
It gives the application a consistent way to change themes and restore a user's choice after reloads. It also addresses server-rendering issues that can make the page display the wrong theme briefly.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { useTheme } from "../hooks/useTheme";.

Good fit Use it when building or maintaining a SolidJS interface that supports Modus or Connect light and dark themes.

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/julianoczkowski/create-trimble-app
agentmods
npx agentmods add rules/julianoczkowski/create-trimble-app/modus-themes-solidjs

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for modus-themes-solidjs

README.md
[![agentmods](https://agentmods.dev/badge/rules/julianoczkowski/create-trimble-app/modus-themes-solidjs.svg)](https://agentmods.dev/rules/julianoczkowski/create-trimble-app/modus-themes-solidjs)
Your own site
<a href="https://agentmods.dev/rules/julianoczkowski/create-trimble-app/modus-themes-solidjs"><img src="https://agentmods.dev/badge/rules/julianoczkowski/create-trimble-app/modus-themes-solidjs.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 3,278 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 92% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.03278
Opus 5 $0.00000 $0.01639
Sonnet 5 $0.00000 $0.00656
Haiku 4.5 $0.00000 $0.00328

Measured 4d ago against content hash 5d009c7f9d26, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

modus-themes-solidjs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

92% identical to modus-themes-react — 82 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

templates/solidjs/.cursor/rules/modus-themes-solidjs.mdc · 507 lines

How it starts

The opening of the file, as written. The whole thing — 507 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Modus Themes Implementation in SolidJS + Vite

🎨 Theme System Overview

CRITICAL: This SolidJS + Vite application supports 6 Modus themes with proper theme switching, persistence, and hydration safety.

Available Themes: 4 Modus themes + 2 Connect themes

  • modus-classic-light / modus-classic-dark
  • modus-modern-light / modus-modern-dark
  • connect-light / connect-dark

🏗️ Theme Architecture

ThemeProvider Setup

// ✅ CORRECT: ThemeProvider in App.tsx
import { ThemeProvider } from "./contexts/ThemeContext";

function App() {
  return (
    <ThemeProvider>
      <ModusProvider>
        <Router>
          <div class="min-h-screen flex flex-col">
            <AppHeader />
            <div class="flex-1">
              <Routes>{/* Routes */}</Routes>
            </div>
            <AppFooter />
          </div>
        </Router>
      </ModusProvider>
    </ThemeProvider>
  );
}

Theme Context Implementation

// ✅ CORRECT: Theme context with hydration safety
import { createEffect, createSignal, type JSX.Element } from "solid-js";
import { ThemeContext, type Theme } from "./ThemeContextData";

interface ThemeProviderProps {
  children: JSX.Element;
}

const VALID_THEMES: Theme[] = [
  "modus-classic-light",
  "modus-classic-dark",
  "modus-modern-light",
  "modus-modern-dark",
  "connect-light",
  "connect-dark",
];

export function ThemeProvider({ children }: ThemeProviderProps) {
  const [theme, setThemeState] = createSignal<Theme>("modus-classic-light");
  const [mounted, setMounted] = createSignal(false);

  // Derived state
  const isDark = theme.includes("dark");
  const isModern = theme.includes("modern");

  // Load theme from localStorage on mount
  createEffect(() => {
    if (typeof window !== "undefined") {
      try {
        const savedTheme = window.localStorage.getItem(
          "preferred-theme"
        ) as Theme | null;

        if (savedTheme && VALID_THEMES.includes(savedTheme)) {
          setThemeState(savedTheme);
        }
      } catch (error) {
        console.warn("Unable to read stored theme preference:", error);
      }
    }
    setMounted(true);
  }, []);

  // Apply theme to document when it changes
  createEffect(() => {
    if (!mounted) return;

    const html = document.documentElement;

    // Set theme attribute (official Modus way)
    html.setAttribute("data-theme", theme);

    // Save to localStorage
    if (typeof window !== "undefined") {
      try {
        window.localStorage.setItem("preferred-theme", theme);
      } catch (error) {
        console.warn("Unable to persist theme preference:", error);
      }
    }
  }, [theme, mounted]);

  const setTheme = (newTheme: Theme) => {
    setThemeState(newTheme);
  };

  // Prevent hydration mismatch by not rendering until mounted
  if (!mounted) {
    return <>{children}</>;
  }

  return (
    <ThemeContext.Provider value={{ theme, setTheme, isDark, isModern }}>
      {children}
    </ThemeContext.Provider>
  );
}

Read the full file on GitHub · 507 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 507 lines · 0 tokens per session scan A 5d009c7f9d26

Subscribe to this mod's changes

modus-themes-solidjs is a cursor rule published in the GitHub repository julianoczkowski/create-trimble-app (3 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,278 tokens. A static security scan graded it A with 0 findings. It is 92% identical to modus-themes-react, differing in 82 lines, and is treated as a copy.