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

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.
@@ -2,14 +2,14 @@
2
2
  name: deskfree
3
3
  description: >
4
4
  DeskFree task management and human-AI collaboration workflows.
5
- Use when: creating tasks, managing work items, updating deliverables,
5
+ Use when: creating tasks, managing work items, updating files,
6
6
  communicating with humans through DeskFree, checking workspace state,
7
7
  handling task lifecycle (start → work → complete → review),
8
- evaluating completed tasks, updating ways of working.
8
+ evaluating completed tasks, updating ways of working, managing initiatives.
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: 6.0.0
12
+ version: 8.0.0
13
13
  metadata: { 'openclaw': { 'emoji': '🏠' } }
14
14
  ---
15
15
 
@@ -20,25 +20,87 @@ metadata: { 'openclaw': { 'emoji': '🏠' } }
20
20
  ### State Machine (memorize this)
21
21
 
22
22
  ```
23
- create_task bot → [start_task] → bot (is_working) → [complete_task] → human
24
- ↑ |
25
- | human approves/declines |
26
- └────────────────────────────────────────────────────────────────┘
27
- |
28
- [approve] → done → [evaluate] → ways_of_working updated
23
+ 🎯 Initiative lifecycle
24
+ suggest_tasks ──────────────────────────────────────────────────────────────────┐
25
+ + initiativeSuggestions → [human approves initiative] → active │
26
+ [human rejects initiative] → deleted │
27
+
28
+ suggest_tasks → [human approves] → bot → [start_task] → bot (is_working) │
29
+ ↑ │ │
30
+ | human approves/declines │ │
31
+ └──────────────────────────────────────────┘ │
32
+ │ │
33
+ [complete_task] │
34
+ ↓ │
35
+ human │
36
+ │ │
37
+ [approve] │
38
+ ↓ │
39
+ done ──→ [evaluate] ──┘
40
+
41
+ globalWoW updated (always)
42
+ + initiative updated (if task has initiative_id)
29
43
  ```
30
44
 
31
- - `complete_task` outcome `done` = work complete for review
45
+ - `complete_task` outcome `done` = work complete (summary required)
32
46
  - `complete_task` outcome `blocked` = need human input (send message FIRST explaining why)
33
47
  - Both outcomes move to `human` — the human triages from there
34
48
  - When human approves (`done`), a pending evaluation is created for ways-of-working update
35
49
 
50
+ ### The Work Loop
51
+
52
+ ```
53
+ 1. Check state → deskfree_state — see tasks, active initiatives, files, pending evaluations
54
+ 2. Suggest tasks → deskfree_suggest_tasks — propose work + optional initiative + file suggestions
55
+ 3. Claim a task → deskfree_start_task — read instructions + parent context + fileContext
56
+ 4. Do the work → deskfree_update_file — build linked file incrementally
57
+ 5. Suggest follow-ups → if work reveals more to do, suggest them via deskfree_suggest_tasks (link to initiative)
58
+ 6. Complete → deskfree_complete_task — summary required for "done"
59
+ 7. Evaluate → if approved tasks have pending WoW evaluation (update globalWoW + initiative)
60
+ ```
61
+
36
62
  ### Three Rules That Break Everything If Ignored
37
63
 
38
- 1. **Always self-task.** Create a DeskFree task before starting ANY work. Tasks are cheap invisible work is expensive. No exceptions.
39
- 2. **Always check state first.** Call `deskfree_state` before creating tasks. Prevents duplicates, shows what needs attention.
64
+ 1. **Always suggest first.** Use `deskfree_suggest_tasks` before starting ANY work. Tasks go through human approval. No exceptions.
65
+ 2. **Always check state first.** Call `deskfree_state` before suggesting tasks. Prevents duplicates, shows active initiatives and files.
40
66
  3. **Always complete tasks.** Never leave a task in `bot` (is_working=true). End with `deskfree_complete_task` — outcome `done` or `blocked`.
41
67
 
