NAME

Wordsmith::Claude::Blog::Reviewer - AI-powered blog paragraph reviewer

SYNOPSIS

use Wordsmith::Claude::Blog::Reviewer;
use IO::Async::Loop;

my $loop = IO::Async::Loop->new;

my $reviewer = Wordsmith::Claude::Blog::Reviewer->new(
    text        => $blog_text,
    title       => 'My Blog Post',
    source_file => 'blog.md',  # For live progress saving
    loop        => $loop,

    on_paragraph => sub {
        my ($para, $analysis, $num, $total) = @_;
        print "Paragraph $num/$total\n";
        print "Analysis: $analysis\n";
        # Return decision hashref
        return { action => 'approve' };
    },

    on_progress => sub {
        my ($current, $total) = @_;
        print "Progress: $current/$total\n";
    },
);

my $result = $reviewer->review->get;
print $result->text;

DESCRIPTION

Reviews blog posts paragraph by paragraph, providing AI analysis of content validity and grammar quality. Supports:

  • Paragraph-by-paragraph review with AI analysis

  • Code block detection with specialized analysis

  • Multiple revision options (grammar, clarity, conciseness, etc.)

  • Live file updates for progress saving

  • Callback-based workflow for UI integration

CALLBACKS

on_paragraph

on_paragraph => sub {
    my ($paragraph, $analysis, $num, $total) = @_;
    # Return a decision hashref
    return { action => 'approve' };
    # Or: { action => 'revise', instructions => '...' }
    # Or: { action => 'replace', content => '...' }
    # Or: { action => 'skip' }
}

Called for each paragraph with the AI analysis. Must return a decision hashref.

on_progress

on_progress => sub {
    my ($current, $total) = @_;
}

Called after each paragraph is processed.

on_complete

on_complete => sub {
    my ($final_text) = @_;
}

Called when review is complete.

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)