@bompus/house-rules 0.0.0-stage → 0.13.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 (236) hide show
  1. package/CODE_OF_CONDUCT.md +83 -0
  2. package/CONTRIBUTING.md +54 -0
  3. package/LICENSE +21 -0
  4. package/README.md +378 -2
  5. package/THIRD_PARTY_NOTICES.md +188 -0
  6. package/compose.mjs +125 -0
  7. package/composition.mjs +361 -0
  8. package/config-view.mjs +209 -0
  9. package/config.mjs +381 -0
  10. package/docs/assets/banner-dark.png +0 -0
  11. package/docs/assets/banner-light.png +0 -0
  12. package/docs/assets/overview.png +0 -0
  13. package/docs/configuration.md +269 -0
  14. package/docs/skill-names.md +50 -0
  15. package/examples/person/house-rules.json +15 -0
  16. package/examples/person/rules/10-tooling.md +8 -0
  17. package/examples/person/rules/20-reporting.md +9 -0
  18. package/examples/project/AGENTS.md +18 -0
  19. package/package.json +42 -4
  20. package/rule-references.mjs +91 -0
  21. package/rules/core.md +340 -0
  22. package/rules/modifiers/backlog-outline.md +25 -0
  23. package/rules/modifiers/backlog-visual.md +16 -0
  24. package/rules/modifiers/coded-offers.md +70 -0
  25. package/rules/modifiers/cross-session-relay.md +23 -0
  26. package/rules/modifiers/effort-estimates.md +41 -0
  27. package/rules/modifiers/land-when-done.md +12 -0
  28. package/rules/modifiers/low-quota-handoff.md +20 -0
  29. package/rules/modifiers/model-default-questions.md +33 -0
  30. package/rules/modifiers/multi-agent.md +38 -0
  31. package/rules/modifiers/no-attribution.md +16 -0
  32. package/rules/modifiers/periodic-updates.md +25 -0
  33. package/rules/modifiers/plan-files.md +82 -0
  34. package/rules/modifiers/question-cards.md +48 -0
  35. package/rules/modifiers/release-batching.md +15 -0
  36. package/rules/modifiers/scratch-on-disk.md +15 -0
  37. package/rules/modifiers/shared-host-load.md +19 -0
  38. package/rules/modifiers/solo-operator.md +13 -0
  39. package/rules/modifiers/squash-landing.md +22 -0
  40. package/rules/modifiers/upstream-contributions.md +45 -0
  41. package/rules/modifiers/web-image-formats.md +35 -0
  42. package/rules/references/backlog-view.md +154 -0
  43. package/rules/references/github-actions.md +45 -0
  44. package/rules/references/landing.md +39 -0
  45. package/rules/references/multi-agent.md +51 -0
  46. package/rules/references/release-batching.md +66 -0
  47. package/rules/references/squash-landing.md +50 -0
  48. package/rules/references/thread-visuals.md +45 -0
  49. package/setup.mjs +445 -0
  50. package/skills/hr-agent-guidance-audit/LICENSE +21 -0
  51. package/skills/hr-agent-guidance-audit/SKILL.md +91 -0
  52. package/skills/hr-agent-guidance-audit/agents/openai.yaml +2 -0
  53. package/skills/hr-agent-guidance-audit/references/prune-workflow.md +72 -0
  54. package/skills/hr-agent-guidance-audit/references/records-and-lessons.md +60 -0
  55. package/skills/hr-agent-guidance-audit/references/retirement-verdicts.md +49 -0
  56. package/skills/hr-agent-guidance-refresh/LICENSE +21 -0
  57. package/skills/hr-agent-guidance-refresh/SKILL.md +36 -0
  58. package/skills/hr-agent-guidance-refresh/agents/openai.yaml +2 -0
  59. package/skills/hr-agent-guidance-refresh/references/verification.md +47 -0
  60. package/skills/hr-api-exposure-check/SKILL.md +159 -0
  61. package/skills/hr-api-exposure-check/agents/openai.yaml +3 -0
  62. package/skills/hr-audit-choices/SKILL.md +67 -0
  63. package/skills/hr-audit-choices/agents/openai.yaml +2 -0
  64. package/skills/hr-benchmarking/NOTICE.md +36 -0
  65. package/skills/hr-benchmarking/SKILL.md +279 -0
  66. package/skills/hr-benchmarking/agents/openai.yaml +2 -0
  67. package/skills/hr-benchmarking/references/javascript.md +130 -0
  68. package/skills/hr-benchmarking/references/tools.md +165 -0
  69. package/skills/hr-benchmarking/scripts/process-attribution.ps1 +20 -0
  70. package/skills/hr-benchmarking/scripts/process-attribution.py +107 -0
  71. package/skills/hr-better-accessibility/LICENSE +22 -0
  72. package/skills/hr-better-accessibility/NOTICE.md +46 -0
  73. package/skills/hr-better-accessibility/SKILL.md +119 -0
  74. package/skills/hr-better-accessibility/agents/openai.yaml +3 -0
  75. package/skills/hr-better-accessibility/focus-and-keyboard.md +130 -0
  76. package/skills/hr-better-accessibility/forms.md +82 -0
  77. package/skills/hr-better-accessibility/hit-areas.md +98 -0
  78. package/skills/hr-better-accessibility/motion-and-zoom.md +81 -0
  79. package/skills/hr-better-accessibility/screen-readers.md +102 -0
  80. package/skills/hr-better-accessibility/semantics-and-aria.md +84 -0
  81. package/skills/hr-better-colors/LICENSE +21 -0
  82. package/skills/hr-better-colors/NOTICE.md +37 -0
  83. package/skills/hr-better-colors/SKILL.md +114 -0
  84. package/skills/hr-better-colors/agents/openai.yaml +3 -0
  85. package/skills/hr-better-colors/color-formats.md +90 -0
  86. package/skills/hr-better-colors/color-usage.md +140 -0
  87. package/skills/hr-better-colors/contrast.md +80 -0
  88. package/skills/hr-better-colors/palette-generation.md +104 -0
  89. package/skills/hr-better-colors/palette-structure.md +76 -0
  90. package/skills/hr-better-colors/token-naming.md +97 -0
  91. package/skills/hr-better-layout/LICENSE +22 -0
  92. package/skills/hr-better-layout/NOTICE.md +48 -0
  93. package/skills/hr-better-layout/SKILL.md +92 -0
  94. package/skills/hr-better-layout/agents/openai.yaml +3 -0
  95. package/skills/hr-better-layout/grouping-and-alignment.md +144 -0
  96. package/skills/hr-better-layout/spacing-and-adaptivity.md +215 -0
  97. package/skills/hr-better-typography/LICENSE +22 -0
  98. package/skills/hr-better-typography/NOTICE.md +46 -0
  99. package/skills/hr-better-typography/SKILL.md +172 -0
  100. package/skills/hr-better-typography/agents/openai.yaml +3 -0
  101. package/skills/hr-better-typography/choosing-fonts.md +69 -0
  102. package/skills/hr-better-typography/css-cheat-sheet.md +65 -0
  103. package/skills/hr-better-typography/details-and-accessibility.md +119 -0
  104. package/skills/hr-better-typography/spacing-and-sizing.md +131 -0
  105. package/skills/hr-better-typography/variable-fonts-and-opentype.md +105 -0
  106. package/skills/hr-better-typography/wrapping-and-punctuation.md +57 -0
  107. package/skills/hr-better-writing/LICENSE +22 -0
  108. package/skills/hr-better-writing/NOTICE.md +46 -0
  109. package/skills/hr-better-writing/SKILL.md +122 -0
  110. package/skills/hr-better-writing/agents/openai.yaml +3 -0
  111. package/skills/hr-code-review/LICENSE +21 -0
  112. package/skills/hr-code-review/NOTICE.md +26 -0
  113. package/skills/hr-code-review/SKILL.md +163 -0
  114. package/skills/hr-code-review/agents/openai.yaml +3 -0
  115. package/skills/hr-code-review/references/acp-client.md +43 -0
  116. package/skills/hr-code-review/references/evidence.md +57 -0
  117. package/skills/hr-code-review/references/impact.md +103 -0
  118. package/skills/hr-code-review/references/panel-adjudication.md +58 -0
  119. package/skills/hr-code-review/references/panel-plan.md +61 -0
  120. package/skills/hr-code-review/references/panel-recommendations.json +105 -0
  121. package/skills/hr-code-review/references/panel-recommendations.md +46 -0
  122. package/skills/hr-code-review/references/panel-setup.md +54 -0
  123. package/skills/hr-code-review/references/reviewer-role.md +31 -0
  124. package/skills/hr-code-review/scripts/acp-panel-client.mjs +299 -0
  125. package/skills/hr-code-review/scripts/check-receipts.mjs +263 -0
  126. package/skills/hr-code-review/scripts/panel-plan.mjs +69 -0
  127. package/skills/hr-code-review/scripts/panel-preferences.mjs +220 -0
  128. package/skills/hr-design-exploration/SKILL.md +105 -0
  129. package/skills/hr-design-exploration/agents/openai.yaml +4 -0
  130. package/skills/hr-diagnosing-bugs/NOTICE.md +45 -0
  131. package/skills/hr-diagnosing-bugs/SKILL.md +108 -0
  132. package/skills/hr-diagnosing-bugs/agents/openai.yaml +3 -0
  133. package/skills/hr-diagnosing-bugs/references/reporting.md +97 -0
  134. package/skills/hr-diagnosing-bugs/scripts/check-pr-offer.mjs +47 -0
  135. package/skills/hr-explain-code/NOTICE.md +37 -0
  136. package/skills/hr-explain-code/SKILL.md +110 -0
  137. package/skills/hr-explain-code/agents/openai.yaml +5 -0
  138. package/skills/hr-explain-code/references/helper-brief.md +39 -0
  139. package/skills/hr-extract-shared-steps/SKILL.md +134 -0
  140. package/skills/hr-extract-shared-steps/agents/openai.yaml +3 -0
  141. package/skills/hr-forgotten-work-audit/SKILL.md +130 -0
  142. package/skills/hr-forgotten-work-audit/references/brief-template.md +56 -0
  143. package/skills/hr-forgotten-work-audit/references/result-format.md +46 -0
  144. package/skills/hr-handoff/LICENSE +21 -0
  145. package/skills/hr-handoff/NOTICE.md +29 -0
  146. package/skills/hr-handoff/SKILL.md +114 -0
  147. package/skills/hr-handoff/agents/openai.yaml +5 -0
  148. package/skills/hr-handoff/assets/ledger.example.json +10 -0
  149. package/skills/hr-handoff/assets/receipt.example.json +76 -0
  150. package/skills/hr-handoff/assets/source.example.json +20 -0
  151. package/skills/hr-handoff/references/reconciliation.md +124 -0
  152. package/skills/hr-handoff/references/successor-thread.md +76 -0
  153. package/skills/hr-handoff/scripts/check-reconciliation.mjs +324 -0
  154. package/skills/hr-house-rules-setup/SKILL.md +114 -0
  155. package/skills/hr-house-rules-setup/agents/openai.yaml +5 -0
  156. package/skills/hr-issue-tracker-setup/SKILL.md +49 -0
  157. package/skills/hr-issue-tracker-setup/agents/openai.yaml +5 -0
  158. package/skills/hr-lean-plan/SKILL.md +146 -0
  159. package/skills/hr-lean-plan/agents/openai.yaml +5 -0
  160. package/skills/hr-maintainability-review/SKILL.md +186 -0
  161. package/skills/hr-maintainability-review/agents/openai.yaml +5 -0
  162. package/skills/hr-manual-qa/NOTICE.md +36 -0
  163. package/skills/hr-manual-qa/SKILL.md +37 -0
  164. package/skills/hr-manual-qa/agents/openai.yaml +3 -0
  165. package/skills/hr-navigation-retro/LICENSE +21 -0
  166. package/skills/hr-navigation-retro/NOTICE.md +5 -0
  167. package/skills/hr-navigation-retro/SKILL.md +86 -0
  168. package/skills/hr-navigation-retro/agents/openai.yaml +4 -0
  169. package/skills/hr-navigation-retro/references/inputs.md +67 -0
  170. package/skills/hr-navigation-retro/scripts/retro.py +552 -0
  171. package/skills/hr-navigation-retro/scripts/transcripts.py +205 -0
  172. package/skills/hr-ordering-tests/SKILL.md +51 -0
  173. package/skills/hr-ordering-tests/agents/openai.yaml +2 -0
  174. package/skills/hr-plain-prose/SKILL.md +264 -0
  175. package/skills/hr-plain-prose/agents/openai.yaml +3 -0
  176. package/skills/hr-plain-prose/scripts/check.mjs +331 -0
  177. package/skills/hr-pr-followup/LICENSE +21 -0
  178. package/skills/hr-pr-followup/NOTICE.md +9 -0
  179. package/skills/hr-pr-followup/SKILL.md +74 -0
  180. package/skills/hr-pr-followup/agents/openai.yaml +2 -0
  181. package/skills/hr-pr-followup/references/review-helpers.md +111 -0
  182. package/skills/hr-pr-followup/scripts/check-landing.py +204 -0
  183. package/skills/hr-pr-followup/scripts/check-pr-review.ts +510 -0
  184. package/skills/hr-pr-followup/scripts/merge-pr.sh +100 -0
  185. package/skills/hr-pr-followup/scripts/resolve-pr-thread.ts +219 -0
  186. package/skills/hr-pr-followup/scripts/verify-landed.sh +184 -0
  187. package/skills/hr-progress-report/SKILL.md +49 -0
  188. package/skills/hr-progress-report/agents/openai.yaml +5 -0
  189. package/skills/hr-read-reddit/SKILL.md +44 -0
  190. package/skills/hr-read-reddit/agents/openai.yaml +2 -0
  191. package/skills/hr-read-reddit/scripts/reddit.ts +252 -0
  192. package/skills/hr-read-x-links/SKILL.md +42 -0
  193. package/skills/hr-read-x-links/agents/openai.yaml +2 -0
  194. package/skills/hr-read-x-links/scripts/x-post.ts +264 -0
  195. package/skills/hr-research-shared-links/SKILL.md +103 -0
  196. package/skills/hr-split-to-prs/LICENSE +21 -0
  197. package/skills/hr-split-to-prs/NOTICE.md +9 -0
  198. package/skills/hr-split-to-prs/SKILL.md +61 -0
  199. package/skills/hr-split-to-prs/agents/openai.yaml +2 -0
  200. package/skills/hr-sqlite/SKILL.md +174 -0
  201. package/skills/hr-sqlite/agents/openai.yaml +2 -0
  202. package/skills/hr-sqlite/references/evidence.md +94 -0
  203. package/skills/hr-sqlite/references/tool-decisions.md +39 -0
  204. package/skills/hr-sqlite/scripts/inspect-sqlite.py +245 -0
  205. package/skills/hr-stock-ui-audit/SKILL.md +132 -0
  206. package/skills/hr-stock-ui-audit/agents/openai.yaml +3 -0
  207. package/skills/hr-stock-ui-audit/scripts/scan.mjs +619 -0
  208. package/skills/hr-tdd/LICENSE +21 -0
  209. package/skills/hr-tdd/NOTICE.md +10 -0
  210. package/skills/hr-tdd/SKILL.md +40 -0
  211. package/skills/hr-tdd/agents/openai.yaml +3 -0
  212. package/skills/hr-tdd/mocking.md +39 -0
  213. package/skills/hr-tdd/tests.md +77 -0
  214. package/skills/hr-test-audit/LICENSE +21 -0
  215. package/skills/hr-test-audit/NOTICE.md +67 -0
  216. package/skills/hr-test-audit/SKILL.md +146 -0
  217. package/skills/hr-test-audit/agents/openai.yaml +3 -0
  218. package/skills/hr-test-audit/scripts/floor-guard.ts +137 -0
  219. package/skills/hr-usage-report/SKILL.md +90 -0
  220. package/skills/hr-usage-report/agents/openai.yaml +2 -0
  221. package/skills/hr-usage-report/assets/example-report.json +125 -0
  222. package/skills/hr-usage-report/assets/report-template.html +377 -0
  223. package/skills/hr-usage-report/scripts/render-report.ts +86 -0
  224. package/skills/hr-usage-report/scripts/usage-by-model.ts +499 -0
  225. package/skills/hr-what-next/SKILL.md +151 -0
  226. package/skills/hr-what-next/agents/openai.yaml +4 -0
  227. package/skills/hr-what-next/references/reporting.md +59 -0
  228. package/skills/hr-what-next/scripts/check-open-work.mjs +711 -0
  229. package/skills/hr-writing-for-agents/NOTICE.md +46 -0
  230. package/skills/hr-writing-for-agents/SKILL-MECHANICS.md +83 -0
  231. package/skills/hr-writing-for-agents/SKILL.md +108 -0
  232. package/skills/hr-writing-for-agents/agents/openai.yaml +3 -0
  233. package/skills/hr-writing-pr/NOTICE.md +48 -0
  234. package/skills/hr-writing-pr/SKILL.md +119 -0
  235. package/skills/hr-writing-pr/agents/openai.yaml +2 -0
  236. package/skills/hr-writing-pr/scripts/benefit-chart.py +200 -0
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: hr-handoff
3
+ description: Create a resumable handoff when the user requests one or the low-quota handoff rule triggers. Do not invoke merely because a conversation is long.
4
+ argument-hint: "What will the next session be used for?"
5
+ disable-model-invocation: false
6
+ ---
7
+
8
+ Write a handoff document summarising the current conversation so a fresh agent can continue the work. Save it outside disposable storage and task worktrees, as § Durable notes in the house rules requires.
9
+
10
+ Default to `handoffs/<project>/<session>.md` in your notes directory (§ Durable notes), expanding `~` and environment variables to an absolute path. Respect a user-selected persistent location. Create parent directories as needed, choose a unique session name, reuse the file for updates, verify its contents, and report the absolute path. Do not default to temporary directories or caches for resumable handoffs.
11
+
12
+ For a low-quota handoff (trigger defined by the `low-quota-handoff` modifier), do only what
13
+ is necessary to reach a safe boundary. Do not abandon time-critical duty mid-action. Create the essential
14
+ current state, Git ownership
15
+ and next action first so they survive an interrupted write; then fill in the
16
+ remaining context. Record the triggering bucket, reading source/time and reset
17
+ time when known, and unknown quota/reset information as unknown.
18
+
19
+ Verify the saved handoff, report its absolute path, and end the turn without
20
+ continuing substantive work, even if tasks were previously authorized; this is the stop
21
+ the house rules' § End of every reply allows for a rule you are following. Only an explicit
22
+ user instruction resumes work, limited to its requested scope; update this same
23
+ handoff and stop again afterward while quota remains low. Do not change
24
+ provider, model or effort without authorization.
25
+
26
+ For a handoff unrelated to quota, follow the user's requested continuation or
27
+ stop boundary.
28
+
29
+ Before a handoff unrelated to quota, check the docs this session relied on or
30
+ changed against the current code: repository guidance, READMEs and design docs
31
+ that name the files, commands or behavior the session touched. List each claim
32
+ the code contradicts, with the doc's file and line and the code evidence, and
33
+ propose the smallest fix for each. Edit docs only with the user's approval;
34
+ record unapproved contradictions as open items so the next session doesn't
35
+ trust them. Skip this check for a low-quota handoff.
36
+
37
+ Preserve, stated exactly and complete even at the cost of length: (1) problems that came up and how they were handled; (2) options raised, tried, or set aside, and why; (3) anything asked for, decided, ruled out, or established as a preference, constraint, or boundary; (4) exactly where things stand now, including any external action started without a recorded result; (5) anything still open, promised, or expected next; (6) details that are hard to reconstruct: names, numbers, dates, exact wording, paths, links. Keep what the user said close to their own words; condense your own reasoning to what it concluded or produced. Everything else stays concise.
38
+
39
+ Close the loop on remaining work: inventory every current and past item as done,
40
+ open, or deferred, each with its owner and next action, and state whether all
41
+ items are addressed. When the handoff spans several threads or scopes, include
42
+ an integrated plan. Preserve an already-selected next action; record unresolved
43
+ decisions and recommendations in priority order.
44
+
45
+ For a handoff unrelated to quota, follow
46
+ [reconciliation.md](references/reconciliation.md) to compare the current and
47
+ preceding source transcripts, linked ledgers and Git inventory with this
48
+ inventory. Name each predecessor plan as a source, so every open or deferred
49
+ line in its ledger carries over as an item. Save its receipt and run the offline checker. Report coverage gaps
50
+ and mechanical results separately from the reviewed claim that all items are
51
+ addressed. Include owned unlanded PRs, dependency PRs and own commits without a
52
+ PR; preserve their owners and landing authority.
53
+
54
+ When a handoff unrelated to quota moves work to another thread, also move what
55
+ the host binds to the outgoing thread:
56
+
57
+ 1. Inventory it: scheduled or recurring tasks, linked pull requests and PR
58
+ watches, and any agent-mail or messaging registration and its subscriptions.
59
+ Use the host's own list or status commands for each.
60
+ 2. Move or record each item. Where the host lets the receiving thread bind it,
61
+ the handoff names the exact call the receiver makes; some hosts let a thread
62
+ bind a task only to itself, so the outgoing thread cannot move it. Otherwise
63
+ record why it stays. Read each item back after the move; a move without a
64
+ read-back is unfinished. Retire the outgoing copy of a task only after the
65
+ receiver's read-back confirms its replacement, so the work neither runs twice nor is lost.
66
+ 3. Follow any thread-switch checklist the owning repository or the user's
67
+ guidance names, and list it in the handoff.
68
+ 4. Keep the outgoing registration until the user closes the old thread, then
69
+ retire it.
70
+ 5. Give each bound item a row in the receipt, with owner, state and next action.
71
+
72
+ When the new thread replaces this one as its successor, also follow
73
+ [successor-thread.md](references/successor-thread.md) for when a replacement is
74
+ warranted, its safe boundary, the title and the successor record.
75
+
76
+ At a low-quota stop, save essential state first and record partial coverage
77
+ when feasible. An unfinished receipt or failing check never delays that stop.
78
+
79
+ Ask what to work on next only when an unresolved decision needs the user's
80
+ input and the handoff's stop boundary permits it. Follow the house rules'
81
+ § Offers and § Finishing work. When stopping for low quota, the saved handoff and recorded next action serve
82
+ as the offer; do not ask a new selection question.
83
+
84
+ A session resuming from a handoff re-reads the repository's guidance index,
85
+ meaning its `AGENTS.md` (or configured instruction root) and the rules and docs
86
+ it names. It also checks `git log` on those paths plus the house-rules checkout
87
+ for changes since the handoff was written; an installed or composed copy of
88
+ the rules can lag its source. Boot-injected rules are a snapshot, not proof of
89
+ current text.
90
+
91
+ Include a **Git** section when the handoff involves repo work:
92
+
93
+ ```markdown
94
+ ## Git
95
+
96
+ - Checkout: <absolute path>; branch or detached HEAD: <verified value>
97
+ - Owns: `path/globs`
98
+ - Do not touch: `<paths other chats own>`
99
+ - Last commit: `<sha> <subject>`
100
+ ```
101
+
102
+ If two chats run in parallel on this repo, owns must not overlap. Prefer one implementation chat at a time.
103
+
104
+ End your report with a ready-to-paste prompt for the resuming agent inside a
105
+ fenced code block, so the user can copy it into a fresh session verbatim. It
106
+ must name the handoff's absolute path, tell the resuming session to read the
107
+ handoff fully before acting (which itself directs the guidance re-read), and
108
+ state the recorded next action plus any provider or host constraint the user
109
+ gave. Keep it under ten lines; the handoff carries the detail, the prompt only
110
+ points at it.
111
+
112
+ Redact any sensitive information, such as API keys, passwords, or personally identifiable information.
113
+
114
+ If the user passed arguments, treat them as a description of what the next session will focus on and tailor the doc accordingly.
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "HR: Handoff"
3
+ short_description: "Create a resumable handoff"
4
+ policy:
5
+ allow_implicit_invocation: true
@@ -0,0 +1,10 @@
1
+ {
2
+ "records": [
3
+ {
4
+ "id": "deferred-1",
5
+ "text": "User deferred the evaluation. Resume only after explicit selection.",
6
+ "at": "2025-01-01T09:00:00Z",
7
+ "outcome": { "item": "evaluation", "state": "deferred" }
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "version": 1,
3
+ "owner": "session-example",
4
+ "coverage": "complete",
5
+ "sources": [
6
+ {
7
+ "id": "current",
8
+ "file": "source.example.json",
9
+ "snapshot": "Fictional session records through 2025-01-01T10:01:00Z",
10
+ "expectedRecords": 3,
11
+ "gaps": []
12
+ },
13
+ {
14
+ "id": "prior-ledger",
15
+ "file": "ledger.example.json",
16
+ "snapshot": "Fictional child ledger at 2025-01-01T09:00:00Z",
17
+ "expectedRecords": 1,
18
+ "gaps": []
19
+ }
20
+ ],
21
+ "accounting": [
22
+ { "source": "current", "record": "request-1", "items": ["parser", "landing"] },
23
+ { "source": "current", "record": "completion-1", "items": ["parser"] },
24
+ { "source": "current", "record": "git-1", "items": ["landing"] },
25
+ { "source": "prior-ledger", "record": "deferred-1", "items": ["evaluation"] }
26
+ ],
27
+ "items": [
28
+ {
29
+ "id": "parser",
30
+ "owner": "session-example",
31
+ "state": "done",
32
+ "evidence": [{ "source": "current", "record": "completion-1" }],
33
+ "next": "Implementation complete; landing is tracked separately."
34
+ },
35
+ {
36
+ "id": "landing",
37
+ "owner": "session-example",
38
+ "state": "open",
39
+ "evidence": [{ "source": "current", "record": "git-1" }],
40
+ "next": "Wait for the user's landing decision; dependency PR9 belongs to its owner."
41
+ },
42
+ {
43
+ "id": "evaluation",
44
+ "owner": "session-example",
45
+ "state": "deferred",
46
+ "evidence": [{ "source": "prior-ledger", "record": "deferred-1" }],
47
+ "next": "Resume only after explicit user selection."
48
+ }
49
+ ],
50
+ "git": {
51
+ "scope": "example/widget; no other repository work",
52
+ "checkedAt": "2025-01-01T10:01:00Z",
53
+ "evidence": [{ "source": "current", "record": "git-1" }],
54
+ "ownedPrs": [
55
+ {
56
+ "url": "https://github.com/example/widget/pull/8",
57
+ "owner": "session-example",
58
+ "state": "open",
59
+ "checkedAt": "2025-01-01T10:01:00Z",
60
+ "evidence": [{ "source": "current", "record": "git-1" }],
61
+ "next": "Wait for the user's landing decision."
62
+ }
63
+ ],
64
+ "dependencyPrs": [
65
+ {
66
+ "url": "https://github.com/example/widget/pull/9",
67
+ "owner": "session-other",
68
+ "state": "open",
69
+ "checkedAt": "2025-01-01T10:01:00Z",
70
+ "evidence": [{ "source": "current", "record": "git-1" }],
71
+ "next": "Await the owner's adoption receipt; no landing authority transferred."
72
+ }
73
+ ],
74
+ "commitsWithoutPr": []
75
+ }
76
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "records": [
3
+ {
4
+ "id": "request-1",
5
+ "text": "Implement the parser, then wait for my landing decision."
6
+ },
7
+ {
8
+ "id": "completion-1",
9
+ "text": "Parser implementation and checks complete; PR8 remains unlanded.",
10
+ "at": "2025-01-01T10:00:00Z",
11
+ "outcome": { "item": "parser", "state": "done" }
12
+ },
13
+ {
14
+ "id": "git-1",
15
+ "text": "Checked example/widget: own PR8 open, dependency PR9 open, no commits without a PR.",
16
+ "at": "2025-01-01T10:01:00Z",
17
+ "outcome": { "item": "landing", "state": "open" }
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,124 @@
1
+ # Reconcile a handoff against its sources
2
+
3
+ Keep a JSON receipt beside the human-readable handoff. It accounts for the
4
+ source records you reviewed and the candidates you extracted. It does not
5
+ replace reading their content or reviewing context-only classifications.
6
+
7
+ ## Collect independent source snapshots
8
+
9
+ Review the current transcript and the preceding handoff's source transcript
10
+ when available. Include linked plans, child ledgers, pending decisions, owned
11
+ Git work and what the host binds to the outgoing thread (scheduled tasks, PR
12
+ watches, mail or messaging registration and subscriptions), as listed in the skill's
13
+ thread-move step. Use the host's existing export and session-search tools.
14
+ Preserve source IDs and text rather than exporting only the items you already
15
+ remembered.
16
+
17
+ Normalize each source into a JSON object with a `records` array. Each record
18
+ has a unique `id` and its original `text`. Record the original location and
19
+ snapshot or range in the receipt's `snapshot` field. Name records by stable
20
+ message IDs or ledger row IDs. Several records can map to the same item.
21
+
22
+ A predecessor plan needs no conversion. Name its `plan.md` as the source
23
+ `file`; the checker reads each item line of its `## Ledger` section (`- [ ]`,
24
+ `- [~]`, `- [x]`, `- [-]`) as a record named `L<line>` (`L12`). Other text in
25
+ the section is not read, so turn any follow-up written there into an item line
26
+ before the handoff. Take a copy of the plan as it stood at the handoff,
27
+ because later edits renumber the lines. Each open or deferred line must map to
28
+ an item; a context-only reason such as "the rest, reopen only if asked" is
29
+ rejected. When one item absorbs several open or deferred lines, give the item
30
+ a `merges` field saying how one next action and one piece of completion evidence
31
+ satisfy every line. A ledger kept as a table is not read; normalize it to JSON
32
+ records instead.
33
+
34
+ When a record settles an item's state, add an `outcome` with `item` and
35
+ `state`, plus `at` as a UTC ISO timestamp. States are `done`, `open` and
36
+ `deferred`. Use the evidence's time, not the export time. A later request or
37
+ current contradictory evidence that reopens completed work also sets
38
+ `outcome.reopens` to `true`. These annotations are reviewed judgments.
39
+
40
+ Record each expected count from independent export metadata or ledger
41
+ inventory. Use `null` when the total is unknown. A count is for the declared
42
+ snapshot or range; it does not establish coverage outside that range.
43
+ Describe missing, omitted, truncated or unavailable content in `gaps`.
44
+ Keep sensitive snapshots local and redact secrets before normalization.
45
+
46
+ ## Fill the receipt
47
+
48
+ Copy the fictional [receipt example](../assets/receipt.example.json) and its
49
+ [session snapshot](../assets/source.example.json) and
50
+ [child ledger](../assets/ledger.example.json) into persistent notes. Replace
51
+ their contents with this session's evidence. Source `file` paths resolve
52
+ relative to the receipt; the checker reads only explicitly named snapshots.
53
+
54
+ - `version` is `1`; `owner` names this session. `coverage` is `complete` or
55
+ `partial`. Claim complete only for the declared source ranges with known
56
+ counts and no known gaps.
57
+ - Each `sources` entry has `id`, `file`, `snapshot`, `expectedRecords` and
58
+ `gaps`. Include inaccessible sources and their limitations rather than
59
+ silently dropping them.
60
+ - Every source record gets one `accounting` row with `source` and `record`.
61
+ Add nonempty `items` containing extracted item IDs, or a `context` reason
62
+ explaining why the record creates no candidate. Review user requests and
63
+ assistant commitments and options before assigning context-only status.
64
+ - Each `items` entry has `id`, `owner`, `state`, `evidence` and `next`, plus
65
+ `merges` when it carries over more than one open or deferred plan line.
66
+ Evidence references use `{ "source": "source-id", "record": "record-id" }`.
67
+ Include the latest declared outcome. For deferred work, `next` gives its
68
+ trigger; for done work, give its result and any separately tracked follow-up.
69
+ - Thread-bound state (scheduled or recurring tasks, PR watches, any mail or
70
+ messaging registration and subscriptions) is an `items` entry like any other. `next`
71
+ names the receiver's exact call to bind it and how to read it back, or why it
72
+ stays with the outgoing thread until the user closes it.
73
+ - `git` records `scope`, `checkedAt` and `evidence`, plus explicit `ownedPrs`,
74
+ `dependencyPrs` and `commitsWithoutPr` arrays. Empty arrays are checked
75
+ results, not omitted fields. For no repository work, say so in `scope` and
76
+ reference the evidence for that conclusion.
77
+ - Every PR has `url`, `owner`, `state`, `checkedAt`, `evidence` and `next`.
78
+ PR states are `open`, `closed` and `merged`. Put every owned unlanded PR in
79
+ `ownedPrs`; distinguish dependency PRs owned by another session.
80
+ Owned PRs must match the receipt owner. Dependencies confer no landing
81
+ authority. Query all touched repositories; host-linked PR lists alone can
82
+ omit work.
83
+ - Own commits without a PR have `repo`, `branch`, `sha`, `owner`, `evidence`
84
+ and `next`. Inspect checkout state and remote containment as the repository
85
+ requires. Do not infer landing from a closed PR alone.
86
+
87
+ Use UTC ISO timestamps such as `2025-01-01T10:01:00Z`. State the query scope
88
+ and check time; this offline checker does not refresh Git or PR state.
89
+
90
+ Preserve already-selected work and the latest unanswered offer, including its
91
+ scope. Questions, inbox notices and other owners' messages grant no new
92
+ authorization. Reconcile a stale open row with later completion evidence;
93
+ record a later reopening separately.
94
+
95
+ ## Run the offline check
96
+
97
+ From this skill's directory, replace the receipt path with its saved location:
98
+
99
+ ```sh
100
+ node scripts/check-reconciliation.mjs <receipt.json>
101
+ ```
102
+
103
+ Bun runs the same script. It prints JSON with status, counts, missing IDs,
104
+ errors, coverage gaps and limits. It does not write files or query hosts.
105
+ Repeating the command on unchanged inputs repeats no external action.
106
+
107
+ | Exit | Meaning | Action |
108
+ | ---- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
109
+ | `0` | Supplied accounting and declared outcomes are mechanically complete | Review the semantic coverage and saved handoff before claiming all items were addressed. |
110
+ | `1` | Malformed input, missing accounting or contradictory declared state | Resolve the reported fields and IDs within the handoff's stop boundary. |
111
+ | `2` | Valid accounting with partial coverage | Save the limitations and known next action; do not label coverage complete. |
112
+
113
+ The checker cannot detect a promise hidden behind a context-only annotation,
114
+ an omitted source, a falsely complete export or an omitted PR query scope.
115
+ Its success checks supplied evidence, not every possible task or current
116
+ external state. Report those limits beside the result.
117
+
118
+ ## Low-quota stop
119
+
120
+ Write essential current state, Git ownership and next action first. Save known
121
+ coverage and missing sources when feasible. Keep the partial handoff even if
122
+ its receipt is unfinished or the checker reports errors. Do not recover a
123
+ transcript, run new evaluations or continue substantive work to make the
124
+ checker pass. The skill's low-quota stop takes precedence over reconciliation.
@@ -0,0 +1,76 @@
1
+ # Replace a session with a successor thread
2
+
3
+ Follow this when a handoff moves work to a fresh thread that takes over from
4
+ the current one. It decides when replacing a session is warranted, when it is
5
+ safe and what the handoff and the successor record. It does not authorize
6
+ starting a thread. The house rules' § Repository work still requires the
7
+ user's direction, a standing spin-off preference or a rule that requires the
8
+ handoff. The host's own guidance owns the tool calls that create, rename and
9
+ rebind a thread.
10
+
11
+ ## When stale guidance warrants a new session
12
+
13
+ Replace a session because its injected guidance went stale only when the change
14
+ is session-critical:
15
+
16
+ - an always-on rule, or a safety rule
17
+ - the catalog entry (name and description) of a skill the session uses
18
+ - a subagent definition the session uses
19
+
20
+ A change to a skill body or a doc does not warrant a new session. The session
21
+ rereads it with `hr-agent-guidance-refresh` at its next boundary, and the body
22
+ is read when the skill runs. That skill notes that a reread does not prove the
23
+ injected context changed, so use the list above, not the reread, to decide
24
+ whether a replacement is needed.
25
+
26
+ ## Boundary
27
+
28
+ Never replace a session mid-turn, in the middle of an evaluation that fixed its
29
+ guidance, or while an external action is pending. An action is pending when it
30
+ has started without a recorded result. Replace it only when the session is
31
+ idle, nothing is running and the ledger is reconciled under the house rules'
32
+ § Finishing work.
33
+
34
+ ## Successor title
35
+
36
+ A successor keeps the base title and ends it with ` v<N>`. The first thread
37
+ counts as `v1` and is renamed at the handoff.
38
+
39
+ 1. If the title ends in ` v` followed by digits, the base is the title without
40
+ that ending and N is that number. Otherwise the base is the whole title and
41
+ N is 1.
42
+ 2. Rename the outgoing thread to `<base> v<N>` when its title does not already
43
+ end that way.
44
+ 3. Give the successor `<base> v<N+1>`, writing N+1 as a plain number without
45
+ leading zeros.
46
+
47
+ A title is a label for people. Never look a thread up by its title. Use the
48
+ registry row, the project and the thread id.
49
+
50
+ ## What the handoff records
51
+
52
+ - The outgoing thread's id and the successor's id, so each points to the other.
53
+ - Each open offer by the offer ID the ledger recorded for it, with its
54
+ question, options and recommendation. The house rules' § Offers records an ID
55
+ for every offer, including a text-only one that never displayed it. The
56
+ successor treats an offer as open only if the handoff lists it and the latest
57
+ ledger or source record still shows it open. An offer answered, completed,
58
+ deferred or superseded since the handoff was written authorizes nothing. A
59
+ bare code or `go` in the successor selects an offer only when one listed offer
60
+ is open. With several, it asks which one, as § Offers requires.
61
+ - The inventory and read-backs from the skill's thread-move step. The
62
+ receiving thread re-points to itself each item the host lets it bind:
63
+ registry rows, scheduled tasks, pull request watches and the messaging name
64
+ the work was known by. For an item it cannot bind, the handoff keeps the
65
+ recorded reason it stays with the outgoing thread. Where the host does not let
66
+ the successor take over the name, the handoff says which name the successor
67
+ registers and who needs to be told.
68
+
69
+ ## Successor record
70
+
71
+ - Mark the outgoing thread settled and record a pointer to the successor where
72
+ the host keeps such notes. Do this last, after the successor confirms it has
73
+ read the handoff.
74
+ - The successor starts by reading the handoff in full. It re-points each item
75
+ it can bind, with a read-back, and records every result in the receipt,
76
+ including the items that stay behind. Only then does it take new work.