@wowok/skills 1.1.2 → 1.1.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.
@@ -1,620 +1,225 @@
1
1
  ---
2
2
  name: wowok-tools
3
3
  description: |
4
- Definitive WoWok MCP tool usage reference — the authoritative fallback when
5
- MCP tool schemas are unavailable. Covers ALL 13 tools with complete parameter
6
- structures, operation types, query types, discriminated unions, and nested
7
- sub-field schemas. Prevents the most common AI failures: wrong tool selection,
8
- incorrect parameter formats, missing required fields, wrong discriminated
9
- union branches, and stale cache issues.
10
-
11
- Use this skill when:
12
- - AI needs to select or invoke any WoWok MCP tool
13
- - AI is unsure which tool fits a task
14
- - AI needs exact parameter format for a specific operation_type
15
- - AI encounters a tool error and needs troubleshooting
16
- - MCP tool schemas are not auto-available in the current environment
17
- - User asks "how do I..." for any WoWok operation
18
- - AI needs to verify parameter types before calling
4
+ WoWok MCP tool reference — the fallback when schemas are unavailable.
5
+ Covers 13 tools with usage patterns, common pitfalls, and troubleshooting.
6
+
7
+ Core value: prevent common AI failures (wrong tool selection, incorrect
8
+ parameter formats, missing required fields, wrong discriminated unions).
19
9
  when_to_use:
20
- - AI is about to call any WoWok MCP tool
21
- - AI is unsure which tool to use for a task
22
- - AI encounters a tool error and needs to debug
10
+ - AI needs to select or invoke any WoWok MCP tool
11
+ - AI encounters tool errors and needs debugging
12
+ - MCP tool schemas are not auto-available
23
13
  - User asks "how do I..." for any WoWok operation
24
- - AI needs exact schema for a specific operation_type or query_type
25
14
  always: true
26
15
  ---
27
16
 
28
- # WoWok MCP Tool Usage Reference
17
+ # WoWok MCP Tool Reference
29
18
 
30
- ## Quick Template (Copy This)
19
+ Quick reference for WoWok MCP tools — patterns, pitfalls, and troubleshooting.
31
20
 
32
- When calling `onchain_operations`, always use this structure:
33
-
34
- ```
35
- {
36
- "operation_type": "<select from 16 types below>",
37
- "data": { /* see specific operation_type for details */ },
38
- "env": { "account": "", "network": "testnet" },
39
- "submission": { /* only when Guard requires user submission */ }
40
- }
41
- ```
42
-
43
- **Critical Rules:**
44
- 1. `operation_type` MUST be one of the 16 types listed below
45
- 2. `data` structure changes based on `operation_type` — see each operation's details
46
- 3. `submission` is ONLY needed when Guard validation requires user-provided data
47
- 4. Most operations return directly; only Guard-triggered flows need a second call with `submission`
21
+ > **Domain Skills**: [wowok-guard](../wowok-guard/SKILL.md) (validation logic), [wowok-messenger](../wowok-messenger/SKILL.md) (encrypted messaging), [wowok-machine](../wowok-machine/SKILL.md) (workflows)
22
+ > **Business Skills**: [wowok-order](../wowok-order/SKILL.md) (customer), [wowok-provider](../wowok-provider/SKILL.md) (merchant), [wowok-arbitrator](../wowok-arbitrator/SKILL.md) (dispute resolution)
48
23
 
49
24
  ---
50
25
 
