sample-text-processor — скилл для Claude Code: как установить
Эталонный скилл уровня BASIC для тестов и валидации. Подсчитывает частоту слов и меняет регистр текста средствами стандартной библиотеки Python.
/plugin marketplace add alirezarezvani/claude-skills
/plugin install engineering-advanced-skills@claude-code-skillsЧто делает sample-text-processor
sample-text-processor служит тестовым образцом для валидаторов skill_validator.py и script_tester.py. Разработка относится к уровню BASIC. Она демонстрирует корректную разметку YAML без лишних полей. Консольный скрипт text_processor.py подсчитывает частоту слов и меняет регистр текста.
Внутри работают модули TextProcessor и FileManager. Утилита обрабатывает отдельные документы через команды analyze и transform, а для папок предусмотрен режим batch. Результаты выводятся в виде консольного текста либо структуры JSON. По умолчанию используется кодировка utf-8.
Для работы нужен Python 3.7 или свежее со стандартной библиотекой. В коде намеренно нет распознавания языка или поддержки форматов вроде PDF и Word. Попытка скормить утилите бинарный файл вызовет сбой декодирования.
Какие задачи решает
- проверить работу
skill_validator.pyна эталонной структуре манифеста - подсчитать число строк и частоту слов в текстовом документе
- преобразовать регистр текста в файлах пакетом
- получить текстовую статистику в формате JSON для пайплайнов
Примеры запросов агенту
- Запусти анализ файла
notes.txtчерезtext_processor.pyи покажи частоту слов - Преобразуй заголовки в файле
chapter.txtв title case с помощью скриптаtext_processor.py - Обработай папку
docs/пакетом черезtext_processor.pyи сохрани статистику вbatch_results.json
Как установить sample-text-processor
1Через маркетплейс плагинов
/plugin marketplace add alirezarezvani/claude-skills/plugin install engineering-advanced-skills@claude-code-skillsКоманда ставит плагин engineering-advanced-skills целиком, со всеми его скиллами
2Через Skills CLI (Vercel)
npx skills add alirezarezvani/claude-skills --skill sample-skill -a claude-code3Вручную: положить файлы
~/.claude/skills/sample-skill/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/sample-skill/
Вручную: положить файлы
.agents/skills/sample-skill/SKILL.mdДля всех проектов — ~/.agents/skills/
Вручную: положить файлы
.cursor/skills/sample-skill/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install alirezarezvani/claude-skills sample-skill2Вручную: положить файлы
.github/skills/sample-skill/SKILL.mdКомандой платформы
gemini skills install https://github.com/alirezarezvani/claude-skills --path engineering/skills/skill-tester/assets/sample-skillВручную: положить файлы
.devin/skills/sample-skill/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о sample-text-processor
Как установить sample-text-processor в Claude Code?
Подключите каталог командой /plugin marketplace add alirezarezvani/claude-skills, а затем установите пакет через /plugin install engineering-advanced-skills@claude-code-skills.
Что делает sample-text-processor?
Скилл служит фикстурой для тестирования валидаторов и подсчитывает базовые показатели текста: строки, знаки и частоту слов. Также он умеет менять регистр текста и экспортировать результаты в JSON.
Какие зависимости нужны для запуска text_processor.py?
Требуется интерпретатор Python 3.7 или новее. Скрипт использует только стандартную библиотеку Python, поэтому сторонние пакеты не нужны.
Исходный текст
SKILL.md · MIT
---
name: sample-text-processor
description: "Reference BASIC-tier skill used as a fixture by skill-tester. Counts words and characters and applies basic text transformations. Use when validating skill-tester itself or when you need a minimal, known-good skill layout to copy. Not a production skill."
---
# Sample Text Processor
This file is the fixture skill_validator.py and script_tester.py run against.
It is deliberately minimal. Keep its frontmatter valid YAML and limited to the
fields Claude Code reads: anything else here gets copied into new skills by
authors treating it as a template.
Tier: BASIC. Dependencies: none, Python standard library only.
## Description
The Sample Text Processor is a simple skill designed to demonstrate the basic structure and functionality expected in the claude-skills ecosystem. This skill provides fundamental text processing capabilities including word counting, character analysis, and basic text transformations.
This skill serves as a reference implementation for BASIC tier requirements and can be used as a template for creating new skills. It demonstrates proper file structure, documentation standards, and implementation patterns that align with ecosystem best practices.
The skill processes text files and provides statistics and transformations in both human-readable and JSON formats, showcasing the dual output requirement for skills in the claude-skills repository.
## Features
### Core Functionality
- **Word Count Analysis**: Count total words, unique words, and word frequency
- **Character Statistics**: Analyze character count, line count, and special characters
- **Text Transformations**: Convert text to uppercase, lowercase, or title case
- **File Processing**: Process single text files or batch process directories
- **Dual Output Formats**: Generate results in both JSON and human-readable formats
### Technical Features
- Command-line interface with comprehensive argument parsing
- Error handling for common file and processing issues
- Progress reporting for batch operations
- Configurable output formatting and verbosity levels
- Cross-platform compatibility with standard library only dependencies
## Usage
### Basic Text Analysis
```bash
python text_processor.py analyze document.txt
python text_processor.py analyze document.txt --output results.json
```
### Text Transformation
```bash
python text_processor.py transform document.txt --mode uppercase
python text_processor.py transform document.txt --mode title --output transformed.txt
```
### Batch Processing
```bash
python text_processor.py batch text_files/ --output results/
python text_processor.py batch text_files/ --format json --output batch_results.json
```
## Examples
### Example 1: Basic Word Count
```bash
$ python text_processor.py analyze sample.txt
=== TEXT ANALYSIS RESULTS ===
File: sample.txt
Total words: 150
Unique words: 85
Total characters: 750
Lines: 12
Most frequent word: "the" (8 occurrences)
```
### Example 2: JSON Output
```bash
$ python text_processor.py analyze sample.txt --format json
{
"file": "sample.txt",
"statistics": {
"total_words": 150,
"unique_words": 85,
"total_characters": 750,
"lines": 12,
"most_frequent": {
"word": "the",
"count": 8
}
}
}
```
### Example 3: Text Transformation
```bash
$ python text_processor.py transform sample.txt --mode title
Original: "hello world from the text processor"
Transformed: "Hello World From The Text Processor"
```
## Installation
This skill requires only Python 3.7 or later with the standard library. No external dependencies are required.
1. Clone or download the skill directory
2. Navigate to the scripts directory
3. Run the text processor directly with Python
```bash
cd scripts/
python text_processor.py --help
```
## Configuration
The text processor supports various configuration options through command-line arguments:
- `--format`: Output format (json, text)
- `--verbose`: Enable verbose output and progress reporting
- `--output`: Specify output file or directory
- `--encoding`: Specify text file encoding (default: utf-8)
## Architecture
The skill follows a simple modular architecture:
- **TextProcessor Class**: Core processing logic and statistics calculation
- **OutputFormatter Class**: Handles dual output format generation
- **FileManager Class**: Manages file I/O operations and batch processing
- **CLI Interface**: Command-line argument parsing and user interaction
## Error Handling
The skill includes comprehensive error handling for:
- File not found or permission errors
- Invalid encoding or corrupted text files
- Memory limitations for very large files
- Output directory creation and write permissions
- Invalid command-line arguments and parameters
## Performance Considerations
- Efficient memory usage for large text files through streaming
- Optimized word counting using dictionary lookups
- Batch processing with progress reporting for large datasets
- Configurable encoding detection for international text
## Contributing
This skill serves as a reference implementation and contributions are welcome to demonstrate best practices:
1. Follow PEP 8 coding standards
2. Include comprehensive docstrings
3. Add test cases with sample data
4. Update documentation for any new features
5. Ensure backward compatibility
## Limitations
As a BASIC tier skill, some advanced features are intentionally omitted:
- Complex text analysis (sentiment, language detection)
- Advanced file format support (PDF, Word documents)
- Database integration or external API calls
- Parallel processing for very large datasets
This skill demonstrates the essential structure and quality standards required for BASIC tier skills in the claude-skills ecosystem while remaining simple and focused on core functionality.
© Alireza Rezvani · MIT · alirezarezvani/claude-skills