intent-engine 0.6.3

A command-line database service for tracking strategic intent, tasks, and events
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
# Intent-Engine: Claude Integration Guide

**Version**: 0.6.3
**Target**: Claude Code, Claude Desktop, and AI assistants via MCP

---

## πŸ“– Authoritative Specification

> **IMPORTANT**: This guide is a practical summary derived from the authoritative specification.
>
> **Single Source of Truth**: `docs/spec-03-interface-current.md`
>
> The spec-03-interface-current.md document is the **foundational blueprint** that defines:
> - βœ… All CLI command signatures and behaviors
> - βœ… All MCP tool definitions and interfaces
> - βœ… Data models and their exact field names
> - βœ… Atomic operation semantics
> - βœ… Output format specifications
> - βœ… Interface stability guarantees (SemVer)
>
> **In case of any conflict or ambiguity**, the spec-03-interface-current.md takes precedence.
>
> This CLAUDE.md guide provides practical usage patterns and integration tips,
> but should always align with the authoritative specification.

---

## πŸ€– What is Intent-Engine?

Intent-Engine is your **external long-term memory** for strategic task management. Think of it as:

- **Your Task Brain**: Persistent, hierarchical task tracking across sessions
- **Context Keeper**: Full history of decisions, blockers, and milestones
- **Smart Assistant**: Recommends next tasks based on focus and priority

---

## 🎯 Core Concept: Focus-Driven Workflow

> **Technical details**: See [AGENT.md]AGENT.md#focus-driven-operations for data models and atomic operation semantics

Intent-Engine works like your brain - **one focused task at a time**:

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Workspace State                     β”‚
β”‚  current_task_id: 42                 β”‚  ← "What am I working on?"
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
           β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Task 42   β”‚  ← The Focused Task
    β”‚  "Impl auth"β”‚
    β””β”€β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”˜
         β”‚   β”‚
    β”Œβ”€β”€β”€β”€β–Όβ” β”Œβ–Όβ”€β”€β”€β”€β”
    β”‚T43  β”‚ β”‚T44  β”‚  ← Subtasks (depth-first priority)
    β”‚JWT  β”‚ β”‚OAuthβ”‚
    β””β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”˜
```

---

## πŸ› οΈ Essential MCP Tools

> **For detailed technical specifications**, see [AGENT.md]AGENT.md#essential-commands

### Core Workflow Tools

| Tool | Purpose | Key Parameters |
|------|---------|----------------|
| `task_start` | Begin working (sets focus) | `task_id`, `with_events` |
| `task_done` | Complete current task | (no parameters) |
| `task_switch` | Change focus to another task | `task_id` |
| `task_pick_next` | Get smart recommendation | (no parameters) |

### Planning Tools

| Tool | Purpose | Key Parameters | Use Case |
|------|---------|----------------|----------|
| `plan` ⭐ | Declarative batch task creation | `tasks: TaskTree[]` | **Batch operations**, hierarchies, dependencies |
| `task_add` | Create single task (imperative) | `name`, `spec`, `priority` | **Single tasks**, interactive CLI |
| `task_spawn_subtask` | Create and focus on subtask | `name`, `spec` | **Dynamic workflows**, interactive |
| `task_add_dependency` | Add single dependency | `blocked_task_id`, `blocking_task_id` | **Single dependencies**, precise control |

**When to use `plan`**:
- βœ… Creating multiple related tasks at once
- βœ… Complex task hierarchies (parent/child relationships)
- βœ… Tasks with dependencies (automatic cycle detection)
- βœ… Idempotent operations (safe to run multiple times)
- βœ… Importing from external systems (YAML/JSON)

**When to use traditional tools** (`task_add`, etc.):
- βœ… Single task creation
- βœ… Interactive CLI sessions
- βœ… Fine-grained control over each step
- βœ… Simple, straightforward operations

> πŸ’‘ **See [PLAN_INTERFACE_GUIDE.md]docs/PLAN_INTERFACE_GUIDE.md for detailed usage patterns and migration examples**

### Query Tools

| Tool | Purpose | Key Parameters |
|------|---------|----------------|
| `task_list` | Filter by status/parent | `status`, `parent` |

### Search and Discovery

| Tool | Purpose | Key Parameters |
|------|---------|----------------|
| `search` | Search tasks AND events | `query`, `include_tasks`, `include_events` |

**Search capabilities**:
- Supports FTS5 syntax: `AND`, `OR`, `NOT`, `"phrases"`
- Returns mixed results with task ancestry for events
- Example: `search(query: "JWT AND authentication")`

### Event Tracking

| Tool | Purpose | Key Parameters |
|------|---------|----------------|
| `event_add` | Record decision/blocker/note | `type`, `data`, `task_id?` |
| `event_list` | Query events with filters | `task_id?`, `type?`, `since?`, `limit?` |

**Event types**: `decision`, `blocker`, `milestone`, `note`

**Filtering** (new in v0.2):
- By type: `event_list(type: "decision")`
- By time: `event_list(since: "7d")`
- Combined: `event_list(type: "blocker", since: "24h")`

### Workspace and Reporting

| Tool | Purpose | Key Parameters |
|------|---------|----------------|
| `current_task_get` | Get focused task | (no parameters) |
| `report_generate` | Generate summary report | `since`, `summary_only` |

### New Features (v0.2+)

**Priority Levels**: Tasks support `critical`, `high`, `medium`, `low`
**Dependencies**: Use `task_add_dependency` to model prerequisites
**Event Filtering**: Filter by type, time range, or both
**Unified Search**: Search across both tasks and events

---

## 🎨 Typical Usage Patterns

### Pattern 1: Starting Fresh
```
User: "Help me implement user authentication"