51
- ## The 13 Tools
52
-
53
- | # | Tool | Type | Description |
54
- |---|------|------|-------------|
55
- | 1 | `onchain_operations` | Write | All on-chain state changes (16 operation_types) |
56
- | 2 | `query_toolkit` | Read | Local + on-chain data query (8 query_types) |
57
- | 3 | `onchain_table_data` | Read | Dynamic field/table sub-item queries (12 query_types) |
58
- | 4 | `account_operation` | Local | Wallet management — 100% local |
59
- | 5 | `local_mark_operation` | Local | Name→address mappings — 100% local |
60
- | 6 | `local_info_operation` | Local | Private data store — 100% local |
61
- | 7 | `messenger_operation` | Hybrid | Encrypted messaging (local + on-chain) |
62
- | 8 | `wip_file` | Hybrid | Witness promise files (generate/verify/sign) |
63
- | 9 | `guard2file` | Read | Export Guard definition to local file |
64
- | 10 | `machineNode2file` | Read | Export Machine nodes to local file |
65
- | 11 | `onchain_events` | Read | Watch on-chain events (paginated) |
66
- | 12 | `wowok_buildin_info` | Read | Protocol reference (constants/instructions) |
67
- | 13 | `documents_and_learn` | Read | Documentation URLs |
68
-
69
- ---
70
-
71
- ## 1. onchain_operations — On-Chain State Changes
72
-
73
- **MCP Input**: `{ operation_type: string, data: object, submission?: object, env?: object }`
74
-
75
- ### operation_type Discriminated Union (16 types)
76
-
77
- The `operation_type` field determines WHICH `data` schema applies. Each type has a COMPLETELY different `data` structure.
78
-
79
- #### service — Service Listing
80
-
81
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_service" })`
82
-
83
- **Key Fields**:
84
- - `object`: TypedPermissionObject — STRING for existing, OBJECT for new
85
- - `description`: Service description
86
- - `location`: Service location
87
- - `sales`: Sales configuration with operations (add/set/remove/clear)
88
- - `repositories`: Repository objects
89
- - `rewards`: Reward objects
90
- - `arbitrations`: Arbitration objects
91
- - `machine`: Machine object ID or null
92
- - `discount`: Discount configuration
93
- - `discount_destroy`: Array of discount names to destroy
94
- - `customer_required`: Required customer info fields
95
- - `order_allocators`: Fund distribution rules
96
- - `buy_guard`: Guard ID for purchase validation
97
- - `change_guard`: Guard ID for order changes
98
- - `pause`: Pause service flag
99
- - `publish`: Publish service flag (LOCKS machine and order_allocators)
100
- - `owner_receive`: Owner fund extraction
101
- - `um`: Contact object ID for Messenger
102
-
103
- **Key Rules**:
104
- - `publish: true` LOCKS `machine` reference and `order_allocators` — unchangeable after publish
105
- - `rewards` and `arbitrations` can be ADDED after publish, not removed
106
- - `sales`, `discount`, `description`, `location` remain mutable after publish
107
-
108
- #### machine — Workflow Template
109
-
110
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_machine" })`
111
-
112
- **Key Fields**:
113
- - `object`: WithPermissionObject — STRING for existing, OBJECT for new
114
- - `progress_new`: Progress new schema
115
- - `description`: Machine description
116
- - `repository`: Repository objects
117
- - `node`: Node field schema with operations (add/set/remove/clear/exchange/rename) OR file path
118
- - `pause`: Pause flag
119
- - `publish`: Publish flag (makes nodes IMMUTABLE)
120
- - `owner_receive`: Owner fund extraction
121
- - `um`: Contact object ID
122
-
123
- **Key Rules**:
124
- - `publish: true` makes node definitions IMMUTABLE
125
- - Machine must be created BEFORE Service references it
126
-
127
- #### progress — Workflow Advancement
128
-
129
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_progress" })`
130
-
131
- **Key Fields**:
132
- - `object`: Progress object ID
133
- - `order`: Order ID
134
- - `node`: Single node advancement
135
- - `nodes`: Multi-step advancement array
136
- - `admin_hold`: Admin hold flag
137
- - `admin_unhold`: Admin unhold flag
138
- - `admin_unhold_node`: Admin unhold node index
139
- - `accept`: Accept flag
140
- - `recipient_accept`: Recipient for acceptance
141
- - `owner_receive`: Owner fund extraction
142
- - `um`: Contact object ID
143
-
144
- #### repository — Consensus Data
145
-
146
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_repository" })`
147
-
148
- **Key Fields**:
149
- - `object`: WithPermissionObject
150
- - `description`: Repository description
151
- - `entity`: Entity reference
152
- - `submit`: Submit records operation
153
- - `submit_and_sign`: Submit and sign records
154
- - `verify`: Verify records
155
- - `vote`: Vote on records
156
- - `owner_receive`: Owner fund extraction
157
- - `um`: Contact object ID
158
-
159
- #### arbitration — Dispute Resolution
160
-
161
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_arbitration" })`
162
-
163
- **Key Fields**:
164
- - `object`: WithPermissionObject
165
- - `description`: Arbitration description
166
- - `entity`: Entity reference
167
- - `arbitrators`: Arbitrators configuration
168
- - `owner_receive`: Owner fund extraction
169
- - `um`: Contact object ID
170
-
171
- #### contact — IM Contact Profile
172
-
173
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_contact" })`
174
-
175
- **Key Fields**:
176
- - `object`: WithPermissionObject
177
- - `my_status`: Status message
178
- - `description`: Contact description
179
- - `location`: Location
180
- - `ims`: IM addresses with operations (add/set/remove/clear)
181
- - `owner_receive`: Owner fund extraction
182
-
183
- #### treasury — Team Fund
184
-
185
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_treasury" })`
186
-
187
- **Key Fields**:
188
- - `object`: TypedPermissionObject
189
- - `description`: Treasury description
190
- - `receive`: Received balance
191
- - `deposit`: Deposit configuration
192
- - `withdraw`: Withdraw configuration
193
- - `external_deposit_guard`: External deposit guards
194
- - `external_withdraw_guard`: External withdraw guards
195
- - `owner_receive`: Owner fund extraction
196
- - `um`: Contact object ID
197
-
198
- #### reward — Incentive Pool
199
-
200
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_reward" })`
201
-
202
- **Key Fields**:
203
- - `object`: TypedPermissionObject
204
- - `claim`: Guard ID for claim verification
205
- - `description`: Reward description
206
- - `coin_add`: Coin to add
207
- - `receive`: Received balance
208
- - `guard_add`: Guards for reward distribution
209
- - `guard_remove_expired`: Remove expired guards flag
210
- - `guard_expiration_time`: Guard expiration time
211
- - `owner_receive`: Owner fund extraction
212
- - `um`: Contact object ID
213
-
214
- #### allocation — Auto-Distribution
215
-
216
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_allocation" })`
217
-
218
- **Two Modes**:
219
-
220
- **MODE 1: CREATE new Allocation**
221
- - `object`: Object with name, tags, onChain, replaceExistName, type_parameter
222
- - `allocators`: Allocator configuration
223
- - `coin`: Coin parameter
224
- - `payment_info`: Payment info
225
-
226
- **MODE 2: OPERATE existing Allocation**
227
- - `object`: Allocation ID or name (STRING)
228
- - `received_coins`: Received balance
229
- - `alloc_by_guard`: Guard for allocation
230
-
231
- #### permission — Access Control
232
-
233
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_permission" })`
234
-
235
- **Key Fields**:
236
- - `object`: WithPermissionObject
237
- - `description`: Permission description
238
- - `policy_add`: Add policies
239
- - `policy_remove`: Remove policies
240
- - `policy_clear`: Clear all policies
241
- - `owner_receive`: Owner fund extraction
242
- - `um`: Contact object ID
243
-
244
- #### guard — Programmable Validation
245
-
246
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_guard" })`
247
-
248
- **Key Fields**:
249
- - `namedNew`: Named object options
250
- - `description`: Guard description
251
- - `table`: Data table array with identifier, b_submission, value_type, value, name
252
- - `root`: Computational tree — either inline node or file reference
253
- - `type: "node"`: Inline GuardNode
254
- - `type: "file"`: Load from file
255
- - `rely`: Dependencies on other Guards
256
-
257
- See [wowok-guard](../wowok-guard/SKILL.md) skill for complete GuardNode reference.
258
-
259
- #### personal — On-Chain Public Identity
26
+ ## Core Patterns
260
27
 