68
+ ### Writing Great Instructions
69
+
70
+ Write instructions as if briefing a contractor who has never seen the codebase. Include:
71
+ - **What to do** — specific, actionable steps
72
+ - **Why** — referencing parent findings or file content when applicable
73
+ - **What "done" looks like** — clear acceptance criteria
74
+ - **Known constraints** — gotchas, dependencies, things to avoid
75
+
76
+ ### File-Based Work Output
77
+
78
+ **Work that produces persistent documents should use files.** A file persists beyond the task — it becomes the lasting artifact of your work.
79
+
80
+ **When to use files:**
81
+ - Writing specs, runbooks, reports, documentation
82
+ - Any output a human will reference after the task closes
83
+ - Output that follow-up tasks will build on
84
+
85
+ **How to link files to tasks:**
86
+ - Use `newFile` in `deskfree_suggest_tasks` to pre-create a file when you know the task will produce one
87
+ - Use `fileId` to link an existing file to a new task
88
+ - When claiming a task with a linked file, its current content is in `fileContext` — read it before starting work
89
+
90
+ **Completing a task:**
91
+ - Provide a clear `summary` of what was accomplished (required for outcome `done`)
92
+ - If the task updated a file, mention the file name/ID in the summary
93
+
94
+ ### Suggesting Follow-ups
95
+
96
+ When completing, always consider: does this work reveal follow-up tasks? If yes, suggest them. Your suggestions are strongest at this moment because you have full context.
97
+
98
+ Call `deskfree_suggest_tasks` before or after completing — pass `parentTaskId` to link follow-ups to the current task. Estimate token cost per suggestion — consider how many files to read, how much reasoning, how much output.
99
+
100
+ ### Building the Chain
101
+
102
+ You're not just doing tasks — you're building a chain. The instructions you write become someone else's brief. The files you produce become someone else's context. Write both with care.
103
+
42
104
  ### Auto-Threading
43
105
 
44
106
  After `deskfree_start_task`, ALL your outbound messages automatically thread into that task. No need to pass `taskId` to `deskfree_send_message`. After `deskfree_complete_task`, auto-threading stops.
@@ -47,6 +109,134 @@ The task sidebar is your human's window into your work — every message appears
47
109
 
48
110
  ---
49
111
 
112
+ ## Working with Files
113
+
114
+ Files are persistent documents owned by a bot that live across tasks.
115
+
116
+ ```
117
+ deskfree_state() → shows files: [{fileId, name, description, version, updatedAt}, ...]
118
+
119
+ deskfree_start_task(taskId) → if task.fileId, returns fileContext: {
120
+ fileId, name, description, content, contentFormat, version
121
+ }
122
+ ```
123
+
124
+ ### Creating Files
125
+
126
+ ```javascript
127
+ // Option 1: Pre-create when suggesting a task
128
+ deskfree_suggest_tasks({
129
+ suggestions: [{
130
+ title: "Write API documentation",
131
+ instructions: "...",
132
+ newFile: {
133
+ name: "API Reference",
134
+ description: "Full API reference documentation for v2 endpoints"
135
+ }
136
+ }]
137
+ })
138
+ // → file is created and linked to the task
139
+
140
+ // Option 2: Create a file directly during work
141
+ deskfree_create_file({
142
+ name: "Deployment Runbook",
143
+ description: "Step-by-step deployment guide",
144
+ content: "# Deployment Runbook\n\n...",
145
+ contentFormat: "markdown"
146
+ })
147
+ ```
148
+
149
+ ### Updating Files
150
+
151
+ ```javascript
152
+ // Always send the full current content — each call replaces the previous version
153
+ deskfree_update_file({
154
+ fileId: "F_abc123",
155
+ content: "# Full document...",
156
+ contentFormat: "markdown" // or "html"
157
+ })
158
+ ```
159
+
160
+ **Build incrementally** — update the file early and often. A half-complete file is infinitely better than none if you're interrupted.
161
+
162
+ ### File Format Choice
163
+
164
+ | Format | Use when |
165
+ |---|---|
166
+ | `markdown` (default) | Text reports, specs, documentation, analysis, code snippets |
167
+ | `html` | Rich web content: dashboards, styled reports, interactive tables |
168
+
169
+ HTML files are rendered in a **sandboxed iframe**. Use `format="html"` when layout and styling matter for the human's review.
170
+
171
+ ---
172
+
173
+ ## Initiatives — Long-Lived Areas of Focus
174
+
175
+ Initiatives answer **"what are we working on and why"** while Ways of Working answers **"how do we work."**
176
+
177
+ | Concept | What it is |
178
+ |---|---|
179
+ | **Initiative** | A persistent area of focus (e.g. "Auth Hardening", "Performance Sprint") |
180
+ | **Initiative Content** | A versioned markdown doc — current state, approach, next priorities |
181
+ | **Task → Initiative link** | Set `initiativeId` on suggestions to link tasks to an initiative |
182
+
183
+ **Default initiative:** Every bot has a "General" initiative for uncategorized work. Tasks without an explicit `initiativeId` are automatically linked to it.
184
+
185
+ ### When to Propose a New Initiative
186
+
187
+ ```
188
+ On every suggest_tasks call, ask yourself:
189
+
190
+ "Does an active initiative exist that this work belongs to?"
191
+ → Yes: set initiativeId on the relevant suggestions
192
+ → No, but this is part of a bigger theme: add an initiativeSuggestion
193
+ → No, and it's a one-off task: no initiative needed (defaults to General)
194
+ ```
195
+
196
+ ### Initiative Suggestion Flow
197
+
198
+ ```
199
+ 1. deskfree_state() → check initiatives[] for existing active ones
200
+
201
+ 2. deskfree_suggest_tasks({
202
+ suggestions: [
203
+ { title: "Audit auth endpoints", estimatedTokens: 20000 },
204
+ { title: "Add rate limiting", estimatedTokens: 15000 }
205
+ ],
206
+ initiativeSuggestions: [
207
+ {
208
+ title: "Auth Hardening",
209
+ content: "# Auth Hardening\n\n## Current State\nNeed to improve auth security.\n\n## Approach\nTBD — start with audit.\n\n## Next Priorities\n1. Audit all auth endpoints\n2. Address findings",
210
+ taskRefs: [0, 1] // auto-links tasks at index 0 and 1 when approved
211
+ }
212
+ ]
213
+ })
214
+
215
+ Human sees:
216
+ 🎯 New Initiative: "Auth Hardening" [Approve] [Reject]
217
+ 📋 Task: "Audit auth endpoints..." [Approve] [Reject]
218
+ 📋 Task: "Add rate limiting..." [Approve] [Reject]
219
+ ```
220
+
221
+ ### Linking Tasks to Existing Initiatives
222
+
223
+ ```
224
+ deskfree_state() → sees initiatives: [{ id: "init_abc", title: "Auth Hardening", status: "active" }]
225
+
226
+ deskfree_suggest_tasks({
227
+ suggestions: [
228
+ { title: "Implement CSRF protection",
229
+ instructions: "...",
230
+ estimatedTokens: 25000,
231
+ initiativeId: "init_abc" // link to existing initiative
232
+ }
233
+ ]
234
+ // no initiativeSuggestions needed — initiative already exists
235
+ })
236
+ ```
237
+
238
+ ---
239
+
50
240
  ## Ways of Working — The Evolving Playbook
