Files
supermarket/internal/web/templates/signal.html
T
davidandClaude Opus 5.5 157902f7e2 Phase 2 part 4: discovery per signal (Claude web search, explee.com)
Each signal's page can search for organizations that show it, by hand or
every 7, 14 or 30 days. Claude with the web_search_20260209 server tool
(pause_turn resumed) works from the signal's "How to spot it" lines and
the profile's targets; a company is kept only if its evidence URL was
among the pages searched. explee.com's company search runs the signal's
description in the target sizes, scored against the hypothesis, keeping
strong matches. Our sites, the inventory, existing prospects, CRM
Accounts and suppressed domains are left out. New companies go to Review
tagged with the signal. Schema 8 adds discovery_runs (counts, searches,
why companies were left out) and the signal's schedule and explee.com
description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 18:27:35 -07:00

128 lines
8.2 KiB
HTML

{{define "content"}}{{with .Data}}{{$s := .S}}
<div class="heading">
<h1>{{if $s.ID}}{{$s.Name}} <span class="badge {{$s.Status}}">{{$s.Status}}</span>{{else}}New signal{{end}}</h1>
{{if $s.ID}}<div class="buttons">
<a class="button secondary" href="/prospects?status=new&amp;signal={{$s.ID}}">Its prospects{{if .Prospects}} ({{.Prospects}} new){{end}}</a>
<a class="button secondary" href="/prospects/new?signal={{$s.ID}}">Add a prospect for it</a>
</div>{{end}}
</div>
<p class="lede">A guess about why a company buys now, written so it can be tested: what you'll see, and what you expect them to do.</p>
{{if $s.ID}}
{{with .Total}}
<section class="card">
<h2>Funnel</h2>
<div class="funnel">
{{range .Cells}}<div class="step"><span class="label">{{stage .Stage}}</span><strong>{{.Count}}</strong>{{with .Rate}}<span class="rate">{{.}} of contacted</span>{{end}}</div>{{end}}
</div>
<p class="small">{{if .RevenueCents}}Revenue <strong>{{money .RevenueCents}}</strong>. {{end}}{{if .SpendCents}}Spend in outside tools <strong>{{money .SpendCents}}</strong>.{{end}}</p>
{{if $.Data.ByChannel}}
<table class="list scorecard">
<thead><tr><th>Channel</th>{{range $.Data.Stages}}<th class="num">{{.Label}}</th>{{end}}</tr></thead>
<tbody>{{range $.Data.ByChannel}}<tr><td>{{channel .Channel}}</td>{{range .Row.Cells}}<td class="num">{{if .Count}}{{.Count}}{{with .Rate}}<span class="rate">{{.}}</span>{{end}}{{else}}<span class="muted">·</span>{{end}}</td>{{end}}</tr>{{end}}</tbody>
</table>
{{else}}<p class="help">Nothing recorded for it yet: tag prospects with it, give it an origami.chat or explee.com campaign, or record outcomes in Review.</p>{{end}}
</section>
{{end}}
{{end}}
{{if $s.ID}}
<section class="card" id="discovery">
<h2>Find companies</h2>
<p>Supermarket searches for organizations that show this signal now and adds them to <a href="/prospects?status=new&amp;signal={{$s.ID}}">Review</a>, tagged with it. Nothing is contacted or sent to your CRM until you accept it.</p>
<div class="grid">
<div>
<h3>Claude, with web search</h3>
<p class="small">Up to {{.MaxSearch}} web searches from “How to spot it”, for up to {{.MaxResults}} companies. Each company comes with the page that shows the signal; any whose page wasn't among the search results is left out. Web searches are billed by Anthropic on top of the tokens.</p>
{{if .Research}}<p class="warn-text small">{{.Research}}</p>
{{else if not $s.SpotLines}}<p class="warn-text small">Fill in “How to spot it” below first.</p>
{{else}}<form method="post" action="/signals/{{$s.ID}}/discover/claude" data-busy="Starting…"><button type="submit" {{if .Running}}disabled{{end}}>Search the web now</button></form>{{end}}
</div>
<div>
<h3>explee.com company search</h3>
<p class="small">Companies that do what you describe below, in your target sizes, scored against the hypothesis; only strong matches are added. The first 10 results of a search are free on explee.com.</p>
{{if not .ExpleeKey}}<p class="small">Save an explee.com API key under <a href="/settings/sources">Settings → Lead sources</a> to use it.</p>
{{else if not $s.ExpleeDefinition}}<p class="small">Describe what the companies do, under “explee.com description” below.</p>
{{else}}<form method="post" action="/signals/{{$s.ID}}/discover/explee" data-busy="Starting…"><button type="submit" class="secondary" {{if .Running}}disabled{{end}}>Search explee.com now</button></form>{{end}}
</div>
</div>
{{template "runs" (dict "ID" $s.ID "Runs" .Runs "Running" .Running)}}
</section>
{{end}}
<form method="post" action="{{if $s.ID}}/signals/{{$s.ID}}{{else}}/signals/new{{end}}" class="card">
<div class="cols">
<label>Name <input name="name" value="{{$s.Name}}" required placeholder="Leaving Microsoft 365"></label>
<label>Status
<select name="status">{{range .Statuses}}<option value="{{.}}" {{if eq . $s.Status}}selected{{end}}>{{.}}</option>{{end}}</select>
<span class="help">Idea, testing, proven or retired. Retired signals stay on the scorecard for comparison.</span>
</label>
</div>
<label>Hypothesis <textarea name="hypothesis" rows="2" placeholder="Teams complaining about the Microsoft 365 price rise switch within a quarter.">{{$s.Hypothesis}}</textarea></label>
<label>How to spot it <textarea name="spot" rows="4" placeholder="One per line: search queries, keywords, origami.chat or explee.com criteria">{{$s.Spot}}</textarea>
<span class="help">Discovery (next) runs these as searches, so write them the way you'd search for the companies.</span></label>
<label>Angle <textarea name="angle" rows="3" placeholder="The pain, and what we promise about it">{{$s.Angle}}</textarea>
<span class="help">What emails, LinkedIn messages and content for this signal should say.</span></label>
<div class="cols">
<label>Search automatically
<select name="discover_every_days">{{range .EveryDays}}<option value="{{.}}" {{if eq . $s.DiscoverEveryDays}}selected{{end}}>{{if eq . 0}}Only when I ask{{else}}Every {{.}} days{{end}}</option>{{end}}</select>
<span class="help">Runs the searches above on a schedule, while the signal isn't retired. Each run costs web searches.</span>
</label>
<label>explee.com description <input name="explee_definition" value="{{$s.ExpleeDefinition}}" placeholder="e.g. law firm, managed IT services, nonprofit">
<span class="help">What the companies do, in a few words, for explee.com's company search.</span>
</label>
</div>
<label>Campaign tag <input name="slug" value="{{$s.Slug}}" placeholder="made from the name">
<span class="help">Used as <code>utm_campaign</code> on links for this signal, so visits and sign-ups are counted against it. Change it before using it, not after.</span></label>
<div class="actions">
<button type="submit">Save</button>
<a href="/signals">Back to signals</a>
</div>
</form>
{{if $s.ID}}
{{if .Campaigns}}
<h2>Campaigns testing it</h2>
<ul class="items">{{range .Campaigns}}<li class="item"><strong>{{.Name}}</strong> <span class="muted small">{{if eq .Source "origami"}}origami.chat{{else}}explee.com{{end}}{{with .Status}} · {{.}}{{end}}</span>
<div class="small">{{range $k, $v := .Stats}}{{if $v}}<span class="stat">{{$k}}: <strong>{{$v}}</strong></span> {{end}}{{end}}</div></li>{{end}}</ul>
{{end}}
{{if .Events}}
<h2>Latest steps</h2>
<table class="list">
<thead><tr><th>When</th><th>Step</th><th>Channel</th><th>Who</th><th>Note</th></tr></thead>
<tbody>{{range .Events}}<tr><td>{{ago .At}}</td><td>{{stage .Stage}}{{if .ValueCents}} · {{money .ValueCents}}{{end}}{{if gt .Count 1}} · {{.Count}}{{end}}</td><td>{{channel .Channel}}</td><td class="small">{{or .Email .Subject}}</td><td class="small">{{truncate 120 .Note}}</td></tr>{{end}}</tbody>
</table>
{{end}}
<form method="post" action="/signals/{{$s.ID}}/delete" data-confirm="Delete “{{$s.Name}}”? Its prospects, campaigns and results stay, without a signal." class="danger-zone">
<button type="submit" class="secondary small">Delete this signal</button>
</form>
{{end}}
{{end}}{{end}}
{{define "runs"}}
<div id="runs" {{if .Running}}hx-get="/signals/{{.ID}}/runs" hx-trigger="every 4s" hx-swap="outerHTML"{{end}}>
{{if .Runs}}
<table class="list runs">
<thead><tr><th>Started</th><th>Source</th><th>Result</th></tr></thead>
<tbody>
{{range .Runs}}
<tr>
<td>{{ago .StartedAt}}</td>
<td>{{if eq .Source "claude"}}Claude web search{{else}}explee.com{{end}}</td>
<td>
{{if eq .Status "running"}}<span class="badge scheduled">searching…</span>
{{else if eq .Status "failed"}}<span class="badge failed">failed</span> <span class="small">{{.Error}}</span>
{{else}}<strong>{{.Added}} new</strong>{{if .Existing}}, {{.Existing}} already in Review{{end}}{{if .Skipped}}, {{.Skipped}} left out{{end}} <span class="muted small">of {{.Found}} found</span>{{end}}
{{if .Searches}}<span class="muted small"> · {{.Searches}} {{if eq .Source "claude"}}web searches{{else}}search{{end}}</span>{{end}}
{{if .Notes}}<details class="small"><summary>Why some were left out</summary><ul>{{range .Notes}}<li>{{.}}</li>{{end}}</ul></details>{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
{{else}}<p class="help">No searches yet.</p>{{end}}
</div>
{{end}}