261
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_personal" })`
28
+ ### Standard Structure
262
29
 
263
- **Key Fields**:
264
- - `description`: Personal description
265
- - `referrer`: Referrer reference
266
- - `information`: Information operations (add/remove/clear)
267
- - `mark`: Mark operations (add/remove/clear/transfer/replace/destroy)
268
-
269
- ⚠️ CRITICAL: Everything in `personal` is PERMANENTLY PUBLIC on-chain.
270
-
271
- #### payment — Irreversible Coin Transfer
272
-
273
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_payment" })`
274
-
275
- **Key Fields**:
276
- - `object`: Named object options
277
- - `revenue`: Revenue recipients array
278
- - `info`: Payment info (remark, index)
279
-
280
- ⚠️ CRITICAL: Payment is IRREVERSIBLE. Always confirm recipient, amount, and token type before executing.
281
-
282
- #### demand — Service Request
283
-
284
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_demand" })`
285
-
286
- **Key Fields**:
287
- - `object`: WithPermissionObject
288
- - `present`: Present configuration
289
- - `description`: Demand description
290
- - `location`: Location
291
- - `rewards`: Reward objects
292
- - `guards`: Guards configuration
293
- - `feedback`: Feedback entries
294
- - `owner_receive`: Owner fund extraction
295
- - `um`: Contact object ID
296
-
297
- #### order — Order Lifecycle
298
-
299
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_order" })`
300
-
301
- **Key Fields**:
302
- - `object`: Order ID or name
303
- - `agents`: Agent addresses
304
- - `required_info`: Required info field
305
- - `progress`: Progress advancement
306
- - `arb_confirm`: Arbitration confirmation
307
- - `arb_objection`: Arbitration objection
308
- - `arb_claim_compensation`: Claim compensation
309
- - `receive`: Receive funds
310
- - `transfer_to`: Transfer order to new owner
311
-
312
- #### gen_passport — Immutable Credential
313
-
314
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_operations_gen_passport" })`
315
-
316
- **Key Fields**:
317
- - `guard`: Guard ID(s) — single string or array of strings
318
- - `info`: Submission call info
319
-
320
- **Features:**
321
- - **Single Guard**: Pass a single guard ID or name as a string
322
- - **Multiple Guards**: Pass an array of guard IDs or names to verify multiple guards at once
323
- - **Name Resolution**: Supports both guard addresses and LocalMark names
324
-
325
- ### Common Sub-Types
326
-
327
- **TypedPermissionObject**: STRING (existing) or OBJECT `{ name, permission, tags?, onChain?, replaceExistName?, type_parameter? }`
328
-
329
- **WithPermissionObject**: Same as TypedPermissionObject but WITHOUT `type_parameter`
330
-
331
- **SubmissionCall** (for execution):
332
- - `sender`: string
333
- - `gas_budget`: string
334
- - Additional network/execution params
30
+ ```json
31
+ {
32
+ "operation_type": "<one of 16 types>",
33
+ "data": { /* type-specific */ },
34
+ "env": { "account": "", "network": "testnet" },
35
+ "submission": { /* Guard submission if needed */ }
36
+ }
37
+ ```
335
38
 
