> **Sole engineer and product owner (personal product)** · July 2025 to present
> Source: https://www.simonbetton.com/case-studies/kiwicv.md (markdown only; there is no HTML page for this document).
> Index of case studies: https://www.simonbetton.com/case-studies/index.md

# Case study: KiwiCV

## Quick facts

|  |  |
| --- | --- |
| **Role** | Sole engineer and product owner, responsible for product design, application architecture, document rendering, AI workflows, account data and delivery |
| **Product** | KiwiCV: a free New Zealand CV builder with PDF and Word downloads; Pro adds rewriting, recommendations, job-tailored CVs, premium templates, cloud storage, job search and application tracking |
| **Commercial model** | Free builder without sign-up or a card; Pro priced at NZ$29 including GST, once; an initial allowance of 10 full rewrites with optional one-time packs |
| **Stack** | TypeScript, Bun, TanStack Start, React 19, Tailwind CSS, Convex, Better Auth, eve, Vercel AI SDK and AI Gateway, Stripe |
| **Document system** | Word templates, Docxtemplater, a custom Word reader and pagination layer, React PDF, PDF.js, CloudConvert and optional Google Vision OCR |
| **Structure** | Separate web, agent and Storybook applications; shared packages for UI, features, backend, documents, document processing, CV rewriting and LinkedIn retrieval |
| **Headline** | The person owns the career facts and accepts the final wording; the system checks evidence, permissions and revisions before applying an AI proposal |

## Overview

KiwiCV helps people turn their experience into a clear New Zealand CV and use it across a job search. A person can start from scratch, import a PDF or Word CV, or supply their LinkedIn profile URL. They edit structured sections beside a live document preview, choose a template, and download PDF and editable Word files without a watermark.

Pro adds an account workspace around that CV: a general rewrite, guided recommendations, versions tailored to selected jobs, a shared supporting-document library, premium templates, a CV catalogue and application tracking. Job search reads a stored catalogue of public LinkedIn listings. A saved application keeps its description, notes, stage and chosen CV together.

My design rests on two constraints. The document someone sees while editing should be the document they download. The experience described in that document must remain theirs. Those constraints reach through the rendering engine, extraction schemas, agent tools, account transactions and review interface.

## The problem

A CV has several audiences. The person writing it needs to recognise their own experience. An employer needs to understand it on a fast skim. Recruitment software needs a predictable reading order and extractable text. A useful builder has to serve all three without making the person learn document layout.

AI adds a separate failure mode. A fluent rewrite can quietly turn a responsibility into an achievement, a qualification into a completed degree, or a job requirement into a skill the person never supplied. Even a real number can become false when attached to the wrong result. A schema can validate the shape of that sentence without establishing its truth.

The product also has to preserve work across ordinary interruptions: an import taking several minutes, a rewrite waiting for clarification, a browser tab closing, two edits arriving at once, or a provider completing after a request is cancelled. These are account and workflow problems as much as model problems.

## Where I put the boundaries

I own the product from the first visit through to the document someone sends an employer. The architecture separates three kinds of work: editing and rendering a CV, running an AI proposal through review, and keeping account data consistent while both happen.

TanStack Start and React serve the web application. Convex holds account data and runs reactive queries, mutations and scheduled processing, with Better Auth supplying identity. The Pro agent runs in a separate eve application through typed tools and authored skills, using the Vercel AI Gateway for model access. Its authority ends at submitting a proposal. Applying that proposal belongs to an authenticated account mutation.

The package layout makes those responsibilities practical. `packages/documents` owns the template and rendering engine; `packages/document-processing` reads uploaded evidence; `packages/cv-rewrite` holds editorial contracts, validation and the agent extension. The rewrite package has no UI or account-storage dependency. `packages/features` connects the UI's service contracts to browser storage and the Convex backend, so I can exercise the same screens in Storybook with controlled loading, failure and review states.

```text
PDF / Word / LinkedIn / manual entry
                  |
          extract and review
                  |
         structured, editable CV
            /             \
     Word template      selected evidence + career direction
           |                          |
     filled document            Pro agent on eve
      /          \              assess → draft → verify
Word download   shared layout           |
                /       \         saved proposal
          live preview  PDF             |
                               compare / edit / accept
                                        |
                              versioned account CV
                                        |
                          job-tailored copies + applications
```