You:
1. task_add(name: "Implement user authentication", spec: "...")
2. task_start(task_id: 42, with_events: true)
3. Review the context and begin work
```

### Pattern 2: Breaking Down Work
```
User: "Let's add authentication"

You:
1. task_start(task_id: 42)
2. Analyze the spec
3. task_spawn_subtask(name: "Design JWT schema")
   β†’ Now subtask is focused
4. Work on subtask
5. task_done() when subtask complete
6. task_pick_next() β†’ Recommends next subtask
```

### Pattern 3: Recording Decisions
```
While implementing JWT:

You: "I chose HS256 algorithm because..."
     event_add(type: "decision", data: "Chose HS256 because...")
```

### Pattern 4: Resuming Work
```
User: "Let's continue with authentication"

You:
1. search(query: "authentication")
   β†’ Find task ID 42 and related events
2. task_start(task_id: 42, with_events: true)
   β†’ Get full context with decision history
3. Review events_summary
4. Continue from where you left off
```

### Pattern 5: Switching Context
```
User: "Let's pause auth and fix that bug"

You:
1. event_add(type: "note", data: "Pausing to handle bug #123")
2. task_switch(task_id: 67)  # Bug fix task
   β†’ Pauses auth, starts bug fix
3. Fix the bug
4. task_done()
5. task_switch(task_id: 42)  # Back to auth
```

### Pattern 6: Working with Dependencies (new in v0.2)
```
User: "Implement the API client, but it depends on authentication being done first"

You:
1. task_list(status: "doing")
   β†’ Find current auth task (ID 42)
2. task_add(name: "Implement API client", priority: "high")
   β†’ Creates task ID 50
3. task_add_dependency(blocked_task_id: 50, blocking_task_id: 42)
   β†’ API client now depends on auth completion
4. Continue working on task 42 (auth)
5. When task 42 is done, task_pick_next() will recommend task 50
```

### Pattern 7: Smart Event Filtering (new in v0.2)
```
User: "What decisions did we make on the authentication task?"

You:
1. search(query: "authentication")
   β†’ Find task ID 42 and decision events
2. event_list(task_id: 42, type: "decision")
   β†’ Get only decision events (efficient!)
3. Review and summarize the decisions

