kanbango 2.5.0 → 3.1.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/.ai/lessons.jsonl CHANGED
@@ -0,0 +1,4 @@
1
+ {"id":"260729-3h4","ts":"2026-07-29","scope":"proj","tags":["tests","mcp","cli","review"],"rule":"DO Add automated tests for every new public CLI/MCP workflow before shipping","when":"api-review","sev":2,"hits":1}
2
+ {"id":"260729-1ur","ts":"2026-07-29","scope":"proj","tags":["javascript","objects"],"rule":"DON'T Use empty object fallbacks in spreads like `...(obj || {})` since spreading falsy is safe","when":"object spread","sev":2,"hits":1}
3
+ {"id":"260729-5eo","ts":"2026-07-29","scope":"proj","tags":["processes","mcp","ownership"],"rule":"DO Track process ownership before stopping or cleaning up discovered services","when":"gui-process management","sev":2,"hits":1}
4
+ {"id":"260729-1ch","ts":"2026-07-29","scope":"proj","tags":["gui","process","mcp"],"rule":"DO GUI/MCP stop must only SIGTERM processes spawned by the current process; treat port-file PIDs as external_running","when":"gui-process management","sev":2,"hits":1}
@@ -1 +1 @@
1
- {"ts":"2026-07-29T09:29:19.070Z","sessionID":"ses_05beb2173ffe1rCJQhZBUHuLgs","added":[],"bumped":[],"error":"llm-parse-fallback"}
1
+ {"ts":"2026-07-29T10:38:42.184Z","sessionID":"ses_052c1be3fffeNPoV7VO6z40X2I","added":["260729-1ch"],"bumped":[]}
package/AGENTS.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  This document provides build commands, testing procedures, and code style guidelines for working with the kanbango codebase.
4
4
 
5
+ ## Kanbango MCP — token rules (when using this board)
6
+
7
+ Source of truth: `agent-playbook.js` (also MCP tool descriptions + `kanban_read` `operation=help`).
8
+
9
+ - hierarchy: epic (context) → task (work+plan) → subtasks (steps)
10
+ - list: `col` filter, `view=summary`; keep `task_id`s; no full-board re-list after every write
11
+ - list_epics / show_epic for initiatives; filter tasks with `epic=E001`
12
+ - show: `view=execution` while coding; `full` only if needed
13
+ - epic_create with description/goals; create tasks with `epic=E001` (prefer id)
14
+ - create once with `description`, `specs`, `in_scope`, `out_of_scope`, `acceptance_criteria`
15
+ - move/update: `return=none`; subtasks = full array replace (no toggle)
16
+ - non-trivial work: `plan_create` → `plan_advance` → `plan_evidence` (real tests, truncated logs) → `plan_done`
17
+ - gui: `status` before `start`; `stop` only owned; `external_running` = do not kill
18
+
5
19
  ## Build & Development Commands
6
20
 
7
21
  ### Available Scripts
