@johngaynor/ocnus 0.0.0-stage → 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.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +988 -2
  3. package/agents/linear-mcp.json +1 -0
  4. package/agents/ocnus-build.md +23 -0
  5. package/agents/ocnus-write-up.md +20 -0
  6. package/cli/host-mark +36 -0
  7. package/cli/lib/agents.sh +350 -0
  8. package/cli/lib/approval.sh +94 -0
  9. package/cli/lib/archive.sh +447 -0
  10. package/cli/lib/billing.sh +166 -0
  11. package/cli/lib/close.sh +189 -0
  12. package/cli/lib/commands.sh +220 -0
  13. package/cli/lib/common.sh +215 -0
  14. package/cli/lib/finish.sh +288 -0
  15. package/cli/lib/github.sh +162 -0
  16. package/cli/lib/guard.sh +134 -0
  17. package/cli/lib/handoff.sh +551 -0
  18. package/cli/lib/host.sh +1802 -0
  19. package/cli/lib/linear.sh +1389 -0
  20. package/cli/lib/links.sh +135 -0
  21. package/cli/lib/merges.sh +853 -0
  22. package/cli/lib/recipes.sh +54 -0
  23. package/cli/lib/settings.sh +465 -0
  24. package/cli/lib/space.sh +343 -0
  25. package/cli/lib/task.sh +847 -0
  26. package/cli/lib/tests.sh +268 -0
  27. package/cli/lib/trust.sh +70 -0
  28. package/cli/ocnus +630 -0
  29. package/herdr/README.md +2238 -0
  30. package/herdr/layouts/default.json +259 -0
  31. package/herdr/mods/agent-settings/cog.svg +4 -0
  32. package/herdr/mods/agent-settings/main.js +356 -0
  33. package/herdr/mods/agent-settings/mod.json +1 -0
  34. package/herdr/mods/cards/main.js +450 -0
  35. package/herdr/mods/cards/mod.json +1 -0
  36. package/herdr/mods/cards/refresh.svg +4 -0
  37. package/herdr/mods/cpu/main.js +90 -0
  38. package/herdr/mods/cpu/mod.json +1 -0
  39. package/herdr/mods/layout-switch/main.js +48 -0
  40. package/herdr/mods/layout-switch/mod.json +1 -0
  41. package/herdr/mods/names/main.js +69 -0
  42. package/herdr/mods/names/mod.json +1 -0
  43. package/herdr/mods/ocnus-spaces/main.js +376 -0
  44. package/herdr/mods/ocnus-spaces/mod.json +1 -0
  45. package/herdr/mods/steps/main.js +354 -0
  46. package/herdr/mods/steps/mod.json +1 -0
  47. package/herdr/spaces/template/SPACE.md +19 -0
  48. package/package.json +27 -4
  49. package/prompts/task-build.md +11 -0
  50. package/prompts/task-new.md +17 -0
  51. package/skills/brief/SKILL.md +64 -0
  52. package/skills/sdlc-breakdown/SKILL.md +312 -0
  53. package/skills/sdlc-build/SKILL.md +182 -0
  54. package/skills/sdlc-define/SKILL.md +203 -0
  55. package/skills/sdlc-plan/SKILL.md +202 -0
  56. package/skills/sdlc-pr/SKILL.md +339 -0
  57. package/skills/sdlc-review/SKILL.md +227 -0