51
241
 
52
242
  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.
@@ -57,19 +247,74 @@ Ways of Working is a **single versioned markdown document** per bot that evolves
57
247
  - Updated after task approval via the evaluation flow (never manually during work)
58
248
  - Each update creates a new immutable version — full history preserved
59
249
 
60
- ### Evaluation Flow
250
+ ### Evaluation Flow — Dual Output
61
251
 
62
- When a human approves a task, it enters `pendingEvaluations` in state.get:
252
+ When a human approves a task, it enters `pendingEvaluations` in state.get. Evaluation now has **two independent outputs**:
63
253
 
64
254
  ```
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)
255
+ 1. deskfree_claim_evaluation(taskId)
256
+ returns: task + messages + waysOfWorking + initiative (if task has initiative_id)
257
+
258
+ 2. Review the task summary, messages, and any file output
259
+
260
+ 3. Ask yourself:
261
+ "Did I learn something about HOW we work that applies everywhere?"
262
+ → Yes: update globalWoW
263
+
264
+ "Did I learn something about WHERE this initiative stands or
265
+ HOW to approach this specific area?"
266
+ → Yes: update initiative content
267
+
268
+ Both? → update both
269
+ Neither? → hasChanges: false for both
270
+
271
+ 4. deskfree_submit_evaluation({
272
+ taskId,
273
+ reasoning: "...",
274
+ globalWoW: { hasChanges: true, updatedContent: "..." },
275
+ initiative: { hasChanges: false }
276
+ })
68
277
  ```
69
278
 
70
- **When to update:** New patterns emerged, a better approach was found, recurring mistakes identified, human gave feedback that reveals process improvements.
279
+ **globalWoW** patterns that apply to all work everywhere. Examples:
280
+ - A better approach to error handling you discovered
281
+ - A recurring mistake to avoid
282
+ - A tool or service pattern that's universally useful
283
+
284
+ **initiative content** — what was learned about this specific area of focus. Examples:
285
+ - Current state of the initiative has changed (task completed a major piece)
286
+ - New findings shifted the approach
287
+ - Next priorities should be reordered
288
+
289
+ **When NOT to update either:** One-off tasks with no transferable learnings, standard work that matched existing patterns.
71
290
 
72
- **When NOT to update:** One-off tasks with no transferable learnings, standard work that matched existing patterns.
291
+ ### Example Evaluation
292
+
293
+ ```
294
+ Task "Audit auth endpoints" (linked to "Auth Hardening" initiative) is approved.
295
+
296
+ claim_evaluation → returns:
297
+ task (with summary: "Found 3 critical issues: session fixation, weak CSRF, no rate limiting")
298
+ waysOfWorking: "..."
299
+ initiative: { id: "init_abc", title: "Auth Hardening", content: "No audit done yet." }
300
+
301
+ Analysis:
302
+ - Gateway has built-in rate limiting (just needs config) → applies everywhere → update globalWoW
303
+ - Audit found 3 critical issues → initiative content needs update → update initiative
304
+
305
+ submit_evaluation({
306
+ taskId: "audit-task",
307
+ reasoning: "Audit found 3 issues. Gateway has rate limiting built in — updated both.",
308
+ globalWoW: {
309
+ hasChanges: true,
310
+ updatedContent: "...## Infrastructure\n- Always check AWS API Gateway config before building custom middleware\n..."
311
+ },
312
+ initiative: {
313
+ hasChanges: true,
314
+ updatedContent: "# Auth Hardening\n\n## Current State\nAudit complete. Found 3 critical issues:\n1. Session fixation\n2. No rate limiting (gateway supports it — just needs config)\n3. Weak CSRF\n\n## Next Priorities\n1. Configure gateway rate limiting (quick win)\n2. Fix session fixation\n3. Implement CSRF tokens"
315
+ }
316
+ })
317
+ ```
73
318
 
