NAME
Wordsmith::Claude - AI-powered text rewriting with style
VERSION
Version 0.01
SYNOPSIS
use Wordsmith::Claude qw(rewrite question);
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
# Simple mode-based rewriting
my $result = rewrite(
text => "The quantum entanglement phenomenon demonstrates non-local correlations",
mode => 'eli5',
loop => $loop,
)->get;
print $result->text;
# "It's like having two magic coins that always match, even far apart!"
# Different tones
my $formal = rewrite(text => $casual_message, mode => 'formal', loop => $loop)->get;
my $casual = rewrite(text => $business_email, mode => 'casual', loop => $loop)->get;
# Fun styles
my $pirate = rewrite(text => $boring, mode => 'pirate', loop => $loop)->get;
my $shakespeare = rewrite(text => $modern, mode => 'shakespeare', loop => $loop)->get;
# Custom instructions
my $custom = rewrite(
text => $text,
instruction => "Rewrite as a nature documentary narrator",
loop => $loop,
)->get;
# Multiple variations
my $result = rewrite(
text => $text,
mode => 'casual',
variations => 3,
loop => $loop,
)->get;
print $_->text for $result->all_variations;
# Ask questions about text
my $answer = question(
text => $essay,
question => "What is the main argument?",
loop => $loop,
)->get;
print $answer->text;
# Ask general questions (no context)
my $answer = question(
question => "What is the capital of France?",
loop => $loop,
)->get;
# Parallel requests (non-blocking)
my $f1 = rewrite(text => $text1, mode => 'eli5', loop => $loop);
my $f2 = rewrite(text => $text2, mode => 'formal', loop => $loop);
my $f3 = question(question => "What is 2+2?", loop => $loop);
# Wait for all to complete
use Future;
my @results = Future->needs_all($f1, $f2, $f3)->get;
DESCRIPTION
Wordsmith::Claude is an AI-powered text rewriting tool built on the Claude Agent SDK. It can transform text into different styles, tones, and complexity levels.
BUILT-IN MODES
Complexity
eli5- Explain Like I'm 5 (very simple)eli10- Explain Like I'm 10 (simple but more detail)technical- Add technical precision and jargon
Tone
formal- Professional, business-appropriatecasual- Relaxed, conversationalfriendly- Warm and approachableprofessional- Polished and authoritative
Length/Format
concise- Trim to essentialsexpand- Add detail and explanationbullets- Convert to bullet pointssummarize- Brief summary
Fun Styles
pirate- Arr, talk like a pirate!shakespeare- Forsooth, in the Bard's tongueyoda- Speak like Yoda, you willcorporate- Synergize the paradigm shiftvalley- Like, totally rewrite it
Utility
proofread- Fix grammar and spelling
EXPORTED FUNCTIONS
rewrite
my $result = rewrite(
text => $input_text, # Required
mode => 'eli5', # Built-in mode (optional)
instruction => 'custom prompt', # Custom instruction (optional)
variations => 3, # Number of variations (default 1)
options => $options_obj, # Wordsmith::Claude::Options (optional)
loop => $loop, # IO::Async::Loop (optional)
)->get;
Rewrite text using a mode or custom instruction. Returns a Future that resolves to a Wordsmith::Claude::Result object.
Either mode or instruction must be provided.
question
my $result = question(
question => "What is the capital of France?", # Required
text => $context_text, # Optional context
options => $options_obj, # Optional
loop => $loop, # Optional
)->get;
# With context
my $result = question(
text => $essay,
question => "What is the main argument?",
loop => $loop,
)->get;
print $result->text; # The answer
Ask a question, optionally about provided text context. Returns a Future that resolves to a Wordsmith::Claude::Result object.
SEE ALSO
Claude::Agent - The underlying Claude Agent SDK
Wordsmith::Claude::Options - Configuration options
Wordsmith::Claude::Result - Result object
Wordsmith::Claude::Mode - Built-in mode definitions
AUTHOR
LNATION, <email at lnation.org>
LICENSE AND COPYRIGHT
This software is Copyright (c) 2026 by LNATION.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)