[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M777VNCA6RB2W3V5EMTDSKW9":3,"skill-same:01M777VNCA6RB2W3V5EMTDSKW9":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M777VNCA6RB2W3V5EMTDSKW9","clean-text-toolkit",null,"Local text cleanup and inspection toolkit. Extract structured items (URLs, emails, phones, IPs, dates, hashtags, money), redact PII (email\u002Fphone\u002Fcredit-card-with-Luhn\u002FSSN\u002FJWT\u002FAWS keys\u002FUUIDs), normalize (BOM\u002FCRLF\u002Fsmart-quotes\u002Fwhitespace\u002Ftabs\u002Fcase\u002FUnicode NFC), line utilities (count\u002Fdedupe\u002Fsort\u002Fshuffle\u002Fhead\u002Ftail), word-frequency stats with stopwords, three-mode text diffs (unified\u002Fside\u002FHTML), no-Jinja2 template renderer with filters and defaults, URL-safe slug generator, and Markdown converter (strip-to-text \u002F minimal HTML \u002F extract headings\u002Flinks\u002Fimages\u002Fcode\u002Flists). Pure Python 3 standard library, no third-party dependencies, no remote calls.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fc\u002Fclean-text-toolkit\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: clean-text-toolkit\ndescription: Local text cleanup and inspection toolkit. Extract structured items (URLs, emails, phones, IPs, dates, hashtags, money), redact PII (email\u002Fphone\u002Fcredit-card-with-Luhn\u002FSSN\u002FJWT\u002FAWS keys\u002FUUIDs), normalize (BOM\u002FCRLF\u002Fsmart-quotes\u002Fwhitespace\u002Ftabs\u002Fcase\u002FUnicode NFC), line utilities (count\u002Fdedupe\u002Fsort\u002Fshuffle\u002Fhead\u002Ftail), word-frequency stats with stopwords, three-mode text diffs (unified\u002Fside\u002FHTML), no-Jinja2 template renderer with filters and defaults, URL-safe slug generator, and Markdown converter (strip-to-text \u002F minimal HTML \u002F extract headings\u002Flinks\u002Fimages\u002Fcode\u002Flists). Pure Python 3 standard library, no third-party dependencies, no remote calls.\nlicense: MIT\nmetadata: {\"openclaw\":{\"requires\":{\"bins\":[\"python3\"]},\"primaryEnv\":null,\"homepage\":\"https:\u002F\u002Fclawhub.ai\u002Fgopendrasharma89-tech\u002Fclean-text-toolkit\"}}\n---\n\n# clean-text-toolkit\n\nv0.4.0\n\nA small, honest local toolkit for the work agents end up doing constantly: read some text someone sent you, find the structured bits, clean it up, redact the secrets, and forward it downstream. Built on Python 3 standard library only. No `pandas`, no `nltk`, no pip installs, no remote calls.\n\nThis skill is the companion to [`clean-csv-toolkit`](https:\u002F\u002Fclawhub.ai\u002Fgopendrasharma89-tech\u002Fclean-csv-toolkit): that one handles structured tabular data, this one handles unstructured text.\n\n## What this skill does\n\n- `scripts\u002Fextract.py` — pull structured items out of any text file. Kinds: `url`, `email`, `phone`, `ipv4`, `ipv6`, `hashtag`, `mention`, `hex-color`, `money`, `iso-date`. Output to stdout (one-per-line or JSON), or to a `.txt` \u002F `.json` \u002F `.jsonl` file. Optional `--unique`, `--sort`, `--with-line` (prefix with the source line number).\n- `scripts\u002Fnormalize.py` — clean up messy text. Chainable transforms applied in command-line order: `--trim`, `--collapse-spaces`, `--strip-blank`, `--to-unix`, `--to-crlf`, `--dehyphenate` (rejoin OCR\u002FPDF hyphenated line-breaks), `--unsmart` (smart quotes \u002F em-dashes → ASCII), `--strip-bom`, `--strip-zwsp` (zero-width spaces and joiners), `--tabs-to-spaces N`, `--spaces-to-tabs N`, `--lower` \u002F `--upper` \u002F `--title`, `--normalize-unicode NFC|NFD|NFKC|NFKD`.\n- `scripts\u002Fredact.py` — anonymize text by replacing PII-like patterns with placeholder tokens. Kinds: `email`, `phone`, `ipv4`, `ipv6`, `url`, `credit-card` (with Luhn validation to suppress false positives), `ssn-us`, `uuid`, `hex-token` (32+ hex chars, typical for tokens \u002F hashes), `aws-access-key` (AKIA…), `jwt` (three base64url segments with the `eyJ` header). `--keep-counts` makes the same value always get the same placeholder; `--preserve-length` pads\u002Ftruncates the placeholder to the original length.\n- `scripts\u002Flines.py` — line-oriented utilities. `--op count | dedupe | sort | shuffle | head | tail`. Streams `count`, `head`, `tail`. `dedupe` and `sort` are O(N) memory in the number of lines, but each line is small so 1 M lines is fine on a laptop. `--case-insensitive`, `--keep first|last`, `--numeric`, `--reverse`, `--seed` for deterministic shuffles.\n- `scripts\u002Fwordcount.py` — word \u002F character \u002F line \u002F sentence statistics. Optional `--top N` for most-frequent words, `--stopwords PATH`, `--min-length N`, `--ignore-case`, `--regex PATTERN` (default `[A-Za-z']+`).\n- `scripts\u002Fdiff_text.py` — three-mode text diff using stdlib `difflib`. `--mode unified` (default), `--mode side` (custom two-column layout), `--mode html` (writes a full HTML file with red\u002Fgreen coloring). `--ignore-case`, `--ignore-whitespace`, `--context N`.\n- `scripts\u002Ftemplate.py` (NEW in v0.2.0) — substitute placeholders in a text file with values from a JSON object or inline `--set key=value` overrides. Mustache (`{{name}}`), dollar (`${name}`), or percent (`%(name)s`) syntax. Filters: upper, lower, title, strip, capitalize, reverse, len, escape-html, escape-json, urlencode. Default values: `{{name ?Unknown}}`. Strict mode (`--strict`) exits 1 if any placeholder is unresolved. **No Jinja2, no `eval`.**\n- `scripts\u002Fslug.py` (NEW in v0.2.0) — turn strings into URL-safe slugs. Single string mode (`--text \"Hello World\"`) or batch mode (line-in-file -> line-out-file). Options: `--separator`, `--max-length`, `--no-lower`, `--ascii` (Unicode -> ASCII transliteration via NFKD), `--keep-dots` (useful for filenames), `--dedupe`.\n- `scripts\u002Fmarkdown.py` (NEW in v0.2.0) — strip Markdown to plain text, render a minimal HTML approximation, or extract structured items (headings, links, images, code blocks, list items) as JSON \u002F JSONL \u002F TSV. For text mode, `--link-style anchor|url|both` controls how `[text](url)` is rendered.\n- `scripts\u002Freplace.py` (NEW in v0.3.0) — find-and-replace with regex \u002F literal \u002F word-boundary modes, capture-group back-references (`\\1`, `\\2`), multiple `--find\u002F--replace` pairs in a single pass, or a JSON `--rules` file with per-rule settings. `--dry-run` previews matches with line:col and context; `--max N` caps replacements per rule. Returns exit 1 when zero replacements happen so it slots into CI.\n- `scripts\u002Fhtmlstrip.py` (NEW in v0.4.0) — strip HTML tags from scraped pages. Three modes: `text` (collapse to plain readable text, drop `\u003Cscript>`\u002F`\u003Cstyle>` content, preserve line breaks at block tags), `html` (sanitize — remove `script,style,iframe,object,embed,form,input` tags + all `on*` event-handler attributes + inline `style=`, keep the rest intact), `extract` (pull links\u002Fimages\u002Fheadings\u002Ftables as JSON\u002FJSONL\u002FTSV). Built on Python stdlib `html.parser`. The single most-asked-for agent capability: turn scraped HTML into something useful in one command.\n- `scripts\u002Fcheck_deps.sh` — verify `python3` is available.\n\n## What this skill does not do\n\n- It does not call any LLM, web service, or remote API.\n- It does not load entire files into memory unless an operation truly needs the whole file (full-content normalization, sort-and-write, diff). Streaming-friendly operations (`extract`, `lines --op count|head|tail`, `wordcount` for chars\u002Flines counters) read one line at a time.\n- It does not write outside the input\u002Foutput paths the caller provides.\n\n## Quick start\n\n### 1. Pull every email out of a log file\n\n```bash\npython3 scripts\u002Fextract.py app.log --kind email --unique --sort\npython3 scripts\u002Fextract.py app.log --kind email --output emails.txt --unique\n```\n\n### 2. Find every URL and tag it with the source line\n\n```bash\npython3 scripts\u002Fextract.py article.md --kind url --with-line\n```\n\n### 3. Clean up a messy OCR dump\n\n```bash\npython3 scripts\u002Fnormalize.py scanned.txt clean.txt \\\n    --strip-bom --to-unix --dehyphenate --collapse-spaces \\\n    --unsmart --strip-blank --normalize-unicode NFC\n```\n\nThe transforms run in the order you list them on the command line.\n\n### 4. Redact PII before sharing a transcript\n\n```bash\npython3 scripts\u002Fredact.py transcript.txt safe.txt\n# default kinds = all\n# default placeholder = [REDACTED_{kind}_{i}]\n```\n\n```bash\n# Only redact emails and phones, give the same email the same placeholder\npython3 scripts\u002Fredact.py transcript.txt safe.txt \\\n    --kinds email,phone --keep-counts\n```\n\n```bash\n# Custom template\npython3 scripts\u002Fredact.py log.txt safe.txt \\\n    --token-template \"\u003C\u003C{kind}#{i}>>\"\n```\n\n```bash\n# Pad placeholder to match original length (for fixed-width layouts)\npython3 scripts\u002Fredact.py log.txt safe.txt --preserve-length\n```\n\nCredit-card matches are validated against the Luhn checksum so 16 random digits in a row don't trigger a false positive.\n\n### 5. Line utilities\n\n```bash\n# Quick file stats\npython3 scripts\u002Flines.py haystack.txt --op count\n\n# Drop duplicates, case-insensitive\npython3 scripts\u002Flines.py users.txt --op dedupe --case-insensitive --output unique.txt\n\n# Numeric sort (so \"100\" > \"23\" > \"7\")\npython3 scripts\u002Flines.py scores.txt --op sort --numeric --reverse\n\n# Deterministic shuffle\npython3 scripts\u002Flines.py prompts.txt --op shuffle --seed 42\n\n# Look at the head and tail of a multi-gig log\npython3 scripts\u002Flines.py huge.log --op head -n 20\npython3 scripts\u002Flines.py huge.log --op tail -n 20\n```\n\n### 6. Word counts\n\n```bash\n# Basic stats\npython3 scripts\u002Fwordcount.py essay.txt\n\n# Top words with stopwords filter\npython3 scripts\u002Fwordcount.py essay.txt --top 20 --ignore-case --stopwords stop.txt\n\n# Machine-readable output\npython3 scripts\u002Fwordcount.py essay.txt --top 10 --json > stats.json\n```\n\n### 7. Text diff\n\n```bash\n# Standard unified diff\npython3 scripts\u002Fdiff_text.py before.txt after.txt\n\n# Side-by-side\npython3 scripts\u002Fdiff_text.py before.txt after.txt --mode side\n\n# HTML report (colorized) for sharing\npython3 scripts\u002Fdiff_text.py before.txt after.txt --mode html --output diff.html\n\n# Whitespace-insensitive compare\npython3 scripts\u002Fdiff_text.py before.txt after.txt --ignore-whitespace\n```\n\n## Exit codes\n\n| Code | Meaning |\n|---|---|\n| 0 | success \u002F one or more matches \u002F files identical |\n| 1 | zero matches \u002F zero redactions \u002F files differ \u002F empty input |\n| 2 | bad arguments \u002F unsafe path \u002F missing input \u002F unknown kind \u002F bad regex \u002F unsupported output extension |\n\nThis 0 \u002F 1 \u002F 2 split is consistent across all six scripts so they slot into shell pipelines cleanly:\n\n```bash\n# Normalize, then redact, then count words in one shot\npython3 scripts\u002Fnormalize.py raw.txt clean.txt --to-unix --dehyphenate \\\n  && python3 scripts\u002Fredact.py clean.txt safe.txt \\\n  && python3 scripts\u002Fwordcount.py safe.txt --top 10\n```\n\n## Safety properties\n\n- Pure Python 3 standard library. No third-party dependencies, no `pip install`.\n- No `subprocess` calls. No shell invocation.\n- All file paths are validated against a strict allowlist regex that rejects shell metacharacters (`;`, `|`, `&`, `>`, `\u003C`, `$`, `` ` ``, etc.). The same `safe_path()` helper that powers `clean-csv-toolkit`.\n- Scripts only read the input paths the caller provides and write to the output paths the caller provides.\n- All inputs and outputs default to UTF-8; reads fall back through `utf-8-sig`, `cp1252`, `latin-1` if needed. Writes are always UTF-8.\n- Deterministic where it matters: `shuffle --seed N` is reproducible; `extract` and `wordcount` always emit results in the same order for a given input.\n\n## Performance\n\n- `lines.py --op dedupe` processes 100,000 short lines (500 distinct) in ~0.06 s.\n- `lines.py --op sort` processes 100,000 lines in ~0.10 s.\n- `extract.py` scans the file in a single streaming pass — memory does not grow with file size.\n\n## Known limitations\n\n- The PII patterns are pragmatic heuristics, not strict RFC validators. The `email` regex accepts `user@host.tld` shapes but does not validate that `host.tld` resolves. `phone` accepts three telltale formats (`+\u003Cdigits>`, `(XXX) XXX-XXXX`, `XXX-XXX-XXXX` \u002F `XXX XXX XXXX`) so it doesn't grab IPs, dates, or credit-card numbers — but it will miss exotic local formats.\n- `credit-card` uses the Luhn checksum, but `hex-token` (and similar high-recall patterns) intentionally over-match; review the count before sharing redacted output publicly.\n- `diff_text.py --mode html` produces the standard `difflib.HtmlDiff` markup, which embeds inline styles. The file is portable but the styling is not customizable.\n\n## v0.4.0 changes\n\n- Added `scripts\u002Fhtmlstrip.py`: HTML → plain text \u002F sanitized HTML \u002F structured extract. Built on stdlib `html.parser`. Three modes (text \u002F html \u002F extract), keeps links optionally, drops `\u003Cscript>\u002F\u003Cstyle>\u002F\u003Cnoscript>` content entirely in text mode, removes `on*` event-handler attributes in sanitize mode. Extract mode pulls links, images, headings, and full table data as JSON.\n- Specifically designed for agents that scrape web pages: one command turns a raw HTML dump into plain text or a structured links\u002Fimages\u002Ftables JSON.\n- Same safe-path policy and 0\u002F1\u002F2 exit-code contract as the rest of the toolkit.\n\n## v0.3.0 changes\n\n- Added `scripts\u002Freplace.py`: sed-like find-and-replace with optional regex, capture-group back-references, multiple find\u002Freplace pairs in one pass, JSON `--rules` file, `--dry-run` preview with line:col context, `--max N` cap per rule, `--word` boundaries for literal mode.\n- Fixed `extract.py`: `--kind url` was grabbing trailing sentence-punctuation (`.`, `)`, `,`, etc.) as part of the URL. Now strips a single trailing punctuation char so `Visit https:\u002F\u002Fexample.com.` correctly extracts `https:\u002F\u002Fexample.com` instead of `https:\u002F\u002Fexample.com.`.\n- Fixed `slug.py`: `--text` mode with input that slugifies to an empty string (e.g. `\"!!! @@@\"`) now exits 1, matching the existing batch-mode behaviour. Previously it returned 0 silently.\n\n## v0.2.0 changes\n\n- Added `scripts\u002Ftemplate.py`: no-Jinja2 template renderer. Three placeholder syntaxes (mustache `{{x}}`, dollar `${x}`, percent `%(x)s`), pipe filters, fallback defaults, and an optional `--strict` mode for CI. **Hand-rolled regex tokenizer, no `eval`, no `subprocess`.**\n- Added `scripts\u002Fslug.py`: URL-safe slug generator. Single-string mode (prints to stdout) or batch mode (one slug per input line). Unicode-aware with optional ASCII transliteration via NFKD; `--keep-dots` for filename use; `--dedupe` for batch outputs.\n- Added `scripts\u002Fmarkdown.py`: three-mode Markdown processor. `text` strips all markup; `html` renders a minimal HTML approximation (headings, paragraphs, lists, blockquotes, fenced code, links, images, bold\u002Fitalic\u002Fcode); `extract` pulls structured items (headings, links, images, code blocks, list items) as JSON \u002F JSONL \u002F TSV.\n- All three new scripts share the same safe-path policy and 0 \u002F 1 \u002F 2 exit-code contract as the rest of the toolkit.\n\n## v0.1.0 changes\n\n- First public release of clean-text-toolkit.\n- Six scripts: `extract.py`, `normalize.py`, `redact.py`, `lines.py`, `wordcount.py`, `diff_text.py`.\n- Shared `_common.py` with `safe_path`, `read_text`, `iter_lines`, and `write_text` helpers (mirrors the design of `clean-csv-toolkit\u002Fscripts\u002F_common.py`).\n- Bug fixed during development: initial `phone` regex was too greedy and matched IPs \u002F ISO dates \u002F credit-card-with-spaces; tightened to three explicit shapes (international, parenthesized, 3-3-4 dashed) that don't collide with those other patterns. Tested against a mixed-content fixture with 5 valid phones and 3 confusable non-phones.\n- Zero third-party dependencies; works on any system that ships Python 3.\n\n## Pairs well with\n\n- [`clean-csv-toolkit`](https:\u002F\u002Fclawhub.ai\u002Fgopendrasharma89-tech\u002Fclean-csv-toolkit) — same author, same design philosophy (pure stdlib, exit-code contract, safe-path policy), for structured tabular data.\n- [`openclaw-prompt-shield`](https:\u002F\u002Fclawhub.ai\u002Fgopendrasharma89-tech\u002Fopenclaw-prompt-shield) — pair `extract.py --kind email,url` with prompt-shield's redaction pipeline to scrub user-supplied text before passing it to an LLM.\n\n## License\n\nMIT\n","# clean-text-toolkit\n\nv0.4.0\n\nA small, honest local toolkit for the work agents end up doing constantly: read some text someone sent you, find the structured bits, clean it up, redact the secrets, and forward it downstream. Built on Python 3 standard library only. No `pandas`, no `nltk`, no pip installs, no remote calls.\n\nThis skill is the companion to [`clean-csv-toolkit`](https:\u002F\u002Fclawhub.ai\u002Fgopendrasharma89-tech\u002Fclean-csv-toolkit): that one handles structured tabular data, this one handles unstructured text.\n\n## What this skill does\n\n- `scripts\u002Fextract.py` — pull structured items out of any text file. Kinds: `url`, `email`, `phone`, `ipv4`, `ipv6`, `hashtag`, `mention`, `hex-color`, `money`, `iso-date`. Output to stdout (one-per-line or JSON), or to a `.txt` \u002F `.json` \u002F `.jsonl` file. Optional `--unique`, `--sort`, `--with-line` (prefix with the source line number).\n- `scripts\u002Fnormalize.py` — clean up messy text. Chainable transforms applied in command-line order: `--trim`, `--collapse-spaces`, `--strip-blank`, `--to-unix`, `--to-crlf`, `--dehyphenate` (rejoin OCR\u002FPDF hyphenated line-breaks), `--unsmart` (smart quotes \u002F em-dashes → ASCII), `--strip-bom`, `--strip-zwsp` (zero-width spaces and joiners), `--tabs-to-spaces N`, `--spaces-to-tabs N`, `--lower` \u002F `--upper` \u002F `--title`, `--normalize-unicode NFC|NFD|NFKC|NFKD`.\n- `scripts\u002Fredact.py` — anonymize text by replacing PII-like patterns with placeholder tokens. Kinds: `email`, `phone`, `ipv4`, `ipv6`, `url`, `credit-card` (with Luhn validation to suppress false positives), `ssn-us`, `uuid`, `hex-token` (32+ hex chars, typical for tokens \u002F hashes), `aws-access-key` (AKIA…), `jwt` (three base64url segments with the `eyJ` header). `--keep-counts` makes the same value always get the same placeholder; `--preserve-length` pads\u002Ftruncates the placeholder to the original length.\n- `scripts\u002Flines.py` — line-oriented utilities. `--op count | dedupe | sort | shuffle | head | tail`. Streams `count`, `head`, `tail`. `dedupe` and `sort` are O(N) memory in the number of lines, but each line is small so 1 M lines is fine on a laptop. `--case-insensitive`, `--keep first|last`, `--numeric`, `--reverse`, `--seed` for deterministic shuffles.\n- `scripts\u002Fwordcount.py` — word \u002F character \u002F line \u002F sentence statistics. Optional `--top N` for most-frequent words, `--stopwords PATH`, `--min-length N`, `--ignore-case`, `--regex PATTERN` (default `[A-Za-z']+`).\n- `scripts\u002Fdiff_text.py` — three-mode text diff using stdlib `difflib`. `--mode unified` (default), `--mode side` (custom two-column layout), `--mode html` (writes a full HTML file with red\u002Fgreen coloring). `--ignore-case`, `--ignore-whitespace`, `--context N`.\n- `scripts\u002Ftemplate.py` (NEW in v0.2.0) — substitute placeholders in a text file with values from a JSON object or inline `--set key=value` overrides. Mustache (`{{name}}`), dollar (`${name}`), or percent (`%(name)s`) syntax. Filters: upper, lower, title, strip, capitalize, reverse, len, escape-html, escape-json, urlencode. Default values: `{{name ?Unknown}}`. Strict mode (`--strict`) exits 1 if any placeholder is unresolved. **No Jinja2, no `eval`.**\n- `scripts\u002Fslug.py` (NEW in v0.2.0) — turn strings into URL-safe slugs. Single string mode (`--text \"Hello World\"`) or batch mode (line-in-file -> line-out-file). Options: `--separator`, `--max-length`, `--no-lower`, `--ascii` (Unicode -> ASCII transliteration via NFKD), `--keep-dots` (useful for filenames), `--dedupe`.\n- `scripts\u002Fmarkdown.py` (NEW in v0.2.0) — strip Markdown to plain text, render a minimal HTML approximation, or extract structured items (headings, links, images, code blocks, list items) as JSON \u002F JSONL \u002F TSV. For text mode, `--link-style anchor|url|both` controls how `[text](url)` is rendered.\n- `scripts\u002Freplace.py` (NEW in v0.3.0) — find-and-replace with regex \u002F literal \u002F word-boundary modes, capture-group back-references (`\\1`, `\\2`), multiple `--find\u002F--replace` pairs in a single pass, or a JSON `--rules` file with per-rule settings. `--dry-run` previews matches with line:col and context; `--max N` caps replacements per rule. Returns exit 1 when zero replacements happen so it slots into CI.\n- `scripts\u002Fhtmlstrip.py` (NEW in v0.4.0) — strip HTML tags from scraped pages. Three modes: `text` (collapse to plain readable text, drop `\u003Cscript>`\u002F`\u003Cstyle>` content, preserve line breaks at block tags), `html` (sanitize — remove `script,style,iframe,object,embed,form,input` tags + all `on*` event-handler attributes + inline `style=`, keep the rest intact), `extract` (pull links\u002Fimages\u002Fheadings\u002Ftables as JSON\u002FJSONL\u002FTSV). Built on Python stdlib `html.parser`. The single most-asked-for agent capability: turn scraped HTML into something useful in one command.\n- `scripts\u002Fcheck_deps.sh` — verify `python3` is available.\n\n## What this skill does not do\n\n- It does not call any LLM, web service, or remote API.\n- It does not load entire files into memory unless an operation truly needs the whole file (full-content normalization, sort-and-write, diff). Streaming-friendly operations (`extract`, `lines --op count|head|tail`, `wordcount` for chars\u002Flines counters) read one line at a time.\n- It does not write outside the input\u002Foutput paths the caller provides.\n\n## Quick start\n\n### 1. Pull every email out of a log file\n\n```bash\npython3 scripts\u002Fextract.py app.log --kind email --unique --sort\npython3 scripts\u002Fextract.py app.log --kind email --output emails.txt --unique\n```\n\n### 2. Find every URL and tag it with the source line\n\n```bash\npython3 scripts\u002Fextract.py article.md --kind url --with-line\n```\n\n### 3. Clean up a messy OCR dump\n\n```bash\npython3 scripts\u002Fnormalize.py scanned.txt clean.txt \\\n    --strip-bom --to-unix --dehyphenate --collapse-spaces \\\n    --unsmart --strip-blank --normalize-unicode NFC\n```\n\nThe transforms run in the order you list them on the command line.\n\n### 4. Redact PII before sharing a transcript\n\n```bash\npython3 scripts\u002Fredact.py transcript.txt safe.txt\n# default kinds = all\n# default placeholder = [REDACTED_{kind}_{i}]\n```\n\n```bash\n# Only redact emails and phones, give the same email the same placeholder\npython3 scripts\u002Fredact.py transcript.txt safe.txt \\\n    --kinds email,phone --keep-counts\n```\n\n```bash\n# Custom template\npython3 scripts\u002Fredact.py log.txt safe.txt \\\n    --token-template \"\u003C\u003C{kind}#{i}>>\"\n```\n\n```bash\n# Pad placeholder to match original length (for fixed-width layouts)\npython3 scripts\u002Fredact.py log.txt safe.txt --preserve-length\n```\n\nCredit-card matches are validated against the Luhn checksum so 16 random digits in a row don't trigger a false positive.\n\n### 5. Line utilities\n\n```bash\n# Quick file stats\npython3 scripts\u002Flines.py haystack.txt --op count\n\n# Drop duplicates, case-insensitive\npython3 scripts\u002Flines.py users.txt --op dedupe --case-insensitive --output unique.txt\n\n# Numeric sort (so \"100\" > \"23\" > \"7\")\npython3 scripts\u002Flines.py scores.txt --op sort --numeric --reverse\n\n# Deterministic shuffle\npython3 scripts\u002Flines.py prompts.txt --op shuffle --seed 42\n\n# Look at the head and tail of a multi-gig log\npython3 scripts\u002Flines.py huge.log --op head -n 20\npython3 scripts\u002Flines.py huge.log --op tail -n 20\n```\n\n### 6. Word counts\n\n```bash\n# Basic stats\npython3 scripts\u002Fwordcount.py essay.txt\n\n# Top words with stopwords filter\npython3 scripts\u002Fwordcount.py essay.txt --top 20 --ignore-case --stopwords stop.txt\n\n# Machine-readable output\npython3 scripts\u002Fwordcount.py essay.txt --top 10 --json > stats.json\n```\n\n### 7. Text diff\n\n```bash\n# Standard unified diff\npython3 scripts\u002Fdiff_text.py before.txt after.txt\n\n# Side-by-side\npython3 scripts\u002Fdiff_text.py before.txt after.txt --mode side\n\n# HTML report (colorized) for sharing\npython3 scripts\u002Fdiff_text.py before.txt after.txt --mode html --output diff.html\n\n# Whitespace-insensitive compare\npython3 scripts\u002Fdiff_text.py before.txt after.txt --ignore-whitespace\n```\n\n## Exit codes\n\n| Code | Meaning |\n|---|---|\n| 0 | success \u002F one or more matches \u002F files identical |\n| 1 | zero matches \u002F zero redactions \u002F files differ \u002F empty input |\n| 2 | bad arguments \u002F unsafe path \u002F missing input \u002F unknown kind \u002F bad regex \u002F unsupported output extension |\n\nThis 0 \u002F 1 \u002F 2 split is consistent across all six scripts so they slot into shell pipelines cleanly:\n\n```bash\n# Normalize, then redact, then count words in one shot\npython3 scripts\u002Fnormalize.py raw.txt clean.txt --to-unix --dehyphenate \\\n  && python3 scripts\u002Fredact.py clean.txt safe.txt \\\n  && python3 scripts\u002Fwordcount.py safe.txt --top 10\n```\n\n## Safety properties\n\n- Pure Python 3 standard library. No third-party dependencies, no `pip install`.\n- No `subprocess` calls. No shell invocation.\n- All file paths are validated against a strict allowlist regex that rejects shell metacharacters (`;`, `|`, `&`, `>`, `\u003C`, `$`, `` ` ``, etc.). The same `safe_path()` helper that powers `clean-csv-toolkit`.\n- Scripts only read the input paths the caller provides and write to the output paths the caller provides.\n- All inputs and outputs default to UTF-8; reads fall back through `utf-8-sig`, `cp1252`, `latin-1` if needed. Writes are always UTF-8.\n- Deterministic where it matters: `shuffle --seed N` is reproducible; `extract` and `wordcount` always emit results in the same order for a given input.\n\n## Performance\n\n- `lines.py --op dedupe` processes 100,000 short lines (500 distinct) in ~0.06 s.\n- `lines.py --op sort` processes 100,000 lines in ~0.10 s.\n- `extract.py` scans the file in a single streaming pass — memory does not grow with file size.\n\n## Known limitations\n\n- The PII patterns are pragmatic heuristics, not strict RFC validators. The `email` regex accepts `user@host.tld` shapes but does not validate that `host.tld` resolves. `phone` accepts three telltale formats (`+\u003Cdigits>`, `(XXX) XXX-XXXX`, `XXX-XXX-XXXX` \u002F `XXX XXX XXXX`) so it doesn't grab IPs, dates, or credit-card numbers — but it will miss exotic local formats.\n- `credit-card` uses the Luhn checksum, but `hex-token` (and similar high-recall patterns) intentionally over-match; review the count before sharing redacted output publicly.\n- `diff_text.py --mode html` produces the standard `difflib.HtmlDiff` markup, which embeds inline styles. The file is portable but the styling is not customizable.\n\n## v0.4.0 changes\n\n- Added `scripts\u002Fhtmlstrip.py`: HTML → plain text \u002F sanitized HTML \u002F structured extract. Built on stdlib `html.parser`. Three modes (text \u002F html \u002F extract), keeps links optionally, drops `\u003Cscript>\u002F\u003Cstyle>\u002F\u003Cnoscript>` content entirely in text mode, removes `on*` event-handler attributes in sanitize mode. Extract mode pulls links, images, headings, and full table data as JSON.\n- Specifically designed for agents that scrape web pages: one command turns a raw HTML dump into plain text or a structured links\u002Fimages\u002Ftables JSON.\n- Same safe-path policy and 0\u002F1\u002F2 exit-code contract as the rest of the toolkit.\n\n## v0.3.0 changes\n\n- Added `scripts\u002Freplace.py`: sed-like find-and-replace with optional regex, capture-group back-references, multiple find\u002Freplace pairs in one pass, JSON `--rules` file, `--dry-run` preview with line:col context, `--max N` cap per rule, `--word` boundaries for literal mode.\n- Fixed `extract.py`: `--kind url` was grabbing trailing sentence-punctuation (`.`, `)`, `,`, etc.) as part of the URL. Now strips a single trailing punctuation char so `Visit https:\u002F\u002Fexample.com.` correctly extracts `https:\u002F\u002Fexample.com` instead of `https:\u002F\u002Fexample.com.`.\n- Fixed `slug.py`: `--text` mode with input that slugifies to an empty string (e.g. `\"!!! @@@\"`) now exits 1, matching the existing batch-mode behaviour. Previously it returned 0 silently.\n\n## v0.2.0 changes\n\n- Added `scripts\u002Ftemplate.py`: no-Jinja2 template renderer. Three placeholder syntaxes (mustache `{{x}}`, dollar `${x}`, percent `%(x)s`), pipe filters, fallback defaults, and an optional `--strict` mode for CI. **Hand-rolled regex tokenizer, no `eval`, no `subprocess`.**\n- Added `scripts\u002Fslug.py`: URL-safe slug generator. Single-string mode (prints to stdout) or batch mode (one slug per input line). Unicode-aware with optional ASCII transliteration via NFKD; `--keep-dots` for filename use; `--dedupe` for batch outputs.\n- Added `scripts\u002Fmarkdown.py`: three-mode Markdown processor. `text` strips all markup; `html` renders a minimal HTML approximation (headings, paragraphs, lists, blockquotes, fenced code, links, images, bold\u002Fitalic\u002Fcode); `extract` pulls structured items (headings, links, images, code blocks, list items) as JSON \u002F JSONL \u002F TSV.\n- All three new scripts share the same safe-path policy and 0 \u002F 1 \u002F 2 exit-code contract as the rest of the toolkit.\n\n## v0.1.0 changes\n\n- First public release of clean-text-toolkit.\n- Six scripts: `extract.py`, `normalize.py`, `redact.py`, `lines.py`, `wordcount.py`, `diff_text.py`.\n- Shared `_common.py` with `safe_path`, `read_text`, `iter_lines`, and `write_text` helpers (mirrors the design of `clean-csv-toolkit\u002Fscripts\u002F_common.py`).\n- Bug fixed during development: initial `phone` regex was too greedy and matched IPs \u002F ISO dates \u002F credit-card-with-spaces; tightened to three explicit shapes (international, parenthesized, 3-3-4 dashed) that don't collide with those other patterns. Tested against a mixed-content fixture with 5 valid phones and 3 confusable non-phones.\n- Zero third-party dependencies; works on any system that ships Python 3.\n\n## Pairs well with\n\n- [`clean-csv-toolkit`](https:\u002F\u002Fclawhub.ai\u002Fgopendrasharma89-tech\u002Fclean-csv-toolkit) — same author, same design philosophy (pure stdlib, exit-code contract, safe-path policy), for structured tabular data.\n- [`openclaw-prompt-shield`](https:\u002F\u002Fclawhub.ai\u002Fgopendrasharma89-tech\u002Fopenclaw-prompt-shield) — pair `extract.py --kind email,url` with prompt-shield's redaction pipeline to scrub user-supplied text before passing it to an LLM.\n\n## License\n\nMIT\n",{"name":5,"license":15,"metadata":24,"description":7},{"openclaw":25},{"homepage":26,"requires":27,"primaryEnv":6},"https:\u002F\u002Fclawhub.ai\u002Fgopendrasharma89-tech\u002Fclean-text-toolkit",{"bins":28},[29],"python3","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fc\u002Fclean-text-toolkit",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill clean-text-toolkit",{"tool":45,"command":46},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill clean-text-toolkit",{"tool":48,"command":49},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill clean-text-toolkit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fc\u002Fclean-text-toolkit\u002FSKILL.md",true,[],[54,61,68,75,82,89],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]