Reference BASIC-tier skill used as a fixture by skill-tester. Counts words and characters and applies basic text transformations. Use when validating skill-test
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-sample-skill-a92d53cb30a4 ,按照其中的说明把「sample-text-processor」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
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.
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.
python text_processor.py analyze document.txt
python text_processor.py analyze document.txt --output results.json
python text_processor.py transform document.txt --mode uppercase
python text_processor.py transform document.txt --mode title --output transformed.txt
python text_processor.py batch text_files/ --output results/
python text_processor.py batch text_files/ --format json --output batch_results.json
$ 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)
$ 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
}
}
}
$ python text_processor.py transform sample.txt --mode title
Original: "hello world from the text processor"
Transformed: "Hello World From The Text Processor"
This skill requires only Python 3.7 or later with the standard library. No external dependencies are required.
cd scripts/
python text_processor.py --help
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)The skill follows a simple modular architecture:
The skill includes comprehensive error handling for:
This skill serves as a reference implementation and contributions are welcome to demonstrate best practices:
As a BASIC tier skill, some advanced features are intentionally omitted:
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.