@questionbase/deskfree 0.3.0-alpha.19 → 0.3.0-alpha.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@questionbase/deskfree",
3
- "version": "0.3.0-alpha.19",
3
+ "version": "0.3.0-alpha.20",
4
4
  "description": "OpenClaw channel plugin for DeskFree — turns DeskFree into a messaging platform for OpenClaw AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -5,11 +5,11 @@ description: >
5
5
  Use when: creating tasks, managing work items, updating deliverables,
6
6
  communicating with humans through DeskFree, checking workspace state,
7
7
  handling task lifecycle (start → work → complete → review),
8
- classifying tasks against activities, recording learnings.
8
+ evaluating completed tasks, updating ways of working.
9
9
  Do NOT use for: general project management advice without DeskFree tools,
10
10
  OpenClaw configuration or gateway setup, non-DeskFree platforms (Jira, Asana, etc.),
11
11
  direct file/code operations (use standard tools for those, create DeskFree tasks for tracking).
12
- version: 5.0.0
12
+ version: 6.0.0
13
13
  metadata: { 'openclaw': { 'emoji': '🏠' } }
14
14
  ---
15
15
 
@@ -20,23 +20,24 @@ metadata: { 'openclaw': { 'emoji': '🏠' } }
20
20
  ### State Machine (memorize this)
21
21
 
22
22
  ```
23
- create_task → ready_for_bot → [start_task] → working_on_it → [complete_task] → waiting_for_human
23
+ create_task → bot → [start_task] → bot (is_working) → [complete_task] → human
24
24
  ↑ |
25
25
  | human approves/declines |
26
26
  └────────────────────────────────────────────────────────────────┘
27
27
  |
28
- [approve] → done
28
+ [approve] → done → [evaluate] → ways_of_working updated
29
29
  ```
30
30
 
31
31
  - `complete_task` outcome `done` = work complete for review
32
32
  - `complete_task` outcome `blocked` = need human input (send message FIRST explaining why)
33
- - Both outcomes move to `waiting_for_human` — the human triages from there
33
+ - Both outcomes move to `human` — the human triages from there
34
+ - When human approves (`done`), a pending evaluation is created for ways-of-working update
34
35
 
35
36
  ### Three Rules That Break Everything If Ignored
36
37
 
37
38
  1. **Always self-task.** Create a DeskFree task before starting ANY work. Tasks are cheap — invisible work is expensive. No exceptions.
38
39
  2. **Always check state first.** Call `deskfree_state` before creating tasks. Prevents duplicates, shows what needs attention.
39
- 3. **Always complete tasks.** Never leave a task in `working_on_it`. End with `deskfree_complete_task` — outcome `done` or `blocked`.
40
+ 3. **Always complete tasks.** Never leave a task in `bot` (is_working=true). End with `deskfree_complete_task` — outcome `done` or `blocked`.
40
41
 
41
42
  ### Auto-Threading
42
43
 
@@ -46,40 +47,29 @@ The task sidebar is your human's window into your work — every message appears
46
47
 
47
48
  ---
48
49
 
49
- ## Activities — The Memory System
50
+ ## Ways of Working — The Evolving Playbook
50
51
 
51
- Activities are **knowledge containers**, not planning artifacts. They accumulate learnings from completed tasks, building institutional memory over time. Think of them as "how we do X" documents that grow smarter with each task.
52
+ Ways of Working is a **single versioned markdown document** per bot that evolves as you complete tasks. It's your institutional memory capturing patterns, preferences, and learnings across all work.
52
53
 
53
- **Key mindset shift:** Goals were about planning. Activities are about **memory**. You don't plan work around activities — you classify tasks into activities to retrieve relevant knowledge, then record what you learned back.
54
+ **Key properties:**
55
+ - Injected automatically via `deskfree_state` (the `waysOfWorking` field)
56
+ - Read it before starting work to understand established patterns
57
+ - Updated after task approval via the evaluation flow (never manually during work)
58
+ - Each update creates a new immutable version — full history preserved
54
59
 
55
- ### The 3-Phase Activity Loop
60
+ ### Evaluation Flow
61
+
62
+ When a human approves a task, it enters `pendingEvaluations` in state.get:
56
63
 
57
64
  ```
58
- ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
59
- │ 1. CLASSIFY │────>│ 2. EXECUTE │────>│ 3. LEARN │
60
- │ │ │ │ │ │
61
- │ Find matching│ │ Use activity │ │ Record what │
62
- │ activities │ │ instructions │ │ was learned │
63
- │ for the task │ │ to inform │ │ back to the │
64
- │ │ │ your work │ │ activity │
65
- └─────────────┘ └─────────────┘ └─────────────┘
66
- ↑ │
67
- └───────────────────────────────────────┘
68
- Activities get smarter over time
65
+ 1. deskfree_claim_evaluation → claim the eval, get task + messages + current ways of working
66
+ 2. Read the task history → understand what was done and how
67
+ 3. deskfree_submit_evaluation → provide reasoning + updated content (or no changes)
69
68
  ```
