Skip to content

Work · Custom AI product · Author-coaching program

AI Book-Summary Writer

New authors stalled on the very first thing we asked them to write

A custom-built AI web app that interviews an author one question at a time and writes their structured book summary for them — turning a coach-assisted worksheet into a self-serve product.

  • Next.js
  • OpenAI
  • Vercel AI SDK
  • Product design
  • Role · sole designer & builder
  • 5 min
guided AI interview
1 sittingScope
paragraph paste-ready output
5→10Scope
designed, built, shipped
Custom appScope
System size
System flow · 5 stages · 20 components reconstructed from the build record

The situation

New authors joining the coaching program hit the same wall at the same moment. Before anything else, they had to write a structured summary of the book they wanted to write. It is the hardest task in the whole program and it comes first.

The existing tool for it was a worksheet. It asked for everything at once, on one page, and most people froze. Coaches ended up walking clients through it line by line on calls, which is expensive and does not scale past the number of hours in a week.

The ask was to turn that worksheet into a product. Something an author could open cold, sit down with once, and leave holding a finished summary they could paste straight into the main platform.

What was broken

  • The worksheet presented every question at once, which is exactly the blank-page problem it was meant to solve.
  • Coaching time went into walking each new author through the same form by hand, one call at a time.
  • Teaching books and memoirs need different questions and a different paragraph structure, and one worksheet served both badly.
  • An earlier assistant approach asked the book type as its first conversational question, spending a turn on it and leaving room for misclassification.
  • The output had no fixed shape, so what came out was not reliably pasteable into the main platform.
  • Nothing produced the structured version the coaching team needed on their side of the same conversation.

Constraints

  • The app had to feel native to the client's main product rather than like a separate tool bolted on.
  • The provider API key could never reach the browser, and the build had to succeed without it configured.
  • A ten-question interview is long enough that a refresh must not destroy it.
  • The output had to match the coaching worksheet exactly, because that is the artefact the coaches already knew how to use.
  • It shipped as a standalone deployment, so there was no existing backend to lean on.

FIG 01 · System Flow

How the system actually runs

Every component below is reconstructed from the project’s own build records. Nothing is added to make it look bigger.

