mirror of
https://github.com/iflytek/skillhub.git
synced 2026-11-27 23:58:51 +00:00
1.2 KiB
1.2 KiB
| name | description |
|---|---|
| text-stats | computes word, line, and character statistics for a text file and reports them as JSON |
text-stats
Overview
computes word, line, and character statistics for a text file and reports them as JSON. Agents use this skill whenever they need reproducible, machine-readable metrics about a piece of text — for example to compare a document before and after rewriting it.
Requirements
POSIX shell and Python 3. Run commands from the skill directory.
Usage
-
Locate the text file to analyze. Any plain-text file in the workspace works;
references/sample.txtis a ready-made fixture. -
Run the helper with the file path as the only argument:
sh scripts/text-stats.sh references/sample.txt -
Read the single-line JSON object from stdout:
{"input":"references/sample.txt","lines":2,"words":20,"characters":144} -
The same object is mirrored to
artifacts/report.jsonwhen a persistent copy is needed.
Resources
references/metrics.md— how each counter is definedreferences/sample.txt— sample input used by the validation casesscripts/— executable helpers invoked during task execution