Back to Skills

korean-character-count

Count Korean text deterministically with exact grapheme, line, and byte contracts for self-intros and form limits.

5,712stars643forksUpdated 6/18/2026

Security Assessment

Safe(100/100)
Security Score100/100

About korean-character-count

This skill provides deterministic Korean text character counting for scenarios where exact character limits matter, such as self-introductions, application forms, and essay submissions. Unlike LLM-based estimation which can be inconsistent, this skill uses standardized Unicode grapheme cluster counting via Intl.Segmenter to ensure reproducible results. It addresses the critical need for precision in Korean text processing where even a single character difference can determine form submission success or failure.

The skill offers three core counting metrics: characters (based on Unicode extended grapheme clusters), lines (recognizing CRLF, LF, CR, and Unicode line separators), and bytes (UTF-8 encoding length). It supports two profiles: a default profile using standard UTF-8 byte calculation, and a specialized 'neis' profile that implements custom byte counting rules (3 bytes per Korean grapheme, 1 byte per ASCII character, 2 bytes per line break) for compatibility with specific Korean educational systems. The tool operates as a Node.js script that accepts text via command-line arguments, files, or standard input.

This skill is essential for Korean language users working with strict character-limited forms, particularly students preparing application essays, professionals writing formal documents, and developers building form validation systems. It eliminates guesswork by providing contractually defined counting behavior, handles mixed Korean/English/emoji text correctly, and ensures that text meets exact submission requirements without manual recounting or trial-and-error adjustments.

FAQ

What's the difference between 'default' and 'neis' profiles?

The default profile uses standard UTF-8 byte counting where each character's byte length varies naturally. The neis profile implements specific rules: Korean graphemes count as 3 bytes, ASCII as 1 byte, and line breaks as 2 bytes, matching requirements for Korean educational systems like NEIS (National Education Information System).

Does this skill modify or normalize my input text?

No. The skill counts text exactly as provided without trimming whitespace, normalizing Unicode, or modifying line endings. This ensures you get accurate counts for the exact text you'll be submitting.

What Node.js version do I need?

Node.js 18 or higher is required. The skill uses Intl.Segmenter which is available in modern Node versions. No additional API keys or external dependencies are needed.

How does the skill count line breaks?

The skill recognizes CRLF, LF, CR, U+2028 (line separator), and U+2029 (paragraph separator) as line breaks. Importantly, CRLF is counted as one line break, not two. Empty strings have 0 lines, while non-empty text has (number of line breaks + 1) lines.

Can this handle emoji and special characters?

Yes. The skill uses Unicode extended grapheme cluster segmentation, which correctly handles emoji (including multi-codepoint emoji like flags and skin tone variants), combining characters, and other complex Unicode sequences as single characters.

All Files

2 files
scripts/korean_character_count.js6.6 KB
View
SKILL.md2.4 KB
View

Install korean-character-count

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill