Install
openclaw skills install character-countCount string length deterministically for text with hard limits. Use this skill when a post, reply, caption, commit message, or other text must stay within a maximum character count.
openclaw skills install character-countUse this skill when text must fit within a strict character limit and guessing is not acceptable.
This skill is portable and self-contained. The counting logic lives in the bundled script at scripts/character_count.py.
This skill measures exact string length as seen by Python len(text).
The bundled script requires python3. For broad portability, assume Python 3.8 or newer.
From the skill root, pass the exact final text over stdin so shell quoting does not alter the content:
printf '%s' "$FINAL_TEXT" | python3 scripts/character_count.py --limit 280 --json
If you are calling it from another working directory, use the full path to the script inside the installed skill folder.
If stdin is inconvenient, pass the text as an argument:
python3 scripts/character_count.py --limit 280 --json --text "Hello world"
--json returns a single JSON object:
{"chars":11,"limit":280,"remaining":269,"ok":true}
Field meanings:
chars: exact Python string length of the provided textlimit: the configured limitremaining: limit - charsok: true when chars <= limitWithout --json, the script prints plain text key-value lines:
chars=11
limit=280
remaining=269
ok=true
For tweets and replies:
--limit 280.ok is false, shorten the text.ok=true.printf '%s' instead of echo to avoid introducing a trailing newline.