semantic-coloring

semantic-coloring is a cursor rule for Cursor from AI-Learning-Gems/AI-Learning-Gems.github.io. It costs 0 tokens per session (3,141 once invoked), scanned A, original, MIT.

A set of editing rules for using consistent, meaning-based colors in textbook chapters. WCAG is an accessibility standard that helps ensure color choices remain usable for people with disabilities.

In plain words
What is it for?
Applying semantic colors during the final editing pass of a textbook chapter, after the prose has been revised.
Why use it?
It gives readers a visual cue for separating and tracking different kinds of concepts while keeping the colors accessible.

Cursor rule for Cursor

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/ai-learning-gems/ai-learning-gems.github.io/semantic-coloring
Clone the repo
git clone --depth 1 https://github.com/AI-Learning-Gems/AI-Learning-Gems.github.io

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 semantic-coloring

README.md
[![agentmods](https://agentmods.dev/badge/rules/ai-learning-gems/ai-learning-gems.github.io/semantic-coloring.svg)](https://agentmods.dev/rules/ai-learning-gems/ai-learning-gems.github.io/semantic-coloring)
Your own site
<a href="https://agentmods.dev/rules/ai-learning-gems/ai-learning-gems.github.io/semantic-coloring"><img src="https://agentmods.dev/badge/rules/ai-learning-gems/ai-learning-gems.github.io/semantic-coloring.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,141 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.03141
Opus 5 $0.00000 $0.01571
Sonnet 5 $0.00000 $0.00628
Haiku 4.5 $0.00000 $0.00314

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

Security

Grade A, and why

semantic-coloring 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.

.cursor/rules/semantic-coloring.mdc · 234 lines

How it starts

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

Semantic Concept Coloring

Rules for applying consistent semantic color-coding to key concepts throughout textbook chapters. This technique uses author-provided color as a visual signal (Mayer's Signaling Principle) to help readers mentally separate and track concept categories.

Research basis: Color-coding is a form of visual signaling with meta-analytic support (Alpizar et al. 2020, g = 0.22; Richter et al. 2016, d = 0.22). Liu et al. (2021) found large effect sizes (eta-squared = 0.23) with lower cognitive load (measured by pupil diameter and EEG). This is fundamentally different from student-directed highlighting (Dunlosky LOW utility): author-provided semantic color-coding is expert-curated, consistent, and functions as a perceptual signal, not a learning activity. It leverages pre-attentive processing (Treisman & Gelade 1980), the Von Restorff isolation effect, and dual coding (Paivio 1986).


When to Apply

The coloring pass is part of the editing workflow (edit-textbook-chapter.md). It runs AFTER prose-quality editing is complete — it should be the last content-level pass before final verification. The writing workflow (write-textbook-chapter.md) may also apply coloring during initial writing, especially in the Chapter Overview paragraph where the technique has the highest impact.


The Color Palette (WCAG AA Compliant)

All colors pass WCAG AA (4.5:1 minimum) for normal-size text on white backgrounds. They are Tailwind CSS 600-700 shades, chosen for perceptual distinguishability and colorblind safety.

# Name Hex WCAG Ratio Prose Syntax LaTeX Syntax
1 Indigo #4F46E5 6.29:1 [**term**]{style="color: #4F46E5;"} $\textcolor{#4F46E5}{symbol}$
2 Emerald #047857 5.48:1 [**term**]{style="color: #047857;"} $\textcolor{#047857}{symbol}$
3 Rose #E11D48 4.70:1 [**term**]{style="color: #E11D48;"} $\textcolor{#E11D48}{symbol}$
4 Sky #0369A1 5.93:1 [**term**]{style="color: #0369A1;"} $\textcolor{#0369A1}{symbol}$
5 Amber #B45309 5.02:1 [**term**]{style="color: #B45309;"} $\textcolor{#B45309}{symbol}$
6 Purple #7E22CE 6.98:1 [**term**]{style="color: #7E22CE;"} $\textcolor{#7E22CE}{symbol}$
7 Teal #0F766E 5.23:1 [**term**]{style="color: #0F766E;"} $\textcolor{#0F766E}{symbol}$
8 Slate #475569 7.58:1 [**term**]{style="color: #475569;"} $\textcolor{#475569}{symbol}$

Read the full file on GitHub · 234 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 · 234 lines · 0 tokens per session scan A fa5b4219eb94

Subscribe to this mod's changes

semantic-coloring is a cursor rule published in the GitHub repository AI-Learning-Gems/AI-Learning-Gems.github.io (22 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,141 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.