@sellable/mcp 0.1.80 → 0.1.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/agents/post-find-leads-filter-scout.md +19 -8
  2. package/agents/post-find-leads-message-scout.md +21 -6
  3. package/agents/registry.json +33 -18
  4. package/agents/source-scout-linkedin-engagement.md +10 -2
  5. package/agents/source-scout-prospeo-contact.md +9 -2
  6. package/agents/source-scout-sales-nav.md +10 -2
  7. package/dist/server.js +7 -1
  8. package/dist/tools/bootstrap.js +2 -2
  9. package/dist/tools/campaigns.d.ts +12 -0
  10. package/dist/tools/campaigns.js +40 -5
  11. package/dist/tools/context.d.ts +10 -4
  12. package/dist/tools/context.js +8 -4
  13. package/dist/tools/leads.d.ts +6 -3
  14. package/dist/tools/leads.js +39 -43
  15. package/dist/tools/navigation.d.ts +28 -1
  16. package/dist/tools/navigation.js +220 -10
  17. package/dist/tools/prompts.js +1 -1
  18. package/dist/tools/provider-preflight.js +2 -3
  19. package/dist/tools/readiness.d.ts +31 -6
  20. package/dist/tools/readiness.js +6 -1
  21. package/dist/tools/rubrics.d.ts +2 -0
  22. package/dist/tools/rubrics.js +2 -0
  23. package/package.json +1 -1
  24. package/skills/create-campaign/SKILL.md +24 -12
  25. package/skills/create-campaign-v2/SKILL.md +166 -114
  26. package/skills/create-campaign-v2/SOUL.md +19 -11
  27. package/skills/create-campaign-v2/core/auto-execute.yaml +14 -13
  28. package/skills/create-campaign-v2/core/flow.v2.json +964 -310
  29. package/skills/create-campaign-v2/references/approval-gate-framing.md +64 -32
  30. package/skills/create-campaign-v2/references/filter-leads.md +8 -0
  31. package/skills/create-campaign-v2/references/final-handoff-contract.md +55 -20
  32. package/skills/create-campaign-v2/references/lead-validation-preview.md +30 -17
  33. package/skills/create-campaign-v2/references/step-13-import-leads.md +62 -17
  34. package/skills/create-campaign-v2/references/validation-criteria.md +10 -5
  35. package/skills/create-campaign-v2/references/watch-link-handoff.md +72 -72
  36. package/skills/create-campaign-v2-tail/SKILL.md +123 -92
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: create-campaign-v2
3
- description: Execute the JSON-gated from-scratch campaign flow: create the brief, validate chained Phase 84 artifacts, then atomically mint a live campaign after explicit user approval at the commit gate.
3
+ description: Execute the JSON-gated shell-first campaign flow with chained Phase 84 artifacts: create a watchable campaign shell with a v1 brief, attach the source with campaignId, import the first 10-row review batch, save rubrics and approved message template, then queue the review cascade and hand off to settings/sequence/start.
4
4
  visibility: internal
5
5
  ---
6
6
 
@@ -9,40 +9,47 @@ visibility: internal
9
9
  <role>
10
10
  You are the create-campaign-v2 orchestrator. Your job is to execute the
11
11
  configured `core/flow.v2.json` state machine from scratch: (1) interview the
12
- user and create `brief.md`, (2) validate the chained Phase 84 draft artifacts,
13
- (3) run a message-review gate, show the user an approval packet and commit
14
- gate, and (4) if the user
15
- approves, atomically mint a real `CampaignOffer` and hand off to the bounded
16
- review-batch tail (Plan 85-02).
12
+ user, resolve sender/company context, and create a watchable campaign shell
13
+ with the v1 brief already attached, (2) use that campaign id for source
14
+ selection, (3) import/confirm the first 10-row review batch to establish
15
+ `workflowTableId`, (4) create rubrics and message artifacts from that campaign
16
+ table sample, (5) sync the approved message set into the campaign brief, and
17
+ (6) queue/observe the bounded cascade before settings, sequence, and start.
17
18
  </role>
18
19
 
19
20
  <objective>
20
21
  Run the configured JSON flow in durable stages:
21
22
 
22
- 0. create-campaign-brief
23
- 1. find leads
24
- 2. filter leads
25
- 3. generate message
26
- 4. message review gate
27
- 5. approval packet + commit gate
28
- 6. atomic mint
29
- 7. review-batch tail to `awaiting-user-greenlight`
23
+ 0. identity/source intake + watchable campaign shell with v1 brief
24
+ 1. create-campaign-brief
25
+ 2. find leads with the campaign id
26
+ 3. import/confirm the first 10-row review batch
27
+ 4. filter leads from the campaign table sample
28
+ 5. generate message from the same campaign table sample
29
+ 6. message review gate
30
+ 7. sync approved message set into the campaign brief
31
+ 8. queue and validate the 10-row cascade
32
+ 9. settings/sender, sequence, and start handoff
30
33
 
31
34
  The JSON flow is the source of truth for stage order, `requiredArtifacts`,