74
319
  ---
75
320
 
@@ -79,26 +324,29 @@ When a human approves a task, it enters `pendingEvaluations` in state.get:
79
324
 
80
325
  - [ ] Called `deskfree_state` — confirmed it returned data (not empty/error)
81
326
  - [ ] Read `waysOfWorking` if present — apply established patterns
327
+ - [ ] Read `initiatives` if present — check for active initiatives this work belongs to
328
+ - [ ] Checked `files` list — know what persistent files already exist
82
329
  - [ ] Checked for existing tasks that match intent — no duplicates
83
- - [ ] Created a task with clear, action-oriented title (max 200 chars)
84
- - [ ] Called `deskfree_start_task` — confirmed task moved to `bot` (is_working=true)
330
+ - [ ] Suggested a task via `deskfree_suggest_tasks` — with `initiativeId` if linking to existing initiative, or `initiativeSuggestions` if proposing new one, and `newFile` if task will produce a document
331
+ - [ ] Once approved: called `deskfree_start_task` — confirmed task moved to `bot` (is_working=true)
332
+ - [ ] If task has `fileContext` — read the existing file content before starting work
85
333
 
86
334
  ### Mid-Work
87
335
 
88
- - [ ] Deliverable started immediately after starting task (not waiting until end)
89
- - [ ] `deskfree_update_deliverable` succeeded (no error response)
336
+ - [ ] File updated immediately after starting task (not waiting until end)
337
+ - [ ] `deskfree_update_file` succeeded (no error response)
90
338
  - [ ] If blocked: sent message explaining WHY before calling `complete_task` with `blocked`
91
339
 
92
340
  ### Pre-Completion
93
341
 
94
- - [ ] Deliverable is non-empty and meaningful (not just headers/placeholders)
95
- - [ ] Deliverable is well-structured markdown that stands alone
96
- - [ ] Called `deskfree_complete_task` — confirmed task moved to `human`
342
+ - [ ] File content is non-empty and meaningful (if task produces a file)
343
+ - [ ] File is well-structured and stands alone as a document
344
+ - [ ] Called `deskfree_complete_task` with a clear `summary` — confirmed task moved to `human`
97
345
  - [ ] If sub-agent: terminated after completion (one task per sub-agent)
98
346
 
99
347
  ### Heartbeat Evaluation Check
100
348
 
101
- - [ ] Any `pendingEvaluations` in state? → claim and evaluate each one
349
+ - [ ] Any `pendingEvaluations` in state? → claim and evaluate each one (submit globalWoW + initiative outputs)
102
350
 
103
351
  ---
104
352
 
@@ -107,21 +355,24 @@ When a human approves a task, it enters `pendingEvaluations` in state.get:
107
355
  ### Orchestrator Flow (main session)
108
356
 
109
357
  ```
110
- 1. deskfree_state → assess workspace + read ways of working
111
- 2. deskfree_create_task create with clear title + instructions
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"
358
+ 1. deskfree_state → assess workspace + read ways of working + check active initiatives + check files
359
+ 2. deskfree_suggest_tasks suggest tasks (with estimatedTokens, initiativeId, initiativeSuggestions, newFile)
360
+ 3. deskfree_start_task → claim approved task (returns full context + parent context + fileContext)
361
+ 4. deskfree_update_file → build linked file incrementally as you work
362
+ 5. deskfree_suggest_tasks suggest follow-ups if work reveals more (parentTaskId to link)
363
+ 6. deskfree_complete_task → complete with outcome done (+ summary) or blocked
115
364
  ```
116
365
 
117
366
  ### Sub-Agent Flow (recommended for tasks > 5 min)
118
367
 
119
368
  ```
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
369
+ Orchestrator: deskfree_suggest_tasks(human approves) → deskfree_start_task → spawn sub-agent with full task context
370
+ Sub-agent: deskfree_update_file (incrementally) → deskfree_suggest_tasks (follow-ups if needed) → deskfree_complete_task (+ summary) → terminate
122
371
  ```