336
- **CoinParam**: `number` (raw) or `string` (e.g., "2WOW", "100USDT")
39
+ **Exceptions** (no `data` wrapper):
40
+ - `gen_passport`: `{ guard, info?, env? }`
41
+ - `guard`, `payment`, `personal`: flat structure
337
42
 
338
- **NamedObject**: `{ name: string; tags?: string[]; onChain?: boolean; replaceExistName?: boolean }`
43
+ ### CREATE vs MODIFY Pattern
339
44
 
340
- ---
45
+ | Format | Meaning | Example |
46
+ |--------|---------|---------|
47
+ | **String** | Reference EXISTING | `"my-service"` or `"0x1234..."` |
48
+ | **Object** | CREATE NEW | `{ name: "my-service", permission: "..." }` |
341
49
 
342
- ## 2. query_toolkit Data Query
343
-
344
- **MCP Input**: `{ query_type: string, ... }` — discriminated union
345
-
346
- **Schema Reference**: `schema_query({ action: "get", name: "query_toolkit" })`
347
-
348
- ### 8 query_types
349
-
350
- #### local_mark_list
351
- - `query_type`: "local_mark_list"
352
- - `network`: Optional network
353
- - Returns: list of local name→address mappings
354
-
355
- #### account_list
356
- - `query_type`: "account_list"
357
- - Returns: list of local accounts
358
-
359
- #### local_info_list
360
- - `query_type`: "local_info_list"
361
- - `network`: Optional network
362
- - Returns: local private data entries
363
-
364
- #### token_list
365
- - `query_type`: "token_list"
366
- - `network`: Optional network
367
- - Returns: available token types with precision info
368
-
369
- #### account_balance
370
- - `query_type`: "account_balance"
371
- - `address`: Account address
372
- - `token_type`: Optional token type
373
- - `network`: Optional network
374
- - Returns: account token balance
375
-
376
- #### onchain_personal_profile
377
- - `query_type`: "onchain_personal_profile"
378
- - `address`: Account address
379
- - `network`: Optional network
380
- - `no_cache`: Optional flag
381
- - Returns: on-chain public profile
382
-
383
- #### onchain_objects
384
- - `query_type`: "onchain_objects"
385
- - `address`: Optional address
386
- - `name_or_address`: Optional name or address
387
- - `network`: Optional network
388
- - `no_cache`: Optional flag
389
- - Returns: on-chain objects owned by address
390
-
391
- #### onchain_received
392
- - `query_type`: "onchain_received"
393
- - `name_or_address`: Name or address
394
- - `all_type`: Optional boolean
395
- - `cursor`: Optional cursor
396
- - `limit`: Optional limit
397
- - `no_cache`: Optional flag
398
- - `network`: Optional network
399
- - Returns: received CoinWrapper objects
50
+ **Key Rule**: `publish: true` LOCKS immutable fields (machine, order_allocators, guard logic).
400
51
 
