Sample Text Processor

Reference BASIC-tier skill used as a fixture by skill-tester.

How to use it

Claude Code
  1. Run the line below. It pulls the whole folder into ~/.claude/skills/sample-skill, including the files SKILL.md points to.
  2. Describe your job in plain words. Claude Code follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit alirezarezvani/claude-skills/engineering/skills/skill-tester/assets/sample-skill#main ~/.claude/skills/sample-skill

For one project only, change the path to .claude/skills/sample-skill. This skill also uses skill_validator.py, script_tester.py, text_processor.py, document.txt, results.json, transformed.txt — copying SKILL.md alone won't be enough. See the folder on GitHub.

Claude (web or desktop app)
  1. On this page open ⋯ → Download .md.
  2. Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
  3. Pick the file and Save. Claude shows the name and description and runs a security scan.
  4. Check the skill is switched on.
  5. Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
  1. ChatGPT: make a Project and paste it into Instructions.
  2. Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
  • Check which app you pasted it into — the steps above name the right one.
  • Some skills need the paid tier of Claude or ChatGPT.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Source of Sample Text Processor

Show the full text163 lines
namedescription
sample-text-processorReference 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
python text_processor.py analyze document.txt
python text_processor.py analyze document.txt --output results.json
Text Transformation
python text_processor.py transform document.txt --mode uppercase
python text_processor.py transform document.txt --mode title --output transformed.txt
Batch Processing
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
$ 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
$ 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
$ 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
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.

1---
2name: sample-text-processor
3description: "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."
4---
5 
6# Sample Text Processor
7 
8This file is the fixture skill_validator.py and script_tester.py run against.
9It is deliberately minimal. Keep its frontmatter valid YAML and limited to the
10fields Claude Code reads: anything else here gets copied into new skills by
11authors treating it as a template.
12 
13Tier: BASIC. Dependencies: none, Python standard library only.
14 
15## Description
16 
17The 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.
18 
19This 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.
20 
21The 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.
22 
23## Features
24 
25### Core Functionality
26- **Word Count Analysis**: Count total words, unique words, and word frequency
27- **Character Statistics**: Analyze character count, line count, and special characters
28- **Text Transformations**: Convert text to uppercase, lowercase, or title case
29- **File Processing**: Process single text files or batch process directories
30- **Dual Output Formats**: Generate results in both JSON and human-readable formats
31 
32### Technical Features
33- Command-line interface with comprehensive argument parsing
34- Error handling for common file and processing issues
35- Progress reporting for batch operations
36- Configurable output formatting and verbosity levels
37- Cross-platform compatibility with standard library only dependencies
38 
39## Usage
40 
41### Basic Text Analysis
42```bash
43python text_processor.py analyze document.txt
44python text_processor.py analyze document.txt --output results.json
45```
46 
47### Text Transformation
48```bash
49python text_processor.py transform document.txt --mode uppercase
50python text_processor.py transform document.txt --mode title --output transformed.txt
51```
52 
53### Batch Processing
54```bash
55python text_processor.py batch text_files/ --output results/
56python text_processor.py batch text_files/ --format json --output batch_results.json
57```
58 
59## Examples
60 
61### Example 1: Basic Word Count
62```bash
63$ python text_processor.py analyze sample.txt
64=== TEXT ANALYSIS RESULTS ===
65File: sample.txt
66Total words: 150
67Unique words: 85
68Total characters: 750
69Lines: 12
70Most frequent word: "the" (8 occurrences)
71```
72 
73### Example 2: JSON Output
74```bash
75$ python text_processor.py analyze sample.txt --format json
76{
77 "file": "sample.txt",
78 "statistics": {
79 "total_words": 150,
80 "unique_words": 85,
81 "total_characters": 750,
82 "lines": 12,
83 "most_frequent": {
84 "word": "the",
85 "count": 8
86 }
87 }
88}
89```
90 
91### Example 3: Text Transformation
92```bash
93$ python text_processor.py transform sample.txt --mode title
94Original: "hello world from the text processor"
95Transformed: "Hello World From The Text Processor"
96```
97 
98## Installation
99 
100This skill requires only Python 3.7 or later with the standard library. No external dependencies are required.
101 
1021. Clone or download the skill directory
1032. Navigate to the scripts directory
1043. Run the text processor directly with Python
105 
106```bash
107cd scripts/
108python text_processor.py --help
109```
110 
111## Configuration
112 
113The text processor supports various configuration options through command-line arguments:
114 
115- `--format`: Output format (json, text)
116- `--verbose`: Enable verbose output and progress reporting
117- `--output`: Specify output file or directory
118- `--encoding`: Specify text file encoding (default: utf-8)
119 
120## Architecture
121 
122The skill follows a simple modular architecture:
123 
124- **TextProcessor Class**: Core processing logic and statistics calculation
125- **OutputFormatter Class**: Handles dual output format generation
126- **FileManager Class**: Manages file I/O operations and batch processing
127- **CLI Interface**: Command-line argument parsing and user interaction
128 
129## Error Handling
130 
131The skill includes comprehensive error handling for:
132- File not found or permission errors
133- Invalid encoding or corrupted text files
134- Memory limitations for very large files
135- Output directory creation and write permissions
136- Invalid command-line arguments and parameters
137 
138## Performance Considerations
139 
140- Efficient memory usage for large text files through streaming
141- Optimized word counting using dictionary lookups
142- Batch processing with progress reporting for large datasets
143- Configurable encoding detection for international text
144 
145## Contributing
146 
147This skill serves as a reference implementation and contributions are welcome to demonstrate best practices:
148 
1491. Follow PEP 8 coding standards
1502. Include comprehensive docstrings
1513. Add test cases with sample data
1524. Update documentation for any new features
1535. Ensure backward compatibility
154 
155## Limitations
156 
157As a BASIC tier skill, some advanced features are intentionally omitted:
158- Complex text analysis (sentiment, language detection)
159- Advanced file format support (PDF, Word documents)
160- Database integration or external API calls
161- Parallel processing for very large datasets
162 
163This 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.

Discussion