package/CHANGELOG.md CHANGED
@@ -5,6 +5,60 @@ All notable changes to kanbango will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.1.0] - 2026-07-30
9
+
10
+ ### Added
11
+ - First-class epic containers under `backlog/epics/E00N.json` (description, goals, in/out scope, notes)
12
+ - Task field `epic_id` with denormalized `epic_group` title for lists/GUI
13
+ - Derived epic status/progress from child task columns (no epic board column)
14
+ - MCP: `list_epics`, `show_epic`, `epic_create`, `epic_update`
15
+ - CLI: `kanban epic list|show|add|update`
16
+ - HTTP: `GET/POST /api/epics` for real epics; `POST /api/tasks` for tasks (legacy `/api/epics` + `column` still creates tasks)
17
+ - Auto-migration of legacy `epic_group` string labels into epic entities
18
+ - GUI swimlanes group by `epic_id` and show epic context
19
+ - Regression tests in `tests/epics.test.js`
20
+
21
+ ### Changed
22
+ - Hierarchy documented for agents: epic → task → subtasks
23
+ - Task summary view includes `epic_id`
24
+ - Agent playbook includes epic discovery/create rules
25
+
26
+ ## [3.0.2] - 2026-07-29
27
+
28
+ ### Added
29
+ - `agent-playbook.js` — single source of truth for agent token rules
30
+ - `kanban_read` `operation=help` returns the playbook (no board I/O)
31
+ - Test that `tools/list` descriptions match the playbook module
32
+
33
+ ### Changed
34
+ - MCP tool descriptions are loaded from `agent-playbook.js` (not duplicated prose)
35
+ - `LLM_AGENTS.md` clarified as human setup docs; agents rely on tool descriptions
36
+
37
+ ## [3.0.1] - 2026-07-29
38
+
39
+ ### Changed
40
+ - MCP tool descriptions encode a token-efficient agent playbook (cheap list/show, fat create once, `return=none`, plan_* only when needed, GUI ownership)
41
+ - `LLM_AGENTS.md`, `AGENTS.md`, and `README.md` document the same rules for project-scoped agents
42
+
43
+ ## [3.0.0] - 2026-07-29
44
+
45
+ ### Breaking
46
+ - New task IDs are zero-padded numeric strings (`001`), not `PI-001-slug`
47
+ - MCP/CLI `toggle` removed; update the full `subtasks` list via `update`
48
+ - Legacy task field alias `tasks` removed; use `subtasks` only
49
+ - `kanban_gui` `stop` only stops a GUI **spawned by the current MCP process**. An external GUI returns `status: "external_running"` and is **not** sent SIGTERM (PID-reuse safety)
50
+ - `kanban_gui` `status` may return `running` (owned), `external_running` (discovered), or `not_running`
51
+
52
+ ### Added
53
+ - Accepted-plan workflow: `plan.js` + CLI `kanban plan <action> --json` + MCP `plan_*` actions on `kanban_manage`
54
+ - `gui-registry.js` — GUI port file, preferred port, discover helpers (extracted from `kanban.js`)
55
+ - Regression tests for plan workflow and GUI process ownership
56
+
57
+ ### Changed
58
+ - Create field policy: only `title` is hard-required; `description`, `specs`, `in_scope`, `out_of_scope`, and `acceptance_criteria` are strongly recommended
59
+ - MCP `kanban_manage` create/plan_create returns `warnings` + `missing_recommended` when recommended fields are omitted (still succeeds)
60
+ - MCP tool descriptions and LLM agent docs push agents to always fill planning boundaries
61
+
8
62
  ## [2.5.0] - 2026-07-27
9
63
 
10
64
  ### Changed
package/LLM_AGENTS.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # MCP Server Guide for LLM Agents
2
2
 
3
- Complete guide for integrating kanbango MCP server into LLM agents and AI assistants.
3
+ Human-oriented setup guide. **Agents do not load this file automatically.**
4
+
5
+ Canonical usage rules live in code (`agent-playbook.js`) and are injected into MCP
6
+ `tools/list` descriptions. After install, the agent only needs the MCP server —
7
+ not this markdown.
8
+
9
+ Optional refresh in-session: `kanban_read` with `operation: "help"`.
4
10
 
5
11
  ## Quick Integration
6
12
 
@@ -63,11 +69,12 @@ Read tasks from kanban board. Can list all tasks, filter by column/epic, or get
63
69
  **Operations:**
64
70
  - `list` - Get all tasks (with optional filters)
65
71
  - `show` - Get specific task details
72
+ - `help` - Return token playbook from `agent-playbook.js` (no board I/O)
66
73
 
67
74
  **Parameters:**
68
75
  ```json
69
76
  {
70
- "operation": "list", // "list" or "show"
77
+ "operation": "list", // "list" | "show" | "help"
71
78
  "task_id": "014", // Required for "show"
72
79
  "col": "planned", // Optional: "active" | "planned" | "icebox" | "done"
73
80
  "epic": "Phase 1" // Optional: filter by epic group
@@ -232,6 +239,11 @@ Patch-update task fields:
232
239
 
233
240
  Control the web GUI server: start, stop, or check status.
234
241
 
242
+ **Ownership (important):**
243
+ - `stop` only sends SIGTERM to a GUI **spawned by this MCP process** (`owned: true`).
244
+ - If the GUI was started elsewhere (CLI `kanban serve`, another MCP), `stop` returns `external_running` and does **not** kill that PID.
245
+ - `status` distinguishes `running` (owned), `external_running` (discovered via port file), and `not_running`.
246
+
235
247
  **Port resolution (start):**
236
248
  1. Explicit `port` argument, if provided
237
249
  2. Else `KANBANGO_GUI_PORT` env
@@ -242,9 +254,9 @@ If the preferred port is busy, the server picks the next free port. Always trust
242
254
  **Auto-start with MCP:** set `KANBANGO_AUTO_GUI=1` in the MCP server env. GUI starts when MCP starts; use `status` to read the URL.
243
255
 
244
256
  **Actions:**
245
- - `start` - Launch the GUI server
246
- - `stop` - Kill the GUI server
247
- - `status` - Check if the GUI is running (reads live process or port file)
257
+ - `start` - Launch the GUI server (or report already_running owned/external)
258
+ - `stop` - Stop only MCP-owned GUI
259
+ - `status` - Check GUI state
248
260
 
249
261
  **Parameters:**
250
262
  ```json
