@basementuniverse/kanbn 2.1.0 → 2.5.1

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.
Files changed (66) hide show
  1. package/README.md +1 -0
  2. package/coverage/tmp/coverage-916017-1788028598821-0.json +1 -0
  3. package/coverage/tmp/{coverage-214293-1787777184569-0.json → coverage-916018-1788028597179-0.json} +1 -1
  4. package/coverage/tmp/coverage-916036-1788028598796-0.json +1 -0
  5. package/docs/actions.md +337 -0
  6. package/docs/advanced-configuration.md +32 -0
  7. package/docs/commands/add.txt +8 -1
  8. package/docs/commands/archive.txt +6 -0
  9. package/docs/commands/board.txt +4 -0
  10. package/docs/commands/burndown.txt +1 -0
  11. package/docs/commands/comment.txt +8 -1
  12. package/docs/commands/contributors.txt +58 -0
  13. package/docs/commands/edit.txt +13 -1
  14. package/docs/commands/find.txt +28 -1
  15. package/docs/commands/gantt.txt +1 -0
  16. package/docs/commands/help.txt +1 -0
  17. package/docs/commands/history.txt +1 -0
  18. package/docs/commands/move.txt +17 -0
  19. package/docs/commands/remove.txt +10 -0
  20. package/docs/commands/restore.txt +6 -0
  21. package/docs/commands/sort.txt +18 -0
  22. package/docs/commands/task.txt +4 -0
  23. package/docs/commands/validate.txt +14 -1
  24. package/docs/contributors.md +145 -0
  25. package/docs/filtering-and-sorting.md +60 -3
  26. package/docs/index-structure.md +120 -12
  27. package/docs/index.md +4 -1
  28. package/docs/multiple-boards.md +1 -0
  29. package/docs/sprints.md +175 -0
  30. package/docs/task-structure.md +9 -2
  31. package/example/advanced/kanbn.yml +65 -0
  32. package/package.json +1 -1
  33. package/routes/add.json +5 -1
  34. package/routes/archive.json +6 -2
  35. package/routes/comment.json +5 -1
  36. package/routes/contributors.json +18 -0
  37. package/routes/edit.json +5 -1
  38. package/routes/move.json +4 -2
  39. package/routes/remove.json +6 -2
  40. package/routes/restore.json +6 -0
  41. package/routes/sort.json +5 -0
  42. package/src/actions.js +904 -0
  43. package/src/board.js +24 -1
  44. package/src/controller/add.js +21 -10
  45. package/src/controller/archive.js +1 -0
  46. package/src/controller/board.js +13 -4
  47. package/src/controller/burndown.js +5 -2
  48. package/src/controller/comment.js +5 -2
  49. package/src/controller/contributors.js +166 -0
  50. package/src/controller/edit.js +40 -14
  51. package/src/controller/find.js +75 -4
  52. package/src/controller/gantt.js +5 -2
  53. package/src/controller/history.js +5 -2
  54. package/src/controller/move.js +84 -10
  55. package/src/controller/remove.js +39 -2
  56. package/src/controller/restore.js +1 -0
  57. package/src/controller/sort.js +40 -0
  58. package/src/controller/task.js +12 -1
  59. package/src/controller/validate.js +141 -4
  60. package/src/git-user-name.js +5 -15
  61. package/src/git-user.js +55 -0
  62. package/src/main.d.ts +204 -4
  63. package/src/main.js +1413 -39
  64. package/src/parse-index.js +205 -17
  65. package/src/utility.js +135 -1
  66. package/coverage/tmp/coverage-214292-1787777191526-0.json +0 -1