components
20
components
stages
5
stages
decisions & guards
6
decisions & guards
AI
2
AI
human handoffs
0
human handoffs
platforms
4
platforms
  1. Stage 1, Entry & path: Welcome, the one branch that matters, and restoring an interrupted session.
    1. Welcome screen (Source, Next.js + React). A branded landing state with the product mark, a one-line description and a start action. Connects to Path selector when start.
    2. Session restore (Guard, Browser storage). A versioned saved session — path, messages, next id, timestamp — loaded and validated on mount; anything invalid clears the key and starts fresh. Connects to Chat thread when valid saved session; Welcome screen when no or invalid session.
    3. Path selector (Decision, React). A two-card chooser — teaching or topic book versus memoir or life story — styled after the main product book-type selector. Connects to Teaching question set when teaching or topic book; Memoir question set when memoir or life story.
  2. Stage 2, Guided interview: One question at a time through a fixed ordered set, with a follow-up on thin answers.
    1. Teaching question set (Workflow, System prompt branch). Ten ordered questions covering working title, subject, reader, problem, lessons, five topics with detail, differentiation, motivation, reader action and planned chapter count. Connects to One-question loop when prompt built.
    2. Memoir question set (Workflow, System prompt branch). Ten ordered questions covering working title, the life season, the shaping struggle, life before, five events with outcomes, the turning point, how it changed them, lessons, why share, and the reader takeaway. Connects to One-question loop when prompt built.
    3. One-question loop (AI, Vercel AI SDK + OpenAI). Hard rules in the prompt: ask exactly one question per message, never present a list or a checklist, never skip or merge, acknowledge only what the author actually said, and never invent a fact. Connects to Composer bar when question asked; Thin-answer follow-up when answer thin or incomplete; Self-check before emit when all ten answered.
    4. Thin-answer follow-up (Guard, System prompt rule). One short follow-up when an answer is vague, short, or misses part of the question — and warm acceptance with no second push when the author says they do not know. Connects to One-question loop when detail gathered.
    5. Composer bar (Capture, React). The author input surface, with a typing indicator and a running thread of their own answers. Connects to Chat server route when author answers.
    6. Chat thread (Workflow, React). Renders the conversation with the emitted output blocks stripped out of the visible messages, so the author sees prose and never a marker. Connects to Session restore when every turn persisted.
  3. Stage 3, Generation & streaming: One server route holds the whole AI surface, validates everything, and streams tokens back.
    1. Chat server route (API / service, Next.js route handler). The single AI endpoint. Validates that the body parses, that messages is a non-empty array of well-formed role and content pairs, and that the path is one of the two allowed values. Connects to Server-side key guard when body valid; Composer bar when malformed body, typed 400.
    2. Server-side key guard (Guard, Environment, server only). The provider key is read only inside the server route; when it is absent the route returns a typed unavailable response rather than failing the build or leaking the condition. Connects to Model call when key present; Composer bar when no key, typed 503.
    3. Model call (AI, Vercel AI SDK + OpenAI). Streaming text generation with a configurable model and a bounded maximum duration, built from the path-specific system prompt. Connects to Token stream when generation started.
    4. Token stream (Workflow, Text stream response). The response is returned as a plain text stream and consumed incrementally by the client. Connects to One-question loop when next question streamed; Sentinel block parser when blocks present in the stream.
    5. Self-check before emit (Guard, System prompt rule). Before emitting, the model counts its paragraphs and estimates length; if it is not exactly five paragraphs it merges or splits, and if it is under the length floor it expands the thinnest paragraphs from what the author already said. Connects to Sentinel block parser when exactly five paragraphs.
  4. Stage 4, Output & paste-out: Two blocks parsed out of one stream, an expansion offer, and copy-ready cards.
    1. Sentinel block parser (Workflow, React). The model wraps the finished summary and a separate internal production brief in paired sentinel markers; the client extracts the latest of each, strips both from the chat, and routes them to two different cards. Connects to Summary card when summary block; Internal brief card when brief block.
    2. Summary card (Outcome, React). The formatted five-paragraph summary with copy to clipboard, plus a live in-progress variant that fills its headings from answers as they arrive. Connects to Anything-else gate when summary rendered.
    3. Internal brief card (Report, React). A second card carrying the structured production brief verbatim, copied separately and handed to the coaching team. Connects to Done state when brief copied.
    4. Anything-else gate (Decision, React + prompt rule). Asked exactly once: anything to add? A yes triggers a faithful regeneration of both blocks with the addition and no invented facts. Connects to Done state when nothing to add; Model call when author adds something.
    5. Done state (Outcome, React). The terminal state: no more questions, a thank-you, and the finished artifacts left on screen.
  5. Stage 5, Platform: Branding, theming, persistence and deployment.
    1. Branding & deploy (Outcome, Next.js on Vercel). Brand context, a design brief and a design prompt written before the build; light and dark theming and a shared app shell make it read as part of the main product. Connects to Welcome screen when shared app shell and theme.
0/11

An author opens the tool from the main product and leaves with a summary they can paste straight back in.