32
35
  `producesArtifacts`, `allowedTools`, `doNotAllow`, `waitFor`, and
33
36
  `transitions`. This prompt explains how to execute those gates; it does not
34
37
  replace them.
35
38
 
36
- Each stage writes its own artifact into the draft directory before the next
37
- stage starts. `brief.md` is the single customer-facing brief and canonical
38
- downstream campaign thesis input.
39
-
40
- After validation artifacts are complete, show the user a commit gate with 6
41
- choices (approve / revise-brief / revise-leads / revise-rubric /
42
- revise-messaging / abort). Only `approve` triggers DB mutation. On `approve`,
43
- atomically mint the campaign (`create_campaign` + `save_rubrics`), capture the
44
- `watchUrl` from the `create_campaign` response, and surface it to the user only
45
- after both tool calls succeed.
39
+ CampaignOffer state is canonical; disk artifacts are a debug trail. In this
40
+ phase, all 14 disk artifacts remain as debug outputs, but resume, gating, and
41
+ handoff read campaign state first: campaign id, watch URL, campaign brief,
42
+ currentStep, provider/search association, selectedLeadListId as the source
43
+ list, workflowTableId as the campaign table, saved rubrics, approved message
44
+ template, senderIds, sequence template, and running state. `brief.md` is the
45
+ single customer-facing debug copy of the brief; the campaign brief field is the
46
+ durable downstream campaign thesis input.
47
+
48
+ There is no separate approval-packet, commit-gate, or mint step in the active
49
+ shell-first flow. The campaign exists early for watch mode. The hard boundary
50
+ is import/enrichment: no leads are imported, no workflow cells are queued, no
51
+ sequence is attached, and nothing starts until the source is selected, rubrics
52
+ are saved, and the approved message set is synced into the campaign brief.
46
53
  </objective>
47
54
 
48
55
  <files>
@@ -52,6 +59,7 @@ Validated draft directory:
52
59
  ```text
53
60
  .sellable/create-campaign-v2/drafts/{workspace-slug}/{campaign-slug}/
54
61
  brief.md
62
+ campaign-shell.json # debug copy of the watchable campaign shell with v1 brief
55
63
  lead-review.md
56
64
  lead-sample.json
57
65
  lead-filter.md
@@ -61,9 +69,9 @@ Validated draft directory:
61
69
  message-review.md
62
70
  message-review-decision.md
63
71
  rubric.json # optional implementation artifact only
64
- approval-packet.md
72
+ approval-packet.md # legacy/deprecated only
65
73
  customer-roleplay.md
66
- commit-gate-decision.md
74
+ commit-gate-decision.md # legacy/deprecated only
67
75
  ```
68
76
 
69
77
  </files>
@@ -73,6 +81,24 @@ Validated draft directory:
73
81
  - Net-new runs start at `bootstrap` -> `brief-interview` in
74
82
  `core/flow.v2.json`. Do not start at `validate-artifacts` unless resuming a
75
83
  compatibility run where all upstream artifacts already exist.
84
+ - New runs create a watchable campaign shell after sender/company identity,
85
+ campaign focus, source intake, and the v1 brief are known. The shell is a
86
+ `CampaignOffer` at `currentStep: "create-offer"` with a real v1 brief and a
87
+ `watchUrl`; when the user opens it they should see the brief, not an empty
88
+ campaign. If shell creation fails, stop and surface the error. There is no
89
+ no-shell mint fallback in the active shell-first flow.
90
+ - After the shell is minted, normal resume paths read the CampaignOffer first.
91
+ Use debug files to explain or reconstruct work, not to decide whether a
92
+ post-mint gate is allowed. Validation/debug artifacts are not durable campaign
93
+ state.
94
+ - The campaign shell may receive setup state before import: approved brief text,
95
+ campaign-attached provider searches/selections, the bounded review-batch
96
+ import, saved rubrics, and the approved message template. It must never queue
97
+ workflow cells, attach a sequence, or start sending until rubrics are saved
98
+ and the approved message set has been synced into the campaign brief.
99
+ - Sender ownership stays out of this plan. senderIds persistence is Plan 04;
100
+ update_campaign({ senderIds }) delegates to the v3 senders route and never
101
+ uses the v2 campaign-offers PUT for sender persistence.
76
102
  - Load `core/flow.v2.json` through
77
103
  `get_subskill_asset({ subskillName: "create-campaign-v2", assetPath: "core/flow.v2.json" })`
78
104
  at the start of the run and treat the returned JSON as the active state
@@ -127,8 +153,9 @@ Validated draft directory:
127
153
  loading, runbooks, local skill files, skill versions, or "Sellable token".
128
154
  "Quick question panel" is only acceptable when explaining a Codex/Claude setup
129
155
  blocker.
130
- - Before campaign mint, do not call `check_rubric`; Phase 84 only writes and
131
- validates draft artifacts.
156
+ - Before the 10-lead import/test batch, do not call `check_rubric`; Phase 84
157
+ only writes and validates artifacts, saves rubrics, and syncs campaign setup
158
+ state.
132
159
  - Never narrate local draft housekeeping to the user. If you create directories,
