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

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.
@@ -9,7 +9,7 @@ description: >
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: 8.0.0
12
+ version: 9.0.0
13
13
  metadata: { 'openclaw': { 'emoji': '🏠' } }
14
14
  ---
15
15
 
@@ -21,11 +21,11 @@ metadata: { 'openclaw': { 'emoji': '🏠' } }
21
21
 
22
22
  ```
23
23
  🎯 Initiative lifecycle
24
- suggest_tasks ──────────────────────────────────────────────────────────────────┐
25
- + initiativeSuggestions → [human approves initiative] → active
26
- [human rejects initiative] → deleted
24
+ deskfree_propose ───────────────────────────────────────────────────────────────┐
25
+ + initiative → [human approves initiative in modal] → active
26
+ [human rejects] → nothing created
27
27
 
28
- suggest_tasks → [human approves] → bot → [start_task] → bot (is_working)
28
+ deskfree_propose → [human approves in modal] → bot → [start_task] → bot (is_working)
29
29
  ↑ │ │
30
30
  | human approves/declines │ │
31
31
  └──────────────────────────────────────────┘ │
@@ -42,70 +42,162 @@ suggest_tasks → [human approves] → bot → [start_task] → bot (is_working)
42
42
  + initiative updated (if task has initiative_id)
43
43
  ```
44
44
 
45
+ - Proposals live as metadata on a single message — **NO database rows until human approves**
46
+ - Human reviews everything in one modal: can edit titles, instructions, toggle substeps
45
47
  - `complete_task` outcome `done` = work complete (summary required)
46
48
  - `complete_task` outcome `blocked` = need human input (send message FIRST explaining why)
47
49
  - Both outcomes move to `human` — the human triages from there
48
- - When human approves (`done`), a pending evaluation is created for ways-of-working update
49
50
 
50
51
  ### The Work Loop
51
52
 
52
53
  ```
53
54
  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
+ 2. Propose plan deskfree_propose — propose work for human approval (one initiative per call)
55
56
  3. Claim a task → deskfree_start_task — read instructions + parent context + fileContext
56
57
  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
+ 5. Propose follow-ups → if work reveals more to do, propose them via deskfree_propose
58
59
  6. Complete → deskfree_complete_task — summary required for "done"
59
60
  7. Evaluate → if approved tasks have pending WoW evaluation (update globalWoW + initiative)
60
61
  ```
61
62
 
62
63
  ### Three Rules That Break Everything If Ignored
63
64
 
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.
65
+ 1. **Always propose first.** Use `deskfree_propose` before starting ANY work. Nothing is created until human approves. No exceptions.
66
+ 2. **Always check state first.** Call `deskfree_state` before proposing. Prevents duplicates, shows active initiatives and files.
66
67
  3. **Always complete tasks.** Never leave a task in `bot` (is_working=true). End with `deskfree_complete_task` — outcome `done` or `blocked`.
67
68
 
68
- ### Writing Great Instructions
69
+ ---
69
70
 
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
71
+ ## Proposing Plans with `deskfree_propose`
75
72
 
76
- ### File-Based Work Output
73
+ **This tool replaces the old `deskfree_suggest_tasks`.** Plans are stored as proposals in message metadata — no tasks, files, or initiatives are created until the human explicitly approves them in a review modal.
77
74
 
78
- **Work that produces persistent documents should use files.** A file persists beyond the task — it becomes the lasting artifact of your work.
75
+ ### When to Propose vs Just Doing Work
79
76
 
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
77
+ - **Always propose first.** Even quick fixes need a proposal. The human approves what gets created.
78
+ - **Exception:** If you're already working on an approved task, you can create files directly with `deskfree_create_file` during that task.
84
79
 
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
80
+ ### One Initiative Per Proposal
89
81
 
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
82
+ Each `deskfree_propose` call handles **one initiative** (existing or new) or no initiative at all. If you need to propose tasks under multiple initiatives, make separate calls.
93
83
 