123
372
 
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.
373
+ Sub-agents have **7 tools:** `deskfree_update_file`, `deskfree_create_file`, `deskfree_complete_task`, `deskfree_send_message`, `deskfree_suggest_tasks`, `deskfree_claim_evaluation`, `deskfree_submit_evaluation`. Workers have workspace context for awareness focus on your assigned task and use context to avoid duplicate suggestions.
374
+
375
+ **Worker pattern — after submitting evaluation:** reflect on what you learned and call `deskfree_suggest_tasks` for follow-up opportunities that emerged from the evaluation.
125
376
 
126
377
  ### When to Use Main vs Sub-Agent
127
378
 
@@ -134,6 +385,50 @@ Sub-agents have **4 tools:** `deskfree_update_deliverable`, `deskfree_complete_t
134
385
 
135
386
  ---
136
387
 
388
+ ## Recurrence — Natural Language + scheduledFor
389
+
390
+ **Recurrence is handled through task instructions, NOT through special fields.** DeskFree uses a simple suggest → complete → suggest cycle for recurring work.
391
+
392
+ ### How Recurrence Works
393
+
394
+ 1. **Document the pattern** in task instructions using natural language:
395
+ - "This task recurs weekly on Mondays. When completing, suggest the next occurrence with scheduledFor set to next Monday."
396
+ - "Monthly report — recurs on the 1st of each month. Schedule next occurrence for first day of next month."
397
+
398
+ 2. **Set the first occurrence** using `scheduledFor` in your suggestion:
399
+ ```javascript
400
+ deskfree_suggest_tasks({
401
+ suggestions: [{
402
+ title: "Weekly team sync prep",
403
+ instructions: "Prepare agenda for Monday team meeting. This task recurs weekly on Mondays. When completing, suggest the next occurrence with scheduledFor set to next Monday at 9 AM.",
404
+ scheduledFor: "2026-03-03T14:00:00Z" // Next Monday 9 AM EST
405
+ }]
406
+ })
407
+ ```
408
+
409
+ 3. **Propagate on completion** — when you complete a recurring task, read the instructions and suggest the next occurrence:
410
+ ```javascript
411
+ // After completing the task:
412
+ deskfree_suggest_tasks({
413
+ suggestions: [{
414
+ title: "Weekly team sync prep",
415
+ instructions: "Prepare agenda for Monday team meeting. This task recurs weekly on Mondays. When completing, suggest the next occurrence with scheduledFor set to next Monday at 9 AM.",
416
+ scheduledFor: "2026-03-10T14:00:00Z" // Following Monday
417
+ }],
418
+ parentTaskId: "current-task-id"
419
+ })
420
+ ```
421
+
422
+ ### Key Points
423
+
424
+ - **No special recurrence fields** — it's just natural language in instructions + `scheduledFor`
425
+ - **You are responsible** for reading the recurrence pattern and creating the next occurrence
426
+ - **Use scheduledFor** to control when the task becomes available
427
+ - **Include the recurrence instructions** verbatim in follow-up suggestions so the pattern continues
428
+ - **Be precise with dates** — calculate the next occurrence based on the documented pattern
429
+
430
+ ---
431
+
137
432
  ## Messaging
138
433
 
139
434
  **Normal replies:** Just respond — the channel handles routing automatically. No tool needed.
@@ -151,18 +446,21 @@ Sub-agents have **4 tools:** `deskfree_update_deliverable`, `deskfree_complete_t
151
446
 
152
447
  ### Heartbeat / Proactive Check
153
448
 
154
- 1. `deskfree_state` → get workspace snapshot + check `waysOfWorking` + `pendingEvaluations`
155
- 2. `pendingEvaluations`? → `deskfree_claim_evaluation` → `deskfree_submit_evaluation`
449
+ 1. `deskfree_state` → get workspace snapshot + check `waysOfWorking` + `initiatives` + `files` + `pendingEvaluations`
450
+ 2. `pendingEvaluations`? → `deskfree_claim_evaluation` → `deskfree_submit_evaluation` (with globalWoW + initiative outputs)
156
451
  3. `bot` tasks? → `deskfree_start_task` + spawn sub-agents
157
452
  4. `bot` (is_working=true) with no active sub-agent? → Complete as blocked or resume
158
453
 
159
454
  ### Human Gives You Work
160
455
 
161
- 1. `deskfree_state` → check existing tasks + read ways of working
162
- 2. `deskfree_create_task`clear title + instructions
163
- 3. `deskfree_start_task`claim it
164
- 4. Work → `deskfree_update_deliverable` incrementally
165
- 5. `deskfree_complete_task` → outcome `done` or `blocked`
456
+ 1. `deskfree_state` → check existing tasks + read ways of working + check active initiatives + check files
457
+ 2. Does this work belong to an active initiative? set `initiativeId` on suggestions
458
+ OR is this starting a new area of focus? add `initiativeSuggestions`
459
+ 3. Will the task produce a persistent document? add `newFile` to the suggestion
460
+ 4. `deskfree_suggest_tasks` → suggest with clear title + instructions
461
+ 5. [human approves] → `deskfree_start_task` → claim it + read fileContext if present
462
+ 6. Work → `deskfree_update_file` incrementally
463
+ 7. `deskfree_complete_task` → outcome `done` (with summary) or `blocked`
166
464
 
