mirror of
https://github.com/NomaDamas/k-skill.git
synced 2026-06-24 02:04:11 +00:00
Issue #65 needs deterministic Korean character, line, and byte counting for self-intros and similar forms, so this adds a bundled helper plus skill/docs/tests around a fixed grapheme/UTF-8 contract with an explicit NEIS compatibility profile. Constraint: Must avoid LLM estimation and keep results deterministic across repeated runs Constraint: No new dependencies; rely on Node 18+ Intl.Segmenter and Buffer.byteLength Rejected: Per-request ad hoc scripts only | contract drift would make repeated counts inconsistent Rejected: Legacy encoding heuristics as the default | modern UTF-8 contract is safer unless the target explicitly says otherwise Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep and profile semantics in sync with docs/tests before changing counting rules Tested: node --test scripts/skill-docs.test.js scripts/test_korean_character_count.js; helper smoke via text/file/stdin; npm test; npm run ci; LSP diagnostics on changed JS files Not-tested: Proprietary site-specific counters beyond the documented default/NEIS contracts
14 lines
297 B
JavaScript
14 lines
297 B
JavaScript
"use strict";
|
|
|
|
const bundled = require("../korean-character-count/scripts/korean_character_count.js");
|
|
|
|
if (require.main === module) {
|
|
try {
|
|
bundled.main(process.argv.slice(2));
|
|
} catch (error) {
|
|
console.error(error.message);
|
|
process.exitCode = 1;
|
|
}
|
|
}
|
|
|
|
module.exports = bundled;
|