Read this system as text
  1. Stage 01

    Entry & path

    Welcome, the one branch that matters, and restoring an interrupted session.

    • Welcome screen · Source · Next.js + React — A branded landing state with the product mark, a one-line description and a start action. → Path selector (start)
    • Session restore · Guard · Browser storage — A versioned saved session — path, messages, next id, timestamp — loaded and validated on mount; anything invalid clears the key and starts fresh. → Chat thread (valid saved session), Welcome screen (no or invalid session)
    • Path selector · Decision · React — A two-card chooser — teaching or topic book versus memoir or life story — styled after the main product book-type selector. → Teaching question set (teaching or topic book), Memoir question set (memoir or life story)
  2. Stage 02

    Guided interview

    One question at a time through a fixed ordered set, with a follow-up on thin answers.

    • Teaching question set · Workflow · System prompt branch — Ten ordered questions covering working title, subject, reader, problem, lessons, five topics with detail, differentiation, motivation, reader action and planned chapter count. → One-question loop (prompt built)
    • Memoir question set · Workflow · System prompt branch — Ten ordered questions covering working title, the life season, the shaping struggle, life before, five events with outcomes, the turning point, how it changed them, lessons, why share, and the reader takeaway. → One-question loop (prompt built)
    • One-question loop · AI · Vercel AI SDK + OpenAI — Hard rules in the prompt: ask exactly one question per message, never present a list or a checklist, never skip or merge, acknowledge only what the author actually said, and never invent a fact. → Composer bar (question asked), Thin-answer follow-up (answer thin or incomplete), Self-check before emit (all ten answered)
    • Thin-answer follow-up · Guard · System prompt rule — One short follow-up when an answer is vague, short, or misses part of the question — and warm acceptance with no second push when the author says they do not know. → One-question loop (detail gathered)
    • Composer bar · Capture · React — The author input surface, with a typing indicator and a running thread of their own answers. → Chat server route (author answers)
    • Chat thread · Workflow · React — Renders the conversation with the emitted output blocks stripped out of the visible messages, so the author sees prose and never a marker. → Session restore (every turn persisted)
  3. Stage 03

    Generation & streaming

    One server route holds the whole AI surface, validates everything, and streams tokens back.

    • Chat server route · API / service · Next.js route handler — The single AI endpoint. Validates that the body parses, that messages is a non-empty array of well-formed role and content pairs, and that the path is one of the two allowed values. → Server-side key guard (body valid), Composer bar (malformed body, typed 400)
    • Server-side key guard · Guard · Environment, server only — The provider key is read only inside the server route; when it is absent the route returns a typed unavailable response rather than failing the build or leaking the condition. → Model call (key present), Composer bar (no key, typed 503)
    • Model call · AI · Vercel AI SDK + OpenAI — Streaming text generation with a configurable model and a bounded maximum duration, built from the path-specific system prompt. → Token stream (generation started)
    • Token stream · Workflow · Text stream response — The response is returned as a plain text stream and consumed incrementally by the client. → One-question loop (next question streamed), Sentinel block parser (blocks present in the stream)
    • Self-check before emit · Guard · System prompt rule — Before emitting, the model counts its paragraphs and estimates length; if it is not exactly five paragraphs it merges or splits, and if it is under the length floor it expands the thinnest paragraphs from what the author already said. → Sentinel block parser (exactly five paragraphs)
  4. Stage 04

    Output & paste-out

    Two blocks parsed out of one stream, an expansion offer, and copy-ready cards.

    • Sentinel block parser · Workflow · React — The model wraps the finished summary and a separate internal production brief in paired sentinel markers; the client extracts the latest of each, strips both from the chat, and routes them to two different cards. → Summary card (summary block), Internal brief card (brief block)
    • Summary card · Outcome · React — The formatted five-paragraph summary with copy to clipboard, plus a live in-progress variant that fills its headings from answers as they arrive. → Anything-else gate (summary rendered)
    • Internal brief card · Report · React — A second card carrying the structured production brief verbatim, copied separately and handed to the coaching team. → Done state (brief copied)
    • Anything-else gate · Decision · React + prompt rule — Asked exactly once: anything to add? A yes triggers a faithful regeneration of both blocks with the addition and no invented facts. → Done state (nothing to add), Model call (author adds something)
    • Done state · Outcome · React — The terminal state: no more questions, a thank-you, and the finished artifacts left on screen.
  5. Stage 05

    Platform

    Branding, theming, persistence and deployment.

    • Branding & deploy · Outcome · Next.js on Vercel — Brand context, a design brief and a design prompt written before the build; light and dark theming and a shared app shell make it read as part of the main product. → Welcome screen (shared app shell and theme)

Platforms · Next.js · Vercel AI SDK · OpenAI · Vercel

What I built

The branch moved out of the conversation

The first design decision was the most useful one. The book-type choice became a two-card UI selector, styled after the main product's own book-type chooser, rather than the interviewer's opening question. That let the system prompt open by stating the type is already chosen and must not be asked. It bought back a turn and removed an entire class of misclassification.

Each path then carries its own ten ordered questions. The teaching set walks working title, subject, reader, problem, lessons, five topics with detail, differentiation, motivation, reader action and planned chapter count. The memoir set walks working title, the life season, the shaping struggle, life before, five events with outcomes, the turning point, how it changed them, lessons, why share, and the reader takeaway. A testimony is not a how-to, and the structure had to change with it.

The interviewer, and the discipline it enforces

