Skip to content
Back to skills

Audit Text Encoding

ASecurity

Check a bounded text input for invalid UTF-8, mixed newlines, NUL characters and oversized lines before ingest.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 26, 2026
ai-agentspythonbash

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 26, 2026

npx -y skills add alisonjieli-png/loop-engine --skill audit-text-encoding --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Audit Text Encoding?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Audit Text Encoding
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/alisonjieli-png-audit-text-encoding/badge)](https://www.skillsdirectory.com/skills/alisonjieli-png-audit-text-encoding)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: audit-text-encoding
description: Check a bounded text input for invalid UTF-8, mixed newlines, NUL characters and oversized lines before ingest.
---

# Audit text encoding

Use this skill before a text ingest, conversion or diff when invalid encoding or mixed line endings could change parsing. It reports structural facts without returning the text.

## Invoke

The owning runtime must authorize an exact absolute materials root and one relative input path. From this skill directory:

```bash
python3 -B scripts/audit_text_encoding.py \
  --approved-root /approved/materials --input-relative notes.txt
```

The default line limit is 10,000 Unicode characters. Use `--max-line-chars` to lower or raise that threshold up to the fixed 100,000-character ceiling. The file ceiling is 20,000,000 bytes and may only be lowered with `--max-bytes`.

## Result and scope

The command prints one `text_encoding_audit/v1` JSON object. It returns `pass` with exit 0, `fail` with exit 1, or `refused` with exit 2. Invalid UTF-8, a NUL character, mixed carriage-return and line-feed styles, or a line over the declared limit fails. A UTF-8 byte-order mark and trailing whitespace are reported without failing. It returns a byte digest, byte and physical-line counts and issue counts, never source lines.

The script reads only one regular file under the approved root, follows no symbolic links in its path, writes no files, and uses no network or credentials. The owning Loop provides read authority and a stable input snapshot. A passing encoding audit does not prove that the content is factually correct, safe to execute, or suitable for the next transformation.

Files in this skill

  • SKILL.md1.6 KB
  • scripts/audit_text_encoding.py3.2 KB
  • scripts/confined_input.py3.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.