## Keeping the free builder complete

The free journey ends with a usable document. A person can import, edit, choose from four templates and download PDF and Word without creating an account. The browser keeps one Saved CV, and returning visitors can continue it. Pro adds five premium templates and the account workspace around the same editing experience.

I make cloud saving explicit. Signing in does not upload the device CV, and the account checks its import identity before offering to save it again, including when an existing copy is archived. That keeps account creation separate from the decision to store career information on the server.

The editor retains source material and review notes alongside structured experience, education, skills and achievements. Unmapped details remain available for review. The person can see what the import reads without having to accept every detail as part of their finished CV.

Premium templates are previewable with the person's own content. Applying one checks Pro access, and downloading checks again. That lets someone judge the actual document before upgrading while keeping access enforcement at the point where the file is produced.

## Making the preview and download agree

A CV builder asks someone to make layout decisions on screen. Those decisions are only useful if the downloaded document respects them. I use an actual Word file as each template, so its typography and paragraph styles have one source that I can edit in Word. Docxtemplater fills that file with the CV, and the editable download retains its fonts, links and semantic styles.

For the live preview and PDF, I use a custom reader and layout engine over the same filled file. The reader resolves Word's style inheritance, numbering, tables, margins, headers, footers and links. The layout layer measures and paginates that representation for the browser preview and React PDF. Both outputs share the page layout, and rendering runs in the browser.

The difficult details are the ones a person notices only when they are wrong. Word usually takes the larger of two adjacent paragraph-spacing values, and space before a paragraph behaves differently at the top of a page. A heading needs to stay beside its opening content. Keep-with-next must then stop at the last populated paragraph of a role or qualification, or several entries become one oversized group that refuses to break naturally.

The Signature template adds right-aligned dates, grouped skills, inline emphasis and a name-and-page footer after the first page. Imported emphasis remains valid only while the paragraph text is unchanged. Once the person edits it, the renderer stops using those character offsets; otherwise the bold words can drift away from the words they meant to emphasise.

I constrain templates to formatting the engine can support and recruitment software can read: real headings and lists, meaningful content in the document body, and generally one reading column. Tests fill every template with short, typical, long and awkward CVs, checking tags, formatting, page counts and retained content. Storybook puts the preview beside the generated PDF so I can inspect the result as a document.

Microsoft Word has its own renderer, with different kerning, hyphenation, bold metrics and paragraph splitting. KiwiCV's preview and PDF share pagination. The Word file carries the same content and template while remaining editable, with its final pagination determined by Word.

## Reading a CV without deciding what it ought to say

### Keeping parsing bounded

Import has one job: retain what the person supplies well enough for them to review it. The local readers preserve Markdown, extract PDF text with page markers, and read DOCX paragraphs, tables, headings, notes and links. Document content stays data; linked resources are not fetched or executed.

I put parsing in workers because an upload should not be able to occupy the server indefinitely. Each parser has a 15-second deadline, with two concurrent workers per process. Limits cover the uploaded file, PDF pages, extracted characters and expanded DOCX archive contents. A 20 MB file, 100 pages and 100,000 characters are the outer document limits. Files beyond those limits fail explicitly, because silently dropping the end of a CV would leave the person reviewing an incomplete career record.

### Reading the page as well as its text

Scans need visual reading, and page layout carries associations that plain text can lose. The visual path uses checkpointed Convex jobs: CloudConvert converts Word to PDF where needed and renders page images, then a model reads batches of four pages into Markdown. Page order, missing pages and the page limit are checked before interpretation.

Google Vision OCR is optional supporting input. I keep its raw output separate from the model transcription and retain page provenance and warnings about unreadable passages. If OCR fails, the model can still interpret the images. When visual processing is disabled, the local text readers remain available for text-bearing documents.

CV imports continue into structured extraction. Supporting documents stop at Markdown and provenance for the evidence library. Anonymous imports use a job capability in an HttpOnly cookie, with only its hash stored in Convex. Successful library uploads transfer into account ownership; temporary originals and intermediates expire within an hour, and jobs have a 20-minute processing deadline.

