electric-clojure-v3-rules

A coding guide for Electric Clojure v3, a Clojure-based system for building web applications with shared client and server code. It covers reactive programming, where changes in data update dependent parts of an application.

In plain words
What is it for?
Use it while designing reactive computations, transferring work between client and server, and rendering web interfaces.
Why use it?
It gives developers consistent patterns for writing efficient Electric Clojure applications without guessing at the framework's conventions.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/theronic/clojure-prompts/electric-clojure-v3-rules
Clone the repo
git clone --depth 1 https://github.com/theronic/clojure-prompts
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 6,623 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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 $0.00000 $0.06623
Opus 5 $0.00000 $0.03312
Sonnet 5 $0.00000 $0.01325
Haiku 4.5 $0.00000 $0.00662

Measured 2d ago against content hash b9476849dd34, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

electric-clojure-v3-rules 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 2d 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.

electric-clojure-v3-rules.mdc · 736 lines

How it starts

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

Electric Clojure v3: A Comprehensive Style Guide

Introduction

Electric Clojure is a reactive Clojure(Script) dialect for building web applications with a unified client-server programming model. This guide distills best practices, patterns, and idioms for writing idiomatic, efficient Electric Clojure v3 applications. It emphasizes Electric's core strengths: reactive computation, seamless client-server transfer, and efficient UI rendering.

Electric Clojure's design enables developers to write full-stack applications in a single language with a unified mental model, eliminating the typical boundaries between client and server. This guide will help you harness these strengths to produce robust, maintainable Electric Clojure code.

1. Electric Clojure Philosophy and Fundamentals

1.1 Core Principles

Reactivity

Electric is fundamentally a reactive programming system, where changes to data automatically propagate through the application.

  • Values flowing through a DAG: Electric programs are directed acyclic graphs (DAGs) of computations, with values flowing from sources to sinks.
  • Differential updates: Only recompute what has changed, with fine-grained reactivity.
  • Signals, not streams: Electric models signals (like mouse coordinates) rather than streams (like mouse clicks).
  • Work-skipping: If an argument to a function hasn't changed, the function doesn't need to be recomputed.
  • Backpressure: Electric automatically handles backpressure throughout the application, ensuring components aren't overwhelmed with data.
;; A reactive timer that automatically updates
(e/defn Timer []
  (let [seconds (/ (e/System-time-ms) 1000)]
    (dom/div (dom/text "Time: " seconds))))
Client-Server Transfer

Electric allows for seamless client-server programming within the same codebase.

  • Transfer boundaries are explicit: Use e/server and e/client to specify where code runs.
  • Values transfer, references don't: Only serializable values can cross network boundaries.
  • Platform interop forces site: Interop with platform-specific code (like DOM or Java) forces expressions to a specific site.
  • Edges aren't sited: Shared bindings pass through function calls symbolically, not forcing transfer.
  • Dynamic siting: Site inheritance follows dynamic scope in v3.

Read the full file on GitHub · 736 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. 2d ago First seen · 736 lines · 0 tokens per session scan A b9476849dd34

Subscribe to this mod's changes

electric-clojure-v3-rules is a cursor rule published in the GitHub repository theronic/clojure-prompts (37 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 6,623 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.