@krysoworks/kryso 0.0.0-stage → 2.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +152 -2
  3. package/bin/kryso +31 -0
  4. package/bin/ship-it-status +14 -0
  5. package/bin/ship-ledger +14 -0
  6. package/bin/ship-loop +14 -0
  7. package/bin/ship-pass +14 -0
  8. package/bin/warden +14 -0
  9. package/dist/answer.d.ts +38 -0
  10. package/dist/answer.js +48 -0
  11. package/dist/bytes.d.ts +5 -0
  12. package/dist/bytes.js +35 -0
  13. package/dist/cleanup.d.ts +1 -0
  14. package/dist/cleanup.js +629 -0
  15. package/dist/commands.d.ts +48 -0
  16. package/dist/commands.js +293 -0
  17. package/dist/completions.d.ts +24 -0
  18. package/dist/completions.js +239 -0
  19. package/dist/daemon.d.ts +15 -0
  20. package/dist/daemon.js +23 -0
  21. package/dist/diagnose.d.ts +47 -0
  22. package/dist/diagnose.js +314 -0
  23. package/dist/doctor.d.ts +1 -0
  24. package/dist/doctor.js +241 -0
  25. package/dist/env.d.ts +9 -0
  26. package/dist/env.js +17 -0
  27. package/dist/evidence.d.ts +39 -0
  28. package/dist/evidence.js +327 -0
  29. package/dist/home.d.ts +3 -0
  30. package/dist/home.js +27 -0
  31. package/dist/install.d.ts +59 -0
  32. package/dist/install.js +137 -0
  33. package/dist/isolate.d.ts +28 -0
  34. package/dist/isolate.js +402 -0
  35. package/dist/leftovers.d.ts +5 -0
  36. package/dist/leftovers.js +156 -0
  37. package/dist/machine.d.ts +6 -0
  38. package/dist/machine.js +185 -0
  39. package/dist/palette.d.ts +147 -0
  40. package/dist/palette.js +167 -0
  41. package/dist/plan.d.ts +1 -0
  42. package/dist/plan.js +133 -0
  43. package/dist/proc.d.ts +23 -0
  44. package/dist/proc.js +23 -0
  45. package/dist/read.d.ts +1 -0
  46. package/dist/read.js +297 -0
  47. package/dist/readiness.d.ts +5 -0
  48. package/dist/readiness.js +64 -0
  49. package/dist/remote.d.ts +6 -0
  50. package/dist/remote.js +85 -0
  51. package/dist/self-update.d.ts +1 -0
  52. package/dist/self-update.js +224 -0
  53. package/dist/semver.d.ts +7 -0
  54. package/dist/semver.js +42 -0
  55. package/dist/style.d.ts +71 -0
  56. package/dist/style.js +187 -0
  57. package/dist/update.d.ts +47 -0
  58. package/dist/update.js +190 -0
  59. package/dist/work.d.ts +25 -0
  60. package/dist/work.js +449 -0
  61. package/dist/workflows.d.ts +4 -0
  62. package/dist/workflows.js +73 -0
  63. package/docker/entrypoint.sh +44 -0
  64. package/docker/runner.Dockerfile +39 -0
  65. package/package.json +65 -4
  66. package/scripts/install-skills.sh +607 -0
  67. package/skills/code-review/SKILL.md +231 -0
  68. package/skills/kryso/SKILL.md +107 -0
  69. package/skills/kryso/golden/help.rounded.ansi +23 -0
  70. package/skills/kryso/golden/help.square.ansi +23 -0
  71. package/skills/kryso/golden/help.txt +23 -0
  72. package/skills/kryso/golden/table-narrow.json +11 -0
  73. package/skills/kryso/golden/table-narrow.rounded.ansi +4 -0
  74. package/skills/kryso/golden/table-narrow.square.ansi +4 -0
  75. package/skills/kryso/golden/table.ansi +5 -0
  76. package/skills/kryso/golden/table.json +11 -0
  77. package/skills/kryso/ledger.sh +2146 -0
  78. package/skills/kryso/palette.json +57 -0
  79. package/skills/kryso/reference/resuming.md +30 -0
  80. package/skills/kryso/reference/routing.md +23 -0
  81. package/skills/kryso/reference/stage-1-claim.md +79 -0
  82. package/skills/kryso/reference/stage-2-build.md +133 -0
  83. package/skills/kryso/reference/stage-3-prove.md +51 -0
  84. package/skills/kryso/reference/stage-4-pr.md +76 -0
  85. package/skills/kryso/reference/stage-5-reconcile.md +81 -0
  86. package/skills/kryso/reference/stage-6-merge-or-park.md +73 -0
  87. package/skills/kryso/reference/stage-7-close-out.md +62 -0
  88. package/skills/kryso/reference/terminal.md +7 -0
  89. package/skills/kryso/ship-it-status.sh +1503 -0
  90. package/skills/kryso/ui.py +274 -0
  91. package/skills/kryso/ui.sh +609 -0
  92. package/skills/kryso-build/SKILL.md +168 -0
  93. package/skills/kryso-shift/SKILL.md +167 -0
  94. package/skills/kryso-shift/archive.py +2784 -0
  95. package/skills/kryso-shift/archive_checker.py +462 -0
  96. package/skills/kryso-shift/archive_checker_lambda.py +155 -0
  97. package/skills/kryso-shift/archive_health.py +364 -0
  98. package/skills/kryso-shift/archive_launchd.py +140 -0
  99. package/skills/kryso-shift/archive_remote.py +990 -0
  100. package/skills/kryso-shift/archiving-checker.md +140 -0
  101. package/skills/kryso-shift/archiving-keep.md +115 -0
  102. package/skills/kryso-shift/archiving-recovery.md +112 -0
  103. package/skills/kryso-shift/archiving-remote.md +166 -0
  104. package/skills/kryso-shift/archiving.md +146 -0
  105. package/skills/kryso-shift/coverage.schema.json +225 -0
  106. package/skills/kryso-shift/deadline.sh +254 -0
  107. package/skills/kryso-shift/feedback.schema.json +35 -0
  108. package/skills/kryso-shift/feedback.sh +228 -0
  109. package/skills/kryso-shift/history-manifest.schema.json +331 -0
  110. package/skills/kryso-shift/keep-after.sh +55 -0
  111. package/skills/kryso-shift/measure.sh +611 -0
  112. package/skills/kryso-shift/merge-ready.sh +207 -0
  113. package/skills/kryso-shift/outcome.schema.json +16 -0
  114. package/skills/kryso-shift/pass-rules.md +8 -0
  115. package/skills/kryso-shift/profile.schema.json +42 -0
  116. package/skills/kryso-shift/reader.sh +692 -0
  117. package/skills/kryso-shift/reads.sh +151 -0
  118. package/skills/kryso-shift/reference/allowance.md +21 -0
  119. package/skills/kryso-shift/reference/driver.md +95 -0
  120. package/skills/kryso-shift/reference/measuring.md +67 -0
  121. package/skills/kryso-shift/reference/outputs.md +21 -0
  122. package/skills/kryso-shift/reference/pass-script.md +115 -0
  123. package/skills/kryso-shift/reference/reconcile-and-merge.md +55 -0
  124. package/skills/kryso-shift/reference/second-reader.md +9 -0
  125. package/skills/kryso-shift/reference/sweeps.md +83 -0
  126. package/skills/kryso-shift/repair.schema.json +14 -0
  127. package/skills/kryso-shift/report-template.html +679 -0
  128. package/skills/kryso-shift/report.py +389 -0
  129. package/skills/kryso-shift/report_fixture.py +65 -0
  130. package/skills/kryso-shift/reporting.md +58 -0
  131. package/skills/kryso-shift/result.sh +91 -0
  132. package/skills/kryso-shift/runner.sh +1178 -0
  133. package/skills/kryso-shift/ship-loop.sh +3977 -0
  134. package/skills/kryso-shift/ship-pass.sh +4987 -0
  135. package/skills/kryso-shift/steps.jq +19 -0
  136. package/skills/kryso-shift/workflow.mjs +830 -0
  137. package/skills/kryso-shift/workflows/default.json +22 -0
  138. package/skills/kryso-shift/workflows/ralph.json +13 -0
  139. package/skills/kryso-watch/SKILL.md +100 -0
  140. package/skills/kryso-watch/answer.schema.json +23 -0
  141. package/skills/kryso-watch/base-refs.sh +44 -0
  142. package/skills/kryso-watch/board.sh +58 -0
  143. package/skills/kryso-watch/reference/config.md +23 -0
  144. package/skills/kryso-watch/reference/outputs.md +30 -0
  145. package/skills/kryso-watch/reference/report.md +29 -0
  146. package/skills/kryso-watch/reference/scheduler.md +32 -0
  147. package/skills/kryso-watch/reference/settlement.md +29 -0
  148. package/skills/kryso-watch/reference/shift.md +44 -0
  149. package/skills/kryso-watch/reference/shim-limits.md +22 -0
  150. package/skills/kryso-watch/reference/triage.md +26 -0
  151. package/skills/kryso-watch/schema.jq +40 -0
  152. package/skills/kryso-watch/settle.schema.json +36 -0
  153. package/skills/kryso-watch/stage-common.sh +187 -0
  154. package/skills/kryso-watch/stages/report.sh +525 -0
  155. package/skills/kryso-watch/stages/settle.sh +722 -0
  156. package/skills/kryso-watch/stages/shift.sh +466 -0
  157. package/skills/kryso-watch/stages/triage.sh +379 -0
  158. package/skills/kryso-watch/tracker.sh +27 -0
  159. package/skills/kryso-watch/triage.schema.json +77 -0
  160. package/skills/kryso-watch/warden.launchd.plist +50 -0
  161. package/skills/kryso-watch/warden.schema.json +98 -0
  162. package/skills/kryso-watch/warden.sh +1004 -0
