Public: anyone can read this; the crew can change it.
README opens with a five-minute tour a realtor can follow in the meeting #13
Check · Review · Land · Live done — Landed and live in production.
mason/speed-to-lead:mason/10-readme-opens-with-a-five-minute-tour-a-r → main 2 commits fork 4 threads · 4 unresolved
2 files
changed +102
−0
README.md +41
| @@ -10,6 +10,47 @@ reply already written for you, and keeps following up for a month until | ||
| 10 | 10 | the person is qualified or gone. **You approve every message before it |
| 11 | 11 | goes.** |
| 12 | 12 | |
| 13 | ## A five-minute tour | |
| 14 | ||
| 15 | For the sales meeting. The names below are the sample leads on the desk. | |
| 16 | ||
| 17 | Before you start: Press "Sign in" on the desk. Anyone signed in can read | |
| 18 | and answer leads (steps 2 to 6). Restarting the samples (step 1) and saving | |
| 19 | your profile (step 7) need an admin; if you are not one, ask the person who | |
| 20 | runs the app to do step 1 just before the meeting, and read step 7 aloud. | |
| 21 | ||
| 22 | The clocks keep running while the app sits idle, so the colours below are only | |
outdated
"waited over five hours" and the red clock go stale. Tie them to a fresh restart or drop the numbers. |
||
| 23 | what you see right after a restart. Do step 1 first. | |
| 24 | ||
| 25 | 1. Restart the samples. At the bottom of the desk, press "Restart the | |
| 26 | sample leads from now" (admin). The twelve sample leads are laid out | |
| 27 | again with fresh clocks. | |
| 28 | 2. Read the desk. The newest leads are at the top. **Maria Gonzalez** and | |
| 29 | **David Chen** have just asked, so their clocks are green, under five | |
| 30 | minutes; they turn amber at five. Above the list, your response record | |
| 31 | says how fast you have been lately. | |
| 32 | 3. Answer a red lead. **Tom Becker** has waited hours, so his clock is | |
| 33 | red. Tap his name: his question is on one side, the reply already | |
| 34 | written for him on the other. Press "Approve and send". His clock stops | |
| 35 | and shows how long he waited. | |
| 36 | 4. Change the words first. Open **Lena Novak**, another red lead. Press | |
| 37 | "Edit", change a sentence in the text box, then approve and send it. | |
| 38 | 5. See who may be texted. **David Chen** carries an "Email only" badge: he | |
outdated
Admin-only steps (profile save, and restart) need to be flagged up front, with how to sign in. Move the restart to the start of the tour. |
||
| 39 | never agreed to be texted. Open him and see that his drafted reply is an | |
| 40 | email, not a text. **Maria Gonzalez** says "Text OK", so hers is a text. | |
| 41 | 6. See the follow-up plan. Open **Marcus Lee**, who has been answered. | |
| 42 | Below the conversation sit his follow-ups for day 1, 3, 7, 14 and 30: | |
| 43 | the ones already gone, and the ones still to come. When a day arrives, | |
| 44 | the follow-up shows on the desk, ready for you to approve. Then open | |
| 45 | **Ethan Brooks** and press "Mark qualified": he leaves the follow-up plan. | |
| 46 | 7. Set your profile (admin to save). Press "Your profile" at the top, fill | |
| 47 | in your name, brokerage, license number, phone and email, and save. Every | |
| 48 | draft not yet sent takes it at once. | |
| 49 | ||
| 50 | Nothing is really sent in this prototype: "send" records the message in the | |
| 51 | lead's history and goes no further. To run the tour again, restart the | |
| 52 | samples (step 1). | |
| 53 | ||
| 13 | 54 | ## How it works |
| 14 | 55 | |
| 15 | 56 | **The desk** (the first screen) lists your leads, newest first. Each row |
src/readme.test.ts added +61
| @@ -0,0 +1,61 @@ | ||
| 1 | import { expect, test } from "bun:test"; | |
| 2 | import { readFileSync } from "node:fs"; | |
| 3 | import { SAMPLES } from "./sample.ts"; | |
| 4 | ||
| 5 | const readme = readFileSync(new URL("../README.md", import.meta.url), "utf8"); | |
| 6 | const tour = readme.split(/^## /m).find((s) => s.startsWith("A five-minute tour")) ?? ""; | |
| 7 | const steps = tour.split(/^\d+\. /m).slice(1); | |
| 8 | const lead = (name: string) => SAMPLES.find((s) => s.name === name)!; | |
| 9 | const says = (name: string, phrase: string) => | |
| 10 | steps.some((s) => s.includes(name) && s.includes(phrase)); | |
| 11 | ||
| 12 | const MIN = 60_000; | |
| 13 | const HOUR = 60 * MIN; | |
| 14 | ||
| 15 | test("the README opens with a tour, ahead of the technical sections", () => { | |
| 16 | expect(tour).not.toBe(""); | |
outdated
Does not check any claim about the sample data (age, colour, consent). Add assertions that fail if the README misdescribes a lead; drop the verb-prefix regex in favour of an explicit match against SAMPLES. |
||
| 17 | expect(readme.indexOf("## A five-minute tour")).toBeLessThan(readme.indexOf("## How it works")); | |
| 18 | expect(readme.indexOf("## A five-minute tour")).toBeLessThan(readme.indexOf("## For whoever connects")); | |
| 19 | }); | |
| 20 | ||
| 21 | test("the tour starts with a restart, and says who can sign in and who is an admin", () => { | |
| 22 | expect(steps[0]).toContain("Restart the samples"); | |
| 23 | expect(tour).toContain("Sign in"); | |
| 24 | expect(tour).toContain("admin"); | |
| 25 | expect(tour).toContain("right after a restart"); | |
| 26 | }); | |
| 27 | ||
| 28 | test("every name in bold is a sample lead", () => { | |
| 29 | const known = new Set(SAMPLES.map((s) => s.name)); | |
| 30 | const bold = [...tour.matchAll(/\*\*([^*]+)\*\*/g)].map((m) => m[1]!); | |
| 31 | expect(bold.length).toBeGreaterThanOrEqual(6); | |
| 32 | for (const name of bold) expect(known.has(name), name).toBe(true); | |
| 33 | }); | |
| 34 | ||
| 35 | test("what the tour says about each lead is what the samples hold", () => { | |
| 36 | for (const name of ["Maria Gonzalez", "David Chen"]) { | |
| 37 | expect(lead(name).ago, name).toBeLessThan(5 * MIN); | |
| 38 | expect(lead(name).answeredIn, name).toBeUndefined(); | |
| 39 | expect(says(name, "green")).toBe(true); | |
| 40 | } | |
| 41 | for (const name of ["Tom Becker", "Lena Novak"]) { | |
| 42 | expect(lead(name).ago, name).toBeGreaterThan(HOUR); | |
| 43 | expect(lead(name).answeredIn, name).toBeUndefined(); | |
| 44 | expect(says(name, "red")).toBe(true); | |
| 45 | } | |
| 46 | expect(lead("David Chen").consent).toBe(false); | |
| 47 | expect(says("David Chen", "Email only")).toBe(true); | |
| 48 | expect(lead("Maria Gonzalez").consent).toBe(true); | |
| 49 | expect(says("Maria Gonzalez", "Text OK")).toBe(true); | |
| 50 | const marcus = lead("Marcus Lee"); | |
| 51 | expect(marcus.answeredIn).toBeDefined(); | |
| 52 | expect(marcus.closed).toBeUndefined(); | |
| 53 | expect(marcus.touched!.length).toBeLessThan(5); | |
| 54 | const ethan = lead("Ethan Brooks"); | |
| 55 | expect(ethan.answeredIn).toBeDefined(); | |
| 56 | expect(ethan.closed).toBeUndefined(); | |
| 57 | }); | |
| 58 | ||
| 59 | test("the tour has no jargon", () => { | |
| 60 | for (const word of ["API", "JSON", "SQLite", "MCP"]) expect(tour.includes(word), word).toBe(false); | |
| 61 | }); |
new above
offline
Only true right after a restart; the samples are seeded once. Make restart the first step and say this.