sil-openclaw 0.3.0 → 0.3.3
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.
- package/CHANGELOG.md +72 -0
- package/README.md +33 -37
- package/dist/lib/credentials.js +1 -1
- package/dist/lib/profile-store.js +126 -67
- package/dist/lib/sil-client.js +2 -2
- package/dist/tools/catalog.js +10 -8
- package/dist/tools/identity.js +3 -3
- package/dist/tools/profile.js +91 -55
- package/openclaw.plugin.json +3 -3
- package/package.json +1 -1
- package/skill/SKILL.md +1 -1
- package/skill/examples/road_cycling_expert_walkthrough.md +112 -68
- package/skill/references/agent_creation_engine.md +41 -30
- package/skill/references/brainstorm_interview.md +49 -40
- package/skill/references/catalog_tools_reference.md +1 -1
- package/skill/references/expert_shopping.md +51 -84
- package/skill/references/manage_experts.md +17 -75
- package/skill/references/refine_expert.md +11 -9
- package/skill/references/search_param_mapping.md +25 -5
|
@@ -1,65 +1,76 @@
|
|
|
1
1
|
# Create a sil-wired shopping expert — the agent-creation engine
|
|
2
2
|
|
|
3
|
-
**Precondition:
|
|
3
|
+
**Precondition: run this ONLY after the user has explicitly endorsed the assembled draft from [`brainstorm_interview.md`](brainstorm_interview.md).** Any step below before that endorsement is forbidden — the interview owns the gate.
|
|
4
4
|
|
|
5
|
-
When the user wants a **dedicated shopping expert
|
|
5
|
+
When the user wants a **dedicated shopping expert**, author and persist a **valid OpenClaw agent profile**: a real new agent under the host `agents` config, with the **sil plugin enabled**, the **sil skill attached**, its persona written into the workspace **`SOUL.md`**, plus the expert's SDS behaviour artefacts in the sil data directory — so it shops with **no further setup**.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Every created expert runs **entirely on Spec-Driven Shopping (SDS)** — the operating model, not an optional layer. The engine persists **all four** SDS specs, each **required and non-blank**: the deep researched `domainSpec`, the derived `intentSpec` schema, and an **initial** `userSpec` + `playbook` (seeded *partial* by the interview's one-touchpoint-per-document setup). All four are present from creation, then **augmented every query** ([`expert_shopping.md`](expert_shopping.md)) — we keep learning.
|
|
8
|
+
|
|
9
|
+
You are the engine: the host config write (and the `SOUL.md` write) is **you driving the host's own `openclaw …` CLI** — the sil plugin never writes the host config. Run the steps **in order, top to bottom** — the order is the spec.
|
|
8
10
|
|
|
9
11
|
## The profile spec (input)
|
|
10
12
|
|
|
11
|
-
The endorsed draft
|
|
13
|
+
The endorsed draft feeds two stores. The **persona** becomes the host workspace **`SOUL.md`** (its identity / voice / standing rules — via the host CLI, **not** a sil artefact). The **four SDS specs** become the sil data-dir artefacts:
|
|
12
14
|
|
|
13
|
-
| Field | Meaning | Required? |
|
|
14
|
-
|
|
15
|
-
| **agentId** |
|
|
16
|
-
| **name** | Human-readable
|
|
17
|
-
| **persona
|
|
18
|
-
| **workspace** | The agent's workspace directory (e.g. `~/.openclaw/workspace-gift-buyer`). | Required for the non-interactive add |
|
|
19
|
-
| **
|
|
15
|
+
| Field | Meaning | Goes to | Required? |
|
|
16
|
+
|---|---|---|---|
|
|
17
|
+
| **agentId** | Lower-kebab id (e.g. `gift-buyer`) → `agents.list[].id`. Unique, never `main`. | host | Required |
|
|
18
|
+
| **name** | Human-readable name ("Gift Buyer"). | sil manifest | Required |
|
|
19
|
+
| **persona** | Who this expert is and how it shops. | host **`SOUL.md`** (via host CLI — no `persona.md`) | Required (non-empty) |
|
|
20
|
+
| **workspace** | The agent's workspace directory (e.g. `~/.openclaw/workspace-gift-buyer`). | host | Required for the non-interactive add |
|
|
21
|
+
| **domainSpec** | The niche's **deep researched expertise** — how to buy well, the full mechanics — from the interview's §2 research pass. Web-refreshed every query. | sil `domain_spec.md` | **Required (non-empty)** |
|
|
22
|
+
| **intentSpec** | The agent-specific **decomposition dimensions** (PRD-style schema) **derived from `domainSpec`**, signed off in §5. | sil `intent_spec.md` | **Required (non-empty)** |
|
|
23
|
+
| **userSpec** | The user's domain-relevant facts + hard constraints. **Seeded partial** from §3 (the one basic fact), then augmented per-query. | sil `user_spec.md` | **Required (non-empty)** |
|
|
24
|
+
| **playbook** | The user's **buying taste**. **Seeded partial** from §4 (the compare-options answer), then augmented per-query. | sil `playbook.md` | **Required (non-empty)** |
|
|
25
|
+
|
|
26
|
+
The **sil plugin** and **sil skill** are always attached (that is what makes it *sil-wired*). Creation is **local and offline** — it does **not** require or perform sil registration, reads no token, and writes nothing to identity storage. The expert registers the user later, on first shop, via `sil_register`. Do **not** present registration as a prerequisite.
|
|
20
27
|
|
|
21
|
-
The
|
|
28
|
+
## The created expert needs WEB tools
|
|
29
|
+
|
|
30
|
+
SDS **web-refreshes the domain spec on every query** and the §2 research pass also reaches the web. So the created agent must have **web/fetch tools in its tool profile** — inherited from `agents.defaults` when its shell is created (step 3). Confirm that profile grants a web-fetch/browse capability and **do not deny it** (alongside not denying the `sil_*` tools). If `agents.defaults` does **not** grant a web tool, the expert cannot keep its domain spec current — surface that to the user as a host-capability gap; do **not** pretend the refresh happened.
|
|
22
31
|
|
|
23
32
|
## Engine steps (run in this exact order)
|
|
24
33
|
|
|
25
|
-
1. **Validate the spec FIRST — before anything is written.** Check `agentId`
|
|
34
|
+
1. **Validate the spec FIRST — before anything is written.** Check `agentId` (present, lower-kebab, unique-looking, ≠ `main`), `name`, `persona`, `workspace`, and the **four SDS specs — `domainSpec`, `intentSpec`, `userSpec`, `playbook` — all present and non-blank** (none is an "absent-is-fine" slot; the user side is seeded *partial* by the interview, never omitted). On any failure, stop with **`invalid_request`** naming the field and **write nothing**. This runs ahead of every host command, so a bad spec never reaches the host.
|
|
26
35
|
|
|
27
|
-
2. **Collision check — read before write.** Run `openclaw agents list --json
|
|
36
|
+
2. **Collision check — read before write.** Run `openclaw agents list --json`; if `agentId` already exists, stop with **`collision`** and **do not** run `openclaw agents add` — never overwrite an existing agent's persona or wiring. Surface it so the user can rename.
|
|
28
37
|
|
|
29
38
|
3. **Create the agent shell (host CLI).** Run:
|
|
30
39
|
```
|
|
31
40
|
openclaw agents add <agentId> --workspace <workspace> --non-interactive --json
|
|
32
41
|
```
|
|
33
|
-
This creates the real `agents.list[]` entry and the
|
|
42
|
+
This creates the real `agents.list[]` entry and the workspace bootstrap files (`SOUL.md`, `AGENTS.md`, …), inheriting model and **tool profile** (which must grant **web/fetch** — see above) from `agents.defaults`. `--non-interactive --json` lets you drive it without a prompt and read the result.
|
|
34
43
|
|
|
35
|
-
4. **
|
|
36
|
-
- **`persona.md`** — the persona/instructions that power the expert's behaviour;
|
|
37
|
-
- **`playbook.md`** — the generated domain **sub-skill**, when supplied;
|
|
38
|
-
- **`profile.json`** — the manifest the sil skill reads at runtime to load them.
|
|
39
|
-
These behaviour artefacts live in `$SIL_DATA_DIR`, kept **out of** the thin host `agents` wiring entry. The tool's own outcomes are `ok` / `invalid_request` / `persistence_failed` — on `invalid_request` it wrote nothing; on `persistence_failed` it left nothing partial.
|
|
44
|
+
4. **Write the persona into the workspace `SOUL.md` (host CLI).** The persona is the agent's soul / system framing — the host's `SOUL.md`, **not** a sil artefact. Write the endorsed persona text straight into the new agent's `SOUL.md` via the host CLI. There is **no** `persona.md` in the sil store and **no** copy step — the persona lives in exactly one place.
|
|
40
45
|
|
|
41
|
-
5. **
|
|
46
|
+
5. **Materialize the SDS behaviour artefacts.** Call **`sil_profile_materialize`** with `{ agentId, name, domainSpec, intentSpec, userSpec, playbook }` — the deep `domainSpec`, the derived `intentSpec` schema, and the initial `userSpec` + `playbook` seeded by the interview (partial, augmented per-query). All four are **required and non-blank**. It writes atomically into **`$SIL_DATA_DIR/agents/<agentId>/`**: `domain_spec.md`, `intent_spec.md`, `user_spec.md`, `playbook.md`, plus `profile.json` (the manifest the sil skill reads at runtime). All four are seeded at creation — none deferred. There is **no `persona.md`** here. The tool's outcomes are `ok` / `invalid_request` / `persistence_failed` — on `invalid_request` it wrote nothing; on `persistence_failed` it left nothing partial.
|
|
42
47
|
|
|
43
|
-
6. **Wire the sil skill
|
|
48
|
+
6. **Wire the sil skill + plugin (host CLI).** Asserted against the pinned host — **`alpine/openclaw:2026.6.9`** — both value-mode sets with `--strict-json` (the only set mode this image accepts):
|
|
44
49
|
```
|
|
45
50
|
openclaw config set 'agents.list[<i>].skills' '["sil"]' --strict-json
|
|
46
51
|
openclaw config set plugins.entries.sil.enabled true --strict-json
|
|
47
52
|
```
|
|
48
|
-
The skill attach makes the agent **know how** to drive the tools; the plugin enable makes the four `sil_*` tools available
|
|
53
|
+
The skill attach makes the agent **know how** to drive the tools; the plugin enable makes the four `sil_*` tools available. Keep `sil` in the agent's skill list and do not deny the `sil_*` tools.
|
|
49
54
|
|
|
50
|
-
7. **Validate with the host's OWN check, THEN declare created.** Run `openclaw config validate --json`. On `alpine/openclaw:2026.6.9` the verdict
|
|
55
|
+
7. **Validate with the host's OWN check, THEN declare created.** Run `openclaw config validate --json`. On `alpine/openclaw:2026.6.9` the verdict is `{ valid, path, issues? }` — success keys off **`.valid`**, never an `ok` field. Only when `valid: true` do you report **`created`**. If `valid: false` (or any CLI step failed), report **`persistence_failed`** with the failing **path** + **cause** (the `issues?`), leaving nothing partial.
|
|
51
56
|
|
|
52
|
-
8. **Tell the user it is ready.** On `created`, tell
|
|
57
|
+
8. **Tell the user it is ready.** On `created`, tell them the expert exists and how to open it. Opening it loads the persona (`SOUL.md`) and all four SDS specs (`profile.json`), and the expert calls `sil_search` / `sil_product_get` (and `sil_register` / `sil_whoami` as needed) on the user's intent with **no further setup**.
|
|
53
58
|
|
|
54
59
|
## Status taxonomy (agent-creation engine)
|
|
55
60
|
|
|
56
61
|
| `status` | Meaning | What to do |
|
|
57
62
|
|---|---|---|
|
|
58
|
-
| `created` |
|
|
59
|
-
| `invalid_request` |
|
|
60
|
-
| `collision` | An agent with that id already exists
|
|
61
|
-
| `persistence_failed` | A write or `openclaw config validate` step failed.
|
|
63
|
+
| `created` | Agent added, artefacts materialized, sil plugin + skill wired, `openclaw config validate` accepted it. | Tell the user it's ready and how to open it. |
|
|
64
|
+
| `invalid_request` | Spec failed validation (missing/blank field). **Nothing written.** | Name the field, fix it, run again — do NOT proceed to `openclaw agents add`. |
|
|
65
|
+
| `collision` | An agent with that id already exists. | Surface it; pick a different id. **Never overwrite.** |
|
|
66
|
+
| `persistence_failed` | A write or `openclaw config validate` step failed. **Nothing partial** left. | Fix the reported path/cause, create again. |
|
|
62
67
|
|
|
63
68
|
## Runtime — how a created expert loads its behaviour
|
|
64
69
|
|
|
65
|
-
When you (the sil skill) start a session inside a created expert,
|
|
70
|
+
When you (the sil skill) start a session inside a created expert, the host has already injected the persona via the workspace **`SOUL.md`**. Then read `$SIL_DATA_DIR/agents/<agentId>/profile.json` and load the four **SDS behaviour artefacts** it points at — all **always present** (required at creation):
|
|
71
|
+
- **`domain_spec.md`** — deep researched niche expertise (how to buy well, the full mechanics) to reason over;
|
|
72
|
+
- **`intent_spec.md`** — the decomposition-dimension schema a query must resolve;
|
|
73
|
+
- **`user_spec.md`** — the user's domain-relevant facts + hard constraints (seeded partial, augmented per-query);
|
|
74
|
+
- **`playbook.md`** — the user's buying taste (seeded partial, augmented per-query).
|
|
75
|
+
|
|
76
|
+
Loading these is what lets the expert shop on its niche with no further setup. When the user states a shopping intent, shop per [`expert_shopping.md`](expert_shopping.md) — the loop that on **every query** web-refreshes the domain spec, decomposes the request along the intent-spec dimensions (the ephemeral per-query intent), and **augments** the already-present `user_spec.md` + `playbook.md` — we keep learning. To sharpen an expert from observed sessions, see [`refine_expert.md`](refine_expert.md).
|
|
@@ -1,67 +1,76 @@
|
|
|
1
1
|
# Brainstorm a tailored shopping expert — the interview
|
|
2
2
|
|
|
3
|
-
When the user asks for a **shopping expert** — "make me a shopping expert for buying gifts", "set up a road-cycling gear agent", "I want an expert that shops for me" — do **not** jump to the engine.
|
|
3
|
+
When the user asks for a **shopping expert** — "make me a shopping expert for buying gifts", "set up a road-cycling gear agent", "I want an expert that shops for me" — do **not** jump to the engine. Run an **open, back-and-forth interview** that shapes the expert *with* the user, then **create nothing** until the user endorses the assembled draft. The agent-creation engine ([`agent_creation_engine.md`](agent_creation_engine.md)) only runs **after** that explicit endorsement.
|
|
4
4
|
|
|
5
|
-
This is a **conversation, not a form-fill.** The
|
|
5
|
+
This is a **conversation, not a form-fill.** The rule is **at least one touchpoint per document** — you walk the five artefacts in order, one touchpoint each, and the deep work (the domain research) is **yours**, not the user's. The depth comes from the agent's own research, not from interrogating the user.
|
|
6
|
+
|
|
7
|
+
## The five SDS artefacts — all four sil docs SEEDED at creation
|
|
8
|
+
|
|
9
|
+
A created expert runs on five artefacts. **All four sil docs are present (non-blank) from creation**, seeded *partial* by this interview + the agent's research, then **lazily augmented / reinforced on every query** ([`expert_shopping.md`](expert_shopping.md)). No sil doc is created blank or deferred to a later first shop. What grows is their *content* — we keep learning.
|
|
10
|
+
|
|
11
|
+
| Artefact | Where | What it holds | Seeded |
|
|
12
|
+
|---|---|---|---|
|
|
13
|
+
| **`SOUL.md`** (persona) | host workspace (via host CLI) | the expert's identity / voice / standing rules | at creation (§1 below); refined on persona refine, stable per query |
|
|
14
|
+
| **`domain_spec.md`** | sil data dir (**required**) | deep researched niche expertise — how to buy well, the full mechanics; web-refreshed every query | at creation (§2 — the agent's own research) |
|
|
15
|
+
| **`intent_spec.md`** | sil data dir (**required**) | the agent-specific **decomposition dimensions** (PRD-style) a query must resolve | at creation (§5 — derived from the domain) |
|
|
16
|
+
| **`user_spec.md`** | sil data dir (**required**) | the user's domain-relevant facts + hard constraints | seeded partial at creation (§3); augmented every query |
|
|
17
|
+
| **`playbook.md`** | sil data dir (**required**) | the user's **buying taste** (price sensitivity, brand, preferences) | seeded partial at creation (§4); augmented every query |
|
|
18
|
+
|
|
19
|
+
The per-query intent (the dimensions filled in for one request) is **ephemeral** — never persisted, never authored here.
|
|
6
20
|
|
|
7
21
|
## Principles for the interview
|
|
8
22
|
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **Converge, don't accumulate.** Reflect a short summary back and get a
|
|
13
|
-
- **Endorsement is a gate, not a formality.** Until the user explicitly says "create it", run **zero** engine steps
|
|
23
|
+
- **One touchpoint per document, walked in order.** Touch each of the five artefacts exactly once during setup (the domain is the exception — agent-researched, **zero questions**). Don't fire a fixed battery; don't over-burden the user. The deep domain spec is the **agent's own research**, never interrogated from the user.
|
|
24
|
+
- **The persona question comes first, and the niche falls out of it.** Asking "what kind of expert, and how should it behave?" surfaces the niche as a by-product — there is **no separate narrow-the-niche step**.
|
|
25
|
+
- **Research, don't interrogate.** The objective decision-mechanics of the domain are *yours* to research (web + knowledge); the user supplies the persona, one basic fact, one taste comparison, and a sign-off — not the domain expertise.
|
|
26
|
+
- **Converge, don't accumulate.** Reflect a short summary back and get a yes/adjust before advancing. The flow is **collaborative** and **re-entrant** — not a locked wizard; the user can revise an earlier section at any point.
|
|
27
|
+
- **Endorsement is a gate, not a formality.** Until the user explicitly says "create it", run **zero** engine steps. The draft lives only in the conversation.
|
|
14
28
|
|
|
15
|
-
##
|
|
29
|
+
## Run the interview in this order — one touchpoint per document
|
|
16
30
|
|
|
17
|
-
|
|
31
|
+
### 1. `SOUL.md` — ASK FIRST: persona + behaviour (the niche falls out of this)
|
|
18
32
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| 2 | **Persona** | Who the expert *is*: its expertise, voice/tone, standing rules — reflecting this user. | `persona` |
|
|
23
|
-
| 3 | **Elicitation style** | How this expert talks to its future user when shopping — how many questions before searching, how proactive, how much it explains. | inside `playbook` |
|
|
24
|
-
| 4 | **Answer→`sil_search`-param mapping** | The domain's decision-attributes translated into concrete `sil_search` parameters this expert will set (see [`search_param_mapping.md`](search_param_mapping.md)). | inside `playbook` |
|
|
25
|
-
| 5 | **Comparison / recommendation rubric** | How this expert ranks and picks among results, weighted by the user's *stated* priorities. | inside `playbook` |
|
|
33
|
+
Open by reflecting the request back ("a shopping expert — let's shape it together"), then ask the **persona/identity** question: **"What kind of expert do you want, and how should it behave?"** — its expertise, voice/tone (terse vs. chatty, cautious vs. opinionated), and any standing rules. This is **not** niche-narrowing: the **niche falls out of the answer** ("a patient first-bike advisor" → the niche is *first road bikes*). Reflect a short persona summary back and confirm. This becomes the host workspace **`SOUL.md`** (the persona is the agent's system framing — **not** a sil artefact, no `persona.md`). If the niche is still vague after the persona answer, fold one clarifying turn into this section — do not run a dedicated narrow-the-niche step.
|
|
34
|
+
|
|
35
|
+
### 2. `domain_spec.md` — NO QUESTION: the agent researches the web itself
|
|
26
36
|
|
|
27
|
-
|
|
37
|
+
With the niche surfaced from §1, **actively research it yourself (web + knowledge)** — pull *everything* about how to buy well in the niche, its **decision-attributes**, and its mechanics, deeply. For a bike that is the full domain: gearing/groupsets and gearing theory, frame types and geometry, **the complete process of fitting a bike to a person**, wheel/tyre selection, the trade-offs that drive a good buy. Converge a **deep domain spec**: how a person *should* buy in this niche, closing the gap where the consumer was uninformed (higher satisfaction, fewer returns). **The fit is everything** — this is researched substance, not restated persona prose and not generic filler; a shallow bullet list, or anything a layperson could have written, **fails the SDS bar** (business rule 4). Reflect the shape back briefly ("for a road bike, fit comes from stack/reach, saddle setback, crank length — here's how I'll think about your buy") and confirm. **Ask the user no domain question — you research it.** This lands in `domainSpec` (→ `domain_spec.md`). **If you lack web access, tell the user** you need web search, then compose `domain_spec.md` from well-established, public buying knowledge — never present a guess as verified research, and never silently proceed.
|
|
28
38
|
|
|
29
|
-
|
|
39
|
+
### 3. `user_spec.md` — ONE basic question
|
|
30
40
|
|
|
31
|
-
|
|
41
|
+
Ask the **single most-basic niche fact** the domain mechanics turn on — for shoes, *foot length + width*; for a bike, *height + leg length*. Plus any **hard constraint** the user volunteers ("never leather", an allergy, a budget hard-no). Seed a *partial* **`userSpec`**: the basic fact(s) + any stated hard constraints, marked **hard** (inviolable) vs **soft** (a bendable preference). Don't run a questionnaire — one basic question; the rest is **augmented per-query** at shop time. If the user gives little, seed a minimal honest body (e.g. "facts to be learned as we shop; no hard constraints stated yet") — non-blank, but partial. This lands in `userSpec` (→ `user_spec.md`).
|
|
32
42
|
|
|
33
|
-
|
|
43
|
+
### 4. `playbook.md` — ONE question: compare a set of options (buying taste)
|
|
34
44
|
|
|
35
|
-
|
|
45
|
+
Surface the user's **buying taste** with **one** question: ask them to **compare a set of options** ("of these three — a value alloy build, a mid-range carbon, a premium race bike — which appeals, and why?"). Their choice and reasoning reveal price sensitivity, brand leanings, and how they weigh value vs. performance — taste a direct "what's your budget?" wouldn't. Seed a *partial* **`playbook`** from the answer (budget feel, brand leanings, value-vs-performance lean), augmented per-query. This lands in `playbook` (→ `playbook.md`). The old seller's-method playbook (elicitation style + answer→param mapping + rubric) is gone: the voice folds into the persona, what to search on lives in the domain spec + the generic [`search_param_mapping.md`](search_param_mapping.md), and the rubric **emerges at recommend time** from the domain dimensions weighted by taste + facts + the per-query intent.
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
- **Elicitation style:** how should the expert talk to its future user — how many questions before it searches, how proactive, how much it explains its picks? Reflect back, confirm.
|
|
39
|
-
- **Answer→`sil_search`-param mapping:** name the domain's decision-attributes ("for road bikes: frame material, groupset tier, wheel size, budget…"), ask the user's stance on each, and translate each stated input into a concrete `sil_search` param (see [`search_param_mapping.md`](search_param_mapping.md) for the param table, worked examples, and the `ship_to`-empty rule). Reflect the mapping back, confirm.
|
|
40
|
-
- **Recommendation rubric:** ask what the user weighs most ("durability over price", "prefer secondhand", "brand X is a hard no"), and tie the expert's ranking/selection to those *stated* priorities — not a fixed order. Reflect back, confirm.
|
|
47
|
+
### 5. `intent_spec.md` — SIGN-OFF: present the decomposition dimensions
|
|
41
48
|
|
|
42
|
-
|
|
49
|
+
From what you learned writing the domain spec, derive the **decomposition dimensions** every query in this niche must resolve — a PRD-style schema (for cycling: use-case, terrain, budget band, fit envelope, timeline, compatibility, performance priorities, aesthetics). These are **agent-specific** — from *this* niche's domain spec, not a generic checklist. Present them and ask the user to **sign off** ("every request, I'll decompose along these — sound right?"). This is the **schema** (the dimensions to resolve), never a filled-in instance (that is the ephemeral per-query intent). This lands in `intentSpec` (→ `intent_spec.md`).
|
|
43
50
|
|
|
44
|
-
6.
|
|
51
|
+
### 6. Derive the identity, assemble, endorse
|
|
45
52
|
|
|
46
|
-
|
|
53
|
+
- **Identity.** Propose an `agentId` (lower-kebab, `^[a-z0-9][a-z0-9-]*$`, never `main`) and a human-readable `name` ("Road-Cycling Buyer" / `road-cycling-buyer`) from the converged niche. **Confirm both** — never silently invent them.
|
|
54
|
+
- **Assemble + present.** Compose `{ agentId, name, persona, domainSpec, intentSpec, userSpec, playbook }` and present a **readable summary**: who the expert is, the **deep domain spec**, the **intent dimensions**, and the **seeded user spec + buying taste** (partial, to grow per-query). Self-check the shape against the engine's `sil_profile_materialize` contract: `agentId` lower-kebab & ≠ `main`, non-blank `name`/`persona`, and a non-blank `domainSpec`/`intentSpec`/`userSpec`/`playbook` (all four present, seeded partial, never absent). This is shape-only — it writes nothing; the engine's validate-first step is the authoritative gate.
|
|
55
|
+
- **Endorse — the gate.** Ask for an explicit go-ahead ("shall I create it?"). Endorsement is an **affirmative user act** on the assembled draft — "yes, create it" / "go ahead". It is **NOT** inferred from the user answering the last question, and **NOT** from silence. **Only on that explicit endorsement** do you proceed to the engine ([`agent_creation_engine.md`](agent_creation_engine.md)).
|
|
47
56
|
|
|
48
57
|
## Edge cases the interview handles gracefully
|
|
49
58
|
|
|
50
|
-
- **Collision (an expert with that id already exists).** The engine refuses a name collision
|
|
51
|
-
- **Abandon mid-flow.**
|
|
52
|
-
- **Creation is local + offline
|
|
59
|
+
- **Collision (an expert with that id already exists).** The engine refuses a name collision (its `collision` outcome from `openclaw agents list`) and never clobbers an existing agent. Surface it and offer a **choice — rename under a new id, or refine the existing expert** — never silently mutate the id or overwrite.
|
|
60
|
+
- **Abandon mid-flow.** Because **no engine step runs before endorsement**, abandonment leaves **nothing created** — no host agent, no artefacts, no wiring, no teardown. Never "save progress" by writing artefacts early.
|
|
61
|
+
- **Creation is local + offline (for the user's identity).** Creating an expert neither requires nor performs sil registration. Do **NOT** present sil registration or a token as a prerequisite to create the expert; the expert registers the user later, on first shop, via `sil_register`. (The §2 domain research reaches the **web** for niche knowledge — the agent's own research, not the user's identity.)
|
|
53
62
|
|
|
54
63
|
## Business rules (invariants the interview holds on every path)
|
|
55
64
|
|
|
56
|
-
1. **No creation without explicit endorsement.** Nothing is written — not the host agent,
|
|
57
|
-
2. **Abandon-mid-flow creates nothing.**
|
|
58
|
-
3. **
|
|
59
|
-
4. **
|
|
60
|
-
5. **
|
|
61
|
-
6. **
|
|
62
|
-
7. **Refine-or-rename on collision; never clobber.**
|
|
63
|
-
8. **Creation is local + offline
|
|
64
|
-
9. **
|
|
65
|
+
1. **No creation without explicit endorsement.** Nothing is written — not the host agent, the `SOUL.md`, the SDS artefacts, or the wiring — until the user explicitly endorses. The draft lives only in the conversation until then.
|
|
66
|
+
2. **Abandon-mid-flow creates nothing.** No engine step runs pre-endorsement, so an abandoned interview leaves no partial expert — automatic, not a teardown.
|
|
67
|
+
3. **One touchpoint per document, walked in order.** `SOUL.md` (ask first — persona, the niche falls out), `domain_spec.md` (no question — agent researches the web), `user_spec.md` (one basic fact), `playbook.md` (one compare-options question), `intent_spec.md` (sign-off). The deep domain expertise is the agent's **own research**, never interrogated. All four sil docs are **present (partial) from creation** — seeded fast, then augmented per-query; the user side is never "filled from empty later".
|
|
68
|
+
4. **The domain spec is DEEP and researched, never generic or restated persona prose.** It carries niche-concrete mechanics a layperson couldn't enumerate — the full how-to-buy-well (for a bike: the complete fit process, gearing theory, geometry — **the fit is everything**). A shallow bullet list or relabelled persona prose **fails SDS**. Research the niche; do not relabel latent knowledge. If you lack web access, say so, then compose it from well-established, public buying knowledge — never present a guess as verified research.
|
|
69
|
+
5. **The intent spec is derived FROM the domain spec, and is a schema not an instance.** The dimensions come from *this* niche's domain spec (agent-specific) and are the **template** to resolve — never the filled-in values for one request (the ephemeral per-query intent).
|
|
70
|
+
6. **Converge each section before advancing; stay re-entrant.** Reflect-and-confirm per section; let the user revise any earlier section.
|
|
71
|
+
7. **Refine-or-rename on collision; never clobber.** Defer to the engine's `collision` refusal; offer refine-or-rename.
|
|
72
|
+
8. **Creation is local + offline for the user's identity.** Never present sil registration / a token as a prerequisite to create. (Domain research may reach the web — the agent's research, not the user's account.)
|
|
73
|
+
9. **The persona is the host `SOUL.md`, not a sil artefact.** No `persona.md` in the sil store. The buying taste IS seeded — a *partial* `playbook.md` — but the old seller's-method playbook is gone (the rubric emerges at recommend time).
|
|
65
74
|
|
|
66
75
|
## After endorsement
|
|
67
76
|
|
|
@@ -16,7 +16,7 @@ cents).
|
|
|
16
16
|
The plugin polls in the background; once the user finishes signing in, call
|
|
17
17
|
`sil_register` again to confirm (it reports `already_registered`).
|
|
18
18
|
- **`sil_whoami`** returns the registered user's identity (name and addresses).
|
|
19
|
-
An expired
|
|
19
|
+
An expired session token is refreshed transparently and the read retried; if the
|
|
20
20
|
session is fully dead, the result names the recovery (`sil_register`).
|
|
21
21
|
- **`sil_search`** returns a ranked list of purchasable variants (`id`, `title`,
|
|
22
22
|
`price`, `availability`, `checkout_url`, `source`), best match first — present
|
|
@@ -1,112 +1,79 @@
|
|
|
1
1
|
# Expert shop-time loop — how a created expert shops on its niche
|
|
2
2
|
|
|
3
|
-
Load this when you (the sil skill) are running **inside a created expert** and the
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
and
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
candidates). Those artefacts are now your operating instructions for the rest of
|
|
11
|
-
this loop.
|
|
12
|
-
|
|
13
|
-
This is **shop time**, not create time. The expert behaves like a specialist a
|
|
14
|
-
user trusts, in the persona's voice — never a generic clerk. It consumes the
|
|
15
|
-
existing catalog tools **unchanged**; the rubric is applied by you at reasoning
|
|
16
|
-
time, not by any new tool.
|
|
17
|
-
|
|
18
|
-
The router's three always-on rules still hold (act-don't-narrate, follow the
|
|
19
|
-
tool's own `recovery`, re-fetch the chosen item before the user commits) — this
|
|
20
|
-
loop layers the profile-driven behaviour on top, it does not restate them.
|
|
3
|
+
Load this when you (the sil skill) are running **inside a created expert** and the user states a shopping intent ("find me something for a steak dinner around $40"). The [engine's Runtime hook](agent_creation_engine.md) ends where this loop begins: the host has injected the persona via the workspace **`SOUL.md`** (voice, standing rules, hard-no's), and the sil skill has read `$SIL_DATA_DIR/agents/<agentId>/profile.json` and loaded the four SDS artefacts — all **present from creation** (seeded partial, augmented every query): **`domain_spec.md`** (deep researched niche expertise), **`intent_spec.md`** (the decomposition-dimension schema), **`user_spec.md`** (the user's facts + hard constraints), and **`playbook.md`** (the user's shopping taste — price sensitivity, brand, preferences). Those are now your operating instructions.
|
|
4
|
+
|
|
5
|
+
This is **shop time**, not create time — behave like a specialist the user trusts, in the persona's voice. Consume the catalog tools **unchanged**; the rubric is applied by you at reasoning time, not by any new tool.
|
|
6
|
+
|
|
7
|
+
This is **Spec-Driven Shopping (SDS)**, and **every query is a learning step** — all four sil docs are already present and the loop **augments / reinforces** them, never fills them from nothing. On **every query** the expert (a) keeps `domain_spec.md` current from the **web**, (b) **decomposes the request along the intent-spec dimensions** into an ephemeral per-query intent, and (c) **augments** `user_spec.md` with any new fact and `playbook.md` with any taste this query surfaces — we keep learning. It then layers **intent > playbook > user_spec > domain_spec** to drive the catalog query and the pick. The layering is the product: the pick's "why" must visibly cite the layers.
|
|
8
|
+
|
|
9
|
+
The router's three always-on rules still hold (act-don't-narrate, follow the tool's own `recovery`, re-check the chosen item before commit) — this loop layers on top, it does not restate them.
|
|
21
10
|
|
|
22
11
|
## The loop (the order IS the spec)
|
|
23
12
|
|
|
24
|
-
Run these steps in order. An attribute the user already stated is never re-asked.
|
|
13
|
+
Run these steps in order. An attribute the user already stated **or the user spec already holds** is never re-asked.
|
|
14
|
+
|
|
15
|
+
### 1. Refresh the domain spec from the web
|
|
16
|
+
|
|
17
|
+
Before anything else, go to the **web** and **enhance `domain_spec.md`** so it stays current and complete (new models, standards, prices, technique). Fold what you learn in and **persist** it by re-running **`sil_profile_materialize`** for this `agentId` with the updated `domainSpec` (the in-place re-materialize — the same atomic store path the engine and refine use). This is a **real web step** — if the host has no web/fetch tool, say so honestly and proceed on the existing domain spec; never pretend the refresh happened.
|
|
18
|
+
|
|
19
|
+
### 2. Decompose the request along the intent-spec dimensions (ephemeral — NEVER persisted)
|
|
20
|
+
|
|
21
|
+
Read `intent_spec.md` — the decomposition **dimensions** a good query must resolve — and **fill them in for *this* request** from the user's words ("a waterproof trail shoe for a wet ultra next month, around €160" → use-case: trail/ultra; weather: wet; budget: ~€160; timeline: next month). State the filled decomposition back so the layering is legible. This filled instance is the **per-query intent** — **ephemeral**: it lives only in this conversation and is **NEVER persisted**. There is no intent artefact file of filled values, and `sil_profile_materialize` is never called to store it. Only the `intent_spec.md` *schema* is persisted; the fill is throwaway.
|
|
22
|
+
|
|
23
|
+
### 3. Augment the already-present user side — facts to `user_spec.md`, taste to `playbook.md`
|
|
24
|
+
|
|
25
|
+
`user_spec.md` and `playbook.md` are **already present** (seeded partial at creation) — this step **augments** them, it does not build them from nothing. Resolving the intent dimensions may surface a new user **fact** (a measurement, a compatibility detail, a hard constraint) or a new **shopping taste** (price sensitivity, brand preference) — asked in-context for *this* query, in the persona's voice, **only when a dimension actually needs it** — then persist it and never re-ask:
|
|
26
|
+
|
|
27
|
+
- A **fact / measurement / hard constraint** → fold into `user_spec.md` and re-materialize (updated `userSpec`). Mark each as **soft** (bendable) or a **hard constraint** (inviolable — "never leather", "nothing over 8 kg", an allergy, an age gate).
|
|
28
|
+
- A **shopping-taste preference** (budget band, brand likes/dislikes) → fold into `playbook.md` (the user's **shopping taste** — price sensitivity and brand preference) and re-materialize (updated `playbook`).
|
|
29
|
+
|
|
30
|
+
The user side **grows incrementally, per-query** — augmenting what is already there, never a big up-front form, never a one-time capture from nothing. **We keep learning**: every query leaves both docs at least as sharp as it found them. Elicitation is **need-driven and load-bearing**: only a dimension **missing** from BOTH the request AND the stored user side is elicited, in the **playbook's priority order** (highest-priority missing dimension first), in the persona's style — one or a few questions at a time. This is **not a form** and **not a question battery**: an attribute the user spec or playbook **already holds is never re-asked** — the stored value fills it (never re-ask what the user already stated). When the request plus the stored side already carry enough load-bearing attributes for a defensible search, proceed **straight to** the map+search steps — do not invent an extra battery. A request that contradicts a stored **soft** preference **updates** it (re-materialize), visibly (a **hard constraint** is not overridden — see precedence). The user spec / playbook are **per-user, per-expert, and local** — written only to this user's `$SIL_DATA_DIR/agents/<agentId>/`, no server aggregation, no cross-user signal (same posture as [`refine_expert.md`](refine_expert.md)). Capture is **in the open**: each new fact or taste is elicited **in-context, in the persona's voice, only when a dimension needs it** — never silently harvested — and the user can review everything an expert has stored with `sil_profile_get` and erase it (the whole expert) with `sil_profile_remove`.
|
|
31
|
+
|
|
32
|
+
### Layering — precedence intent > playbook > user_spec > domain_spec
|
|
33
|
+
|
|
34
|
+
- **Intent** (the per-query decomposition) narrows the field — what this request demands.
|
|
35
|
+
- **Playbook** (shopping taste) shapes preferences — price sensitivity, brand, taste — within what the intent allows.
|
|
36
|
+
- **User spec** fills standing **facts** the request left unsaid (a measurement kept from before, a compatibility constraint) — never re-asked — and carries the **hard constraints**.
|
|
37
|
+
- **Domain spec** supplies the **decision-mechanics and trade-offs** to reason over (for trail running, last volume and lug depth matter more than weight here) — the substrate, not a tiebreaker over the user's wants.
|
|
25
38
|
|
|
26
|
-
|
|
39
|
+
**Precedence resolves conflicts: intent > playbook > user_spec > domain_spec — for *preferences*.** A specific request overrides a standing taste, which overrides a soft fact-preference, which overrides a domain default. **Exception — hard constraints are inviolable:** a `user_spec.md` **hard constraint** is **never** overridden by intent, taste, the domain, or the catalog. Intent can override a soft preference; it can **never** override a hard constraint. A weight bends; a hard constraint does not.
|
|
27
40
|
|
|
28
|
-
A **
|
|
29
|
-
names as priority-ordered for the niche (e.g. budget, serving size, the niche's
|
|
30
|
-
key descriptors). **Elicitation is need-driven**: you elicit **only** a
|
|
31
|
-
load-bearing attribute that is **missing**. When the stated intent already carries
|
|
32
|
-
enough load-bearing attributes for a defensible search, do **not** invent an extra
|
|
33
|
-
question battery — proceed straight to the map+search steps below.
|
|
41
|
+
**Route every hard constraint to a real enforcement point, never only soft `query` text.** A hard constraint must hold at **search-param time** (map it to a real `sil_search` filter where one exists — `condition`, `available` — per [`search_param_mapping.md`](search_param_mapping.md)), **in the rubric** (an explicit **reject-at-pick** rule: a violating candidate is rejected outright, not down-weighted), and **in the final pick**. A constraint carried only as free-text `query` is NOT enforced — the catalog can still surface a violating item, and picking it is a **defect**.
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
**in the playbook's priority order** — one or a few questions at a time, in the
|
|
37
|
-
playbook's elicitation style. This is **not a fixed form-fill** and **not a
|
|
38
|
-
question battery**: you ask like a curious expert, and you **never re-ask** an
|
|
39
|
-
attribute the user already stated. Elicit the highest-priority missing attribute
|
|
40
|
-
first, then the next — never a single up-front wizard form.
|
|
43
|
+
> **Terminology — "reject-at-pick" here = the "reject-at-…-rule" phrasing in [`search_param_mapping.md`](search_param_mapping.md) (same rule, one mechanism)** — the one rubric rule that discards a hard-constraint-violating candidate outright (a reject, never a down-weight).
|
|
41
44
|
|
|
42
|
-
###
|
|
45
|
+
### 4. Map the answers to well-formed `sil_search` params
|
|
43
46
|
|
|
44
|
-
Translate each
|
|
45
|
-
[`search_param_mapping.md`](search_param_mapping.md) — that reference owns the
|
|
46
|
-
full answer→param table and the worked examples; **load it, do not re-carry it
|
|
47
|
-
here.** The load-bearing rules from it that govern this step:
|
|
47
|
+
Translate each filled intent dimension — **plus the standing user-spec facts, the shopping taste, and the domain-spec mechanics** the layering brought in — to a **real `sil_search` param** per [`search_param_mapping.md`](search_param_mapping.md). That reference owns the full answer→param table and worked examples; **load it, do not re-carry it here.** The load-bearing rules that govern this step:
|
|
48
48
|
|
|
49
|
-
- A stated taste with **no matching param** (a colour, a brand) folds into the
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
call.
|
|
53
|
-
- Leave **`ship_to` empty** by default so the server resolves the user's
|
|
54
|
-
registered default address. Do **not** call `sil_whoami` to populate it — no
|
|
55
|
-
`sil_whoami` round-trip.
|
|
49
|
+
- A stated taste with **no matching param** (a colour, a brand) folds into the `query` text or the rubric — you **never invent a filter**. There is no `color` param, no `brand` param.
|
|
50
|
+
- A user-spec **hard constraint** maps to a **real filter where one exists** (`condition`, `available`) so the catalog never returns a violating item; where no param matches, it does NOT collapse to `query` text — it becomes an explicit **reject-at-pick** rubric rule (Step 6).
|
|
51
|
+
- Leave **`ship_to` empty** by default so the server resolves the registered default address. Do **not** call `sil_whoami` to populate it.
|
|
56
52
|
|
|
57
|
-
###
|
|
53
|
+
### 5. Search
|
|
58
54
|
|
|
59
|
-
Call `sil_search` with the mapped params. It returns purchasable variants
|
|
60
|
-
**best-first**.
|
|
55
|
+
Call `sil_search` with the mapped params. It returns purchasable variants **best-first**.
|
|
61
56
|
|
|
62
|
-
###
|
|
57
|
+
### 6. Compare the candidates on the rubric — reject hard-constraint violators outright
|
|
63
58
|
|
|
64
|
-
|
|
65
|
-
**weighted by the user's stated priorities** ("durability over price"), plus the
|
|
66
|
-
persona's **hard-rules / hard-no's** (a brand the user refuses, an age gate the
|
|
67
|
-
persona enforces). The rubric informs your *reasoning*, not the list order:
|
|
68
|
-
present results **best-first** as `sil_search` returned them — **never re-rank**.
|
|
59
|
+
The **rubric emerges here, at pick time** — not a stored seller artefact. Build it from the **domain-spec dimensions and trade-offs** (last volume vs. weight, rim depth vs. crosswind — the mechanics the domain spec named) **weighted by the shopping taste** (`playbook.md`), the **user's facts** (`user_spec.md`), and the **per-query intent**. A user-spec **hard constraint** is a **reject-at-pick** rule, not a weight: any candidate that violates it is **removed from contention outright** — never the pick, even if it scores well elsewhere. (A soft preference only down-weights.) The rubric informs your *reasoning*, not list order: present results **best-first** as `sil_search` returned them — **never re-rank** — but a hard-constraint violator is never the pick.
|
|
69
60
|
|
|
70
|
-
###
|
|
61
|
+
### 7. Recommend — always with the "why" that cites the layers
|
|
71
62
|
|
|
72
|
-
Recommend with **domain-relevant rationale** in the expert's voice — the **"why"
|
|
73
|
-
tied to the rubric and the user's stated priorities ("I picked this because it
|
|
74
|
-
holds the 105 groupset you wanted at the top of your budget"). The "why" is the
|
|
75
|
-
product: the result list is the same one generic search returns; the expert's
|
|
76
|
-
value is the reasoning over it. Never hand back a bare list.
|
|
63
|
+
Recommend with **domain-relevant rationale** in the expert's voice — the **"why"** must make the layering **legible**: cite the **per-query intent** (what this request demanded), at least one **stored user-spec fact or taste you did NOT re-ask** ("you're a wide D-width, kept from before"), and at least one **researched domain-spec dimension** ("for trail running, last volume and lug depth matter more than weight here") — tied to the user's priorities. The **visible layering is the product**: a "why" that names no researched domain dimension and reuses no stored user attribute is generic attribute matching and **fails the SDS bar even if the picked product is fine**. Never hand back a bare list.
|
|
77
64
|
|
|
78
|
-
###
|
|
65
|
+
### 8. Re-fetch with `sil_product_get` before any buy
|
|
79
66
|
|
|
80
|
-
Price, availability, and `checkout_url` from `sil_search` are **point-in-time**.
|
|
81
|
-
Before you hand off to **buy / checkout / purchase**, **re-fetch** the chosen item
|
|
82
|
-
with `sil_product_get` for fresh price / availability / `checkout_url`. **Never
|
|
83
|
-
commit a buy off the stale `sil_search` snapshot** — buy off the fresh
|
|
84
|
-
`sil_product_get` detail, never the earlier `sil_search` result.
|
|
67
|
+
Price, availability, and `checkout_url` from `sil_search` are **point-in-time**. Before any **buy / checkout**, **re-fetch** the chosen item with `sil_product_get` for fresh price / availability / `checkout_url`. **Never commit a buy off the stale `sil_search` snapshot.**
|
|
85
68
|
|
|
86
69
|
## When `sil_search` returns `ok` with `products: []` — relax and explain
|
|
87
70
|
|
|
88
|
-
An empty result on `status: ok`
|
|
89
|
-
**never a silent dead-end**. **Relax or re-frame** the params (loosen a
|
|
90
|
-
constraint, broaden the `query`) and **explain what you changed and why** ("I
|
|
91
|
-
dropped the secondhand-only filter because nothing matched it — here's what's new
|
|
92
|
-
in stock"). Do not just stop silently and do not leave the user with nothing.
|
|
71
|
+
An empty result on `status: ok` is a normal, servable outcome — **never a silent dead-end**. **Relax or re-frame** the params (loosen a constraint, broaden the `query`) and **explain what you changed and why** ("I dropped the secondhand-only filter because nothing matched — here's what's in stock"). Never just stop silently.
|
|
93
72
|
|
|
94
73
|
## When the domain is genuinely unservable — an honest "no", never junk
|
|
95
74
|
|
|
96
|
-
When the catalog **cannot serve** the domain — out of the
|
|
97
|
-
**not shippable**, **age-gated**, or persistently empty after a reasonable
|
|
98
|
-
relax — say so **honestly**. This is a **different outcome** from the empty-but-
|
|
99
|
-
servable relax case above: there is no constraint to loosen, so you give an honest
|
|
100
|
-
"no". **Never fabricate** options and **never pad with junk** — handing back
|
|
101
|
-
irrelevant or unbuyable results to avoid saying "no" destroys trust. Honesty over
|
|
102
|
-
a hollow answer.
|
|
75
|
+
When the catalog **cannot serve** the domain — out of scope, **not shippable**, **age-gated**, or persistently empty after a reasonable relax — say so **honestly**. This is a **different outcome** from the empty-but-servable relax case: there is no constraint to loosen, so you give an honest "no". **Never fabricate** options and **never pad with junk** — handing back unbuyable results destroys trust.
|
|
103
76
|
|
|
104
77
|
## When `sil_search` / `sil_product_get` returns a non-`ok` status
|
|
105
78
|
|
|
106
|
-
A non-`ok` status is **not an empty match** — do **not** treat a `retryable`
|
|
107
|
-
(transient / source down) or an auth failure like `products: []` and relax the
|
|
108
|
-
params; that is the wrong recovery. **Follow the tool's own `recovery` hint**
|
|
109
|
-
exactly and **never improvise** a different one. The full status taxonomy and the
|
|
110
|
-
per-status recovery rule live in
|
|
111
|
-
[`catalog_tools_reference.md`](catalog_tools_reference.md) — that reference owns
|
|
112
|
-
them; **load it, do not re-carry the taxonomy here.**
|
|
79
|
+
A non-`ok` status is **not an empty match** — do **not** treat a `retryable` or an auth failure like `products: []` and relax the params. **Follow the tool's own `recovery` hint** exactly and **never improvise**. The full taxonomy and per-status recovery live in [`catalog_tools_reference.md`](catalog_tools_reference.md) — **load it, do not re-carry the taxonomy here.**
|