401
52
  ---
402
53
 
403
- ## 3. onchain_table_data — Table Sub-Items
404
-
405
- **MCP Input**: `{ query_type: string, parent: string, ... }` — 12 query_types
406
-
407
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_table_data" })`
408
-
409
- | query_type | Parent | Key | Returns |
410
- |------------|--------|-----|---------|
411
- | `onchain_table` | any object | — (paginated cursor) | TableAnswer |
412
- | `onchain_table_item_repository_data` | Repository | name + entity | entry record |
413
- | `onchain_table_item_permission_perm` | Permission | address | perm entry |
414
- | `onchain_table_item_entity_registrar` | Registrar | address | registrar record |
415
- | `onchain_table_item_entity_linker` | Linker | entity + who | linker entry |
416
- | `onchain_table_item_reward_record` | Reward | address | claim record |
417
- | `onchain_table_item_demand_presenter` | Demand | address | presenter info |
418
- | `onchain_table_item_treasury_history` | Treasury | address (payment) | history entry |
419
- | `onchain_table_item_machine_node` | Machine | u64 (index) | node definition |
420
- | `onchain_table_item_progress_history` | Progress | u64 (index) | history entry |
421
- | `onchain_table_item_address_mark` | AddressMark | address | public mark |
422
- | `onchain_table_item_generic` | any object | key_type + key_value | ObjectBase |
54
+ ## The 13 Tools
423
55
 
424
- All support: `no_cache?: boolean`, `network?: "localnet" | "testnet"`
56
+ | Tool | Purpose | Key Pattern |
57
+ |------|---------|-------------|
58
+ | `onchain_operations` | Write state (16 types) | Discriminated by `operation_type` |
59
+ | `query_toolkit` | Read on-chain data | 8 query types |
60
+ | `onchain_table_data` | Query sub-items | Dynamic field access |
61
+ | `account_operation` | Wallet management | 100% local |
62
+ | `local_mark_operation` | Name→address mappings | 100% local |
63
+ | `local_info_operation` | Private data store | 100% local |
64
+ | `messenger_operation` | Encrypted messaging | Hybrid (see messenger skill) |
65
+ | `wip_file` | Witness promise files | Generate/verify/sign |
66
+ | `guard2file` | Export Guard definition | Read-only |
67
+ | `machineNode2file` | Export Machine nodes | Read-only |
68
+ | `onchain_events` | Watch events | Paginated |
69
+ | `wowok_buildin_info` | Protocol constants | Reference data |
70
+ | `documents_and_learn` | Documentation URLs | Learning resources |
425
71
 
426
72
  ---
427
73
 
428
- ## 4. account_operation LOCAL Wallet
74
+ ## Critical Patterns by Operation
429
75
 
430
- **MCP Input**: `{ operation_type: string, data: object }`
76
+ ### service Business Listing
431
77
 
432
- **Schema Reference**: `schema_query({ action: "get", name: "account_operation" })`
78
+ **Immutable After Publish**: `machine`, `order_allocators`
79
+ **Mutable Always**: `sales`, `discount`, `description`, `location`
80
+ **Add-Only After Publish**: `rewards`, `arbitrations`
433
81
 
434
- Operations: `generate`, `suspend`, `resume`, `faucet`, `sign`, `signData`, `query`
82
+ **Common Pitfall**: Forgetting `publish: true` leaves machine/allocators changeable — risky for production.
435
83
 
436
- 100% LOCALnever touches blockchain.
84
+ ### machineWorkflow Template
437
85
 
438
- ---
86
+ **Key Insight**: Machine defines WHO can advance (via `namedOperator`). Empty string = Order-operable; non-empty = requires Permission.
439
87
 
440
- ## 5. local_mark_operation LOCAL Address Book
88
+ **Publish Effect**: Makes nodes immutable. Essential before Service references it.
441
89
 
442
- **MCP Input**: `{ operation_type: string, data: object }`
90
+ ### progress Advancement
443
91
 