70
69
 
71
- 1. **Classify** Before starting a task, call `deskfree_classify_task` with the task title/instructions. It returns matching activities with their accumulated knowledge.
72
- 2. **Execute** — Read the activity instructions. They contain learnings from previous similar tasks. Use them to inform your approach.
73
- 3. **Learn** — After completing the task, call `deskfree_learn_from_task` to link the task and append what you discovered. Future tasks benefit automatically.
74
-
75
- ### When to Create Activities
76
-
77
- Activities emerge from work — don't pre-create them. Create one when:
78
- - You finish a task and `deskfree_classify_task` returns no matches (`suggestNew: true`)
79
- - You notice a recurring type of work with no activity yet
80
- - The human explicitly asks for one
70
+ **When to update:** New patterns emerged, a better approach was found, recurring mistakes identified, human gave feedback that reveals process improvements.
81
71
 
82
- **Don't create activities for:** one-off tasks, trivial work, or as planning/organizational tools.
72
+ **When NOT to update:** One-off tasks with no transferable learnings, standard work that matched existing patterns.
83
73
 
84
74
  ---
85
75
 
@@ -88,10 +78,10 @@ Activities emerge from work — don't pre-create them. Create one when:
88
78
  ### Pre-Flight (before ANY work)
89
79
 
90
80
  - [ ] Called `deskfree_state` — confirmed it returned data (not empty/error)
81
+ - [ ] Read `waysOfWorking` if present — apply established patterns
91
82
  - [ ] Checked for existing tasks that match intent — no duplicates
92
83
  - [ ] Created a task with clear, action-oriented title (max 200 chars)
93
- - [ ] Called `deskfree_start_task` — confirmed task moved to `working_on_it`
94
- - [ ] Called `deskfree_classify_task` — checked for relevant activity instructions
84
+ - [ ] Called `deskfree_start_task` — confirmed task moved to `bot` (is_working=true)
95
85
 
96
86
  ### Mid-Work
97
87
 
@@ -103,10 +93,13 @@ Activities emerge from work — don't pre-create them. Create one when:
103
93
 
104
94
  - [ ] Deliverable is non-empty and meaningful (not just headers/placeholders)
105
95
  - [ ] Deliverable is well-structured markdown that stands alone
106
- - [ ] Called `deskfree_complete_task` — confirmed task moved to `waiting_for_human`
107
- - [ ] Called `deskfree_learn_from_task` if there are useful learnings to record
96
+ - [ ] Called `deskfree_complete_task` — confirmed task moved to `human`
108
97
  - [ ] If sub-agent: terminated after completion (one task per sub-agent)
109
98
 
99
+ ### Heartbeat Evaluation Check
100
+
101
+ - [ ] Any `pendingEvaluations` in state? → claim and evaluate each one
102
+
110
103
  ---
111
104
 
112
105
  ## Task Workflow
@@ -114,23 +107,21 @@ Activities emerge from work — don't pre-create them. Create one when:
114
107
  ### Orchestrator Flow (main session)
115
108
 
116
109
  ```
117
- 1. deskfree_state → assess workspace
110
+ 1. deskfree_state → assess workspace + read ways of working
118
111
  2. deskfree_create_task → create with clear title + instructions
119
- 3. deskfree_classify_task find relevant activities for context
120
- 4. deskfree_start_task claim it (returns full context)
121
- 5. deskfree_update_deliverable build incrementally as you work
122
- 6. deskfree_complete_task → outcome "done" or "blocked"
123
- 7. deskfree_learn_from_task → record learnings to matching activity
112
+ 3. deskfree_start_task claim it (returns full context)
113
+ 4. deskfree_update_deliverable build incrementally as you work
114
+ 5. deskfree_complete_task outcome "done" or "blocked"
124
115
  ```
125
116
 
126
117
  ### Sub-Agent Flow (recommended for tasks > 5 min)
127
118
 
128
119
  ```
129
- Orchestrator: deskfree_create_task → deskfree_classify_task → deskfree_start_task → spawn sub-agent with full task context + activity instructions
130
- Sub-agent: deskfree_update_deliverable (incrementally) → deskfree_complete_task → deskfree_learn_from_task → terminate
120
+ Orchestrator: deskfree_create_task → deskfree_start_task → spawn sub-agent with full task context
121
+ Sub-agent: deskfree_update_deliverable (incrementally) → deskfree_complete_task → terminate
131
122
  ```