@@ -289,31 +301,57 @@ Check status:
289
301
  ```json
290
302
  {
291
303
  "status": "started",
304
+ "owned": true,
292
305
  "port": 5623,
293
306
  "pid": 12345,
294
307
  "url": "http://localhost:5623"
295
308
  }
296
309
  ```
297
310
 
298
- **Response (stop):**
311
+ **Response (stop - owned):**
299
312
  ```json
300
313
  {
301
314
  "status": "stopping",
315
+ "owned": true,
302
316
  "port": 5623,
303
317
  "pid": 12345
304
318
  }
305
319
  ```
306
320
 
307
- **Response (status - running):**
321
+ **Response (stop - external refused):**
322
+ ```json
323
+ {
324
+ "status": "external_running",
325
+ "owned": false,
326
+ "port": 5623,
327
+ "pid": 12345,
328
+ "url": "http://localhost:5623",
329
+ "hint": "GUI was not started by this MCP process; stop refused."
330
+ }
331
+ ```
332
+
333
+ **Response (status - running owned):**
308
334
  ```json
309
335
  {
310
336
  "status": "running",
337
+ "owned": true,
311
338
  "port": 5623,
312
339
  "pid": 12345,
313
340
  "url": "http://localhost:5623"
314
341
  }
315
342
  ```
316
343
 
344
+ **Response (status - external):**
345
+ ```json
346
+ {
347
+ "status": "external_running",
348
+ "owned": false,
349
+ "port": 5623,
350
+ "pid": 99999,
351
+ "url": "http://localhost:5623"
352
+ }
353
+ ```
354
+
317
355
  **Response (status - not running):**
318
356
  ```json
319
357
  {
@@ -426,17 +464,34 @@ Check status:
426
464
 
427
465
  ---
428
466
 
429
- ## Best Practices for LLM Agents
430
-
431
- 1. **Always use `kanban_read` first** - Discover existing tasks before creating new ones
432
- 2. **Numeric task lookup** - Task IDs are zero-padded numbers (e.g. `"035"`). Unpadded numbers such as `"35"` also work in any `task_id` parameter.
433
- 3. **Use `col` filter** - Narrow down to relevant column when listing
434
- 4. **Use `epic` grouping** - Organize tasks by features/phases
435
- 5. **Create with planning fields** - Always include description, specs, in_scope, out_of_scope, acceptance_criteria; treat `warnings`/`missing_recommended` as a signal to fill gaps
436
- 6. **Work through subtasks** - Toggle each subtask as you complete them
437
- 7. **Move tasks through workflow** - planned → active → done progression
438
- 8. **Use `show` operation** - Get full task details including subtasks
439
- 9. **Handle task IDs** - Always use the full task ID returned from create/show
467
+ ## Token-efficient playbook (source of truth)
468
+
469
+ **Edit `agent-playbook.js` only.** MCP tool descriptions and `operation=help` are built from it.
470
+
471
+ At runtime agents already receive the rules via tool descriptions. Humans can also call:
472
+
473
+ ```json
474
+ { "operation": "help" }
475
+ ```
476
+
477
+ on `kanban_read` (no board I/O).
478
+
479
+ ### Drop-in for project `AGENTS.md` (optional)
480
+
481
+ Same bullets as `DROP_IN_RULE` in `agent-playbook.js` — copy if you want them outside MCP:
482
+
483
+ ```text
484
+ Kanbango MCP — token rules:
485
+ - list: col filter, view=summary; keep task_ids; no full-board re-list after writes
486
+ - show: view=execution while coding; full only if needed
487
+ - create once with description,specs,in_scope,out_of_scope,acceptance_criteria
488
+ - move/update: return=none; subtasks=full array replace
489
+ - non-trivial: plan_create → plan_advance → plan_evidence (real tests, truncated logs) → plan_done
490
+ - gui: status before start; stop only owned; external_running = do not kill
491
+ ```
492
+
493
+ ### Columns
494
+ `planned` → `active` (few at a time) → `done`. Use `icebox` for parked work.
440
495
 
441
496
  ---
442
497
 
package/README.md CHANGED
@@ -31,8 +31,13 @@ kanban serve
31
31
  # List all tasks
32
32
  kanban list --json
33
33
 
34
- # Add a task
35
- kanban add "My task" --col planned --epic "Phase 1"
34
+ # Add an epic (initiative container), then a task under it
35
+ kanban epic add "Phase 1" --description "Why this initiative" --goals "Ship X"
36
+ kanban add "My task" --col planned --epic E001
37
+
38
+ # List epics / show epic with child rollup
39
+ kanban epic list --json
40
+ kanban epic show E001
36
41
 
37
42
  # Show details
38
43
  kanban show 001
@@ -44,6 +49,16 @@ kanban move 001 active
44
49
  kanban update 001 '{"subtasks":[{"done":true,"text":"Research"},{"done":false,"text":"Implementation"}]}'
45
50
  ```