444
- **Schema Reference**: `schema_query({ action: "get", name: "local_mark_operation" })`
92
+ **Dual Paths**:
93
+ - `node`: Single step
94
+ - `nodes`: Multi-step array
445
95
 
446
- Operations:
447
- - `add`: Add marks with `{ marks: { name, address, tags? }[], network? }`
448
- - `remove`: Remove marks with `{ marks: { name }[], network? }`
449
- - `clear`: Clear all with `{ network? }`
96
+ **Guard Integration**: Forward transitions may require Guard validation — see [wowok-machine](../wowok-machine/SKILL.md).
450
97
 
451
- ---
98
+ ### guard — Immutable Validation
452
99
 
453
- ## 6. local_info_operation LOCAL Private Data
100
+ **CRITICAL**: Guards are CREATE-ONLY. No modification after deployment.
454
101
 
455
- **MCP Input**: `{ operation_type: string, data: object }`
102
+ **Update Strategy**: `guard2file` modify locally create new Guard → update all references.
456
103
 
457
- **Schema Reference**: `schema_query({ action: "get", name: "local_info_operation" })`
104
+ See [wowok-guard](../wowok-guard/SKILL.md) for complete GuardNode reference and design patterns.
458
105
 
459
- Store sensitive info (phone, address, contacts) locally.
106
+ ### order Customer Operations
460
107
 
461
- ---
108
+ **Key Distinction**: Order is builder-owned; agents can operate but **CANNOT withdraw**.
462
109
 
463
- ## 7. messenger_operation Encrypted Messaging
110
+ **Arbitration Flow**: `arb_confirm` `arb_objection` → `arb_claim_compensation` (all via Order)
464
111
 
465
- **MCP Input**: varies by operation
112
+ See [wowok-order](../wowok-order/SKILL.md) for customer-side arbitration operations.
466
113
 
467
- **Schema Reference**: `schema_query({ action: "get", name: "messenger_operation" })`
114
+ ### gen_passport Credential Generation
468
115
 
469
- Operations: `watch_conversations`, `send_message`, `send_file`, `watch_messages`, `extract_zip_messages`, `generate_wts`, `verify_wts`, `sign_wts`, `wts2html`, `proof_message`, `mark_messages_as_viewed`, `mark_conversation_as_viewed`, `blacklist`, `friendslist`, `guardlist`, `settings`
116
+ **Single or Multiple**: One Guard (string) or multiple Guards (array)
470
117
 
471
- See [wowok-messenger](../wowok-messenger/SKILL.md) skill for detailed usage.
118
+ **Use Case**: Off-chain permission verification, voting eligibility, access control.
472
119
 
473
120
  ---
474
121
 
475
- ## 8-13 Quick Reference
122
+ ## Common Pitfalls
476
123
 
477
- ### wip_file
124
+ ### 1. Wrong Discriminated Union Branch
478
125
 
479
- **Schema Reference**: `schema_query({ action: "get", name: "wip_file" })`
126
+ **Symptom**: "Invalid data structure" errors
127
+ **Cause**: Using `service` schema for `order` operation
128
+ **Fix**: Match `operation_type` exactly to schema
480
129
 
481
- Operations: `generate`, `verify`, `sign`, `wip2html`
130
+ ### 2. CREATE vs MODIFY Confusion
482
131
 
483
- ### guard2file
132
+ **Symptom**: Creates duplicate objects instead of modifying
133
+ **Cause**: Passing object shape when string reference intended
134
+ **Fix**: String = existing, Object = new
484
135
 
485
- **Schema Reference**: `schema_query({ action: "get", name: "guard2file" })`
136
+ ### 3. Missing submission Field
486
137
 
487
- - `guard`: Guard ID or name
488
- - `file_path`: Output file path
489
- - `format`: "json" or "markdown"
138
+ **Symptom**: Guard validation fails with "missing submission"
139
+ **Cause**: Guard requires user data but `submission` omitted
140
+ **Fix**: Add `submission: { sender, info }` after first call fails
490
141
 
491
- ### machineNode2file
142
+ ### 4. Immutable Field After Publish
492
143
 
493
- **Schema Reference**: `schema_query({ action: "get", name: "machineNode2file" })`
144
+ **Symptom**: "Cannot modify published field" error
145
+ **Cause**: Attempting to change `machine` or `order_allocators` after `publish: true`
146
+ **Fix**: Create new Service with corrected fields
494
147
 
