agentsclimarketplace

Char index skill

Skill agent-hanju/char-index-skill/skills/char-index-skill

Character-level string manipulation: find nth char/substring, split at indices, extract ranges, modify at positions. For test generation, parsing, position-critical tasks.From its SKILL.md

Install
npx -y skills add agent-hanju/char-index-skill --skill char-index-skill

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.2 KB, 881 tokens by cl100k_base, as published. Nobody here has run it

Char-Index String Manipulation

Precise index-based string operations. Use when you need exact character positioning for test generation, parsing, or LLM response extraction.

Operations (12 tools)

All via python ${CLAUDE_SKILL_DIR}/scripts/char_ops.py <command> [options]. Returns JSON.

Finding (4)

  • find-nth-char: Find nth occurrence of char → {"index": N}
  • find-all-chars: All positions of char → {"indices": [...]}
  • find-nth-substring: Find nth occurrence of substring → {"index": N}
  • find-all-substrings: All positions of substring → {"indices": [...]}

Splitting & Extraction (4)

  • split-at: Split at indices → {"parts": [...]}
  • extract: Substring by range → {"substring": "...", "length": N}
  • extract-between: Content between markers → {"content": "...", "content_start": N, ...}
  • extract-batch: Multiple ranges → {"results": [{...}, ...]}

Modification (3)

  • insert: Insert at index → {"result": "..."}
  • delete: Delete range [start, end) → {"result": "..."}
  • replace: Replace range with text → {"result": "..."}

Utilities (1)

  • count: Character statistics → {"total": N, "letters": N, "digits": N, ...}

Quick Reference

TaskCommand
Find 3rd 'l'find-nth-char --text "hello world" --char "l" --n 3
All 'l' positionsfind-all-chars --text "hello world" --char "l"
Split at 2,5,8split-at --text "hello world" --indices "2,5,8"
Extract chars 0-5extract --text "hello world" --start 0 --end 5
Between markersextract-between --text "a[b]c" --start-marker "[" --end-marker "]"
Insert commainsert --text "hello world" --index 5 --insertion ","
Delete rangedelete --text "hello world" --start 5 --end 11
Replace rangereplace --text "hello world" --start 6 --end 11 --replacement "Python"
Count charscount --text "hello world"

Usage Patterns

Basic:

python ${CLAUDE_SKILL_DIR}/scripts/char_ops.py find-nth-char \
  --text "hello world" --char "l" --n 3
# {"index": 9}

Chain with jq:

INDEX=$(python ${CLAUDE_SKILL_DIR}/scripts/char_ops.py find-nth-char \
  --text "$TEXT" --char "x" --n 1 | jq -r '.index')

Batch operations:

python ${CLAUDE_SKILL_DIR}/scripts/char_ops.py extract-batch \
  --text "hello world" \
  --ranges '[{"start":0,"end":5},{"start":6,"end":11}]'

Key Points

  • 0-indexed: All positions start from 0
  • 1-based occurrence: find-nth-* uses --n 1 for first occurrence
  • Negative indices: -1 = last char, -5 = 5th from end
  • Returns -1: When char/substring not found
  • Range format: [start, end) - start inclusive, end exclusive
  • Unicode safe: Each Unicode character = 1 position
  • Overlaps included: find-all-* finds overlapping matches

More Info

  • Practical examples: examples.md
  • Command help: python ${CLAUDE_SKILL_DIR}/scripts/char_ops.py --help

What ships with it: 2 files

21.4 KB alongside SKILL.md, 1 of them executable

scripts/

Keep looking

Skills are one crate of 326,512. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.