FLOW MASON

Build this pipeline yourself

Open in the interactive wizard to customize and export

Open in Wizard
08

Book Chapter Editor

Comprehensive AI-powered editing producing 3 polished versions with analysis

advanced Creative AI

Components Used

generator json_transform logger

The Problem

Authors need professional editing, but:

  • Human editors are expensive - $500-2000+ per chapter
  • Turnaround is slow - Days or weeks per round
  • Single perspective - One editor, one style
  • No comparison - Hard to evaluate different approaches

What if you could get multiple professional-quality edits instantly, with detailed analysis and comparison?

Pain Points We’re Solving

  • Cost barrier - Professional editing priced out of reach
  • Iteration time - Weeks between revision rounds
  • Style lock-in - Committed to one editor’s vision
  • No metrics - No objective way to compare versions

Thinking Process

Let’s design a multi-version editing pipeline:

flowchart TB
    subgraph Analysis["1. Understand the Text"]
        A1["Word count"]
        A2["Reading level"]
        A3["Complexity metrics"]
    end

    subgraph Critique["2. Deep Critique"]
        C1["Strengths"]
        C2["Weaknesses"]
        C3["Priority fixes"]
    end

    subgraph Versions["3. Generate Versions"]
        V1["V1: Refined<br/>Technical fixes"]
        V2["V2: Enhanced<br/>Emotional impact"]
        V3["V3: Humanized<br/>Natural flow"]
    end

    subgraph Compare["4. Compare"]
        CO1["Stats per version"]
        CO2["Notes per version"]
        CO3["Side-by-side"]
    end

    Analysis --> Critique --> Versions --> Compare

Three Editing Philosophies

quadrantChart
    title Editing Approaches
    x-axis Conservative --> Transformative
    y-axis Technical --> Creative

    quadrant-1 Enhanced Edit
    quadrant-2 Humanized Edit
    quadrant-3 Refined Edit
    quadrant-4 Experimental

    V1-Refined: [0.3, 0.7]
    V2-Enhanced: [0.6, 0.6]
    V3-Humanized: [0.7, 0.3]
VersionPhilosophyTemperature
RefinedFix issues, preserve voice0.6
EnhancedStrengthen impact, better pacing0.7
HumanizedNatural prose, authentic dialogue0.75

Solution Architecture

flowchart TB
    subgraph Input["📥 Chapter Input"]
        I1["chapter_content<br/>(1500+ words)"]
        I2["genre"]
        I3["target_audience"]
        I4["style_notes"]
        I5["focus_areas"]
    end

    subgraph Analysis["📊 Analysis Phase"]
        AN1["Analyze Original"]
        AN2["Parse Statistics"]
    end

    subgraph Critique["🔍 Critique Phase"]
        CR1["Deep Editorial Critique"]
        CR2["20+ year editor persona"]
    end

    subgraph Parallel["⚡ Parallel Version Generation"]
        direction LR
        subgraph V1["Version 1"]
            V1A["Refined Edit<br/>temp: 0.6"]
            V1B["Notes"]
            V1C["Stats"]
        end
        subgraph V2["Version 2"]
            V2A["Enhanced Edit<br/>temp: 0.7"]
            V2B["Notes"]
            V2C["Stats"]
        end
        subgraph V3["Version 3"]
            V3A["Humanized Edit<br/>temp: 0.75"]
            V3B["Notes"]
            V3C["Stats"]
        end
    end

    subgraph Output["📤 Final Output"]
        O1["original_statistics"]
        O2["critique"]
        O3["versions[3]"]
        O4["comparison"]
    end

    Input --> Analysis --> Critique
    Critique --> V1A & V2A & V3A
    V1A --> V1B --> V1C
    V2A --> V2B --> V2C
    V3A --> V3B --> V3C
    V1C & V2C & V3C --> Output

Pipeline Stages

Stage 1: Analyze Original Text

Extract objective metrics:

{
  "id": "analyze-original",
  "component": "generator",
  "config": {
    "system_prompt": "You are a text analysis expert. Return JSON only with exact metrics.",
    "prompt": "Analyze this text and return JSON:\n\n{{input.chapter_content}}\n\nReturn: {\"word_count\": N, \"sentence_count\": N, \"paragraph_count\": N, \"avg_sentence_length\": N, \"flesch_kincaid_grade\": N, \"reading_difficulty\": \"easy|moderate|challenging\"}",
    "temperature": 0.1,
    "max_tokens": 500
  }
}

Stage 2: Deep Editorial Critique

The foundation for all edits:

