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.
@@ -119,7 +119,7 @@ function registerRegister(api) {
119
119
  /**
120
120
  * `sil_whoami` — read the registered user's live identity (name + addresses)
121
121
  * from sil-api with the stored Bearer token, refreshing transparently on an
122
- * expired access token.
122
+ * expired session token.
123
123
  *
124
124
  * execute() flow (ALL I/O here; register() opens nothing, arms no timer —
125
125
  * whoami is a synchronous request/response, NOT a poll):
@@ -150,8 +150,8 @@ function registerWhoami(api) {
150
150
  name: "sil_whoami",
151
151
  label: "Who am I on sil",
152
152
  description: "Return the registered user's identity (name and addresses) from sil,"
153
- + " using the credentials stored by sil_register. If the access token has"
154
- + " expired it is refreshed transparently and the read is retried. If you"
153
+ + " using the credentials stored by sil_register. If the stored session token"
154
+ + " has expired it is refreshed transparently and the read is retried. If you"
155
155
  + " are not registered, or the session has fully expired, the result names"
156
156
  + " the recovery action (run sil_register).",
157
157
  parameters: Type.Object({}),
@@ -2,13 +2,17 @@
2
2
  * sil shopping-expert profile tools.
3
3
  *
4
4
  * `sil_profile_materialize` is the plugin's half of the agent-creation engine:
5
- * it writes the created expert's *behaviour* artefacts (persona + optional
6
- * domain sub-skill playbook + a typed manifest) into the plugin's own data
7
- * directory (`$SIL_DATA_DIR`, the disclosed `filesystemScope`). The *wiring*
8
- * half — the host `agents.list[]` entry, the enabled `sil` plugin, the attached
9
- * `sil` skill — is the host agent driving its own `openclaw …` CLI under the
10
- * bundled `skill/SKILL.md` procedure; the plugin never writes `~/.openclaw`
11
- * (`security.noChildProcess: true`, host config is outside `filesystemScope`).
5
+ * it writes the created expert's *SDS behaviour* artefacts (all four required —
6
+ * domain spec + intent-spec dimension schema + user spec + playbook taste,
7
+ * present from creation and augmented every query — and a typed manifest) into
8
+ * the plugin's own data directory (`$SIL_DATA_DIR`, the
9
+ * disclosed `filesystemScope`). The persona is NOT written here — the agent's
10
+ * identity/voice is the host workspace `SOUL.md`, written directly via the host
11
+ * CLI. The *wiring* half — the host `agents.list[]` entry, the enabled `sil`
12
+ * plugin, the attached `sil` skill, the `SOUL.md` — is the host agent driving
13
+ * its own `openclaw …` CLI under the bundled `skill/SKILL.md` procedure; the
14
+ * plugin never writes `~/.openclaw` (`security.noChildProcess: true`, host
15
+ * config is outside `filesystemScope`).
12
16
  *
13
17
  * Why a tool (not skill-driven `write`-tool prose): the host agent's only way
14
18
  * to invoke plugin code is a registered tool, and a plugin write buys
@@ -34,15 +38,24 @@ export function registerProfileTools(api) {
34
38
  function registerMaterialize(api) {
35
39
  api.registerTool({
36
40
  name: "sil_profile_materialize",
37
- label: "Materialize a sil shopping-expert's behaviour artefacts",
38
- description: "Write a created sil shopping expert's behaviour artefacts into the sil"
39
- + " data directory: the persona/instructions, an optional generated domain"
40
- + " sub-skill (playbook), and a typed manifest the sil skill reads at"
41
- + " runtime to load them. Call this AFTER the host agent has been created"
42
- + " (openclaw agents add) and BEFORE openclaw config validate. It does NOT"
43
- + " touch the host OpenClaw config — the plugin enable + skill attach are"
44
- + " driven by the host CLI, not this tool. Writes are atomic: an invalid"
45
- + " spec writes nothing, and a write failure leaves nothing partial.",
41
+ label: "Materialize a sil shopping-expert's SDS behaviour artefacts",
42
+ description: "Write a created sil shopping expert's SDS behaviour artefacts into the sil"
43
+ + " data directory — ALL FOUR are REQUIRED and present from creation (seeded"
44
+ + " partial by the light ≤10-question setup + an initial research pass, then"
45
+ + " augmented every query): the domain spec (deep researched niche expertise"
46
+ + " — how to buy well, the full mechanics), the intent spec (the"
47
+ + " agent-specific decomposition dimensions a query must resolve, derived"
48
+ + " from the domain spec), the user spec (the user's domain-relevant facts +"
49
+ + " hard constraints) and the playbook (the user's buying taste), plus a"
50
+ + " typed manifest the sil skill reads at runtime to load them. The persona"
51
+ + " is NOT written here — it is the host workspace SOUL.md, written via the"
52
+ + " host CLI. Re-run it over the SAME agentId to refine an expert in place or"
53
+ + " augment a spec from a query (pass the full updated body — it overwrites"
54
+ + " atomically). Call this AFTER the host agent has been created (openclaw"
55
+ + " agents add) and BEFORE openclaw config validate. It does NOT touch the"
56
+ + " host OpenClaw config — the plugin enable + skill attach are driven by the"
57
+ + " host CLI, not this tool. Writes are atomic: an invalid spec writes"
58
+ + " nothing, and a write failure leaves nothing partial.",
46
59
  parameters: Type.Object({
47
60
  agentId: Type.String({
48
61
  description: "The host agent id the expert was created under (agents.list[].id),"
@@ -51,17 +64,38 @@ function registerMaterialize(api) {
51
64
  name: Type.String({
52
65
  description: "The human-readable expert name (recorded in the manifest).",
53
66
  }),
54
- persona: Type.String({
55
- description: "The shopping persona/instructions — the expert's expertise, tone, and"
56
- + " standing rules. Non-empty. Materialized as persona.md and copied"
57
- + " into the agent workspace SOUL.md by the skill.",
67
+ domainSpec: Type.String({
68
+ description: "The SDS domain spec — deep researched niche expertise: how to buy well"
69
+ + " in the niche and its full mechanics (for cycling: gearing theory,"
70
+ + " frame geometry, the complete bike-fit process). Researched by the"
71
+ + " agent itself (web + knowledge), not interrogated from the user."
72
+ + " REQUIRED, non-empty. Materialized as domain_spec.md; web-refreshed"
73
+ + " every query.",
74
+ }),
75
+ intentSpec: Type.String({
76
+ description: "The SDS intent spec — the agent-specific decomposition DIMENSIONS (a"
77
+ + " PRD-style template) a shopping query must resolve, derived from the"
78
+ + " domain spec (for cycling: use-case, terrain, budget, timeline,"
79
+ + " compatibility, performance priorities, aesthetics). REQUIRED,"
80
+ + " non-empty. This is the dimension SCHEMA only — the per-query intent"
81
+ + " (dimensions filled in) is ephemeral and is never stored. Materialized"
82
+ + " as intent_spec.md.",
83
+ }),
84
+ userSpec: Type.String({
85
+ description: "The SDS user spec — the user's domain-relevant facts + hard"
86
+ + " constraints (body measurements, climate, the rules they never"
87
+ + " break). REQUIRED, non-empty: present from creation (seeded partial"
88
+ + " by the light ≤10-question setup), then augmented every query."
89
+ + " Materialized as user_spec.md (per-user, per-expert, local). On a"
90
+ + " per-query augment / refine, pass the full updated body.",
91
+ }),
92
+ playbook: Type.String({
93
+ description: "The SDS playbook — the user's buying TASTE (price sensitivity, brand"
94
+ + " preferences, general taste). REQUIRED, non-empty: present from"
95
+ + " creation (seeded partial), then augmented every query. Materialized"
96
+ + " as playbook.md. On a per-query augment / refine, pass the full"
97
+ + " updated body.",
58
98
  }),
59
- playbook: Type.Optional(Type.String({
60
- description: "The generated domain sub-skill: how this expert shops on sil (which"
61
- + " sil_* tool for which intent, refinement rules). Materialized as"
62
- + " playbook.md and loaded by the sil skill at session start. Omit"
63
- + " when the expert needs no domain playbook.",
64
- })),
65
99
  }),
66
100
  async execute(_callId, params) {
67
101
  // The host validates `params` against the schema above before we run, but
@@ -70,23 +104,22 @@ function registerMaterialize(api) {
70
104
  const spec = {
71
105
  agentId: typeof params["agentId"] === "string" ? params["agentId"] : "",
72
106
  name: typeof params["name"] === "string" ? params["name"] : "",
73
- persona: typeof params["persona"] === "string" ? params["persona"] : "",
74
- ...(typeof params["playbook"] === "string"
75
- ? { playbook: params["playbook"] }
76
- : {}),
107
+ domainSpec: typeof params["domainSpec"] === "string" ? params["domainSpec"] : "",
108
+ intentSpec: typeof params["intentSpec"] === "string" ? params["intentSpec"] : "",
109
+ userSpec: typeof params["userSpec"] === "string" ? params["userSpec"] : "",
110
+ playbook: typeof params["playbook"] === "string" ? params["playbook"] : "",
77
111
  };
78
112
  const result = materializeProfile(spec);
79
113
  if (result.ok) {
80
- api.logger.info("sil_profile_materialized", {
81
- agent_id: result.agentId,
82
- has_playbook: result.playbookPath !== undefined,
83
- });
114
+ api.logger.info("sil_profile_materialized", { agent_id: result.agentId });
84
115
  return jsonResult({
85
116
  status: "ok",
86
117
  agentId: result.agentId,
87
118
  dir: result.dir,
88
- personaPath: result.personaPath,
89
- ...(result.playbookPath ? { playbookPath: result.playbookPath } : {}),
119
+ domainSpecPath: result.domainSpecPath,
120
+ intentSpecPath: result.intentSpecPath,
121
+ userSpecPath: result.userSpecPath,
122
+ playbookPath: result.playbookPath,
90
123
  profilePath: result.profilePath,
91
124
  });
92
125
  }
@@ -126,11 +159,13 @@ function registerList(api) {
126
159
  + " arguments. Sourced from the sil data directory's artefact store (each"
127
160
  + " agents/<id>/profile.json is the authoritative \"is a sil expert\""
128
161
  + " signal — a bare host agent without one is not listed). Returns the"
129
- + " experts most-recently-created first, each with its agentId, name,"
130
- + " whether it carries a domain playbook, and createdAt. An empty store is"
131
- + " a normal, successful empty listing — not an error. One unreadable or"
132
- + " corrupt manifest is reported inline in `unreadable` and never aborts"
133
- + " the listing. Reads no token and writes nothing.",
162
+ + " experts most-recently-created first, each with its agentId, name, and"
163
+ + " createdAt. Every expert carries all four SDS specs (domain + intent +"
164
+ + " user + playbook, all required and present from creation), so per-slot"
165
+ + " presence is not flagged. An empty store is a normal, successful empty"
166
+ + " listing — not an error. One unreadable or corrupt manifest is reported"
167
+ + " inline in `unreadable` and never aborts the listing. Reads no token and"
168
+ + " writes nothing.",
134
169
  parameters: Type.Object({}),
135
170
  async execute(_callId, _params) {
136
171
  const { experts, unreadable } = listAgentProfiles();
@@ -150,8 +185,8 @@ function registerList(api) {
150
185
  * `sil_profile_get` — view one expert's full detail (read-only).
151
186
  *
152
187
  * Re-runs the writer's `agentId` gate before any read (a traversal-shaped id →
153
- * `invalid_request`). Returns the manifest plus the persona/playbook bodies so
154
- * the skill can render a complete view. An unknown or unloadable expert →
188
+ * `invalid_request`). Returns the manifest plus the SDS artefact bodies so the
189
+ * skill can render a complete view. An unknown or unloadable expert →
155
190
  * `not_found` (the skill lists the healthy experts) — never a stack trace or a
156
191
  * raw path. Reads no token and writes nothing.
157
192
  */
@@ -160,12 +195,14 @@ function registerGet(api) {
160
195
  name: "sil_profile_get",
161
196
  label: "View one sil shopping expert's detail",
162
197
  description: "Show one sil shopping expert's full detail — read-only. Pass its"
163
- + " `agentId`. Returns the expert's name, its persona/instructions, its"
164
- + " domain playbook when one exists, the manifest path, and createdAt,"
165
- + " read from the artefact store so the agent can summarize the expert."
166
- + " An unknown expert returns `not_found` (list the experts to see which"
167
- + " exist) — never a stack trace or a raw path. A malformed/traversal id"
168
- + " returns `invalid_request`. Reads no token and writes nothing.",
198
+ + " `agentId`. Returns the expert's name, its four SDS specs (domain, intent,"
199
+ + " user spec / facts, and playbook / buying taste — all present), the"
200
+ + " manifest path, and createdAt, read from the artefact store so the agent"
201
+ + " can summarize the expert. The persona is not here — it is the host"
202
+ + " workspace SOUL.md. An unknown expert returns `not_found` (list the"
203
+ + " experts to see which exist) — never a stack trace or a raw path. A"
204
+ + " malformed/traversal id returns `invalid_request`. Reads no token and"
205
+ + " writes nothing.",
169
206
  parameters: Type.Object({
170
207
  agentId: Type.String({
171
208
  description: "The expert's host agent id (lower-kebab, e.g. \"gift-buyer\"; not"
@@ -176,16 +213,15 @@ function registerGet(api) {
176
213
  const agentId = typeof params["agentId"] === "string" ? params["agentId"] : "";
177
214
  const result = readAgentProfile(agentId);
178
215
  if (result.ok) {
179
- api.logger.info("sil_profile_viewed", {
180
- agent_id: result.agentId,
181
- has_playbook: result.playbook !== undefined,
182
- });
216
+ api.logger.info("sil_profile_viewed", { agent_id: result.agentId });
183
217
  return jsonResult({
184
218
  status: "ok",
185
219
  agentId: result.agentId,
186
220
  name: result.name,
187
- persona: result.persona,
188
- ...(result.playbook !== undefined ? { playbook: result.playbook } : {}),
221
+ domainSpec: result.domainSpec,
222
+ intentSpec: result.intentSpec,
223
+ userSpec: result.userSpec,
224
+ playbook: result.playbook,
189
225
  profilePath: result.profilePath,
190
226
  createdAt: result.createdAt,
191
227
  });
@@ -2,7 +2,7 @@
2
2
  "id": "sil",
3
3
  "name": "sil",
4
4
  "description": "sil commerce plugin for OpenClaw — register on sil, read your identity, and search and look up products in the sil catalog.",
5
- "version": "0.3.0",
5
+ "version": "0.3.3",
6
6
  "skills": ["./skill"],
7
7
  "activation": {
8
8
  "onCapabilities": ["tool"]
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "security": {
53
53
  "shipsRuntimeCode": true,
54
- "packagingNote": "Compiled JavaScript ships under ./dist. register() stays synchronous and opens nothing — it only registers tools. ALL I/O happens inside a tool's execute(): sil_register calls sil-web over the network, writes tokens.json + config.json to the plugin data directory (owner-only, 0600), and arms a bounded background poll timer that stops on the first terminal claim outcome or after the session deadline. sil_whoami reads the stored access token and calls sil-api for the user's identity, refreshing transparently via sil-web on a 401 (at most one refresh + one retry per call, no timer); a confirmed-dead session clears tokens.json. sil_search and sil_product_get read the stored access token and call sil-api's catalog endpoints (search / lookup) with it — read-only, no token write, no timer, a single round-trip (a 401 is a terminal re-register hint, no refresh). sil_profile_materialize makes no network call and reads no token: it writes a created shopping expert's behaviour artefacts (persona.md, optional playbook.md, profile.json) atomically into $SIL_DATA_DIR/agents/<agentId>/ (owner-only, 0600) — the agent's host-config wiring is driven separately by the host CLI, never by this plugin. sil_profile_list / sil_profile_get / sil_profile_remove are the local expert lifecycle over the same artefact store, also making no network call and reading no token: list enumerates $SIL_DATA_DIR/agents/*/profile.json read-only, get reads one expert's manifest + persona/playbook bodies read-only, and remove deletes exactly one validated agents/<agentId>/ leaf directory (fail-closed on a malformed/traversal id — deletes nothing) — the host-wiring half of removal is the host CLI's, not this plugin's. The PKCE verifier is held only in memory and is never written to disk. Tokens and identity PII are never logged.",
54
+ "packagingNote": "Compiled JavaScript ships under ./dist. register() stays synchronous and opens nothing — it only registers tools. ALL I/O happens inside a tool's execute(): sil_register calls sil-web over the network, writes tokens.json + config.json to the plugin data directory (owner-only, 0600), and arms a bounded background poll timer that stops on the first terminal claim outcome or after the session deadline. sil_whoami reads the stored session token and calls sil-api for the user's identity, refreshing transparently via sil-web on a 401 (at most one refresh + one retry per call, no timer); a confirmed-dead session clears tokens.json. sil_search and sil_product_get read the stored session token and call sil-api's catalog endpoints (search / lookup) with it — read-only on catalog data, no timer, but with the SAME bounded 401 recovery as sil_whoami: on a 401 they refresh ONCE via sil-web (rotating tokens.json) and retry the read ONCE; a second 401 or a dead (invalid_grant) refresh token clears tokens.json and is reported as a terminal re-register hint. A non-401 error writes no token. sil_profile_materialize makes no network call and reads no token: it writes a created shopping expert's SDS behaviour artefacts (domain_spec.md + intent_spec.md + user_spec.md + playbook.md — all four required and present from creation, seeded partial then augmented every query, plus profile.json) into $SIL_DATA_DIR/agents/<agentId>/ (owner-only, 0600), writing each artefact atomically (tmp file → rename over target). Failure guarantee: a FRESH create that fails mid-write is torn down (no partial directory survives); a RE-MATERIALIZE over an existing expert is per-file atomic and dir-preserving (NOT a cross-file transaction) — on failure the prior expert is left intact and is never served half-refined (a missing body fails the read closed). The persona is the agent's host workspace SOUL.md, written by the host CLI (not this plugin, not a sil artefact), and the agent's host-config wiring is driven separately by the host CLI. sil_profile_list / sil_profile_get / sil_profile_remove are the local expert lifecycle over the same artefact store, also making no network call and reading no token: list enumerates $SIL_DATA_DIR/agents/*/profile.json read-only, get reads one expert's manifest + domain_spec/intent_spec/user_spec/playbook bodies read-only, and remove deletes exactly one validated agents/<agentId>/ leaf directory (fail-closed on a malformed/traversal id — deletes nothing) — the host-wiring half of removal is the host CLI's, not this plugin's. The PKCE verifier is held only in memory and is never written to disk. Tokens and identity PII are never logged.",
55
55
  "registersLongLivedService": false,
56
56
  "serviceIds": [],
57
57
  "runsTimers": true,
@@ -61,7 +61,7 @@
61
61
  "https://sil.4gpts.com"
62
62
  ],
63
63
  "filesystemScope": [
64
- "$SIL_DATA_DIR (default $XDG_DATA_HOME/sil, else ~/.local/share/sil) — tokens.json, config.json, agents/<agentId>/{persona.md,playbook.md,profile.json} (shopping-expert behaviour artefacts written by sil_profile_materialize)"
64
+ "$SIL_DATA_DIR (default $XDG_DATA_HOME/sil, else ~/.local/share/sil) — tokens.json, config.json, agents/<agentId>/{domain_spec.md,intent_spec.md,user_spec.md,playbook.md,profile.json} (shopping-expert SDS behaviour artefacts written by sil_profile_materialize — all four required and present from creation, seeded partial then augmented every query: the domain spec (domain_spec.md) + intent-spec dimension schema (intent_spec.md) + user spec (user_spec.md) + buying taste (playbook.md); the persona is the host workspace SOUL.md, not a sil artefact)"
65
65
  ],
66
66
  "credentialsOnDisk": [
67
67
  "tokens.json (access + refresh token)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sil-openclaw",
3
- "version": "0.3.0",
3
+ "version": "0.3.3",
4
4
  "description": "OpenClaw plugin for sil — register an identity and search and look up products in the sil commerce catalog from an agent.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/skill/SKILL.md CHANGED
@@ -39,7 +39,7 @@ Confirm the `sil_*` tools are exposed. If they are missing from the available to
39
39
 
40
40
  [`references/catalog_tools_reference.md`](references/catalog_tools_reference.md) holds the per-tool behaviour for the four core tools and the shared status taxonomy. Basic shopping needs only that one reference.
41
41
 
42
- When the session is running **inside a created expert** (a loaded profile under `$SIL_DATA_DIR/agents/<agentId>/`) and the user states a shopping intent, follow [`references/expert_shopping.md`](references/expert_shopping.md) — the profile-driven shop-time loop. It is additive: a plain, profile-less session keeps shopping via the "find X" → `sil_search` row above, unchanged.
42
+ When the session is running **inside a created expert** (a loaded profile under `$SIL_DATA_DIR/agents/<agentId>/`) and the user states a shopping intent, follow [`references/expert_shopping.md`](references/expert_shopping.md) — the profile-driven, **Spec-Driven Shopping (SDS)** shop-time loop that web-refreshes the domain spec, decomposes the request along the intent spec, and augments the already-present user spec + buying taste every query. A created expert runs entirely on SDS; a plain, profile-less session keeps shopping via the "find X" → `sil_search` row above, unchanged.
43
43
 
44
44
  [`references/manage_experts.md`](references/manage_experts.md) holds the list / view / remove flow for the experts the user has created — including the host-CLI-first remove ordering and the confirm-before-remove gate. Load it the moment the user wants to see or remove an existing expert.
45
45
 
@@ -1,106 +1,150 @@
1
- # Worked example — a road-cycling shopping expert, end to end
1
+ # Worked example — a road-cycling shopping expert as general counsel
2
2
 
3
- A complete walkthrough from a free-form request through the interview ([`../references/brainstorm_interview.md`](../references/brainstorm_interview.md)) to a created expert via the engine ([`../references/agent_creation_engine.md`](../references/agent_creation_engine.md)). The transcript is illustrative — a real interview adapts to the user; this shows the *shape* of convergence and the load-bearing gates.
3
+ A short walkthrough from a **create-expert request** through the interview
4
+ ([`../references/brainstorm_interview.md`](../references/brainstorm_interview.md))
5
+ to a created expert via the engine
6
+ ([`../references/agent_creation_engine.md`](../references/agent_creation_engine.md)),
7
+ then how it acts as **general counsel to the buyer** — an ongoing advisor across
8
+ the buyer's cycling needs, not a one-query optimizer. The interview walks the
9
+ **five artefacts, one touchpoint each, in order**; the deep domain work is the
10
+ agent's own research. The transcript is illustrative — it shows the *shape*, the
11
+ gates, and the SDS layering.
4
12
 
5
- ## 1. The free-form request
13
+ ## The interview — one touchpoint per document
6
14
 
7
15
  > **User:** "I want an expert that shops for road-cycling gear for me."
8
16
 
9
- Reflect the request back and open with one orienting question — not a form:
17
+ **1. `SOUL.md` — ask first (persona; the niche falls out).** No separate
18
+ narrow-the-niche step:
10
19
 
11
- > **Expert:** "A shopping expert for road-cycling gear — let's shape it together. We can revise anything as we go. To start: are you after a complete bike, or kit and components (wheels, groupsets, apparel)?"
20
+ > **Expert:** "Let's shape it. What kind of expert do you want, and how should it
21
+ > behave?"
22
+ > **User:** "A patient guide — I'm buying my first proper road bike and I'm new to
23
+ > this. Always explain fit. And no carbon-fibre handlebars, a friend cracked one."
12
24
 
13
- ## 2. Narrow the (vague) domain FIRST
25
+ → Persona (→ host **`SOUL.md`**): *a patient first-bike advisor who always explains
26
+ fit; standing rule — never recommend carbon handlebars.* The niche — **a complete
27
+ first road bike** — fell out of the answer.
14
28
 
15
- "Road-cycling gear" is broad. Narrow it before any other section:
29
+ **2. `domain_spec.md` — no question (the agent researches the web).** The agent
30
+ researches how to buy a first road bike well, then reflects the shape back:
16
31
 
17
- > **User:** "Mostly components and apparel — I already have a frame."
18
- > **Expert:** "Got it — so the niche is **road-cycling components & apparel for an existing frame** (wheels, groupsets, finishing kit, clothing), not complete bikes. Does that capture it?"
19
- > **User:** "Yes."
32
+ > **Expert:** "I've done the homework. The short version: **the fit is everything** —
33
+ > frame size from height *and* inseam, stack/reach set torso angle, saddle setback
34
+ > from KOPS, crank length scales with inseam. Then endurance-vs-race geometry,
35
+ > groupset/gearing theory (gear-inches, compact vs mid-compact for your terrain),
36
+ > and alloy-vs-carbon + wheel/tyre trade-offs. For a first bike I'd weight fit and
37
+ > comfort over outright speed. Track?"
38
+ > **User:** "Yes — I want to actually enjoy riding it."
20
39
 
21
- The concrete, confirmed niche is locked before persona/mapping/rubric — the narrow-first gate is satisfied.
40
+ → Deep **`domainSpec`** (→ `domain_spec.md`): the full how-to-buy-well — the
41
+ complete fit process, geometry, gearing theory, material/wheel trade-offs — the
42
+ layer a coarse "size 56, black" request never names. *(If the agent had no web tool,
43
+ it would say so, then compose the domain spec from well-established, public buying knowledge — never present a guess as verified research.)*
22
44
 
23
- ## 3. Converge the persona (section 2)
45
+ **3. `user_spec.md` — one basic question.** The single most-basic niche fact:
24
46
 
25
- > **Expert:** "How should this expert come across — a terse spec-checker, or a chatty guide who explains trade-offs? Any standing rules?"
26
- > **User:** "Knowledgeable but concise. Always flag compatibility issues with my groupset. No carbon-fibre handlebars — I don't trust them."
27
- > **Expert:** "Persona: a concise, knowledgeable road-cycling components advisor; standing rules — always flag groupset compatibility, never recommend carbon handlebars. Good?"
28
- > **User:** "Perfect."
47
+ > **Expert:** "One basic thing I'll keep: your **height** and **inseam**?"
48
+ > **User:** "178 cm, 81 cm inseam."
29
49
 
30
- → lands in `persona`.
50
+ → Seeded partial **`userSpec`** (→ `user_spec.md`): *height 178 / inseam 81 (soft
51
+ facts); HARD-NO: carbon-fibre handlebars (inviolable).* The rest is augmented per
52
+ query.
31
53
 
32
- ## 4. Converge the three playbook sections (3–5)
54
+ **4. `playbook.md` — one question: compare a set of options (buying taste).**
33
55
 
34
- **Elicitation style:**
35
- > **Expert:** "When you ask it to shop, should it search right away on a one-line request, or ask a clarifying question or two first?"
36
- > **User:** "Ask at most one clarifying question, then search."
56
+ > **Expert:** "Of these three — a value alloy build, a mid-range carbon, a premium
57
+ > race bike — which appeals, and why?"
58
+ > **User:** "The value alloy, around €1500. I don't chase brands."
37
59
 
38
- **Answer→`sil_search`-param mapping** (loading [`../references/search_param_mapping.md`](../references/search_param_mapping.md)):
39
- > **Expert:** "For components the decision-attributes are budget, groupset tier, new vs. secondhand, and where you buy. Where do you stand?"
40
- > **User:** "Budget around €1200, secondhand is fine, I'm in France and prefer local shops."
60
+ → Seeded partial **`playbook`** (→ `playbook.md`): *value-conscious, ~€1500 feel,
61
+ brand-agnostic; comfort over outright speed.*
41
62
 
42
- Translating each stated input to a real param:
63
+ **5. `intent_spec.md` — sign-off.** The decomposition dimensions, derived from the
64
+ domain spec:
43
65
 
44
- ```
45
- query: "road-cycling components 105 groupset" # niche descriptors
46
- category: "cycling-components"
47
- price_max: 120000 # €1200 → minor units (cents)
48
- condition: ["secondhand"] # "secondhand is fine"
49
- local_merchants: true # "prefer local shops" → ranking bias; query issued in French
50
- # ship_to: OMITTED — server resolves the registered default address; no sil_whoami round-trip
51
- ```
52
-
53
- **Recommendation rubric:**
54
- > **Expert:** "What matters most when I pick among results?"
55
- > **User:** "Compatibility first, then value, then weight. Brand X is a hard no."
56
-
57
- → Rubric: rank by groupset compatibility, then value, then weight; exclude brand X. Tied to the user's *stated* priorities, not a fixed order.
66
+ > **Expert:** "Every time you ask me to find something, I'll decompose along:
67
+ > use-case, terrain, budget, fit envelope, timeline, compatibility, performance
68
+ > priorities, aesthetics. Sign off?"
69
+ > **User:** "Yep."
58
70
 
59
- All three sections are authored as prose into the single `playbook` string.
71
+ → **`intentSpec`** (→ `intent_spec.md`): that schema (the dimensions to resolve),
72
+ never a filled-in request.
60
73
 
61
- ## 5. Derive + confirm the identity
74
+ ## Assemble + endorse — the gate
62
75
 
63
- > **Expert:** "I'll call it **Road-Cycling Buyer** (`road-cycling-buyer`). Good?"
64
- > **User:** "Yes."
65
-
66
- → `agentId: road-cycling-buyer` (lower-kebab, ≠ `main`), `name: "Road-Cycling Buyer"`.
67
-
68
- ## 6. Assemble the draft and present it back
69
-
70
- The assembled spec — a valid `sil_profile_materialize` input:
76
+ Identity confirmed (`road-cycling-buyer` / "Road-Cycling Buyer"), the assembled
77
+ draft is a valid `sil_profile_materialize` input — persona → `SOUL.md`, all four
78
+ SDS specs to the sil store, all present from creation (user side seeded *partial*):
71
79
 
72
80
  ```jsonc
73
81
  {
74
82
  "agentId": "road-cycling-buyer",
75
83
  "name": "Road-Cycling Buyer",
76
- "persona": "A concise, knowledgeable road-cycling components advisor. Standing rules: always flag groupset compatibility; never recommend carbon-fibre handlebars.",
77
- "playbook": "## Elicitation style\nAsk at most one clarifying question, then search.\n\n## Answer→sil_search-param mapping\n- Budget → price_min/price_max (minor units). Secondhand-ok → condition: [\"secondhand\"]. Local shops → local_merchants: true, query in French. ship_to left empty (server resolves the registered default; no sil_whoami round-trip).\n\n## Recommendation rubric\nRank by groupset compatibility, then value, then weight. Brand X is a hard no."
84
+ "persona": "A patient first-road-bike advisor. Always explains fit. Standing rule: never recommend carbon-fibre handlebars.",
85
+ "domainSpec": "## First road bike — how to buy well (deep)\n**Fit is everything**: size from height AND inseam; stack/reach set torso angle; saddle setback from KOPS; crank length scales with inseam; bar reach/drop set hands. Bad fit is the #1 reason first bikes get abandoned.\n## Geometry: endurance (comfort) vs race (speed); head-tube angle + trail govern handling.\n## Groupset & gearing: tier = shift quality + weight, not capability; gear-inches = chainring/cog × wheel; compact vs mid-compact vs 1x trade range for step size — pick for terrain.\n## Material & wheels: alloy vs carbon (feel/price/repairability); rim depth vs crosswind; tyre clearance bounds comfort.\n## Trade-offs: stiffness vs comfort; aero vs crosswind; tier vs budget. First bike: weight fit + comfort over speed.",
86
+ "intentSpec": "## Decomposition dimensions (schema)\nuse-case; terrain; budget band; fit envelope; timeline; compatibility; performance priorities; aesthetics. The per-query fill is ephemeral; this schema is persisted.",
87
+ "userSpec": "## User spec (seeded partial)\n### Soft facts/preferences\n- Height 178 cm, inseam 81 cm.\n- Comfort + enjoyment over outright speed.\n### Hard constraints (INVIOLABLE)\n- HARD-NO: carbon-fibre handlebars.",
88
+ "playbook": "## Buying taste (seeded partial)\n- Value-conscious; budget feel ~€1500.\n- Brand-agnostic. (Finer taste fills in per-query.)"
78
89
  }
79
90
  ```
80
91
 
81
- > **Expert:** "Here's the expert: a concise components advisor that flags compatibility, searches secondhand within ~€1200, biases to local French shops, and ranks compatibility → value → weight. Shall I create it?"
92
+ > **Expert:** "Here's the expert — shall I create it?"
93
+ > **User:** "Yes, create it."
82
94
 
83
- ## 7. Explicit endorsement — the gate
95
+ **This affirmative act is the gate** — up to here, **zero engine steps ran**. Only
96
+ now does the engine proceed
97
+ ([`../references/agent_creation_engine.md`](../references/agent_creation_engine.md)):
98
+ validate-first → collision check → `openclaw agents add road-cycling-buyer
99
+ --workspace ~/.openclaw/workspace-road-cycling-buyer --non-interactive --json`
100
+ (confirm the inherited profile grants a web tool) → write the persona into
101
+ `SOUL.md` → `sil_profile_materialize { agentId, name, domainSpec, intentSpec,
102
+ userSpec, playbook }` → wire sil:
84
103
 
85
- > **User:** "Yes, create it."
104
+ ```
105
+ openclaw config set 'agents.list[<i>].skills' '["sil"]' --strict-json
106
+ openclaw config set plugins.entries.sil.enabled true --strict-json
107
+ ```
108
+
109
+ → `openclaw config validate --json` returns valid → **`created`**.
110
+
111
+ ## As general counsel — an ongoing advisor, not a one-query optimizer
112
+
113
+ The expert is now standing counsel for this buyer's cycling life. Across requests it
114
+ **reuses** what it knows (the 178/81 fit envelope, the no-carbon-bars hard rule, the
115
+ value-conscious taste — **never re-asked**), and on **every query** web-refreshes the
116
+ domain spec, decomposes the request along the intent dimensions, and **augments** the
117
+ already-present user spec + playbook — we keep learning.
118
+
119
+ > **User:** "Find me a first road bike, ~€1500."
86
120
 
87
- **This affirmative act is the gate.** Up to this point, **zero engine steps have run** — nothing was written. Only now does the engine proceed.
121
+ This is one request, not the point of the expert. It runs the shop-time loop
122
+ ([`../references/expert_shopping.md`](../references/expert_shopping.md) owns the
123
+ map→search→compare→recommend machinery — not repeated here): web-refresh the domain,
124
+ decompose the intent, augment the playbook with a taste it surfaces in context, then
125
+ recommend with a "why" that **cites the layers** — "for your **178/81 fit envelope**
126
+ (kept from before) a 54 cm endurance frame sits right, and **fit/comfort outrank
127
+ outright speed on a first bike** (a domain mechanic), so I passed a lighter race-geo
128
+ bike, all within your value budget." A rationale naming no domain mechanic and reusing
129
+ no stored fact would **fail the SDS bar** even if the bike were fine.
88
130
 
89
- ## 8. Run the engine (after endorsement)
131
+ Weeks later the *same* counsel handles new needs without re-onboarding:
90
132
 
91
- Following [`../references/agent_creation_engine.md`](../references/agent_creation_engine.md) in order:
133
+ > **User:** "Now a winter bike, same budget."
92
134
 
93
- 1. **Validate the spec FIRST** — `agentId` lower-kebab & ≠ `main` ✓, `name` non-blank ✓, `persona` non-blank ✓, `workspace` present ✓.
94
- 2. **Collision check** — `openclaw agents list --json`; no existing `road-cycling-buyer` → proceed.
95
- 3. **Create the shell** — `openclaw agents add road-cycling-buyer --workspace ~/.openclaw/workspace-road-cycling-buyer --non-interactive --json`.
96
- 4. **Materialize artefacts** — `sil_profile_materialize` with the spec writes `persona.md`, `playbook.md`, `profile.json` into `$SIL_DATA_DIR/agents/road-cycling-buyer/`.
97
- 5. **System framing** — copy `persona.md` into the agent's workspace `SOUL.md`.
98
- 6. **Wire sil** — `openclaw config set 'agents.list[<i>].skills' '["sil"]' --strict-json` and `openclaw config set plugins.entries.sil.enabled true --strict-json`.
99
- 7. **Validate with the host's OWN check, THEN declare created** — `openclaw config validate --json` returns valid → outcome **`created`**.
100
- 8. **Tell the user** — the expert exists; opening it loads the persona + playbook and it shops on its niche with **no further setup**.
135
+ It reuses the fit envelope and taste, decomposes the new intent (all-weather →
136
+ mudguard clearance, tyre durability), and recommends citing the kept fit fact + a
137
+ winter domain mechanic. A "bump my budget to €2000" **updates** the stored taste
138
+ (visibly); but "find me a carbon-handlebar bike" hits the standing **hard rule** —
139
+ intent never overrides a hard constraint.
101
140
 
102
141
  ## Edge cases this example would have handled
103
142
 
104
- - **Collision** (a `road-cycling-buyer` already exists): the engine returns `collision`, writes nothing, and the conversation offers **refine-or-rename** — never clobbers.
105
- - **Abandon before step 7** of the interview (user walks away pre-endorsement): nothing was created, nothing to tear down — the draft lived only in the conversation.
106
- - **Creation is local + offline**: no sil registration was needed to create the expert; the user registers later, on first shop, via `sil_register`.
143
+ - **Collision** (`road-cycling-buyer` exists): the engine returns `collision`, writes
144
+ nothing, the conversation offers **refine-or-rename** — never clobbers.
145
+ - **Abandon before endorsement**: nothing created, nothing to tear down — the draft
146
+ lived only in the conversation.
147
+ - **No web tool**: the expert says so honestly and proceeds on the existing domain
148
+ spec — never pretends the refresh happened.
149
+ - **Creation is local + offline** (for identity): no sil registration to create; the
150
+ user registers later, on first shop, via `sil_register`.