132
123
 
133
- Sub-agents have **5 tools:** `deskfree_update_deliverable`, `deskfree_complete_task`, `deskfree_send_message`, `deskfree_suggest_tasks`, `deskfree_learn_from_task`. They cannot create activities, classify tasks, create tasks, or read workspace state.
124
+ Sub-agents have **4 tools:** `deskfree_update_deliverable`, `deskfree_complete_task`, `deskfree_send_message` (also supports task suggestions), `deskfree_submit_evaluation`. They cannot create tasks, read workspace state, or claim evaluations.
134
125
 
135
126
  ### When to Use Main vs Sub-Agent
136
127
 
@@ -160,19 +151,18 @@ Sub-agents have **5 tools:** `deskfree_update_deliverable`, `deskfree_complete_t
160
151
 
161
152
  ### Heartbeat / Proactive Check
162
153
 
163
- 1. `deskfree_state` → get workspace snapshot
164
- 2. `ready_for_bot` tasks? → `deskfree_classify_task` for context → `deskfree_start_task` + spawn sub-agents
165
- 3. `working_on_it` with no active sub-agent? → Complete as blocked or resume
154
+ 1. `deskfree_state` → get workspace snapshot + check `waysOfWorking` + `pendingEvaluations`
155
+ 2. `pendingEvaluations`? → `deskfree_claim_evaluation` → `deskfree_submit_evaluation`
156
+ 3. `bot` tasks? → `deskfree_start_task` + spawn sub-agents
157
+ 4. `bot` (is_working=true) with no active sub-agent? → Complete as blocked or resume
166
158
 
167
159
  ### Human Gives You Work
168
160
 
169
- 1. `deskfree_state` → check existing tasks
161
+ 1. `deskfree_state` → check existing tasks + read ways of working
170
162
  2. `deskfree_create_task` → clear title + instructions
171
- 3. `deskfree_classify_task` → find relevant activity knowledge
172
- 4. `deskfree_start_task`claim it
173
- 5. Work → `deskfree_update_deliverable` incrementally
174
- 6. `deskfree_complete_task` → outcome `done` or `blocked`
175
- 7. `deskfree_learn_from_task` → record learnings
163
+ 3. `deskfree_start_task` → claim it
164
+ 4. Work`deskfree_update_deliverable` incrementally
165
+ 5. `deskfree_complete_task`outcome `done` or `blocked`
176
166
 
177
167
  ---
178
168
 
@@ -180,31 +170,41 @@ Sub-agents have **5 tools:** `deskfree_update_deliverable`, `deskfree_complete_t
180
170
 
181
171
  > **Full parameter details:** See `references/tools.md`
182
172
 
183
- ### Orchestrator (10 tools)
173
+ ### Orchestrator (8 tools)
184
174
 
185
175
  | Tool | What it does |
186
176
  |---|---|
187
- | `deskfree_state` | Full workspace snapshot — tasks and recently done |
188
- | `deskfree_create_activity` | Create a knowledge container for a type of work |
189
- | `deskfree_update_activity` | Update activity name, description, or instructions |
190
- | `deskfree_classify_task` | Find activities relevant to a task |
191
- | `deskfree_learn_from_task` | Link task to activity and record learnings |
192
- | `deskfree_create_task` | Create task (→ `ready_for_bot`) |
193
- | `deskfree_start_task` | Claim task → `working_on_it`, returns full context |
177
+ | `deskfree_state` | Full workspace snapshot — tasks, recently done, ways of working, pending evaluations |
178
+ | `deskfree_create_task` | Create task (→ `bot`) |
179
+ | `deskfree_start_task` | Claim task `bot` (is_working=true), returns full context |
194
180
  | `deskfree_update_deliverable` | Build deliverable markdown incrementally |
195
- | `deskfree_complete_task` | Mark done or blocked → `waiting_for_human` |
196
- | `deskfree_send_message` | Message in task thread |
197
- | `deskfree_suggest_tasks` | Suggest tasks for human review |
181
+ | `deskfree_complete_task` | Mark done or blocked → `human` |
182
+ | `deskfree_send_message` | Message in task thread (also supports task suggestions) |
183
+ | `deskfree_claim_evaluation` | Claim a pending ways-of-working evaluation |
184
+ | `deskfree_submit_evaluation` | Submit evaluation result with reasoning and optional updated content |
198
185
 
199
- ### Worker (5 tools — sub-agents only)
186
+ ### Worker (4 tools — sub-agents only)
200
187
 