{
  "id": "critique",
  "component": "generator",
  "depends_on": ["analyze-original"],
  "config": {
    "system_prompt": "You are a senior book editor with 20+ years of experience in {{input.genre}} fiction. Provide brutally honest, constructive critique.",
    "prompt": "Critique this {{input.genre}} chapter for {{input.target_audience}}:\n\n{{input.chapter_content}}\n\nAuthor style notes: {{input.author_style_notes}}\nFocus areas: {{input.focus_areas}}\n\nProvide:\n1. Overall impression (2-3 sentences)\n2. Top 3-5 strengths with specific examples\n3. Top 3-5 areas for improvement\n4. Structural observations\n5. 5-10 line-level issues with quotes\n6. Priority fixes (top 3 most impactful changes)",
    "temperature": 0.4,
    "max_tokens": 2000
  }
}

Stages 3-5: Parallel Version Generation

All three versions generate simultaneously:

sequenceDiagram
    participant C as Critique
    participant V1 as Version 1
    participant V2 as Version 2
    participant V3 as Version 3

    C->>V1: Critique complete
    C->>V2: Critique complete
    C->>V3: Critique complete

    par Parallel Generation
        V1->>V1: Refined Edit (0.6)
        V2->>V2: Enhanced Edit (0.7)
        V3->>V3: Humanized Edit (0.75)
    end

    Note over V1,V3: ~10 seconds total (not 30)

Version 1: Refined Edit

{
  "id": "version-1-refined",
  "component": "generator",
  "depends_on": ["critique"],
  "config": {
    "system_prompt": "You are a precise, surgical editor. Fix issues while preserving the author's voice.",
    "prompt": "Edit this chapter based on the critique:\n\nOriginal:\n{{input.chapter_content}}\n\nCritique:\n{{stages.critique.output.text}}\n\nInstructions:\n- Fix grammatical and structural issues\n- Tighten prose (remove redundancy)\n- Preserve author's voice and style\n- Make minimal but impactful changes\n\nReturn the complete edited chapter.",
    "temperature": 0.6,
    "max_tokens": 4000
  }
}

Version 2: Enhanced Edit

{
  "id": "version-2-enhanced",
  "component": "generator",
  "depends_on": ["critique"],
  "config": {
    "system_prompt": "You are a developmental editor focused on emotional impact and reader engagement.",
    "prompt": "Edit this chapter to enhance emotional impact:\n\nOriginal:\n{{input.chapter_content}}\n\nCritique:\n{{stages.critique.output.text}}\n\nInstructions:\n- Strengthen emotional resonance\n- Improve pacing and tension\n- Add vivid sensory details\n- Sharpen dialogue\n- Show don't tell\n- Enhance transitions\n\nReturn the complete edited chapter.",
    "temperature": 0.7,
    "max_tokens": 4000
  }
}

Version 3: Humanized Edit

{
  "id": "version-3-humanized",
  "component": "generator",
  "depends_on": ["critique"],
  "config": {
    "system_prompt": "You are an editor specializing in authentic, natural prose that reads like it was written by a skilled human author.",
    "prompt": "Edit this chapter for natural, authentic prose:\n\nOriginal:\n{{input.chapter_content}}\n\nCritique:\n{{stages.critique.output.text}}\n\nInstructions:\n- Make prose flow naturally\n- Create realistic, distinct dialogue\n- Add subtle human touches\n- Remove anything that feels \"AI-written\"\n- Publication-ready quality\n\nReturn the complete edited chapter.",
    "temperature": 0.75,
    "max_tokens": 4000
  }
}

Stages 6-8: Generate Editorial Notes (Parallel)

{
  "id": "notes-v1",
  "component": "generator",
  "depends_on": ["version-1-refined"],
  "config": {
    "system_prompt": "Summarize editing changes concisely.",
    "prompt": "Compare original to edited and list key changes:\n\nOriginal excerpt:\n{{input.chapter_content | truncate(500)}}\n\nEdited:\n{{stages.version-1-refined.output.text | truncate(500)}}\n\nProvide: 1) Summary of approach 2) Key changes made 3) What was preserved 4) Best for: [audience type]",
    "temperature": 0.3,
    "max_tokens": 400
  }
}

Final Stage: Compile Output