133
160
  save drafts, write artifacts, or persist intermediate state, translate it into
134
161
  the campaign benefit: consistent brief, approved lead source, reviewed message,
@@ -139,9 +166,9 @@ Validated draft directory:
139
166
  content. Show a short `Open artifact:` line with the one key clickable
140
167
  markdown link for that stage. Do not show raw filesystem paths unless links
141
168
  cannot be created or the user asks. Do this for brief approval, lead-source
142
- approval/review, lead-filter review, message review, and final approval
143
- packet. Do not use the link as a substitute for rendering the decision in
144
- chat; links are for deeper inspection.
169
+ approval/review, lead-filter review, and message review. Do not use the link
170
+ as a substitute for rendering the decision in chat; links are for deeper
171
+ inspection.
145
172
  - Any time the user is reviewing a list or decision, use rendered Markdown with
146
173
  short indexed sections and bullets. Do not use label-plus-paragraph blocks
147
174
  like `Key numbers:` followed by one long paragraph. Do not use fenced code
@@ -369,9 +396,9 @@ me`, `I’ll paste a different sender profile`, and `Other / custom`.
369
396
  - ...
370
397
  - ...
371
398
 
372
- **7. After approval**
399
+ **7. What happens next**
373
400
  I’ll find good-fit LinkedIn leads, show the source decision and sample, then
374
- draft the first message for review. Nothing goes live without approval.
401
+ draft the first message for review. No leads import and nothing sends yet.
375
402
  ```
376
403
 
377
404
  In the `Lead plan` section, do not expose internal provider shorthand as the
@@ -413,10 +440,9 @@ This usually takes ~3-5 min, and I'll show you the source decision + sample
413
440
  before anything goes live.`
414
441
  - After the lead sample/source decision is ready and approved or auto-confirmed,
415
442
  show the next progress line:
416
- `Lead source is set. Now I'll do two things from this sample: apply the fit
417
- filter to clean the list down to great fits, and draft the first message we
418
- should test for this campaign. Those can run in parallel and usually take
419
- ~2-3 min.`
443
+ `Lead source is set. I'll import the first 10-row review batch into the
444
+ campaign table, then use that same batch to tighten the fit filter and draft the
445
+ message we should test.`
420
446
  - During long post-intake work, show concise progress checkpoints before the
421
447
  next expensive stage: source being checked, source switch/tradeoff if any,
422
448
  lead sample usable, filter/message drafting, and full message prompt loading.
@@ -431,14 +457,14 @@ should test for this campaign. Those can run in parallel and usually take
431
457
  ```
432
458
 
433
459
  - In hosted/rehearsal runs, `Bash` is only for safe local draft-directory
434
- housekeeping before approval: `mkdir`, `ls`, `find`, `test`, `pwd`, `echo`,
460
+ housekeeping before the import/test batch: `mkdir`, `ls`, `find`, `test`, `pwd`, `echo`,
435
461
  or `cat` inside the repo. Do not use
436
462
  Bash to run interpreters/scripts (`python`, `node`, `npm`, `pnpm`, `yarn`,
437
463
  `npx`), call APIs, query databases, inspect prompt dumps, run git, or
438
464
  synthesize artifact content. Use `Read`/`Write`/`Edit` for artifact files and
439
465
  MCP tools for product actions.
440
- - `brief.md` is the single user-facing brief and stable downstream thesis
441
- source.
466
+ - `brief.md` is the single user-facing debug copy of the brief. The
467
+ `CampaignOffer.campaignBrief` field is the stable downstream thesis source.
442
468
  - `lead-review.md` and `lead-sample.json` are the required outputs of `find leads`.
443
469
  - `lead-filter.md` is the primary output of `filter leads`.
444
470
  - `rubric.json` is optional and secondary to `lead-filter.md`.
@@ -455,25 +481,30 @@ should test for this campaign. Those can run in parallel and usually take
455
481
  - `message-review.md` and `message-review-decision.md` are the mandatory
456
482
  message quality gate outputs between `message-validation.md` and
457
483
  `approval-packet.md`.
458
- - Run the dependency chain as a DAG: `create-campaign-brief` -> `find leads`;
459
- once `lead-review.md` and `lead-sample.json` exist, the normal path is the
484
+ - Run the dependency chain as a DAG: `create-campaign-brief` -> `find leads` ->
485
+ bounded import/confirm. Once `lead-review.md`, `lead-sample.json`, and the
486
+ campaign table `workflowTableId` exist, the normal path is the
460
487
  `post-lead-workstreams` step. Launch `filter leads` and `message generation`
461
- from the same basis (`brief.md`, `lead-review.md`, `lead-sample.json`) as
462
- separate workstreams when the host supports real subagents/background work.
488
+ from the same basis (`brief.md`, `lead-review.md`, `lead-sample.json`, and
489
+ the imported review-batch rows) as separate workstreams when the host supports
490
+ real subagents/background work.
463
491
  First call `get_post_find_leads_scout_registry` and use the returned
464
492
  canonical `name` values. In Claude Code, use both returned Task/Agent