201
- `deskfree_update_deliverable`, `deskfree_complete_task`, `deskfree_send_message`, `deskfree_suggest_tasks`, `deskfree_learn_from_task`
188
+ `deskfree_update_deliverable`, `deskfree_complete_task`, `deskfree_send_message`, `deskfree_submit_evaluation`
202
189
 
203
190
  ---
204
191
 
205
192
  ## Deliverable Best Practices
206
193
 
207
- Structure deliverables as **standalone markdown documents:**
194
+ ### Choosing a format
195
+
196
+ `deskfree_update_deliverable` accepts an optional `format` parameter:
197
+
198
+ | Format | Use when |
199
+ |---|---|
200
+ | `markdown` (default) | Text reports, analysis, documentation, code — anything prose-based |
201
+ | `html` | Rich web content: dashboards, styled reports, interactive tables, data visualizations |
202
+
203
+ HTML deliverables are rendered in a **sandboxed iframe** (no access to parent page). Use `format="html"` when layout and styling matter for the human's review. Use `format="markdown"` for everything else.
204
+
205
+ ### Markdown deliverables
206
+
207
+ Structure as **standalone markdown documents:**
208
208
 
209
209
  ```markdown
210
210
  # Task Title
@@ -222,6 +222,18 @@ Detailed analysis, implementation notes, etc.
222
222
  - Follow-up actions, outstanding questions
223
223
  ```
224
224
 
225
+ ### HTML deliverables
226
+
227
+ Pass a complete, self-contained HTML document (or fragment — a wrapper `<html>` is injected automatically):
228
+
229
+ ```html
230
+ <h1>Report Title</h1>
231
+ <table>
232
+ <tr><th>Metric</th><th>Value</th></tr>
233
+ <tr><td>Users</td><td>1,234</td></tr>
234
+ </table>
235
+ ```
236
+
225
237
  **Build incrementally** — start with outline immediately after `deskfree_start_task`, fill sections as you go, polish before completing. A half-complete deliverable is infinitely better than none.
226
238
 
227
239
  ---
@@ -231,13 +243,13 @@ Detailed analysis, implementation notes, etc.
231
243
  | Error | Cause | Action |
232
244
  |---|---|---|
233
245
  | `deskfree_state` returns empty | No tasks exist | Create a task if appropriate. **Do NOT retry in a loop.** |
234
- | 404 on `deskfree_start_task` | Task not `ready_for_bot` or doesn't exist | Another bot claimed it. Call `deskfree_state`, try a different task. |
235
- | 404 on `deskfree_complete_task` | Task not `working_on_it` | Already completed or released. Check state. |
246
+ | 404 on `deskfree_start_task` | Task not `bot` or doesn't exist | Another bot claimed it. Call `deskfree_state`, try a different task. |
247
+ | 404 on `deskfree_complete_task` | Task not `bot` (is_working=true) | Already completed or released. Check state. |
236
248
  | 409 on `deskfree_start_task` | Race condition — another bot claimed it | Call `deskfree_state`, pick a different task. |
237
249
  | 401 Unauthorized | Bot token invalid or expired | Check channel configuration. Do not retry. |
238
- | `deskfree_update_deliverable` fails | Task not in `working_on_it` or network error | Verify task state with `deskfree_state`. If task was released, re-claim or abort. |
239
- | `deskfree_classify_task` returns no matches | No activities yet or none relevant | Continue without activity context. Consider creating one after task completion. |
240
- | Sub-agent spawn fails | Resource limits, config error | Complete task as `blocked` with explanation. Do not leave in `working_on_it`. |
250
+ | `deskfree_update_deliverable` fails | Task not in `bot` (is_working=true) or network error | Verify task state with `deskfree_state`. If task was released, re-claim or abort. |
251
+ | `deskfree_claim_evaluation` returns null | Already claimed by another process | No action needed. Move to next pending evaluation. |
252
+ | Sub-agent spawn fails | Resource limits, config error | Complete task as `blocked` with explanation. Do not leave in `bot` (is_working=true). |
241
253
  | WebSocket disconnected | Network issue | Plugin auto-reconnects with backoff. Messages fall back to HTTP polling. No action needed. |
242
254
 
243
255
  ### Recovery Pattern
@@ -246,24 +258,173 @@ If anything goes wrong mid-task:
246
258
  1. Send a message explaining what happened (`deskfree_send_message`)
247
259
  2. Save whatever partial deliverable you have (`deskfree_update_deliverable`)
248
260
  3. Complete as `blocked` (`deskfree_complete_task` with outcome `blocked`)
