{
  "markdown": "# char-index-skill\n\n**Character-level index-based string manipulation** as a Claude Code Skill.\n\nLLMs generate text token-by-token and struggle with exact character counting. This skill provides precise index-based tools for test code generation, string parsing, and position-critical tasks.\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n> Evolved from [char-index-mcp](https://github.com/agent-hanju/char-index-mcp). The MCP server is still supported — see [MCP Server](#mcp-server-legacy) section.\n\n## Installation\n\nClone the repository:\n\n```bash\ngit clone https://github.com/agent-hanju/char-index-skill.git\n```\n\nCopy `skills/char-index-skill/` into your project's `.claude/skills/` directory, or use it directly from the cloned repo.\n\n### Usage\n\nClaude will automatically invoke the skill when you need character-level string operations. You can also call it explicitly with `/char-index-skill`.\n\nAll operations are available via:\n\n```bash\npython ${CLAUDE_SKILL_DIR}/scripts/char_ops.py <command> [options]\n```\n\nSee [SKILL.md](skills/char-index-skill/SKILL.md) for the full command reference.\n\n## Features (12 Operations)\n\n### Finding (4)\n- `find-nth-char` - Find nth occurrence of a character\n- `find-all-chars` - Find all indices of a character\n- `find-nth-substring` - Find nth occurrence of a substring\n- `find-all-substrings` - Find all occurrences of a substring\n\n### Splitting & Extraction (4)\n- `split-at` - Split string at multiple positions\n- `extract` - Extract substring by range\n- `extract-between` - Extract text between two markers\n- `extract-batch` - Extract multiple substrings by index ranges\n\n### Modification (3)\n- `insert` - Insert text at specific position\n- `delete` - Delete characters in range\n- `replace` - Replace range with new text\n\n### Utilities (1)\n- `count` - Character statistics (total, letters, digits, etc.)\n\n## Quick Examples\n\n```bash\n# Find 3rd 'l'\npython ${CLAUDE_SKILL_DIR}/scripts/char_ops.py find-nth-char \\\n  --text \"hello world\" --char \"l\" --n 3\n# {\"index\": 9}\n\n# Split at positions\npython ${CLAUDE_SKILL_DIR}/scripts/char_ops.py split-at \\\n  --text \"hello world\" --indices \"2,5,8\"\n# {\"parts\": [\"he\", \"llo\", \" wo\", \"rld\"]}\n\n# Extract between markers\npython ${CLAUDE_SKILL_DIR}/scripts/char_ops.py extract-between \\\n  --text \"<tag>content</tag>\" --start-marker \"<tag>\" --end-marker \"</tag>\"\n# {\"content\": \"content\", ...}\n\n# Count characters\npython ${CLAUDE_SKILL_DIR}/scripts/char_ops.py count --text \"Hello World!\"\n# {\"total\": 12, \"letters\": 10, \"digits\": 0, \"spaces\": 1, \"special\": 1}\n```\n\nSee [examples.md](skills/char-index-skill/examples.md) for more practical examples.\n\n## Key Points\n\n- **0-indexed**: All positions start from 0\n- **1-based occurrence**: `find-nth-*` uses `--n 1` for first occurrence\n- **Negative indices**: `-1` = last char, `-5` = 5th from end\n- **Range format**: `[start, end)` - start inclusive, end exclusive\n- **Unicode safe**: Each Unicode character = 1 position\n- **JSON output**: All operations return JSON for easy parsing\n\n## Use Cases\n\n1. **Test Code Generation** - Generate strings with exact character counts\n2. **Data Processing** - Split/extract data at precise positions\n3. **Text Formatting** - Insert/delete/replace at specific indices\n4. **LLM Response Parsing** - Extract content between XML tags by position\n\n## Project Structure\n\n```\nchar-index-skill/\n├── skills/\n│   └── char-index-skill/\n│       ├── SKILL.md               # Skill definition\n│       ├── examples.md            # Usage examples\n│       └── scripts/char_ops.py    # Implementation (12 operations)\n├── char_index_mcp/                # MCP server (legacy)\n│   ├── server.py\n│   ├── char_ops.py                # Synced copy\n│   └── tests/\n├── pyproject.toml                 # MCP package config\n├── README.md\n└── LICENSE\n```\n\n## Development\n\n```bash\ngit clone https://github.com/agent-hanju/char-index-skill.git\ncd char-index-skill\n\npython -m venv .venv\n.venv/Scripts/activate  # or source .venv/bin/activate\n\npip install -e .\npytest char_index_mcp/tests/ -v\nruff check .\nmypy char_index_mcp/\n```\n\n## MCP Server (Legacy)\n\nThe `char-index-mcp` package provides the same 12 operations as an MCP server for integration with Claude Desktop, Cursor, and other MCP clients. This is maintained for backward compatibility but the Claude Code Skill is the recommended approach.\n\n```bash\n# Install\npip install char-index-mcp\n\n# Or run directly\nuvx char-index-mcp\n```\n\nConfiguration for Claude Desktop (`claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"char-index\": {\n      \"command\": \"uvx\",\n      \"args\": [\"char-index-mcp\"]\n    }\n  }\n}\n```\n\n[![PyPI](https://img.shields.io/pypi/v/char-index-mcp)](https://pypi.org/project/char-index-mcp/)\n[![Python](https://img.shields.io/pypi/pyversions/char-index-mcp)](https://pypi.org/project/char-index-mcp/)\n\n## License\n\nMIT License - see LICENSE file for details\n",
  "bytes": 4932,
  "sha": "602038c55f15b7a6d813a4de8d1e96a6aa08837b1c9b32ac0c4b673eb384571d",
  "repo_slug": "agent-hanju/char-index-skill",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_agent_hanju_char_index_skill_char_index__3a8985da/readme"
}