167
465
  ---
168
466
 
@@ -170,49 +468,41 @@ Sub-agents have **4 tools:** `deskfree_update_deliverable`, `deskfree_complete_t
170
468
 
171
469
  > **Full parameter details:** See `references/tools.md`
172
470
 
173
- ### Orchestrator (8 tools)
471
+ ### Orchestrator (9 tools)
174
472
 
175
473
  | Tool | What it does |
176
474
  |---|---|
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 |
180
- | `deskfree_update_deliverable` | Build deliverable markdown incrementally |
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 |
185
-
186
- ### Worker (4 tools — sub-agents only)
187
-
188
- `deskfree_update_deliverable`, `deskfree_complete_task`, `deskfree_send_message`, `deskfree_submit_evaluation`
189
-
190
- ---
475
+ | `deskfree_state` | Full workspace snapshot — tasks, recently done, ways of working, active initiatives, files, pending evaluations |
476
+ | `deskfree_suggest_tasks` | Suggest tasks for human approval (with estimatedTokens, initiativeId, initiativeSuggestions, newFile, fileId) |
477
+ | `deskfree_start_task` | Claim task → `bot` (is_working=true), returns full context + parent context + fileContext |
478
+ | `deskfree_update_file` | Update a linked file's content incrementally |
479
+ | `deskfree_create_file` | Create a new persistent file |
480
+ | `deskfree_complete_task` | Mark done (summary required) or blocked `human` |
481
+ | `deskfree_send_message` | Message in task thread (content required) |
482
+ | `deskfree_claim_evaluation` | Claim a pending evaluation returns task, messages, globalWoW, and initiative (if applicable) |
483
+ | `deskfree_submit_evaluation` | Submit evaluation with dual output: globalWoW + initiative (each independently updatable) |
191
484
 
192
- ## Deliverable Best Practices
485
+ ### Worker (7 tools — sub-agents only)
193
486
 
194
- ### Choosing a format
487
+ `deskfree_update_file`, `deskfree_create_file`, `deskfree_complete_task`, `deskfree_send_message`, `deskfree_suggest_tasks`, `deskfree_claim_evaluation`, `deskfree_submit_evaluation`
195
488
 
196
- `deskfree_update_deliverable` accepts an optional `format` parameter:
489
+ Workers receive workspace context at spawn time — use it to understand what else is happening, avoid duplicate suggestions, and link follow-ups to existing initiatives.
197
490
 
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 |
491
+ ---
202
492
 
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.
493
+ ## File Best Practices
204
494
 
205
- ### Markdown deliverables
495
+ ### Markdown files
206
496
 
207
497
  Structure as **standalone markdown documents:**
208
498
 
209
499
  ```markdown
210
- # Task Title
500
+ # Document Title
211
501
 
212
502
  ## Summary
213
- Brief overview of what was accomplished.
503
+ Brief overview of what this document covers.
214
504
 
215
- ## Key Findings / Results
505
+ ## Key Findings / Content
216
506
  - Main points with supporting detail
217
507
 
218
508
  ## Details
@@ -222,7 +512,7 @@ Detailed analysis, implementation notes, etc.
222
512
  - Follow-up actions, outstanding questions
223
513
  ```
224
514
 
225
- ### HTML deliverables
515
+ ### HTML files
226
516
 
227
517
  Pass a complete, self-contained HTML document (or fragment — a wrapper `<html>` is injected automatically):
228
518
 
@@ -234,7 +524,7 @@ Pass a complete, self-contained HTML document (or fragment — a wrapper `<html>
234
524
  </table>
235
525
  ```
236
526
 
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.
527
+ **Build incrementally** — start with outline immediately after `deskfree_start_task`, fill sections as you go, polish before completing. A half-complete file is infinitely better than none.
238
528
 
239
529
  ---
240
530
 
@@ -247,7 +537,8 @@ Pass a complete, self-contained HTML document (or fragment — a wrapper `<html>
247
537
  | 404 on `deskfree_complete_task` | Task not `bot` (is_working=true) | Already completed or released. Check state. |
248
538
  | 409 on `deskfree_start_task` | Race condition — another bot claimed it | Call `deskfree_state`, pick a different task. |
249
539
  | 401 Unauthorized | Bot token invalid or expired | Check channel configuration. Do not retry. |
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. |
540
+ | `deskfree_update_file` fails | File not found or network error | Verify fileId with `deskfree_state`. If file was deleted, create a new one. |
541
+ | 422 on `deskfree_complete_task` | Missing required `summary` for outcome `done` | Add a meaningful summary of what was accomplished. |
251
542
  | `deskfree_claim_evaluation` returns null | Already claimed by another process | No action needed. Move to next pending evaluation. |