249
- 4. **Never leave a task stranded in `working_on_it`**
261
+ 4. **Never leave a task stranded in `bot` (is_working=true)**
262
+
263
+ ### Edge Cases & Advanced Scenarios
264
+
265
+ | Scenario | Guidance |
266
+ |---|---|
267
+ | **Concurrent task access** | If multiple bots try to claim the same task, one will get 409 Conflict. The winner proceeds, losers should call `deskfree_state` and pick different tasks. |
268
+ | **Long-running operations** | For tasks >10 minutes, send periodic progress updates via `deskfree_send_message` so humans know you're still working. Update deliverable incrementally. |
269
+ | **Partial deliverable recovery** | If interrupted mid-work, `deskfree_start_task` returns the current deliverable content. Resume from where you left off, don't start over. |
270
+ | **Network timeouts during updates** | If `deskfree_update_deliverable` times out, retry once. If it fails again, complete as `blocked` with the timeout explanation. |
271
+ | **Empty or corrupt deliverables** | Always validate deliverable content before calling `deskfree_update_deliverable`. Minimum viable content is better than empty/corrupted content. |
272
+ | **Sub-agent coordination** | Only one sub-agent per task. If a sub-agent fails to start, the main session should resume the task directly. Don't spawn multiple sub-agents for the same task. |
273
+ | **Evaluation claim conflicts** | `deskfree_claim_evaluation` returns `null` if another process claimed it first. This is normal - move to the next pending evaluation or complete your heartbeat. |
274
+ | **Ways of working too large** | If ways of working content becomes very large (>50KB), consider archiving old sections. Focus updates on recent patterns and current best practices. |
275
+
276
+ ### Troubleshooting Common Issues
277
+
278
+ #### "Task not found" (404) Errors
279
+ - **Cause**: Task was claimed by another bot, completed, or deleted
280
+ - **Solution**: Always call `deskfree_state` first to see available tasks
281
+ - **Prevention**: Check task status in state before attempting operations
282
+
283
+ #### Auto-threading Not Working
284
+ - **Cause**: No active task context, or called `deskfree_complete_task` already
285
+ - **Solution**: Pass explicit `taskId` to `deskfree_send_message`
286
+ - **Debug**: Check that `deskfree_start_task` was called and returned successfully
287
+
288
+ #### Deliverable Updates Failing
289
+ - **Common causes**:
290
+ - Task was released by another process → call `deskfree_state` to verify task status
291
+ - Deliverable content is malformed (invalid markdown, control characters)
292
+ - Network timeout → retry once, then complete as blocked if persistent
293
+ - **Solution**: Validate markdown content before sending, handle network errors gracefully
294
+
295
+ #### Sub-agent Spawn Failures
296
+ - **Common causes**: Resource limits, configuration errors, invalid task context
297
+ - **Immediate action**: Main session should resume the task directly
298
+ - **Recovery**: Complete task as `blocked` only if you cannot resume the work yourself
299
+
300
+ #### Ways of Working Updates Not Applying
301
+ - **Cause**: Another evaluation process updated it first, or `hasChanges=false` was sent
302
+ - **Check**: Ensure `hasChanges=true` and `updatedContent` is provided when you intend to update
303
+ - **Conflict resolution**: If content conflicts occur, the last successful submission wins
304
+
305
+ #### "State returns empty" Issues
306
+ - **Not an error**: Empty state means no tasks exist - this is normal
307
+ - **Action**: Create a task if you have work to do, otherwise return `HEARTBEAT_OK`
308
+ - **Don't**: Retry `deskfree_state` in a loop - it's not broken
250
309
 
251
310
  ---
252
311
 