Alternative - Recent blockers:
event_list(task_id: 42, type: "blocker", since: "7d")
β†’ Get blockers from last week only
```

---

## πŸ’‘ Best Practices

### 1. Always Start Tasks
```
❌ DON'T: task_done() without starting
βœ… DO:    task_start(42) then task_done()
```

### 2. Use Hierarchical Decomposition
```
❌ DON'T: Flat list of 10 implementation steps
βœ… DO:    Parent task with 3-4 logical subtasks
```

### 3. Record Important Decisions
```
❌ DON'T: Just implement without context
βœ… DO:    event_add() for key design choices
```

### 4. Leverage with_events
```
❌ DON'T: Start task without history
βœ… DO:    task_start(task_id, with_events: true)
```

### 5. Let pick-next Guide You
```
❌ DON'T: Manually search for next task
βœ… DO:    task_pick_next() for smart recommendation
```

---

## ⚠️ Common Mistakes

### Mistake 1: Passing ID to task_done
```
❌ task_done(task_id: 42)  # WRONG - no parameters

βœ… task_start(42)           # Set focus first
   task_done()              # Then complete
```

### Mistake 2: Using list for text search
```
❌ task_list(status: "JWT")  # WRONG - list is metadata only (status, parent)

βœ… search(query: "JWT")  # Correct - searches tasks and events
```

### Mistake 3: Not checking current task
```
❌ Assume no task is focused
   task_done()  # ERROR

βœ… current_task_get()  # Check first
   If focused: task_done()
   If not: task_start() first
```

### Mistake 4: Trying to complete parent with incomplete children
```
❌ task_start(42)        # Parent
   task_done()           # ERROR: has incomplete subtasks

βœ… task_start(42)        # Parent
   task_spawn_subtask()  # Child 1
   task_done()           # Complete child 1
   task_spawn_subtask()  # Child 2
   task_done()           # Complete child 2
   task_switch(42)       # Back to parent
   task_done()           # Now works - all children done
```

---

## 🎯 When to Use Intent-Engine

### βœ… GOOD Use Cases

1. **Multi-session work**
   - "Let's implement authentication" (will take multiple conversations)
   - Complex features that span days

2. **Hierarchical problems**
   - "Design and implement API endpoints" (has multiple sub-steps)
   - Need to break down large tasks

3. **Decision tracking**
   - "Why did we choose approach X?" (record decisions)
   - Project retrospectives

4. **Context recovery**
   - "What were we working on?" (resume after break)
   - "What decisions have we made?" (review history)

### ❌ NOT Ideal For

1. **Single-step tasks**
   - "Fix this typo" (too trivial)
   - Quick one-liners

2. **Exploratory questions**
   - "What is JWT?" (informational only)
   - No actual work being tracked

3. **Temporary context**
   - Current conversation already has context
   - Won't need this information later

---

## πŸ”„ Integration Workflow

### With Claude Code

When user says:
- "Help me implement X" β†’ Create task, track work
- "What's next?" β†’ Use pick-next
- "Why did we...?" β†’ Check events
- "Continue authentication" β†’ Start task, load context

### Task Lifecycle

```
User Request
    β”‚
    β–Ό
task_add ──────────────┐
    β”‚                  β”‚ (strategic planning)
    β–Ό                  β”‚
task_start ──────────────
    β”‚                  β”‚ (active work)
    β”œβ”€β”€ event_add      β”‚
    β”œβ”€β”€ task_spawn_subtask
    β”‚                  β”‚
    β–Ό                  β”‚
task_done β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

---

## 🧠 Mental Model

Think of Intent-Engine as:

1. **Your Notebook** - Persistent task list across sessions
2. **Your Focus Ring** - One task at a time (current_task_id)
3. **Your Memory** - Decision history in events
4. **Your Guide** - Smart recommendations (pick-next)
5. **Your Tree** - Hierarchical problem breakdown

---

## πŸ“š Key References

- **Interface Spec** (authoritative): `docs/spec-03-interface-current.md`
- **AI Agent Guide** (technical details): `AGENT.md`
- **MCP Schema**: `mcp-server.json`
- **Setup Guide**: `docs/*/integration/mcp-server.md`

> For data models, output formats, and command specifications, see [AGENT.md]AGENT.md

---

## πŸŽ“ Philosophy

Intent-Engine is designed for **strategic intent tracking**, not tactical todo lists:

- **What + Why** over "How"
- **Persistent context** over ephemeral notes
- **Hierarchical thinking** over flat lists
- **Decision history** over task status
- **Focus** over multitasking

---

**Last Updated**: 2025-11-17
**Spec Version**: 0.6.3
**MCP Tools**: 14 available (search tool for unified search)
**Status**: Experimental (Pre-1.0)