Agent skill

Mdx Sanitizer

by curiositech in curiositech/some_claude_skills

Sanitize MDX content for Docusaurus builds. An agent skill from curiositech/some_claude_skills.

MITAuto-check: notesDocuments & Office

Install Mdx Sanitizer

skills CLI
$ npx skills add curiositech/some_claude_skills --skill mdx-sanitizer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install curiositech/some_claude_skills mdx-sanitizer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/curiositech/some_claude_skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/mdx-sanitizer .claude/skills/mdx-sanitizer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mdx-sanitizer
GitHub stars
244
Token cost
~1.2k tokens
SKILL.md length
305 words
Files
2
Skills in repo
95
Repo updated
First seen
Licence
MIT

At a glance

Sanitize MDX content for Docusaurus builds. An agent skill from curiositech/some_claude_skills.

  • Works in 3 steps: Sync-Time Sanitization (Proactive) → Pre-Commit Validation (Reactive) → Build-Time Validation (Final Check)
  • Pre-commit hooks fail on bracket
  • SKILL.md covers The Problem, Solution Architecture, Usage and Escaping Strategies, plus 4 more sections
  • Calls npm

What it does

Mdx Sanitizer is an agent skill from curiositech/some_claude_skills. Sanitize MDX content for Docusaurus builds. Fixes unescaped angle brackets (<, , &lt;=, &gt;=), Liquid/Nunjucks template syntax ({{ }}), TypeScript generics (Promise&lt;T&gt;), and inline code backtick edge cases. Use when pre-commit hooks fail on bracket or Liquid validation, or when MDX/JSX build errors reference unexpected tokens. NOT for general markdown linting or prose editing.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `.claude-plugin/plugin.json`).

It sits in Documents & Office, covering Markdown and React components. It works with TypeScript and npm. The repository describes itself as: Claude skills that make my life easier. The licence is MIT.

When your agent uses it

  • Pre-commit hooks fail on bracket
  • Liquid validation
  • MDX/JSX build errors reference unexpected tokens

Example prompts

  • “/mdx-sanitizer”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, Glob, Grep

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Sync-Time Sanitization (Proactive)
  2. Pre-Commit Validation (Reactive)
  3. Build-Time Validation (Final Check)

What it can do on your machine

Read from SKILL.md and the folder at commit 6713fc7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • mdxjs.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mdx Sanitizer loads about 1.2k tokens when it runs. Until then it costs about 100 tokens; SKILL.md has 305 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~100
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, Glob, Grep

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from curiositech/some_claude_skills at commit 6713fc7, republished under its MIT licence (© curiositech). 305 words, ~1,202 tokens.

Download SKILL.mdSave it as .claude/skills/mdx-sanitizer/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
mdx-sanitizer
description
Sanitize MDX content for Docusaurus builds. Fixes unescaped angle brackets (<, >, &lt;=, &gt;=), Liquid/Nunjucks template syntax ({{ }}), TypeScript generics (Promise&lt;T&gt;), and inline code backtick edge cases. Use when pre-commit hooks fail on bracket or Liquid validation, or when MDX/JSX build errors reference unexpected tokens. NOT for general markdown linting or prose editing.
allowed-tools
Read, Write, Edit, Bash, Glob, Grep
version
1.0.0
triggers
mdx error, angle bracket, jsx parsing, build failure mdx, escape angle brackets, sanitize markdown
metadata.category
DevOps & Automation
metadata.tags
mdx, docusaurus, markdown, build-tools, sanitization

MDX Sanitizer

Comprehensive MDX content sanitizer that prevents JSX parsing errors caused by angle brackets, generics, and other conflicting patterns.

The Problem

