DUNIN7 · LOOMWORKS · RECORD
record.dunin7.com
Status Current
Path change-requests/loomworks-example-generator-cr-v0_1.md

Loomworks Example Generator — change request — v0.1

Version. 0.1 Date. 2026-06-07 Status. Build specification for the marketing-site Example Generator. Scope is fixed by loomworks-example-generator-scoping-note-v0_2 (all seven decisions Operator-confirmed). Technical consumer: Claude Code on DUNIN7-M4. Markdown primary. Render-type. Change request. CC-facing. Source. loomworks-example-generator-scoping-note-v0_2; loomworks-example-generator-investigation-v0_1; loomworks-api-glossary-v0_3; CC recon of DUNIN7/foray-kaspathon (Business Analyzer) and DUNIN7/foray-protocol.


Plain-language summary

Build a page on the Loomworks marketing site where a prospect types a few sentences about their own work and gets back an HTML "here's how Loomworks would help you" page. Behind it, a Cloudflare Worker makes two AI calls — first it maps their work into Loomworks's vocabulary, then it generates a tailored illustration grounded in that mapping. The AI is grounded in the glossary so it uses the terms correctly. Nothing real is created, nothing is saved, and the API key lives only in the Worker — never in the browser. Seven example chips, spanning very different kinds of work (including an architecture decision record for developers), let a visitor start with one tap.


What is built

A static page on loomworks-marketing (Cloudflare Pages) plus a Cloudflare Worker, same-origin, that exposes two AI endpoints. The page gathers a short seed-spine input, the Worker runs a two-step chained Anthropic call grounded in the glossary, and the page renders the resulting HTML. Ephemeral — no persistence, no engine, no engagement.

Hard constraints (non-negotiable)

D1 — Input (seed-spine fields)

Three required short fields plus one optional, each with a worked placeholder:

Keep it to these. This is a teaser, not an induction.

D2 — The seven example chips

Each chip, when tapped, pre-fills the D1 fields with a short worked seed for that domain. Chip text adapts the glossary's worked examples. The seven, with their pre-fill seeds:

  1. Legal matter — work: Building the case record for Acme v. Beta, a breach-of-contract dispute. / for: The litigation team and outside counsel. / done: A complete, citable case record ready for filing. / constraints: Every fact tied to its exhibit or ruling.
  2. Clinical-trial protocol — work: Drafting the protocol for a Phase II trial of a new therapy. / for: The research team, the IRB, and the regulator. / done: An approved protocol with every criterion justified. / constraints: Inclusion/exclusion criteria must be defensible.
  3. Research synthesis — work: Synthesizing the evidence on a treatment's effect at 12 weeks. / for: A systematic-review panel. / done: A defensible synthesis, every claim sourced. / constraints: Retracted sources must be flagged and excluded.
  4. Product specification — work: Specifying a new authentication system for our app. / for: The engineering and PM teams. / done: A spec engineers can build from without ambiguity. / constraints: Security requirements are hard rules, not suggestions.
  5. Regulatory filing — work: Preparing our quarterly disclosure to the regulator. / for: The compliance team and the regulator. / done: A filing approved by the compliance lead. / constraints: Nothing filed without the compliance lead's approval.
  6. Documentary — work: Building the factual and continuity record for a feature documentary. / for: The director, editors, and fact-checkers. / done: A locked record the edit can rely on. / constraints: Every claim on screen must be sourced and cleared.
  7. Architecture decision record (ADR) — work: Keeping the record of why our system is built the way it is. / for: Current and future engineers on the team. / done: Any engineer can find why a decision was made, what it was weighed against, and what later changed it. / constraints: When a decision is reversed, the original and the reversal both stay visible.

The ADR chip's seed leads on the "why did we decide this" hook deliberately — it is the software chip and should land the recall-and-provenance point.

D3 — The grounding system prompt

A single system-prompt constant in the Worker, grounding the model in Loomworks's vocabulary, drawn from the glossary. It must teach:

Draft the exact prompt text against loomworks-api-glossary-v0_3 and surface it in the handoff for review before first use. Embed it as a constant (no runtime glossary fetch).

The two-step chain (D7 — both at launch)

Call 1 — Analyze. User turn: the four D1 fields. The model returns clean <h3>-sectioned HTML mapping the prospect's work into Loomworks, with these five sections (D4):

  1. <h3>Your work in Loomworks</h3> — the engagement framing
  2. <h3>What its Memory would hold</h3> — assertions, provenance, kinds of contribution
  3. <h3>Organizing and arranging it</h3> — Manifestation → Shaping for their readers
  4. <h3>What you'd produce</h3> — Rendering: the artifact or the spec
  5. <h3>Why this helps</h3> — recall, provenance, governed approval, in their terms

Call 2 — Illustrate. User turn: the original D1 fields plus the HTML analysis from Call 1. Instruct the model to generate a concrete worked illustration for this prospect's domain, citing its own prior analysis — a sample engagement showing what its Memory would hold (a few example assertions), what a Manifestation of it looks like, who Shaping would frame it for, and what Rendering would produce. Vary it; do not template it. Return sectioned HTML.

This chaining (the FORAY Business Analyzer pattern) is what makes the output bespoke. Both calls ship at launch.

D4 — Output rendering

D5 — Wiring (Cloudflare Worker, same-origin)

Rate-limiting (the one item the scoping note left for the CR to specify)

This is a public, unauthenticated endpoint spending API credits — it must not be open to abuse. Implement at least:

Surface the chosen limits in the handoff; the Operator confirms the numbers.

Build sequence

  1. Scaffold the page in loomworks-marketing — the D1 fields, the seven chips, the results region, the copy/download/print affordances. Static, no AI yet.
  2. Stand up the Worker with the two endpoints, the system-prompt constant (drafted from the glossary), the model string, body/length caps, and the rate-limiting. Key as a secret.
  3. Wire the page to the Worker; implement the two-step chain client-side (Call 1, hold its HTML, Call 2 with that HTML appended).
  4. Test end-to-end against each of the seven chips and a free-typed input; confirm the key never appears in any client asset or network response; confirm rate-limiting fires.
  5. Confirm always-on behavior (the Worker serves with the M4 off — it is edge-hosted, not tunneled).

Acceptance

Out of scope

Handoff must report


DUNIN7 — Done In Seven LLC — Miami, Florida Loomworks Example Generator — change request — v0.1 — 2026-06-07