Character Count Skill for Openclaw

A deterministic utility to count string length for text with strict character limits using Python-based measurement.

evandataforge
v0.1.0
Mar 24, 2026
2
807
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install character-count

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install character-count using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Character Count Skill?

The Character Count skill is a portable and self-contained tool designed for developers and AI agents who need to ensure text adheres to strict character boundaries. Unlike manual estimation which can be prone to error, this Openclaw Skills utility uses a dedicated Python script to provide exact measurements of final drafts, including spaces, punctuation, and hashtags.

By integrating this skill into your workflow, you can prevent truncation and submission errors on platforms like X (Twitter), GitHub, or internal CMS systems. It acts as a deterministic local gate, ensuring that any text—from commit messages to social media replies—is validated before being finalized or posted.

Character Count Skill Use Cases

  • Validating social media posts against platform limits like the 280-character X limit.
  • Ensuring Git commit messages stay within recommended line lengths.
  • Checking SEO meta descriptions and titles for length compliance.
  • Automated drafting workflows where an AI agent must iteratively shorten text until it fits a specific constraint.

How Character Count Skill Works

  1. The text to be measured is passed to the skill via standard input (stdin) or as a command-line argument.
  2. The underlying Python script calculates the exact string length using the standard Python len() function.
  3. The script compares the count against a user-defined limit to determine compliance.
  4. A result is returned in either plain text or JSON format, indicating the character count, remaining space, and a boolean success status.

Character Count Skill Setup

To use this component of Openclaw Skills, ensure you have Python 3.8 or newer installed. You can invoke the script directly from the skill directory:

# Standard usage via stdin (recommended to preserve formatting)
printf '%s' "Your text here" | python3 scripts/character_count.py --limit 280 --json

# Alternative usage via argument
python3 scripts/character_count.py --limit 280 --json --text "Hello world"

Character Count Skill Data Schema & Taxonomy

The skill provides structured output to facilitate easy parsing by other tools or agents. When using the --json flag, the schema is as follows:

Field Type Description
chars Integer The exact number of characters in the provided text.
limit Integer The maximum character threshold configured.
remaining Integer The difference between the limit and the actual count.
ok Boolean Returns true if the count is less than or equal to the limit.

Character Count Skill Advanced Features

  • Deterministic JSON output mode for seamless integration into multi-agent automation pipelines.
  • Support for stdin piping using printf to avoid the common trailing newline issues associated with echo.
  • Portable script design that can be referenced by full path from any working directory within the Openclaw Skills environment.
  • Iterative validation support for AI-driven text rewriting and re-verification.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*