← 返回 Skills 市场
evandataforge

Character Count

作者 Evan · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
121
总下载
2
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install character-count
功能描述
Count 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...
使用说明 (SKILL.md)

Character Count

Use 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.

Scope

This skill measures exact string length as seen by Python len(text).

  • It is suitable for generic hard-limit workflows.
  • It is not a platform-specific compliance engine.
  • If a platform applies custom weighting rules for URLs, Unicode, or special tokens, treat this skill as a deterministic local gate, not as a guarantee of platform acceptance.

Rules

  • Never estimate character counts manually.
  • Always count the final text exactly as it will be posted or saved.
  • If the text is too long, rewrite it and count again.
  • Prefer the JSON output mode for deterministic downstream use.
  • Do not describe the result as platform-accurate unless the target platform uses plain string length.

Recommended Usage

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"

Output Contract

--json returns a single JSON object:

{"chars":11,"limit":280,"remaining":269,"ok":true}

Field meanings:

  • chars: exact Python string length of the provided text
  • limit: the configured limit
  • remaining: limit - chars
  • ok: true when chars \x3C= limit

Without --json, the script prints plain text key-value lines:

chars=11
limit=280
remaining=269
ok=true

Twitter and X Workflow

For tweets and replies:

  1. Draft the final post text.
  2. Count it with --limit 280.
  3. If ok is false, shorten the text.
  4. Count again.
  5. Post only after the script reports ok=true.
  6. If you need exact X enforcement, add a platform-specific validation step in addition to this skill.

Notes

  • Count the exact final text, including spaces, punctuation, hashtags, and URLs.
  • Do not add or remove characters after counting unless you count again.
  • Use printf '%s' instead of echo to avoid introducing a trailing newline.
  • If the script receives no text, treat that as a calling error and fix the invocation before proceeding.
安全使用建议
This skill appears to do exactly what it claims: run the bundled Python script locally to compute Python string length. Before installing, note that Python's len() counts code points, not grapheme clusters or platform-specific token weighting (e.g., Twitter/X counts URLs/emojis differently), so the result is a deterministic local gate but may not match every platform's rules. The skill requests no secrets and performs no network I/O. If you need platform-accurate counts (or Unicode grapheme-aware counts), request or implement a specialized validator instead.
功能分析
Type: OpenClaw Skill Name: character-count Version: 0.1.0 The skill bundle is a straightforward utility for deterministic character counting. The Python script `scripts/character_count.py` and the instructions in `SKILL.md` are focused entirely on measuring string length against a provided limit, with no evidence of malicious intent, data exfiltration, or suspicious execution patterns.
能力评估
Purpose & Capability
Name/description match the included script and README: the skill deterministically counts characters using Python's len(). Required binary is only python3, which is appropriate and minimal.
Instruction Scope
SKILL.md restricts behavior to counting provided text via stdin or --text and describes output formats; it does not instruct reading unrelated files, environment variables, or sending data externally.
Install Mechanism
No install spec (instruction-only with a bundled script) — nothing is downloaded or written to disk during install beyond the packaged files.
Credentials
The skill requests no environment variables or credentials. The single required binary (python3) is proportional to the task.
Persistence & Privilege
always is false and the skill is user-invocable. agents/openai.yaml allows implicit invocation (normal for skills); this is expected and not excessive by itself.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install character-count
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /character-count 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial public release of a portable deterministic string-length counting skill with bundled Python helper and ClawHub metadata.
元数据
Slug character-count
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Character Count 是什么?

Count 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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 121 次。

如何安装 Character Count?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install character-count」即可一键安装,无需额外配置。

Character Count 是免费的吗?

是的,Character Count 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Character Count 支持哪些平台?

Character Count 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Character Count?

由 Evan(@evandataforge)开发并维护,当前版本 v0.1.0。

💬 留言讨论