@scribe-platform/cli 0.7.0 → 0.8.0

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 (46) hide show
  1. package/dist/commands/login.d.ts.map +1 -1
  2. package/dist/commands/login.js +15 -1
  3. package/dist/commands/login.js.map +1 -1
  4. package/dist/commands/prospect.d.ts +27 -0
  5. package/dist/commands/prospect.d.ts.map +1 -0
  6. package/dist/commands/prospect.js +213 -0
  7. package/dist/commands/prospect.js.map +1 -0
  8. package/dist/commands/request.d.ts +38 -0
  9. package/dist/commands/request.d.ts.map +1 -0
  10. package/dist/commands/request.js +214 -0
  11. package/dist/commands/request.js.map +1 -0
  12. package/dist/commands/site.d.ts +11 -0
  13. package/dist/commands/site.d.ts.map +1 -1
  14. package/dist/commands/site.js +41 -3
  15. package/dist/commands/site.js.map +1 -1
  16. package/dist/commands/update.d.ts +10 -0
  17. package/dist/commands/update.d.ts.map +1 -1
  18. package/dist/commands/update.js +128 -31
  19. package/dist/commands/update.js.map +1 -1
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +4 -0
  22. package/dist/index.js.map +1 -1
  23. package/dist/lib/claude-hook.d.ts +74 -0
  24. package/dist/lib/claude-hook.d.ts.map +1 -0
  25. package/dist/lib/claude-hook.js +108 -0
  26. package/dist/lib/claude-hook.js.map +1 -0
  27. package/dist/lib/client.d.ts +182 -0
  28. package/dist/lib/client.d.ts.map +1 -1
  29. package/dist/lib/client.js +82 -0
  30. package/dist/lib/client.js.map +1 -1
  31. package/dist/lib/skill.d.ts +13 -0
  32. package/dist/lib/skill.d.ts.map +1 -1
  33. package/dist/lib/skill.js +33 -2
  34. package/dist/lib/skill.js.map +1 -1
  35. package/dist/lib/update-check.d.ts +46 -0
  36. package/dist/lib/update-check.d.ts.map +1 -0
  37. package/dist/lib/update-check.js +103 -0
  38. package/dist/lib/update-check.js.map +1 -0
  39. package/package.json +1 -1
  40. package/skills/scribe-site-builder/SKILL.md +155 -33
  41. package/skills/scribe-site-builder/recipes/README.md +10 -3
  42. package/skills/scribe-site-builder/recipes/domains.md +151 -0
  43. package/skills/scribe-site-builder/recipes/forms.md +5 -2
  44. package/skills/scribe-site-builder/recipes/prospects.md +192 -0
  45. package/skills/scribe-site-builder/recipes/requests.md +145 -0
  46. package/skills/scribe-site-builder/recipes/schema.md +24 -0