@@ -0,0 +1,354 @@
1
+ // The steps of the card whose tab is selected: what each step of its write-up
2
+ // did, how long it took, and how long it waited on the human. With no card's
3
+ // tab selected, the space's cards that have hand-offs, newest first, with
4
+ // where each stands. A click on a card shows its steps, even when its tab is
5
+ // closed.
6
+ //
7
+ // All of that is worked out by `ocnus task log <space> [<card>] --json`.
8
+ // This mod draws the views that command returns and holds no rules about
9
+ // hand-offs: every label and every length of time arrives as text.
10
+ //
11
+ // A step is one line. A click on it opens what the step said. When
12
+ // `task log` says a card's agent is stuck or has stopped, or that a pull
13
+ // request of the card's has no agent to wake or nothing is watching them,
14
+ // that shows in place of where the card stands in the list, and on a line
15
+ // after its steps.
16
+ import { View, div } from "gpui-kit";
17
+ import { v_flex, h_flex } from "gpui-base";
18
+ import { exec, spaces, panes, terminals, theme, layout, window, checking, appHome } from "herdr";
19
+
20
+ // How often to see whether another card is selected, or Herdr's tabs have
21
+ // changed. A change in them is read at once, so an agent's state shows within
22
+ // this and a read.
23
+ const LOOK_MS = 2000;
24
+ const REREAD_MS = 6000; // how often to read what is shown again
25
+ const SPACES_MS = 60000; // spaces change rarely
26
+ const TIMEOUT_MS = 10000;
27
+ // How this mod's own link into the repo that ships it ends.
28
+ const LINKED_AT = "/herdr/mods/steps";
29
+ // A tab is a card's when it is named as `ocnus task new` names it.
30
+ const CARD = /^[A-Za-z][A-Za-z0-9]*-[0-9]+$/;
31
+
32
+ // `herdr-app check` draws the mod once, with no card selected, which would
33
+ // show one line of text and none of the rows. It is given these to draw, all
34
+ // of them open, so a mistake in a row fails the check: a list of cards and a
35
+ // card's steps, with the way back from one to the other. Their agents are
36
+ // one blocked, one whose pull requests nothing is watching, and one whose
37
+ // pull request is in conflict with no agent running.
38
+ const SAMPLE_CARDS = {
39
+ space: "demo",
40
+ cards: [
41
+ { card: "ABC-4", state: "waiting on the human", waiting: "waiting on the human for 1h 20m", for: "1h 20m",
42
+ agent: { state: "unwatched", kind: null, tab: null, label: "nothing watching its pull requests: herdr-core not running", for: "1h 20m", seconds: 4800, pulls: [] } },
43
+ { card: "ABC-3", state: "waiting on the human", waiting: "waiting on the human for 2m 05s", for: "2m 05s" },
44
+ { card: "ABC-2", state: "build done, then review", waiting: null, for: "12m 30s",
45
+ agent: { state: "blocked", kind: "permission", tab: "abc-2-a-card", label: "agent waiting on a permission prompt", for: "1m 10s", seconds: 70, pulls: [] } },
46
+ { card: "ABC-1", state: "plan done, then breakdown", waiting: null, for: "3d 04h" },
47
+ ],
48
+ };
49
+ const SAMPLE = {
50
+ run: 1,
51
+ state: "waiting on the human",
52
+ waiting: "waiting on the human for 2m 05s",
53
+ agent: { state: "conflict", kind: null, tab: null, label: "acme/api#7 in conflict, no agent running", for: "2m 05s", seconds: 125,
54
+ pulls: ["https://github.com/acme/api/pull/7"] },
55
+ steps: [
56
+ { run: 1, at: "a", clock: "10:00", kind: "start", label: "started", took: "", short: "" },
57
+ { run: 1, at: "b", clock: "10:00", kind: "step", label: "define done", took: "50s", short: "50s", summary: "A summary.", flags: "A flag." },
58
+ { run: 1, at: "c", clock: "10:09", kind: "wait", label: "answered", took: "waited 7m 04s", short: "7m 04s", answer: "approve" },
59
+ { run: 1, at: "d", clock: "10:17", kind: "step", label: "plan done", took: "7m 24s, includes waiting on the human", short: "7m 24s" },
60
+ { run: 1, at: "e", clock: "10:17", kind: "step", label: "breakdown asked a question", took: "5s", short: "5s", question: "Approve?", waiting: "waiting on the human for 2m 05s" },
61
+ ],
62
+ };
63
+
64
+ function find(node, id) {
65
+ if (node?.id === id) return node;
66
+ for (const child of node?.children ?? []) {
67
+ const found = find(child, id);
68
+ if (found) return found;
69
+ }
70
+ return null;
71
+ }
72
+
73
+ // The sidebar's rail goes by its width, as in Herdr's own lists.
74
+ const narrow = () => (find(layout(), "sidebar")?.size?.px ?? Infinity) < 160;
75
+
76
+ function parse(text) {
77
+ try {
78
+ return JSON.parse(text);
79
+ } catch {
80
+ return null;
81
+ }
82
+ }
83
+
84
+ // What Herdr shows of the tabs in the spaces whose folder is `folder`, on
85
+ // this computer: each tab's id and name, and each of its terminals' status
86
+ // and app. `task log` works out each card's agent from these, so a change in
87
+ // them is read at once. A pane's status has no word for hc's error, so each
88
+ // terminal's own word, from terminals(), is in it too.
89
+ function herdrSees(folder) {
90
+ if (folder === null) return "";
91
+ const word = new Map(terminals().map((t) => [t.address, t.status ?? null]));
92
+ const tabs = new Set();
93
+ const seen = [];
94
+ for (const space of spaces()) {
95
+ if (space.machine || space.folder !== folder) continue;
96
+ for (const tab of space.tabs) {
97
+ tabs.add(tab.id);
98
+ seen.push([tab.id, tab.name]);
99
+ }
100
+ }
101
+ for (const p of panes()) {
102
+ if (p.terminal && tabs.has(p.tab)) seen.push([p.tab, p.terminal, p.status, p.app, word.get(p.terminal) ?? null]);
103
+ }
104
+ return JSON.stringify(seen);
105
+ }
106
+
107
+ // What a view draws. Every read counts a card's seconds and an agent's on,
108
+ // and only the times drawn from them count.
109
+ function drawnOf(view) {
110
+ if (!view) return view;
111
+ const agent = (a) => (a ? { ...a, seconds: null } : a);
112
+ if (Array.isArray(view.cards)) return { ...view, cards: view.cards.map(({ seconds, ...c }) => ({ ...c, agent: agent(c.agent) })) };
113
+ return { ...view, agent: agent(view.agent) };
114
+ }
115
+
116
+ // What a failed command said, without the name it starts its errors with.
117
+ const said = (r) => (r.stderr || r.stdout).trim().replace(/^ocnus: /, "");
118
+
119
+ const OLD_CLI = "This ocnus is too old for the Steps panel. Run: ocnus update";
120
+ // An ocnus from before --json answers with its usage line, not JSON, and
121
+ // one from before the list of cards asks which card.
122
+ const failure = (r, what) => {
123
+ const text = said(r);
124
+ return text.startsWith("usage:") || text.startsWith("which card?") ? OLD_CLI : text || `${what} failed`;
125
+ };
126
+
127
+ // What is selected on this computer: the shown space's folder, the card its
128
+ // shown tab is for, if it is a card's tab, and which tab that is.
129
+ function selected() {
130
+ const space = spaces().find((s) => s.active && !s.machine) ?? null;
131
+ const tab = space?.tabs.find((t) => t.active) ?? null;
132
+ const card = tab && CARD.test(tab.name) ? tab.name.toUpperCase() : null;
133
+ return { folder: space?.folder ?? null, card, tab: `${space?.id ?? ""}\n${tab?.id ?? ""}` };
134
+ }
135
+
136
+ export default class Steps extends View {
137
+ init(_props, cx) {
138
+ this.cmd = "ocnus"; // the one on PATH, until that cannot start
139
+ this.listed = null; // the spaces ocnus listed last
140
+ this.listedAt = 0;
141
+ this.key = null; // what the view on hand was read for
142
+ this.space = null; // the ocnus space the shown Herdr space is, or null
143
+ this.picked = null; // a card chosen from the list, and the tab it was chosen in
144
+ this.view = null; // a card's steps, or the list of cards
145
+ this.error = null;
146
+ this.busy = false;
147
+ this.readAt = 0;
148
+ this.seen = null; // what Herdr showed of the space's tabs when it was read
149
+ this.drawn = null; // what the last redraw showed, to redraw only on a change
150
+ this.open = null; // the step whose lines are showing, by its time
151
+ if (checking()) return;
152
+ cx.timer.every(LOOK_MS, (cx) => this.look(cx));
153
+ this.look(cx);
154
+ }
155
+
156
+ // Runs the ocnus command. One that cannot run is tried again as the
157
+ // copy this mod is linked from: Herdr may have been started without the
158
+ // user's PATH. Everything this mod runs only reads, so twice is safe.
159
+ async ocnus(args) {
160
+ try {
161
+ return await exec(this.cmd, args, { timeout: TIMEOUT_MS });
162
+ } catch (e) {
163
+ if (this.cmd !== "ocnus") throw e;
164
+ const link = await exec("readlink", [`${appHome()}/mods/steps`]);
165
+ const at = link.stdout.trim();
166
+ if (link.code !== 0 || !at.endsWith(LINKED_AT)) throw e;
167
+ this.cmd = `${at.slice(0, -LINKED_AT.length)}/cli/ocnus`;
168
+ return exec(this.cmd, args, { timeout: TIMEOUT_MS });
169
+ }
170
+ }
171
+
172
+ // What the panel shows: the card of the selected tab; else the card chosen
173
+ // from the list; else the list. A card chosen from the list is let go as
174
+ // soon as another tab is seen selected, so coming back to that tab shows
175
+ // the list. The panel is drawn again whenever a tab is selected.
176
+ shown() {
177
+ const now = selected();
178
+ if (this.picked && (now.card || this.picked.tab !== now.tab)) this.picked = null;
179
+ const card = now.card ?? this.picked?.card ?? null;
180
+ return { folder: now.folder, card, picked: Boolean(this.picked), key: `${now.folder ?? ""}\n${card ?? ""}` };
181
+ }
182
+
183
+ // Show a card chosen from the list, or the list again with null.
184
+ pick(card, cx) {
185
+ this.picked = card ? { card, tab: selected().tab } : null;
186
+ this.open = null;
187
+ cx.notify();
188
+ this.look(cx);
189
+ }
190
+
191
+ // Read again when something else is to be shown, when Herdr's tabs in the
192
+ // space have changed, or when what is on hand is stale. Nothing is read
193
+ // while nobody can see the panel, and a space that is not an ocnus
194
+ // space has nothing to read again.
195
+ look(cx) {
196
+ if (this.busy || window()?.visible === false || narrow()) return;
197
+ const now = this.shown();
198
+ const seen = herdrSees(now.folder);
199
+ const stale = Boolean(this.space) && (Date.now() - this.readAt >= REREAD_MS || seen !== this.seen);
200
+ if (now.key === this.key && !stale) return;
201
+ this.busy = true;
202
+ cx.spawn(async (cx) => {
203
+ let space = null;
204
+ let view = null;
205
+ let error = null;
206
+ try {
207
+ if (!this.listed || Date.now() - this.listedAt > SPACES_MS) {
208
+ const r = await this.ocnus(["space", "ls", "--json"]);
209
+ const list = r.code === 0 ? parse(r.stdout)?.spaces : null;
210
+ if (Array.isArray(list)) {
211
+ this.listed = list;
212
+ this.listedAt = Date.now();
213
+ } else {
214
+ error = r.code === 0 ? OLD_CLI : failure(r, "ocnus space ls");
215
+ }
216
+ }
217
+ space = (this.listed ?? []).find((s) => s.folder === now.folder)?.name ?? null;
218
+ if (!error && space) {
219
+ const card = now.card ? [now.card] : [];
220
+ const r = await this.ocnus(["task", "log", space, ...card, "--json"]);
221
+ const got = r.code === 0 ? parse(r.stdout) : null;
222
+ if (got && Array.isArray(now.card ? got.steps : got.cards)) view = got;
223
+ else error = r.code === 0 ? OLD_CLI : failure(r, "ocnus task log");
224
+ }
225
+ } catch (e) {
226
+ error = `Could not run ocnus: ${e?.message ?? e}`;
227
+ }
228
+ this.key = now.key;
229
+ this.space = space;
230
+ this.view = view;
231
+ this.error = error;
232
+ this.readAt = Date.now();
233
+ this.seen = seen;
234
+ this.busy = false;
235
+ // A redraw of a mod redraws the whole window, so only when what it
236
+ // shows has changed.
237
+ const drawn = JSON.stringify([now.key, space, drawnOf(view), error]);
238
+ if (drawn !== this.drawn) {
239
+ this.drawn = drawn;
240
+ cx.notify();
241
+ }
242
+ // A card chosen while this was being read is read now, not at the
243
+ // next look.
244
+ if (this.shown().key !== now.key) this.look(cx);
245
+ });
246
+ }
247
+
248
+ // One card of the list: its ID and how long it has stood where it is,
249
+ // then where that is. When its agent is stuck or has stopped, that is shown
250
+ // in their place. A card waiting on the human stands out, and so does one
251
+ // whose agent is stuck. A click shows its steps.
252
+ card(c, i, t) {
253
+ const agent = c.agent ?? null;
254
+ const out = Boolean(c.waiting || agent);
255
+ return v_flex().id(`card-${i}`).flex_none().px(8).py(4).gap(1).rounded(8)
256
+ .hover((el) => el.bg(t.hover))
257
+ .on_click((_e, cx) => this.pick(c.card, cx))
258
+ .child(h_flex().gap(8).items_center()
259
+ .child(div().flex_1().min_w(0).truncate().text_color(t.foreground).child(c.card ?? ""))
260
+ .child(div().flex_none().text_size(11.5).text_color(out ? t.blocked : t.dim)
261
+ .child((agent ? agent.for : c.for) ?? "")))
262
+ .child(div().text_size(11.5).text_color(out ? t.blocked : t.muted).whitespace_normal()
263
+ .child((agent ? agent.label : c.state) ?? ""));
264
+ }
265
+
266
+ // What the card's agent is doing now, when it is stuck or has stopped: a
267
+ // line after its steps, as `task log` ends a card's log with `now:`.
268
+ now(agent, t) {
269
+ return h_flex().id("now").flex_none().px(8).py(4).gap(8).items_center()
270
+ .child(div().w(38).flex_none().text_size(11.5).text_color(t.dim).child("now"))
271
+ .child(div().flex_1().min_w(0).whitespace_normal().text_color(t.blocked).child(agent.label ?? ""))
272
+ .child(div().flex_none().text_size(11.5).text_color(t.blocked).child(agent.for ?? ""));
273
+ }
274
+
275
+ // The way from a card chosen from the list back to the list.
276
+ back(t) {
277
+ return div().id("back").flex_none().px(8).py(4).rounded(8).text_size(11.5).text_color(t.dim)
278
+ .hover((el) => el.bg(t.hover))
279
+ .on_click((_e, cx) => this.pick(null, cx))
280
+ .child("‹ All cards");
281
+ }
282
+
283
+ // One hand-off, on one line: its clock, its label and the time alone. A
284
+ // click opens the rest of what the view says about it. `s` is a step of the
285
+ // view, and its kind says whether it is a wait.
286
+ row(s, i, t, open) {
287
+ const wait = s.kind === "wait";
288
+ const start = s.kind === "start";
289
+ // An ocnus from before `short` gives the whole of `took` here.
290
+ const short = s.short ?? s.took ?? "";
291
+ const full = s.took && s.took !== short ? s.took : null;
292
+ const lines = [full, s.question, s.answer, s.reason, s.summary, s.flags ? `Flags: ${s.flags}` : null]
293
+ .filter(Boolean);
294
+ const small = (text, color) =>
295
+ div().pl(46).pr(4).text_size(11.5).text_color(color).whitespace_normal().child(text);
296
+ return v_flex().id(`step-${i}`).flex_none().px(8).py(4).gap(2).rounded(8)
297
+ .hover((el) => el.bg(t.hover))
298
+ .on_click((_e, cx) => {
299
+ this.open = this.open === s.at ? null : s.at;
300
+ cx.notify();
301
+ })
302
+ .child(h_flex().gap(8).items_center()
303
+ .child(div().w(38).flex_none().text_size(11.5).text_color(t.dim).child(s.clock ?? ""))
304
+ .child(div().flex_1().min_w(0).truncate()
305
+ .text_color(wait ? t.blocked : start ? t.muted : t.foreground).child(s.label ?? ""))
306
+ .child(div().flex_none().text_size(11.5).text_color(wait ? t.blocked : t.dim).child(short)))
307
+ // A question still waiting shows whether or not the step is open.
308
+ .when(Boolean(s.waiting), (el) => el.child(small(s.waiting, t.blocked)))
309
+ .when(open, (el) => el.children(lines.map((text) => small(text, t.muted))));
310
+ }
311
+
312
+ render() {
313
+ const t = theme();
314
+ const now = this.shown();
315
+ if (narrow()) return v_flex().size_full().bg(t.chrome);
316
+ const sample = checking();
317
+ const read = now.key === this.key;
318
+ const view = sample ? SAMPLE : this.view;
319
+ const list = sample ? SAMPLE_CARDS : this.view;
320
+ const note = (text, color) =>
321
+ div().px(8).py(6).text_size(12).text_color(color).whitespace_normal().child(text);
322
+ const items = [];
323
+ // The latest run only: a card written up twice keeps both in its log.
324
+ const steps = (view?.steps ?? []).filter((s) => s.run === view.run);
325
+ const cards = list?.cards ?? [];
326
+ const rows = () => {
327
+ // Where the card stands, as the view words it.
328
+ if (view.state) items.push(note(view.state, view.waiting ? t.blocked : t.dim));
329
+ steps.forEach((s, i) => items.push(this.row(s, i, t, sample || this.open === s.at)));
330
+ if (view.agent) items.push(this.now(view.agent, t));
331
+ };
332
+ // A card chosen from the list always has the way back, even while it
333
+ // loads or when it could not be read.
334
+ if (sample || now.picked) items.push(this.back(t));
335
+ if (sample) {
336
+ cards.forEach((c, i) => items.push(this.card(c, i, t)));
337
+ rows();
338
+ } else if (!read) items.push(note("Loading…", t.dim));
339
+ else if (this.error) items.push(note(this.error, t.blocked));
340
+ else if (!this.space) items.push(note("This space is not an ocnus space.", t.dim));
341
+ else if (now.card) {
342
+ if (steps.length === 0) items.push(note(`No hand-offs recorded for ${now.card} yet.`, t.dim));
343
+ else rows();
344
+ } else if (cards.length === 0) items.push(note("No hand-offs recorded in this space yet.", t.dim));
345
+ else cards.forEach((c, i) => items.push(this.card(c, i, t)));
346
+ return v_flex().size_full().min_h(0).bg(t.chrome).text_size(13)
347
+ .child(h_flex().h(31).flex_none().pl(16).pr(14).items_center().justify_between()
348
+ .text_size(11.5).text_color(t.dim)
349
+ .child("Steps")
350
+ .child(div().child(now.card ?? (read ? this.space : null) ?? "")))
351
+ .child(v_flex().id("step-list").flex_1().min_h(0).px(8).pb(14)
352
+ .overflow_y_scrollbar().mode("always").children(items));
353
+ }
354
+ }
@@ -0,0 +1 @@
1
+ { "place": "none", "title": "Steps" }
@@ -0,0 +1,19 @@
1
+ <!-- ocnus:template -->
2
+ <!-- Delete the line above once this doc is filled in. `ocnus status` reports the space as unfinished until then. -->
3
+
4
+ # __NAME__
5
+
6
+ One paragraph: what this space is, who it is for, and what "done" usually
7
+ looks like for a piece of work in it.
8
+
9
+ ## Repos
10
+
11
+ One section per repo in this space. An agent reads this to decide which
12
+ repo a piece of work belongs in, so be specific.
13
+
14
+ ### example-repo
15
+
16
+ - **Owns:** what lives here and nowhere else.
17
+ - **Does not own:** things people expect to find here but that live in
18
+ another repo, and which repo that is.
19
+ - **Run and test:** how to set it up and how to run its tests.
package/package.json CHANGED
@@ -1,6 +1,29 @@
1
1
  {
2
2
  "name": "@johngaynor/ocnus",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2.0.0",
4
+ "description": "A software factory: agent skills and the Herdr setup to run them, installed with one command.",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "ocnus": "cli/ocnus"
8
+ },
9
+ "files": [
10
+ "agents/",
11
+ "cli/ocnus",
12
+ "cli/host-mark",
13
+ "cli/lib/",
14
+ "herdr/",
15
+ "prompts/",
16
+ "skills/"
17
+ ],
18
+ "scripts": {
19
+ "test": "test/run.sh"
20
+ },
21
+ "os": [
22
+ "darwin",
23
+ "linux"
24
+ ],
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/johngaynor/ocnus.git"
28
+ }
29
+ }
@@ -0,0 +1,11 @@
1
+ Build Linear card {card}, which is approved and has its task started. This session is in the task's folder in the ocnus space `{space}`.
2
+
3
+ Start with the sdlc-build skill. Each skill ends by recording a hand-off with `ocnus task handoff {space} {card}`, as the skill describes. Record each one before you start the next skill, even though you carry straight on: the hand-offs are how I see how each step ended. You are driving this run, so act on the `status` you recorded:
4
+
5
+ - `done`: go straight on to the step in `next`, without waiting for me. `review` is the sdlc-review skill, which may come next from sdlc-pr too, once it has merged the default branch in to bring a pull request up to date, `build` is the sdlc-build skill again, which builds what the review step found not met, and `pr` is the sdlc-pr skill, which pushes the reviewed commits and opens the pull request.
6
+ - `needs-human`: wait for my answer. When it comes, record my answer as the skill describes, then carry on with the same skill. If I say "brief" or `/brief` while you wait, it is not my answer: give the brief, as the brief skill describes, record nothing, then ask the same question again.
7
+ - `failed`: stop there. Don't start the next skill.
8
+
9
+ Once sdlc-pr has opened the pull requests, you run no watch of your own. When every pull request for the card has merged, ocnus's watch records the merge, `pr` `done` with `next: merged`, and finishes the task with `ocnus task finish {space} {card}`, as the sdlc-pr skill says. Once your turn is over, it ends this session, then removes the task and closes this tab, which ends the run. So record no merge and run no `task finish` yourself. When it leaves the task as it is because removing it would lose work, `ocnus task log {space} {card}` shows what it named: tell me if I ask, and leave the task as it is. I merge the pull requests myself. Never merge one, and never turn on auto-merge.
10
+
11
+ Do every step yourself, in this session. Don't hand a step to a subagent.
@@ -0,0 +1,17 @@
1
+ Write up Linear card {card} so that it is ready to build. This session is in the ocnus space `{space}`.
2
+
3
+ Start with the sdlc-define skill. Each skill ends by recording a hand-off with `ocnus task handoff {space} {card}`, as the skill describes. Record each one before you start the next skill, even though you carry straight on: the hand-offs are how I see how each step ended. You are driving this run, so act on the `status` you recorded:
4
+
5
+ - `done`: go straight on to the step in `next`, without waiting for me. `plan` is the sdlc-plan skill and `breakdown` is the sdlc-breakdown skill.
6
+ - `needs-human`: wait for my answer. When it comes, record my answer as the skill describes, then carry on with the same skill. If I say "brief" or `/brief` while you wait, it is not my answer: give the brief, as the brief skill describes, record nothing, then ask the same question again.
7
+ - `failed`: stop there. Don't start the next skill.
8
+
9
+ If I ask for a change when I'm approving, sdlc-breakdown tells you which skill makes it. When that skill hands off, go back to sdlc-breakdown, not on to `next`.
10
+
11
+ Do every step yourself, in this session. Don't hand a step to a subagent.
12
+
13
+ sdlc-breakdown asks me to approve the card, and whether to start its build phase now or later. With the breakdown approval off (`ocnus approval --breakdown off`), sdlc-breakdown approves a card it has no doubt about by itself, without asking me, and asks me only about one it has a doubt about. When it hands off with `next: start`, the card is approved, and the work starts with:
14
+
15
+ ocnus task start {space} {card}
16
+
17
+ It names the branch from the type you set on the card and from its title. If the card was sliced, it takes a sub-issue's ID in place of {card}. sdlc-breakdown's Start the build phase says which, and what to do when it stops. Run it yourself only when I approved to start now. When I chose to start later, give it to me and don't run it. When the setting approved the card, run it yourself, as for an approval to start now. When sdlc-breakdown says to give the card's type and title, add `--type` and `--title` to the command, as the skill shows, whether you run it or give it to me.
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: brief
3
+ description: Catch the human up on a session in no more than five lines, in three parts (the original task, what has happened so far and what you are working on right now). Use this whenever the human says "brief" or `/brief`, in any Claude Code session, whatever you are doing or waiting on, and at every needs-human stop in a step skill, which opens with a brief. It records nothing, is never an answer to a question, and never stops a run.
4
+ ---
5
+
6
+ # Brief
7
+
8
+ When the human comes back to a long session, nothing in it says what the session is for or how far it has got. A brief says so in a few lines, so that they can answer or steer the session without scrolling back through it or opening the card.
9
+
10
+ A brief is not a step. It changes nothing, records nothing and ends nothing: once it is given, the session goes on as it was.
11
+
12
+ ## The brief
13
+
14
+ No more than five lines, in three parts, each starting with its name in bold:
15
+
16
+ - **Task:** the original task, in one line.
17
+ - **So far:** what has happened so far, in one to three lines.
18
+ - **Now:** what you are working on right now, in one line.
19
+
20
+ Write each line in plain words, for someone who knows the work but has been away from it. Leave out what the human can't act on, such as which files you read. Give no more than the five lines: they can ask for more.
21
+
22
+ ```
23
+ - **Task:** ABC-122, a Download CSV button on the orders page, under parent card ABC-100 Orders, in the Linear project Shop.
24
+ - **So far:** Written up, approved and started. The build step made the export in api and the button in web, in two commits, and the tests pass.
25
+ - **Now:** Checking the work against the card's Done when, item 2 of 3.
26
+ ```
27
+
28
+ ## Where each part comes from
29
+
30
+ ### In a session ocnus started for a card
31
+
32
+ The session's first message names a Linear card and an ocnus space, and has you record each hand-off for them. After a long run your memory of how it started may be gone, but the card, its log and its commits are not. So read them again for each brief, rather than going from memory:
33
+
34
+ - **Task:** `ocnus linear read <card>` gives the card's ask, in its title and its original description above the Specification, and, on lines of their own at the top, its parent card and its Linear project. Name the card, what it asks for, and its parent card and Linear project when it has them. When `ocnus linear read` can't read the card, because no Linear key is saved or Linear rejected the key, read it with the Linear tools.
35
+ - **So far:** `ocnus task log <space> <card>` gives each step recorded so far and how it ended. Once the task has started, the commits on the task's branch give what the build phase has made: `git log --oneline origin/<default branch>..HEAD` in each of the task's worktrees. What you say has happened agrees with both. Name the steps that are done and what came of them, not every row.
36
+ - **Now:** this comes from you: the step you are in and what you are doing in it, or the question you are waiting on.
37
+
38
+ ### In any other session
39
+
40
+ - **Task:** the session's first request, in a line.
41
+ - **So far:** what the conversation has done, and the commits it made, in `git log`, when you are working in a repo.
42
+ - **Now:** what you are doing, or the question you are waiting on.
43
+
44
+ ## A brief records nothing
45
+
46
+ A brief is not a hand-off, and not an answer. Never run `ocnus task handoff` for one: not for the brief, and not for the word "brief". So `ocnus task log` and the Steps panel read after a brief as they did before it, and a card that was waiting on the human still shows it is waiting. Write nothing on the card for it either.
47
+
48
+ ## After a brief
49
+
50
+ A brief never stops a run. Once it is given, go on as you were:
51
+
52
+ - **You were waiting on a `needs-human` question.** "brief" is never an answer, and nor is `/brief`. Give the brief, with the question as what is happening now, and record nothing. Then ask the same question again, ending your message with the block the command printed when you recorded the question, without recording it again, and wait for the answer. When the human's message gives an answer as well as asking for a brief, give the brief, then take the answer as the step skill says.
53
+ - **You were in the middle of a step.** Give the brief, then carry on with the step where you left it, without waiting for a reply.
54
+ - **In any other session.** Give the brief, then go on with what you were doing, or ask again what you were asking.
55
+
56
+ ## At a needs-human stop
57
+
58
+ Every `needs-human` stop in the six step skills, the `sdlc-*` ones, opens with a brief, as their section "The handoff block" says. It has the same three parts, and **Now:** is the question you are asking. It goes above the hand-off block in your message, and is in the session only: the hand-off you record holds what it always has.
59
+
60
+ ```
61
+ - **Task:** ABC-122, a Download CSV button on the orders page, in the Linear project Shop.
62
+ - **So far:** Wrote the Specification and the Plan. The card is one piece.
63
+ - **Now:** Asking you to approve ABC-122 as written up, and whether to start its build phase now.
64
+ ```