Retries need the same limits as the initial work. Each model stage permits a primary attempt and at most one backup for eligible provider or validation failures within its deadline. Cancellation, an expired deadline or a non-retryable authentication error cannot trigger another paid attempt. Worker leases prevent duplicate execution, and cancelled jobs reject late results. Hourly admission limits and a shared daily budget bound how much processing uploads can start.

### Preserving uncertainty in dates and facts

Extraction returns structured facts with source passages. The validator matches them against the source at word and number boundaries, allowing whitespace, Unicode normalisation and Markdown emphasis. Narrative fields may join complete source lines in order. A value that is absent from the source fails validation.

Dates need more than a string that happens to parse. I give them explicit forms: a calendar date with its original passage, an explicitly current end date, an unresolved passage, or no supplied date. A year-only source cannot acquire a month, and a missing end date cannot become “Present”. Reversed ranges keep both passages for review. This lets the Builder preserve uncertainty instead of converting it into a confident-looking date.

Source matching establishes consistency with the extracted text. It cannot establish that a model reads the page correctly or associates a date with the right role. That is why the person sees an import summary and review reminders even when the schema and evidence checks pass.

## Giving the agent room to write, with a defined place to stop

### Working from the person's edited CV

The current CV is the editorial source. I exclude the original import snapshot and unselected supporting documents from a rewrite, because removing a claim in the Builder should mean it stays removed. More context would be harmful if it lets the agent restore something the person deliberately corrected.

Selected supporting documents can add career evidence. A desired role or a job listing can guide emphasis. The distinction matters when a listing asks for a skill: the agent can ask whether the person has that experience, but the requirement itself supplies no evidence that they do.

The editorial guidance addresses the implications that make a fluent rewrite misleading. Routine duties do not establish measurable impact. A qualification name does not establish completion. Two facts appearing in the same CV do not establish a causal connection. Missing fields mean information is absent, not that the person lacks the experience. A strong CV can return no changes; the agent does not need to rewrite it to justify the call.

### Checking what code can check, then judging the wording

I restrict a proposal to named editorial sections. It cannot add unknown sections or repeat a section, and the application function leaves identity, employers, job headings, qualifications and dates intact. Numerical tokens must occur in the supplied evidence. Supporting-document citations must identify a selected document and a matching verbatim passage.

Those checks catch precise classes of error, but they cannot establish meaning. The number “20” can be present in the source and still be attached to the wrong achievement. The submit tool therefore asks an independent model to check the proposal against the CV, selected evidence and facts supplied during review. That check includes implied seniority, timing, causal claims and the explanations accompanying each edit.

A rejected verdict returns issues for correction without saving the proposal. A material question pauses for clarification. A verified draft becomes a proposal the person can review. The verifier itself has a bounded response, a 90-second timeout and no automatic SDK retries.

The verifier can miss an unsupported implication. I treat its verdict as one check before human review, with the deterministic restrictions still in force. The person sees the proposed wording and its evidence before deciding whether to use it.

### Making acceptance an account operation

Review shows each section's original and proposed wording, highlighted changes, explanations and source passages. Wide screens show the versions side by side; narrow screens interleave changes without horizontal scrolling. The person can edit a section, keep its original wording, change section order or request a targeted refinement.

A refinement can change only the selected sections. It merges into the existing proposal so manual edits elsewhere survive. Missing optional achievements become recommendations; a conflict that prevents a faithful draft becomes a focused question.

Acceptance needs to know exactly what the person is accepting. I check the proposal revision and the source CV revision together. If someone edits the CV in another tab while reviewing a rewrite, acceptance stops and preserves both versions. A general rewrite updates the same CV and snapshots its original. A job-tailored result becomes an independent copy, with its own versions and listing context.

## Keeping a run valid through interruptions

An agent request needs authority from the account that owns the work. Convex checks ownership, Pro access and allowance before creating an opaque run capability. The rewrite channel uses it to load the authoritative source from the server. Passing CV JSON or telling the model that an account has Pro cannot authorise that operation.