46
51
 
52
+ ### Hierarchy
53
+
54
+ | Level | What | Storage |
55
+ |-------|------|---------|
56
+ | **Epic** | Initiative context (description, goals) | `backlog/epics/E001.json` |
57
+ | **Task** | Kanban card (column, AC, plan) | `backlog/{col}/001.json` |
58
+ | **Subtask** | Checklist / plan steps | `subtasks[]` on task |
59
+
60
+ Epic status is **derived** from child task columns (not a board column).
61
+
47
62
  ### Columns
48
63
 
49
64
  | Column | Purpose |
@@ -129,9 +144,11 @@ Once connected, your agent gets access to these tools:
129
144
 
130
145
  | Tool | What it does |
131
146
  |------|-------------|
132
- | `kanban_read` | List tasks, filter by column/epic, show details |
133
- | `kanban_manage` | Create, move, patch-update tasks |
134
- | `kanban_gui` | Start, stop, or check web GUI status (returns the real URL/port) |
147
+ | `kanban_read` | List/show tasks (`view=summary` by default cheap) |
148
+ | `kanban_manage` | Create, move, update, plan_* workflow |
149
+ | `kanban_gui` | Start / status / stop (stop only kills GUI this MCP started) |
150
+
151
+ **Token tip for agents:** rules ship inside MCP tool descriptions (`agent-playbook.js`). Optional: `kanban_read` → `operation: "help"`. Human setup notes: [LLM_AGENTS.md](./LLM_AGENTS.md).
135
152
 
136
153
  Your agent stays in sync with your real board — every change is persisted as JSON files.
137
154
 
@@ -146,6 +163,7 @@ Your agent stays in sync with your real board — every change is persisted as J
146
163
  | `kanban add <TITLE>` | Add a new task |
147
164
  | `kanban move <ID> <COL>` | Move task |
148
165
  | `kanban mcp-init` | Generate MCP config files |
166
+ | `kanban plan <action> --json '{...}'` | Accepted-plan workflow (create/advance/evidence/done/status) |
149
167
 
150
168
  ## Web GUI
151
169
 
@@ -160,7 +178,7 @@ kanban serve
160
178
 
161
179
  ```js
162
180
  const kanban = require('kanbango');
163
- const tasks = await kanban.allEpics();
181
+ const tasks = await kanban.allTasks();
164
182
  ```
165
183
 