312
+ ## Common Workflow Patterns
313
+
314
+ ### Pattern 1: Research & Analysis (Sub-agent Recommended)
315
+
316
+ ```
317
+ Main Session:
318
+ 1. deskfree_state() → check workspace
319
+ 2. deskfree_create_task({
320
+ title: "Research competitor HumanLayer",
321
+ instructions: "Analyze their product, pricing, and positioning vs DeskFree"
322
+ })
323
+ 3. deskfree_start_task(taskId) → get task context
324
+ 4. spawn_subagent(research_prompt) → background research
325
+
326
+ Sub-agent:
327
+ 1. deskfree_update_deliverable() → initial outline
328
+ 2. [research work...]
329
+ 3. deskfree_update_deliverable() → interim findings
330
+ 4. [more research...]
331
+ 5. deskfree_update_deliverable() → final report
332
+ 6. deskfree_complete_task(taskId, "done")
333
+ ```
334
+
335
+ ### Pattern 2: Quick Fix (Main Session)
336
+
337
+ ```
338
+ 1. deskfree_state() → check current state
339
+ 2. deskfree_create_task({
340
+ title: "Fix broken login endpoint",
341
+ instructions: "Apply hotfix for 500 error in /auth/login"
342
+ })
343
+ 3. deskfree_start_task(taskId) → claim the work
344
+ 4. deskfree_update_deliverable() → "Investigating issue..."
345
+ 5. [fix the code...]
346
+ 6. deskfree_update_deliverable() → "Applied fix, testing..."
347
+ 7. [verify fix...]
348
+ 8. deskfree_update_deliverable() → "Fix verified and deployed"
349
+ 9. deskfree_complete_task(taskId, "done")
350
+ ```
351
+
352
+ ### Pattern 3: Blocked Task with Human Input
353
+
354
+ ```
355
+ 1-5. [normal task startup...]
356
+ 6. [encounter blocker - need API key]
357
+ 7. deskfree_send_message("Need the new Stripe API key to complete this integration. Where can I find it?")
358
+ 8. deskfree_update_deliverable() → save partial progress
359
+ 9. deskfree_complete_task(taskId, "blocked") → hand off to human
360
+ ```
361
+
362
+ ### Pattern 4: Ways of Working Evaluation
363
+
364
+ ```
365
+ Heartbeat check:
366
+ 1. deskfree_state() → shows pendingEvaluations: [{taskId: "abc", ...}]
367
+ 2. deskfree_claim_evaluation("abc") → get evaluation context
368
+ 3. [analyze task, messages, current ways of working...]
369
+ 4. deskfree_submit_evaluation({
370
+ taskId: "abc",
371
+ reasoning: "Found a new pattern for API error handling...",
372
+ hasChanges: true,
373
+ updatedContent: "# Ways of Working\n\n## API Integration\n[new section]..."
374
+ })
375
+ ```
376
+
253
377
  ## Task Title Examples
254
378
 
255
379
  **Good (short, scannable, action-oriented):**
256
380
  - "Research competitor HumanLayer"
257
- - "Deploy staging hotfix"
381
+ - "Deploy staging hotfix"
258
382
  - "Write API docs for /users endpoint"
383
+ - "Debug memory leak in worker process"
384
+ - "Review Q3 performance metrics"
259
385
 
260
386
  **Bad (verbose, unclear):**
261
387
  - "Do some research on a competitor called HumanLayer and write up findings"
262
388
  - "There's a bug in staging that needs fixing"
389
+ - "I need to check on some performance stuff for the quarterly review"
263
390
 
264
391
  ---
265
392
 
393
+ ## Best Practices & Anti-Patterns
394
+
395
+ ### ✅ Do This
396
+
397
+ | Practice | Rationale | Example |
398
+ |---|---|---|
399
+ | **Update deliverable early and often** | Shows progress, survives interruptions | Update outline immediately, add sections as you work |
400
+ | **Use descriptive commit-style titles** | Easy to scan, actionable | "Fix authentication timeout in Safari" |
401
+ | **Send progress messages for long tasks** | Humans know you're working | "25% complete - analyzed 3 of 12 competitor features" |
402
+ | **Complete blocked tasks with explanation** | Clear handoff to humans | Message: "Need AWS credentials", then complete as blocked |
403
+ | **Start with template deliverables** | Consistent structure, never empty | Use the markdown template every time |
404
+ | **Handle 404/409 gracefully** | Race conditions are normal | Check state and pick different task, don't retry same task |
405
+
406
+ ### ❌ Don't Do This
407
+
408
+ | Anti-Pattern | Why It's Bad | Instead |
409
+ |---|---|---|
410
+ | **Leave tasks in `bot` (is_working=true)** | Blocks the workspace indefinitely | Always complete as `done` or `blocked` |
411
+ | **Retry `deskfree_state` in loops** | Wastes resources, indicates logic error | Call once per decision point |
412
+ | **Start multiple sub-agents per task** | Creates confusion, race conditions | One sub-agent per task maximum |
413
+ | **Update deliverable only at the end** | Progress lost if interrupted | Update incrementally throughout work |
414
+ | **Ignore 409 conflicts on task claims** | Causes infinite retry loops | Accept conflict, check state, pick different task |
415
+ | **Create tasks without clear actions** | Unclear what needs doing | Use imperative verbs: "research X", "fix Y", "analyze Z" |
416
+ | **Send messages instead of completing blocked** | Task stays in limbo | Send message explaining blocker, then complete as blocked |
417
+
418
+ ### Common Gotchas
419
+
420
+ - **Auto-threading stops after `deskfree_complete_task`** → Pass explicit `taskId` for post-completion messages
421
+ - **Empty deliverable content is rejected** → Always provide meaningful content, even if just an outline
422
+ - **Sub-agents can't create tasks** → Only orchestrator (main session) can create and claim tasks
423
+ - **Ways of working updates require `hasChanges=true`** → Explicitly set flag when submitting changes
424
+ - **Task titles are visible to humans** → Make them professional and descriptive
425
+ - **Evaluation reasoning is important** → Explain your analysis even if no changes are made
426
+
266
427
  ## Human Review Outcomes
