encoding-checker

encoding-checker is a skill for Claude Code from zhiliyouxian/claude-novel-writer. It costs 45 tokens per session (2,718 once invoked), scanned A, original, MIT.

A checker and repair tool for damaged text encoding, such as replacement characters shown as �. It scans chapter files, identifies the exact locations of problems, and repairs them using the surrounding text.

In plain words
What is it for?
Use it to scan Markdown chapters, produce an error report, locate corrupted characters, repair them, and verify the result.
Why use it?
It helps restore readable chapter content after incorrect character conversion or copying introduces corrupted symbols. It checks the files again after repair until no such errors remain.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the novel-writer plugin — 9 skills, 11 commands, 9 agents shipped together

Good fit Use it to scan Markdown chapters, produce an error report, locate corrupted characters, repair them, and verify the result.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zhiliyouxian/claude-novel-writer/encoding-checker
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zhiliyouxian/claude-novel-writer --skill encoding-checker
Clone the repo
git clone --depth 1 https://github.com/zhiliyouxian/claude-novel-writer

Made for: Claude Code.

Or install novel-writer, the plugin that ships this one along with the rest of its 9 skills, 11 commands, 9 agents.

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 encoding-checker

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhiliyouxian/claude-novel-writer/encoding-checker/github.svg)](https://agentmods.dev/skills/zhiliyouxian/claude-novel-writer/encoding-checker)
Your own site
<a href="https://agentmods.dev/skills/zhiliyouxian/claude-novel-writer/encoding-checker"><img src="https://agentmods.dev/badge/skills/zhiliyouxian/claude-novel-writer/encoding-checker/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 encoding-checker

Your own site · 80×15
<a href="https://agentmods.dev/skills/zhiliyouxian/claude-novel-writer/encoding-checker"><img src="https://agentmods.dev/badge/skills/zhiliyouxian/claude-novel-writer/encoding-checker.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,718 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.
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.00045 $0.02718
Opus 5 $0.00023 $0.01359
Sonnet 5 $0.00009 $0.00544
Haiku 4.5 $0.00005 $0.00272

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

Security

Grade A, and why

encoding-checker 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 11d 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.

skills/encoding-checker/SKILL.md · 375 lines

How it starts

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

编码检查与修复器

你是专业的文本质量修复工具,负责检测并自动修复章节文件中的编码问题(乱码字符),确保文本完整性。

目录结构规范: specs/directory-structure.md

核心原则

检测到乱码必须立即修复,修复后再次检查,循环直到无乱码为止。


检测脚本

使用 Python 脚本进行精确检测:

# 脚本位置
{plugin_dir}/scripts/check-encoding.py

# 检测目录下所有 md 文件
python3 {plugin_dir}/scripts/check-encoding.py <目录路径>

# 生成详细修复报告
python3 {plugin_dir}/scripts/check-encoding.py <目录路径> --report

# 输出 JSON 格式(供程序解析)
python3 {plugin_dir}/scripts/check-encoding.py <目录路径> --json

脚本输出示例

❌ productions/xuanhuan_001/chapters/chapter-0003.md (3 个错误)
   第15行: ...不像��渎那样锋利...
   第87行: ...一口���,正要...
   第156行: ...突破到���星...

============================================================
检测完成: 30 个文件
  ✅ 正常: 28
  ❌ 问题: 2
  📍 总错误数: 5

核心能力

1. 乱码检测(脚本实现)

  • 检测 Unicode 替换字符(U+FFFD,显示为 �)
  • 检测异常控制字符(0x00-0x08, 0x0B, 0x0C, 0x0E-0x1F, 0x7F)
  • 精确定位:文件名、行号、列号、上下文

2. 自动修复(Claude 实现)

  • 根据上下文智能推测原文
  • 直接修改文件完成修复
  • 修复后立即再次检查

3. 循环验证

  • 修复后重新运行脚本扫描
  • 确保所有问题已解决
  • 直到零乱码才通过

乱码模式

常见乱码类型

类型 特征 产生原因
Unicode替换符 (U+FFFD) 无法解码的字节序列
GBK→UTF8乱码 锟斤拷烫烫烫 编码转换错误
截断乱码 字符显示不完整 多字节字符被截断
控制字符 不可见但影响显示 复制粘贴引入

常见修复模式

乱码上下文 推测原文 置信度
一口���,正要 一口气,正要
微微���笑 微微一笑
但���住 但记住
一阵���意 一阵寒意/暖意 中(需看上下文)
���星 三星/五星/九星 中(需看上下文)
不像���渎 不像亵渎

工作流程

激活条件

# 自动触发
- 章节审核前(/nw-ch-audit)
- 导出发布前(/nw-release)
- 批量创作完成后

# 手动触发
- 用户说"检查乱码"、"修复乱码"
- 用户说"检查编码"、"修复编码"

完整流程(循环直到无乱码)

开始
  ↓
【第1轮】运行检测脚本
  python3 {plugin_dir}/scripts/check-encoding.py <chapters_dir>
  ↓
检测到乱码?
  ├─ 否 → ✅ 通过,结束
  └─ 是 → 进入修复流程
        ↓
      解析脚本输出,获取问题列表
        ↓
      逐个修复:
        ├─ Read 读取问题文件
        ├─ 根据上下文推测原文
        ├─ Edit 修复乱码
        └─ 记录修复内容
        ↓
      【第2轮】再次运行脚本
        ↓
      还有乱码?
        ├─ 否 → ✅ 修复完成,结束
        └─ 是 → 继续修复(循环)

步骤详解

步骤1: 运行检测脚本
# 检测章节目录
python3 {plugin_dir}/scripts/check-encoding.py productions/{project_id}/chapters/

# 或使用 JSON 输出便于解析
python3 {plugin_dir}/scripts/check-encoding.py productions/{project_id}/chapters/ --json

Read the full file on GitHub · 375 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. 11d ago First seen · 375 lines · 45 tokens per session scan A a3399face5d5

Subscribe to this mod's changes

encoding-checker is a skill published in the GitHub repository zhiliyouxian/claude-novel-writer (5 stars, last pushed 8mo ago), licensed MIT. It adds 45 tokens to every session and 2,718 once invoked, about $0.0002 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-08-31.

Related

Other skills, from other repositories

baoyu-youtube-transcript

A tool for downloading the written captions, subtitles, chapter information, speaker labels, and cover image from a YouTube video using its URL or ID.

JimLiu/baoyu-skills · 107 tokens

orbit-notion

Open Orbit briefing skill — selected by the Orbit pipeline when Notion is the user's only connected connector, or when the user explicitly scopes their daily digest to Notion. Pulls the past 24 hours of document edits, comments, mentions, and database row changes from the user's authenticated Notion connection and…

nexu-io/open-design · 117 tokens

instrument-data-to-allotrope

Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full…

anthropics/knowledge-work-plugins · 123 tokens

feishu

Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.

Hmbown/CodeWhale · 33 tokens

read

Reads URLs and PDFs by fetching source content, defaulting to concise summaries for plain read requests and clean Markdown when asked to convert, save, quote, cite, or feed downstream work. Use when users ask in any language to read, fetch, check, summarize, quote, cite, convert, or save a URL or PDF. Not for local…

tw93/Waza · 78 tokens

overleaf-sync

A two-way connection between a local paper folder and Overleaf, a web-based LaTeX editor for writing research papers. It lets you move changes between the local files and the shared Overleaf project.

wanshuiyin/Auto-claude-code-research-in-sleep · 97 tokens