166
184
  ## Requirements
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Single source of truth for agent-facing kanbango usage rules.
3
+ * MCP tool descriptions are built from this module — not from LLM_AGENTS.md.
4
+ * Docs may quote DROP_IN_RULE; keep them in sync by editing here only.
5
+ */
6
+
7
+ const DROP_IN_RULE = [
8
+ 'Kanbango MCP — token rules:',
9
+ '- hierarchy: epic (context) → task (work+plan) → subtasks (steps)',
10
+ '- list: col filter, view=summary; keep task_ids; no full-board re-list after writes',
11
+ '- list_epics / show_epic for initiatives; list tasks with epic=E001 for work',
12
+ '- show: view=execution while coding; full only if needed',
13
+ '- epic_create with description/goals; create tasks with epic=E001 (prefer id)',
14
+ '- create once with description,specs,in_scope,out_of_scope,acceptance_criteria',
15
+ '- move/update: return=none; subtasks=full array replace',
16
+ '- non-trivial: plan_create → plan_advance → plan_evidence (real tests, truncated logs) → plan_done',
17
+ '- gui: status before start; stop only owned; external_running = do not kill'
18
+ ].join('\n');
19
+
20
+ const TOOL_DESCRIPTIONS = {
21
+ kanban_read: [
22
+ 'Read board. TOKEN RULES: list defaults to view=summary (id/title/col/progress only).',
23
+ 'Hierarchy: epic (container/context) → task (work) → subtasks (steps).',
24
+ 'Always pass col when possible. Prefer show+view=execution over full.',
25
+ 'list_epics/show_epic for initiatives; filter list with epic=E001 or epic title.',
26
+ 'Do not re-list the whole board after every write — keep task_id from create/move.',
27
+ 'Task IDs numeric ("014"); epic IDs "E001". views: summary|planning|execution|full; fields[] overrides view.',
28
+ 'operation=help returns this playbook as short text (no board I/O).'
29
+ ].join(' '),
30
+
31
+ kanban_manage: [
32
+ 'Write board / plan. TOKEN RULES: one create with all planning fields beats many updates;',
33
+ 'after write use return=none (or summary). Do not dump full task unless needed.',
34
+ 'Actions: create|move|update (daily); epic_create|epic_update (containers);',
35
+ 'plan_create→plan_advance→plan_evidence→plan_done (non-trivial only).',
36
+ 'epic_create: title + description/goals/in_scope/out_of_scope. Link tasks via epic=E001.',
37
+ 'create/plan_create: title required; also send description,specs,in_scope,out_of_scope,acceptance_criteria',
38
+ '(missing → warnings, not failure). move: task_id+column. update: task_id + fields or subtasks[] full list',
39
+ '(no toggle). plan_evidence needs real test run: diff,test_command,stdout,stderr,exit_code — truncate logs.',
40
+ 'Example create: {"action":"create","title":"Ship image","epic":"E001","description":"...","specs":"...",',
41
+ '"in_scope":["CLI"],"out_of_scope":["GUI"],"acceptance_criteria":["npm test passes"],"col":"planned"}'
42
+ ].join(' '),
43
+
44
+ kanban_gui: [
45
+ 'Web GUI control. Prefer status before start. stop only kills GUI this MCP spawned;',
46
+ 'external_running = do not retry kill — use the returned url or leave it.',
47
+ 'status: running|external_running|not_running. Rarely needed mid-task — open once if user wants UI.'
48
+ ].join(' ')
49
+ };
50
+
51
+ const MUST_CONTAIN = [
52
+ 'TOKEN RULES',
53
+ 'view=summary',
54
+ 'return=none',
55
+ 'plan_create',
56
+ 'external_running',
57
+ 'subtasks',
58
+ 'epic_create'
59
+ ];
60
+
61
+ function playbookHelpPayload() {
62
+ return {
63
+ source: 'agent-playbook.js',
64
+ note: 'Canonical rules for agents. Same text drives MCP tool descriptions. LLM_AGENTS.md is human docs only.',
65
+ drop_in_rule: DROP_IN_RULE,
66
+ tools: {
67
+ kanban_read: TOOL_DESCRIPTIONS.kanban_read,
68
+ kanban_manage: TOOL_DESCRIPTIONS.kanban_manage,
69
+ kanban_gui: TOOL_DESCRIPTIONS.kanban_gui
70
+ }
71
+ };
72
+ }
73
+
74
+ module.exports = {
75
+ DROP_IN_RULE,
76
+ TOOL_DESCRIPTIONS,
77
+ MUST_CONTAIN,
78
+ playbookHelpPayload
79
+ };
package/bin/kanban-cmd.js CHANGED
@@ -13,7 +13,7 @@ function findPython() {
13
13
  if (result.status === 0) {
14
14
  return cmd;
15
15
  }
16
- } catch (e) {
16
+ } catch {
17
17
  continue;
18
18
  }
19
19
  }