465
493
  subagents in the same assistant message; in Codex, use both returned custom
466
494
  scouts as disjoint subagents in the same assistant turn when the host exposes
467
495
  them. The existing `filter-rubric` and `message-generation` steps remain
468
496
  focused retry and resume targets.
469
- - Message generation does not need `lead-filter.md` to start. The moment
470
- `lead-sample.json` exists with at least 5 probable good-fit rows and the lead
471
- source is confirmed or auto-confirmed, start the message-generation
472
- workstream from `brief.md`, `lead-review.md`, and `lead-sample.json`. It can
473
- prepare proof inventory, token strategy, and candidate angles while
474
- filter-leads tightens keep/exclude rules. Approval still waits for both
475
- `lead-filter.md` and `message-validation.md`, then reconciles that the
476
- selected message basis rows still pass the final filter.
497
+ - Message generation does not need `lead-filter.md` to start. The moment the
498
+ bounded review batch is imported and `workflowTableId` is ready, start the
499
+ message-generation workstream from `brief.md`, `lead-review.md`,
500
+ `lead-sample.json`, and the imported campaign table sample. It can prepare
501
+ proof inventory, token strategy, and candidate angles while filter-leads
502
+ tightens keep/exclude rules. Approval still waits for both `lead-filter.md`
503
+ and `message-validation.md`, then reconciles that the selected message basis
504
+ rows still pass the final filter.
505
+ If a legacy/resume host starts message prep from preview rows before import,
506
+ it still needs at least 5 probable good-fit rows and must reconcile the final
507
+ winner against the imported review batch before message review.
477
508
  - `lead-sample.json` from `find leads` is always the message sample source.
478
509
  `filter leads` must not create a different message sample or cause message
479
510
  generation to fetch new prospects. The filter only marks which find-leads
@@ -504,7 +535,8 @@ workstreams`, `in parallel`, or `background` unless parallel branches were
504
535
  - For post-lead workstreams, first call
505
536
  `get_post_find_leads_scout_registry` and launch exactly the returned
506
537
  `filter-leads` and `message-generation` scouts when real subagents are
507
- available. This is the same registry pattern as source scouting, but the
538
+ available. This is the two Task/Agent subagents path for the
539
+ `post-lead-workstreams` step. This is the same registry pattern as source scouting, but the
508
540
  trigger is source approval and the join gate is both `lead-filter.md` and
509
541
  `message-validation.md` existing from the same `brief.md`, `lead-review.md`,
510
542
  and `lead-sample.json`.
@@ -512,21 +544,27 @@ workstreams`, `in parallel`, or `background` unless parallel branches were
512
544
  `requiredArtifacts` exist.
513
545
  - Never call a tool outside the active step's `allowedTools`, and never call a
514
546
  tool listed in the active step's `doNotAllow`.
515
- - Before the user chooses `approve`, the mutating live-campaign tools are
516
- forbidden: `create_campaign`, `save_rubrics`, `import_leads`,
517
- `confirm_lead_list`, `update_campaign`, `queue_cells`, and `start_campaign`.
518
- - During pre-approval validation, do not call `check_rubric`; use the
519
- campaignless lead-filter artifacts and only use campaign-backed scoring after
520
- the approval flow allows it.
521
- - Resume state is based on the presence and completeness of the chained artifacts,
522
- not on inline validation blocks inside `brief.md`.
547
+ - Before the source is approved, `import_leads` and `confirm_lead_list` are
548
+ forbidden. After source approval, import/confirm only the bounded 10-row
549
+ review batch. Before rubrics and the approved message set are both on the
550
+ campaign, the spend/send-adjacent cascade tools are forbidden: `queue_cells`,
551
+ `enrich_with_prospeo`, `bulk_enrich_with_prospeo`,
552
+ `attach_recommended_sequence`, `attach_sequence`, and `start_campaign`.
553
+ `create_campaign`, `update_campaign`, and `save_rubrics` are allowed only when
554
+ the active `flow.v2.json` step allows them.
555
+ - During pre-import validation, do not call `check_rubric`; use the lead-filter
556
+ artifacts and only use campaign-backed scoring after Step 13 imports the
557
+ 10-lead test batch.
558
+ - Resume state is based on CampaignOffer state first, then the presence and
559
+ completeness of the chained debug artifacts. Never treat file presence as the
560
+ durable source of truth after the campaign exists.
523
561
  - Preserve the Phase 83 thesis. Do not rewrite product, ICP, offer, or message
524
562
  hypothesis sections during preview validation.
525
563
  - Exception: brief-validated may rewrite §3 Campaign Thesis AND §12 Next Steps
526
564
  when Phase-84 lead-yield data clearly contradicts a Phase-83 UNVALIDATED
527
565
  decision on primary lead-source. "Clearly contradicts" = the Phase-83
528
566
  primary source yields 0 FIT while an alternative source yields ≥ 5 FIT in
529
- the same ~25-row sample (or an equivalent ≥ 5× ratio at larger samples).
567
+ the same 10-row test sample (or an equivalent ≥ 5× ratio at larger samples).
530
568
  Every rewrite MUST cite specific yield numbers from `lead-review.md`. All
