class-extraction-guard

class-extraction-guard is a skill for Claude Code from ivy00johns/Skill-Madness. It costs 218 tokens per session (1,689 once invoked), scanned A, original, MIT.

A source-code check that finds repeated long strings of frontend utility classes and encourages moving them into a named class or shared component. Utility classes are small styling labels placed directly in markup.

In plain words
What is it for?
It scans className or markup usage, detects repeated utility-class groups, and flags places where the styling should be extracted into shared code.
Why use it?
Repeated styling strings make frontend code harder to maintain even when the pages look correct and the values use approved design tokens.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code.

Part of the skill-madness plugin — 80 skills shipped together

Good fit It scans className or markup usage, detects repeated utility-class groups, and flags places where the styling should be extracted into shared code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ivy00johns/skill-madness/class-extraction-guard
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.

Any agent
npx skills add ivy00johns/Skill-Madness --skill class-extraction-guard
Clone the repo
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness

Made for: Claude Code.

Or install skill-madness, the plugin that ships this one along with the rest of its 80 skills.

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 class-extraction-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/ivy00johns/skill-madness/class-extraction-guard/github.svg)](https://agentmods.dev/skills/ivy00johns/skill-madness/class-extraction-guard)
Your own site
<a href="https://agentmods.dev/skills/ivy00johns/skill-madness/class-extraction-guard"><img src="https://agentmods.dev/badge/skills/ivy00johns/skill-madness/class-extraction-guard/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for class-extraction-guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/ivy00johns/skill-madness/class-extraction-guard"><img src="https://agentmods.dev/badge/skills/ivy00johns/skill-madness/class-extraction-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 218 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,689 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 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.1 $0.00218 $0.01689
Opus 5 $0.00109 $0.00844
Sonnet 5 $0.00044 $0.00338
Haiku 4.5 $0.00022 $0.00169

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

Security

Grade A, and why

class-extraction-guard 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 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/check_class_extraction.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/workflows/class-extraction-guard/SKILL.md · 125 lines

How it starts

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

class-extraction-guard

What this is

A deterministic, parse-once gate that flags utility-class soup: the same long run of utility classes pasted inline across many call-sites instead of extracted into a named class (@apply / a CSS component) or a shared UI component.

It exists because of a real gap. design-token-guard checks which values styling uses — it catches a hardcoded #07090c that should be var(--token). But a string like flex items-center gap-1.5 text-bone-faint hover:text-rune uses perfectly valid tokens, so design-token-guard passes it by construction. Repeat that string 9× across the codebase and you have a maintenance problem the value gate was never built to see. And because the repeated version renders identically to an extracted one, the pixel gates (render-sanity, ux-review) can't see it either. The duplication lives only in source — exactly in the seam between the value gate and the pixel gates. This is the missing organization gate that closes that seam.

gate reads catches
render-sanity / ux-review pixels broken pages, dead links, stale data, visual regressions
design-token-guard source hardcoded colors / inline styles bypassing the token system
class-extraction-guard source the same utility combo repeated inline instead of extracted

None subsumes the others. A UI build wants all three.

Quick start

# Human-readable report
python3 ~/.claude/skills/class-extraction-guard/scripts/check_class_extraction.py --root .

# JSON for a gate (same gate contract as design-token-guard: exit codes +
# .summary.errors / .summary.warnings — the JSON key shapes differ)
python3 ~/.claude/skills/class-extraction-guard/scripts/check_class_extraction.py --root . --json
#   -> { "summary": { "errors": 0, "warnings": 12, "files_scanned": 98 },
#        "findings": [ { "rule": "...", "file": "...", "line": 93, "count": 9,
#                        "string": "...", "occurrences": [...], "suggestion": "..." } ] }

Read the full file on GitHub · 125 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 125 lines · 218 tokens per session scan A cbb7b7342e3c

Subscribe to this mod's changes

class-extraction-guard is a skill published in the GitHub repository ivy00johns/Skill-Madness (11 stars, last pushed yesterday), licensed MIT. It adds 218 tokens to every session and 1,689 once invoked, about $0.0011 per session on Opus 5. 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.

Related

Other skills, from other repositories

chakra-ui-builder

Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…

chakra-ui/chakra-ui · 214 tokens

visual-ralph

Visual Ralph orchestration for frontend UI from generated references, static references, or live URL targets, using $ralph with built-in visual verdict and pixel-diff evidence until the implementation matches and leaves a reproducible design system.

Yeachan-Heo/oh-my-codex · 50 tokens

frontend-visual-qa

Audits already-rendered web, landing-page, HTML deck/slide, browser tool/game, dashboard/admin, design-system, and desktop UIs using real-browser or native-app journeys, inspected screenshots, DOM geometry, responsive or projection viewports, and a bundled Playwright sweep. Use after UI implementation to find…

daymade/claude-code-skills · 145 tokens

prototype-web

A clickable, high-fidelity web product prototype with navigation, a hero section, feature cards, steps, social proof, and optional pricing. It is designed to resemble a finished landing page while remaining a prototype.

nexu-io/html-anything · 24 tokens

waitlist-page

A simple waitlist page for collecting email addresses from people interested in a new product or early-access release.

nexu-io/html-anything · 25 tokens

tailwindcss

Tailwind CSS v4 conventions — semantic design tokens for theme-safe styling, mobile-first responsive layouts, and v4-first utilities. Use when styling components or writing className utilities with Tailwind. Don't use for plain CSS, CSS-in-JS (styled-components, emotion), or other utility frameworks.

compozy/compozy · 64 tokens