wp-admin-codemirror

wp-admin-codemirror is a skill for Claude Code, Codex from Lonsdale201/wp-agent-skills. It costs 159 tokens per session (3,443 once invoked), scanned A, original, MIT.

A way to place WordPress's bundled CodeMirror editor inside an administration page. CodeMirror is a text editor that adds code formatting and syntax highlighting for formats such as CSS, JavaScript, JSON, HTML, PHP, SQL, Markdown, and YAML.

In plain words
What is it for?
Use it for custom CSS fields, code or configuration snippets, webhook payloads, regular expressions, and other code-like text areas in plugin settings.
Why use it?
It avoids adding another editor library and provides the WordPress-specific setup needed for the editor to load correctly. It also accounts for users who have disabled syntax highlighting in their profile.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for custom CSS fields, code or configuration snippets, webhook payloads, regular expressions, and other code-like text areas in plugin settings.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lonsdale201/wp-agent-skills/wp-admin-codemirror
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 Lonsdale201/wp-agent-skills --skill wp-admin-codemirror
Clone the repo
git clone --depth 1 https://github.com/Lonsdale201/wp-agent-skills

Made for: Claude Code, Codex.

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 wp-admin-codemirror

README.md
[![agentmods](https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/wp-admin-codemirror/github.svg)](https://agentmods.dev/skills/lonsdale201/wp-agent-skills/wp-admin-codemirror)
Your own site
<a href="https://agentmods.dev/skills/lonsdale201/wp-agent-skills/wp-admin-codemirror"><img src="https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/wp-admin-codemirror/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 wp-admin-codemirror

Your own site · 80×15
<a href="https://agentmods.dev/skills/lonsdale201/wp-agent-skills/wp-admin-codemirror"><img src="https://agentmods.dev/badge/skills/lonsdale201/wp-agent-skills/wp-admin-codemirror.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 159 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,443 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.00159 $0.03443
Opus 5.5 $0.00064 $0.01377
Sonnet 5.5 $0.00032 $0.00689
Haiku 4.5 $0.00016 $0.00344

Measured 1mo ago against content hash b3ec86609ef8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

wp-admin-codemirror 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 1mo 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.

wordpress/wp-admin-codemirror/SKILL.md · 300 lines

How it starts

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

WordPress Admin CodeMirror (wp.codeEditor)

WP bundles CodeMirror 5 plus its linter add-ons. Plugins almost never use it because the entry point is one underused function (wp_enqueue_code_editor) and the JS init is split between two files. This skill is the bootstrap recipe.

When to use this skill

Trigger when ANY of the following is true:

  • The user is adding a <textarea> to admin for CSS / JSON / JS / HTML / PHP / SQL / regex / Markdown / YAML content and wants syntax highlighting (NOT the block editor).
  • Code references wp_enqueue_code_editor, wp_get_code_editor_settings, wp.codeEditor, wp.CodeMirror, wp_code_editor_settings, code-editor script handle.
  • The user is building a "custom CSS field", "snippet editor", "JSON config editor", "webhook payload field", "regex builder", "shortcode preview", "rules engine".
  • The user mentions CodeMirror, Monaco, Ace, Prism specifically in a WP-admin context — and the answer is "use the bundled CodeMirror".

The five-step bootstrap

add_action( 'admin_enqueue_scripts', static function ( string $hook_suffix ): void {
    // 1. Only on your screen.
    if ( 'settings_page_myplugin' !== $hook_suffix ) {
        return;
    }

    // 2. Ask WP to enqueue CodeMirror and bundle a settings snapshot for this MIME type.
    //    Use 'type' (MIME) or 'file' (extension sniff).
    $settings = wp_enqueue_code_editor( array( 'type' => 'text/css' ) );

    // 3. CRITICAL: $settings is false when the user has disabled syntax highlighting
    //    in their profile. Stop here; the textarea stays as a plain textarea.
    if ( false === $settings ) {
        return;
    }

    // 4. Enqueue YOUR admin script that calls wp.codeEditor.initialize().
    wp_enqueue_script(
        'myplugin-css-editor',
        plugins_url( 'assets/css-editor.js', MYPLUGIN_FILE ),
        array( 'code-editor', 'wp-i18n' ),
        MYPLUGIN_VERSION,
        array( 'in_footer' => true )
    );

    // 5. Pass the textarea ID and per-instance settings to your script.
    wp_add_inline_script(
        'myplugin-css-editor',
        'window.MyPluginCssEditor = ' . wp_json_encode( array(
            'id'       => 'myplugin_custom_css',
            'settings' => $settings,
        ) ) . ';',
        'before'
    );
} );

Read the full file on GitHub · 300 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. 1mo ago First seen · 300 lines · 159 tokens per session scan A b3ec86609ef8

Subscribe to this mod's changes

wp-admin-codemirror is a skill published in the GitHub repository Lonsdale201/wp-agent-skills (25 stars, last pushed 7d ago), licensed MIT. It adds 159 tokens to every session and 3,443 once invoked, about $0.0006 per session on Opus 5.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-09-11.

Related

Other skills, from other repositories

static-seo

Audits and improves SEO for static HTML sites. Use when the user asks to audit, set up, or improve SEO on a static site (Hugo, Jekyll, 11ty, Gatsby, Next.js static export, hand-rolled HTML, or wp-static-clone output), or mentions head metadata, structured data, JSON-LD, sitemaps, IndexNow, Open Graph images, schema…

jdevalk/skills · 143 tokens

fluentui-blazor

Guide for using the Microsoft Fluent UI Blazor component library (Microsoft.FluentUI.AspNetCore.Components NuGet package) in Blazor applications. Use this when the user is building a Blazor app with Fluent UI components, setting up the library, using FluentUI components like FluentButton, FluentDataGrid, FluentDialog…

boshi-xixixi/TraeSkill · 118 tokens

stack

Validates Biome 2.3+, Bun workspace, Next.js 16 and Tailwind v4 config and flags deprecated patterns. Use before stack work or when AI-generated config may be outdated.

shipshitdev/skills · 42 tokens

cardputer-buddy

Iterate on the Cardputer-Adv MicroPython app bundle (Claude Buddy, Snake, Hello) after the device is already provisioned via m5-onboard. Use when the user wants to add a new app, push a single changed .py without re-flashing, watch device serial logs, or run a one-shot REPL command. Trigger on "add an app", "push to…

anthropics/claude-plugins-official · 109 tokens

migrate-to-rust

Clones, analyzes, plans, and migrates legacy codebases (C++, Fortran, Java, Python, C, Shell) from a GitHub URL or local directory to a modern, high-performance, deterministic, 100% Safe Rust architecture, tracking live telemetry across every task bucket, test failure/fix cycle, and Profile-Guided Optimization (PGO)…

google/skills · 166 tokens

frontend-design

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

anthropics/claude-plugins-official · 40 tokens