531
569
  other Phase-83 brief sections remain read-only. See
532
570
  `references/filter-leads.md` § Brief-Validated Rewrite Authority for the
@@ -535,30 +573,25 @@ workstreams`, `in parallel`, or `background` unless parallel branches were
535
573
  artifact intact.
536
574
  - If a required upstream artifact is missing, stop and route back to the
537
575
  missing step instead of guessing.
538
- - Before asking for commit approval, persist a customer-facing
539
- `message-review.md` and `message-review-decision.md` so the message
540
- approval decision can be inspected later.
541
- - Before asking for commit approval, persist a customer-facing
542
- `approval-packet.md` so the exact packet can be inspected later.
543
- - The pre-mint approval packet must show exactly one concrete `## Sample
544
- Message` rendered as the recipient would see it, in addition to the approved
545
- message template. Do not make the user mentally expand `{{tokens}}` at final
546
- approval.
576
+ - Before importing the 10-lead test batch, persist a customer-facing
577
+ `message-review.md` and `message-review-decision.md` so the message decision
578
+ can be inspected later.
579
+ - The message review must show one concrete sample message rendered as the
580
+ recipient would see it, in addition to the approved message template. Do not
581
+ make the user mentally expand `{{tokens}}`.
547
582
  - Do not include sequence, cadence, sending-window, mailbox, or campaign
548
- settings review in the pre-mint approval packet. Those come after mint. The
549
- pre-mint packet approves only the brief, lead source, lead filter/rubric, and
550
- first message direction.
583
+ settings review in `message-review.md`. Those come after the 10-lead test
584
+ batch, in the settings/sequence handoff.
551
585
  - Do not include post-accept DMs, connection-accepted follow-ups, day-2 / day-7
552
586
  follow-ups, second touches, reply branches, or any other sequence-shaped copy
553
- in `message-review.md` or the pre-mint approval packet. If
587
+ in `message-review.md`. If
554
588
  `message-validation.md` contains those, mark the message review as
555
589
  `revise-messaging` and route back to message generation even if the artifact
556
590
  says `Status: confirmed`.
557
591
  - Persist `customer-roleplay.md` when a customer/operator roleplay critique is
558
- run. This critique can recommend a decision, but it can never authorize mint.
559
- - Persist `commit-gate-decision.md` with exactly one of the six gate choices.
560
- Only an explicit `approve` value in this decision artifact authorizes DB
561
- mutation.
592
+ run. This critique can recommend a decision, but it can never replace
593
+ `approve-message` for lead import, workflow-table processing, sequence attach,
594
+ or start.
562
595
 
563
596
  </rules>
564
597
 
@@ -566,13 +599,14 @@ Message` rendered as the recipient would see it, in addition to the approved
566
599
 
567
600
  There are two human gates:
568
601
 
569
- - `message-review` is the mandatory pre-packet message quality gate. It asks
602
+ - `message-review` is the mandatory pre-import message quality gate. It asks
570
603
  only whether to proceed with the selected message (`approve-message`) or run
571
- one more messaging revision (`revise-messaging`). It does not authorize DB
572
- mutation.
573
- - The commit gate is the only mandatory user approval before DB mutation.
574
- Earlier artifact gates are interrupt-only unless this contract explicitly
575
- names the `message-review` gate.
604
+ one more messaging revision (`revise-messaging`). `approve-message` authorizes
605
+ syncing the approved message set into the campaign brief, saving rubrics,
606
+ importing the bounded 10-lead test batch, and queueing/observing that sample.
607
+ - The sender/settings/sequence handoff is the launch gate. Starting the campaign
608
+ still waits until a sender is attached, the sequence is accepted, and the user
609
+ greenlights start.
576
610
 
577
611
  Auto-continue without a structured question gate when the artifact says
578
612
  `Status: confirmed` (or equivalent), confidence is high/medium, volume is
@@ -591,14 +625,14 @@ Ask the user only when one of these is true:
591
625
  or normal public research.
592
626
  - Message validation has a blocking skeptical-prospect issue, no selected
593
627
  winner, weak token plan, or a recommendation to revise. Even when it is
594
- confirmed, render the `message-review` gate before creating the approval
595
- packet so the founder can approve or revise the message deliberately.
628
+ confirmed, render the `message-review` gate before importing the test batch so
629
+ the founder can approve or revise the message deliberately.
596
630
 
597
631
  When asking subjective strategy questions (buyer scope, first ask, proof
598
632
  emphasis, tone, lead-source preference), always make it clear the user can give
599
633
  a custom answer. Add an explicit `Other / custom` option to each subjective
600
634
  question. Do not rely on prose like "you can add detail" as the only custom
601
- path. Do not add custom options to the final six-choice commit gate.
635
+ path.
602
636
  Every subjective setup question is single-choice in both Claude Code and
603
637
  Codex. Use mutually exclusive options, set or assume `multiSelect: false`, and
604
638
  never use checkbox or multi-select wording that invites selecting several