267
428
 
268
- - **Approve** → task moves to `done`. Work accepted.
269
- - **Decline / request changes** → task returns to `ready_for_bot` with feedback. Restart it.
429
+ - **Approve** → task moves to `done`. Creates pending evaluation for ways-of-working update.
430
+ - **Decline / request changes** → task returns to `bot` with feedback. Restart it.
@@ -1,74 +1,20 @@
1
1
  # DeskFree Tools — Full Parameter Reference
2
2
 
3
- ## Orchestrator Tools (10)
3
+ ## Orchestrator Tools (8)
4
4
 
5
5
  ### `deskfree_state`
6
- Get full workspace snapshot — all tasks and recently done tasks.
6
+ Get full workspace snapshot — all tasks, recently done tasks, current ways of working, and pending evaluations.
7
7
 
8
8
  | Parameter | Type | Required | Description |
9
9
  |-----------|------|----------|-------------|
10
10
  | *(none)* | — | — | — |
11
11
 
12
- **Returns:** Active tasks array, recently completed tasks.
13
-
14
- ---
15
-
16
- ### `deskfree_create_activity`
17
- Create an activity — a knowledge container for a type of work. Activities accumulate learnings from tasks.
18
-
19
- | Parameter | Type | Required | Description |
20
- |-----------|------|----------|-------------|
21
- | `name` | string | Yes | Activity name (max 200 chars) |
22
- | `description` | string | No | What this activity covers (max 50,000 chars) |
23
- | `instructions` | string | No | Initial instructions/knowledge (max 50,000 chars) |
24
-
25
- **Returns:** `{ activity }` — created activity object with ID.
26
-
27
- ---
28
-
29
- ### `deskfree_update_activity`
30
- Update an activity's name, description, or instructions.
31
-
32
- | Parameter | Type | Required | Description |
33
- |-----------|------|----------|-------------|
34
- | `activityId` | string | Yes | Activity ID to update (max 16 chars) |
35
- | `name` | string | No | New name (max 200 chars) |
36
- | `description` | string | No | Updated description (max 50,000 chars) |
37
- | `instructions` | string | No | Updated instructions (max 50,000 chars) |
38
-
39
- **Returns:** `{ activity }` — updated activity object.
40
-
41
- ---
42
-
43
- ### `deskfree_classify_task`
44
- Find activities relevant to a task. Returns matching activities whose instructions should inform the task.
45
-
46
- | Parameter | Type | Required | Description |
47
- |-----------|------|----------|-------------|
48
- | `taskTitle` | string | Yes | Task title to classify (max 200 chars) |
49
- | `taskInstructions` | string | No | Task instructions for better matching (max 50,000 chars) |
50
-
51
- **Returns:** `{ matches, suggestNew }` — array of matching activities (with score), and boolean suggesting whether to create a new activity.
52
-
53
- ---
54
-
55
- ### `deskfree_learn_from_task`
56
- After completing a task, link it to an activity and record what was learned. Appends new instructions to the activity.
57
-
58
- | Parameter | Type | Required | Description |
59
- |-----------|------|----------|-------------|
60
- | `taskId` | string | Yes | Task UUID |
61
- | `activityId` | string | Yes | Activity ID to learn into (max 16 chars) |
62
- | `additionalInstructions` | string | No | New learnings to append (max 50,000 chars) |
63
-
64
- **Returns:** `{ activity }` — updated activity with incremented taskCount and appended instructions.
65
-
66
- **Note:** Safe to call multiple times for the same task/activity pair (upserts the link).
12
+ **Returns:** Active tasks array, recently completed tasks, `waysOfWorking` (string or null), `pendingEvaluations` (array of `{taskId, taskNumber, title}`).
67
13
 
68
14
  ---
69
15
 
70
16
  ### `deskfree_create_task`
71
- Create a new task (starts as `ready_for_bot`).
17
+ Create a new task (starts as `bot`).
72
18
 
73
19
  | Parameter | Type | Required | Description |
74
20
  |-----------|------|----------|-------------|
@@ -78,7 +24,7 @@ Create a new task (starts as `ready_for_bot`).
78
24
  ---
79
25
 
80
26
  ### `deskfree_start_task`
