sil-openclaw 0.3.7 → 0.3.9

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.
@@ -1,48 +1,97 @@
1
- # Refine your shopper or one of its domains — the refinement loop
2
-
3
- When the user wants to **sharpen their shopper** — "refine my shopper", "the cycling domain keeps surfacing the wrong stuff, let's fix it", "amend what you know about me" — do **not** re-onboard from scratch and do **not** quietly mutate anything. Run this **targeted-amend** loop: load the relevant artefact, propose concrete refinements drawn from what the shopper actually **observed** in real shopping sessions, let the user **confirm a subset**, and persist **only** the confirmed subset by re-running the existing persist step. Nothing changes silently; nothing persists without the user's explicit confirmation.
4
-
5
- Refine has **two targets** — pick the one the user means:
6
-
7
- - **The shopper itself** — the **shared `user_spec.md`** (cross-niche facts + hard constraints that carry across every niche), or the **persona** (the host `SOUL.md`).
8
- - **One domain** — a single niche pack (target it by **slug**): its `domain_spec.md` (niche mechanics), `intent_spec.md` (decomposition dimensions), or `playbook.md` (the niche buying taste).
9
-
10
- This is a distinct capability from creating the shopper ([`agent_creation_engine.md`](agent_creation_engine.md), which CREATES) and from the shop-time loop (which SHOPS). The default is a **targeted amend**, not a full cold re-onboard. Run these steps **in order, top to bottom** — the order is the spec.
11
-
12
- ## The refinement loop (run in this exact order)
13
-
14
- 1. **Trigger + load the target.** Refinement starts only when the user **explicitly asks** to sharpen the shopper or a **named** domain. At the end of a session you MAY *offer* to refine — but that offer is a prompt only: it loads nothing, proposes nothing, and persists nothing until the user accepts and then clears the explicit confirm gate in step 3. An ambiguous, silent, or off-topic remark is **never** a trigger. Once triggered, load the relevant artefacts with **`sil_profile_get { domainSlug? }`**:
15
- - To refine the **shopper**, load the **overview** (no `domainSlug`) — the shared `userSpec` + the domain index.
16
- - To refine **one domain**, pass its **`domainSlug`** — its `domainSpec` / `intentSpec` / `playbook` bodies **plus** the shared `userSpec`.
17
- The persona is the host workspace **`SOUL.md`**, read separately when a persona refinement is on the table. Everything you propose is grounded in what the shopper already is.
18
-
19
- 2. **Propose, session-grounded — concretely, never a generic template.** Propose a small set of **concrete refinements drawn from the observed session** — what the shopper actually saw in the just-completed (or in-progress) session. Each proposal must name **two things**:
20
- - **which artefact element it changes** — a **persona** standing rule (the host `SOUL.md`), a **shared user-spec** fact or hard constraint (`user_spec.md` — e.g. a standing measurement, "never leather" as a hard constraint — carries across every niche), or, within **one named domain**, a **domain-spec** mechanic (`domain_spec.md`), an **intent-spec** dimension (`intent_spec.md`), or a **buying-taste** preference (`playbook.md` — a brand the user keeps rejecting in this niche, a tightened budget band); and
21
- - **the concrete observed evidence behind it** — a `sil_search` param mapping that returned **relevant** vs **irrelevant** items, a question that turned out to matter (or was noise), a candidate the user **accepted** or **rejected**, or a fact/taste/constraint the user **volunteered but the spec never captured** (e.g. "you said 'nothing over 8kg' three times" → a shared `user_spec.md` hard constraint; "you rejected every leather option" → a shared hard constraint; "you kept asking about lug depth, which the cycling domain spec never covered" → that domain's `domain_spec.md` mechanic; "every cycling request turned on frame size, but its intent schema never decomposed on it" → that domain's `intent_spec.md` dimension).
22
-
23
- **Scope each proposal correctly:** a cross-niche fact/constraint or persona change targets the **shopper** (shared `user_spec.md` / `SOUL.md`); a niche-mechanical change targets **one domain's** pack. The **per-query intent** is ephemeral and is never a refine target — only a domain's `intent_spec.md` *dimension schema* is. Every proposal cites the observed evidence — it is **grounded**, not guesswork; a proposal not tied to anything the session showed is forbidden. (When the observed session is unavailable, do not invent one — see the fallback at the foot of this reference.)
1
+ ---
2
+ name: refine-shopper
3
+ description: The refinement loop — sharpen the shopper or one domain from observed sessions, confirm-before-persist. Load when the user asks to refine, sharpen, or amend their shopper or a niche.
4
+ ---
24
5
 