I bind callbacks to the capability, request identifier and expiry, and recheck access to Pro and the selected evidence. Cancellation and refinement rotate the capability. This matters when a provider is slow: a response from an obsolete attempt must not arrive later and replace the proposal someone is reviewing. Public run queries omit these credentials.

Source revisions, evidence selection, proposals, questions and progress live with the account, so closing a tab does not discard a run. The interface shows named stages and short public summaries of the editorial work. A stage without a summary remains a stage; it does not acquire an invented progress percentage.

The rewrite allowance follows delivery. A full generation reserves one unit atomically, then settles it once when a validated proposal is durably available. Failed work releases the reservation. Clarification can park without holding a unit and checks the balance again on resumption. This also handles two CVs starting at once: both requests use the same account balance, so they cannot spend the same remaining rewrite.

Targeted refinements, explanations and manual edits stay outside the full-rewrite count. Stripe checkout and webhook handling own purchases, with separate products for Pro access and rewrite packs. Fulfilment checks the account and purchase terms, and a ledger records grants and use. Keeping those products separate also means a dispute over a rewrite pack does not accidentally revoke an unrelated Pro purchase.

## Preserving the work around the CV

A person may use the same project notes or detailed work history across several applications. I keep those documents in one account-wide library, then make selection explicit for each rewrite. The library retains the original file, extracted Markdown and source name; the agent receives only the evidence selected for that operation.

Markdown notes have rich text and source editing. Autosave has to account for typing that continues while a request is in flight, so completing a save cannot replace newer local writing. Explicit saves keep immutable versions, restores preserve current work first, and concurrent edits are checked. PDF and Word extractions remain review-only with their originals available.

Removing evidence has a different meaning from deleting accepted work. A proposal that depends on a removed document needs its affected changes removed or regenerated. Accepted CVs and their versions stay intact. The person can change what evidence is available for future editing without altering the record of what they already accepted.

The same distinction shapes the CV catalogue: one main CV, independent copies for applications and an archive. Autosave maintains working content; creation, explicit saves and downloads keep versions. Application assignments point to owned CVs and show when an archived or deleted document needs replacing.

## Keeping job search independent of collection

Searching for a role should not require waiting for a scraper. I separate public listing collection from the person's search: background workers populate a shared Convex catalogue, and search reads that catalogue directly. Filters and pagination need no provider or model call, so existing listings remain searchable while collection is unavailable.

The main CV supplies editable defaults for titles and industry. Indexed filters cover location, industry, workplace and open status, with relevance-ordered pages of up to 20 jobs and bounded reads. Only public employer text and metadata enter the shared catalogue. CV content, identities and private notes stay with the account and out of provider requests.

Collection covers twelve selected role groups. The dispatcher runs every five minutes, with each group due six hours after a successful collection. A deployment-wide lease permits one provider run at a time. A worker consumes its lease once, which prevents duplicate scheduled delivery from starting duplicate paid requests; an expired worker cannot publish into a replacement run.

I reserve the maximum US$0.10 actor charge before each call against a persisted UTC-day budget, initially US$5. A timeout does not refund that reservation, because the provider may still be running and charging for the request. Time limits, response limits and bounded retries constrain the work as well as the requested charge. The budget caps requested actor charges; hosting and other provider costs sit outside it.

Each role group takes up to 100 recent results and records when it reaches that cap. That makes partial coverage visible. Collection retains original plain-text descriptions, with no AI rewriting or fabricated replacements for missing results.

Freshness also needs an explicit rule. A listing expires 30 days after its last verification or at an earlier supplied closing date. A confirmed closure hides it, but absence from a partial collection leaves its status unchanged. Search checks expiry itself, so a delayed cleanup job cannot keep an expired role visible.

## Keeping the application useful after a listing closes

The public catalogue answers what is available to search. A saved application needs to retain what the person actually considered. Saving therefore creates a private snapshot: its description, notes, stage and chosen CV survive public listing updates and expiry. The workspace offers Board and List views across Saved, Applied, Interviewing, Offer and Closed. Notes check concurrent edits and preserve local writing on failure; removing an application leaves its CV intact.