252
543
  | Sub-agent spawn fails | Resource limits, config error | Complete task as `blocked` with explanation. Do not leave in `bot` (is_working=true). |
253
544
  | WebSocket disconnected | Network issue | Plugin auto-reconnects with backoff. Messages fall back to HTTP polling. No action needed. |
@@ -256,7 +547,7 @@ Pass a complete, self-contained HTML document (or fragment — a wrapper `<html>
256
547
 
257
548
  If anything goes wrong mid-task:
258
549
  1. Send a message explaining what happened (`deskfree_send_message`)
259
- 2. Save whatever partial deliverable you have (`deskfree_update_deliverable`)
550
+ 2. Save whatever partial file content you have (`deskfree_update_file`)
260
551
  3. Complete as `blocked` (`deskfree_complete_task` with outcome `blocked`)
261
552
  4. **Never leave a task stranded in `bot` (is_working=true)**
262
553
 
@@ -265,10 +556,10 @@ If anything goes wrong mid-task:
265
556
  | Scenario | Guidance |
266
557
  |---|---|
267
558
  | **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. |
559
+ | **Long-running operations** | For tasks >10 minutes, send periodic progress updates via `deskfree_send_message` so humans know you're still working. Update file incrementally. |
560
+ | **Partial file recovery** | If interrupted mid-work, `deskfree_start_task` returns the current file content in `fileContext`. Resume from where you left off, don't start over. |
561
+ | **Network timeouts during updates** | If `deskfree_update_file` times out, retry once. If it fails again, complete as `blocked` with the timeout explanation. |
562
+ | **Empty or corrupt file content** | Always validate file content before calling `deskfree_update_file`. Minimum viable content is better than empty/corrupted content. |
272
563
  | **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
564
  | **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
565
  | **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. |
@@ -285,12 +576,12 @@ If anything goes wrong mid-task:
285
576
  - **Solution**: Pass explicit `taskId` to `deskfree_send_message`
286
577
  - **Debug**: Check that `deskfree_start_task` was called and returned successfully
287
578
 
288
- #### Deliverable Updates Failing
579
+ #### File Updates Failing
289
580
  - **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)
581
+ - File ID is wrong or file was deleted → call `deskfree_state` to see current files
582
+ - File content is malformed (invalid markdown, control characters)
292
583
  - Network timeout → retry once, then complete as blocked if persistent
293
- - **Solution**: Validate markdown content before sending, handle network errors gracefully
584
+ - **Solution**: Validate content before sending, handle network errors gracefully
294
585
 
295
586
  #### Sub-agent Spawn Failures
296
587
  - **Common causes**: Resource limits, configuration errors, invalid task context
@@ -311,42 +602,41 @@ If anything goes wrong mid-task:
311
602
 
312
603
  ## Common Workflow Patterns
313
604
 
314
- ### Pattern 1: Research & Analysis (Sub-agent Recommended)
605
+ ### Pattern 1: Research & Analysis with File Output
315
606
 
316
607
  ```
317
608
  Main Session:
318
- 1. deskfree_state() → check workspace
319
- 2. deskfree_create_task({
609
+ 1. deskfree_state() → check workspace + files
610
+ 2. deskfree_suggest_tasks([{
320
611
  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
612
+ instructions: "Analyze their product, pricing, and positioning vs DeskFree",
613
+ newFile: { name: "HumanLayer Analysis", description: "Competitor analysis report" }
614
+ }])
615
+ 3. [human approves task]
616
+ 4. deskfree_start_task(taskId) → get task context + fileContext (empty file pre-created)
617
+ 5. spawn_subagent(research_prompt) → background research
325
618
 
326
619
  Sub-agent:
327
- 1. deskfree_update_deliverable() → initial outline
620
+ 1. deskfree_update_file(fileId, "# HumanLayer Analysis\n\n## Summary\n...") → initial outline
328
621
  2. [research work...]
329
- 3. deskfree_update_deliverable() → interim findings
622
+ 3. deskfree_update_file(fileId, "...") → interim findings
330
623
  4. [more research...]
331
- 5. deskfree_update_deliverable() → final report
332
- 6. deskfree_complete_task(taskId, "done")
624
+ 5. deskfree_update_file(fileId, "...") → final report
625
+ 6. deskfree_complete_task(taskId, "done", summary: "Analysis complete — 3 key differentiators identified, full report in file")
333
626
  ```
334
627
 
335
- ### Pattern 2: Quick Fix (Main Session)
628
+ ### Pattern 2: Quick Fix (Main Session, No File)
336
629
 
337
630
  ```
338
631
  1. deskfree_state() → check current state
339
- 2. deskfree_create_task({
340
- title: "Fix broken login endpoint",
632
+ 2. deskfree_suggest_tasks([{
633
+ title: "Fix broken login endpoint",
341
634
  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..."
635
+ }])
636
+ 3. [human approves task]
637
+ 4. deskfree_start_task(taskId) claim the work
345
638
  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")
639
+ 6. deskfree_complete_task(taskId, "done", summary: "Fixed null pointer in auth middleware, deployed to staging")
350
640
  ```
351
641
 
352
642
  ### Pattern 3: Blocked Task with Human Input
@@ -355,7 +645,7 @@ Sub-agent:
355
645
  1-5. [normal task startup...]
356
646
  6. [encounter blocker - need API key]
357
647
  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
648
+ 8. deskfree_update_file(fileId, "...") → save partial progress if task has a file
359
649
  9. deskfree_complete_task(taskId, "blocked") → hand off to human
360
650
  ```
361
651
 
@@ -364,13 +654,16 @@ Sub-agent:
364
654
  ```
365
655
  Heartbeat check:
366
656
  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...]
657
+ 2. deskfree_claim_evaluation("abc") → get evaluation context (task, messages, waysOfWorking, initiative?)
658
+ 3. [analyze task summary, messages, current ways of working, initiative if present...]
369
659
  4. deskfree_submit_evaluation({
370
660
  taskId: "abc",
371
661
  reasoning: "Found a new pattern for API error handling...",
372
- hasChanges: true,
373
- updatedContent: "# Ways of Working\n\n## API Integration\n[new section]..."
662
+ globalWoW: {
663
+ hasChanges: true,
664
+ updatedContent: "# Ways of Working\n\n## API Integration\n[new section]..."
665
+ },
666
+ initiative: { hasChanges: false }
374
667
  })
375
668
  ```
376
669
 
@@ -378,7 +671,7 @@ Heartbeat check:
378
671
 
379
672
  **Good (short, scannable, action-oriented):**
380
673
  - "Research competitor HumanLayer"
381
- - "Deploy staging hotfix"
674
+ - "Deploy staging hotfix"
382
675
  - "Write API docs for /users endpoint"
383
676
  - "Debug memory leak in worker process"
384
677
  - "Review Q3 performance metrics"
@@ -396,12 +689,13 @@ Heartbeat check:
396
689
 
397
690
  | Practice | Rationale | Example |
398
691
  |---|---|---|
399
- | **Update deliverable early and often** | Shows progress, survives interruptions | Update outline immediately, add sections as you work |
692
+ | **Update file early and often** | Shows progress, survives interruptions | Update outline immediately, add sections as you work |
400
693
  | **Use descriptive commit-style titles** | Easy to scan, actionable | "Fix authentication timeout in Safari" |
401
694
  | **Send progress messages for long tasks** | Humans know you're working | "25% complete - analyzed 3 of 12 competitor features" |
402
695
  | **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 |
696
+ | **Start with template file structure** | Consistent structure, never empty | Use the markdown template every time |
404
697
  | **Handle 404/409 gracefully** | Race conditions are normal | Check state and pick different task, don't retry same task |
698
+ | **Provide meaningful summary on done** | Humans see this first | "Wrote full API docs for /users endpoint — 12 methods documented" |
405
699
 
406
700
  ### ❌ Don't Do This
407
701
 
@@ -410,19 +704,21 @@ Heartbeat check:
410
704
  | **Leave tasks in `bot` (is_working=true)** | Blocks the workspace indefinitely | Always complete as `done` or `blocked` |
411
705
  | **Retry `deskfree_state` in loops** | Wastes resources, indicates logic error | Call once per decision point |
412
706
  | **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 |
707
+ | **Update file only at the end** | Progress lost if interrupted | Update incrementally throughout work |
414
708
  | **Ignore 409 conflicts on task claims** | Causes infinite retry loops | Accept conflict, check state, pick different task |
415
709
  | **Create tasks without clear actions** | Unclear what needs doing | Use imperative verbs: "research X", "fix Y", "analyze Z" |
416
710
  | **Send messages instead of completing blocked** | Task stays in limbo | Send message explaining blocker, then complete as blocked |
711
+ | **Complete "done" without a summary** | Human can't quickly understand outcome | Always provide a 1-3 sentence summary of what was accomplished |
417
712
 
418
713
  ### Common Gotchas
419
714
 
420
715
  - **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
716
+ - **Empty file content is not useful** → Always provide meaningful content, even if just an outline
717
+ - **Sub-agents can't create tasks** → Only orchestrator (main session) can create and claim tasks
423
718
  - **Ways of working updates require `hasChanges=true`** → Explicitly set flag when submitting changes
424
719
  - **Task titles are visible to humans** → Make them professional and descriptive
425
720
  - **Evaluation reasoning is important** → Explain your analysis even if no changes are made
721
+ - **summary is required for outcome "done"** → Plan what you'll write before completing
426
722
 
427
723
  ## Human Review Outcomes
428
724