Implementation Spike Plan
Status: Proposed next step
Date: 2026-04-16
Goal
Build the smallest real implementation that proves Brainforge can turn existing markdown source assets into fixed-layout branded PDFs that are recognizably aligned with the current Sales Assets Figma system.
This spike is not trying to solve every document shape. It should answer one question cleanly:
Can Brainforge render its first one-pager, service two-pager, comparison page, and proof-oriented case study from repo content without needing a designer to manually recompose the output in Figma?
Recommendation
Use a narrow Spike 1 implementation inside apps/platform.
Why this is the best first move:
- the Platform already contains the closest distribution surface (
/marketing-assets) - the repo is already Node and Next.js based
- no separate service is needed until rendering volume, reliability, or deployment ergonomics make it necessary
- it keeps the first feedback loop short for Platform, GTM, and Design
Recommended shape:
fixture markdown -> typed adapter -> fixed-layout HTML component tree -> server-side Chromium PDF render -> artifact review
Proposed Spike Scope
In scope
- One real one-pager fixture.
- One real two-page service fixture.
- One real comparison-style fixture.
- One real case-study fixture.
- A small typed document model.
- A small reusable print component set.
- HTML output and PDF export.
- Side-by-side review against selected Figma benchmark families.
Out of scope
- Arbitrary markdown support.
- WYSIWYG editing.
- Automatic publish to
brainforge-files. - Full case-study template family beyond one selected proof-oriented case study.
- Background jobs, queueing, or bulk generation.
- Generalized metadata/catalog integration in the Platform UI.
Fixture To Benchmark Mapping
Fixture A: Insurance workflow automation one-pager
Source:
knowledge/sales/agents/service-assets/insurance-workflow-automation-one-pager.md
Closest benchmark family:
General Services - V1 - Mar 2025
Why:
- shared one-page story arc
- strong hero + stats + services/benefits + CTA shape
- similar need for a prominent transformation narrative at the top of the page
Fixture B: Insurance broker lead intake two-pager
Source:
knowledge/sales/marketing-assets/design-ready-copy/insurance-broker-lead-intake-2pager.md
Closest benchmark family:
- Page 1:
Service Offerings - V1 - Mar 2026 - Page 2:
Event Data Modeling - Page 2 - Optional supporting pattern:
FAQs (1/2)andFAQs (2/2)for stacked information density and explicit page ownership
Why:
- page 1 wants hero, proof, KPI, and capability rhythm
- page 2 wants more structured content blocks and explicit bottom-of-page ownership
- the source copy is already canonical two-pager copy, so it is the best first pagination test
Fixture C: LMNT BI tool recommendation comparison asset
Source:
knowledge/clients/lmnt/resources/lmnt_bi_tool_recommendation.md
Closest benchmark family:
- primary:
Pricing Page - V1 - May 2025 - supporting density pattern:
Event Data Modeling - Page 2
Why:
- the document already contains an executive recommendation, decision criteria, and a comparison matrix
- the core visual problem is side-by-side platform evaluation rather than narrative storytelling
- the pricing/comparison family is the closest existing print system match for a structured comparison asset
Fixture D: Amazon BI analytics case study
Source:
knowledge/sales/marketing-assets/case-studies/Amazon_BI_Analytics_CaseStudy.md
Closest benchmark family:
- page 1 benchmark:
General Services - V1 - Mar 2025 - page 2 benchmark:
Service Offerings - V1 - Mar 2026
Why:
- it has clean frontmatter, explicit
Context / Challenge / Solution / Resultssections, and a compact metrics story - it introduces proof-oriented composition, at-a-glance metadata, and tool/team callouts without requiring a fully generalized case-study system
- it is more implementation-ready than looser case-study markdown because the section boundaries are already stable
Minimum Component Inventory
The first spike should support only the components needed for the four chosen fixtures.
Page shell
PrintPagePageContentFrameBrandStripFooterPageNumber
Shared header and footer
HeroHeaderTrustedByRowCtaBannerContactFooter
Content blocks
MetricCardsBenefitGridCapabilityListAudienceBlockTimelineStepsProofHighlightProcessStepsComparisonMatrixRecommendationCalloutResultsTableAtGlancePanelTeamAndToolsStrip
Page-2 oriented structured blocks
SectionIntroThreeColumnOfferGridRoadmapStepsFaqStack
Proposed Document Model
The first model should be typed and explicit, but narrow.
type AssetDocument = {
documentType: 'one-pager' | 'two-pager' | 'comparison' | 'case-study'
title: string
subtitle?: string
pages: AssetPage[]
contactBlock?: ContactBlock
}
type AssetPage = {
pageType:
| 'general-one-pager'
| 'service-page-1'
| 'service-page-2'
| 'comparison-page'
| 'case-study-page-1'
| 'case-study-page-2'
sections: AssetSection[]
}
type AssetSection =
| HeroSection
| TrustedBySection
| MetricSection
| BenefitsSection
| ProcessSection
| CapabilitySection
| AudienceSection
| ProofSection
| CtaSection
| ComparisonSection
| ResultsSection
| AtGlanceSectionImplementation rule:
- do not parse directly from arbitrary headings into generic blocks
- write one adapter per fixture/archetype
- let the adapter decide which sections land on which page
Adapter Strategy
The adapters should be handwritten for the first spike.
Adapter 1
- Input:
insurance-workflow-automation-one-pager.md - Output:
AssetDocumentwithpageType = general-one-pager
Expected mapping:
Top Section: Visual Storytelling→HeroSection+MetricSectionValue Proposition→ short narrative block inside hero or intro sectionBenefits→BenefitGridAudience→AudienceBlockWhat's Included→CapabilityListProcess/Timeline→TimelineStepsSuccess Metrics→ProofHighlightor secondary metrics rowCall to Action+Footer→CtaSection+ContactFooter
Adapter 2
- Input:
insurance-broker-lead-intake-2pager.md - Output:
AssetDocumentwithservice-page-1andservice-page-2
Expected mapping:
Header→HeroHeaderTrusted by→TrustedByRowKPI / metric highlight→MetricCardsorProofHighlightProcess→ProcessStepsMenu of capabilities→CapabilityListorThreeColumnOfferGridWho this is for + Deliverables→AudienceBlock+ structured deliverables blockCase study highlight→ProofHighlightCTA+Follow-up / Let's talk→CtaBanner+ContactFooter
Page ownership rule:
- page 1 should carry hero, trust/proof, KPI, and process
- page 2 should carry capability density, audience/deliverables, proof, and CTA/footer
Adapter 3
- Input:
lmnt_bi_tool_recommendation.md - Output:
AssetDocumentwithpageType = comparison-page
Expected mapping:
Executive Summary→HeroSection+RecommendationCalloutWhy a March Omni Trial→ short narrative block or intro sectionPilot Scope+Success Criteria→ compact capability / checklist sectionBI Platform Comparison Matrix→ComparisonMatrixOther Tools Considered→ secondary comparison or exclusion notes blockRecommended BI Architecture→ structured recommendation stack + CTA/footer
Implementation rule:
- keep the comparison table curated and typed; do not attempt generic markdown table support in Spike 1
Adapter 4
- Input:
Amazon_BI_Analytics_CaseStudy.md - Output:
AssetDocumentwithcase-study-page-1andcase-study-page-2
Expected mapping:
- frontmatter metrics →
MetricSection Context+Challenge→ page 1 narrative structureSolution→ primary proof/content section with tool referencesResults→ResultsTable+ proof bandProject Details→AtGlancePanel+TeamAndToolsStrip
Page ownership rule:
- page 1 should establish context, challenge, and the core solution story
- page 2 should carry results, metadata, team/tools callouts, and the closing proof/CTA treatment
Proposed Repo Shape
This should start as a server-only module inside apps/platform.
Suggested directory shape:
apps/platform/src/lib/marketingAssetPipeline/
adapters/
insuranceWorkflowAutomation.ts
insuranceBrokerLeadIntake.ts
lmntBiToolRecommendation.ts
amazonBiAnalyticsCaseStudy.ts
components/
print/
render/
renderAssetHtml.ts
renderAssetPdf.ts
templates/
generalOnePager.tsx
serviceTwoPager.tsx
types.tsWhy this shape:
- keeps the spike isolated from the existing asset browser
- allows server-only rendering code without polluting the client UI layer
- preserves a path to later move rendering into a job or separate service if needed
Rendering Approach
HTML
Render fixed-layout HTML first.
Requirements:
- explicit page container sized to the Figma system
- deterministic inner content frame
- no responsive behavior inside the print template
- all spacing controlled through the template system, not markdown defaults
Use server-side Chromium rendering first.
Preferred first implementation decision:
- start with a Chromium-based renderer in app code
- keep the abstraction behind
renderAssetPdf()so the engine can later swap to Gotenberg if needed
The important evaluation point is not the exact package name. It is whether Brainforge can keep the rendering engine behind a small boundary while preserving HTML-first templates.
Verification Plan
The spike should be evaluated against both implementation and design criteria.
Functional checks
- The adapter produces a stable typed document model.
- The HTML renders consistently on repeat runs.
- The PDF export preserves page count and content order.
- Page 2 content does not overflow or rely on accidental browser flow.
- Comparison rows remain readable and visually consistent without manual column tuning in Figma.
- Case-study metadata and results blocks feel intentionally composed, not bolted onto a generic service template.
Figma fidelity checks
- Header band feels visually equivalent to the selected benchmark family.
- Metric block density matches the benchmark rather than looking like a web dashboard.
- Footer and brand strip placement feel deliberate and consistent.
- Two-page output has explicit page ownership, not arbitrary page breaks.
- Overall section rhythm looks like a Brainforge leave-behind, not a printed webpage.
- Comparison assets read like a Brainforge recommendation memo rather than a raw exported table.
- Case-study assets preserve proof density without losing readability.
Operational checks
- The spike can run locally from
apps/platformwithout standing up another service. - The rendering boundary is narrow enough to move later if needed.
- Template code is understandable by a Platform engineer without designer-specific tooling.
Exit Criteria
Spike 1 is successful if all of the following are true:
- The one-pager fixture can be generated from repo source copy with only adapter logic and no hand-editing in the template.
- The two-pager fixture can be generated with explicit page ownership and no broken pagination.
- The comparison fixture can be generated with a stable, typed matrix and a clear recommendation stack.
- The case-study fixture can be generated with proof, results, and metadata blocks that still feel native to the print system.
- Design review says the output is close enough to the Figma family that iteration can continue in code rather than returning to manual export.
- The team still believes
apps/platformis a reasonable home for the next increment.
Decisions To Make After Spike 1
- Whether to keep rendering inside
apps/platformor move it behind a service boundary. - Whether publishing should also emit HTML preview artifacts alongside PDFs.
- Whether the section schema is stable enough to formalize across more archetypes.
- Whether advanced paged-media tooling is necessary for multi-page quality.
- Whether the next template family should deepen comparison/case-study coverage or move into FAQ-specific pagination.
Last updated: 2026-04-16