@@ -0,0 +1,175 @@
1
+ # Sprints
2
+
3
+ A sprint in Kanbn is nothing more than **a named point in time**. Each sprint has a start date, and
4
+ runs until the next sprint starts; the last sprint in the list is the current one, and runs up to
5
+ now. Nothing stores an end date or a duration, and there is no way for a sprint to be "closed" -
6
+ starting the next sprint is what ends the previous one, and any end date you see in reporting output
7
+ is derived from the next sprint's start.
8
+
9
+ Tasks are never assigned to a sprint. A sprint is a window that reporting commands measure through,
10
+ so which sprint a task belongs to is worked out from its dates (`created`, `started`, `completed`,
11
+ `due`) rather than being recorded anywhere on the task. This means sprints cost nothing to add
12
+ retrospectively, and moving a boundary re-slices history rather than invalidating it.
13
+
14
+ Sprints live in the [`sprints`](index-structure.md#sprints) index option:
15
+
16
+ ```yaml
17
+ sprints:
18
+ -
19
+ start: 2026-07-01T09:00:00.000Z
20
+ name: 'Foundation Sprint'
21
+ description: 'Baseline product and infrastructure work.'
22
+ -
23
+ start: 2026-07-08T09:00:00.000Z
24
+ name: 'Workflow Sprint'
25
+ ```
26
+
27
+ `start` and `name` are required, `description` is optional.
28
+
29
+ ## Starting a sprint
30
+
31
+ ```bash
32
+ kanbn sprint --name "Workflow Sprint" --description "Core team workflow and onboarding features."
33
+ ```
34
+
35
+ `kanbn sp` is the short alias. The sprint always starts *now* - there is no option to backdate one
36
+ from the CLI, so a sprint that should have started last Monday is a front matter edit.
37
+
38
+ | Option | Effect |
39
+ | --- | --- |
40
+ | `--name`, `-n` | Sprint name. If omitted, auto-named `Sprint {n}` from the number of existing sprints |
41
+ | `--description`, `-d` | Optional description, shown in `kanbn status` output |
42
+ | `--interactive`, `-i` | Prompt for name and (optionally) description |
43
+ | `--board`, `-b` | Run from the context of another board (see [below](#sprints-and-multiple-boards)) |
44
+
45
+ There is no command to rename, re-date or delete a sprint. All three are edits to the `sprints`
46
+ list in the board's front matter, which is deliberate: the sprint list is a small hand-maintainable
47
+ piece of history, and `kanbn sprint` only ever appends to it.
48
+
49
+ ## Reading a sprint
50
+
51
+ Three commands take a `--sprint N|"name"` option (`-p` in every case). A sprint can be selected by
52
+ 1-based number or by exact name; an unknown number or name is an error, not an empty result.
53
+
54
+ ### `kanbn status --sprint`
55
+
56
+ Adds a `sprint` section to the status output for the selected sprint, defaulting to the current one:
57
+
58
+ ```bash
59
+ kanbn status --sprint 2
60
+ kanbn status --sprint "Workflow Sprint"
61
+ ```
62
+
63
+ ```yaml
64
+ sprint:
65
+ number: 2
66
+ name: 'Workflow Sprint'
67
+ start: 2026-07-08T09:00:00.000Z
68
+ end: 2026-07-15T09:00:00.000Z
69
+ current: 3
70
+ description: 'Core team workflow and onboarding features.'
71
+ durationDelta: 604800000
72
+ durationMessage: '1 week'
73
+ created: # tasks created during the sprint, with their total workload
74
+ started: # tasks started during the sprint
75
+ completed: # tasks completed during the sprint
76
+ due: # tasks due during the sprint
77
+ ```
78
+
79
+ Each of those four groups lists the matching task ids with their column and workload, plus a summed
80
+ `workload`. Any [custom date fields](index-structure.md#customfields) you have declared get a group
81
+ of their own too.
82
+
83
+ `current` and `end` only appear when you're looking at a sprint other than the current one: `current`
84
+ is the number of the sprint that is running now, and `end` is the moment the sprint you asked about
85
+ stopped, which is the next sprint's `start`. The current sprint has no `end`, because it hasn't
86
+ ended - its `durationDelta` and `durationMessage` are measured up to now, and will be larger every
87
+ time you run the command until the next sprint starts.
88
+
89
+ ### `kanbn burndown --sprint`
90
+
91
+ ```bash
92
+ kanbn burndown --sprint "Workflow Sprint"
93
+ kanbn burndown --sprint 1 --sprint 2
94
+ ```
95
+
96
+ Plots remaining workload across the sprint window. `--sprint` can be repeated to draw a chart per
97
+ sprint. With no `--sprint` or `--date` at all, burndown uses the current sprint - and if no sprints
98
+ are defined, it falls back to all time, from the earliest task date to now.
99
+
100
+ ### `kanbn history --sprint`
101
+
102
+ ```bash
103
+ kanbn history --sprint 2
104
+ ```
105
+
106
+ Filters the event listing down to events that fall inside the sprint window. Repeatable, and
107
+ combinable with `--assigned`, `--task` and `--date`.
108
+
109
+ Gantt charts don't use sprints at all.
110
+
111
+ ## Sprints and multiple boards
112
+
113
+ Sprints are workspace-level by default: every board reads the workspace list, so one sprint cadence
114
+ covers the whole workspace and `kanbn sprint -b design` appends to that shared list (and says so in
115
+ verbose mode).
116
+
117
+ A board that declares its own `sprints` in its front matter **replaces** the workspace list for
118
+ itself entirely - it can no longer see workspace sprints, so `kanbn status -b design -p "Foundation
119
+ Sprint"` will fail to find one that only exists at workspace level. Sprints started on such a board
120
+ are auto-named `{Board name} Sprint {n}` so two boards' sprints can't be confused. Forking is never
121
+ implicit; it stays a deliberate front matter edit. See
122
+ [multiple boards](multiple-boards.md#per-board-sprints).
123
+
124
+ `--sprint` can't be combined with `--all-boards`, because sprint numbers and names are relative to
125
+ one board's list.
126
+
127
+ ## Keeping the list sane
128
+
129
+ The "current sprint is the last one" and "a sprint runs until the next one starts" rules both assume
130
+ the list is in chronological order. `kanbn validate` emits a `sprints-out-of-order` warning if it
131
+ isn't - worth checking after hand-editing dates.
132
+
133
+ ## Example workflow
134
+
135
+ A team working in weekly sprints, reviewing at the end of each one.
136
+
137
+ Start the first sprint on the Monday:
138
+
139
+ ```bash
140
+ kanbn sprint -n "Foundation Sprint" -d "Baseline product and infrastructure work."
141
+ ```
142
+
143
+ Work the week normally - `kanbn add`, `kanbn move`, `kanbn comment`. Nothing needs to reference the
144
+ sprint; the dates Kanbn stamps on tasks as they're created, started and completed are what the
145
+ sprint reporting reads.
146
+
147
+ Check progress mid-week:
148
+
149
+ ```bash
150
+ kanbn status --due
151
+ kanbn burndown --normalise auto
152
+ ```
153
+
154
+ With no `--sprint`, both default to the current sprint, so this is the "how is this week going"
155
+ view.
156
+
157
+ On the following Monday, review what the week actually contained, then start the next sprint:
158
+
159
+ ```bash
160
+ kanbn status --sprint "Foundation Sprint"
161
+ kanbn history --sprint "Foundation Sprint"
162
+ kanbn sprint -n "Workflow Sprint" -d "Core team workflow and onboarding features."
163
+ ```
164
+
165
+ Starting the second sprint closes the first one at that moment, and the reports above stay valid
166
+ for it forever - `kanbn status -p 1` and `kanbn burndown -p 1` will show the same window next month.
167
+
168
+ Comparing two sprints later on:
169
+
170
+ ```bash
171
+ kanbn burndown -p "Foundation Sprint" -p "Workflow Sprint"
172
+ ```
173
+
174
+ The [`example/basic`](../example/basic) workspace ships with three sprints defined, so every command
175
+ on this page can be run there as-is.
@@ -100,7 +100,11 @@ An array of tags to apply to this task.
100
100
 
101
101
  ### `assigned`
102
102
 
103
- The name of the user this task is assigned to.
103
+ The name of the user this task is assigned to. This is free text: any string is a valid assignee, and Kanbn never rejects or rewrites one.
104
+
105
+ A workspace can declare a list of [contributors](contributors.md), which gives each person a canonical spelling, autocompletes this field in the interactive prompts and lets `kanbn find --assigned @me` work. Contributors are advisory — `assigned` stays free text either way, and a name that isn't in the list is still perfectly valid.
106
+
107
+ A task has one assignee. `assigned` is a single string in the schema, the filters, the board template and the reporting commands, and there is no multiple-assignee form.
104
108
 
105
109
  ### `progress`
106
110
 
@@ -150,6 +154,8 @@ The `depends-on` relation type is reserved for gantt scheduling. It means the cu
150
154
 
151
155
  An array of comments, where each comment has an `author` and `date` property, and some text.
152
156
 
157
+ `author` is free text, exactly like [`assigned`](#assigned), and it is optional — a comment added on a machine with no resolvable user has an empty author rather than failing to save. When the workspace declares [contributors](contributors.md), the default author is the canonical name for the current user.
158
+
153
159
  ## History
154
160
 
155
161
  An optional array of structured lifecycle events used for richer timeline reporting (including burndown).
@@ -168,7 +174,8 @@ Notes:
168
174
 
169
175
  - History entries are stored in the reserved `## History` section as list items.
170
176
  - `date` should be an ISO timestamp.
171
- - Additional fields (for example `author`) are preserved if present.
177
+ - Every event carries an optional `author`, naming the [current user](contributors.md#the-current-user) at the time it happened. The key is omitted entirely when there is no resolvable user, so a machine with no git identity writes exactly the history it always has.
178
+ - Any other additional field is preserved if present.
172
179
  - An event type this version of Kanbn doesn't recognise is preserved and skipped rather than rejected, so a task file written by a newer version stays readable.
173
180
 
174
181
  ### Board attribution
@@ -53,6 +53,71 @@ columnSorting:
53
53
 
54
54
  dateFormat: yyyy-mm-dd
55
55
 
56
+ # The people who work on this workspace. A contributor can be a bare name or an
57
+ # object; `name` is the value written into a task's `assigned` field and a
58
+ # comment's `author`, and `aliases` catch the other spellings that mean the same
59
+ # person. The list is advisory - `assigned` stays free text and is never
60
+ # validated against it. Run `kanbn contributors --usage` to see which spellings
61
+ # are already in use. See docs/contributors.md.
62
+ contributors:
63
+ - name: Ana
64
+ email: ana@example.com
65
+ aliases:
66
+ - ana
67
+ - Ana Ruiz
68
+ - name: Ben
69
+ email: ben@example.com
70
+ aliases:
71
+ - ben
72
+
73
+ # Rules that fire when a task changes. Actions only run during commands that
74
+ # change something - never during `board`, `find` or `burndown` - and nothing a
75
+ # rule writes can fire another rule. `--no-actions` on any of those commands, or
76
+ # KANBN_NO_ACTIONS=1, steps around a rule that is misbehaving.
77
+ # See docs/actions.md.
78
+ actions:
79
+ # `task.started` is a transition rather than an operation: it fires when the
80
+ # task wasn't started before and is now, whatever caused it. It reads
81
+ # startedColumns above, so adding another started column doesn't break it.
82
+ - name: start-work
83
+ on: task.started
84
+ then:
85
+ - assign: '@me'
86
+ - addTag: active
87
+ - removeTag: ready
88
+
89
+ - name: close-out
90
+ on: task.completed
91
+ then:
92
+ - removeTag: active
93
+ - setProgress: 1
94
+ - set: { closedBy: '@me' }
95
+
96
+ # `reviewedAt` above is stamped by the column linkage; the rule runs after it,
97
+ # so it can see and override anything that stamping wrote.
98
+ - name: flag-review
99
+ on: task.moved
100
+ when:
101
+ toColumn: Review
102
+ then:
103
+ - addTag: needs-review
104
+ - comment: 'Review requested by @me'
105
+
106
+ # `for` points the verbs at related tasks instead of this one. Children carry
107
+ # the `child-of` relation, so `incoming` finds them from the epic.
108
+ - name: epic-blocks-children
109
+ on: task.moved
110
+ when:
111
+ tag: epic
112
+ toColumn: Blocked
113
+ for:
114
+ related: child-of
115
+ direction: incoming
116
+ where:
117
+ is-completed: false
118
+ then:
119
+ - addTag: blocked-by-epic
120
+
56
121
  # Custom fields (team, storyPoints, ...) can be interpolated here because they
57
122
  # are declared in customFields above. See docs/index-structure.md for the full
58
123
  # list of available variables.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basementuniverse/kanbn",
3
- "version": "2.1.0",
3
+ "version": "2.5.1",
4
4
  "description": "A CLI Kanban application",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/routes/add.json CHANGED
@@ -6,7 +6,8 @@
6
6
  ],
7
7
  "args": {
8
8
  "boolean": [
9
- "interactive"
9
+ "interactive",
10
+ "actions"
10
11
  ],
11
12
  "string": [
12
13
  "name",
@@ -55,6 +56,9 @@
55
56
  "board": [
56
57
  "b"
57
58
  ]
59
+ },
60
+ "default": {
61
+ "actions": true
58
62
  }
59
63
  },
60
64
  "controller": "./src/controller/add",
@@ -6,7 +6,8 @@
6
6
  ],
7
7
  "args": {
8
8
  "boolean": [
9
- "list"
9
+ "list",
10
+ "actions"
10
11
  ],
11
12
  "alias": {
12
13
  "list": [
@@ -18,7 +19,10 @@
18
19
  },
19
20
  "string": [
20
21
  "board"
21
- ]
22
+ ],
23
+ "default": {
24
+ "actions": true
25
+ }
22
26
  },
23
27
  "controller": "./src/controller/archive",
24
28
  "help": "./docs/commands/archive.txt"
@@ -6,7 +6,8 @@
6
6
  ],
7
7
  "args": {
8
8
  "boolean": [
9
- "interactive"
9
+ "interactive",
10
+ "actions"
10
11
  ],
11
12
  "string": [
12
13
  "text",
@@ -25,6 +26,9 @@
25
26
  "board": [
26
27
  "b"
27
28
  ]
29
+ },
30
+ "default": {
31
+ "actions": true
28
32
  }
29
33
  },
30
34
  "controller": "./src/controller/comment",
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "Contributors",
3
+ "commands": [
4
+ "contributors"
5
+ ],
6
+ "args": {
7
+ "boolean": [
8
+ "json",
9
+ "usage"
10
+ ],
11
+ "alias": {
12
+ "json": ["j"],
13
+ "usage": ["u"]
14
+ }
15
+ },
16
+ "controller": "./src/controller/contributors",
17
+ "help": "./docs/commands/contributors.txt"
18
+ }
package/routes/edit.json CHANGED
@@ -6,7 +6,8 @@
6
6
  ],
7
7
  "args": {
8
8
  "boolean": [
9
- "interactive"
9
+ "interactive",
10
+ "actions"
10
11
  ],
11
12
  "string": [
12
13
  "name",
@@ -56,6 +57,9 @@
56
57
  "board": [
57
58
  "b"
58
59
  ]
60
+ },
61
+ "default": {
62
+ "actions": true
59
63
  }
60
64
  },
61
65
  "controller": "./src/controller/edit",
package/routes/move.json CHANGED
@@ -8,7 +8,8 @@
8
8
  "boolean": [
9
9
  "interactive",
10
10
  "relative",
11
- "add"
11
+ "add",
12
+ "actions"
12
13
  ],
13
14
  "string": [
14
15
  "column",
@@ -33,7 +34,8 @@
33
34
  ]
34
35
  },
35
36
  "default": {
36
- "add": true
37
+ "add": true,
38
+ "actions": true
37
39
  }
38
40
  },
