@wowok/skills 1.1.3 → 1.1.5

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.
@@ -19,7 +19,30 @@ always: true
19
19
 
20
20
  ## 1. Core Principles
21
21
 
22
- ### 1.1 Security & Safety
22
+ ### 1.1 Object Reuse Principle (General Best Practice)
23
+
24
+ **ALWAYS prefer reusing existing objects over creating new ones** — this enables centralized permission control and reduces management overhead.
25
+
26
+ | Object Type | Reuse Strategy | Why |
27
+ |-------------|----------------|-----|
28
+ | **Permission** | **Strongly recommended** — ask user for existing Permission name/ID | Centralized permission control across all services |
29
+ | Machine | Reuse if workflow fits | Save design time for similar processes |
30
+ | Guards | Reuse if validation logic matches | Avoid redundant rules |
31
+ | Contact | Reuse existing customer service Contact | Single point of management |
32
+ | Arbitration | Always reuse existing Arbitration services | Customers choose from established arbiters |
33
+
34
+ **How to Reuse**:
35
+ - Ask user: *"Do you have an existing object you'd like to reuse? Provide the name or ID."*
36
+ - Use string value `"<name_or_id>"` to reference existing objects
37
+ - Use object shape `{ name?, ... }` only when creating new
38
+
39
+ **CREATE vs MODIFY Pattern**:
40
+ | Format | Meaning | Use When |
41
+ |--------|---------|----------|
42
+ | String `"<name>"` or `"<0x...>"` | **REUSE** existing | Object already exists |
43
+ | Object `{ name?, ... }` | **CREATE** new | Need new object |
44
+
45
+ ### 1.2 Security & Safety
23
46
 
24
47
  - **Hot Wallet Usage**: WoWok never exposes private keys. Treat it as a spending account for transfers, receipts, and commerce. Flag large transactions for explicit user confirmation.
25
48
  - **Amount-Sensitive Operations**: Any token transfer, payment, or reward distribution MUST be verbally confirmed with the user before execution. Use `Payment` objects for commercial transfers when possible (they offer Guard validation and purpose tracking).
@@ -136,20 +159,6 @@ Controls name collision behavior:
136
159
  - Default to `false` in production to prevent accidental name hijacking
137
160
  - Prefer versioned names (`_v1`, `_v2`) over `replaceExistName` for production
138
161
 
139
- ### 4.2 Address Display Rules
140
-
141
- When displaying an address (0x prefix + 64 hex characters) to the user:
142
-
143
- 1. **Query local mark first**:
144
-
145
- **Tool**: `query_toolkit` with `query_type: "local_mark_list"` and filter by address.
146
-
147
- 2. **Display format**:
148
- - If local mark exists: `{name} ({short_address})`
149
- - If no local mark: `{first8}...{last3}` (e.g., `0x3a2f8e1...8c1`)
150
-
151
- 3. **Short address format**: Include `0x` prefix, take first 8 chars + `...` + last 3 chars
152
-
153
162
  ---
154
163
 
155
164
  ## 5. Network & Token Defaults
@@ -185,47 +194,7 @@ Use `Payment` objects for commercial transfers when possible — they offer Guar
185
194
 
186
195
  ---
187
196
 
188
- ## 7. Name Resolution & Display
189
-
190
- ### 7.1 Name Resolution Priority
191
-
192
- | Priority | Source | Display Format | Example |
193
- |----------|--------|----------------|---------|
194
- | 1 (Highest) | `local_mark_operation` | `{local_mark_name} (localmark)` | `my_service (localmark)` |
195
- | 2 | `account_operation` (account name) | `{account_name}` | `alice_wallet` |
196
- | 3 (Fallback) | None / Unnamed | `{first6}...{last3}` | `0x3a2f...8c1` |
197
-
198
- ### 7.2 Address Resolution & Display Format
199
-
200
- **Resolve addresses to names** via `query_toolkit`:
201
-
202
- **Tool**: `query_toolkit` with `query_type: "local_names"` and `addresses` array parameter.
203
-
204
- - Each address must be a valid WOW ID: `0x` prefix + **64 hex characters**.
205
- - Returns resolved account name and/or local mark name for each address.
206
- - Name priority follows [7.1](#71-name-resolution-priority): `local_mark` > `account`.
207
-
208
- **Address truncation** (for display):
209
-
210
- ```
211
- {first_6_chars}...{last_3_chars}
212
- ```
213
-
214
- - Include the `0x` prefix in the character count.
215
- - Use exactly **three dots** (`...`) as the separator.
216
- - Example: `0x3a2f...8c1`
217
-
218
- **Combined display**: human-readable name + truncated address in parentheses.
219
-
220
- | Name Source | Display Format | Example |
221
- |-------------|----------------|---------|
222
- | local_mark | `{local_mark} ({first6}...{last3})` | `my_service (0x3a2f...8c1)` |
223
- | account | `{account_name} ({first6}...{last3})` | `alice_wallet (0x3a2f...8c1)` |
224
- | none (fallback) | `{first6}...{last3}` | `0x3a2f...8c1` |
225
-
226
- ---
227
-
228
- ## 8. Error Patterns
197
+ ## 7. Error Patterns
229
198
 
230
199
  | Error | Likely Cause |
231
200
  |-------|-------------|
@@ -236,7 +205,7 @@ Use `Payment` objects for commercial transfers when possible — they offer Guar
236
205
 
237
206
  ---
238
207
 
239
- ## 9. Testing & Validation Workflow
208
+ ## 8. Testing & Validation Workflow
240
209
 
241
210
  1. **Design Phase**: Use `wowok_buildin_info` to discover available permissions, Guard instructions, and value types
242
211
 
@@ -267,7 +236,7 @@ WoWok's value type system is the foundation for type-safe data declarations used
267
236
 
268
237
  ---
269
238
 
270
- ## 10. Incremental Object Building
239
+ ## 9. Incremental Object Building
271
240
 
272
241
  For complex objects with many fields (Service, Machine), use **incremental building** instead of creating everything in one call:
273
242
 
@@ -42,13 +42,13 @@ Quick reference for WoWok MCP tools — patterns, pitfalls, and troubleshooting.
42
42
 
43
43
  ### CREATE vs MODIFY Pattern
44
44
 
45
+ See [wowok-safety](../wowok-safety/SKILL.md) for complete object reuse principles.
46
+
45
47
  | Format | Meaning | Example |
46
48
  |--------|---------|---------|
47
- | **String** | Reference EXISTING | `"my-service"` or `"0x1234..."` |
49
+ | **String** | Reference EXISTING (reuse) | `"my-service"` or `"0x1234..."` |
48
50
  | **Object** | CREATE NEW | `{ name: "my-service", permission: "..." }` |
49
51
 
50
- **Key Rule**: `publish: true` LOCKS immutable fields (machine, order_allocators, guard logic).
51
-
52
52
  ---
53
53
 
54
54
  ## The 13 Tools