library/specializations/cli-mcp-development/skills/encoding-handler/SKILL.md
Handle text encoding across platforms including UTF-8, Windows codepages, and BOM handling.
npx skillsauth add a5c-ai/babysitter encoding-handlerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Handle text encoding across platforms.
import { Buffer } from 'buffer';
import iconv from 'iconv-lite';
export function detectBOM(buffer: Buffer): string | null {
if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) return 'utf-8';
if (buffer[0] === 0xFF && buffer[1] === 0xFE) return 'utf-16le';
if (buffer[0] === 0xFE && buffer[1] === 0xFF) return 'utf-16be';
return null;
}
export function stripBOM(content: string): string {
return content.charCodeAt(0) === 0xFEFF ? content.slice(1) : content;
}
export function decodeBuffer(buffer: Buffer, encoding = 'utf-8'): string {
const bom = detectBOM(buffer);
if (bom) {
return stripBOM(iconv.decode(buffer, bom));
}
return iconv.decode(buffer, encoding);
}
export function encodeString(content: string, encoding = 'utf-8', addBOM = false): Buffer {
const encoded = iconv.encode(content, encoding);
if (addBOM && encoding.toLowerCase() === 'utf-8') {
return Buffer.concat([Buffer.from([0xEF, 0xBB, 0xBF]), encoded]);
}
return encoded;
}
development
Model documentation skill for generating model cards following Google's model card framework.
development
MLflow integration skill for experiment tracking, model registry, and artifact management. Enables LLMs to log experiments, compare runs, manage model lifecycle, and retrieve artifacts through the MLflow API.
data-ai
LIME-based local explanation skill for individual predictions across tabular, text, and image data.
devops
Kubeflow Pipelines skill for ML workflow orchestration, component management, and Kubernetes-native ML.