/cold-md:cold-learnfrom cold-md
Reads FoxReach A/B test results, runs a two-proportion z-test on interested-reply rate, checks bounce/not-interested guards, and records the outcome. Updates beliefs and decisions on a winner, proposes a cold.md diff, and tells the user how to promote the winning variant.
Ships in cold-md. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Decides winner, inconclusive, or extend for the active experiment, under the trust ladder.
.cold/experiments/.active and .cold/experiments/<id>/protocol.md (design, step, variantIds or campaignIds, thresholds).cold/last-send.json (campaignId, sentAt, accountIds).cold/trust.json, .cold/config.json (guards.*, trust.*, experiments.autoAdvanceTier)cold.mdFOXREACH_API_KEYPATCH=.cold/proposed-diff.patch
PREV=$(jq -r '.coldMdHashAtPropose // empty' .cold/trust.json)
NOW=$(shasum -a 256 cold.md | awk '{print $1}')
if [ ! -f "$PATCH" ] && [ -n "$PREV" ]; then
if [ "$PREV" != "$NOW" ]; then F='.approvedDiffStreak += 1' # patch applied
else F='.approvedDiffStreak = 0'; fi # patch rejected
jq "$F | del(.coldMdHashAtPropose)" .cold/trust.json > .cold/trust.tmp && mv .cold/trust.tmp .cold/trust.json
fi
T=$(jq -r '.trust.autoCommitAfterApprovedStreak' .cold/config.json)
S=$(jq -r '.approvedDiffStreak' .cold/trust.json)
[ "$S" -ge "$T" ] && jq '.autoCommit = true' .cold/trust.json > .cold/trust.tmp && mv .cold/trust.tmp .cold/trust.json
A patch still on disk means the last proposal is pending: no streak change.
.active: "No active experiment. Run /cold experiment." Stop.variantIds.control or variantIds.variant null: "/cold send did not record the variant IDs. Run foxreach sequences variants list --campaign <id> --step <sequenceId> --json and add them to the protocol." Stop.now - sentAt below min_days_before_read: "Needs more days." Stop. Never pull stats early; peeking biases the read.Variant design (one campaign, variants on one step):
foxreach inbox categorize-stats --campaign "$CID" --step "$STEP" --group-by variant \
--from "$SENT_AT" --to "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --json \
> .cold/experiments/$ID/results.json
Two-campaign design: run it once per campaign in campaignIds, without --step and --group-by (the whole sequence is under test), and save both.
The CLI prints:
{ "groups": [
{ "key": "<variant id>", "sent": 0, "replied": 0, "interested": 0,
"not_interested": 0, "out_of_office": 0, "bounce": 0,
"unsubscribe": 0, "uncategorized": 0 }
] }
key is the variant ID (--group-by variant), or "all" when not grouped. Match keys to protocol.variantIds. A null key holds sends made before the variants existed; report its sent and leave it out of the test.replied excludes bounce, warmup and unrelated mail. bounce counts bounce notices that reached the inbox and were categorized as bounces.--from/--to, and only after they are categorized.Curl fallback (the response is wrapped in data):
curl -sS "https://api.foxreach.io/api/v1/inbox/categorize-stats?campaignId=$CID&sequenceStep=$STEP&groupBy=variant&fromDate=$SENT_AT&toDate=$NOW_ISO" \
-H "X-API-Key: $FOXREACH_API_KEY" | jq '.data'
uncategorized > 0 undercounts interested replies. Tell the user to run /cold triage and rerun /cold learn. Continue only if they say so, and note it in the decision.sent >= sample_size_per_arm. Short: extend (Step 7).Per arm: bounce_rate = bounce / sent, not_interested_rate = not_interested / sent. Also read foxreach accounts health <id> --json for each ID in last-send.json.accountIds and compute bounce7d.bounced / bounce7d.sent.
guards.bounceRateThreshold: the experiment is invalid. When guards.autoPauseOnGuardBreach is true, run foxreach campaigns pause "$CID". Variant weights cannot go below 1, so a breaching variant cannot be weighted to zero. With the campaign paused, offer to end the test with foxreach sequences variants delete <VARIANT_ID> --campaign "$CID" --step <sequenceId> --yes (deleting one of two variants deletes both, and the step goes back to its own subject and body, the control), or to fix the accounts. Append the breach to .cold/decisions.md. Propose no cold.md change. Stop.not_interested_rate above guards.notInterestedRateThreshold: warn and continue; the result is still informative.from math import sqrt, erf
def phi(x): return 0.5 * (1 + erf(x / sqrt(2)))
ra, rb = ia / na, ib / nb # interested / sent, a = control
p = (ia + ib) / (na + nb)
z = (rb - ra) / sqrt(p * (1 - p) * (1 / na + 1 / nb))
p_value = 2 * (1 - phi(abs(z)))
delta_pp = (rb - ra) * 100
se = sqrt(ra * (1 - ra) / na + rb * (1 - rb) / nb) * 100
ci = (delta_pp - 1.96 * se, delta_pp + 1.96 * se)
| Condition | Outcome |
|---|---|
abs(delta_pp) < min_delta_pp | inconclusive |
p_value >= significance_level | inconclusive |
| CI contains 0 | inconclusive |
| all three pass | winner = the arm with the higher interested rate |
Write .cold/experiments/<id>/decision.md with Status: inconclusive, the numbers per arm (sent, interested, rate), delta, p, CI, the reason, and the next move:
max_extensions is not used up: raise the sample by extension_step_pct. The campaign keeps sending to its remaining leads; if it has none left, bring more with /cold leads and add them with foxreach campaigns add-leads "$CID" --lead-ids <ids> (500 per call). Record the extension in the protocol and wait another min_days_before_read.decision.md: Status: winner, the winning arm, the numbers, the proposed cold.md edit, and the updated belief. Append to .cold/beliefs.md:
## Tier <N>: <variable>
- Pattern: <winning pattern>
- Lift: <delta_pp>pp interested-reply rate (95% CI [<lo>, <hi>], p=<p>)
- Sample: n=<na + nb>
- Source: <experiment id>, concluded <date>
Write the cold.md change as a unified diff to .cold/proposed-diff.patch and snapshot the hash:
jq --arg h "$(shasum -a 256 cold.md | awk '{print $1}')" '.coldMdHashAtPropose = $h' \
.cold/trust.json > .cold/trust.tmp && mv .cold/trust.tmp .cold/trust.json
Trust ladder. trust.autoCommit true: git apply .cold/proposed-diff.patch && rm .cold/proposed-diff.patch and log "applied automatically, streak ". Otherwise:
Proposed: .cold/proposed-diff.patch
Review: cat .cold/proposed-diff.patch
Accept: git apply .cold/proposed-diff.patch && rm .cold/proposed-diff.patch
Reject: rm .cold/proposed-diff.patch
Trust streak <s>/<autoCommitAfterApprovedStreak>.
Promote the winner in FoxReach. Variants can only change while the campaign is paused. Offer the two options and run the one the user picks (<SEQ> is protocol.sequenceId):
foxreach campaigns pause "$CID"
# Keep a small test running: winner weight 9, the other 1
foxreach sequences variants update <WINNER_ID> --campaign "$CID" --step <SEQ> --weight 9
foxreach sequences variants update <OTHER_ID> --campaign "$CID" --step <SEQ> --weight 1
# Or end the test: delete the variants (deleting one of two deletes both, and the step
# goes back to its own copy), then write the winning copy into the step
foxreach sequences variants delete <OTHER_ID> --campaign "$CID" --step <SEQ> --yes
foxreach sequences update --campaign "$CID" --sequence <SEQ> --subject "<winner subject>" --body "<winner body>"
foxreach campaigns resume "$CID"
If the protocol has no sequenceId (older runs), take it from foxreach sequences list --campaign "$CID" --json (the entry whose step_number is protocol.step). Guide: https://www.foxreach.io/docs/product/ab-testing. Two-campaign design: keep the winning setting for future campaigns; offer to pause the losing campaign.
On winner or a closed inconclusive: clear .cold/experiments/.active. If experiments.autoAdvanceTier is true, raise currentTier by 1. Append to .cold/decisions.md:
## <date>: tier <N> / <variable>
Experiment: <id>
Outcome: <winner = arm | inconclusive>
Numbers: <rb>% vs <ra>% interested (<delta>pp, p=<p>, CI [<lo>, <hi>])
Status: <pending review | applied automatically, streak <s>>
Next: <next tier or extension>
min_days_before_read.trust.autoCommit is false; write the patch..cold/experiments/<id>/results.json, decision.md.cold/beliefs.md, .cold/decisions.md (appended).cold/proposed-diff.patch (winner, trust not yet earned).cold/trust.jsonWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ab-testing, foxreach, experiment-analysis, statistical-testing
npx claudepluginhub foxreach/cold-md --plugin cold-md11 skills in this plugin
/cold-draftDraft cold email openers, bumps, breakups and replies from a cold.md file, write FoxReach-ready step templates (with {{variables}} and optional spin syntax) and experiment variants, and lint cold.md or drafts against the spec. Use when the user asks to write a cold email, sequence, bump, breakup, reply or objection response, runs `/cold draft`, `/cold bump`, `/cold breakup` or `/cold lint`, or when a cold.md file exists at the repo root. Enforces the cold.md spec (https://cold.md): banned phrases, voice rules, proof list, sequence constraints and audience disqualifiers./cold-experimentDesign the next A/B experiment in the cold.md loop. Reads the current tier, picks the one variable to test, writes the control and variant copy, sample size, guards and decision rule into a protocol under .cold/experiments/, and marks it active for /cold draft, /cold send and /cold learn. Use after /cold leads and before /cold draft, or when the user says "design the next experiment", "what should we test next", "set up the A/B" or runs /cold experiment./cold-icpBuild your Ideal Customer Profile (ICP) and write it to icp.md for the rest of the cold.md suite to consume. Use when the user says "build my ICP", "define my target audience", "who should I sell to", "analyze my website for ICP", or when starting a new cold outreach project. Can bootstrap from a URL (scrape homepage, about, pricing, case studies) or run an interactive Q&A. Validates the draft with web research and, when a FoxReach key is set, an optional free Lead Finder count. Writes a structured icp.md that cold-leads, cold-draft, and cold-send all read.Other plugins' skills for the same job