@@ -0,0 +1,192 @@
1
+ # Recipe: prospects
2
+
3
+ Ashley's calling pipeline lives in Scribe as Clients with `status: 'prospect'`.
4
+ This recipe is about **recording and nurturing prospects she already has** —
5
+ logging what happened on a call, scheduling the next touch, and moving one
6
+ through the funnel. Finding new leads is not covered here: wherever a name comes
7
+ from (a Places sweep, a referral, a drive-by), this recipe starts once it exists.
8
+
9
+ The same operations are available two ways — `scribe prospect …` on the command
10
+ line, and the `list_prospects` / `get_prospect` / `create_prospect` /
11
+ `log_prospect_call` / `set_prospect_status` MCP tools. They are the same
12
+ endpoints; use whichever the session has.
13
+
14
+ §3 is the part to actually read. Everything else is mechanics.
15
+
16
+ ## 1. The pipeline
17
+
18
+ Four statuses, and a prospect only ever sits in the first one:
19
+ `prospect` → `active` (won) or `lost`, with `active` ↔ `churned` afterwards for
20
+ a real client. Nothing is deleted on the way through — a lost prospect keeps its
21
+ whole call log, because the reason it was lost is the point of recording it.
22
+
23
+ ```
24
+ scribe prospect create "A+ Plumbing" \
25
+ --contact-name "Dana" --phone "555-0101" \
26
+ --note "Found on the Yelp sweep — no website, 4.6 stars over 90 reviews"
27
+
28
+ scribe prospect list --due # who to call today
29
+ scribe prospect show <id> # the full call log before dialling
30
+
31
+ scribe prospect log <id> \
32
+ --note "Left a voicemail, no callback yet" \
33
+ --outcome left-message \
34
+ --next 2026-10-14
35
+
36
+ scribe prospect status <id> active # won
37
+ scribe prospect status <id> lost --reason "Nephew builds their sites"
38
+ ```
39
+
40
+ `list` defaults to a table and takes `--json` for parsing; so does every other
41
+ subcommand. `--status` and `--search` filter, and the default list is
42
+ due-sorted — soonest or most overdue first, undated prospects last.
43
+
44
+ ## 1b. Always pass `--outcome` on a real call
45
+
46
+ `--outcome` is how far the attempt got, shallowest to deepest:
47
+
48
+ | Outcome | Use when |
49
+ |---|---|
50
+ | `no-answer` | Nobody picked up |
51
+ | `left-message` | Voicemail, or a message left with someone |
52
+ | `gatekeeper` | Spoke to a person, but not the decision-maker |
53
+ | `reached` | Spoke to the decision-maker |
54
+ | `meeting-set` | Spoke to them **and** got a forward commitment |
55
+
56
+ **It is optional in the CLI and should be treated as required for any note that
57
+ describes a contact attempt.** It is the only input to the prospect's warmth, so
58
+ a call logged without it leaves the pipeline reading colder and less-worked than
59
+ it really is — and a prospect that was genuinely called three times without an
60
+ outcome recorded will never show as `stalled`, so Ashley keeps calling a dead
61
+ number.
62
+
63
+ Leave it off only for a note that wasn't an attempt: research, a finding from a
64
+ sweep, a reminder to self.
65
+
66
+ ## 1c. Reading warmth
67
+
68
+ Every prospect carries a derived `warmth` plus an attempt count. Nothing stores
69
+ it — it is computed from the call log every time it's read, so it changes on its
70
+ own as a prospect goes quiet.
71
+
72
+ | Warmth | Means | Worth more effort? |
73
+ |---|---|---|
74
+ | `hot` | Meeting set, recently | Yes — this is the closest to a sale |
75
+ | `warm` | Real conversation, recently | Yes |
76
+ | `untouched` | Nobody has called yet | Yes — needs a first attempt |
77
+ | `cold` | Tried a few times, or a conversation that went quiet | Yes — re-warmable |
78
+ | `stalled` | Called repeatedly and **never once** reached a human | No — this one is spent |
79
+
80
+ `stalled` is the only warmth that means stop. Note that a prospect you once
81
+ reached can never stall, however many no-answers follow — a conversation
82
+ happened, so going quiet is re-warmable rather than unreachable.
83
+
84
+ Sort with `--sort warm` to rank by likelihood to buy, or `--sort neglected` to
85
+ find prospects nobody has followed up on. `--sort neglected` is worth running
86
+ periodically: a prospect with no follow-up date never appears in `--due` at all,
87
+ so it's the only way those surface.
88
+
89
+ ## 1d. "Do I need more leads?"
90
+
91
+ ```
92
+ scribe prospect pipeline
93
+ ```
94
+
95
+ Reports counts per warmth and a **workable** total, which is everything except
96
+ `stalled`. Read the shape, not the total — a wall of `cold` that hasn't hit the
97
+ stall cutoff is a calling backlog and the answer is "go call them", while a wall
98
+ of `stalled` with workable near zero is a real shortage and the answer is "go
99
+ find names". A low workable count is the signal to prospect; a low total with
100
+ healthy warmth is not.
101
+
102
+ ## 2. Logging a call is the only way to reschedule
103
+
104
+ `scribe prospect log` is the one command that moves `nextFollowUpAt`. There is
105
+ no "set the follow-up date" command, deliberately: a date that changed with no
106
+ note is a reschedule nobody can explain a month later. Every change to when
107
+ Ashley next calls someone arrives attached to a dated note saying why.
108
+
109
+ - `--note <text>` is **required**. A reschedule with nothing to say is still
110
+ worth a sentence ("no answer, trying again Tuesday").
111
+ - `--next <date>` (re)schedules; `--clear-next` removes the scheduled follow-up
112
+ entirely. They're mutually exclusive.
113
+ - Omit both and the note is appended with the existing follow-up untouched.
114
+
115
+ Notes are append-only. Nothing edits or deletes one, from either surface.
116
+
117
+ ## 3. What to do unprompted, and what to ask about first
118
+
119
+ Nothing below is enforced by the CLI or the API — there is no approval flag to
120
+ set and no permission that blocks any of it. It is a judgment call every time,
121
+ and this table is the judgment. Ashley's use of Claude here is a long-term
122
+ mixture of "just handle it" and "check with me first"; getting this wrong in the
123
+ cautious direction wastes a message, and getting it wrong in the other direction
124
+ means she finds out a prospect was written off without her.
125
+
126
+ | Action | Do it, or propose it? |
127
+ |---|---|
128
+ | `prospect log` — recording a call, a voicemail, a reschedule | **Do it.** This is the routine nurture action. It's additive, it's reversible by logging again, and asking first defeats the point. Include `--outcome`. |
129
+ | `prospect list` / `prospect show` / `prospect pipeline` | **Do it.** Read-only. |
130
+ | `prospect create` | **Check for a near-duplicate first** — `prospect list --search "<part of the name>"`. A clean miss means create it. Anything that looks like the same business under a different spelling, propose it rather than creating a second record. |
131
+ | `prospect update` — a name fix, a new phone number | **Do it** when the correction is unambiguous (a typo, a number from a call she just logged). Propose a wholesale rename. |
132
+ | `prospect status … lost` | **Propose it, with the reason, and wait for a yes.** It removes the prospect from her working list. Being wrong here looks identical to her forgetting about them. |
133
+ | `prospect status … active` | **Always Ashley's call.** A won deal is a business fact she knows and the data doesn't. Never infer it from an enthusiastic note. |
134
+
135
+ The two `status` rows are the load-bearing ones. When proposing either, say which
136
+ prospect, which reason, and what the last note said — enough that she can answer
137
+ without opening the console.
138
+
139
+ ## 4. Where this is a contract, and where it's advice
140
+
141
+ | Contract | Advice |
142
+ |---|---|
143
+ | `nextFollowUpAt` changes **only** through `prospect log` — nothing else writes it | How far out to schedule a follow-up |
144
+ | Notes are append-only; no surface edits or deletes one | How much detail to put in a note |
145
+ | A status move never deletes anything, including `lost` | When to give up on a prospect |
146
+ | Deletion isn't in the CLI or the API at all — it's console-only | — |
147
+ | Warmth is derived from the call log; there's no field to set | Which warmth is worth your attention today |
148
+ | `outcome` is a **contact result** only — there is no `demo-sent` | Whether a given note needs an outcome at all |
149
+
150
+ ## Gotchas
151
+
152
+ - **A prospect's demo site is a real Scribe Site.** Ashley builds it in the CMS
153
+ because the CMS is what she's selling — own repo in the org, same as a
154
+ production site (RFC 0006). Create it with the normal `scribe site add`
155
+ flow; a won deal provisions nothing new, it just points `site.clientId` at the
156
+ now-`active` Client. RFC 0001's original summary describes a shared static
157
+ `demos` repo — that is historical and was never built. Don't repeat it.
158
+ - **Attaching that Site to the Client is console-only.** There is no `scribe`
159
+ command and no `--client` flag on `site add`: it's the **Client** box on
160
+ Staff console → **Sites** → the site. So "they bought" is two actions — the
161
+ status move, which you can run, and the attach, which you hand over as a step
162
+ for Ashley to click. Say both; an `active` Client whose Site is still attached
163
+ to nobody reads as "nobody is being billed for it" on that page.
164
+ - **`lost` is a status, not a delete.** A lost prospect keeps its whole call log
165
+ and gains a `lostReason`. It also stays in the default list — both
166
+ `prospect list` and the console's prospects view cover `prospect` **and**
167
+ `lost` — so narrow with `--status prospect` to see only live ones. What a
168
+ lost prospect does drop out of is the due queue: `--due` is prospect-only.
169
+ - **There is no `scribe prospect delete`**, and no `DELETE` under
170
+ `/api/v1/prospects`. Deleting a Client is reachable only from the staff
171
+ console, behind its confirmation dialog. If something genuinely needs
172
+ removing, that's a thing to hand to Ashley, not to work around.
173
+ - **Every prospect command needs a staff-role API key.** A non-staff key gets a
174
+ 403 from the whole `/api/v1/prospects` surface, and a read-only key gets one
175
+ from everything except `list` and `show`.
176
+ - **`--due` is "now or overdue", not "upcoming".** A prospect scheduled for next
177
+ week won't appear until the date arrives. Use `prospect list` for the whole
178
+ funnel.
179
+ - **A prospect with no follow-up scheduled sorts last, not first.** Undated
180
+ isn't urgent — but it does mean nobody has decided what happens next, so it's
181
+ worth surfacing to Ashley if one sits there. `--sort neglected` is how.
182
+ - **`demo-sent` is not an outcome**, and neither is `not-interested`. The first
183
+ is just a note; the second is `prospect status <id> lost --reason ...`.
184
+ Outcomes record how far a *contact attempt* got, nothing else.
185
+ - **Warmth decays on its own.** A `hot` prospect you don't log anything against
186
+ becomes `warm` and then `cold` with no action from anyone, because the clock
187
+ moved. That's intended — it's what stops a stale meeting looking like your
188
+ best lead — but it means warmth you read last week may differ today.
189
+ - **Don't treat warmth as a prediction.** It's a triage order. The real buying
190
+ signal is usually in the note prose ("lost a bid because the GC couldn't find
191
+ them online"), which the enum flattens. Read the notes before telling Ashley
192
+ who's closest to buying; use the sort to decide where to start reading.
@@ -0,0 +1,145 @@
1
+ # Recipe: requests
2
+
3
+ A **Request** is a Client asking the Agency to do work — a content change, a new
4
+ page, a bug report, a question (RFC 0005). It is the mirror image of a
5
+ submission, and conflating the two is the mistake to avoid:
6
+
7
+ | | Who wrote it | Who owes the answer | Where it lives |
8
+ |---|---|---|---|
9
+ | **Submission** | a Visitor, through the Client's form | the Client | `scribe submission …`, per site + collection |
10
+ | **Request** | the Client, through their dashboard | **the Agency — you** | `scribe request …`, one queue across every site |
11
+
12
+ Requests belong to the relationship rather than to a repo: nothing about one is
13
+ in the site's files, and archiving a site doesn't touch them.
14
+
15
+ §4 is the part to actually read. The rest is mechanics.
16
+
17
+ ## 1. The queue
18
+
19
+ ```
20
+ scribe request list # the queue, oldest activity first
21
+ scribe request list --unassigned # nobody has picked these up
22
+ scribe request list --mine # claimed by this key's owner
23
+ scribe request list --site rods-auto-body # one site's requests
24
+ scribe request list --status done --all # finished ones, normally hidden
25
+ scribe request show <id> # the ask + the whole thread
26
+ ```
27
+
28
+ `list` is the staff queue, so it defaults to **oldest first** — a queue is worked
29
+ from the end that has waited longest — and **hides `done`/`cancelled`**. Asking
30
+ for a closed status by name shows it anyway, so `--status done` doesn't come back
31
+ empty. `--json` on anything; the table prints the ids you need.
32
+
33
+ `total` in the JSON (and the line under the table) is the whole result, not the
34
+ page. A queue quietly showing 25 of 60 is how one stops being believed.
35
+
36
+ **Every command here needs a staff-role key.** A site user's key gets a 403 from
37
+ the whole surface, because a thread carries internal notes and claiming one only
38
+ means something from inside the Agency. A key restricted to specific sites must
39
+ pass `--site`, rather than being handed a "queue" that is silently a subset.
40
+
41
+ ## 2. The statuses, and the one that reads backwards
42
+
43
+ Fixed by the platform — unlike a form's workflow, there is nothing per-site to
44
+ read out of `.scribe.yml`.
45
+
46
+ | Status | Means | Who owes the next action |
47
+ |---|---|---|
48
+ | `open` | Filed, nobody has picked it up | **The Agency** |
49
+ | `in-progress` | Picked up, and the Client has been told | The Agency |
50
+ | `waiting-on-you` | **Waiting on the *Client*** | The Client |
51
+ | `done` | Finished | Nobody |
52
+ | `cancelled` | Dropped | Nobody |
53
+
54
+ **`waiting-on-you` is phrased from the Client's side**, because they read it on
55
+ their own dashboard — it is the Client who is being waited on, not Ashley. Read
56
+ as an agency instruction it means the opposite of what it says, and it is the one
57
+ status an agent will get backwards. The CLI prints "Waiting on client" beside it
58
+ for exactly this reason.
59
+
60
+ Use it only when the work genuinely cannot continue without an answer: it puts a
61
+ "needs you" badge on the Client's dashboard. When they reply, the request comes
62
+ back to `open` on its own.
63
+
64
+ ## 3. Working one
65
+
66
+ ```
67
+ scribe request claim <id> # take it; --release hands it back
68
+ scribe request reply <id> --message "On it — today."
69
+ scribe request reply <id> --message "DNS still at their old host" --internal
70
+ scribe request status <id> waiting-on-you
71
+ scribe request status <id> done
72
+ ```
73
+
74
+ The loop that matches how the queue is meant to read:
75
+
76
+ 1. `request show <id>` — the whole thread, before touching anything.
77
+ 2. `request claim <id>`.
78
+ 3. A short visible reply saying it's picked up. **A reply on an `open` request
79
+ moves it to `in-progress` by itself** — don't follow it with a `status` call.
80
+ 4. Do the work. Usually this is an ordinary content/design change in the site's
81
+ repo: the request names its site, and `page` often names the page.
82
+ 5. Reply with what changed, including the URL, **then** `status done`.
83
+
84
+ **Never mark a request done without a visible reply.** From the Client's side a
85
+ request that silently turns Done is indistinguishable from being ignored, and
86
+ they have no way to see what was changed.
87
+
88
+ An **internal note** (`--internal`) is Agency-only: filtered out of every read a
89
+ Client can reach, and it emails nobody. It also moves no status — thinking out
90
+ loud isn't picking something up. Use it for what you found, especially anything
91
+ that needs Dave.
92
+
93
+ ## 4. What to do unprompted, and what to show her first
94
+
95
+ Nothing below is enforced. There is no approval flag on any of these commands,
96
+ and the API will do whatever it is asked.
97
+
98
+ | Action | Do it, or propose it? |
99
+ |---|---|
100
+ | `request list` / `request show` | **Do it.** Read-only. |
101
+ | `request claim` | **Do it.** It's a label saying someone is on this, and `--release` undoes it. |
102
+ | `request reply --internal` | **Do it.** The Client never sees it, nothing is emailed, and a note nobody needed is harmless. |
103
+ | The actual work — a content change, a fix, a new page | **Do it**, to the same standard as any other edit: preview before publishing, and say what you changed. |
104
+ | `request reply` (visible) | **Show her the text first**, unless she has said otherwise this session. It is emailed to the Client the moment it's sent, it is permanent, and it speaks for her business. |
105
+ | `request status done` / `cancelled` | **Propose it.** Closing a request is a claim that the work is finished, and the Client reads the close. |
106
+ | `request status waiting-on-you` | **Propose it**, and say what you'd be asking for. It parks the request on the Client's desk. |
107
+
108
+ The visible-reply row is the load-bearing one, and it is the difference between
109
+ a useful agent and an embarrassing one. "Draft it and let me read it" is the
110
+ default posture; she can and will say "just send them" for a run of routine
111
+ ones, which is a fine thing to honour for that session.
112
+
113
+ A good way to offer the whole thing, if she asks you to work the queue: do the
114
+ changes, show each reply before sending, propose each close.
115
+
116
+ ## 5. Where this is a contract, and where it's advice
117
+
118
+ | Contract | Advice |
119
+ |---|---|
120
+ | A Request is created **only** by the Client — there is no `scribe request create`, and no POST on `/api/v1/requests` | What to do when they ask by phone instead |
121
+ | A visible reply on an `open` request moves it to `in-progress` | How quickly to acknowledge |
122
+ | Internal notes are filtered server-side from every Client-reachable read | How much to put in one |
123
+ | Messages are append-only — nothing edits or deletes one | — |
124
+ | A visible reply or a status change emails the Client; an internal note does not | — |
125
+ | `assignTo` is only ever "me" or "nobody" — assigning someone else isn't built | When to release one |
126
+ | Nothing is ever deleted, including a cancelled request | — |
127
+
128
+ ## Gotchas
129
+
130
+ - **There is no `create`.** A Request filed by the Agency on the Client's behalf
131
+ would put words in their mouth and make the queue a measure of us rather than
132
+ of them. If a Client asks for something by phone, either do it as an ordinary
133
+ edit or ask them to file it so there's a thread. Say that rather than looking
134
+ for a flag.
135
+ - **A reply is email.** Each one reaches the Client's inbox immediately; there is
136
+ no draft state and no recall. Compose it as the message it is.
137
+ - **Claiming is Agency-private.** The Client never sees who holds their request —
138
+ the assignment writes an internal note, not a thread message, so "why isn't
139
+ Ashley on this one?" is a question they can't ask.
140
+ - **Re-running a status change is safe.** A no-op transition writes no message
141
+ and sends no email, so setting `done` twice doesn't double-notify.
142
+ - **`--all` is history, not a wider filter.** It only adds `done` and
143
+ `cancelled`; everything else is in the default list already.
144
+ - **Requests survive their site being archived**, and are unreachable through
145
+ anything in the repo. Don't go looking for them in the site's files.
@@ -129,6 +129,30 @@ produced a clean commit, a green deploy, and no tracking at all.
129
129
  Cookieless, so it needs no consent banner, and `defer` keeps it off the
130
130
  critical path.
131
131
 
132
+ ## Changing a collection that already holds content
133
+
134
+ `scribe schema apply <site> --file <spec>` upserts **one whole collection by
135
+ name** — so the spec you send *is* the collection afterwards. A field you leave
136
+ out is a field you removed. Read the current definition first
137
+ (`scribe schema show <site> <collection>`), edit that, and send it back; never
138
+ write a spec from memory for a collection that already exists.
139
+
140
+ What each kind of change costs, because a schema edit and a content edit are
141
+ different risks:
142
+
143
+ | Change | Effect on existing entries |
144
+ |---|---|
145
+ | Add a field | Harmless. Existing entries read it as empty. Add `required: true` only if you're also filling it in, or every existing entry becomes invalid. |
146
+ | Remove a field | The content files keep the value, but nothing reads it and the admin stops showing it. Effectively lost. |
147
+ | Rename a field | There is no rename — it is a remove plus an add, and the old values do not follow. Moving them means editing every content file. |
148
+ | Change a field's type | The declared type generates the build's validation, so an entry whose value no longer fits **breaks the site build** rather than failing quietly. |
149
+ | Remove a collection | `scribe schema remove` **deletes its content folder too**. |
150
+
151
+ So when someone asks to "rename that field" or "change services to use a number
152
+ for price", say what it will do to the entries that already exist before you run
153
+ it. On a form collection the same applies to its submissions, which are in the
154
+ database and far harder to reconcile than files in a repo.
155
+
132
156
  ## From the CLI instead
133
157
 
134
158
  Useful when you want the schema without a checkout, or to inspect it while