@@ -0,0 +1,231 @@
1
+ ---
2
+ name: code-review
3
+ description: "Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/spec asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to \"review since X\"."
4
+ ---
5
+
6
+ <!-- Vendored from mattpocock/skills, with house changes marked below. Upstream prose is linted at its
7
+ source, not here: de-slopping someone else's words would make every diff against upstream noise.
8
+ House changes sit outside the deslop-lint-disable markers, so the markers show what is whose. -->
9
+ <!-- deslop-lint-disable -->
10
+
11
+ Two-axis review of the diff between `HEAD` and a fixed point the user supplies:
12
+
13
+ - **Standards**: does the code conform to this repo's documented coding standards?
14
+ - **Spec**: does the code faithfully implement the originating issue / spec?
15
+
16
+ Both axes run as **parallel sub-agents** so they don't pollute each other's context, then this skill aggregates their findings.
17
+
18
+ The issue tracker should have been provided to you. If `docs/agents/issue-tracker.md` is missing, tell the user to run `/setup-matt-pocock-skills`.
19
+
20
+ <!-- deslop-lint-enable -->
21
+
22
+ **What the caller may supply.** Six things, all optional, and each one removes a guess:
23
+
24
+ | Argument | Effect |
25
+ | --- | --- |
26
+ | The fixed point | Step 1 pins it instead of asking. |
27
+ | The spec | Step 2 takes it instead of searching. A path or the text itself. |
28
+ | A report path | Step 6 writes the aggregated report to that path as well as to the chat. |
29
+ | That the run is unattended | Nobody is there to answer, so the skill never asks a question. It reports the gap and carries on. |
30
+ | A diff path | Step 1 writes the diff there instead of a temporary file, so a reviewer that can read files but not run a shell can read it. |
31
+ | A reviewer agent type | Step 4 dispatches both sub-agents as that type, whose tools the host holds to reading. The read-only clause stays in both prompts, and step 5's tree check still runs. |
32
+
33
+ With none of them the skill behaves as upstream wrote it.
34
+
35
+ <!-- deslop-lint-disable -->
36
+
37
+ ## Process
38
+
39
+ ### 1. Pin the fixed point
40
+
41
+ Whatever the user said is the fixed point (a commit SHA, branch name, tag, `main`, `HEAD~5`, etc.). If they didn't specify one, ask for it.
42
+
43
+ Capture the diff command once: `git diff <fixed-point>...HEAD` (three-dot, so the comparison is against the merge-base). Also note the list of commits via `git log <fixed-point>..HEAD --oneline`.
44
+
45
+ Before going further, confirm the fixed point resolves (`git rev-parse <fixed-point>`) and the diff is non-empty. A bad ref or empty diff should fail here, not inside two parallel sub-agents.
46
+
47
+ <!-- deslop-lint-enable -->
48
+
49
+ **Unattended, a missing fixed point ends the review.** There is nobody to ask, and a guessed fixed point reviews a diff nobody asked about, which is worse than no review because it comes back quiet. Stop with one line, `code-review: no fixed point supplied`, and nothing else. The same holds for a ref that does not resolve or a diff that comes back empty: one line naming which of the three failed, then stop.
50
+
51
+ Write the diff to a file once and work from it, because the quote check in step 5 greps it and two sub-agent prompts carry it:
52
+
53
+ ```sh
54
+ REVIEW_DIFF="$(mktemp -t code-review-diff)" # or the diff path the caller supplied
55
+ git diff <fixed-point>...HEAD > "$REVIEW_DIFF"
56
+ ```
57
+
58
+ **Record the tree before anything is dispatched.** The reviewers may only read, and this is how that gets checked rather than trusted:
59
+
60
+ ```sh
61
+ git rev-parse HEAD
62
+ git status --porcelain
63
+ ```
64
+
65
+ Keep both. Step 5 compares them after the sub-agents return.
66
+
67
+ <!-- deslop-lint-disable -->
68
+
69
+ ### 2. Identify the spec source
70
+
71
+ Look for the originating spec, in this order:
72
+
73
+ 1. Issue references in the commit messages (`#123`, `Closes #45`, GitLab `!67`, etc.), fetched via the workflow in `docs/agents/issue-tracker.md`.
74
+ 2. A path the user passed as an argument.
75
+ 3. A spec file under `docs/`, `specs/`, or `.scratch/` matching the branch name or feature.
76
+ 4. If nothing is found, ask the user where the spec is. If they say there isn't one, the **Spec** sub-agent will skip and report "no spec available".
77
+
78
+ <!-- deslop-lint-enable -->
79
+
80
+ **Unattended, step 2 never reaches its fourth branch.** A caller-supplied spec wins outright. Where none was supplied and the first three branches find nothing, skip the Spec sub-agent and report "no spec available" on that axis. Do not ask, and do not promote a plausible-looking file to spec: a review pinned to the wrong contract reports scope creep that was in the brief all along.
81
+
82
+ <!-- deslop-lint-disable -->
83
+
84
+ ### 3. Identify the standards sources
85
+
86
+ Anything in the repo that documents how code should be written, such as `CODING_STANDARDS.md` or `CONTRIBUTING.md`.
87
+
88
+ On top of whatever the repo documents, the Standards axis always carries the **smell baseline** below: a fixed set of Fowler code smells (_Refactoring_, ch.3) that applies even when a repo documents nothing. Two rules bind it:
89
+
90
+ - **The repo overrides.** A documented repo standard always wins; where it endorses something the baseline would flag, suppress the smell.
91
+ - **Always a judgement call.** Each smell is a labelled heuristic ("possible Feature Envy"), never a hard violation. Like any standard here, skip anything tooling already enforces.
92
+
93
+ Each smell reads *what it is* → *how to fix*; match it against the diff:
94
+
95
+ - **Mysterious Name**: a function, variable, or type whose name doesn't reveal what it does or holds. → rename it; if no honest name comes, the design's murky.
96
+ - **Duplicated Code**: the same logic shape appears in more than one hunk or file in the change. → extract the shared shape, call it from both.
97
+ - **Feature Envy**: a method that reaches into another object's data more than its own. → move the method onto the data it envies.
98
+ - **Data Clumps**: the same few fields or params keep travelling together (a type wanting to be born). → bundle them into one type, pass that.
99
+ - **Primitive Obsession**: a primitive or string standing in for a domain concept that deserves its own type. → give the concept its own small type.
100
+ - **Repeated Switches**: the same `switch`/`if`-cascade on the same type recurs across the change. → replace with polymorphism, or one map both sites share.
101
+ - **Shotgun Surgery**: one logical change forces scattered edits across many files in the diff. → gather what changes together into one module.
102
+ - **Divergent Change**: one file or module is edited for several unrelated reasons. → split so each module changes for one reason.
103
+ - **Speculative Generality**: abstraction, parameters, or hooks added for needs the spec doesn't have. → delete it; inline back until a real need shows.
104
+ - **Message Chains**: long `a.b().c().d()` navigation the caller shouldn't depend on. → hide the walk behind one method on the first object.
105
+ - **Middle Man**: a class or function that mostly just delegates onward. → cut it, call the real target direct.
106
+ - **Refused Bequest**: a subclass or implementer that ignores or overrides most of what it inherits. → drop the inheritance, use composition.
107
+
108
+ <!-- deslop-lint-enable -->
109
+
110
+ **Two test smells join the baseline.** A house change: they are part of the smell baseline above, pasted with it into the Standards prompt, and judgement calls like the rest.
111
+
112
+ - **Redundant Test**: two tests that exercise the same branch with nothing in their inputs or assertions to tell them apart, both in the diff or one in the diff and one already in the suite. → merge them into one table-driven test, or delete the one the other subsumes. It covers a caller's test too: a test that calls a thin caller of a shared helper only to reach a rule the helper alone decides, such as each reader of one parser checked for the parser's missing-record case, when the helper's own test already covers that rule. → keep the helper's test, and delete the caller's unless the caller decides something there itself.
113
+ - **Fake Assertion**: a test whose assertion checks a fake, a mock or a stub (how often it was called, what it was handed) where it could check behaviour a caller sees. → assert on the result the seam returns or the state it leaves.
114
+
115
+ A finding for either quotes the test it flags, or the fake assertion, from the diff, so the quote check in step 5 holds it as it holds any other finding. A Redundant Test finding names the other test too: quoted from the diff when the diff adds it, or by its file and line when the suite already held it. Where the repository has a testing policy, `.kryso/testing-policy.md` or, at its old place, `docs/agents/testing-policy.md`, it is a standards source, and it overrides these two as any documented standard overrides the baseline: a policy that asks for one assertion per test makes two cases of one rule its own call.
116
+
117
+ <!-- deslop-lint-disable -->
118
+
119
+ ### 4. Spawn both sub-agents in parallel
120
+
121
+ **Standards sub-agent prompt** should include:
122
+
123
+ - The full diff command and commit list.
124
+ - The list of standards-source files you found in step 3, **plus the smell baseline from step 3** pasted in full (the sub-agent has no other access to it).
125
+ - The brief: "Report, per file/hunk where relevant, (a) every place the diff violates a documented standard: cite the standard (file + the rule); and (b) any baseline smell you spot: name it and quote the hunk. Distinguish hard violations from judgement calls: documented-standard breaches can be hard, but baseline smells are always judgement calls, and a documented repo standard overrides the baseline. Skip anything tooling enforces. Under 400 words."
126
+
127
+ **Spec sub-agent prompt** should include:
128
+
129
+ - The diff command and commit list.
130
+ - The path or fetched contents of the spec.
131
+ - The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. Under 400 words."
132
+
133
+ If the spec is missing, skip the Spec sub-agent and note this in the final report.
134
+
135
+ <!-- deslop-lint-enable -->
136
+
137
+ **Dispatch them as the caller's reviewer agent type when it supplied one,** and give each prompt the saved diff's path, since a reviewer without a shell cannot run the diff command itself.
138
+
139
+ **Run both sub-agents in the foreground.** Pass `run_in_background: false` on each dispatch. A background reviewer returns a notification rather than a report, and a skill that ends its turn to wait for the report has ended: whoever called it gets back nothing, and under `/kryso-build` that nothing is a missing review artefact and a wasted run.
140
+
141
+ **Open both prompts with the read-only clause, word for word.** A reviewer that edits the code it is reviewing has reviewed something nobody will ever see again:
142
+
143
+ > You are reviewing, not changing. Do not create, edit or delete any file. Do not run `git stash`, `git checkout`, `git restore`, `git reset`, `git add`, `git commit`, or anything else that writes the working tree or the index. Read the diff, read the files it touches, read the standards and the spec, and report. Nothing else.
144
+
145
+ **Close both prompts with the evidence clause, word for word.** It is what makes a finding checkable, and it is the only defence against a reviewer that answered from the prompt without opening the diff:
146
+
147
+ > Every finding quotes the hunk it is about: the file path, the line number, and at least one line of code copied exactly as it appears in the diff. A finding with no quote does not count as a finding.
148
+
149
+ ### 5. Check the reviewers before you believe them
150
+
151
+ Three checks, in this order, before a single finding reaches the report.
152
+
153
+ **The tree has not moved.** Run `git rev-parse HEAD` and `git status --porcelain` again and compare them to what step 1 recorded. On any difference the review is void: say so, name the paths that moved, and revert nothing. The caller owns the tree, and a skill that quietly reverts a reviewer's edit destroys the evidence of the bug that produced it.
154
+
155
+ **Each axis quoted the diff.** Take one quoted line of code from each axis and grep the saved diff for it:
156
+
157
+ ```sh
158
+ grep -F -- '<the quoted line>' "$REVIEW_DIFF"
159
+ ```
160
+
161
+ No match means that axis reported on a diff it never read. Rerun that axis once with the same prompt. A second miss makes the axis void, which goes in the report as `Standards: void, quotes not found in the diff` rather than as a clean pass.
162
+
163
+ **Neither axis came back empty-handed.** Where the harness reports a sub-agent's tool-call count, zero calls voids that axis on the same terms as a failed quote check. A confident summary built from no tool calls reads exactly like a real review and is not one.
164
+
165
+ ### 6. Aggregate
166
+
167
+ <!-- House renumbering: upstream calls this step 5. The heading sits outside the markers so
168
+ everything inside them stays byte for byte upstream's. -->
169
+ <!-- deslop-lint-disable -->
170
+
171
+ Present the two reports under `## Standards` and `## Spec` headings, verbatim or lightly cleaned. Do **not** merge or rerank findings, because the two axes are deliberately separate (see _Why two axes_).
172
+
173
+ End with a one-line summary: total findings per axis, and the worst issue _within each axis_ (if any). Don't pick a single winner across axes: that's the reranking the separation exists to prevent.
174
+
175
+ <!-- deslop-lint-enable -->
176
+
177
+ **With a report path, write the same report there.** The chat output does not change. The file gets the two axis sections, the summary line, and one section the chat does not need:
178
+
179
+ ```markdown
180
+ # Code review
181
+
182
+ Fixed point: <ref> (<sha>)
183
+ Spec: <path, or "no spec available">
184
+ Diff: <n> files, <n> commits
185
+
186
+ ## Standards
187
+
188
+ <the Standards report, or "void, quotes not found in the diff">
189
+
190
+ ## Spec
191
+
192
+ <the Spec report, or "no spec available">
193
+
194
+ ## Summary
195
+
196
+ Standards: <n> findings, worst: <one line>
197
+ Spec: <n> findings, worst: <one line>
198
+
199
+ ## Triage
200
+
201
+ | # | Axis | Finding | Outcome | Evidence |
202
+ | --- | --- | --- | --- | --- |
203
+ | 1 | Standards | <one line> | | |
204
+ | 2 | Spec | <one line> | | |
205
+ ```
206
+
207
+ Seed one triage row per finding and leave the last two columns empty. Filling them is the caller's job, because only the caller knows the scope boundary a finding has to be measured against. An orchestrator downstream counts these rows against the findings, so a report that omits a row hides a finding.
208
+
209
+ <!-- deslop-lint-disable -->
210
+
211
+ ## Why two axes
212
+
213
+ A change can pass one axis and fail the other:
214
+
215
+ - Code that follows every standard but implements the wrong thing → **Standards pass, Spec fail.**
216
+ - Code that does exactly what the issue asked but breaks the project's conventions → **Spec pass, Standards fail.**
217
+
218
+ Reporting them separately stops one axis from masking the other.
219
+
220
+ <!-- deslop-lint-enable -->
221
+
222
+ ## Rationalisations
223
+
224
+ | Excuse | Reality |
225
+ | --- | --- |
226
+ | "No fixed point, but the branch obviously came off `main`" | Obviously is a guess, and a guessed diff reviews the wrong change quietly. One error line, then stop. |
227
+ | "There is no spec, but the issue body reads like one" | Where triage posted a brief, that is the contract. Anything else promoted to spec turns brief content into reported scope creep. |
228
+ | "The reviewer fixed the thing it found, which saves a step" | It reviewed code that no longer exists and left the caller a tree it did not write. Void the review. |
229
+ | "The tree moved, so I should put it back" | Reverting destroys the evidence. Name the paths and hand it to the caller. |
230
+ | "The finding is clearly right even without a quote" | Then quoting it costs nothing. No quote, no finding. |
231
+ | "The axis came back with nothing, so the code is clean" | Nothing and void look identical in a report. Run the quote check before you decide which one you got. |
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: kryso
3
+ description: Use when one change should go all the way from claimed to merged with nobody watching. Triggers include "work the next ticket", "pick up a ready-for-agent issue and ship it", "take this to a merged PR", "worktree it, review it and ship it", or "ship issue #N". Also use when the run starts from a description, spec or branch rather than a ticket, and when resuming work that already has a worktree or an open pull request.
4
+ ---
5
+
6
+ # kryso
7
+
8
+ One piece of work per invocation, from claimed to merged or parked. A whole column is `kryso-shift`'s job, not this skill's.
9
+
10
+ Read `CLAUDE.md` first where it exists: it is the repository's working contract on every host. Where it restricts the shape of shell commands (one command per call, no pipes, no `$(...)`), its rule wins over the command blocks in this skill: split a block into separate calls that obey it. Then read two repo files before anything else. `docs/agents/issue-tracker.md` gives the tracker and project-board commands, and `docs/agents/triage-labels.md` gives the AFK-ready label string. On a tracker entry the run moves the issue's card on its GitHub Projects board, where it has one, and every id on the board is read live off the issue, never from a checked-in file. [Stage 1](reference/stage-1-claim.md) has the sequence.
11
+
12
+ ## The three rules
13
+
14
+ **The worktree is the lock.** One worktree under `.claude/worktrees/` means one run in flight. Where one exists for the work, another agent holds it and this run takes something else. The exceptions are a worktree this same run cut, which is a resume point, and one a handoff names for this run's shift, below under Resuming.
15
+
16
+ **The gate runs in the session that ships.** The build forks, and the fork's own test runs, the tests related to its change, are its working loop. This session proves the result by running the typecheck, the lint, the full suite and the repo's PR gate itself, once, over the final commit, before the push. The full suite runs nowhere else in the pass. Run each receipt in the foreground with `--wait 540` and call `wait` until its exit comes back, as [stage 3](reference/stage-3-prove.md#the-gate) describes. Never end the turn while a receipt is open, because the receipt outlives the turn and its exit can change the outcome. The zero-tool-call rule stays for anything delegated whose summary this session would otherwise believe: a result with no tool uses is void, rerun once, then done inline. Never write that something passes without the command and its exit status above the claim.
17
+
18
+ **The ledger is the record.** Every run keeps its state in `.kryso/pass/` at the root of its worktree, so a compaction or a resume reads the disk instead of the transcript:
19
+
20
+ | Path | Holds |
21
+ | --- | --- |
22
+ | `.kryso/pass/brief.md` | The spec this run works from. First line names its source: the agent brief, the issue body, or the user's description as you read it. |
23
+ | `.kryso/pass/run.md` | The ledger. Run parameters at the top, then one appended line per event: `<time> <stage> <outcome> <evidence>`, written through `ledger.sh`, which reads the clock. |
24
+ | `.kryso/pass/logs/<name>.log` | One receipt per gate command, in the form [stage 3](reference/stage-3-prove.md#the-gate) gives. |
25
+ | `.kryso/pass/review.md` | The review report and its triage table. |
26
+
27
+ The ledger is opened once, the first time the run cuts the worktree, through `ledger.sh` beside this skill. [Stage 2](reference/stage-2-build.md#the-ledger) has the command and what it leaves on disk, a copy of the module at `$WORKTREE/.kryso/pass/ledger.sh` among them. Every later event is `bash "$WORKTREE/.kryso/pass/ledger.sh" event "$WORKTREE" <stage> <outcome> <evidence>`, a park is `park "$WORKTREE" <stage> <word> <evidence>`, a gate runs to its receipt with `receipt "$WORKTREE" <name> '<command>' --wait 540`, `wait "$WORKTREE" <log> --wait 540` takes up a receipt that printed `running <log>`, `ci "$WORKTREE" <pr> --wait 540` holds stage 5's wait on the PR's checks, `read "$WORKTREE"` prints everything the module knows about the run as one JSON document, and at stage 7 `bash <this skill's directory>/ledger.sh archive "$WORKTREE"` copies `.kryso/pass/` out to `.claude/kryso/shipped/` before the worktree goes.
28
+
29
+ The directory goes with the worktree at close out and stays with it on a park, because the worktree is the resume point.
30
+
31
+ `ship-it-status.sh` beside this file reads every run's state from outside any of them. Run `bash <this skill's directory>/ship-it-status.sh --inspect <issue>` before resuming a worktree or re-forking after an apparent interrupt. The script header says why, and lists its other forms and the signals it reads.
32
+
33
+ ### Output discipline
34
+
35
+ Long output goes to a log, never into this transcript. The module prints the exit line and the last twenty lines:
36
+
37
+ ```sh
38
+ bash "$WORKTREE/.kryso/pass/ledger.sh" receipt "$WORKTREE" test 'pnpm test' --wait 540
39
+ ```
40
+
41
+ Every `gh --json` call carries a `--jq` filter, because board and issue JSON is large and you want three fields from it. CI is read with `gh run view --log-failed` and a tail, never a whole log. Nobody cats a whole file to check one fact.
42
+
43
+ ### After a compaction
44
+
45
+ Re-read `.kryso/pass/run.md` and the current stage's reference file before acting. A summary that says a gate passed is not a receipt. The receipt is the log file the ledger points at.
46
+
47
+ ## Entry
48
+
49
+ Two ways in, and they differ only at the ends.
50
+
51
+ From the tracker, which is the default and what an unattended shift does. Stage 1 picks and claims an issue, stage 7 closes it, and the board moves at both.
52
+
53
+ From a description, when the user names the work or hands over a spec, a branch or a failing test. Stage 1 shrinks to choosing the base branch and checking the lock. There is no card to move and no issue to close, so say once in the report that the run had no ticket behind it. Everything between stages 2 and 6 is identical.
54
+
55
+ Either way the brief has to exist as text on disk before stage 2 ends, because the review compares the diff against it. A review with nothing to compare against reports "no spec available", and the Spec axis is lost.
56
+
57
+ ## Resuming
58
+
59
+ Under a tracker entry an existing worktree is a lock, so the run takes something else. When the user names the issue or the branch, or a driver hands a continuation over, that worktree is this run's. Before the first command in it, read [resuming.md](reference/resuming.md): whose issue it is, the branch and ledger module to refresh, the base to restore, which engine owns the ledger, and the stage to continue from.
60
+
61
+ ## Stages
62
+
63
+ Read a stage's reference file when the stage starts. A run that ends at the claim never loads the merge stage.
64
+
65
+ | # | Stage | Move on when | Instructions |
66
+ | --- | --- | --- | --- |
67
+ | 1 | Claim | The lock is clear, the brief's source is known and its text is in hand, and the base branch is chosen. On a tracker entry, also: the issue is assigned to you and the card reads In Progress | [stage-1-claim.md](reference/stage-1-claim.md) |
68
+ | 2 | Build | The named `kryso-build` skill has returned in the foreground and passed the four checks: commits past the base, a clean tree, the build and review ledger lines, and a review artefact whose quotes grep in the diff | [stage-2-build.md](reference/stage-2-build.md) |
69
+ | 3 | Prove | Typecheck, lint, the full suite and the repo's PR gate have run here, to logs, with their exit lines in this transcript | [stage-3-prove.md](reference/stage-3-prove.md) |
70
+ | 4 | PR | The PR exists against the intended base, its body cites the receipts, and the card reads In review | [stage-4-pr.md](reference/stage-4-pr.md) |
71
+ | 5 | Reconcile | Every finding on the PR has a fix, a tracking issue or a reply, harmless approvals and notices need none, and CI is green on the head commit | [stage-5-reconcile.md](reference/stage-5-reconcile.md) |
72
+ | 6 | Merge or park | The PR is merged, or parked with a reason | [stage-6-merge-or-park.md](reference/stage-6-merge-or-park.md) |
73
+ | 7 | Close out | `.kryso/pass/` is copied to `.claude/kryso/shipped/`, the branch is gone on origin and here, and the worktree is removed. On a tracker entry, also: the issue is closed and the card reads Done, or, where the build left criteria unmet, the issue stays open with `needs-triage` and the card stays In review | [stage-7-close-out.md](reference/stage-7-close-out.md) |
74
+
75
+ Where this skill sits among the others, and which skill to reach for from which stage, is in [routing.md](reference/routing.md), and how the status script and the pass script style a terminal is in [terminal.md](reference/terminal.md). An executing run needs neither.
76
+
77
+ ## The second reader
78
+
79
+ When `kryso.secondReader` or `PLAYBOOK_SECOND_READER` turns it on, stage 4 puts the fork's triage in front of a second reader, `kryso-shift`'s `reader.sh`, before the PR body is written. Its disputes go in a Second reader subsection of the PR body and one `review second-read` ledger line, and change no triage row, stage or outcome. [Stage 4](reference/stage-4-pr.md#the-second-reader) has the commands.
80
+
81
+ ## The outcome block
82
+
83
+ Every run ends with this block, whatever happened, as the last thing in the report:
84
+
85
+ ```
86
+ outcome: shipped | parked | nothing-to-take | failed
87
+ issue: <number, or none>
88
+ branch: <name, or none>
89
+ pr: <url, or none>
90
+ reason: <one paragraph: what landed, or what stopped it and where the evidence is>
91
+ ```
92
+
93
+ `shipped` means merged and closed out. `parked` means the work is real and waiting, with the worktree left as the resume point. `nothing-to-take` means stage 1 found no candidate, which is a correct result and not a failure. `failed` means the run broke in a way a rerun will not fix.
94
+
95
+ ## Red flags
96
+
97
+ Stop when you catch yourself about to:
98
+
99
+ - write "tests pass" with no command output above it
100
+ - dispatch an agent to run the gate
101
+ - trust a summary of a stage over the ledger line and the log it points at
102
+ - paste a whole test run, a whole CI log or a whole `gh --json` blob into this transcript
103
+ - merge into the default branch
104
+ - fix something the bot found that the brief never asked for
105
+ - remove a worktree before its PR is merged, or before `.kryso/pass/` is copied out
106
+ - take an issue that already has a worktree or an open PR
107
+ - stop mid-run and ask the user a question
@@ -0,0 +1,23 @@
1
+ Usage: kryso example [options] <issue>
2
+ kryso example --all
3
+
4
+ A paragraph of prose stays as written, even one that ends: like this
5
+ one, or one that holds a term with two spaces in it.
6
+
7
+ SELECTION
8
+ <issue> the issue to take (a number)
9
+ --all every issue in the queue, oldest first, until the
10
+ bounds below stop it
11
+ -q, --queue Q the queue to read (default: ready-for-agent)
12
+ --note TEXT a note → kept as written, (not dim) when not last
13
+
14
+ RUN BOUNDS
15
+ --max N stop after N passes
16
+ --until TIME stop at TIME, in the local zone (HH:MM)
17
+ a-verb a verb, which is an entry as a flag is
18
+
19
+ EXIT STATUS
20
+ 0 every pass merged
21
+ 1 a pass parked (see the ledger)
22
+
23
+ This line ends the help: not a section.
@@ -0,0 +1,23 @@
1
+ Usage: kryso example [options] <issue>
2
+ kryso example --all
3
+
4
+ A paragraph of prose stays as written, even one that ends: like this
5
+ one, or one that holds a term with two spaces in it.
6
+
7
+  SELECTION 
8
+ <issue> the issue to take (a number)
9
+ --all every issue in the queue, oldest first, until the
10
+ bounds below stop it
11
+ -q, --queue Q the queue to read (default: ready-for-agent)
12
+ --note TEXT a note → kept as written, (not dim) when not last
13
+
14
+  RUN BOUNDS 
15
+ --max N stop after N passes
16
+ --until TIME stop at TIME, in the local zone (HH:MM)
17
+ a-verb a verb, which is an entry as a flag is
18
+
19
+  EXIT STATUS 
20
+ 0 every pass merged
21
+ 1 a pass parked (see the ledger)
22
+
23
+ This line ends the help: not a section.
@@ -0,0 +1,23 @@
1
+ Usage: kryso example [options] <issue>
2
+ kryso example --all
3
+
4
+ A paragraph of prose stays as written, even one that ends: like this
5
+ one, or one that holds a term with two spaces in it.
6
+
7
+ Selection:
8
+ <issue> the issue to take (a number)
9
+ --all every issue in the queue, oldest first, until the
10
+ bounds below stop it
11
+ -q, --queue Q the queue to read (default: ready-for-agent)
12
+ --note TEXT a note → kept as written, (not dim) when not last
13
+
14
+ Run bounds:
15
+ --max N stop after N passes
16
+ --until TIME stop at TIME, in the local zone (HH:MM)
17
+ a-verb a verb, which is an entry as a flag is
18
+
19
+ Exit status:
20
+ 0 every pass merged
21
+ 1 a pass parked (see the ledger)
22
+
23
+ This line ends the help: not a section.
@@ -0,0 +1,11 @@
1
+ {
2
+ "indent": 2,
3
+ "header": true,
4
+ "width": 40,
5
+ "rows": [
6
+ ["STATE", "ISSUE", "LAST EVENT"],
7
+ [{ "text": "● LIVE", "tone": "ok" }, { "text": "#7", "tone": "value" }, "build committed abc1234 and its review"],
8
+ [{ "text": "‖ parked", "tone": "warn" }, { "text": "#8", "tone": "value" }, { "text": "merge parked base is the default branch", "tone": "warn" }],
9
+ ["○ stale", "#9", "café → done"]
10
+ ]
11
+ }
@@ -0,0 +1,4 @@
1
+ STATE ISSUE LAST EVENT
2
+ ● LIVE #7 build committed abc1
3
+ ‖ parked #8 merge parked base is
4
+ ○ stale #9 café → done
@@ -0,0 +1,4 @@
1
+ STATE ISSUE LAST EVENT
2
+ ● LIVE #7 build committed abc1…
3
+ ‖ parked #8 merge parked base is…
4
+ ○ stale #9 café → done
@@ -0,0 +1,5 @@
1
+ PASS ISSUE LIVE UPDATED
2
+ wt-41 #41 live 2026-11-26T18:00:00Z
3
+ wt-7 - unknown
4
+ wt-bad unreadable: bad ledger
5
+ café →
@@ -0,0 +1,11 @@
1
+ {
2
+ "indent": 2,
3
+ "header": true,
4
+ "rows": [
5
+ ["PASS", "ISSUE", "LIVE", "UPDATED"],
6
+ [{ "text": "wt-41", "tone": "value" }, "#41", { "text": "live", "tone": "ok" }, { "text": "2026-11-26T18:00:00Z", "tone": "dim" }],
7
+ [{ "text": "wt-7", "tone": "value" }, { "text": "-", "tone": "bold" }, { "text": "unknown", "tone": "warn" }, ""],
8
+ [{ "text": "wt-bad", "tone": "value" }, "", "", { "text": "unreadable: bad ledger", "tone": "fail" }],
9
+ ["café", "→", "", ""]
10
+ ]
11
+ }