81
- Claim a `ready_for_bot` task → moves to `working_on_it`. Returns full context.
27
+ Claim a `bot` task → moves to `bot` (is_working=true). Returns full context.
82
28
 
83
29
  | Parameter | Type | Required | Description |
84
30
  |-----------|------|----------|-------------|
@@ -86,7 +32,7 @@ Claim a `ready_for_bot` task → moves to `working_on_it`. Returns full context.
86
32
 
87
33
  **Returns:** Full task context — instructions, current deliverable, message history. Use this to populate sub-agent spawn prompts.
88
34
 
89
- **Errors:** 404 if task not `ready_for_bot` or doesn't exist. 409 if already claimed.
35
+ **Errors:** 404 if task not `bot` or doesn't exist. 409 if already claimed.
90
36
 
91
37
  ---
92
38
 
@@ -103,7 +49,7 @@ Update task deliverable. Build incrementally as you work.
103
49
  ---
104
50
 
105
51
  ### `deskfree_complete_task`
106
- Finish a task → moves to `waiting_for_human`.
52
+ Finish a task → moves to `human`.
107
53
 
108
54
  | Parameter | Type | Required | Description |
109
55
  |-----------|------|----------|-------------|
@@ -115,27 +61,43 @@ Finish a task → moves to `waiting_for_human`.
115
61
  ---
116
62
 
117
63
  ### `deskfree_send_message`
118
- Send a message in the task thread.
64
+ Send a message in the task thread. Can also suggest follow-up tasks for human review.
119
65
 
120
66
  | Parameter | Type | Required | Description |
121
67
  |-----------|------|----------|-------------|
122
- | `content` | string | Yes | Message content |
68
+ | `content` | string | No | Message content. Required unless `suggestions` is provided. |
123
69
  | `taskId` | string | No | Task UUID (optional — auto-threaded to active task if omitted) |
70
+ | `suggestions` | array | No | List of tasks to suggest for human review (1-10), each with `title` (required) and `instructions` (optional). Provide this instead of `content`. |
124
71
 
125
72
  ---
126
73
 
127
- ### `deskfree_suggest_tasks`
128
- Suggest new tasks for the human to review and approve.
74
+ ### `deskfree_claim_evaluation`
75
+ Claim a pending ways-of-working evaluation. Atomically sets `isWorking=true` where `evaluationPending=true` and `isWorking=false`. Returns null if already claimed.
129
76
 
130
77
  | Parameter | Type | Required | Description |
131
78
  |-----------|------|----------|-------------|
132
- | `tasks` | array | Yes | List of tasks to suggest (1-10), each with `title` (required) and `instructions` (optional) |
133
- | `taskId` | string | No | Current task UUID — links suggestions to the task you are working on |
79
+ | `taskId` | string | Yes | Task UUID from `pendingEvaluations` list |
80
+
81
+ **Returns:** `{ task, waysOfWorking, currentVersion, messages }` — full evaluation context, or `null` if already claimed.
82
+
83
+ ---
84
+
85
+ ### `deskfree_submit_evaluation`
86
+ Submit the result of a ways-of-working evaluation. Always call this after `deskfree_claim_evaluation`.
87
+
88
+ | Parameter | Type | Required | Description |
89
+ |-----------|------|----------|-------------|
90
+ | `taskId` | string | Yes | Task UUID being evaluated |
91
+ | `reasoning` | string | Yes | Explanation of your analysis — what you learned and why you did or did not update ways of working |
92
+ | `hasChanges` | boolean | Yes | Whether the ways of working should be updated |
93
+ | `updatedContent` | string | No | Full updated ways-of-working markdown (required if `hasChanges=true`) |
94
+
95
+ **Returns:** `{ success, version }` — version number of the new ways-of-working entry (if hasChanges=true).
134
96
 
135
97
  ---
136
98
 
137
- ## Worker Tools (5 — sub-agents only)
99
+ ## Worker Tools (4 — sub-agents only)
138
100
 
139
- Sub-agents receive: `deskfree_update_deliverable`, `deskfree_complete_task`, `deskfree_send_message`, `deskfree_suggest_tasks`, `deskfree_learn_from_task`
101
+ Sub-agents receive: `deskfree_update_deliverable`, `deskfree_complete_task`, `deskfree_send_message`, `deskfree_submit_evaluation`
140
102
 
141
- They **cannot** use: `deskfree_state`, `deskfree_create_activity`, `deskfree_update_activity`, `deskfree_classify_task`, `deskfree_create_task`, `deskfree_start_task`
103
+ They **cannot** use: `deskfree_state`, `deskfree_create_task`, `deskfree_start_task`, `deskfree_claim_evaluation`