Tailoring accepts one to five confirmed listings, supplied as pasted text, LinkedIn URLs or both. Direct URL retrieval is a separate bounded provider operation, with pasted text available if retrieval fails. The person reviews the listing text before it guides a rewrite.

Several compatible listings can guide one CV. If they ask for materially different directions, the agent asks which to prioritise. I keep the same evidence and acceptance rules here as in the general rewrite: listings guide emphasis, supplied career facts support claims, and the reviewed result becomes a separate CV. Choosing a target role does not alter the person's main career record.

## Making support follow the same rules

As the product owner, I need enough context to understand a stalled run and recover it without damaging the person's work. The private administration workspace exposes account records, workflow stages, retained run history and rewrite accounting. Each privileged query and mutation checks the current verified account and active session on the backend.

Support changes require a reason and leave an audit record. CV edits and restores preserve versions, while document and application-note edits check for conflicts. Pro overrides are separate from payment state, and support views keep payment records read-only.

Recovery uses the workflow's existing rules. Stopping invalidates worker credentials and releases a reservation once. Retrying rechecks Pro access, source revision, selected evidence and allowance before issuing fresh credentials. A support action can recover generation, but applying the result still requires the person's acceptance.

The dashboard labels its counts as a recent-record window and lets me page through older retained runs. It does not imply lifetime totals. Device-only CVs remain outside that workspace because they are not account data.

## Testing the decisions that protect someone's work

I concentrate tests on failures that can leave a convincing interface around the wrong result: a date assigned invented precision, a citation to removed evidence, an edit overwritten by a late response, or two requests spending one remaining rewrite. The suite covers parser and source checks, document pagination, protected CV fields, proposal revisions, revoked access, callback recovery, concurrent reservations, duplicate payment events and saved-job retention.

Storybook uses the real compositions with controlled services for loading, errors, review and recovery, including support operations. Repository checks cover formatting, types, tests and production builds. CI also checks Convex generated files when its deployment credential is available.

The editorial evaluator uses synthetic examples of weak writing, strong technical writing, career change, graduates, sparse facts and embedded instructions. Tailoring adds compatible and conflicting listings. Each live case permits one drafting call and one independent judgement without retries. Reports retain rejected drafts as well as model identifiers, usage and the failing stage, so there is something concrete to inspect when the wording is wrong.

Extraction has separate date and visual corpora. I keep offline tests and live evaluation distinct: injected responses test orchestration and validation, while paid calls assess the configured model. Authenticated journeys, collection and Stripe checkout need connected checks of their own. Fixture counts are not passing evaluation scores, and I do not publish customer, interview or factual-accuracy rates for this product.

## Results

KiwiCV gives someone a complete path from an existing document or a blank CV to reviewed wording, PDF and editable Word downloads, and a record of their applications. The free builder works without an account. Pro adds the evidence library, cloud versions, AI review and job-search workspace around that same career record.

The most substantial pieces of my work are the document engine, where one Word template drives three outputs; the proposal and acceptance model, where AI editing cannot bypass review or overwrite a newer source; and the job catalogue, where browsing remains independent of provider calls. Each has tests around the failure conditions that shape its design.

## Technologies and standards

- Application: TypeScript, Bun, TanStack Start and Router, React 19, Tailwind CSS, Vite and Nitro.
- Data and identity: Convex database, file storage, reactive queries, mutations and scheduled functions; Better Auth; Stripe checkout and signed webhooks.
- AI: eve runtime and extension tools, authored editorial skills, Vercel AI SDK and AI Gateway, Zod contracts, independent verification calls.
- Documents: Word Open XML, Docxtemplater, PizZip, a custom style reader and pagination layer, React PDF, embedded fonts, semantic headings and lists.
- Import: PDF.js, bounded Node workers, CloudConvert page rendering, optional Google Vision OCR, structured source matching and date variants.
- Job data: bounded Apify adapters, a shared public Convex catalogue, private application snapshots and scheduled freshness checks.
- Verification: Bun tests, Convex test fixtures, Storybook, Testing Library, Playwright, synthetic model evaluations, Ultracite, native TypeScript checking and GitHub Actions.