@@ -652,8 +686,9 @@ Do not create a review question whose only useful answer is "looks good".
652
686
 
653
687
  ## Step 1: Find Leads
654
688
 
655
- Use existing `find-leads` campaignless preview behavior to validate ICP and
656
- volume with a real sample.
689
+ Use the shell-first CampaignOffer campaignId for lead-source preview.
690
+ Campaignless preview mode is only allowed before the campaign shell is minted;
691
+ it is legacy-only and not part of the active flow once a CampaignOffer exists.
657
692
 
658
693
  Write:
659
694
 
@@ -664,17 +699,25 @@ Write:
664
699
 
665
700
  Required behavior:
666
701
 
667
- - use campaignless preview mode
668
- - do not pass `campaignOfferId` (Step 1 only — this is the one place
669
- where campaignless is the right choice; every post-mint provider
670
- search Prospeo, Sales Nav, Apollo, Signal Discovery, or any
671
- future provider MUST include `campaignOfferId` so the search
672
- persists to the campaign and shows up in the UI's Contact Search
673
- tab. Omitting `campaignOfferId` after mint orphans the search.)
702
+ - pass the CampaignOffer campaignId as `campaignOfferId` to every provider
703
+ prompt/search that can persist into campaign state:
704
+ `get_provider_prompt({ provider, campaignOfferId, confirmed: true })`,
705
+ `search_signals`, `search_sales_nav`, and `search_prospeo`. This lets the user
706
+ watch source work in the campaign during intake.
707
+ - provider prompt preflight and interaction-mode approval are in-memory. On
708
+ resume or MCP restart, call `get_provider_prompt({ provider, campaignOfferId })`
709
+ again before any provider search/import; do not assume CampaignOffer state
710
+ proves preflight happened in this process.
711
+ on resume or MCP restart, call `get_provider_prompt({ provider, campaignOfferId })` again.
712
+ - if CampaignOffer campaignId is missing, stop and recover shell creation before
713
+ sourcing; do not run a campaignless source path in the active flow.
674
714
  - do not import leads
675
- - do not set `selectedLeadListId`
676
- - do not create lead-list rows
677
- - do not mutate DB-backed campaign state
715
+ - do not import into the campaign table, queue cells, attach a sequence, or start
716
+ the campaign
717
+ - do not create lead-list rows except explicit user-supplied preview flows
718
+ allowed by `flow.v2.json`
719
+ - only mutate campaign-attached source preview state in the narrow watch-mode
720
+ ways allowed by the active flow step
678
721
  - run a real parallel source-angle scout when the source is not supplied and at
679
722
  least two viable source angles exist. Treat source scouting as independent
680
723
  branches, then compare the outputs in `lead-review.md`. Call
@@ -741,7 +784,7 @@ usable leads`.
741
784
  as they exist: keyword lanes searched, timeframe used, post results by lane,
742
785
  finalist posts reviewed, engagers fetched, sampled engagers, sampled fits,
743
786
  estimated usable leads, and what is still unknown. Do not wait until the final
744
- approval packet to show those numbers.
787
+ lead-source review to show those numbers.
745
788
  - Signals source decisions should prefer fresh posts. Default to posts from the
746
789
  last 30 days, prefer the last 7-14 days when quality is comparable, and call
747
790
  out any older post as a deliberate tradeoff. Do not hide post age inside the
@@ -749,25 +792,26 @@ usable leads`.
749
792
  - default source quality target is 300-500+ likely usable leads for scalable
750
793
  outbound; accept ~150+ likely ICP-fit warm prospects as viable for a focused
751
794
  Signals-first campaign or first review batch. Name the volume tradeoff in
752
- `lead-review.md` and the approval packet rather than forcing a discard.
795
+ `lead-review.md` and the message review context rather than forcing a discard.
753
796
  - if `lead-source-intake.json` is present, read `sourceType`,
754
797
  `sourceInputMode`, file path or existing lead-list ID, selected columns,
755
798
  confirmation token, normalized counts, and any preview-created
756
799
  `domainFilterId`
757
800
  - supplied LinkedIn profile CSVs call `load_csv_linkedin_leads` in preview mode
758
- only before approval; do not pass `confirmed: true`, `campaignOfferId`,
759
- `currentStep`, `leadListId`, `sourceLeadListId`, or provider-import params
760
- during the preview. After approval, this branch is a two-stage batch path:
801
+ only before rubrics and the approved message set are ready; do not pass
802
+ provider-import params during the preview. Use `campaignOfferId` only to
803
+ attach the preview/source choice to the campaign UI. In Step 13, this branch
804
+ is a two-stage batch path:
761
805
  materialize the full supplied CSV into a Sellable lead-list table first, then
762
806
  use the returned `leadListId` as `sourceLeadListId` for the bounded campaign
763
807
  review import