{
  "id": "compile-output",
  "component": "json_transform",
  "depends_on": ["stats-v1", "stats-v2", "stats-v3", "notes-v1", "notes-v2", "notes-v3"],
  "config": {
    "data": {
      "original_stats": "{{stages.parse-original-stats.output}}",
      "critique": "{{stages.critique.output.text}}",
      "v1": { "content": "{{stages.version-1-refined.output.text}}", "notes": "{{stages.notes-v1.output.text}}", "stats": "{{stages.stats-v1.output}}" },
      "v2": { "content": "{{stages.version-2-enhanced.output.text}}", "notes": "{{stages.notes-v2.output.text}}", "stats": "{{stages.stats-v2.output}}" },
      "v3": { "content": "{{stages.version-3-humanized.output.text}}", "notes": "{{stages.notes-v3.output.text}}", "stats": "{{stages.stats-v3.output}}" }
    },
    "expression": "{chapter_title: '{{input.chapter_title}}', genre: '{{input.genre}}', original_statistics: original_stats, editorial_critique: critique, versions: [{version: `1`, name: 'Refined Edit', description: 'Technical fixes, preserved voice', content: v1.content, notes: v1.notes, statistics: v1.stats}, {version: `2`, name: 'Enhanced Edit', description: 'Emotional impact, better pacing', content: v2.content, notes: v2.notes, statistics: v2.stats}, {version: `3`, name: 'Humanized & Polished', description: 'Natural prose, publication-ready', content: v3.content, notes: v3.notes, statistics: v3.stats}]}"
  }
}

Pipeline Execution Timeline

gantt
    title Book Editor Pipeline Execution
    dateFormat s
    axisFormat %S sec

    section Analysis
    Analyze Original    :a1, 0, 3s
    Parse Stats        :a2, after a1, 1s

    section Critique
    Deep Critique      :c1, after a2, 8s

    section Version 1
    Refined Edit       :v1, after c1, 10s
    V1 Notes          :n1, after v1, 3s
    V1 Stats          :s1, after v1, 2s

    section Version 2
    Enhanced Edit      :v2, after c1, 10s
    V2 Notes          :n2, after v2, 3s
    V2 Stats          :s2, after v2, 2s

    section Version 3
    Humanized Edit     :v3, after c1, 10s
    V3 Notes          :n3, after v3, 3s
    V3 Stats          :s3, after v3, 2s

    section Output
    Compile           :out, after s1 s2 s3, 1s

Total time: ~25 seconds (vs 3x longer if sequential)

Sample Input

{
  "chapter_title": "The Weight of Silence",
  "genre": "literary",
  "target_audience": "adult readers who enjoy character-driven literary fiction",
  "author_style_notes": "Prefer understated prose, subtle emotional beats, avoid melodrama",
  "focus_areas": ["pacing", "dialogue", "emotional resonance", "sensory details", "subtext"],
  "chapter_content": "The kitchen still smelled of coffee when Eleanor found the photograph..."
}

Expected Output Structure

{
  "chapter_title": "The Weight of Silence",
  "genre": "literary",
  "original_statistics": {
    "word_count": 1547,
    "sentence_count": 89,
    "flesch_kincaid_grade": 8.2,
    "reading_difficulty": "moderate"
  },
  "editorial_critique": "This chapter establishes a contemplative tone...",
  "versions": [
    {
      "version": 1,
      "name": "Refined Edit",
      "description": "Technical fixes, preserved voice",
      "content": "[Full edited chapter]",
      "notes": "Made surgical edits focusing on...",
      "statistics": { "word_count": 1523, "reading_difficulty": "moderate" }
    },
    {
      "version": 2,
      "name": "Enhanced Edit",
      "description": "Emotional impact, better pacing",
      "content": "[Full edited chapter]",
      "notes": "Strengthened the emotional arc by...",
      "statistics": { "word_count": 1612, "reading_difficulty": "moderate" }
    },
    {
      "version": 3,
      "name": "Humanized & Polished",
      "description": "Natural prose, publication-ready",
      "content": "[Full edited chapter]",
      "notes": "Focused on natural rhythm and...",
      "statistics": { "word_count": 1589, "reading_difficulty": "moderate" }
    }
  ]
}

Key Learnings

1. Critique-Driven Editing

The critique stage informs all three versions, ensuring consistency:

flowchart TD
    C["Critique"] --> V1["Version 1"]
    C --> V2["Version 2"]
    C --> V3["Version 3"]

2. Temperature Ladder

VersionTempEffect
Refined0.6Conservative, precise
Enhanced0.7Balanced creativity
Humanized0.75More natural variation

3. Parallel Efficiency

8 AI calls execute in 3 waves instead of 8 sequential calls.

Try It Yourself

fm run pipelines/08-book-chapter-editor.pipeline.json \
  --input inputs/08-book-chapter.json