The prompt carries hard rules: ask exactly one question per message, never present a list or a checklist, never skip or merge questions, acknowledge only what the author actually said, and never invent a fact. The whole product is the discipline of one question at a time, because a list is the worksheet that was already failing people.

One follow-up fires when an answer is vague, short, or misses part of the question. When the author says they do not know, the prompt requires warm acceptance and forbids a second push. The five-item question is where the longest paragraph comes from, so thin answers there produce a thin summary. That question is gathered a few items at a time and never as a numbered checklist.

One server route holding the whole AI surface

There is a single AI endpoint. It validates that the body parses, that messages is a non-empty array of well-formed role and content pairs, and that the path is one of the two allowed values. One route is the entire attack surface, so it validates everything before it spends a token.

The provider key is read only inside that route. When it is absent, the route returns a typed unavailable response instead of failing the build or leaking the condition. A misconfigured deploy becomes a clear, specific failure rather than a broken build.

A self-check the model must pass before it may emit

Before emitting, the model counts its own paragraphs and estimates length. If the draft is not exactly five paragraphs it merges or splits until it is. If it falls under the length floor it expands the thinnest paragraphs, drawing only on what the author already told it. Shortening the summary to make room for anything else is explicitly forbidden.

One stream, two audiences

The same response carries two things: the author's prose summary, and a structured internal production brief for the coaching team. Both are wrapped in paired sentinel markers. The client extracts the latest of each, strips both out of the visible chat, and routes them into two separately copyable cards. The author sees prose and never sees a marker. The team gets the structured version without a second pass.

Persistence, branding and delivery

The session is versioned and saved as the interview runs, then validated on load. Anything invalid clears the key and starts fresh. Brand context, a design brief and a design prompt were written before the build, and light and dark theming plus a shared app shell make it read as part of the main product rather than beside it. It deploys on Vercel with the key held server-side.

Edge cases and failure handling

  • A mid-interview refresh restores path, messages and position from the saved session rather than losing ten questions of work.
  • A saved session that fails validation on load clears itself and starts clean, instead of restoring a broken state.
  • Every storage read and write is wrapped, so private mode, a quota error, a disabled store or server-side rendering is a silent no-op rather than a crash.
  • A missing provider key returns a specific unavailable code from the route, so the deploy still builds and the failure is diagnosable.
  • A draft that comes back as three or seven paragraphs is merged or split to exactly five before it reaches the author.
  • A thin answer gets exactly one follow-up, and an author who says they do not know is never pushed twice.
  • The anything-else gate is asked once. A yes regenerates both blocks faithfully with the addition and no invented facts, rather than opening an endless loop.
  • Output markers are stripped from the chat thread, so the transport format never leaks into the reading experience.

How I verified it

The coaching worksheet was the specification. Both paragraph structures, both prose formulas and the expansion rules all derive from it, so verification meant checking the emitted artefact against the worksheet the coaches already used rather than against my own taste.

The interview was walked end to end on both paths, teaching and memoir, including the thin-answer follow-up and the do-not-know acceptance. The five-paragraph self-check was exercised against drafts that came back the wrong shape. Session restore was checked against a refresh mid-interview, and against a deliberately corrupted saved session. The missing-key path was verified to build and to return its typed unavailable response rather than a crash.

What changed

An author now goes from a blank page to a finished, paste-ready summary in one guided sitting. The output is five paragraphs, expandable to ten on request, in the exact structure the main platform expects.

Coaches are no longer walking every new client through the worksheet by hand. The same run also hands the coaching team their structured production brief, copied from its own card, which the worksheet never produced at all.

The client owns a real AI product rather than a workflow: a standalone Next.js app, designed, built and shipped, branded to sit inside the product they already sell.

Before / after

  • Before
  • ✕ New authors stalled at the first big task
  • ✕ The worksheet was manual and intimidating
  • ✕ Coaching time spent walking people through it by hand
  • After
  • ✓ Blank page to a paste-ready summary in one guided sitting
  • ✓ Coaches freed from walking every client through the worksheet
  • ✓ The client got a real AI product, not just a workflow

ScopeFigures on this page describe what was built, covered or verified — not a measured lift.

Have something close to this? Book a call. I’ll tell you if I’ve already built it.

One Manila business day to reply. All client work is under NDA; what you see here is redrawn architecture with real metrics.

Book