@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,339 @@
1
+ ---
2
+ name: sdlc-pr
3
+ description: Put a reviewed Linear card up as pull requests, by pushing the task's branch in each repo the work changed, opening a pull request into that repo's default branch that names the card and says how the review step showed each Done when item, moving the card to In Review once they are all open, waiting for the human to merge them, which ocnus's watch sees on GitHub and records before it finishes the task, making in the same pull requests any change they ask for in the tab, and bringing one that comes to conflict with its default branch up to date when ocnus's watch wakes it. Use this once sdlc-review has handed off done with pr next, whenever asked to push, open the pull request for, or put up a reviewed card in its task, even if the request only says "pr ABC-123". It never merges a pull request.
4
+ ---
5
+
6
+ # Open the pull request
7
+
8
+ Pull request is the step after the review step. The build step made the change the Plan describes and committed it on the task's branch, and the review step checked that work against the card's Done when and wrote what it found on the card as its Review. This step pushes the branch, opens a pull request in each repo the work changed, moves the card to In Review once they are all open, waits while the human merges them, makes in the same pull requests any change they ask for in the tab while they wait, and brings a pull request up to date when it comes to conflict with its default branch. It runs no watch of its own. ocnus's watch on the merges sees what happens to the pull requests on GitHub: it wakes this session for a conflict or a pull request closed without merging, and once they have all merged it records the merge, without the human having to say so, and finishes the task, which removes its worktrees and closes its tab.
9
+
10
+ The human reads the pull request, not this session. So each pull request has to name the card and say, for each Done when item, how the review step showed that it is met and what is left to the human to check.
11
+
12
+ The human merges. Never run `gh pr merge`, not even with `--auto`, and never turn on auto-merge in the repo's settings on GitHub. Push the task's branch and nothing else, and never forced.
13
+
14
+ ## Before you push anything
15
+
16
+ 1. Get the card. If you weren't given a card ID, ask for one.
17
+ 2. Read the card with `ocnus linear read <card ID>`: the original description, the Specification, the Plan, the Breakdown, the Review and the comments.
18
+ 3. If the card has no Plan, it was not approved to build. Push nothing, and hand off as `failed`, saying so.
19
+ 4. If the Breakdown cut the card into several slices, each slice is a sub-issue that is built, reviewed and put up as a pull request on its own. Push nothing, and hand off as `failed`, naming the sub-issue that comes first.
20
+ 5. Open nothing unless the Review passed the work. The `sdlc-review` skill writes the Review on the card, as a collapsed section after the Breakdown, and marks each Done when item **Met.**, **Not met.** or **For the human.** If the card has no Review, an item in it is **Not met.**, or it says a test fails that the human did not let stand, the work has not passed: push nothing, and hand off as `failed`, saying which. An item **For the human.** does not hold the pull request back, and nor does a test the human let stand. Each goes in the description, as what is left to the human.
21
+ 6. Check where you are, as the build step did. The work is in the task's worktrees, which `ocnus task start` made under the space's `tasks/` folder, one for each repo, all on the task's branch. Run `git branch --show-current` in each one. The branch has to name this card, as in `feat/abc-122-short-name`. If you are in a repo's own checkout, on its default branch, or on a branch for another card, push nothing and hand off as `failed`, saying where you are.
22
+ 7. Run `git status` in each worktree. The review step leaves nothing uncommitted, and nothing uncommitted goes into a pull request. If a worktree has changes, push nothing, and hand off as `failed`, naming the worktree and its changed files.
23
+
24
+ ## 1. Find what the work changed
25
+
26
+ The task started from each repo's default branch, so the work is the commits that branch doesn't have. In each worktree, run `git fetch origin`, then `git log --oneline origin/main..HEAD`, with the repo's own default branch in place of `main`. `git symbolic-ref --short refs/remotes/origin/HEAD` names it, as `origin/<branch>`.
27
+
28
+ The worktrees with commits ahead of the default branch are the repos the work changed. Each of them gets a pull request, and no other. A worktree with no `origin`, or one whose fetch fails, is held to its local default branch instead (`git log --oneline main..HEAD`): with no commits there it needs no pull request, and with commits the checks in section 2 stop the push.
29
+
30
+ If no worktree has commits ahead of its default branch, there is nothing to open. Hand off as `failed`, saying so.
31
+
32
+ ## 2. Check that you can push
33
+
34
+ Check everything that could stop the push or the pull request before you push anything, so that nothing goes up by half. When a check fails, push nothing, not even in a worktree that passed it, and hand off as `failed`, with the reason and what the human can run to put it right.
35
+
36
+ 1. Run `gh auth status`. If `gh` is missing or not signed in to GitHub, the reason is that, and what to run is `gh auth login`.
37
+ 2. In each worktree with commits, run `git remote get-url origin`. A repo with no `origin` can't be pushed: what to run is `git remote add origin <the repo's URL>`.
38
+ 3. In each of those worktrees, run `gh repo view --json nameWithOwner,defaultBranchRef`. It has to know the repo, and the default branch it gives is the one the pull request goes into. If it gives another branch than section 1 used, find the commits again against this one. If it fails, give what it said.
39
+
40
+ ## 3. Read how the repo takes a pull request
41
+
42
+ Read the guidance in each worktree with commits: its `CLAUDE.md`, `AGENTS.md`, `README` and any `CONTRIBUTING` file, and its pull request template, `.github/pull_request_template.md`. GitHub also takes the template at the repo's root, in `docs/`, or as a file in `.github/PULL_REQUEST_TEMPLATE/`. Look for three things:
43
+
44
+ - **How a pull request is written.** The form of its title, the sections its description must have, and a line or a checklist it must hold.
45
+ - **How commits are written.** The review step checked the commits, and its Review says so in its **Commits:** line. If that line names a commit that breaks one of the repo's rules, push nothing and ask the human whether to open the pull request anyway, in a handoff block with `status: needs-human`. Rewriting commits is not for this step.
46
+ - **Rules for a change like this one.** A version that only a release changes, or a file that must not be in a commit. Check the commits against a rule the Review does not mention, and ask the human the same way if one breaks it.
47
+
48
+ ## 4. Push the branch and open the pull request
49
+
50
+ **Back from section 8.** When this step runs again after section 8 brought a pull request up to date and the review step passed the work again, the pull requests are open already: `ocnus task log <space> <card ID>` shows the last `pr` hand-off as `done`, with `review` next. Push only a branch that moved. In each worktree with commits, run `git fetch origin`, then `git log --oneline origin/<branch>..HEAD`: when it shows nothing, GitHub has every commit already, so push nothing in that worktree and leave its pull request as it is, open or merged. A branch that moved goes through the list below, but its pull request keeps the title and the description it has, **Changes asked for:** lines and all. Read the description with `gh pr view <url> --json body`, add a line at its end under **Brought up to date:**, putting that heading in the first time, and give it to `gh pr edit` in item 5. The line says what the hand-off of section 8 said in its summary: the merge commit, the files that conflicted and what the fix changed.
51
+
52
+ For each worktree with commits, and no other:
53
+
54
+ 1. Push the task's branch: `git push -u origin <branch>`. It is never forced: no `--force` and no `--force-with-lease`. If the push is refused, for example because the branch on GitHub has commits this one doesn't, don't force it, pull or rebase. Hand off as `failed`, with what git said, and name any repo already pushed.
55
+ 2. Write the title by the repo's rules. Where it has none, write it as the build step's commits are written, such as `feat: export orders as CSV`.
56
+ 3. Write the description, by the repo's template where it has one. It links the card, with its ID and its Linear URL. It lists each Done when item, in the card's words, with how the review step showed it, taken from the Review. An item for the human says what is left to the human: what to run, and what they should see. When the card has pull requests in several repos, each one links the others.
57
+ 4. Write the description to a file, and give it with `--body-file`. On the command line, the shell would run what is between backticks in it.
58
+ 5. Run `gh pr list --head <branch> --state open --json number,url`. If the branch already has an open pull request, update it with `gh pr edit <number> --title <title> --body-file <file>` rather than opening another. Otherwise open one into the default branch: `gh pr create --base <default branch> --head <branch> --title <title> --body-file <file>`. If it fails, hand off as `failed`, with what `gh` said and which branches are already pushed.
59
+ 6. With several repos, open them all first, then edit each description to link the others.
60
+ 7. Read each pull request back with `gh pr view <url> --json url,title,body,baseRefName,headRefName`, and check that it goes from the task's branch into the default branch and that its description says what you wrote.
61
+
62
+ Then, once every pull request is open and read back, move the card in Linear to its team's last started status, In Review:
63
+
64
+ ```sh
65
+ ocnus linear move <card ID> review
66
+ ```
67
+
68
+ Run it once, after the last pull request is read back, never in the list above: with pull requests in several repos, the card does not move before the last one is open. The status is picked by its kind and its place in the team's order, so in a team with only one started status the card stays in it. A card that is there already, further on, done or canceled stays where it is, and the command says so. Change nothing else on the card.
69
+
70
+ If the command exits non-zero, the card was not moved, and what it printed says why, such as Linear out of reach or a key without Write permission. Don't stop for it, don't run it again, and don't move the card some other way: go on to wait for the merge. Say in the summary of the hand-off that waits that the card was not moved, and why: `ocnus task log` shows it there, since the hand-off that ends the card is ocnus's watch's, not yours.
71
+
72
+ ## 5. Wait for the merge
73
+
74
+ With every pull request open, hand off as `needs-human` with their links:
75
+
76
+ ```
77
+ ocnus task handoff <space> <card ID> <<'EOF'
78
+ step: pr
79
+ status: needs-human
80
+ summary: <the pull requests opened, one for each repo the work changed, what is left to the human in them, and why the card was not moved to In Review, if it was not>
81
+ question: Merge <the link of each pull request>. ocnus's watch sees the merge on GitHub and records it; tell me here if you want a change instead.
82
+ options: merged | a change you want made | stop here
83
+ EOF
84
+ ```
85
+
86
+ Then wait, and run nothing in the background: no watch of your own, and nothing else that asks GitHub. ocnus has one watch on the pull requests of every card that waits on its merge, `ocnus task merges`, in a herdr-core terminal of its own, and recording this hand-off wakes it. It asks GitHub about them every minute, however long they have been open, and whatever this session is doing. Once every pull request for the card has merged, it records the merge and finishes the task, as section 7 says. When one comes into conflict with its default branch, or is closed without merging, it wakes you, as below. When it cannot ask GitHub, as with `gh` signed out, `ocnus status` and `ocnus task log` say so to the human, and it asks again each minute: that needs nothing from you.
87
+
88
+ When the human answers in the tab, record the answer first, as the handoff block section says. Then:
89
+
90
+ - **They say it has merged.** Hand off as `needs-human` again, with the same question, saying in the summary that ocnus's watch records the merge within a minute. Then do nothing more: check nothing on GitHub, record no merge and run no `task finish`. The hand-off keeps the card waiting on its merge, and wakes ocnus's watch if it is not running. A pull request that has not merged yet is still waited on.
91
+ - **They ask for a change.** Make it as section 6 says, then wait again.
92
+ - **They say to stop.** Hand off as `failed`, with the pull requests that are still open in `reason`. Leave them open, as they are.
93
+
94
+ Whatever happens, the human merges. Never run `gh pr merge` yourself, never turn on auto-merge, and never close a pull request.
95
+
96
+ ocnus's watch wakes you when a pull request for the card comes into conflict with its default branch, or is closed without merging. Its message comes in the tab, as if typed, and starts with `ocnus-merges:`, naming the pull request and what was seen. When this session had exited, ocnus starts it again with that message, by running `ocnus task build <space> <card ID> --continue` in the tab. The message is not the human's answer, but record what it saw first, as the answer:
97
+
98
+ ```
99
+ ocnus task handoff <space> <card ID> <<'EOF'
100
+ step: pr
101
+ status: answered
102
+ answer: in conflict on GitHub, seen by ocnus's watch, <its link>
103
+ EOF
104
+ ```
105
+
106
+ For one that was closed, the answer is `closed on GitHub, seen by ocnus's watch, <its link>`. Then take it up, starting no watch:
107
+
108
+ - **A pull request in conflict.** Bring it up to date as section 8, "Bring a pull request up to date", says, without asking the human first.
109
+ - **A pull request closed without merging.** Ask the human whether to stop here, as `needs-human`, naming it. If they want it stopped, hand off as `failed`, with the pull request that was closed in `reason`. Run no `task finish`, whatever they answer. A card whose pull request was closed never reaches section 7, so its task stays as it is, with its work. If they reopen it, hand off as `needs-human` again, with the links, and wait as above.
110
+
111
+ ocnus wakes you once for each conflict or closed pull request, not again while it stays so, and never for one you recorded and are asking the human about. A pull request that leaves conflict and comes back to it wakes you again.
112
+
113
+ ## 6. Make a change asked for in the tab
114
+
115
+ The human reads the pull requests, and may want something changed before they merge. They say so in the tab, as their answer to the wait. The change goes into the same pull requests: on the task's branch, in the worktree of the repo it belongs in. Only what the human says in the tab is a change to make here. Comments from a GitHub review, and CI results, are not read in this step.
116
+
117
+ Ask first, as `needs-human`, before you make a change that would alter what the human approved on the card: one that adds, drops or changes a Done when item, takes another approach than the Plan's, or brings in a new dependency. Ask first too when the change belongs in a repo that has no open pull request for the card, because the pull request there has merged or there never was one; `gh pr view <url> --json state` says which. Say what the change would alter, and make it only once they say yes. A repo that has no open pull request gets one once the change is pushed, opened as section 4 says.
118
+
119
+ Then, for each change asked for:
120
+
121
+ 1. Make it in the worktree, on the task's branch, as the build step does: by the repo's rules for a change like this one, which section 3 found, and with a test where it changes what the code does, written first and seen to fail.
122
+ 2. Run the repo's whole test suite, once, through `ocnus tests run` as the build step does, keeping what it prints, in a file if it is long. If a test fails, other than one the human let stand, find out why and fix it. Change a test only when the change asked for changes what that test checks. If the tests can't be made to pass, commit and push nothing, leave the change in the worktree as it is, and hand off as `failed`, with the failing tests and what you tried in `reason`. The pull requests stay open as they are.
123
+ 3. Commit on the task's branch with `git commit`, by the repo's rules for commits. Don't skip its commit hooks. `git status` shows no changes after.
124
+ 4. Push it with `git push`, never forced. If the push is refused, don't force it, pull or rebase. Hand off as `failed`, with what git said.
125
+ 5. Add what changed to the pull request's description, so whoever reads it sees what was asked for and which commit made it. Read the description with `gh pr view <url> --json body`, add a line for the change under **Changes asked for:** at its end, putting that heading in the first time, write it to a file, and give it with `gh pr edit <number> --body-file <file>`.
126
+ 6. Read the pull request back with `gh pr view <url> --json body,commits`, and check that its description says what you wrote and that the new commit is in it.
127
+
128
+ Then hand off as `needs-human` again, with the links, and wait as section 5 says. ocnus's watch asks GitHub about a pull request just opened for the change at its next pass:
129
+
130
+ ```
131
+ ocnus task handoff <space> <card ID> <<'EOF'
132
+ step: pr
133
+ status: needs-human
134
+ summary: <the change made, the commit in each pull request that makes it, and that the tests pass>
135
+ question: Merge <the link of each pull request>. ocnus's watch sees the merge on GitHub and records it; tell me here if you want a change instead.
136
+ options: merged | a change you want made | stop here
137
+ EOF
138
+ ```
139
+
140
+ ## 7. When the pull requests have merged
141
+
142
+ Record no merge, and run no `task finish`: ocnus's watch does both, whatever this session is doing. Once GitHub shows every pull request for the card merged, its next pass, within a minute or so, records the human's answer, `merged on GitHub, seen by ocnus's watch`, then the hand-off that ends the card:
143
+
144
+ ```
145
+ step: pr
146
+ status: done
147
+ next: merged
148
+ summary: Merged on GitHub: <each pull request>. Recorded by ocnus's watch.
149
+ ```
150
+
151
+ `merged` is where the card ends. No step comes after it, and nothing hands off as it. Recording it moves the card to Done in Linear.
152
+
153
+ Then the watch finishes the task, with `ocnus task finish <space> <card ID>`, the run's last command. It removes the task's worktrees, deletes the task's branch in each repo, removes the task's folder and then closes the task's tab: the tab this session runs in when `ocnus task build` started it. While you are idle in the tab, your turn over, the watch first ends this session with `/exit`, as `ocnus task close` ends one. While you are busy, it leaves the card for a later pass, so end your turn once you have handed off. The branch on GitHub is left alone: the repo's own settings delete it or keep it.
154
+
155
+ `task finish` checks every repo before it removes anything. If removing the task would lose work, it removes nothing, and names each thing that would be lost under the repo it is in: changes that are not committed, commits that are not in the default branch, such as a fix pushed after the merge, and ignored files that the repo's setup does not make again, such as a design doc or an `.env`. The watch then leaves the task as it is, with everything it named on the merge's flags, as `task not finished: …`, which `ocnus task log <space> <card ID>` shows. It does the same when this session does not exit after `/exit`, with `task not finished: its agent did not exit`. What to keep is the human's call. Record no other hand-off for it, and change nothing more. Don't commit, push or remove anything to get `task finish` through, and don't remove the task by hand.
156
+
157
+ When `ocnus task handoff` refuses a block, saying that the card's merge is recorded already, ocnus's watch has recorded the merge. Record nothing more for the card, and run no `task finish`. Tell the human that ocnus's watch recorded the merge, and that `ocnus task log <space> <card ID>` shows under the merge anything that kept it from finishing the task. Then change nothing more.
158
+
159
+ ## 8. Bring a pull request up to date
160
+
161
+ ocnus's watch wakes you when a pull request is in conflict with its default branch: the default branch has moved on since the task started, and GitHub cannot merge the two as they are. Bring it up to date without asking the human, so that it is ready to merge when they come to it. Bring up to date only each pull request ocnus's watch named in conflict: a pull request with no conflict gets no push.
162
+
163
+ Take the default branch by a merge, never a rebase. A rebase rewrites the branch, and only a forced push would put it on GitHub, which this step never makes.
164
+
165
+ In the worktree of each repo whose pull request is in conflict, on the task's branch:
166
+
167
+ 1. Run `git fetch origin`, then `git merge origin/<default branch>`, with the default branch section 2 found. git stops with the files in conflict, and `git status` lists them. Note them: the hand-off and the pull request name them. When git merges it with no conflict, as it does when the default branch has moved again since GitHub looked, it commits the merge itself: go on to item 3.
168
+ 2. Resolve each one, keeping both what the card's work does and what the default branch has done since. `git log HEAD..origin/<default branch> -- <file>` lists the commits that changed it there.
169
+ 3. Run the repo's whole test suite through `ocnus tests run`, as section 6 does. If a test fails, other than one the human let stand, find out why and fix it. Change a test only when the default branch changed what that test checks. The review step that follows in this session relies on this run, so the suite runs once on the merge.
170
+ 4. Commit the merge with `git commit`, by the repo's rules for commits. Where they say nothing of a merge, keep the message git wrote for it, with `git commit --no-edit`. Don't skip its commit hooks. A fix the tests needed goes in the merge, or in a commit after it. `git status` shows no changes after.
171
+ 5. Push nothing yet. The review step checks the merge first, and section 4 pushes it once the review step has passed the work again.
172
+
173
+ Ask the human only when you cannot settle the conflict: when the tests cannot be made to pass, or when a resolution would change what a Done when item says, such as when the default branch now does what an item asks for in another way, or has taken away something the work builds on. Then leave the merge in the worktree as it is, and hand off as `needs-human`, naming the pull request and the files in conflict:
174
+
175
+ ```
176
+ ocnus task handoff <space> <card ID> <<'EOF'
177
+ step: pr
178
+ status: needs-human
179
+ summary: <why it cannot be settled: the tests that fail and what you tried, or the Done when item a resolution would change, and how>
180
+ question: <the pull request> is in conflict with <the default branch> in <the files in conflict>. <the resolution you recommend>?
181
+ options: <your recommendation> | <another resolution> | stop here
182
+ EOF
183
+ ```
184
+
185
+ Until they answer, commit and push nothing. When they answer, record the answer first, as the handoff block section says, then settle the conflict the way they say, from item 2 above. If they say to stop, hand off as `failed`, with the pull request and the files in conflict in `reason`, and leave the merge in the worktree as it is, for them.
186
+
187
+ Once the merge is committed and the tests pass, record the hand-off:
188
+
189
+ ```
190
+ ocnus task handoff <space> <card ID> <<'EOF'
191
+ step: pr
192
+ status: done
193
+ next: review
194
+ summary: <the pull request brought up to date, the merge commit, the files that conflicted and what the fix changed, and that the tests pass>
195
+ EOF
196
+ ```
197
+
198
+ The step that follows is the `sdlc-review` skill. It checks each Done when item again, now with the merge commit, revises the card's Review, and hands back to this step with `pr` next. This step then runs again from the top. Section 4 finds the pull requests open, pushes only the branch that moved, never forced, and adds the **Brought up to date:** line to its description. Section 5 waits for the merge again.
199
+
200
+ ## The handoff block
201
+
202
+ Every step of the lifecycle ends the same way, so whoever is driving it, a person or a script, can tell how the step ended without reading the whole session.
203
+
204
+ Record a hand-off every time this step ends or pauses: when the step is finished, when you need an answer, and when something has gone wrong. Record it even when you go straight on to another step, because the record is what shows this one ended. Run `ocnus task handoff` with the block on stdin, one value per line:
205
+
206
+ ```
207
+ ocnus task handoff <space> <card ID> <<'EOF'
208
+ step: <this step>
209
+ status: <done, needs-human or failed>
210
+ next: <the step that follows>
211
+ summary: <one to three sentences on what you did>
212
+ flags: <what the human should know but wasn't asked>
213
+ question: <one question>
214
+ options: <the answers you expect, your recommendation first, separated by " | ">
215
+ answer: <what the human said, in a few words>
216
+ reason: <what went wrong, and what you already tried>
217
+ EOF
218
+ ```
219
+
220
+ `<space>` is the ocnus space this session is in. The `step:` line names this step. The words in angle brackets are hints: put your own in their place. The command checks the block, records it and prints it back. Which lines you write depends on the status:
221
+
222
+ | Status | Use it when | Lines |
223
+ |---|---|---|
224
+ | `done` | This step's work is on the card and you have read it back | `step`, `status`, `next`, `summary`, and `flags` if there are any |
225
+ | `needs-human` | You can't go on without an answer or an approval | `step`, `status`, `question`, `options`, and `summary` if it helps them answer |
226
+ | `answered` | The human has replied to a `needs-human` hand-off | `step`, `status`, `answer` |
227
+ | `failed` | Something is missing or went wrong, and this skill tells you to stop or doesn't cover it | `step`, `status`, `reason` |
228
+
229
+ - **If the command refuses the block, fix what it names and run it again.** If it can't record at all, because the command is missing, you are not in an ocnus space, or it says the hand-off was not recorded, write the block in your message instead and carry on. Don't make a space or install anything to get it to run.
230
+ - **When you stop for the human, end your message with the block the command printed.** At a `needs-human` stop, open your message with a brief: the one the `brief` skill gives, with the question as what is happening now. The brief goes above the block. Between them, or above the block at any other stop, goes only what the human needs and can't read on the card: a section you could not write there, or the summary they approve from.
231
+ - **Wherever this skill says to ask, tell or stop, use the block.** An ask is `needs-human`. Something to tell goes in `flags`. A stop because something is missing or went wrong is `failed`.
232
+ - **`needs-human` is a pause, not an ending.** Wait for the answer. When it comes, record it before anything else, as a hand-off with `status: answered` and what they said in a few words. That is how the time spent waiting on them is told from your own work. Then carry on with this step. The step is over only at `done` or `failed`.
233
+ - **Ask one question per block.** If you have two, ask first the one whose answer could change the other. The human can always answer in their own words, so `options` are suggestions.
234
+ - **After `done`, this step is over.** Record the hand-off before anything else. If another step sent you here to revise this section, go back to that step and ignore `next`. Otherwise go on to the step in `next` only if you were asked to run more than this one step, and if you weren't, stop there.
235
+ - **After `failed`, change nothing more.** Leave the card as it is for the human.
236
+
237
+ ## If something goes wrong
238
+
239
+ | When this happens | Do this |
240
+ |---|---|
241
+ | The card ID doesn't resolve | Ask the human for the ID. Don't pick a card because its title looks similar |
242
+ | The Linear tools aren't available | Hand off as `failed`. Don't open a pull request from memory of the card or from its title |
243
+ | `ocnus linear read` says no Linear key is saved or that Linear rejected the key, or the command isn't there | Read the card with the Linear tools instead, and say so in `flags` when you hand off |
244
+ | `gh` is missing or not signed in | Hand off as `failed`, saying to run `gh auth login`. Push nothing |
245
+ | A repo with commits has no `origin`, or `gh repo view` doesn't know it | Hand off as `failed`, naming the repo and what to run. Push nothing, in any repo |
246
+ | The push is refused | Hand off as `failed`, with what git said. Never force it, and don't pull or rebase to get it through |
247
+ | `gh pr create` or `gh pr edit` fails | Hand off as `failed`, with what `gh` said and which branches are already pushed |
248
+ | The branch already has an open pull request | Update it with `gh pr edit`. Don't open a second one |
249
+ | `ocnus linear move` exits non-zero | The card was not moved. Say so, and why, in the summary of the hand-off that waits, and go on to wait for the merge. Don't move it with the Linear tools |
250
+ | The human says it has merged | Record their answer, then hand off `needs-human` again, saying that ocnus's watch records the merge within a minute. Check nothing on GitHub, record no merge and run no `task finish` |
251
+ | A pull request was closed without merging | Ask the human whether to stop. Don't reopen it or open another, and run no `task finish`: the task stays |
252
+ | A pull request is in conflict, and the tests cannot be made to pass or a resolution would change what a Done when item says | Hand off as `needs-human`, naming the pull request and the files in conflict, as section 8 says. Commit and push nothing until the human answers. Never rebase, and never force a push to get past it |
253
+ | A message from `ocnus-merges` in the tab says a pull request is in conflict or was closed | Record it first, as the answer: `in conflict on GitHub, seen by ocnus's watch, <its link>`, or `closed on GitHub, seen by ocnus's watch, <its link>`. Then bring it up to date as section 8 says, or ask the human whether to stop. Start no watch |
254
+ | `ocnus task handoff` refuses a block, saying that the card's merge is recorded already | ocnus's watch recorded the merge. Record nothing more for the card, and run no `task finish`: tell the human so, and that `ocnus task log` shows under the merge anything that kept it from finishing the task |
255
+ | `task finish` refuses, as `task not finished: …` under the merge in `ocnus task log` shows | ocnus's watch left the task as it is. When the human asks, tell them everything it named. Record no other hand-off, and change nothing to get it through |
256
+ | The human asks for a change | Make it as section 6 says, push it and wait again. Ask first if it would alter what they approved on the card |
257
+ | The tests fail after a change asked for, and can't be made to pass | Hand off as `failed`, with the failing tests. Commit and push nothing, and leave the pull requests open |
258
+
259
+ If something fails that isn't on this list, stop and tell the human what happened. Don't work around it, and never merge a pull request to get past it.
260
+
261
+ ## Example
262
+
263
+ **From the card's Review**
264
+
265
+ ```
266
+ >>> ## Review
267
+ Round 1, on api 3f2a91c and web 8d04e17. The tests pass in both.
268
+
269
+ - **Met.** Button shows for a manager: `OrdersPage.test.tsx` renders the page as a manager and as a clerk, and finds the button only for the manager.
270
+ - **Met.** Columns, and one row per order: `test_orders_export.py` checks the columns, and that a file of three orders has three rows.
271
+ - **For the human.** Opens in a spreadsheet: download the file from the orders page, and open it in a spreadsheet app.
272
+
273
+ **Commits:** both follow the repo's rules.
274
+ >>>
275
+ ```
276
+
277
+ **The description of the pull request in api**
278
+
279
+ ```
280
+ Builds [ABC-122](https://linear.app/acme/issue/ABC-122/export-orders-as-csv): Export orders as CSV. The web side is in acme/web#88.
281
+
282
+ **Done when:**
283
+
284
+ - **Met.** A manager sees a Download CSV button: `OrdersPage.test.tsx` renders the page as a manager and as a clerk, and finds the button only for the manager.
285
+ - **Met.** The file has the order's columns, and one row per order: `test_orders_export.py` checks the columns, and that a file of three orders has three rows.
286
+ - **Left to you.** The file opens in a spreadsheet: download it from the orders page, and open it in a spreadsheet app.
287
+ ```
288
+
289
+ **The hand-offs**
290
+
291
+ ```
292
+ ocnus task handoff shop ABC-122 <<'EOF'
293
+ step: pr
294
+ status: needs-human
295
+ summary: Opened acme/api#141 and acme/web#88 into main, each linking the card and the other, and moved ABC-122 to In Review. One item is left to you: open the file in a spreadsheet.
296
+ question: Merge https://github.com/acme/api/pull/141 and https://github.com/acme/web/pull/88. ocnus's watch sees the merge on GitHub and records it; tell me here if you want a change instead.
297
+ options: merged | a change you want made | stop here
298
+ EOF
299
+ ```
300
+
301
+ ```
302
+ ocnus task handoff shop ABC-122 <<'EOF'
303
+ step: pr
304
+ status: answered
305
+ answer: name the file by the day it was made
306
+ EOF
307
+ ```
308
+
309
+ ```
310
+ ocnus task handoff shop ABC-122 <<'EOF'
311
+ step: pr
312
+ status: needs-human
313
+ summary: The file is named orders-YYYY-MM-DD.csv now, with its test, in commit 5c1e0d2 on acme/api#141, and its description lists the change. Both test suites pass.
314
+ question: Merge https://github.com/acme/api/pull/141 and https://github.com/acme/web/pull/88. ocnus's watch sees the merge on GitHub and records it; tell me here if you want a change instead.
315
+ options: merged | a change you want made | stop here
316
+ EOF
317
+ ```
318
+
319
+ ```
320
+ ocnus task handoff shop ABC-122 <<'EOF'
321
+ step: pr
322
+ status: answered
323
+ answer: merged
324
+ EOF
325
+ ```
326
+
327
+ ```
328
+ ocnus task handoff shop ABC-122 <<'EOF'
329
+ step: pr
330
+ status: needs-human
331
+ summary: You say both have merged. ocnus's watch records the merge within a minute, then finishes the task and closes this tab.
332
+ question: Merge https://github.com/acme/api/pull/141 and https://github.com/acme/web/pull/88. ocnus's watch sees the merge on GitHub and records it; tell me here if you want a change instead.
333
+ options: merged | a change you want made | stop here
334
+ EOF
335
+ ```
336
+
337
+ **What ocnus's watch then records**
338
+
339
+ The human's answer, `merged on GitHub, seen by ocnus's watch`, then `pr` `done` with `merged` next, naming both pull requests. Then it ends this session with `/exit`, and runs `ocnus task finish shop ABC-122`.
@@ -0,0 +1,227 @@
1
+ ---
2
+ name: sdlc-review
3
+ description: Review a built Linear card in its task before anything is pushed, by running the tests, checking each Done when item against the Plan's tests, writing what was found on the card as its Review, and sending what is not met back to the build step. Use this once sdlc-build has handed off done, whenever asked to review, check or verify a built card in its task, even if the request only says "review ABC-123". It changes no code, pushes nothing and opens no pull request.
4
+ ---
5
+
6
+ # Review a card
7
+
8
+ The review step comes after the build step. The build step made the change the Plan describes and committed it on the task's branch. The review step checks that work against the card's Done when before anyone else sees it, and sends what falls short back to the build step. It also comes after the `sdlc-pr` skill when that step has merged the default branch into the task's branch, to bring a pull request in conflict up to date: the merge is checked before it is pushed.
9
+
10
+ The human is not watching while it runs. They read the card's Review and the hand-off afterwards, so the Review has to say of each Done when item whether it is met and how that was shown, and the hand-off has to say plainly how the review step ended.
11
+
12
+ The review step changes no code. Push nothing and open no pull request. What falls short goes back to the build step, and pushing and the pull request come after this step.
13
+
14
+ ## Before you check anything
15
+
16
+ 1. Get the card. If you weren't given a card ID, ask for one.
17
+ 2. Read the card with `ocnus linear read <card ID>`: the original description, the Specification, the Plan, the Breakdown, the Review if an earlier round wrote one, and the comments.
18
+ 3. If the card has no Plan, it was not approved to build, so there is nothing to review. Change nothing, and hand off as `failed`, saying so.
19
+ 4. If the Breakdown cut the card into several slices, each slice is a sub-issue with a Plan of its own, built on its own. Review the sub-issue, not this card. Change nothing, and hand off as `failed`, naming the sub-issue that comes first.
20
+ 5. Check where you are. The work is in the task's worktrees, which `ocnus task start` made under the space's `tasks/` folder, one for each repo, all on the task's branch. Run `git branch --show-current` in each one. The branch has to name this card, as in `feat/abc-122-short-name`. If you are in a repo's own checkout, on its default branch, or on a branch for another card, change nothing and hand off as `failed`, saying where you are.
21
+ 6. Run `git status` in each worktree. The build step leaves nothing uncommitted. If a worktree has changes, the build step did not finish: change nothing, and hand off as `failed`, naming the worktree and its changed files.
22
+ 7. Find what was built. The task started from each repo's default branch, so the build step's commits are the ones the default branch doesn't have: `git log --oneline origin/main..HEAD`, with the repo's own default branch in place of `main`. If no worktree has a commit there, nothing was built. Hand off as `failed`, saying so.
23
+
24
+ ## 1. Read how the repo works
25
+
26
+ Read the guidance in each worktree with commits: its `CLAUDE.md`, `AGENTS.md`, `README` and any `CONTRIBUTING` file. Look for three things:
27
+
28
+ - **How it is tested.** The command that runs the tests, and how to run only some of them.
29
+ - **How commits are written.** The form of a commit message, and anything a commit must never contain.
30
+ - **Rules for a change like this one.** A list that a new file must be added to, docs that change when the behaviour does, a version that only a release changes.
31
+
32
+ ## 2. Run the tests
33
+
34
+ Run the repo's whole test suite in each worktree with commits, unless this session has already seen it pass on exactly what that worktree holds now. That is so only when all of these hold:
35
+
36
+ - This session ran the build step, or the pr step after a conflict merge, and that step's last whole run passed, but for any test the human let stand.
37
+ - Nothing changed a file in the worktree after that run: that step only committed what the run tested, and every commit since the run is one that step made. A commit hook that refused a commit, so that a file was fixed after the run, means the run no longer counts.
38
+ - The repo runs no commit hook that can change what is committed, such as through `.husky/`, `lint-staged` or `.pre-commit-config.yaml`.
39
+ - `git status` shows no changes.
40
+
41
+ Then don't run it again, and say so on the Review's round line, as in `The tests pass, in the build step's run.` When the build step ran in another session, when anything changed after that run, or when you can't tell, run it yourself: the review step is what shows it.
42
+
43
+ When you run it, run it once, and keep what it prints, in a file if it is long, rather than running it again to read another part of it. Run it through `ocnus tests run`, as the build step does, as in `ocnus tests run npm test`, so that the test run is recorded as this card's.
44
+
45
+ If a test fails, note which one and what it said. Don't fix it, because the review step changes no code. A failing test is work that goes back to the build step, but for a test the human let stand. The build step's done hand-off names such a test in `flags`, and `ocnus task log <space> <card ID>` shows the human's answer. Name it on the round line as let stand: it sends nothing back.
46
+
47
+ If the tests can't run at all, because something they need is missing from the worktree, don't install anything. Ask the human, saying what is missing.
48
+
49
+ ## 3. Check each Done when item
50
+
51
+ Work through the Done when items in order, one at a time. For each one:
52
+
53
+ 1. Take its test from the Plan's Tests line for that item, and find it in the worktree. Read it, and check that it checks what the item says, not something nearby or something weaker. A test that only checks a page loads doesn't show that the page lists the right rows.
54
+ 2. Run that test, on its own where the repo can run some tests alone, and see it pass.
55
+ 3. Where the Plan shows a part of the item by a real run, such as a command used on a real card or a page opened in a browser, do it when it can be done from the worktree and the repo's guidance allows it. A run that reaches outside the task, such as one that pushes, deploys, sends a message or changes a real account, is for the human: say what to run and what they should see.
56
+
57
+ Each item is one of three:
58
+
59
+ - **Met.** Its test is there, checks what the item says, and passes, and any real run the Plan names for it was done and showed it.
60
+ - **Not met.** Its test is missing, checks less than the item says, or fails, or a real run showed the item isn't true. Say which, in words the build step can act on.
61
+ - **For the human.** Everything you could do shows it, but part of it can only be shown by a run you may not do. An item for the human doesn't send the work back.
62
+
63
+ ## 4. Check the commits
64
+
65
+ Check each of the build step's commits against the repo's rules for commits: the form of its message, and anything a commit must never contain. Check the change against the repo's rules for a change like this one. A commit or a change that breaks one goes in the Review, and in `flags` when you hand off. It doesn't send the work back on its own: a rule that a Done when item needs, such as a new test that must be added to a list before it runs, is already an item not met.
66
+
67
+ ## 5. Write the Review on the card
68
+
69
+ Write what you found on the card as a collapsed section after the Breakdown. Change nothing else on the card. If an earlier round wrote a Review, revise it in place, so the card has one Review, the latest.
70
+
71
+ Write it with this command, the section's body on stdin:
72
+
73
+ ```
74
+ ocnus linear section <card ID> Review <<'EOF'
75
+ Round <n>, on <the commit each worktree was at>. The tests <pass, or which fail>.
76
+
77
+ - **Met.** <Done when item, in a few words>: <how it was shown>
78
+ - **Not met.** <Done when item>: <what is missing or fails>
79
+ - **For the human.** <Done when item>: <what to run, and what they should see>
80
+
81
+ **Commits:** <that they follow the repo's rules, or which rule a commit breaks>
82
+ EOF
83
+ ```
84
+
85
+ The command adds the heading and the folding, puts the Review after the Breakdown, and leaves everything above it as it is. On a later round the card has a Review already, and the command refuses a second one. Run it with `--replace` after the section name, which puts the new Review in the last one's place:
86
+
87
+ ```
88
+ ocnus linear section <card ID> Review --replace <<'EOF'
89
+ <the Review, in the same form>
90
+ EOF
91
+ ```
92
+
93
+ The round is 1 the first time, and one more each time the work has been sent back to the build step before. When `sdlc-pr` sent the work here after the default branch was merged in, the round is one more than the last as well, and its round line says why: `Round <n>, on <the commit each worktree was at>, after the default branch was merged in.` Check each Done when item again with the merge commit, as for any round. The command reads the card back before it says it is done: when it says it added or wrote the Review, the write is checked, and you don't need to read the card again.
94
+
95
+ ## 6. Hand off
96
+
97
+ When the Review is on the card and you have read it back, record the hand-off. The review step is not finished until it is recorded.
98
+
99
+ When every Done when item is met or for the human, and the tests pass, the work is ready for its pull request:
100
+
101
+ ```
102
+ ocnus task handoff <space> <card ID> <<'EOF'
103
+ step: review
104
+ status: done
105
+ next: pr
106
+ summary: <how many Done when items are met and how each was shown, in which repos, and that the tests pass>
107
+ flags: <each item for the human, with how to check it; any commit that breaks the repo's rules>
108
+ EOF
109
+ ```
110
+
111
+ The step that follows is the `sdlc-pr` skill, which pushes the reviewed commits and opens the pull request.
112
+
113
+ When a Done when item is not met, or the tests fail, the work goes back to the build step. First run `ocnus task log <space> <card ID>`. If it already shows a hand-off from the review step with `next: build` for this card, the work has been sent back once already: go to the next block instead. Otherwise send it back:
114
+
115
+ ```
116
+ ocnus task handoff <space> <card ID> <<'EOF'
117
+ step: review
118
+ status: done
119
+ next: build
120
+ summary: <each Done when item that is not met and why, and each test that fails>
121
+ EOF
122
+ ```
123
+
124
+ The step that follows is the `sdlc-build` skill, which reads the Review and builds only what it says is not met.
125
+
126
+ When the work has been sent back to the build step before, ask the human whether it should go round again, so the build step and the review step don't go back and forth with no one watching:
127
+
128
+ ```
129
+ ocnus task handoff <space> <card ID> <<'EOF'
130
+ step: review
131
+ status: needs-human
132
+ summary: <each Done when item that is still not met and why, and what the last round changed>
133
+ question: <the items still not met, in a few words>. Build again, or stop here?
134
+ options: build again | stop here
135
+ EOF
136
+ ```
137
+
138
+ When they answer, record it, then hand off as `done` with `next: build` if they want it built again. If they want it stopped, hand off as `failed`, with the items still not met in `reason`.
139
+
140
+ ## The handoff block
141
+
142
+ Every step of the lifecycle ends the same way, so whoever is driving it, a person or a script, can tell how the step ended without reading the whole session.
143
+
144
+ Record a hand-off every time this step ends or pauses: when the step is finished, when you need an answer, and when something has gone wrong. Record it even when you go straight on to another step, because the record is what shows this one ended. Run `ocnus task handoff` with the block on stdin, one value per line:
145
+
146
+ ```
147
+ ocnus task handoff <space> <card ID> <<'EOF'
148
+ step: <this step>
149
+ status: <done, needs-human or failed>
150
+ next: <the step that follows>
151
+ summary: <one to three sentences on what you did>
152
+ flags: <what the human should know but wasn't asked>
153
+ question: <one question>
154
+ options: <the answers you expect, your recommendation first, separated by " | ">
155
+ answer: <what the human said, in a few words>
156
+ reason: <what went wrong, and what you already tried>
157
+ EOF
158
+ ```
159
+
160
+ `<space>` is the ocnus space this session is in. The `step:` line names this step. The words in angle brackets are hints: put your own in their place. The command checks the block, records it and prints it back. Which lines you write depends on the status:
161
+
162
+ | Status | Use it when | Lines |
163
+ |---|---|---|
164
+ | `done` | This step's work is on the card and you have read it back | `step`, `status`, `next`, `summary`, and `flags` if there are any |
165
+ | `needs-human` | You can't go on without an answer or an approval | `step`, `status`, `question`, `options`, and `summary` if it helps them answer |
166
+ | `answered` | The human has replied to a `needs-human` hand-off | `step`, `status`, `answer` |
167
+ | `failed` | Something is missing or went wrong, and this skill tells you to stop or doesn't cover it | `step`, `status`, `reason` |
168
+
169
+ - **If the command refuses the block, fix what it names and run it again.** If it can't record at all, because the command is missing, you are not in an ocnus space, or it says the hand-off was not recorded, write the block in your message instead and carry on. Don't make a space or install anything to get it to run.
170
+ - **When you stop for the human, end your message with the block the command printed.** At a `needs-human` stop, open your message with a brief: the one the `brief` skill gives, with the question as what is happening now. The brief goes above the block. Between them, or above the block at any other stop, goes only what the human needs and can't read on the card: a section you could not write there, or the summary they approve from.
171
+ - **Wherever this skill says to ask, tell or stop, use the block.** An ask is `needs-human`. Something to tell goes in `flags`. A stop because something is missing or went wrong is `failed`.
172
+ - **`needs-human` is a pause, not an ending.** Wait for the answer. When it comes, record it before anything else, as a hand-off with `status: answered` and what they said in a few words. That is how the time spent waiting on them is told from your own work. Then carry on with this step. The step is over only at `done` or `failed`.
173
+ - **Ask one question per block.** If you have two, ask first the one whose answer could change the other. The human can always answer in their own words, so `options` are suggestions.
174
+ - **After `done`, this step is over.** Record the hand-off before anything else. If another step sent you here to revise this section, go back to that step and ignore `next`. Otherwise go on to the step in `next` only if you were asked to run more than this one step, and if you weren't, stop there.
175
+ - **After `failed`, change nothing more.** Leave the card as it is for the human.
176
+
177
+ ## If something goes wrong
178
+
179
+ | When this happens | Do this |
180
+ |---|---|
181
+ | The card ID doesn't resolve | Ask the human for the ID. Don't pick a card because its title looks similar |
182
+ | The Linear tools aren't available | Hand off as `failed`. Don't review from memory of the card or from its title |
183
+ | `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 and write the Review with the Linear tools instead, in the same form, between `>>> ## Review` and a closing `>>>`, and on a later round revise the one there in place. A key with Read permission alone reads the card and gets the error only at the write: write just the Review with them then. Say so in `flags` when you hand off |
184
+ | A repo the Plan changes has no worktree in the task | Ask the human. The task may have been started with targets that left it out |
185
+ | The Plan's Tests line names a test that isn't there | The item is not met. Say which test is missing. Don't write it: that is the build step's work |
186
+ | A test fails only now and then | Run it again. If it fails again, the item is not met. If it passes, say in `flags` that it failed once |
187
+ | `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 Review twice. If it then says the card already has a Review, the first try got through |
188
+ | `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 |
189
+ | The collapsed section shows as plain `>>>` text | Leave the content as it is and tell the human. Don't keep reformatting it |
190
+
191
+ If something fails that isn't on this list, stop and tell the human what happened. Don't work around it.
192
+
193
+ ## Example
194
+
195
+ **From the card's Plan**
196
+
197
+ ```
198
+ **Tests:**
199
+ 1. Button shows for a manager: component test in `OrdersPage.test.tsx`
200
+ 2. Columns, and one row per order: API test in `test_orders_export.py`
201
+ 3. Same filters and range as on screen: API test with a filtered request, and a component test that the filters are passed
202
+ ```
203
+
204
+ **The Review it writes**
205
+
206
+ ```
207
+ ocnus linear section ABC-122 Review <<'EOF'
208
+ Round 1, on api 3f2a91c and web 8d04e17. The tests pass in both.
209
+
210
+ - **Met.** Button shows for a manager: `OrdersPage.test.tsx` renders the page as a manager and as a clerk, and finds the button only for the manager.
211
+ - **Not met.** Columns, and one row per order: `test_orders_export.py` checks the columns, but no test checks that there is one row per order.
212
+ - **Met.** Same filters and range as on screen: the API test sends a filtered request, and the component test checks the filters are passed.
213
+
214
+ **Commits:** both follow the repo's rules.
215
+ EOF
216
+ ```
217
+
218
+ **The hand-off at the end**
219
+
220
+ ```
221
+ ocnus task handoff shop ABC-122 <<'EOF'
222
+ step: review
223
+ status: done
224
+ next: build
225
+ summary: Item 2 is not met: test_orders_export.py checks the CSV's columns but not that it has one row per order. Items 1 and 3 are met, and the tests pass in api and web.
226
+ EOF
227
+ ```