39
41
  "controller": "./src/controller/move",
@@ -8,7 +8,8 @@
8
8
  "boolean": [
9
9
  "force",
10
10
  "index",
11
- "all-boards"
11
+ "all-boards",
12
+ "actions"
12
13
  ],
13
14
  "alias": {
14
15
  "force": [
@@ -23,7 +24,10 @@
23
24
  },
24
25
  "string": [
25
26
  "board"
26
- ]
27
+ ],
28
+ "default": {
29
+ "actions": true
30
+ }
27
31
  },
28
32
  "controller": "./src/controller/remove",
29
33
  "help": "./docs/commands/remove.txt"
@@ -16,6 +16,12 @@
16
16
  "board": [
17
17
  "b"
18
18
  ]
19
+ },
20
+ "boolean": [
21
+ "actions"
22
+ ],
23
+ "default": {
24
+ "actions": true
19
25
  }
20
26
  },
21
27
  "controller": "./src/controller/restore",
package/routes/sort.json CHANGED
@@ -32,6 +32,11 @@
32
32
  "workload",
33
33
  "progress",
34
34
  "assigned",
35
+ "overdue",
36
+ "is-started",
37
+ "is-completed",
38
+ "in-started-column",
39
+ "in-completed-column",
35
40
  "board"
36
41
  ],
37
42
  "alias": {