reph

Templates · Engineering

Spike / investigation template

Time-boxed research with a question, findings and recommendation

Start with this template →Sign in

Opens on reph with the template ready to start. No account needed; sign in to keep your document.

Use it when

The team cannot decide or estimate until someone answers one narrow technical question inside a fixed time box

Who it's for

EngineerTech leadResearcher

Filled example

The template filled in for a made-up company, so you can see what good looks like.

Can we generate PDF invoices without a headless browser?

Author: Hana Ito · Date: 2026-09-17

Question

Can Copperleaf Labs render customer invoices as PDF, matching the current layout, without running headless Chromium in the billing service, at under 200 ms per invoice?

Time box

Three days. If no option met the bar by then, the plan was to recommend keeping Chromium but moving it into its own worker pool.

Background

The billing service runs headless Chromium to print invoices. It uses about 400 MB of memory per pod, causes most of our out-of-memory restarts, and blocks the move to smaller nodes planned for Q4. The platform team needs an answer before sizing those nodes on 1 October.

Approaches tried

Approach Result Evidence
pdf-lib, drawing the layout by hand Works, 35 ms per invoice, but 600 lines of positioning code Prototype branch spike/pdf-lib, benchmark of 1,000 invoices
React-PDF with our existing components Works, 120 ms per invoice, layout matches within 2 px Branch spike/react-pdf, visual diff of 50 real invoices
Typst via a WebAssembly build Fast (60 ms) but fonts and right-to-left text failed Branch spike/typst, 9 of 50 invoices rendered wrong
Chromium in a separate worker pool Works, unchanged output, still 400 MB per worker Load test notes, 2026-09-16

Findings

React-PDF reproduces the invoice layout closely, handles our three fonts and Arabic invoices correctly, and keeps memory under 90 MB per pod. pdf-lib is faster but every layout change would need hand-tuned coordinates, which finance requests about once a month. Typst is promising but not ready for right-to-left text. Moving Chromium to a worker pool solves the memory problem for the billing pods but adds a service to operate.

One dead end worth recording: React-PDF's default font loading fetches from the network on every render. Registering fonts once at startup cut render time from 480 ms to 120 ms.

Recommendation

Replace Chromium with React-PDF for invoices, reusing our existing invoice components. Remove Chromium from the billing image once the switch has run in production for two weeks.

Follow-up work

The template

Show the blank template

Spike / investigation

Author: [your name] · Date: [date]

Question

The specific question this spike answers, narrow enough to actually resolve in the time box, not "should we use X."

Time box

How long you gave this, and what you'd do if you ran out. That's part of the plan, not a failure state.

Background

Why this question matters now: the decision it unblocks.

Approaches tried

Approach Result Evidence

Findings

What you actually learned, including dead ends. A dead end saves the next person from repeating it.

Recommendation

What to do next, stated as a decision someone could act on today, not "more research is needed."

Follow-up work

Questions

How long should a spike take?
Usually one to five days; pick the box before you start and stop when it ends
What if the time box runs out?
Write up what you learned and recommend either a decision or one more narrower spike
Does spike code get merged?
Rarely. It is evidence, not production code, so throw it away or rewrite it properly

Fill it with your agent

Connect Claude to reph over MCP, then paste this. The draft arrives as suggestions you accept or reject section by section. How to connect Claude.

Find my reph doc "Spike / investigation" with search_docs, then read it with read_doc. Fill the approaches table, findings and recommendation from my prototype branch notes, benchmark output and the vendor docs or issue threads I paste. Tie every claim to evidence in the table and state the recommendation as a decision. File it with suggest_edit, one replace_section op per section (heading line kept) so each can be accepted alone. Ask each open question (findings that rest on one measurement) with add_comment quoting that section's heading line, then call request_review with a one-line summary.

Related templates

Start with this template →Sign in