count-zh
Skill0 starsChanged 6 days agoMITView on GitHub
Counts Chinese characters (字數) in a file with ./fw count-zh. Use when the user asks for 字數 / word count / character count, or when Chinese-language writing must be checked against a length limit. Counts CJK ideographs only, which is what a 字數 limit means; wc -w and len() mis-count Chinese, so use this instead of a hand-rolled count.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- cite-checkSkill
- deck-imageSkill
- deck-planSkill
- deck-runtimeSkill
- deck-svgSkill
- diagramSkill
- fix-termsSkill
- flow-checkSkill
- gpt-reviewSkill
- house-styleSkill
- safe-editSkill
- source-kitSkill
- topic-scoutSkill
- yt2subSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Check against a limit: run it, compare to the assignment's 字數 requirement, and report the gap.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
count-zh — Chinese character (字數) count
The framework ships ./fw count-zh (run from the course root). This skill is the entry point for "how many words / 字數" requests on Chinese-language work; the script is the implementation. Run — and extend — ./fw count-zh rather than counting 字數 by hand, with wc, or with len(); each gives the wrong number for Chinese (see below).
Why a dedicated tool
Chinese text has no spaces between words, so the usual reflexes are wrong:
wc -wcounts whitespace-delimited tokens → drastically undercounts Chinese.len(text)/ a raw character count → overcounts (includes punctuation, English, digits, whitespace, markup).
count-zh.py counts CJK Unified Ideographs only ([一-鿿]), excluding punctuation, English letters, digits, and whitespace — which is what a 字數 limit on an assignment or journal actually means.
Usage
./fw count-zh <file> # prints the integer 字數 to stdout- Count a draft:
./fw count-zh <unit>/homework.qmd - Check against a limit: run it, compare to the assignment's 字數 requirement, and report the gap.
Notes
- It counts the raw file. Markdown/LaTeX/Quarto markup keywords are English, so they add no CJK and don't inflate the count — but Chinese inside YAML front matter (e.g. a Chinese
title:) does count. For a strict body-only number, point it at the prose, not a generated wrapper. - One file at a time. For a multi-chapter thesis, sum the per-file counts.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

