@johngaynor/ocnus 2.0.0 → 2.0.1-next.12
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/README.md +59 -18
- package/cli/lib/approval.sh +1 -1
- package/cli/lib/guard.sh +5 -3
- package/cli/lib/handoff.sh +1 -1
- package/cli/lib/linear.sh +200 -34
- package/cli/lib/task.sh +61 -11
- package/cli/lib/usage.sh +159 -0
- package/cli/ocnus +34 -13
- package/herdr/README.md +155 -56
- package/herdr/layouts/default.json +10 -11
- package/herdr/mods/usage/main.js +149 -0
- package/herdr/mods/usage/mod.json +1 -0
- package/package.json +2 -2
- package/prompts/task-new.md +2 -2
- package/skills/brief/SKILL.md +4 -4
- package/skills/sdlc-breakdown/SKILL.md +69 -23
|
@@ -11,7 +11,7 @@ The method is elephant carpaccio: cut the work into slices so thin that each one
|
|
|
11
11
|
|
|
12
12
|
Thin slices matter more when an agent is building. Each slice can be checked end to end as soon as it merges, a mistake stays inside one small pull request, and if the third slice never ships, the first two still work.
|
|
13
13
|
|
|
14
|
-
This skill has
|
|
14
|
+
This skill has three parts. Proposing, and the approval, happen on every card: the human approves it, unless they have turned the breakdown approval off and you have no doubt to raise. Creating sub-issues happens only once a card that was sliced is approved. Recording the blockers, the other cards the card waits on and the cards that wait on it, happens once any card is approved.
|
|
15
15
|
|
|
16
16
|
## Before you write anything
|
|
17
17
|
|
|
@@ -63,6 +63,19 @@ Some work has no cut that passes the checks. A refactor may have nothing to clic
|
|
|
63
63
|
|
|
64
64
|
Then the card stands as one piece, however large it is. Don't force a cut that fails a check. A horizontal slice is worse than a large card, because it merges something nobody can test. Say in one line why it can't be cut, and if it is large, say so when you ask the human to approve.
|
|
65
65
|
|
|
66
|
+
### Find the cards it depends on
|
|
67
|
+
|
|
68
|
+
A card often needs another card's work merged first, such as a command, a table or a screen that the other card makes. Linear records that as a blocker: a relation of the kind blocks, from the card that has to land first to the card that waits for it. `task start` goes by the blockers, and holds a card while a card that blocks it is not done. So find every such card now, for the card and for each slice. You record them once the card is approved, in part 3.
|
|
69
|
+
|
|
70
|
+
Look in two places:
|
|
71
|
+
|
|
72
|
+
- **This card.** Its description, Specification and Plan name the work it builds on, by card ID or by what that work makes. The `Blocked by:` lines of `ocnus linear read <card ID>` show the blockers it has already.
|
|
73
|
+
- **The open cards of the space's teams**, which `ocnus task ls <space> --json` lists under their statuses. Read each one whose title touches what this card changes or uses, with `ocnus linear read <ID>`.
|
|
74
|
+
|
|
75
|
+
A card is a dependency only when this card, or one of its slices, can't be built or merged until that card's work has merged. A card that is done already, one that is only related, and one that could land in either order are not. A dependency can be a slice of another card, a sub-issue of a card that was sliced: name that slice, by its own ID, not the card it was sliced from, since a card's slices merge one at a time and this card may need only the first.
|
|
76
|
+
|
|
77
|
+
Then look the other way, for cards already approved and not started that need this card first. They are the cards in a not-started status, Todo in Lab or Ready for Dev in PHY, which `task ls` lists under a status with `"type": "unstarted"`. Each was written up without this card, which may not have existed then, so nothing holds it while this card is built. For each one whose work needs this card's, note what it waits on: this card when it is one piece, or the first of its slices whose work the other card needs. A card in Backlog is not approved yet: its own breakdown finds this card when it is written up.
|
|
78
|
+
|
|
66
79
|
### Write it to the card
|
|
67
80
|
|
|
68
81
|
Append a Breakdown section below the Plan. Leave it open, not collapsible, because it is what the human reads to approve the card. Change nothing above it.
|
|
@@ -74,6 +87,8 @@ For one piece:
|
|
|
74
87
|
```
|
|
75
88
|
ocnus linear section <card ID> Breakdown <<'EOF'
|
|
76
89
|
One piece. <one line on why: already small, or why it can't be cut>
|
|
90
|
+
|
|
91
|
+
Blocked by: <ID and title of each other card it depends on>
|
|
77
92
|
EOF
|
|
78
93
|
```
|
|
79
94
|
|
|
@@ -84,11 +99,14 @@ ocnus linear section <card ID> Breakdown <<'EOF'
|
|
|
84
99
|
1. **<slice name: a short phrase for the behaviour>**
|
|
85
100
|
- [ ] <its Done when>
|
|
86
101
|
- [ ] …
|
|
102
|
+
- Blocked by: <ID and title of each other card this slice depends on>
|
|
87
103
|
2. **<slice name>**
|
|
88
104
|
- [ ] …
|
|
89
105
|
EOF
|
|
90
106
|
```
|
|
91
107
|
|
|
108
|
+
The `Blocked by:` line names the other cards it depends on, from Find the cards it depends on above. Leave it out where there are none. A dependency of the whole card goes on its first slice. The slice before each slice blocks it already, so don't name that one.
|
|
109
|
+
|
|
92
110
|
To change a Breakdown that is already on the card, run the same command with `--replace` after the section name.
|
|
93
111
|
|
|
94
112
|
Create nothing else in Linear yet. A proposal the human turns down should leave nothing behind to clean up.
|
|
@@ -100,8 +118,8 @@ Breakdown is the last step of the write-up phase, so it ends with the whole card
|
|
|
100
118
|
First read the breakdown approval, with `ocnus approval --json`. Read it when you get to the approval, not before: the human may turn it on or off while the card is written up, and the setting as it is now is the one that counts. It prints one line, such as `{"file":"…/settings.json","approval":{"breakdown":true}}`.
|
|
101
119
|
|
|
102
120
|
- **`"breakdown": true`**: ask the human, as below. With nothing set, no setting in the file or no file, it is `true`.
|
|
103
|
-
- **`"breakdown": false`, and you have no doubt to raise**: don't ask. The setting approves the card,
|
|
104
|
-
- **`"breakdown": false`, and you have a doubt to raise**: ask the human, as below, and put the doubt in the summary. A doubt is what this skill says to raise when you ask the human to approve: a sub-issue that looks too big to stay one piece, more than six slices, which makes the card look like several cards,
|
|
121
|
+
- **`"breakdown": false`, and you have no doubt to raise**: don't ask. The setting approves the card, which starts it as the human's approval does. When the card is sliced, go on to part 2 and part 3, then hand off. When it is one piece, go on to part 3, then hand off. All are described below.
|
|
122
|
+
- **`"breakdown": false`, and you have a doubt to raise**: ask the human, as below, and put the doubt in the summary. A doubt is what this skill says to raise when you ask the human to approve: a sub-issue that looks too big to stay one piece, more than six slices, which makes the card look like several cards, a card that can't be cut and is large, or a card you can't tell whether to record as a blocker of this card, or as blocked by it.
|
|
105
123
|
- **The command fails, or prints anything else**, such as when the settings file is not valid settings or this machine's `ocnus` has no `approval` command: ask the human, as below, and say in the summary that the breakdown approval could not be read, and why, in the command's words.
|
|
106
124
|
|
|
107
125
|
The setting is for this approval alone. A question define or plan asked earlier in the write-up waited for the human's answer, and so does one this skill asks before it gets here, such as whether to revise a Breakdown the card already has.
|
|
@@ -112,15 +130,16 @@ When you ask, give them a summary they can answer from without opening Linear:
|
|
|
112
130
|
- The Done when list.
|
|
113
131
|
- The approach, in a sentence or two.
|
|
114
132
|
- Whether it is one piece or several, and why. If several, the slice names in order.
|
|
133
|
+
- The other cards it depends on, by ID and title, for the card or for each slice, and the cards in Todo that need it first, which it will be recorded as blocking. Say so when there are none.
|
|
115
134
|
|
|
116
|
-
Then ask them to approve or say what to change.
|
|
135
|
+
Then ask them to approve or say what to change. Approving the card starts its build phase: once the approval is recorded, you run `task start` on it. Record the ask as a hand-off with this block, then end your message with the summary and, below it, the block the command printed:
|
|
117
136
|
|
|
118
137
|
```
|
|
119
138
|
ocnus task handoff <space> <card ID> <<'EOF'
|
|
120
139
|
step: breakdown
|
|
121
140
|
status: needs-human
|
|
122
|
-
question: Approve <card ID> as specified, planned and broken down, and start its build phase
|
|
123
|
-
options: approve
|
|
141
|
+
question: Approve <card ID> as specified, planned and broken down, and start its build phase?
|
|
142
|
+
options: approve | change breakdown | change plan | change specification
|
|
124
143
|
EOF
|
|
125
144
|
```
|
|
126
145
|
|
|
@@ -130,10 +149,10 @@ Wait for their answer.
|
|
|
130
149
|
|---|---|
|
|
131
150
|
| Change the breakdown | Revise the Breakdown section, with `--replace`, and ask again |
|
|
132
151
|
| Change the Specification or the Plan | Make the change by that section's own skill, `sdlc-define` or `sdlc-plan`, as a revision the human asked for. That skill ends with its own `done` block, whose `next` does not apply here: come back to this step and re-check every section below the one that changed, because a new Done when item can make the Plan and the Breakdown wrong. Ask again |
|
|
133
|
-
| Approve, and the card is one piece | The card is ready to build.
|
|
134
|
-
| Approve, and the card is sliced | Go on to part 2 |
|
|
152
|
+
| Approve, and the card is one piece | The card is ready to build. Go on to part 3, then hand off, as described below |
|
|
153
|
+
| Approve, and the card is sliced | Go on to part 2, then part 3 |
|
|
135
154
|
|
|
136
|
-
|
|
155
|
+
Go by what they mean, not by the exact words: `approve`, `yes` or `go ahead` approves the card. An approval always starts the build phase: none holds it back. When they approve the card but want its start held back, in any words, such as not yet or I'll start it, tell them that approving starts it, and ask again: a card they want to hold stays unapproved, in Backlog, until they approve it. A card that another card blocks needs no holding back: `task start` holds it by itself until every card that blocks it, or the card it was sliced from, is done. An approval by the setting, with the breakdown approval off, starts the card in the same way, and since no one was asked, there is no answer to record.
|
|
137
156
|
|
|
138
157
|
## Part 2: Create the sub-issues
|
|
139
158
|
|
|
@@ -150,7 +169,7 @@ Do this only when the card has been approved in this session, by the human or by
|
|
|
150
169
|
EOF
|
|
151
170
|
```
|
|
152
171
|
|
|
153
|
-
It makes each slice a sub-issue of the card, with the slice name as its title and the card's type, since slices don't get a type of their own, and marks it as blocked by the slice before it. The first slice is blocked by
|
|
172
|
+
It makes each slice a sub-issue of the card, with the slice name as its title and the card's type, since slices don't get a type of their own, and marks it as blocked by the slice before it. The first slice is blocked by no slice. The other cards a slice depends on are recorded in part 3. It reads back each one it makes, then prints a line for each slice, `Slice <n> of <total>: <sub-issue ID> <slice name>`, which gives you each sub-issue's ID. A slice that a run before has made already, a sub-issue of the card with the slice's name as its title, is left as it is, and only its blocker is added when it lacks one. It names any other sub-issue the card has, and leaves it alone.
|
|
154
173
|
2. **Write each sub-issue's sections**, in order, in the same form as any card, each with its own command and the sub-issue's ID, in this order:
|
|
155
174
|
- A Specification, with the parent's Why narrowed to this slice, and the slice's Done when: `ocnus linear section <sub-issue ID> Specification <<'EOF'`.
|
|
156
175
|
- A Plan, with the approach in a sentence or two, only the files this slice touches, and the Tests lines for its Done when items: `ocnus linear section <sub-issue ID> Plan <<'EOF'`.
|
|
@@ -158,20 +177,41 @@ Do this only when the card has been approved in this session, by the human or by
|
|
|
158
177
|
|
|
159
178
|
A sub-issue has to stand alone. The build step will open it in a fresh session and see only that card, so anything it needs from the parent goes into it.
|
|
160
179
|
|
|
161
|
-
Then update the parent's Breakdown list so each slice name carries its sub-issue's ID, with `ocnus linear section <card ID> Breakdown --replace`. The parent is not built. It stays as the record of the whole.
|
|
180
|
+
Then update the parent's Breakdown list so each slice name carries its sub-issue's ID, with `ocnus linear section <card ID> Breakdown --replace`. Keep each slice's `Blocked by:` line as it is. The parent is not built. It stays as the record of the whole.
|
|
181
|
+
|
|
182
|
+
Read the parent and each sub-issue back, then go on to part 3.
|
|
183
|
+
|
|
184
|
+
## Part 3: Record the blockers
|
|
162
185
|
|
|
163
|
-
|
|
186
|
+
Do this once the card is approved in this session, by the human or by the setting, whether it is one piece or sliced, and before you hand off: `task start` reads the blockers when it starts the card, so they have to be in Linear first. Record nothing before the approval: a proposal the human turns down should leave nothing behind to clean up.
|
|
187
|
+
|
|
188
|
+
1. **The cards this card depends on.** For the card, or each slice, that the Breakdown says other cards block, record them with one command: the card that waits first, then each card that blocks it.
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
ocnus linear block <card ID> <blocker ID>...
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
When the card is sliced, the card that waits is the slice, by the sub-issue ID `ocnus linear slices` printed for it. A dependency of the whole card goes on its first slice. A blocker that is a slice of another card is given by that slice's own ID, not by the card it was sliced from.
|
|
195
|
+
2. **The cards in Todo that need this one first.** For each, record this card as its blocker: the other card first, then this card, or the first of its slices that the other card needs.
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
ocnus linear block <other card ID> <card ID or slice ID>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The command reads every card it is given before it records anything, then records each blocker the card does not have yet, as a relation of the kind blocks from the blocker to the card, and reads each one back. It skips a blocker the card has already, and removes none, so running it again with the same cards is safe. It prints a line for each blocker, `<card> is now blocked by <blocker>` or `<card> is blocked by <blocker> already`. It refuses a card given as its own blocker, and records nothing then.
|
|
202
|
+
|
|
203
|
+
When no other card blocks the card or any of its slices, and no card in Todo needs it first, there is nothing to record. Either way, hand off next.
|
|
164
204
|
|
|
165
205
|
## Hand off
|
|
166
206
|
|
|
167
|
-
Breakdown is finished when the card is approved, by the human or by the setting,
|
|
207
|
+
Breakdown is finished when the card is approved, by the human or by the setting, its sub-issues exist if it was sliced, and its blockers are recorded. Then record the hand-off:
|
|
168
208
|
|
|
169
209
|
```
|
|
170
210
|
ocnus task handoff <space> <card ID> <<'EOF'
|
|
171
211
|
step: breakdown
|
|
172
212
|
status: done
|
|
173
213
|
next: start
|
|
174
|
-
summary: <that the card is approved, by the human or by the setting
|
|
214
|
+
summary: <that the card is approved, by the human or by the setting; whether it is one piece or sliced; if sliced, the sub-issues in order with their IDs, and which one is first; and each blocker you recorded, naming the card that waits and the card that blocks it, or that there was none to record>
|
|
175
215
|
flags: <anything that didn't go to plan, such as a blocking relation that couldn't be set>
|
|
176
216
|
EOF
|
|
177
217
|
```
|
|
@@ -185,7 +225,7 @@ ocnus task handoff <space> <card ID> <<'EOF'
|
|
|
185
225
|
step: breakdown
|
|
186
226
|
status: done
|
|
187
227
|
next: start
|
|
188
|
-
summary: Approved by the setting, with the breakdown approval off, to start now. <whether it is one piece or sliced; if sliced, the sub-issues in order with their IDs, and which one is first>
|
|
228
|
+
summary: Approved by the setting, with the breakdown approval off, to start now. <whether it is one piece or sliced; if sliced, the sub-issues in order with their IDs, and which one is first; and each blocker you recorded, naming the card that waits and the card that blocks it, or that there was none to record>
|
|
189
229
|
flags: <anything that didn't go to plan>
|
|
190
230
|
approved: setting
|
|
191
231
|
EOF
|
|
@@ -209,16 +249,14 @@ Put the title between single quotes as Linear has it, and write each `'` in it a
|
|
|
209
249
|
|
|
210
250
|
Once `task start` has opened the build tab, it puts this write-up session away: once this session's turn has ended, it ends the Claude session with `/exit` and closes this tab, which archives the session in the Claude app's list. For a sliced card it does the same once a sub-issue is started, since this tab is named after the card the sub-issue was sliced from.
|
|
211
251
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
- **The human chose to start later:** give them the command, `ocnus task start <space> <ID>`, and run nothing. This session stays open until that command is run, from any terminal, and that puts it away.
|
|
215
|
-
- **The human chose to start now:** run that command yourself, once, after the hand-off above is recorded, or written in your message when it could not be recorded. Then tell the human the tab it opened, and pass on every `agent` and `note` line it printed: those say what still needs them, such as an agent it could not start, a repo Claude Code will ask about trusting, or a card it did not move in Linear. Its `write-up` line says this session is put away once this turn ends. So say everything in this turn and ask nothing after it: once the turn ends, this session is gone.
|
|
252
|
+
Whoever approved the card, the human or the setting, run that command yourself, once, after the hand-off above is recorded, or written in your message when it could not be recorded. Then tell the human the tab it opened, and pass on every `agent` and `note` line it printed: those say what still needs them, such as an agent it could not start, a repo Claude Code will ask about trusting, or a card it did not move in Linear. Its `write-up` line says this session is put away once this turn ends. So say everything in this turn and ask nothing after it: once the turn ends, this session is gone.
|
|
216
253
|
|
|
217
254
|
If it stops, don't run it again. This session stays open, since `task start` puts it away only once it has opened the build tab. Tell the human what it said, and what to do next:
|
|
218
255
|
|
|
219
256
|
| It stopped | Then tell the human |
|
|
220
257
|
|---|---|
|
|
221
|
-
|
|
|
258
|
+
| It held the card: it says `<ID> is held`, and names each card that blocks it, or the card it was sliced from, and is not done yet | That the card is approved and waits for those cards in Todo, with nothing made for it. To run `ocnus task start <space> <ID>` once they are done, from any terminal: that starts its build phase, and puts this session away |
|
|
259
|
+
| Before it made the task, for any other reason: what it said has no `made the task at` | To run `ocnus task start <space> <ID>` once what it named is fixed |
|
|
222
260
|
| After it made the task: it says `made the task at <folder>` | That the task is made and a second `task start` would be refused, so to open that folder in the space, in Herdr, and run `ocnus task build <space> <ID>` there |
|
|
223
261
|
|
|
224
262
|
## The handoff block
|
|
@@ -264,11 +302,11 @@ EOF
|
|
|
264
302
|
|---|---|
|
|
265
303
|
| The card ID doesn't resolve | Ask the human for the ID. Don't pick a card because its title looks similar |
|
|
266
304
|
| The Linear tools aren't available | Stop and say so. Show the finished section in the session so the work isn't lost. Don't save it somewhere else and report the step as done |
|
|
267
|
-
| `ocnus linear` says no Linear key is saved, that Linear rejected the key or that Linear answered with an error, or the command isn't there | Read the card, write the Breakdown, make the slices
|
|
305
|
+
| `ocnus linear` says no Linear key is saved, that Linear rejected the key or that Linear answered with an error, or the command isn't there | Read the card, write the Breakdown, make the slices, write their sections and record the blockers with the Linear tools instead, in the same form: the Breakdown under the heading `## Breakdown`; each slice a sub-issue of the card, with the slice name as its title and the card's type, blocked by the slice before it; a sub-issue's Specification and Plan each between `>>> ## <name>` and a closing `>>>`; and each blocker a relation of the kind blocks, from the card that blocks to the card that waits. Make only the slices the card has no sub-issue for yet. A key with Read permission alone reads the card and gets the error only at a write: make that write and the rest with them then. Say so in `flags` |
|
|
268
306
|
| `ocnus linear` says it could not reach Linear | Run it once more. It checks the card before it writes, so it can't add the section twice. If it then says the card already has a Breakdown, the first try got through |
|
|
269
307
|
| `ocnus linear section` says the text above the section changed | Put it back from what you read at the start of this run, with the Linear tools, and tell the human |
|
|
270
308
|
| Making the slices stops partway | Don't start over. Run `ocnus linear slices` again with the same list: it finds the slices already made by their names, makes only the missing ones, and adds any blocker that is missing. Then write any section a sub-issue lacks: `ocnus linear section` refuses one that is there |
|
|
271
|
-
|
|
|
309
|
+
| `ocnus linear block` stops, or a blocking relation can't be set | When it says it could not reach Linear, run it again with the same cards: it skips the blockers already there. When it says no Linear key is saved, that Linear rejected the key or that Linear answered with an error, record the rest with the Linear tools, as in the row above. A blocker you still can't record goes in `flags`, naming the card that waits and the card that blocks it, and in your message too: `task start` does not hold a card for a blocker Linear doesn't have. The Breakdown still names it, so it isn't lost |
|
|
272
310
|
| The human's answer isn't a clear yes | Treat it as a change request. Ask what they want changed, then ask for approval again |
|
|
273
311
|
|
|
274
312
|
If something fails that isn't on this list, stop and tell the human what happened. Don't work around it.
|
|
@@ -283,7 +321,7 @@ One piece. Four files and one behaviour, small enough for a single pull request.
|
|
|
283
321
|
EOF
|
|
284
322
|
```
|
|
285
323
|
|
|
286
|
-
**Sliced.** The card "Order notes" asks that staff can add notes to an order, edit and delete them, and mark some as visible to the customer. The plan touches the database, the API, the staff app and the customer app.
|
|
324
|
+
**Sliced.** The card "Order notes" asks that staff can add notes to an order, edit and delete them, and mark some as visible to the customer. The plan touches the database, the API, the staff app and the customer app. It checks who is staff by the roles that ABC-127, "Staff roles", adds: the first slice of another card, "Staff accounts", not merged yet. And ABC-135, "Notify the customer of a new note", is in Todo and needs the notes the customer sees, which slice 3 makes.
|
|
287
325
|
|
|
288
326
|
```
|
|
289
327
|
ocnus linear section ABC-130 Breakdown <<'EOF'
|
|
@@ -291,6 +329,7 @@ ocnus linear section ABC-130 Breakdown <<'EOF'
|
|
|
291
329
|
- [ ] On an order, a staff member can type a note and save it.
|
|
292
330
|
- [ ] Saved notes show on the order, newest first, with the author and time.
|
|
293
331
|
- [ ] Someone who is not staff can neither add nor see notes.
|
|
332
|
+
- Blocked by: ABC-127 Staff roles
|
|
294
333
|
2. **Staff can edit and delete their own notes**
|
|
295
334
|
- [ ] A staff member can edit a note they wrote, and the note shows it was edited.
|
|
296
335
|
- [ ] A staff member can delete a note they wrote, after confirming.
|
|
@@ -301,6 +340,13 @@ ocnus linear section ABC-130 Breakdown <<'EOF'
|
|
|
301
340
|
EOF
|
|
302
341
|
```
|
|
303
342
|
|
|
343
|
+
The summary the human approves from names ABC-127 as slice 1's blocker, and ABC-135 as a card in Todo that slice 3 will block. Once the card is approved, and its slices are made as ABC-131, ABC-132 and ABC-133, part 3 records both:
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
ocnus linear block ABC-131 ABC-127
|
|
347
|
+
ocnus linear block ABC-135 ABC-133
|
|
348
|
+
```
|
|
349
|
+
|
|
304
350
|
**The wrong cut** for the same card:
|
|
305
351
|
|
|
306
352
|
```
|