495
- - `machine`: Machine ID or name
496
- - `file_path`: Output file path
497
- - `format`: "json" or "markdown"
148
+ ### 5. Wrong Tool Selection
498
149
 
499
- ### onchain_events
150
+ | Task | Wrong Tool | Correct Tool |
151
+ |------|-----------|--------------|
152
+ | Query object state | `onchain_operations` | `query_toolkit` |
153
+ | Send message | `onchain_operations` | `messenger_operation` |
154
+ | Check name availability | `query_toolkit` | `local_mark_operation` |
155
+ | Export Guard logic | `query_toolkit` | `guard2file` |
500
156
 
501
- **Schema Reference**: `schema_query({ action: "get", name: "onchain_events" })`
502
-
503
- - `type`: Event type
504
- - `cursor`: Optional cursor
505
- - `limit`: Optional limit
157
+ ---
506
158
 
507
- ### wowok_buildin_info
159
+ ## Troubleshooting Guide
508
160
 
509
- **Schema Reference**: `schema_query({ action: "get", name: "wowok_buildin_info" })`
161
+ ### "Schema not found"
510
162
 
511
- - `info_type`: "constants", "permissions", "guard_instructions", "network", "value_types"
163
+ **Action**: `schema_query({ action: "get", name: "<tool_name>" })`
512
164
 
513
- ### documents_and_learn
165
+ ### "Invalid parameter format"
514
166
 
515
- **Schema Reference**: `schema_query({ action: "get", name: "documents_and_learn" })`
167
+ **Checklist**:
168
+ 1. Correct `operation_type`?
169
+ 2. CREATE vs MODIFY format correct?
170
+ 3. Required fields present?
171
+ 4. `submission` needed for Guard?
516
172
 
517
- - `document_type`: Optional document type
173
+ ### "Permission denied"
518
174
 
519
- ---
175
+ **Causes**:
176
+ - Not object owner
177
+ - Missing Permission reference
178
+ - Guard validation failed
520
179
 
521
- ## Tool Selection Decision Tree
180
+ ### Tool-Specific Errors
522
181
 
523
- ```
524
- User wants to...
525
- ├─ CREATE/MODIFY on-chain object onchain_operations
526
- │ ├─ operation_type = service | machine | permission | guard | ...
527
- │ └─ data = { op: "create"|"update"|..., ... }
528
-
529
- ├─ QUERY data
530
- │ ├─ Local accounts/marks/info/tokens → query_toolkit
531
- │ ├─ On-chain objects/profile → query_toolkit (onchain_objects / onchain_personal_profile)
532
- │ ├─ Account balance → query_toolkit (account_balance)
533
- │ ├─ Table sub-items → onchain_table_data
534
- │ ├─ Received payments → query_toolkit (onchain_received)
535
- │ └─ On-chain events → onchain_events
536
-
537
- ├─ MANAGE local data
538
- │ ├─ Accounts → account_operation
539
- │ ├─ Address book → local_mark_operation
540
- │ └─ Private info → local_info_operation
541
-
542
- ├─ COMMUNICATE → messenger_operation
543
- ├─ PROMISES (WIP) → wip_file
544
- ├─ EXPORT definitions → guard2file / machineNode2file
545
- ├─ LEARN protocol → wowok_buildin_info
546
- └─ DOCUMENTATION → documents_and_learn
547
- ```
182
+ | Error | Likely Cause | Solution |
183
+ |-------|-------------|----------|
184
+ | "Object not found" | Wrong address or not created | Verify with `query_toolkit` |
185
+ | "Name already exists" | `replaceExistName: false` | Set `replaceExistName: true` or choose new name |
186
+ | "Guard validation failed" | Missing/incorrect `submission` | Add proper `submission` field |
187
+ | "Insufficient balance" | Account lacks funds | Check with `account_operation` |
188
+ | "Deadline passed" | Timestamp in past | Use future timestamp |
548
189
 
549
190
  ---
550
191
 
551
- ## Mandatory Patterns
552
-
553
- ### Query-First Pattern (ALWAYS before writes)
554
-
555
- ```
556
- 1. query_toolkit (account_list) → Which accounts exist?
557
- 2. query_toolkit (local_mark_list) → What named addresses exist?
558
- 3. query_toolkit (onchain_objects) → What's already on-chain?
559
- 4. wowok_buildin_info → Protocol constants/permissions
560
- ```
561
-
562
- ### Dry-Run Pattern (ALWAYS for writes)
192
+ ## Schema Access
563
193
 
