kanbango 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/planv2.md ADDED
@@ -0,0 +1,307 @@
1
+ # Plan V2
2
+
3
+ ## Goal
4
+
5
+ Evolve `markdown-kanban` into an LLM-first task system with:
6
+
7
+ - rich task and subtask descriptions
8
+ - minimal token usage in MCP flows
9
+ - a minimal MCP surface area
10
+ - structured, actionable error messages
11
+ - partial reads so agents only fetch the task slices they need
12
+
13
+ ## Core Decision
14
+
15
+ Use JSON as the canonical task storage format.
16
+
17
+ Reasoning:
18
+
19
+ - Markdown is human-friendly, but becomes fragile once tasks need nested rich fields.
20
+ - JSON is easier to validate, partially read, partially update, and return through MCP.
21
+ - Token savings will come primarily from response shaping in MCP, not from the on-disk format itself.
22
+
23
+ ## Token Strategy
24
+
25
+ The main token optimization should happen in MCP responses, not by compressing field names or over-optimizing file syntax.
26
+
27
+ Avoid:
28
+
29
+ - always returning the full task
30
+ - adding many narrow MCP methods
31
+ - cryptic short keys like `sp`, `ac`, `d`
32
+
33
+ Prefer:
34
+
35
+ - one read tool with multiple views
36
+ - explicit field selection
37
+ - compact summary responses by default
38
+ - structured update responses with configurable return payloads
39
+
40
+ ## Recommended Task Schema
41
+
42
+ ```json
43
+ {
44
+ "id": "PI-014-google-calendar",
45
+ "title": "Google Calendar Integration",
46
+ "column": "active",
47
+ "epic_group": "Phase 1",
48
+ "created": "2026-07-07",
49
+ "description": "High-level context and implementation plan in markdown.",
50
+ "specs": "Technical constraints, APIs, data model, edge cases.",
51
+ "acceptance_criteria": [
52
+ "User can connect Google account",
53
+ "Events sync in both directions",
54
+ "Sync conflicts are logged"
55
+ ],
56
+ "subtasks": [
57
+ {
58
+ "id": "st-1",
59
+ "text": "Implement OAuth flow",
60
+ "done": false,
61
+ "description": "Use PKCE, store refresh token encrypted."
62
+ }
63
+ ],
64
+ "notes": "Optional freeform notes"
65
+ }
66
+ ```
67
+
68
+ ## Field Semantics
69
+
70
+ - `description`: the main context, why the work exists, and the implementation plan
71
+ - `specs`: concrete technical facts, constraints, APIs, data shape, edge cases
72
+ - `acceptance_criteria`: what must be true for the task to count as done
73
+ - `subtasks[].description`: local execution detail for a subtask
74
+ - `notes`: optional freeform leftovers, references, or observations
75
+
76
+ This split is useful for both humans and agents.
77
+
78
+ ## MCP Surface
79
+
80
+ Keep the MCP surface at 3 tools:
81
+
82
+ - `kanban_read`
83
+ - `kanban_create`
84
+ - `kanban_update`
85
+
86
+ Do not add separate tools like:
87
+
88
+ - `kanban_read_specs`
89
+ - `kanban_read_ac`
90
+ - `kanban_read_subtasks`
91
+
92
+ That would increase surface area without meaningfully reducing tokens.
93
+
94
+ ## kanban_read Design
95
+
96
+ Add support for response shaping.
97
+
98
+ ### Option A: view presets
99
+
100
+ ```json
101
+ {
102
+ "operation": "show",
103
+ "task_id": "PI-014-google-calendar",
104
+ "view": "planning"
105
+ }
106
+ ```
107
+
108
+ Suggested views:
109
+
110
+ - `summary`: id, title, column, epic, created, progress counts
111
+ - `planning`: summary + description + specs + acceptance_criteria
112
+ - `execution`: planning + subtasks
113
+ - `full`: everything including notes and metadata
114
+
115
+ ### Option B: explicit fields
116
+
117
+ ```json
118
+ {
119
+ "operation": "show",
120
+ "task_id": "PI-014-google-calendar",
121
+ "fields": ["title", "description", "acceptance_criteria"]
122
+ }
123
+ ```
124
+
125
+ Recommendation: support both.
126
+
127
+ - `view` is simple and ergonomic
128
+ - `fields` is precise for advanced agents
129
+
130
+ If both are supplied, `fields` should win.
131
+
132
+ ## kanban_create Design
133
+
134
+ Allow rich fields during creation, but keep minimal creation possible.
135
+
136
+ Minimal create:
137
+
138
+ ```json
139
+ {
140
+ "title": "Add user authentication"
141
+ }
142
+ ```
143
+
144
+ Full create:
145
+
146
+ ```json
147
+ {
148
+ "title": "Add user authentication",
149
+ "col": "planned",
150
+ "epic": "Auth",
151
+ "description": "Implement auth flow and session model.",
152
+ "specs": "Use OAuth + session cookies.",
153
+ "acceptance_criteria": [
154
+ "User can sign in",
155
+ "Session persists after refresh"
156
+ ],
157
+ "subtasks": [
158
+ {
159
+ "text": "Create auth routes",
160
+ "description": "Add login and callback handlers."
161
+ }
162
+ ],
163
+ "notes": "Optional"
164
+ }
165
+ ```
166
+
167
+ ## kanban_update Design
168
+
169
+ Use a patch-like payload and let callers control the returned payload size.
170
+
171
+ ```json
172
+ {
173
+ "operation": "update",
174
+ "task_id": "PI-014-google-calendar",
175
+ "patch": {
176
+ "description": "Updated implementation plan...",
177
+ "acceptance_criteria": [
178
+ "OAuth works",
179
+ "Tokens refresh correctly"
180
+ ]
181
+ },
182
+ "return": "summary"
183
+ }
184
+ ```
185
+
186
+ Suggested `return` values:
187
+
188
+ - `none`
189
+ - `summary`
190
+ - `full`
191
+
192
+ Default should be `summary`, not `full`.
193
+
194
+ This avoids sending large descriptions back after every small edit.
195
+
196
+ ## Read Strategy For Agents
197
+
198
+ Agents should not always read the whole task.
199
+
200
+ Recommended workflows:
201
+
202
+ ### Triage
203
+
204
+ Use `summary` only.
205
+
206
+ ### Planning
207
+
208
+ Read:
209
+
210
+ - `description`
211
+ - `specs`
212
+ - `acceptance_criteria`
213
+
214
+ ### Implementation
215
+
216
+ Read:
217
+
218
+ - planning fields
219
+ - subtasks
220
+
221
+ ### Verification
222
+
223
+ Read:
224
+
225
+ - `acceptance_criteria`
226
+ - progress / status fields
227
+
228
+ ### Backlog cleanup
229
+
230
+ Read:
231
+
232
+ - summary only
233
+
234
+ This is not a bad idea. It is the correct way to reduce token use while staying useful.
235
+
236
+ ## Error Design
237
+
238
+ Errors should be structured JSON, not a plain string.
239
+
240
+ Recommended shape:
241
+
242
+ ```json
243
+ {
244
+ "error": {
245
+ "code": "TASK_NOT_FOUND",
246
+ "message": "Task PI-014-google-calendar was not found",
247
+ "hint": "Call kanban_read with operation=list to discover valid task ids",
248
+ "details": {
249
+ "task_id": "PI-014-google-calendar"
250
+ },
251
+ "retryable": false
252
+ }
253
+ }
254
+ ```
255
+
256
+ Suggested error codes:
257
+
258
+ - `TASK_NOT_FOUND`
259
+ - `INVALID_COLUMN`
260
+ - `INVALID_SUBTASK_INDEX`
261
+ - `VALIDATION_ERROR`
262
+ - `MISSING_REQUIRED_FIELD`
263
+ - `TASK_CONFLICT`
264
+ - `PARSE_ERROR`
265
+
266
+ Good errors should help an agent recover without extra back-and-forth.
267
+
268
+ ## Migration Strategy
269
+
270
+ Existing Markdown files are already persisted data, so backward compatibility matters during migration.
271
+
272
+ Recommended migration plan:
273
+
274
+ 1. Add JSON schema support.
275
+ 2. Support reading both `.md` and `.json` task files during transition.
276
+ 3. Write new tasks as JSON.
277
+ 4. Add an optional migration command later if needed.
278
+ 5. Once the repo is clean and the migration is accepted, decide whether to keep Markdown read support permanently.
279
+
280
+ ## Suggested Defaults
281
+
282
+ - Canonical storage: JSON
283
+ - MCP tools: keep exactly 3
284
+ - Default read view: `summary` for lists, `planning` or `summary` for show depending on client choice
285
+ - Default update return payload: `summary`
286
+ - Rich task fields: `description`, `specs`, `acceptance_criteria`, `notes`
287
+ - Rich subtask fields: `text`, `done`, `description`
288
+
289
+ ## Non-Goals
290
+
291
+ Avoid for now:
292
+
293
+ - many specialized MCP methods
294
+ - abbreviated schema keys just to save a few tokens
295
+ - always rendering HTML for descriptions
296
+ - over-structuring subtasks with too many fields
297
+
298
+ ## Next Implementation Steps
299
+
300
+ 1. Define the JSON schema in code and docs.
301
+ 2. Update `kanban.js` to read and write JSON tasks.
302
+ 3. Add transitional support for reading existing Markdown tasks.
303
+ 4. Extend `kanban_read` with `view` and `fields`.
304
+ 5. Extend `kanban_create` and `kanban_update` with rich fields and `patch` semantics.
305
+ 6. Add structured MCP error responses with codes and hints.
306
+ 7. Update the web GUI to edit `description`, `specs`, `acceptance_criteria`, and subtask descriptions.
307
+ 8. Add tests for partial reads, structured errors, and Markdown-to-JSON compatibility.
package/tests/run.js ADDED
@@ -0,0 +1,19 @@
1
+ const { spawnSync } = require('child_process');
2
+ const path = require('path');
3
+
4
+ function runNode(scriptPath, args, label) {
5
+ const fullPath = path.join(process.cwd(), scriptPath);
6
+ const result = spawnSync(process.execPath, [fullPath, ...(args || [])], {
7
+ stdio: 'inherit',
8
+ });
9
+ if (result.status !== 0) {
10
+ console.error(`✗ ${label} failed`);
11
+ process.exit(result.status || 1);
12
+ }
13
+ console.log(`✓ ${label}`);
14
+ }
15
+
16
+ runNode(path.join('bin', 'kanban.js'), ['list', '--json'], 'CLI list');
17
+ runNode(path.join('tests', 'update-tasks.test.js'), [], 'Update tasks test');
18
+ runNode(path.join('tests', 'read-views.test.js'), [], 'Read views test');
19
+ runNode(path.join('tests', 'mcp-server.test.js'), [], 'MCP server test');