claude-skills/engineering/skills/skill-tester/assets/sample-skill/references/api-reference.md
Reza Rezvani 1851c8fb09 fix(plugins): restructure 9 multi-skill domain plugins into ./skills/ layout
Same root cause as #587/#591 — Claude Code's runtime loader rejects
array-form skills paths like ["./content-production", "./ai-seo", ...]
even when each entry is a valid subdirectory containing SKILL.md.
`claude plugin validate` accepts them but the loader does not.

The proven canonical layout (used by self-improving-agent in #536):

  <plugin>/
  ├── .claude-plugin/plugin.json    skills: "./skills"
  └── skills/
      ├── <skill-1>/SKILL.md
      ├── <skill-2>/SKILL.md
      └── ...

Restructured 9 multi-skill domain plugins:
- business-growth (4 skills moved)
- c-level-advisor (28)
- engineering (36)
- engineering-team (32)
- finance (2)
- marketing-skill (43)
- product-team (12)
- project-management (8)
- ra-qm-team (13)

Also fixed standalone plugins that had root SKILL.md + ./skills/ subdir
(agenthub, autoresearch-agent, executive-mentor, playwright-pro). The
loader rejected them despite skills="./skills" because of the conflicting
root SKILL.md (compare self-improving-agent which works because PR #536
moved its root SKILL.md). Moved each root SKILL.md into ./skills/<name>/.

Restored standalone plugin folders to their original paths after the
multi-skill restructure swept them into parent skills/ directories
(marketplace.json source paths require original locations).

Removed 7 orphaned marketplace entries that pointed to skill folders
without their own plugin.json (content-creator, demand-gen,
fullstack-engineer, aws-architect, product-manager, scrum-master,
skill-security-auditor) — these were already non-functional.

Bumped patch versions on every changed plugin and synced
marketplace.json. Marketplace now lists 29 working plugins (down
from 36).

After merge: users run `/plugin marketplace update claude-code-skills`
followed by `/plugin update --all` to pick up the working layout.
2026-05-02 22:51:20 +02:00

2.5 KiB

Text Processor API Reference

Classes

TextProcessor

Main class for text processing operations.

__init__(self, encoding: str = 'utf-8')

Initialize the text processor with specified encoding.

Parameters:

  • encoding (str): Character encoding for file operations. Default: 'utf-8'

analyze_text(self, text: str) -> Dict[str, Any]

Analyze text and return comprehensive statistics.

Parameters:

  • text (str): Text content to analyze

Returns:

  • dict: Statistics including word count, character count, lines, most frequent word

Example:

processor = TextProcessor()
stats = processor.analyze_text("Hello world")
# Returns: {'total_words': 2, 'unique_words': 2, ...}

transform_text(self, text: str, mode: str) -> str

Transform text according to specified mode.

Parameters:

  • text (str): Text to transform
  • mode (str): Transformation mode ('upper', 'lower', 'title', 'reverse')

Returns:

  • str: Transformed text

Raises:

  • ValueError: If mode is not supported

OutputFormatter

Static methods for output formatting.

format_json(data: Dict[str, Any]) -> str

Format data as JSON string.

format_human_readable(data: Dict[str, Any]) -> str

Format data as human-readable text.

FileManager

Handles file operations and batch processing.

find_text_files(self, directory: str) -> List[str]

Find all text files in a directory recursively.

Supported Extensions:

  • .txt
  • .md
  • .rst
  • .csv
  • .log

Command Line Interface

Commands

analyze

Analyze text file statistics.

python text_processor.py analyze <file> [options]

transform

Transform text file content.

python text_processor.py transform <file> --mode <mode> [options]

batch

Process multiple files in a directory.

python text_processor.py batch <directory> [options]

Global Options

  • --format {json,text}: Output format (default: text)
  • --output FILE: Output file path (default: stdout)
  • --encoding ENCODING: Text file encoding (default: utf-8)
  • --verbose: Enable verbose output

Error Handling

The text processor handles several error conditions:

  • FileNotFoundError: When input file doesn't exist
  • UnicodeDecodeError: When file encoding doesn't match specified encoding
  • PermissionError: When file access is denied
  • ValueError: When invalid transformation mode is specified

All errors are reported to stderr with descriptive messages.