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
package/dist/tools/identity.js
CHANGED
|
@@ -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
|
|
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
|
|
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({}),
|
package/dist/tools/profile.js
CHANGED
|
@@ -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 (
|
|
6
|
-
* domain
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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
|
|
40
|
-
+ "
|
|
41
|
-
+ "
|
|
42
|
-
+ "
|
|
43
|
-
+ "
|
|
44
|
-
+ "
|
|
45
|
-
+ "
|
|
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
|
-
|
|
55
|
-
description: "The
|
|
56
|
-
+ "
|
|
57
|
-
+ "
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
89
|
-
|
|
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
|
-
+ "
|
|
131
|
-
+ "
|
|
132
|
-
+ "
|
|
133
|
-
+ "
|
|
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
|
|
154
|
-
*
|
|
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
|
|
164
|
-
+ "
|
|
165
|
-
+ " read from the artefact store so the agent
|
|
166
|
-
+ "
|
|
167
|
-
+ "
|
|
168
|
-
+ "
|
|
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
|
-
|
|
188
|
-
|
|
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
|
});
|
package/openclaw.plugin.json
CHANGED
|
@@ -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.
|
|
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
|
|
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>/{
|
|
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
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.
|
|
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
|
|
1
|
+
# Worked example — a road-cycling shopping expert as general counsel
|
|
2
2
|
|
|
3
|
-
A
|
|
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
|
-
##
|
|
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
|
-
|
|
17
|
+
**1. `SOUL.md` — ask first (persona; the niche falls out).** No separate
|
|
18
|
+
narrow-the-niche step:
|
|
10
19
|
|
|
11
|
-
> **Expert:** "
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
> **
|
|
18
|
-
>
|
|
19
|
-
>
|
|
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
|
-
|
|
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
|
-
|
|
45
|
+
**3. `user_spec.md` — one basic question.** The single most-basic niche fact:
|
|
24
46
|
|
|
25
|
-
> **Expert:** "
|
|
26
|
-
> **User:** "
|
|
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
|
-
→
|
|
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
|
-
|
|
54
|
+
**4. `playbook.md` — one question: compare a set of options (buying taste).**
|
|
33
55
|
|
|
34
|
-
**
|
|
35
|
-
>
|
|
36
|
-
> **User:** "
|
|
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
|
-
|
|
39
|
-
|
|
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
|
-
|
|
63
|
+
**5. `intent_spec.md` — sign-off.** The decomposition dimensions, derived from the
|
|
64
|
+
domain spec:
|
|
43
65
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
71
|
+
→ **`intentSpec`** (→ `intent_spec.md`): that schema (the dimensions to resolve),
|
|
72
|
+
never a filled-in request.
|
|
60
73
|
|
|
61
|
-
##
|
|
74
|
+
## Assemble + endorse — the gate
|
|
62
75
|
|
|
63
|
-
|
|
64
|
-
|
|
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
|
|
77
|
-
"
|
|
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
|
|
92
|
+
> **Expert:** "Here's the expert — shall I create it?"
|
|
93
|
+
> **User:** "Yes, create it."
|
|
82
94
|
|
|
83
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
131
|
+
Weeks later the *same* counsel handles new needs without re-onboarding:
|
|
90
132
|
|
|
91
|
-
|
|
133
|
+
> **User:** "Now a winter bike, same budget."
|
|
92
134
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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** (
|
|
105
|
-
|
|
106
|
-
- **
|
|
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`.
|