94
- ### Suggesting Follow-ups
84
+ ### How Substeps Work
95
85
 
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.
86
+ Substeps are **human-reviewable checklist items** within a task. The human can toggle each one on/off before approving:
97
87
 
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.
88
+ ```javascript
89
+ deskfree_propose({
90
+ tasks: [{
91
+ title: "Audit auth endpoints",
92
+ instructions: "Review all authentication endpoints for security issues...",
93
+ substeps: [
94
+ "Review session management",
95
+ "Check CSRF protection",
96
+ "Verify rate limiting",
97
+ "Test token expiration handling"
98
+ ]
99
+ }]
100
+ })
101
+ ```
99
102
 
100
- ### Building the Chain
103
+ In the review modal, the human sees:
104
+ ```
105
+ ☑ Task: Audit auth endpoints
106
+ ☑ Review session management
107
+ ☑ Check CSRF protection
108
+ ☐ Verify rate limiting ← human unchecked this
109
+ ☑ Test token expiration handling
110
+ ```
101
111
 
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.
112
+ Only checked substeps become part of the approved task.
103
113
 
104
- ### Auto-Threading
114
+ ### File Linking (Existing vs New)
105
115
 
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.
116
+ ```javascript
117
+ // Link an existing file — bot receives its content when claiming the task
118
+ deskfree_propose({
119
+ tasks: [{
120
+ title: "Update API docs",
121
+ instructions: "...",
122
+ file: { existingId: "FILE_abc123" }
123
+ }]
124
+ })
107
125
 
108
- The task sidebar is your human's window into your work every message appears there in real-time.
126
+ // Create a new file on approvalfor tasks that produce documents
127
+ deskfree_propose({
128
+ tasks: [{
129
+ title: "Write deployment runbook",
130
+ instructions: "...",
131
+ file: { name: "Deployment Runbook", description: "Step-by-step deployment guide" }
132
+ }]
133
+ })
134
+ ```
135
+
136
+ New files are created atomically when the human approves — no orphaned files if rejected.
137
+
138
+ ### Examples of Good Proposals
139
+
140
+ **Research with file output:**
141
+ ```javascript
142
+ deskfree_propose({
143
+ initiative: { title: "Competitor Analysis", content: "# Competitor Analysis\n\nSystematic review of key competitors..." },
144
+ context: "User asked for competitive landscape overview — proposing structured analysis.",
145
+ tasks: [
146
+ {
147
+ title: "Analyze HumanLayer positioning",
148
+ instructions: "Research HumanLayer's product, pricing, and market position vs DeskFree...",
149
+ substeps: ["Review public docs and pricing", "Analyze feature comparison", "Draft positioning summary"],
150
+ file: { name: "HumanLayer Analysis", description: "Competitive analysis report" },
151
+ estimatedTokens: 20000
152
+ },
153
+ {
154
+ title: "Analyze CrewAI positioning",
155
+ instructions: "Research CrewAI's product and market position...",
156
+ substeps: ["Review public docs", "Analyze use cases", "Compare approach"],
157
+ file: { name: "CrewAI Analysis", description: "Competitive analysis report" },
158
+ estimatedTokens: 15000
159
+ }
160
+ ]
161
+ })
162
+ ```
163
+
164
+ **Quick fix under existing initiative:**
165
+ ```javascript
166
+ deskfree_propose({
167
+ initiative: "INI_abc123", // existing initiative ID
168
+ context: "Found during audit — session fixation vulnerability in /auth/login",
169
+ tasks: [{
170
+ title: "Fix session fixation in auth endpoint",
171
+ instructions: "Regenerate session ID after successful authentication...",
172
+ substeps: ["Add session regeneration", "Add regression test", "Verify in staging"],
173
+ estimatedTokens: 10000
174
+ }]
175
+ })
176
+ ```
177
+
178
+ **Scheduled/recurring work:**
179
+ ```javascript
180
+ deskfree_propose({
181
+ context: "Setting up weekly metrics report",
182
+ tasks: [{
183
+ title: "Weekly metrics report",
184
+ instructions: "Generate weekly performance metrics. This recurs weekly on Mondays. When completing, propose the next occurrence.",
185
+ substeps: ["Pull metrics from dashboard", "Generate summary", "Flag anomalies"],
186
+ file: { name: "Weekly Metrics", description: "Recurring weekly metrics report" },
187
+ scheduledFor: "2026-03-02T14:00:00Z"
188
+ }]
189
+ })
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Writing Great Instructions
195
+
196
+ Write instructions as if briefing a contractor who has never seen the codebase. Include:
197
+ - **What to do** — specific, actionable steps
198
+ - **Why** — referencing parent findings or file content when applicable
199
+ - **What "done" looks like** — clear acceptance criteria
200
+ - **Known constraints** — gotchas, dependencies, things to avoid
109
201
 
110
202
  ---
111
203
 
@@ -124,18 +216,14 @@ deskfree_start_task(taskId) → if task.fileId, returns fileContext: {
124
216
  ### Creating Files
125
217
 
126
218
  ```javascript