MDX 2.x treats unescaped < and { as JSX syntax. This causes build failures when content contains:

  • TypeScript generics: Promise&lt;T&gt;, Array&lt;string&gt;, Map&lt;K, V&gt;
  • Comparisons: &lt;100ms, &lt;=, &gt;=
  • Arrows: --&gt;, &lt;--, -&gt;
  • Invalid tags: &lt;link&gt; in prose, &lt;tag&gt; placeholders
  • Empty brackets: &lt;&gt;

Solution Architecture

This skill implements a three-layer defense:

1. Sync-Time Sanitization (Proactive)

Content is sanitized when syncing from .claude/skills/ to website/docs/:

  • syncSkillDocs.ts - Main skill files
  • syncSkillSubpages.ts - Reference files
  • doc-generator.ts - Generated docs
2. Pre-Commit Validation (Reactive)

The git pre-commit hook validates files before commit using validate-brackets.js.

3. Build-Time Validation (Final Check)

npm run validate:all runs as part of prebuild to catch any issues.

Usage

Check for Issues (Dry Run)
bash
cd website
npm run sanitize:mdx
# or with verbose output
npm run sanitize:mdx -- --verbose
Fix All Issues
bash
cd website
npm run sanitize:mdx -- --fix
# or shorthand
npm run fix:mdx
Programmatic API
typescript
import { sanitizeForMdx, validateMdxSafety, isMdxSafe } from './lib/mdx-sanitizer';

// Sanitize content
const result = sanitizeForMdx(content, { useHtmlEntities: true });
if (result.modified) {
  console.log(`Fixed ${result.issues.length} issues`);
  fs.writeFileSync(path, result.content);
}

// Validate without modifying
const issues = validateMdxSafety(content, 'path/to/file.md');

// Quick check
if (!isMdxSafe(content)) {
  // Handle issues
}

Escaping Strategies

The sanitizer uses HTML entities for maximum compatibility:

PatternOriginalEscaped
Less-than<&lt;
Greater-than>&gt;
Generics&lt;T&gt;&amp;lt;T&amp;gt;
Comparison&lt;=&amp;lt;=

Content inside code blocks (``` or `) is automatically protected and never escaped.

Files Modified

  • website/scripts/lib/mdx-sanitizer.ts - Core sanitizer module
  • website/scripts/sanitize-mdx.ts - CLI wrapper
  • website/scripts/syncSkillDocs.ts - Integration
  • website/scripts/syncSkillSubpages.ts - Integration
  • website/scripts/lib/doc-generator.ts - Integration
  • website/package.json - npm scripts

Patterns Detected

  1. Less-than before digit: &lt;100, &lt;0.5ms
  2. Comparison operators: &lt;=, &gt;=
  3. Empty brackets: &lt;&gt;
  4. Arrows: &lt;--, --&gt;
  5. Generic types: Promise&lt;T&gt;, Array&lt;string&gt;
  6. Space after less-than: &lt; value
  7. Invalid pseudo-tags: &lt;link&gt;, &lt;tag&gt; (not valid HTML)

Troubleshooting

Build Still Fails After Running Sanitizer
  1. Clear Docusaurus cache: npm run clear
  2. Re-run sanitizer: npm run sanitize:mdx -- --fix
  3. Rebuild: npm run build
False Positives

If valid JSX components are being escaped:

  • Ensure they use PascalCase (e.g., &lt;MyComponent&gt;)
  • Check they're valid HTML5 elements
Manual Escaping

For edge cases, manually escape in source:

  • Use backticks for inline code: `&lt;T&gt;`
  • Use fenced code blocks for multi-line
  • Use HTML entities: &lt; and &gt;

Sources

© curiositech, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .claude/skills/mdx-sanitizer of curiositech/some_claude_skills.

  • SKILL.md
  • .claude-plugin/plugin.json

Open the folder on GitHubat commit 6713fc7

Compare with similar skills

Mdx Sanitizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mdx Sanitizer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mdx Sanitizer this skillcuriositech/some_claude_skills244—~1.2kAutomated safety check: NotesMIT
Server Feature Devscragnog/HOT-Step-CPP174—~6.5kAutomated safety check: NotesMIT
React Emailviclafouch/meme-studio1102 repos~3.6kAutomated safety check: PassMIT
Fumadocsbetter-notify/better-notify313—~2.3kAutomated safety check: PassMIT
Using Docs Kitlobehub/lobe-ui2.2k—~2.8kAutomated safety check: PassMIT
Jpagecode2rich/jpage175—~3.2kAutomated safety check: NotesMIT

Similar skills

  • Server Feature Dev

    scragnog/HOT-Step-CPP

    Guides adding or modifying a feature in the HOT-Step CPP Node/TypeScript server (Express route + service pattern, better-sqlite3 schema changes, engine calls via aceClient, logging, tsx watch dev…

    174 GitHub stars~6.5k tokensUpdated yesterday
    Backend & APIsAuto-check: notes
  • React Email

    viclafouch/meme-studio

    A skill your agent uses when creating HTML email templates with React components - welcome emails, password resets, notifications, order confirmations, newsletters, or transactional emails.

    110 GitHub starsUsed in 2 repos~3.6k tokens
    Backend & APIsAuto-check passed
  • Fumadocs

    better-notify/better-notify

    A skill your agent uses when writing MDX documentation pages for a Fumadocs project — frontmatter, meta.json, page ordering, and fumadocs-ui React components available inside MDX content.

    313 GitHub stars~2.3k tokensUpdated 1 mo ago
    Frontend & DesignAuto-check passed
  • Using Docs Kit

    lobehub/lobe-ui

    Set up and author a documentation site with @lobehub/docs-kit (the lobedocs CLI, React Router + Vite static docs used by ui.lobehub.com).

    2.2k GitHub stars~2.8k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Jpage

    code2rich/jpage

    即页(jpage)统一技能:生成 HTML/Markdown 内容、制作 reveal.js 幻灯片、使用内容模板市场风格、上传到即页并管理文件。所有内容生产与文件管理操作都通过本技能完成。

    175 GitHub stars~3.2k tokensUpdated 2 mo ago
    Documents & OfficeAuto-check: notes
  • Mdzilla

    pi0/mdzilla

    Browse, search, and export documentation from any source using the mdzilla CLI.

    110 GitHub stars~761 tokensUpdated 6 mo ago
    Documents & OfficeAuto-check passed

More from curiositech/some_claude_skills

All 95 skills in this repo
  • Crisis Detection Intervention AI

    curiositech/some_claude_skills

    Detect crisis signals in user content using NLP, mental health sentiment analysis, and safe intervention protocols.

    244 GitHub starsUsed in 2 repos~3.8k tokens
    Auto-check passed
  • Form Validation Architect

    curiositech/some_claude_skills

    End-to-end form handling with react-hook-form, Zod schemas, validation patterns, error messaging, field arrays, and multi-step wizards.

    244 GitHub stars~3.8k tokensUpdated 1 mo ago
    Auto-check passed
  • GitHub Actions Pipeline Builder

    curiositech/some_claude_skills

    Build production CI/CD pipelines with GitHub Actions. An agent skill from curiositech/some_claude_skills.

    244 GitHub stars~2.8k tokensUpdated 1 mo ago
    Auto-check: notes
  • Background Job Orchestrator

    curiositech/some_claude_skills

    Expert in background job processing with Bull/BullMQ (Redis), Celery, and cloud queues.

    244 GitHub stars~3.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Competitive Cartographer

    curiositech/some_claude_skills

    Strategic analyst that maps competitive landscapes, identifies white space opportunities, and provides positioning recommendations.

    244 GitHub stars~1.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Computer Vision Pipeline

    curiositech/some_claude_skills

    Build production computer vision pipelines for object detection, tracking, and video analysis.

    244 GitHub stars~4k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about Mdx Sanitizer

What does Mdx Sanitizer do?

Sanitize MDX content for Docusaurus builds. An agent skill from curiositech/some_claude_skills. Mdx Sanitizer is an agent skill from curiositech/some_claude_skills. Sanitize MDX content for Docusaurus builds.

When should I use Mdx Sanitizer?

Mdx Sanitizer fits situations like: pre-commit hooks fail on bracket; liquid validation; MDX/JSX build errors reference unexpected tokens.

How do I install Mdx Sanitizer in Claude Code?

Run `npx skills add curiositech/some_claude_skills --skill mdx-sanitizer -a claude-code`. Or copy the skill folder (.claude/skills/mdx-sanitizer in curiositech/some_claude_skills) into .claude/skills/mdx-sanitizer in your project. Claude Code loads it when a task matches its description.

How do I install Mdx Sanitizer in Codex?

Run `npx skills add curiositech/some_claude_skills --skill mdx-sanitizer -a codex`. Or copy the skill folder (.claude/skills/mdx-sanitizer in curiositech/some_claude_skills) into .agents/skills/mdx-sanitizer in your project. Codex loads it when a task matches its description.

Can I use Mdx Sanitizer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add curiositech/some_claude_skills --skill mdx-sanitizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mdx-sanitizer, .gemini/skills/mdx-sanitizer, .github/skills/mdx-sanitizer and .opencode/skills/mdx-sanitizer in your project.

What does Mdx Sanitizer need to run?

Going by SKILL.md and its folder, Mdx Sanitizer needs the command-line tools its instructions call (npm). Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, Glob, Grep.

Does Mdx Sanitizer access the network?

SKILL.md names 2 domains. As links in the text: mdxjs.com and github.com. This is read from the text; nothing was executed.

Is Mdx Sanitizer safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Mdx Sanitizer use?

Mdx Sanitizer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mdx Sanitizer use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Mdx Sanitizer?

Skills that share tags, products or a category with Mdx Sanitizer: Server Feature Dev (scragnog/HOT-Step-CPP, 174 stars), React Email (viclafouch/meme-studio, 110 stars), Fumadocs (better-notify/better-notify, 313 stars) and Using Docs Kit (lobehub/lobe-ui, 2.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mdx Sanitizer?

curiositech (a GitHub organization) maintains it in curiositech/some_claude_skills, which has 244 GitHub stars. The repository holds 95 skills in this directory. The repository was last updated on September 6, 2026.

Source: curiositech/some_claude_skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.