564
- ```
565
- 1. Call onchain_operations WITHOUT submission → Validate + Preview
566
- 2. Show preview to user → Get explicit confirmation
567
- 3. Call onchain_operations WITH submission → Execute
194
+ ```javascript
195
+ // Get any tool schema
196
+ schema_query({ action: "get", name: "onchain_operations" })
197
+ schema_query({ action: "get", name: "query_toolkit" })
198
+ schema_query({ action: "get", name: "messenger_operation" })
199
+ // ... etc for all 13 tools
568
200
  ```
569
201
 
570
202
  ---
571
203
 
572
- ## Common Errors
204
+ ## Design Principles
573
205
 
574
- | Error | Cause | Fix |
575
- |-------|-------|-----|
576
- | "object not found" | Cache stale | Add `no_cache: true` |
577
- | "permission denied" | Wrong sender | Verify sender has permission |
578
- | "unknown query_type" | Wrong tool | Check if table query use `onchain_table_data` |
579
- | "table field required" | Missing Guard table | Guards MUST have `table` array |
580
- | "dependency not found" | Build order | Build dependencies before dependents |
581
- | "invalid parameter" | Wrong format | Check discriminated union branch |
582
- | submission parameter errors | Didn't check schema | Verify all submission fields |
206
+ 1. **Immutability First**: Guards, published Machines — design carefully, no updates
207
+ 2. **Explicit Over Implicit**: Always specify `operation_type`, never rely on defaults
208
+ 3. **Validate Before Execute**: Use `query_toolkit` to check state before operations
209
+ 4. **Local for Private**: Sensitive data `local_info_operation`, never on-chain
210
+ 5. **Schema as Source**: When in doubt, query schema don't guess parameter formats
583
211
 
584
212
  ---
585
213
 
586
- ## Schema Query Tool — Authoritative Schema Source
587
-
588
- Use the `schema_query` MCP tool to retrieve complete JSON schemas for any WoWok tool or operation. This is the **authoritative source** — returns schemas directly from the MCP server with all properties, types, and descriptions.
589
-
590
- ### Usage Examples
591
-
592
- **List all available schemas:**
593
- ```
594
- schema_query({ action: "list" })
595
- ```
596
-
597
- **Get a specific tool schema:**
598
- ```
599
- schema_query({ action: "get", name: "onchain_operations" })
600
- schema_query({ action: "get", name: "onchain_operations_service" })
601
- schema_query({ action: "get", name: "query_toolkit" })
602
- ```
603
-
604
- **Search schemas by keyword:**
605
- ```
606
- schema_query({ action: "search", query: "guard" })
607
- ```
214
+ ## Quick Decision Tree
608
215
 
609
- **List all on-chain operation types:**
610
216
  ```
611
- schema_query({ action: "list_operations" })
217
+ Need to change on-chain state?
218
+ ├── YES → onchain_operations
219
+ │ └── Which type? (service, machine, order, guard, etc.)
220
+ ├── NO, just query → query_toolkit
221
+ │ └── Object state or table data?
222
+ ├── NO, communicate → messenger_operation
223
+ ├── NO, manage wallet → account_operation
224
+ └── NO, export definition → guard2file / machineNode2file
612
225
  ```
613
-
614
- ### Available Schema Names
615
-
616
- **Main Tools:** `onchain_operations`, `query_toolkit`, `onchain_table_data`, `onchain_events`, `account_operation`, `local_mark_operation`, `local_info_operation`, `messenger_operation`, `wip_file`, `guard2file`, `machineNode2file`, `wowok_buildin_info`, `schema_query`
617
-
618
- **Individual Operations:** `onchain_operations_service`, `onchain_operations_machine`, `onchain_operations_order`, `onchain_operations_progress`, `onchain_operations_guard`, `onchain_operations_permission`, `onchain_operations_arbitration`, `onchain_operations_repository`, `onchain_operations_contact`, `onchain_operations_treasury`, `onchain_operations_reward`, `onchain_operations_allocation`, `onchain_operations_personal`, `onchain_operations_payment`, `onchain_operations_demand`, `onchain_operations_gen_passport`
619
-
620
- **When to use**: Always call `schema_query` before using complex tools like `onchain_operations` — the discriminated unions have 16 branches with 5-6 levels of nesting, and one wrong field name causes immediate failure. Use `action: "get"` with the specific operation name (e.g., `onchain_operations_service`) when you need the complete structure for a single operation type.