764
- - supplied company/domain CSVs call `load_csv_domains`; pre-approval
765
- confirmation is allowed only without `campaignOfferId` or `currentStep` and
766
- only to produce a standalone `domainFilterId` for campaignless
767
- account-constrained people sampling
808
+ - supplied company/domain CSVs call `load_csv_domains`; confirmation is allowed
809
+ to produce a `domainFilterId` for Prospeo sampling. Run the preview search
810
+ with `campaignOfferId`. In Step 13, use the same `domainFilterId` in a
811
+ campaign-associated Prospeo people search, then import.
768
812
  - existing Sellable lead lists skip provider discovery and sample from the
769
- existing rows before approval; do not clone/import the list until after
770
- approval
813
+ existing rows; do not clone/import the list until rubrics are saved and the
814
+ approved message set is in the campaign brief
771
815
  - do not call `save_domain_filters` in the pre-approval create-campaign path
772
816
 
773
817
  `lead-review.md` must state:
@@ -922,7 +966,11 @@ chain, and route to `revise-leads`.
922
966
 
923
967
  ## Step 2: Filter Leads
924
968
 
925
- Read `brief.md`, `lead-review.md`, and `lead-sample.json`.
969
+ Read CampaignOffer state first, then `brief.md`, `lead-review.md`, and
970
+ `lead-sample.json` as debug context. Filter/rubric saving happens after
971
+ `workflowTableId` exists from the bounded import. The durable write is
972
+ `save_rubrics({ campaignOfferId, leadScoringRubrics }) after the campaign table
973
+ exists`; `lead-filter.md` and `rubric.json` remain debug outputs.
926
974
 
927
975
  This branch can run in parallel with Step 3 once `lead-review.md` and
928
976
  `lead-sample.json` exist. It owns lead quality and production rubrics only.
@@ -1008,7 +1056,6 @@ sections.
1008
1056
  Do not:
1009
1057
 
1010
1058
  - call `check_rubric`
1011
- - call `save_rubrics`
1012
1059
  - create a second independent scoring design in `rubric.json`
1013
1060
  - emit more than one optional/supporting rule
1014
1061
 