127
- // Option 1: Pre-create when suggesting a task
128
- deskfree_suggest_tasks({
129
- suggestions: [{
219
+ // Option 1: Pre-create when proposing a task (created on approval)
220
+ deskfree_propose({
221
+ tasks: [{
130
222
  title: "Write API documentation",
131
223
  instructions: "...",
132
- newFile: {
133
- name: "API Reference",
134
- description: "Full API reference documentation for v2 endpoints"
135
- }
224
+ file: { name: "API Reference", description: "Full API reference documentation" }
136
225
  }]
137
226
  })
138
- // → file is created and linked to the task
139
227
 
140
228
  // Option 2: Create a file directly during work
141
229
  deskfree_create_file({
@@ -166,72 +254,43 @@ deskfree_update_file({
166
254
  | `markdown` (default) | Text reports, specs, documentation, analysis, code snippets |
167
255
  | `html` | Rich web content: dashboards, styled reports, interactive tables |
168
256
 
169
- HTML files are rendered in a **sandboxed iframe**. Use `format="html"` when layout and styling matter for the human's review.
170
-
171
257
  ---
172
258
 
173
259
  ## Initiatives — Long-Lived Areas of Focus
174
260
 
175
261
  Initiatives answer **"what are we working on and why"** while Ways of Working answers **"how do we work."**
176
262
 
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
263
  ### When to Propose a New Initiative
186
264
 
187
265
  ```
188
- On every suggest_tasks call, ask yourself:
266
+ On every deskfree_propose call, ask yourself:
189
267
 
190
268
  "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)
269
+ → Yes: pass the initiative ID as a string
270
+ → No, but this is part of a bigger theme: pass { title, content } to create new
271
+ → No, and it's a one-off task: omit initiative (defaults to General)
194
272
  ```
195
273
 
196
- ### Initiative Suggestion Flow
274
+ ### Examples
197
275
 
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
276
+ ```javascript
277
+ // Link to existing initiative
278
+ deskfree_propose({
279
+ initiative: "INI_abc123",
280
+ tasks: [{ title: "Implement CSRF protection", instructions: "..." }]
281
+ })
222
282
 
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
- }
283
+ // Create new initiative with tasks
284
+ deskfree_propose({
285
+ initiative: {
286
+ title: "Auth Hardening",
287
+ content: "# Auth Hardening\n\n## Current State\nNeed to improve auth security.\n\n## Next Priorities\n1. Audit all endpoints\n2. Address findings"
288
+ },
289
+ context: "Starting security improvement initiative based on recent audit findings.",
290
+ tasks: [
291
+ { title: "Audit auth endpoints", instructions: "...", estimatedTokens: 20000 },
292
+ { title: "Add rate limiting", instructions: "...", estimatedTokens: 15000 }
233
293
  ]
234
- // no initiativeSuggestions needed — initiative already exists
235
294
  })
236
295
  ```
237
296
 
@@ -239,17 +298,11 @@ deskfree_suggest_tasks({
239
298
 
240
299
  ## Ways of Working — The Evolving Playbook
241
300
 
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.
243
-
244
- **Key properties:**
245
- - Injected automatically via `deskfree_state` (the `waysOfWorking` field)
246
- - Read it before starting work to understand established patterns
247
- - Updated after task approval via the evaluation flow (never manually during work)
248
- - Each update creates a new immutable version — full history preserved
301
+ Ways of Working is a **single versioned markdown document** per bot that evolves as you complete tasks.
249
302
 
250
303
  ### Evaluation Flow — Dual Output
251
304
 
252
- When a human approves a task, it enters `pendingEvaluations` in state.get. Evaluation now has **two independent outputs**:
305
+ When a human approves a task, it enters `pendingEvaluations`. Evaluation has **two independent outputs**:
253
306
 
254
307
  ```
255
308
  1. deskfree_claim_evaluation(taskId)
@@ -260,60 +313,10 @@ When a human approves a task, it enters `pendingEvaluations` in state.get. Evalu
260
313
  3. Ask yourself:
261
314
  "Did I learn something about HOW we work that applies everywhere?"
262
315
  → Yes: update globalWoW
263
-
264
- "Did I learn something about WHERE this initiative stands or
265
- HOW to approach this specific area?"
316
+ "Did I learn something about WHERE this initiative stands?"
266
317
  → Yes: update initiative content
267
318
 
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
- })
277
- ```
278
-
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.
290
-
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
- })
319
+ 4. deskfree_submit_evaluation({ taskId, reasoning, globalWoW, initiative })
317
320
  ```
318
321
 
319
322
  ---
@@ -322,31 +325,29 @@ submit_evaluation({
322
325
 
323
326
  ### Pre-Flight (before ANY work)
324
327
 
325
- - [ ] Called `deskfree_state` — confirmed it returned data (not empty/error)
328
+ - [ ] Called `deskfree_state` — confirmed it returned data
326
329
  - [ ] Read `waysOfWorking` if present — apply established patterns
327
- - [ ] Read `initiatives` if present — check for active initiatives this work belongs to
330
+ - [ ] Read `initiatives` if present — check for active initiatives
328
331
  - [ ] Checked `files` list — know what persistent files already exist
329
332
  - [ ] Checked for existing tasks that match intent — no duplicates
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
333
+ - [ ] Proposed via `deskfree_propose` — with initiative, substeps, file links as appropriate
331
334
  - [ ] Once approved: called `deskfree_start_task` — confirmed task moved to `bot` (is_working=true)
332
335
  - [ ] If task has `fileContext` — read the existing file content before starting work
333
336
 
334
337
  ### Mid-Work
335
338
 
336
339
  - [ ] File updated immediately after starting task (not waiting until end)
337
- - [ ] `deskfree_update_file` succeeded (no error response)
338
340
  - [ ] If blocked: sent message explaining WHY before calling `complete_task` with `blocked`
339
341
 
340
342
  ### Pre-Completion
341
343
 
342
344
  - [ ] 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`
345
+ - [ ] Called `deskfree_complete_task` with a clear `summary`
345
346
  - [ ] If sub-agent: terminated after completion (one task per sub-agent)
346
347
 
347
348
  ### Heartbeat Evaluation Check
348
349
 
349
- - [ ] Any `pendingEvaluations` in state? → claim and evaluate each one (submit globalWoW + initiative outputs)
350
+ - [ ] Any `pendingEvaluations` in state? → claim and evaluate each one
350
351
 
351
352
  ---
352
353
 
@@ -355,176 +356,82 @@ submit_evaluation({
355
356
  ### Orchestrator Flow (main session)
356
357
 
357
358
  ```
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
359
+ 1. deskfree_state → assess workspace
360
+ 2. deskfree_propose propose plan (one initiative per call)
361
+ 3. deskfree_start_task → claim approved task
362
+ 4. deskfree_update_file → build linked file incrementally
363
+ 5. deskfree_propose propose follow-ups if needed
364
+ 6. deskfree_complete_task → complete with outcome done or blocked
364
365
  ```
365
366
 
366
- ### Sub-Agent Flow (recommended for tasks > 5 min)
367
+ ### Sub-Agent Flow
367
368
 
368
369
  ```
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
370
+ Orchestrator: deskfree_propose → (human approves) → deskfree_start_task → spawn sub-agent
371
+ Sub-agent: deskfree_update_file → deskfree_propose (follow-ups) → deskfree_complete_task → terminate
371
372
  ```
372
373
 
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.
376
-
377
- ### When to Use Main vs Sub-Agent
378
-
379
- | Main session | Sub-agent |
380
- |---|---|
381
- | Quick tasks (< 5 min) | Research, reports, analysis |
382
- | Interactive/back-and-forth | Code development, debugging |
383
- | Urgent fixes | Long operations (> 10 min) |
384
- | | Background work while human may message |
374
+ Sub-agents have **7 tools:** `deskfree_update_file`, `deskfree_create_file`, `deskfree_complete_task`, `deskfree_send_message`, `deskfree_propose`, `deskfree_claim_evaluation`, `deskfree_submit_evaluation`.
385
375
 
386
376
  ---
387
377
 
388
378
  ## Recurrence — Natural Language + scheduledFor
389
379
 
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
380
+ Recurrence is handled through task instructions + `scheduledFor`. Document the pattern in instructions, set the first occurrence, propagate on completion by proposing the next occurrence.
429
381
 
430
382
  ---
431
383
 
432
384
  ## Messaging
433
385
 
434
- **Normal replies:** Just respond — the channel handles routing automatically. No tool needed.
386
+ **Normal replies:** Just respond — the channel handles routing automatically.
435
387
 
436
388
  **Use `deskfree_send_message` only for:**
437
389
  - Progress updates during task execution
438
390
  - Questions needing human input mid-task
439
391
  - Status reports for long-running tasks
440
392
 
441
- **Never use it for:** Normal conversation replies (channel handles those).
442
-
443
393
  ---
444
394
 
445
395
  ## Decision Tree
446
396
 
447
397
  ### Heartbeat / Proactive Check
448
398
 
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)
399
+ 1. `deskfree_state` → get workspace snapshot
400
+ 2. `pendingEvaluations`? → claim and evaluate
451
401
  3. `bot` tasks? → `deskfree_start_task` + spawn sub-agents
452
402
  4. `bot` (is_working=true) with no active sub-agent? → Complete as blocked or resume
453
403
 
454
404
  ### Human Gives You Work
455
405
 
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`
406
+ 1. `deskfree_state` → check existing tasks + initiatives + files
407
+ 2. Does this work belong to an active initiative? → pass its ID
408
+ OR is this starting a new area? → pass { title, content }
409
+ 3. `deskfree_propose` propose with context, substeps, file links
410
+ 4. [human approves in modal] `deskfree_start_task` claim it
411
+ 5. Work → `deskfree_update_file` incrementally
412
+ 6. `deskfree_complete_task`outcome `done` (with summary) or `blocked`
464
413
 
465
414
  ---
466
415
 
467
416
  ## Tools Reference
468
417
 
469
- > **Full parameter details:** See `references/tools.md`
470
-
471
418
  ### Orchestrator (9 tools)
472
419
 
473
420
  | Tool | What it does |
474
421
  |---|---|
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 |
422
+ | `deskfree_state` | Full workspace snapshot — tasks, done tasks, ways of working, initiatives, files, pending evaluations |
423
+ | `deskfree_propose` | Propose a plan for human approval one initiative per call, with substeps and file links |
424
+ | `deskfree_start_task` | Claim task → `bot` (is_working=true), returns full context + fileContext |
478
425
  | `deskfree_update_file` | Update a linked file's content incrementally |
479
426
  | `deskfree_create_file` | Create a new persistent file |
480
427
  | `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) |
428
+ | `deskfree_send_message` | Message in task thread |
429
+ | `deskfree_claim_evaluation` | Claim a pending evaluation |
430
+ | `deskfree_submit_evaluation` | Submit evaluation with globalWoW + initiative outputs |
484
431
 
485
432
  ### Worker (7 tools — sub-agents only)
486
433
 
487
- `deskfree_update_file`, `deskfree_create_file`, `deskfree_complete_task`, `deskfree_send_message`, `deskfree_suggest_tasks`, `deskfree_claim_evaluation`, `deskfree_submit_evaluation`
488
-
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.
490
-
491
- ---
492
-
493
- ## File Best Practices
494
-
495
- ### Markdown files
496
-
497
- Structure as **standalone markdown documents:**
498
-
499
- ```markdown
500
- # Document Title
501
-
502
- ## Summary
503
- Brief overview of what this document covers.
504
-
505
- ## Key Findings / Content
506
- - Main points with supporting detail
507
-
508
- ## Details
509
- Detailed analysis, implementation notes, etc.
510
-
511
- ## Next Steps (if applicable)
512
- - Follow-up actions, outstanding questions
513
- ```
514
-
515
- ### HTML files
516
-
517
- Pass a complete, self-contained HTML document (or fragment — a wrapper `<html>` is injected automatically):
518
-
519
- ```html
520
- <h1>Report Title</h1>
521
- <table>
522
- <tr><th>Metric</th><th>Value</th></tr>
523
- <tr><td>Users</td><td>1,234</td></tr>
524
- </table>
525
- ```
526
-
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.
434
+ `deskfree_update_file`, `deskfree_create_file`, `deskfree_complete_task`, `deskfree_send_message`, `deskfree_propose`, `deskfree_claim_evaluation`, `deskfree_submit_evaluation`
528
435
 
529
436
  ---
530
437
 
@@ -534,14 +441,8 @@ Pass a complete, self-contained HTML document (or fragment — a wrapper `<html>
534
441
  |---|---|---|
535
442
  | `deskfree_state` returns empty | No tasks exist | Create a task if appropriate. **Do NOT retry in a loop.** |
536
443
  | 404 on `deskfree_start_task` | Task not `bot` or doesn't exist | Another bot claimed it. Call `deskfree_state`, try a different task. |
537
- | 404 on `deskfree_complete_task` | Task not `bot` (is_working=true) | Already completed or released. Check state. |
538
- | 409 on `deskfree_start_task` | Race condition another bot claimed it | Call `deskfree_state`, pick a different task. |
539
- | 401 Unauthorized | Bot token invalid or expired | Check channel configuration. Do not retry. |
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. |
542
- | `deskfree_claim_evaluation` returns null | Already claimed by another process | No action needed. Move to next pending evaluation. |
543
- | Sub-agent spawn fails | Resource limits, config error | Complete task as `blocked` with explanation. Do not leave in `bot` (is_working=true). |
544
- | WebSocket disconnected | Network issue | Plugin auto-reconnects with backoff. Messages fall back to HTTP polling. No action needed. |
444
+ | 409 on `deskfree_start_task` | Race condition | Call `deskfree_state`, pick a different task. |
445
+ | 401 Unauthorized | Bot token invalid | Check channel configuration. Do not retry. |
545
446
 
546
447
  ### Recovery Pattern
547
448
 
@@ -551,174 +452,31 @@ If anything goes wrong mid-task:
551
452
  3. Complete as `blocked` (`deskfree_complete_task` with outcome `blocked`)
552
453
  4. **Never leave a task stranded in `bot` (is_working=true)**
553
454
 
554
- ### Edge Cases & Advanced Scenarios
555
-
556
- | Scenario | Guidance |
557
- |---|---|
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. |
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. |
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. |
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. |
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. |
566
-
567
- ### Troubleshooting Common Issues
568
-
569
- #### "Task not found" (404) Errors
570
- - **Cause**: Task was claimed by another bot, completed, or deleted
571
- - **Solution**: Always call `deskfree_state` first to see available tasks
572
- - **Prevention**: Check task status in state before attempting operations
573
-
574
- #### Auto-threading Not Working
575
- - **Cause**: No active task context, or called `deskfree_complete_task` already
576
- - **Solution**: Pass explicit `taskId` to `deskfree_send_message`
577
- - **Debug**: Check that `deskfree_start_task` was called and returned successfully
578
-
579
- #### File Updates Failing
580
- - **Common causes**:
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)
583
- - Network timeout → retry once, then complete as blocked if persistent
584
- - **Solution**: Validate content before sending, handle network errors gracefully
585
-
586
- #### Sub-agent Spawn Failures
587
- - **Common causes**: Resource limits, configuration errors, invalid task context
588
- - **Immediate action**: Main session should resume the task directly
589
- - **Recovery**: Complete task as `blocked` only if you cannot resume the work yourself
590
-
591
- #### Ways of Working Updates Not Applying
592
- - **Cause**: Another evaluation process updated it first, or `hasChanges=false` was sent
593
- - **Check**: Ensure `hasChanges=true` and `updatedContent` is provided when you intend to update
594
- - **Conflict resolution**: If content conflicts occur, the last successful submission wins
595
-
596
- #### "State returns empty" Issues
597
- - **Not an error**: Empty state means no tasks exist - this is normal
598
- - **Action**: Create a task if you have work to do, otherwise return `HEARTBEAT_OK`
599
- - **Don't**: Retry `deskfree_state` in a loop - it's not broken
600
-
601
455
  ---
602
456
 
603
- ## Common Workflow Patterns
604
-
605
- ### Pattern 1: Research & Analysis with File Output
606
-
607
- ```
608
- Main Session:
609
- 1. deskfree_state() → check workspace + files
610
- 2. deskfree_suggest_tasks([{
611
- title: "Research competitor HumanLayer",
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
618
-
619
- Sub-agent:
620
- 1. deskfree_update_file(fileId, "# HumanLayer Analysis\n\n## Summary\n...") → initial outline
621
- 2. [research work...]
622
- 3. deskfree_update_file(fileId, "...") → interim findings
623
- 4. [more research...]
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")
626
- ```
627
-
628
- ### Pattern 2: Quick Fix (Main Session, No File)
629
-
630
- ```
631
- 1. deskfree_state() → check current state
632
- 2. deskfree_suggest_tasks([{
633
- title: "Fix broken login endpoint",
634
- instructions: "Apply hotfix for 500 error in /auth/login"
635
- }])
636
- 3. [human approves task]
637
- 4. deskfree_start_task(taskId) → claim the work
638
- 5. [fix the code...]
639
- 6. deskfree_complete_task(taskId, "done", summary: "Fixed null pointer in auth middleware, deployed to staging")
640
- ```
641
-
642
- ### Pattern 3: Blocked Task with Human Input
643
-
644
- ```
645
- 1-5. [normal task startup...]
646
- 6. [encounter blocker - need API key]
647
- 7. deskfree_send_message("Need the new Stripe API key to complete this integration. Where can I find it?")
648
- 8. deskfree_update_file(fileId, "...") → save partial progress if task has a file
649
- 9. deskfree_complete_task(taskId, "blocked") → hand off to human
650
- ```
651
-
652
- ### Pattern 4: Ways of Working Evaluation
653
-
654
- ```
655
- Heartbeat check:
656
- 1. deskfree_state() → shows pendingEvaluations: [{taskId: "abc", ...}]
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...]
659
- 4. deskfree_submit_evaluation({
660
- taskId: "abc",
661
- reasoning: "Found a new pattern for API error handling...",
662
- globalWoW: {
663
- hasChanges: true,
664
- updatedContent: "# Ways of Working\n\n## API Integration\n[new section]..."
665
- },
666
- initiative: { hasChanges: false }
667
- })
668
- ```
669
-
670
457
  ## Task Title Examples
671
458
 
672
- **Good (short, scannable, action-oriented):**
673
- - "Research competitor HumanLayer"
674
- - "Deploy staging hotfix"
675
- - "Write API docs for /users endpoint"
676
- - "Debug memory leak in worker process"
677
- - "Review Q3 performance metrics"
459
+ **Good:** "Research competitor HumanLayer", "Fix auth timeout in Safari", "Write API docs for /users"
678
460
 
679
- **Bad (verbose, unclear):**
680
- - "Do some research on a competitor called HumanLayer and write up findings"
681
- - "There's a bug in staging that needs fixing"
682
- - "I need to check on some performance stuff for the quarterly review"
461
+ **Bad:** "Do some research on a competitor", "There's a bug that needs fixing"
683
462
 
684
463
  ---
685
464
 
686
- ## Best Practices & Anti-Patterns
465
+ ## Best Practices
687
466
 
688
467
  ### ✅ Do This
689
-
690
- | Practice | Rationale | Example |
691
- |---|---|---|
692
- | **Update file early and often** | Shows progress, survives interruptions | Update outline immediately, add sections as you work |
693
- | **Use descriptive commit-style titles** | Easy to scan, actionable | "Fix authentication timeout in Safari" |
694
- | **Send progress messages for long tasks** | Humans know you're working | "25% complete - analyzed 3 of 12 competitor features" |
695
- | **Complete blocked tasks with explanation** | Clear handoff to humans | Message: "Need AWS credentials", then complete as blocked |
696
- | **Start with template file structure** | Consistent structure, never empty | Use the markdown template every time |
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" |
468
+ - Update files early and often — shows progress, survives interruptions
469
+ - Use descriptive commit-style titles
470
+ - Send progress messages for long tasks
471
+ - Provide meaningful summary on done
472
+ - Include substeps for multi-step tasks gives human granular control
699
473
 
700
474
  ### ❌ Don't Do This
701
-
702
- | Anti-Pattern | Why It's Bad | Instead |
703
- |---|---|---|
704
- | **Leave tasks in `bot` (is_working=true)** | Blocks the workspace indefinitely | Always complete as `done` or `blocked` |
705
- | **Retry `deskfree_state` in loops** | Wastes resources, indicates logic error | Call once per decision point |
706
- | **Start multiple sub-agents per task** | Creates confusion, race conditions | One sub-agent per task maximum |
707
- | **Update file only at the end** | Progress lost if interrupted | Update incrementally throughout work |
708
- | **Ignore 409 conflicts on task claims** | Causes infinite retry loops | Accept conflict, check state, pick different task |
709
- | **Create tasks without clear actions** | Unclear what needs doing | Use imperative verbs: "research X", "fix Y", "analyze Z" |
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 |
712
-
713
- ### Common Gotchas
714
-
715
- - **Auto-threading stops after `deskfree_complete_task`** → Pass explicit `taskId` for post-completion messages
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
718
- - **Ways of working updates require `hasChanges=true`** → Explicitly set flag when submitting changes
719
- - **Task titles are visible to humans** → Make them professional and descriptive
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
475
+ - Leave tasks in `bot` (is_working=true)
476
+ - Retry `deskfree_state` in loops
477
+ - Start multiple sub-agents per task
478
+ - Update file only at the end
479
+ - Skip the context field in proposals explain your reasoning
722
480
 
723
481
  ## Human Review Outcomes
724
482