divine-mobile: Skill for Claude Code

.agents/skills/js-regex-cjk-word-boundary/SKILL.md

js-regex-cjk-word-boundary is a skill for Claude Code, Codex from divinevideo/divine-mobile. It costs 177 tokens per session (1,905 once invoked), scanned A, original, MPL-2.0.

A JavaScript debugging guide for regular expressions that use the \b word-boundary marker with Chinese, Japanese, Korean, and other non-Latin text. It explains why the pattern can run without errors but still fail to match.

In plain words
What is it for?
Use it when JavaScript regexes detect names, document clues, or keywords incorrectly in multilingual text.
Why use it?
It fixes text detection that works for English or ASCII input but silently returns false for CJK or other Unicode scripts.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; installed under .agents/ (shared by several agents).

This is divinevideo/divine-mobile's own configuration. It tells Claude Code and Codex how to work on divine-mobile itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything divine-mobile configures →

Reuse

Borrowing it

Nothing to install: this file belongs to divinevideo/divine-mobile. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/divinevideo/divine-mobile/main/.agents/skills/js-regex-cjk-word-boundary/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/divinevideo/divine-mobile

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 js-regex-cjk-word-boundary

README.md
[![agentmods](https://agentmods.dev/badge/skills/divinevideo/divine-mobile/js-regex-cjk-word-boundary/github.svg)](https://agentmods.dev/skills/divinevideo/divine-mobile/js-regex-cjk-word-boundary)
Your own site
<a href="https://agentmods.dev/skills/divinevideo/divine-mobile/js-regex-cjk-word-boundary"><img src="https://agentmods.dev/badge/skills/divinevideo/divine-mobile/js-regex-cjk-word-boundary/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 js-regex-cjk-word-boundary

Your own site · 80×15
<a href="https://agentmods.dev/skills/divinevideo/divine-mobile/js-regex-cjk-word-boundary"><img src="https://agentmods.dev/badge/skills/divinevideo/divine-mobile/js-regex-cjk-word-boundary.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 177 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,905 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00177 $0.01905
Opus 5 $0.00088 $0.00953
Sonnet 5 $0.00035 $0.00381
Haiku 4.5 $0.00018 $0.00191

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

Security

Grade A, and why

js-regex-cjk-word-boundary 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 8d 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.

.agents/skills/js-regex-cjk-word-boundary/SKILL.md · 147 lines

How it starts

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

JavaScript Regex: \b Word Boundary Fails with CJK Characters

Problem

JavaScript's \b (word boundary) assertion silently fails when used with CJK (Chinese/Japanese/Korean) characters. The regex compiles without error and runs without throwing, but it simply never matches CJK text that should match. This is particularly insidious because:

  1. No error is thrown — the regex just returns false
  2. The same pattern works perfectly for Latin/ASCII text
  3. The CJK characters in the pattern are correct (verified by direct string comparison)

Context / Trigger Conditions

  • Regex pattern like /\b\u904B\u8EE2\u514D\u8A31\u8A3C\b/ (Japanese: 運転免許証) returns false on text containing the exact characters
  • Pattern like /\b\uC6B4\uC804\uBA74\uD5C8\uC99D\b/ (Korean: 운전면허증) fails similarly
  • Text-detection functions (e.g., hasDriverLicenceCue(), inferIssuerFromTitleText()) return incorrect results for CJK input while working correctly for all Latin-script patterns
  • Any regex using \b boundaries around non-ASCII Unicode characters (also affects Cyrillic, Arabic, Thai, etc.)

Root Cause

JavaScript's \b matches the boundary between a "word character" (\w = [a-zA-Z0-9_]) and a "non-word character" (\W). CJK characters are classified as \W (non-word characters).

When \b appears before a CJK character, it looks for a \w-to-\W or \W-to-\w transition. But if the preceding character is also \W (whitespace, punctuation, start of string, or another CJK character), the boundary condition is \W-to-\W, which \b does NOT match.

// This FAILS — \b doesn't work with CJK
/\b\u904B\u8EE2\u514D\u8A31\u8A3C\b/.test("運転免許証")  // false!

// This WORKS — no word boundaries
/\u904B\u8EE2\u514D\u8A31\u8A3C/.test("運転免許証")  // true

Solution

Quick Fix: Remove \b from CJK patterns

Simply remove \b assertions from any regex pattern that matches CJK characters:

// Before (broken):
[/\b\u904B\u8EE2\u514D\u8A31\u8A3C\b/, "JAPAN"],      // 運転免許証
[/\b\uC6B4\uC804\uBA74\uD5C8\uC99D\b/, "KOREA"],      // 운전면허증

// After (working):
[/\u904B\u8EE2\u514D\u8A31\u8A3C/, "JAPAN"],            // 運転免許証
[/\uC6B4\uC804\uBA74\uD5C8\uC99D/, "KOREA"],           // 운전면허증

Read the full file on GitHub · 147 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. 8d ago First seen · 147 lines · 177 tokens per session scan A aff01cf9afaf

Subscribe to this mod's changes

js-regex-cjk-word-boundary is a skill published in the GitHub repository divinevideo/divine-mobile (264 stars, last pushed today), licensed MPL-2.0. It adds 177 tokens to every session and 1,905 once invoked, about $0.0009 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-09-03.