@@ -1024,7 +1071,12 @@ mcp__sellable__get_subskill_prompt({ subskillName: "generate-messages", offset,
1024
1071
 
1025
1072
  Continue chunked-read until `hasMore=false`. Treat all chunks as one prompt load. Follow it verbatim once loaded. The same directive is locked in `flow.v2.json::messageGeneration.toolRules`.
1026
1073
 
1027
- Do NOT proceed to Step 4 (message review gate) without loading and following the full generate-messages workflow. `message-validation.md` must prove the full workflow ran (all required sections present + raw sendable Selected Winner + explicit single-send-unit PASS) before `message-review.md` can recommend `approve-message`. If the message review or approval packet is ready but the generate-messages prompt was not retrieved in this run, route back to message-generation instead of asking the commit gate. If `message-validation.md` contains post-accept DM, follow-up, second-touch, cadence, branch, or other sequence-shaped copy, do not summarize it as ready; route back to message-generation and require a single first outbound send.
1074
+ Do NOT proceed to Step 4 (message review gate) without loading and following the full generate-messages workflow. `message-validation.md` must prove the full workflow ran (all required sections present + raw sendable Selected Winner + explicit single-send-unit PASS) before `message-review.md` can recommend `approve-message`. If the message review is ready but the generate-messages prompt was not retrieved in this run, route back to message-generation before queueing the 10-lead test cascade. If `message-validation.md` contains post-accept DM, follow-up, second-touch, cadence, branch, or other sequence-shaped copy, do not summarize it as ready; route back to message-generation and require a single first outbound send.
1075
+
1076
+ After the main-chat message approval, update_campaign_brief writes `## Approved
1077
+ Message Template` with `{{...}}` tokens before any Generate Message cascade is
1078
+ queued. The message review shows one concrete filled sample for the user, but
1079
+ the durable template lives in `CampaignOffer.campaignBrief`.
1028
1080
 
1029
1081
  ## Tail (MANDATORY TOOL ORDER + Steps 13-16 + Threshold Trips + Hard Rules)
1030
1082
 
@@ -34,7 +34,8 @@ tell them what they will see next.
34
34
  - "quick question panel" is only for a setup blocker where the host UI feature
35
35
  is missing.
36
36
  - "lead source" beats provider internals unless comparing options.
37
- - "no campaign is created until you approve" beats mutation jargon.
37
+ - "I’ll create the campaign shell with the brief so you can watch it fill in,
38
+ but no leads import and nothing sends yet" beats mutation jargon.
38
39
  - "I’m turning this into a brief now" beats "I’m persisting the draft."
39
40
  - "Sorry, this is taking a little longer than expected" is appropriate when a
40
41
  step overruns its estimate. Do not over-apologize; one calm acknowledgment is
@@ -78,10 +79,12 @@ the sentence, or revise the message. It should include the exact fallback
78
79
  example, like `omit the noticed... line` or `use "operators"`. Missing data
79
80
  should never produce robotic or creepy copy.
80
81
 
81
- Approved token guidance is part of the campaign, not just the review. When a
82
- campaign is minted, the approved brief should carry forward the token fill
83
- rules and examples: good fills, good omits, bad fills, fallback rules, and why
84
- the bad fills are blocked.
82
+ Approved token guidance is part of the campaign, not just the review. Before
83
+ the 10-lead test batch imports, the campaign brief should carry forward the
84
+ token fill rules and examples: good fills, good omits, bad fills, fallback
85
+ rules, and why the bad fills are blocked.
86
+ The campaign brief must carry forward the token fill rules from review into the
87
+ live campaign state before import.
85
88
 
86
89
  ## Progress Updates
87
90
 
@@ -131,16 +134,20 @@ Good wait update:
131
134
 
132
135
  ```text
133
136
  This is taking a little longer than I expected, sorry. I’m being careful here
134
- because the brief becomes the source of truth for the leads and messages. I’ll
135
- show you the draft next so you can approve it or change it.
137
+ because the campaign state is what the lead source, filters, and messages will
138
+ build from. I’ll show you the draft next so you can approve it or change it.
136
139
  ```
137
140
 
141
+ CampaignOffer state is canonical; disk artifacts are a debug trail. Keep the
142
+ diagnostics for inspection, and all 14 disk artifacts remain as debug outputs,
143
+ but resume, gating, and handoff read campaign state first.
144
+
138
145
  Good opening:
139
146
 
140
147
  ```text
141
148
  I’ll help you launch this as a Sellable campaign. First I’ll confirm who we’re
142
149
  sending from and which company this is for, then I’ll turn that into a campaign
143
- brief before anything is created.
150
+ brief before any leads are imported or anything can send.
144
151
  ```
145
152
 
146
153
  Good identity setup:
@@ -264,11 +271,12 @@ aspirational copy.
264
271
  Call the post-filter message stage `message generation` in chat.
265
272
  `message-validation.md` is an internal proof artifact, not the workstream name.
266
273
 
267
- Be explicit about when nothing has been created yet:
274
+ Be explicit about what has and has not happened:
268
275
 
269
276
  ```text
270
- Nothing has been created in Sellable yet. I’ll only create the campaign after
271
- you approve the final brief, lead source, filter, and message.
277
+ I created the campaign shell with the brief so you can watch it fill in. I
278
+ won’t import leads, attach a sequence, or start anything until the source,
279
+ filters, and message are set.
272
280
  ```
273
281
 
274
282
  ## What To Avoid
@@ -1,9 +1,10 @@
1
1
  # Autonomous tail configuration for create-campaign-v2 (Plan 85-02)
2
2
  #
3
- # This file controls the post-commit review-batch tail that runs AFTER the
4
- # commit gate succeeds and the campaign has been atomically minted. The tail
5
- # does NOT call `start_campaign` on its own and does NOT spend enrichment
6
- # credits on the full cohort before the user has reviewed a real sample.
3
+ # This file controls the shell-first review-batch tail that runs AFTER the
4
+ # campaign shell already has the approved source, saved rubrics, and approved
5
+ # message set in the brief. The tail does NOT call `start_campaign` on its own
6
+ # and does NOT spend enrichment credits on the full cohort before the user has
7
+ # reviewed a real sample.
7
8
  #
8
9
  # Tune after 3-5 real campaign runs. Log every threshold trip so tuning is
9
10
  # evidence-based, not guess-based. See `auto-execute.README.md` for a
@@ -16,17 +17,17 @@ import:
16
17
  # Initial review batch imported in Step 13 before the sample validation
17
18
  # loop. Import + enrichment must never exceed this cap before the user
18
19
  # reviews the sample and explicitly asks to expand.
19
- importLimit: 25
20
- # Provider is inherited from the Phase 84 commit decision (not re-selected
21
- # here). The autonomous tail reads the committed value rather than
22
- # overriding it.
20
+ importLimit: 10
21
+ # Provider is inherited from the campaign-attached source association created
22
+ # during find-leads. Step 13 may re-run provider preflight in memory, but it
23
+ # does not choose a new source.
23
24
  provider: prospeo
24
25
 
25
26
  sample:
26
27
  # Rows pulled from the imported cohort for the validation loop. In v2 this
27
- # equals the review-batch cap so the user sees a meaningful first batch
28
+ # equals the review-batch cap so the user sees a focused first test batch
28
29
  # without spending credits on hundreds of rows.
29
- sampleSize: 25
30
+ sampleSize: 10
30
31
  # Projected first-batch passing count required to proceed to sample
31
32
  # messaging. This is not approval to scale the full source list.
32
33
  # projectedPass = round(passInSample / sampleSize * importLimit).
@@ -105,9 +106,9 @@ handoff:
105
106
  # Orientation surfaced in Step 16 ("awaiting-user-greenlight") along with
106
107
  # the watch link. Keep this short and user-facing.
107
108
  orientation: >-
108
- Review the first 25 enriched leads and messages. If they look good,
109
- approve/start this review batch or ask Claude to expand the next batch
110
- before spending credits on more leads.
109
+ Review the first 10 enriched leads and messages. If they look good,
110
+ attach a sender in Settings, accept the recommended sequence, and start
111
+ the campaign without spending credits on more leads first.
111
112
 
112
113
  retry:
113
114
  # Stop after N repeats of the same tool hitting the same error. Prevents