25
- 3. **Confirm — the gate, before anything persists.** Present the proposals and let the user **confirm a subset** — all, some, or none (per-proposal accept/reject). Confirmation is an **explicit affirmative act** on specific proposals. It is **never inferred from silence**, and **never** from the user answering an **off-topic** / unrelated question. This is the strongest invariant of the loop, re-applying the create engine's endorsement discipline at refine time — *see [`brainstorm_interview.md`](brainstorm_interview.md) for the endorsement-gate discipline; do not restate it here.* Until the user confirms, the proposals live **only in the conversation**.
26
-
27
- 4. **Persist ONLY the confirmed subset — scoped to the right target.** Fold **only the confirmed** proposals into the right artefact, then re-run the engine's persist step over the matching target — refine is a **whole-doc path**, so it uses **`sil_profile_materialize`** (not `sil_remember`):
28
- - A **shared user-spec** change (cross-niche fact / hard constraint) → **`sil_profile_materialize { name, userSpec }`** with **NO `domain`** — read the current shared `userSpec`, fold the confirmed change in, pass it back. This overwrites only the shared `user_spec.md`; no domain pack is touched.
29
- - A **domain** change (a domain-spec mechanic, an intent-spec dimension, or a buying-taste preference for one niche) → **`sil_profile_materialize { name, userSpec, domain: { slug, name, domainSpec, intentSpec, playbook } }`** scoped to **that one slug** — read the current pack, fold the confirmed change into the relevant body, pass all three domain bodies (+ the unchanged shared `userSpec`) back. This re-mints exactly that one `domains/<slug>/` pack; sibling domains and the shared spec are untouched.
30
- - A **persona** change → refresh the agent's workspace **`SOUL.md`** via the host CLI — the persona is the `SOUL.md`, not a sil artefact, so a persona refinement is a host-CLI `SOUL.md` re-write, **NOT** a `sil_profile_materialize` call.
31
-
32
- The unconfirmed proposals are **discarded** with the conversation; nothing else persists. If the user confirms nothing, nothing changes. The re-materialize is an **atomic in-place re-write** of the targeted artefact(s) (the store's existing idiom; do **not** hand-roll a write under the sil data directory). **On a persist failure the prior artefacts are left intact** — the shopper is never served half-refined, and you tell the user the refinement **did not stick**. *Truthful failure-safety note: the re-write is per-file atomic and dir-preserving — a failed re-write never tears the shopper down and never serves a coherent half-refined pack (a broken manifest reads back as not-found, fail-closed). It is **not** a cross-file transaction; the safety property is "fails closed, prior state intact / never half-served", not "all files roll back together".*
33
-
34
- 5. **Close the loop — the refined shopper reflects the kept changes on re-run.** A later session loads the **updated** artefacts (the same Runtime hook the engine documents) and behaves accordingly — the new shared hard-no, the deeper cycling domain spec, the sharper intent dimensions, the tightened niche taste. The improvement is durable: refinement is **iterative, never one-shot** — a change that did not land well is itself refinable next time.
35
-
36
- 6. **Isolation — the targeted artefact only.** A domain refinement touches exactly that one `domains/<slug>/` pack — **siblings and the shared user spec are untouched** (unless the shared spec is the target). A shared-spec or persona refinement touches the shopper level and **no domain pack**. And the **generic, profile-less shopping path is untouched** (a plain sil session still shops exactly as today). One target's sharpening never leaks into another.
37
-
38
- ## Privacy + scope — per-user and local
39
-
40
- The improvement is **per-user and local**: written only to this user's sil data directory (`$SIL_DATA_DIR/shopper/`), on this machine. There is **no server-side aggregation, no shared store, no cross-user signal** — the refine path calls **no server endpoint** and performs **no identity round-trip**. The shopper gets sharper for this user alone; nothing is pooled or shared.
41
-
42
- ## How a refinement reaches the `sil_search` params
6
+ # Refine your shopper or one of its domains — the refinement loop
43
7
 
44
- A refinement to what the shopper searches on lands in an artefact — a shared fact in `user_spec.md`, or, within a domain, a mechanic in `domain_spec.md`, a dimension in `intent_spec.md`, or a taste in `playbook.md` — and those feed the **shop-time** mapping ([`search_param_mapping.md`](search_param_mapping.md)). The mapping maps **only onto real `sil_search` params** — a refined fact/taste with **no matching param** folds into the `query` text or the recommend-time rubric, **never an invented filter**. The `ship_to` rule is unchanged at refine time too: leave it empty (the server resolves the registered default) — no identity round-trip to populate it. **Do not restate the param table here** — point at [`search_param_mapping.md`](search_param_mapping.md).
8
+ When the user wants to **sharpen their shopper** — "refine my shopper", "the cycling
9
+ domain keeps surfacing the wrong stuff", "amend what you know about me" — do **not**
10
+ re-onboard and do **not** quietly mutate anything. Run this **targeted-amend** loop:
11
+ load the relevant artefact, propose refinements drawn from what the shopper actually
12
+ **observed** in real sessions, let the user **confirm a subset**, and persist **only**
13
+ the confirmed subset. Nothing changes silently; nothing persists without confirmation.
14
+
15
+ Refine has **two targets**:
16
+
17
+ - **The shopper itself** — the **shared `user_spec.md`** (cross-niche facts + hard
18
+ constraints), or the **persona** (the host `SOUL.md`).
19
+ - **One domain** — a single niche **domain pack**, targeted by **slug**: its
20
+ `domain_spec.md`, `intent_spec.md`, or `playbook.md`.
21
+
22
+ This is distinct from creating the shopper
23
+ ([`agent_creation_engine.md`](agent_creation_engine.md)) and from the shop loop (which
24
+ SHOPS). Run the steps **in order**.
25
+
26
+ ## The refinement loop
27
+
28
+ 1. **Trigger + load the target.** Refinement starts only when the user **explicitly
29
+ asks** to sharpen the shopper or a **named** domain. At session end you MAY *offer*
30
+ to refine, but that offer loads/proposes/persists nothing until the user accepts and
31
+ clears the confirm gate (step 3). Load with **`sil_profile_get { domainSlug? }`** —
32
+ the overview (no slug) for the shopper, or a `domainSlug` for one domain's pack (+
33
+ the shared `userSpec`). Read the persona from the host **`SOUL.md`** when it is on
34
+ the table.
35
+ 2. **Propose, session-grounded — never a generic template.** Propose a small set of
36
+ **concrete refinements drawn from the observed session** — what the shopper actually
37
+ saw. Each proposal names **which artefact element it changes** (a persona rule, a
38
+ shared `user_spec.md` fact/constraint, or — within one named domain — a
39
+ `domain_spec.md` mechanic, an `intent_spec.md` dimension, or a `playbook.md` taste)
40
+ **and the concrete observed evidence** (a param mapping that returned relevant vs
41
+ irrelevant items, a candidate accepted or rejected, a fact the user volunteered but
42
+ the spec never captured — "you said 'nothing over 8kg' three times" → a shared hard
43
+ constraint; "you kept asking about lug depth" → that domain's `domain_spec.md`).
44
+ Scope each correctly: a cross-niche fact/constraint or persona change targets the
45
+ **shopper**; a niche-mechanical change targets **one domain's** pack. The per-query
46
+ intent is ephemeral and never a refine target — only a domain's `intent_spec.md`
47
+ *schema* is. Every proposal cites its evidence; an ungrounded one is not proposed.
48
+ 3. **Confirm — the gate.** Present the proposals and let the user **confirm a subset** —
49
+ all, some, or none (per-proposal accept/reject). Confirmation is an explicit
50
+ affirmative act; it is **never inferred from silence**, and never from an
51
+ **off-topic** reply. Until the user confirms, the proposals live only in the
52
+ conversation. (This re-applies the create engine's endorsement discipline — see
53
+ [`brainstorm_interview.md`](brainstorm_interview.md); do not restate it here.)
54
+ 4. **Persist ONLY the confirmed subset — scoped to the right target.** Fold **only the
55
+ confirmed** proposals in and re-run the engine's persist step — refine is a
56
+ **whole-doc** path, so it uses **`sil_profile_materialize`** (not `sil_remember`):
57
+ - A **shared user-spec** change → **`sil_profile_materialize { name, userSpec }`**
58
+ with **no `domain`** — overwrites only the shared `user_spec.md`.
59
+ - A **domain** change → **`sil_profile_materialize { name, userSpec, domain: { slug,
60
+ name, domainSpec, intentSpec, playbook } }`** scoped to **that one slug** —
61
+ re-mints exactly that `domains/<slug>/` pack; siblings + the shared spec untouched.
62
+ - A **persona** change → refresh the workspace **`SOUL.md`** via the host CLI — a
63
+ persona refinement is a host-CLI `SOUL.md` re-write, **not** a
64
+ `sil_profile_materialize` call.
65
+ The re-materialize is an **atomic in-place re-write** (the store's idiom; do not
66
+ hand-roll a write). **On a persist failure the prior artefacts are left intact** —
67
+ never a half-refined shopper — and you tell the user the refinement did not stick.
68
+ 5. **Close the loop.** A later session loads the **updated** artefacts and behaves
69
+ accordingly. Refinement is iterative — a change that did not land is refinable next
70
+ time.
71
+ 6. **Isolation.** A domain refinement touches exactly that one `domains/<slug>/` pack —
72
+ **siblings and the shared user spec are untouched** unless the shared spec is the
73
+ target — and the profile-less path is untouched. One target's sharpening never leaks
74
+ into another.
75
+
76
+ ## Per-user + local
77
+
78
+ The improvement is **per-user and local**: written only to this user's sil data
79
+ directory (`$SIL_DATA_DIR/shopper/`), on this machine. No server-side aggregation, no
80
+ cross-user signal, no identity round-trip.
81
+
82
+ ## How a refinement reaches the params
83
+
84
+ A refined fact / mechanic / dimension / taste lands in an artefact and feeds the
85
+ **shop-time** mapping ([`search_param_mapping.md`](search_param_mapping.md)) — real
86
+ `sil_search` params only; a refinement with no matching param folds into `query` or the
87
+ rubric, never an invented filter. The `ship_to` rule is unchanged (leave it empty; the
88
+ server resolves the registered default). **Do not restate the param table here** — point
89
+ at [`search_param_mapping.md`](search_param_mapping.md).
45
90
 
46
91
  ## When there is no observed-session signal
47
92
 
48
- If the user asks to refine but **no observed session** is available — a fresh session, or the prior session is out of context — do **not fabricate** session observations to propose against. Fall back to a **guided amend**: ask the user what they want to change (and apply the same confirm-before-persist gate to whatever they describe), or **invite them to shop a session first** so the next refinement has real evidence to ground proposals in. Never invent observations.
93
+ If the user asks to refine but **no observed session** is available (a fresh session, or
94
+ the prior one is out of context), do **not fabricate** observations. Fall back to a
95
+ **guided amend**: ask the user what to change (apply the same confirm-before-persist
96
+ gate), or **invite them to shop a session first** so the next refinement has real
97
+ evidence. Never invent observations.
@@ -1,55 +1,79 @@
1
- # Answer→`sil_search`-param mapping (the mapping is real)
2
-
3
- Load this at shop time, when the shop loop maps a decomposed request into a `sil_search` call ([`shop_loop.md`](shop_loop.md) Step 4). The mapping must target the **real `sil_search` parameters** (the shopping loop's catalog tool, named in `SKILL.md`) and nothing else — never invent a filter. (Under SDS there is no stored "answer→param mapping" seller artefact — the niche knowledge of *what* to search on lives in the active domain's domain spec; this reference is the generic param table the mapping draws on.)
4
-
5
- ## The parameters available to map onto
6
-
7
- | User's stated input | `sil_search` param it maps to |
8
- |---|---|
9
- | A budget ("under €1500", "€800–1200") | `price_min` / `price_max` — **in the currency's ISO 4217 minor unit** (cents): €1500 → `price_max: 150000` |
10
- | "Prefer secondhand" / "used is fine" | `condition: ["secondhand"]` |
11
- | "New only" | `condition: ["new"]` |
12
- | The narrowed niche + key descriptors | `query` (free text) and/or `category` |
13
- | "In stock only" (the default) / "show me out-of-stock too" | `available` (omit for in-stock default; `false` to include unavailable) |
14
- | "Buy from a local/domestic shop" | `local_merchants: true` (a best-effort ranking *bias*, not a hard filter — and *optionally*, to surface more local shops, issue the `query` in that country's language; a tactic, never an override of a language the user deliberately chose) |
15
-
16
- A stated taste with **no matching param** (e.g. "I like bold colours", "prefer eco-friendly brands") does **not** become a new param — fold it into the `query` text or into the recommendation rubric. There is no `color` filter, no `brand` filter; inventing one produces a shopper that emits invalid `sil_search` calls at shop time.
17
-
18
- ## SDS mapping inputs — the decomposed intent, the shared user facts, the domain buying taste, the domain mechanics
19
-
20
- Under [Spec-Driven Shopping](shop_loop.md), the mapping reads several layers, not only the user's words for *this* request:
21
-
22
- - The **decomposed per-query intent** (the active domain's `intent_spec.md` dimensions filled in for this request — ephemeral) is the most specific layer and wins for *preferences* (precedence **intent > playbook(domain) > user_spec(SHARED) > domain_spec(domain)**).
23
- - The **buying taste** (the active domain's `playbook.md`) supplies the user's standing preferences for *this niche* — budget band, brand likes/dislikes — these map to params (a budget band → `price_min`/`price_max`) exactly like a freshly-stated answer would, but are **never re-asked**. Taste is per-domain — it does not carry to another niche.
24
- - The **shared user spec** (`user_spec.md`) supplies the user's standing **facts** (a foot profile, a compatibility detail) and the **hard constraints**, reused across **every** niche — facts map to params like any stated answer; the stored value fills the param, never re-asked.
25
- - The **domain spec** (the active domain's `domain_spec.md`) supplies the niche's **decision-mechanics** — which attributes are load-bearing for *this* niche (last volume, rim depth, gearing range), so the mapping knows what to map and what matters.
1
+ ---
2
+ name: search-param-mapping
3
+ description: The shop-time answer→sil_search parameter mapping — real params only, hard-constraint routing, the ship_to rule. Load when mapping a decomposed request into a sil_search call.
4
+ ---
26
5
 
27
- The param table itself is **unchanged** — these layers are inputs to the same mapping, not new params. A domain dimension, a standing user fact, or a taste with **no matching param** folds into `query`/rubric per the no-invented-filter rule above, exactly like any other non-param taste.
28
-
29
- ## Hard constraints — route to a real filter AND a reject-at-recommend rule, NEVER only `query` text
30
-
31
- A **shared user-spec hard constraint** ("never leather", "nothing over 8 kg", an allergy, an age gate) is **inviolable** in *every* niche — the shopper never recommends a violating item. A hard constraint carried **only** as soft `query` free text leaks: the catalog can still surface a violating product, and recommending it is a defect. So map every hard constraint to **two** enforcement points, **not merely `query`**:
32
-
33
- 1. **A real `sil_search` filter where one exists.** "New only" / "secondhand only" → `condition`; "in stock only" → `available` (omit for the in-stock default). Where a param matches the constraint, set it so the catalog never returns the violating item at all.
34
- 2. **An explicit reject-at-pick rubric rule** ([`shop_loop.md`](shop_loop.md) Step 6). For a constraint with **no matching param** (no `material` filter for "never leather"), the constraint becomes a rubric rule that **rejects** any violating candidate outright — **never recommend** it — rather than down-weighting it. A hard constraint is a reject, not a weight.
35
-
36
- A hard constraint that lands **only** in `query` text is **not** enforced — it is a hint, not a filter, and the catalog may ignore it. Route it to a filter and a reject rule; the `query` text is at most an additional nudge, never the sole carrier of an inviolable constraint.
37
-
38
- ## `ship_to` stays EMPTY by default — inline rule (do not skip)
39
-
40
- Do **not** map the user's location onto `ship_to`, and do **not** instruct the shopper to call `sil_whoami` to populate it. When `ship_to` is absent, sil-api resolves the user's **registered default address** server-side. Set `ship_to` (a `{ country, region?, postal_code? }` object of ISO codes) **only** to OVERRIDE the default with a *different* destination than the registered address (e.g. "ship this to my office in Germany"). The shopper inherits correct location-aware search by construction — leave `ship_to` out, and never round-trip `sil_whoami` to fill it.
41
-
42
- ## Worked param examples
6
+ # Answer→`sil_search`-param mapping (the mapping is real)
43
7
 
44
- At shop time the mapping translates the decomposed intent + the stored facts/taste into concrete params. For a shopper's road-cycling domain whose user said (this request, plus a stored €1200 budget taste in that domain) "secondhand is fine, I'm in France and want local shops":
8
+ Load this at shop time, when the shop loop maps a decomposed request into a
9
+ `sil_search` call ([`shop_loop.md`](shop_loop.md) Beat 5). The mapping targets the
10
+ **real `sil_search` parameters** and nothing else — never invent a filter.
11
+
12
+ **The param catalog lives in the `sil_search` tool description** — the full list and
13
+ their forms (`query`/`category`; `price_min`/`price_max` in the currency's ISO 4217
14
+ minor unit; `condition` = `["new"]`/`["secondhand"]`; `available`; `local_merchants`;
15
+ `ship_to` as ISO codes). Read it there; do not restate it here. Under SDS there is no
16
+ stored "answer→param" seller artefact — *what* to search on for a niche lives in the
17
+ active domain's `domain_spec.md`; this reference covers only the SDS layers that feed
18
+ the mapping and the two rules the mapping must hold.
19
+
20
+ ## What feeds the mapping — the SDS layers
21
+
22
+ The mapping reads several layers, not just the user's words for this request:
23
+
24
+ - The **decomposed per-query intent** (the active `intent_spec.md` filled for this
25
+ request — ephemeral) is most specific and wins for *preferences* (precedence
26
+ **intent > playbook(domain) > user_spec(SHARED) > domain_spec(domain)**).
27
+ - The **shopping taste** (the active `playbook.md`) supplies standing preferences for
28
+ *this niche* — a budget band → `price_min`/`price_max` exactly like a freshly-stated
29
+ answer, but **never re-asked**. Taste is per-domain.
30
+ - The **shared user spec** (`user_spec.md`) supplies standing **facts** and the **hard
31
+ constraints**, reused across **every** niche — a fact maps to a param like any answer.
32
+ - The **domain spec** supplies the niche's decision-mechanics — which attributes are
33
+ load-bearing here — so the mapping knows what to map and what matters.
34
+
35
+ These layers are inputs to the same params, not new params. A stated taste with **no
36
+ matching param** (a colour, a brand, "eco-friendly") folds into the `query` text or the
37
+ recommendation rubric — **never a new filter**. There is no `color` or `brand` param;
38
+ inventing one emits invalid `sil_search` calls.
39
+
40
+ ## Hard constraints — a real filter AND a reject-at-recommend rule, NEVER only `query`
41
+
42
+ A shared user-spec **hard constraint** ("never leather", "nothing over 8 kg", an
43
+ allergy, an age gate) is **inviolable** in every niche. A hard constraint carried
44
+ **only** as soft `query` text leaks — the catalog can still surface a violating item.
45
+ Route each to **two** points, **not merely `query`** (see
46
+ [`shop_loop.md`](shop_loop.md) Beat 5):
47
+
48
+ 1. **A real `sil_search` filter where one exists** — "new/secondhand only" →
49
+ `condition`; "in stock only" → `available` (omit for the in-stock default). Where a
50
+ param matches, set it so the catalog never returns the violating item.
51
+ 2. **An explicit reject-at-pick rubric rule** for a constraint with no matching param
52
+ (no `material` filter for "never leather"): the constraint **rejects** any violating
53
+ candidate outright, never down-weights it. A hard constraint is a reject, not a
54
+ weight.
55
+
56
+ ## `ship_to` stays EMPTY by default
57
+
58
+ Do **not** map the user's location onto `ship_to`, and do **not** call `sil_whoami` to
59
+ populate it. When `ship_to` is absent, sil-api resolves the user's **registered default
60
+ address** server-side. Set `ship_to` only to OVERRIDE the default with a *different*
61
+ destination (e.g. "ship this to my office in Germany"). The shopper inherits
62
+ location-aware search by construction — leave `ship_to` out.
63
+
64
+ ## Worked example
65
+
66
+ For a road-cycling domain whose user said (this request + a stored budget taste in that
67
+ domain) "secondhand is fine, I'm in France and want local shops":
45
68
 
46
69
  ```
47
- query: "<niche descriptors from the answer>" # e.g. "endurance road bike 105 groupset"
70
+ query: "endurance road bike 105 groupset" # niche descriptors
48
71
  category: "<the narrowed niche category>"
49
72
  price_max: 120000 # €1200 → minor units (cents)
50
- condition: ["secondhand"] # "secondhand is fine"
51
- local_merchants: true # "want local shops" → ranking bias; optionally query in the local language (e.g. French) to surface more of them
52
- # ship_to: OMITTED — server resolves the registered default address; no sil_whoami round-trip
73
+ condition: ["secondhand"]
74
+ local_merchants: true # ranking bias; optionally query in French to surface more local shops
75
+ # ship_to: OMITTED — server resolves the registered default address
53
76
  ```
54
77
 
55
- Budget → `price_max` (cents), "secondhand is fine" → `condition`, "want local shops" → `local_merchants: true`; `ship_to` left out so the server resolves the registered default. A non-param taste ("understated colours") folds into `query` or the rubric, never a new filter.
78
+ A non-param taste ("understated colours") folds into `query` or the rubric, never a new
79
+ filter.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: setup-onboarding
3
+ description: The one-time setup script the router defers to — the five-stage onboarding progression, the after-register shopper offer, and the per-search pitch. Load while a shopper is still being set up (SKILL.md routes here); it is shed once setup is complete.
4
+ ---
5
+
6
+ # Setting up the shopper — the staged onboarding
7
+
8
+ The router defers the **one-time setup script** here: the five-stage **progression**, the
9
+ after-register offer, and the per-search pitch. None of it applies once setup is complete
10
+ — the router sheds it. Read every stage from state, never guess: `sil_whoami` (is there a
11
+ sil identity yet?) plus the no-arg `sil_profile_get` overview (does a shopper exist — the
12
+ `name` field — and does it hold any `domains`?). Present **only the current stage's beat
13
+ and its single next step**.
14
+
15
+ ## The five-stage progression — present one stage, shed it on completion
16
+
17
+ 1. **Unregistered** — `sil_whoami` finds no sil identity. Before `sil_register` runs, set
18
+ the expectation: state plainly what registering does and **how 4GPTs & SIL use the
19
+ user's data**, grounded strictly in this plugin — no invented policy. Registering opens
20
+ a browser sign-in and creates their **sil identity** (name + addresses, read by
21
+ `sil_whoami`), stored **locally**; their shopper's setup and memory live in a **local
22
+ profile store** under `$SIL_DATA_DIR`, never leaving the device via the plugin; catalog
23
+ **search** queries sil's product catalog. Next: `sil_register`.
24
+ 2. **Registered, no shopper** — a sil identity exists, no shopper yet. Bare `sil_search`
25
+ works now, but is not the finished state. Guide the user to **set up their shopper**,
26
+ naming **up front, before the onboarding starts**, that it takes a **couple of minutes
27
+ and a few questions**. The after-register offer below owns the gate.
28
+ 3. **Shopper, no domain yet** — `name` present, `domains: []`. The first shopping intent
29
+ **mints the first domain**, announced with the inferred niche stated so the user can
30
+ correct it. Next: state a shopping intent.
31
+ 4. **Shopper active** — `name` present, `domains` non-empty. Check off the completion
32
+ **milestones**: the **first domain created** (`domains` now non-empty) and, softer, that
33
+ the memory tool has been used (`sil_remember` stored a fact or taste — a soft self-check
34
+ judged from whether this shopper has ever remembered anything).
35
+ 5. **Setup complete** — a shopper with at least one domain. **Shed** every onboarding beat:
36
+ none of the stages above apply. **Show only how to use** the plugin well — the
37
+ **domain-gated shop loop** and **Spec-Driven Shopping** ([`shop_loop.md`](shop_loop.md)).
38
+
39
+ ## After register — offer to set up the shopper, once (offer_shopper)
40
+
41
+ `sil_register` returns `already_registered` with `next_step: "offer_shopper"` on a
42
+ confirmed registration. That hint is a breadcrumb: first run a **no-arg `sil_profile_get`**
43
+ (the overview) to read shopper state, then branch:
44
+
45
+ - **Empty store — no shopper yet:** introduce the shopper in one short beat and offer to
46
+ set it up — name the value (it shops each niche in depth, reuses the sizes and hard
47
+ limits it already knows so nothing is re-asked, explains why each pick fits). Load
48
+ [`brainstorm_interview.md`](brainstorm_interview.md) **only if the user accepts** (a
49
+ yes). Take no for an answer; bare `sil_search` stays first-class.
50
+ - **A shopper already exists:** **skip this beat** entirely. The shopper is a **singleton**
51
+ — never offer a second one.
52
+
53
+ ## After a bare search — the per-search pitch (post-result)
54
+
55
+ When a plain `sil_search` **completes with status `ok`** in a **profile-less** session,
56
+ present the results best-first **exactly as they came back**, then append **one short
57
+ trailing line** naming what a shopper would add. It is never a pre-search question and
58
+ never a re-rank. Name one or two of the three levers, rotating which you lead with:
59
+
60
+ - **niche depth** — a shopper weighs these picks against how the niche actually buys;
61
+ - **memory** — it keeps your sizes and hard limits on file, so no search re-asks them;
62
+ - **the why** — it explains which pick fits you and why.
63
+
64
+ This line **recurs on every** completed profile-less search — the recurrence is the point;
65
+ there is **no fire-once or seen-it gate, and no cooldown**. Brevity plus lever rotation
66
+ keep it from nagging. Two things suppress it: a **shopper already exists** (that session is
67
+ the shopper's — **drop the line**), or the search **did not complete `ok`** (a non-ok
68
+ status carries its own recovery — follow that and add no tip).