rhachet-roles-bhrain 0.2.0 → 0.5.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 (365) hide show
  1. package/dist/.test/getContextOpenAI.js +1 -1
  2. package/dist/.test/getContextOpenAI.js.map +1 -1
  3. package/dist/access/sdk/sdkOpenAi.d.ts +25 -0
  4. package/dist/access/sdk/sdkOpenAi.js +122 -0
  5. package/dist/access/sdk/sdkOpenAi.js.map +1 -1
  6. package/dist/access/sdks/anthropic/sdkAnthropic.d.ts +31 -0
  7. package/dist/access/sdks/anthropic/sdkAnthropic.js +151 -0
  8. package/dist/access/sdks/anthropic/sdkAnthropic.js.map +1 -0
  9. package/dist/access/sdks/qwen/sdkQwen.d.ts +31 -0
  10. package/dist/access/sdks/qwen/sdkQwen.js +134 -0
  11. package/dist/access/sdks/qwen/sdkQwen.js.map +1 -0
  12. package/dist/domain.objects/BrainArch1/BrainArch1Actor.d.ts +67 -0
  13. package/dist/domain.objects/BrainArch1/BrainArch1Actor.js +12 -0
  14. package/dist/domain.objects/BrainArch1/BrainArch1Actor.js.map +1 -0
  15. package/dist/domain.objects/BrainArch1/BrainArch1Atom.d.ts +40 -0
  16. package/dist/domain.objects/BrainArch1/BrainArch1Atom.js +3 -0
  17. package/dist/domain.objects/BrainArch1/BrainArch1Atom.js.map +1 -0
  18. package/dist/domain.objects/BrainArch1/BrainArch1Context.d.ts +30 -0
  19. package/dist/domain.objects/BrainArch1/BrainArch1Context.js +3 -0
  20. package/dist/domain.objects/BrainArch1/BrainArch1Context.js.map +1 -0
  21. package/dist/domain.objects/BrainArch1/BrainArch1LoopIteration.d.ts +34 -0
  22. package/dist/domain.objects/BrainArch1/BrainArch1LoopIteration.js +8 -0
  23. package/dist/domain.objects/BrainArch1/BrainArch1LoopIteration.js.map +1 -0
  24. package/dist/domain.objects/BrainArch1/BrainArch1LoopIterationCompletedEvent.d.ts +23 -0
  25. package/dist/domain.objects/BrainArch1/BrainArch1LoopIterationCompletedEvent.js +9 -0
  26. package/dist/domain.objects/BrainArch1/BrainArch1LoopIterationCompletedEvent.js.map +1 -0
  27. package/dist/domain.objects/BrainArch1/BrainArch1LoopResult.d.ts +49 -0
  28. package/dist/domain.objects/BrainArch1/BrainArch1LoopResult.js +8 -0
  29. package/dist/domain.objects/BrainArch1/BrainArch1LoopResult.js.map +1 -0
  30. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactedEvent.d.ts +31 -0
  31. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactedEvent.js +9 -0
  32. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactedEvent.js.map +1 -0
  33. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactionResult.d.ts +27 -0
  34. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactionResult.js +8 -0
  35. package/dist/domain.objects/BrainArch1/BrainArch1MemoryCompactionResult.js.map +1 -0
  36. package/dist/domain.objects/BrainArch1/BrainArch1MemoryManager.d.ts +45 -0
  37. package/dist/domain.objects/BrainArch1/BrainArch1MemoryManager.js +3 -0
  38. package/dist/domain.objects/BrainArch1/BrainArch1MemoryManager.js.map +1 -0
  39. package/dist/domain.objects/BrainArch1/BrainArch1MemoryTokenUsage.d.ts +29 -0
  40. package/dist/domain.objects/BrainArch1/BrainArch1MemoryTokenUsage.js +8 -0
  41. package/dist/domain.objects/BrainArch1/BrainArch1MemoryTokenUsage.js.map +1 -0
  42. package/dist/domain.objects/BrainArch1/BrainArch1PermissionDecision.d.ts +22 -0
  43. package/dist/domain.objects/BrainArch1/BrainArch1PermissionDecision.js +8 -0
  44. package/dist/domain.objects/BrainArch1/BrainArch1PermissionDecision.js.map +1 -0
  45. package/dist/domain.objects/BrainArch1/BrainArch1PermissionGuard.d.ts +30 -0
  46. package/dist/domain.objects/BrainArch1/BrainArch1PermissionGuard.js +3 -0
  47. package/dist/domain.objects/BrainArch1/BrainArch1PermissionGuard.js.map +1 -0
  48. package/dist/domain.objects/BrainArch1/BrainArch1Session.d.ts +47 -0
  49. package/dist/domain.objects/BrainArch1/BrainArch1Session.js +17 -0
  50. package/dist/domain.objects/BrainArch1/BrainArch1Session.js.map +1 -0
  51. package/dist/domain.objects/BrainArch1/BrainArch1SessionMessage.d.ts +34 -0
  52. package/dist/domain.objects/BrainArch1/BrainArch1SessionMessage.js +12 -0
  53. package/dist/domain.objects/BrainArch1/BrainArch1SessionMessage.js.map +1 -0
  54. package/dist/domain.objects/BrainArch1/BrainArch1ToolCall.d.ts +21 -0
  55. package/dist/domain.objects/BrainArch1/BrainArch1ToolCall.js +8 -0
  56. package/dist/domain.objects/BrainArch1/BrainArch1ToolCall.js.map +1 -0
  57. package/dist/domain.objects/BrainArch1/BrainArch1ToolDefinition.d.ts +54 -0
  58. package/dist/domain.objects/BrainArch1/BrainArch1ToolDefinition.js +20 -0
  59. package/dist/domain.objects/BrainArch1/BrainArch1ToolDefinition.js.map +1 -0
  60. package/dist/domain.objects/BrainArch1/BrainArch1ToolExecutionCompletedEvent.d.ts +36 -0
  61. package/dist/domain.objects/BrainArch1/BrainArch1ToolExecutionCompletedEvent.js +9 -0
  62. package/dist/domain.objects/BrainArch1/BrainArch1ToolExecutionCompletedEvent.js.map +1 -0
  63. package/dist/domain.objects/BrainArch1/BrainArch1ToolResult.d.ts +25 -0
  64. package/dist/domain.objects/BrainArch1/BrainArch1ToolResult.js +8 -0
  65. package/dist/domain.objects/BrainArch1/BrainArch1ToolResult.js.map +1 -0
  66. package/dist/domain.objects/BrainArch1/BrainArch1Toolbox.d.ts +31 -0
  67. package/dist/domain.objects/BrainArch1/BrainArch1Toolbox.js +3 -0
  68. package/dist/domain.objects/BrainArch1/BrainArch1Toolbox.js.map +1 -0
  69. package/dist/domain.objects/Reviewer/ReviewerReflectManifest.d.ts +44 -0
  70. package/dist/domain.objects/Reviewer/ReviewerReflectManifest.js +8 -0
  71. package/dist/domain.objects/Reviewer/ReviewerReflectManifest.js.map +1 -0
  72. package/dist/domain.objects/Reviewer/ReviewerReflectManifestOperation.d.ts +30 -0
  73. package/dist/domain.objects/Reviewer/ReviewerReflectManifestOperation.js +35 -0
  74. package/dist/domain.objects/Reviewer/ReviewerReflectManifestOperation.js.map +1 -0
  75. package/dist/domain.objects/Reviewer/ReviewerReflectMetrics.d.ts +89 -0
  76. package/dist/domain.objects/Reviewer/ReviewerReflectMetrics.js +8 -0
  77. package/dist/domain.objects/Reviewer/ReviewerReflectMetrics.js.map +1 -0
  78. package/dist/domain.objects/Reviewer/ReviewerReflectRuleProposal.d.ts +43 -0
  79. package/dist/domain.objects/Reviewer/ReviewerReflectRuleProposal.js +8 -0
  80. package/dist/domain.objects/Reviewer/ReviewerReflectRuleProposal.js.map +1 -0
  81. package/dist/domain.operations/artifact/genLoopFeedback.js +1 -1
  82. package/dist/domain.operations/artifact/genLoopFeedback.js.map +1 -1
  83. package/dist/domain.operations/artifact/genStepGrabCallerFeedbackToArtifact.d.ts +1 -1
  84. package/dist/domain.operations/brain.replic.arch1/core/invokeBrainArch1.d.ts +13 -0
  85. package/dist/domain.operations/brain.replic.arch1/core/invokeBrainArch1.js +106 -0
  86. package/dist/domain.operations/brain.replic.arch1/core/invokeBrainArch1.js.map +1 -0
  87. package/dist/domain.operations/brain.replic.arch1/llm/generateBrainArch1LlmResponse.d.ts +18 -0
  88. package/dist/domain.operations/brain.replic.arch1/llm/generateBrainArch1LlmResponse.js +16 -0
  89. package/dist/domain.operations/brain.replic.arch1/llm/generateBrainArch1LlmResponse.js.map +1 -0
  90. package/dist/domain.operations/brain.replic.arch1/loop/iterateBrainArch1Loop.d.ts +30 -0
  91. package/dist/domain.operations/brain.replic.arch1/loop/iterateBrainArch1Loop.js +71 -0
  92. package/dist/domain.operations/brain.replic.arch1/loop/iterateBrainArch1Loop.js.map +1 -0
  93. package/dist/domain.operations/brain.replic.arch1/loop/runBrainArch1Loop.d.ts +20 -0
  94. package/dist/domain.operations/brain.replic.arch1/loop/runBrainArch1Loop.js +90 -0
  95. package/dist/domain.operations/brain.replic.arch1/loop/runBrainArch1Loop.js.map +1 -0
  96. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/anthropic.d.ts +8 -0
  97. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/anthropic.js +31 -0
  98. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/anthropic.js.map +1 -0
  99. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/index.d.ts +3 -0
  100. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/index.js +10 -0
  101. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/index.js.map +1 -0
  102. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/openai.d.ts +8 -0
  103. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/openai.js +31 -0
  104. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/openai.js.map +1 -0
  105. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/qwen.d.ts +8 -0
  106. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/qwen.js +32 -0
  107. package/dist/domain.operations/brain.replic.arch1/plugins/atoms/qwen.js.map +1 -0
  108. package/dist/domain.operations/brain.replic.arch1/plugins/memoryManagers/slidingWindow.d.ts +6 -0
  109. package/dist/domain.operations/brain.replic.arch1/plugins/memoryManagers/slidingWindow.js +80 -0
  110. package/dist/domain.operations/brain.replic.arch1/plugins/memoryManagers/slidingWindow.js.map +1 -0
  111. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/allowAll.d.ts +6 -0
  112. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/allowAll.js +14 -0
  113. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/allowAll.js.map +1 -0
  114. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/promptUser.d.ts +8 -0
  115. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/promptUser.js +52 -0
  116. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/promptUser.js.map +1 -0
  117. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly.d.ts +8 -0
  118. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly.js +38 -0
  119. package/dist/domain.operations/brain.replic.arch1/plugins/permissionGuards/readOnly.js.map +1 -0
  120. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/exec.d.ts +33 -0
  121. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/exec.js +100 -0
  122. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/exec.js.map +1 -0
  123. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/index.d.ts +6 -0
  124. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/index.js +26 -0
  125. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/bash/index.js.map +1 -0
  126. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/edit.d.ts +41 -0
  127. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/edit.js +107 -0
  128. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/edit.js.map +1 -0
  129. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/glob.d.ts +33 -0
  130. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/glob.js +68 -0
  131. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/glob.js.map +1 -0
  132. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/grep.d.ts +41 -0
  133. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/grep.js +97 -0
  134. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/grep.js.map +1 -0
  135. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/index.d.ts +6 -0
  136. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/index.js +65 -0
  137. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/index.js.map +1 -0
  138. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/read.d.ts +37 -0
  139. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/read.js +96 -0
  140. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/read.js.map +1 -0
  141. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/write.d.ts +33 -0
  142. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/write.js +81 -0
  143. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/files/write.js.map +1 -0
  144. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/fetch.d.ts +33 -0
  145. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/fetch.js +113 -0
  146. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/fetch.js.map +1 -0
  147. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/index.d.ts +6 -0
  148. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/index.js +36 -0
  149. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/index.js.map +1 -0
  150. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/search.d.ts +36 -0
  151. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/search.js +101 -0
  152. package/dist/domain.operations/brain.replic.arch1/plugins/toolboxes/web/search.js.map +1 -0
  153. package/dist/domain.operations/brain.replic.arch1/tool/executeBrainArch1ToolCall.d.ts +14 -0
  154. package/dist/domain.operations/brain.replic.arch1/tool/executeBrainArch1ToolCall.js +45 -0
  155. package/dist/domain.operations/brain.replic.arch1/tool/executeBrainArch1ToolCall.js.map +1 -0
  156. package/dist/domain.operations/brain.replic.arch1/tool/mergeBrainArch1Toolboxes.d.ts +19 -0
  157. package/dist/domain.operations/brain.replic.arch1/tool/mergeBrainArch1Toolboxes.js +35 -0
  158. package/dist/domain.operations/brain.replic.arch1/tool/mergeBrainArch1Toolboxes.js.map +1 -0
  159. package/dist/domain.operations/git/genGitHubFileUrl.d.ts +9 -0
  160. package/dist/domain.operations/git/genGitHubFileUrl.js +55 -0
  161. package/dist/domain.operations/git/genGitHubFileUrl.js.map +1 -0
  162. package/dist/domain.operations/git/getGitRemoteUrl.d.ts +7 -0
  163. package/dist/domain.operations/git/getGitRemoteUrl.js +40 -0
  164. package/dist/domain.operations/git/getGitRemoteUrl.js.map +1 -0
  165. package/dist/domain.operations/hooks/getInvokeHooks.js +1 -1
  166. package/dist/domain.operations/hooks/getInvokeHooks.js.map +1 -1
  167. package/dist/domain.operations/reflect/createDraftDirectory.d.ts +11 -0
  168. package/dist/domain.operations/reflect/createDraftDirectory.js +46 -0
  169. package/dist/domain.operations/reflect/createDraftDirectory.js.map +1 -0
  170. package/dist/domain.operations/reflect/enumFeedbackFiles.d.ts +7 -0
  171. package/dist/domain.operations/reflect/enumFeedbackFiles.js +69 -0
  172. package/dist/domain.operations/reflect/enumFeedbackFiles.js.map +1 -0
  173. package/dist/domain.operations/reflect/extractJsonFromResultText.d.ts +7 -0
  174. package/dist/domain.operations/reflect/extractJsonFromResultText.js +19 -0
  175. package/dist/domain.operations/reflect/extractJsonFromResultText.js.map +1 -0
  176. package/dist/domain.operations/reflect/invokeClaudeCodeForReflect.d.ts +46 -0
  177. package/dist/domain.operations/reflect/invokeClaudeCodeForReflect.js +120 -0
  178. package/dist/domain.operations/reflect/invokeClaudeCodeForReflect.js.map +1 -0
  179. package/dist/domain.operations/reflect/metrics/computeMetricsExpected.d.ts +12 -0
  180. package/dist/domain.operations/reflect/metrics/computeMetricsExpected.js +28 -0
  181. package/dist/domain.operations/reflect/metrics/computeMetricsExpected.js.map +1 -0
  182. package/dist/domain.operations/reflect/metrics/computeMetricsRealized.d.ts +26 -0
  183. package/dist/domain.operations/reflect/metrics/computeMetricsRealized.js +66 -0
  184. package/dist/domain.operations/reflect/metrics/computeMetricsRealized.js.map +1 -0
  185. package/dist/domain.operations/reflect/metrics/writeLogArtifact.d.ts +17 -0
  186. package/dist/domain.operations/reflect/metrics/writeLogArtifact.js +93 -0
  187. package/dist/domain.operations/reflect/metrics/writeLogArtifact.js.map +1 -0
  188. package/dist/domain.operations/reflect/step1/compileCitationsMarkdown.d.ts +8 -0
  189. package/dist/domain.operations/reflect/step1/compileCitationsMarkdown.js +28 -0
  190. package/dist/domain.operations/reflect/step1/compileCitationsMarkdown.js.map +1 -0
  191. package/dist/domain.operations/reflect/step1/compileReflectStep1Prompt.d.ts +14 -0
  192. package/dist/domain.operations/reflect/step1/compileReflectStep1Prompt.js +93 -0
  193. package/dist/domain.operations/reflect/step1/compileReflectStep1Prompt.js.map +1 -0
  194. package/dist/domain.operations/reflect/step2/compileReflectStep2Prompt.d.ts +18 -0
  195. package/dist/domain.operations/reflect/step2/compileReflectStep2Prompt.js +208 -0
  196. package/dist/domain.operations/reflect/step2/compileReflectStep2Prompt.js.map +1 -0
  197. package/dist/domain.operations/reflect/step2/executeManifestOperations.d.ts +17 -0
  198. package/dist/domain.operations/reflect/step2/executeManifestOperations.js +189 -0
  199. package/dist/domain.operations/reflect/step2/executeManifestOperations.js.map +1 -0
  200. package/dist/domain.operations/reflect/step2/parseManifestOperations.d.ts +8 -0
  201. package/dist/domain.operations/reflect/step2/parseManifestOperations.js +73 -0
  202. package/dist/domain.operations/reflect/step2/parseManifestOperations.js.map +1 -0
  203. package/dist/domain.operations/reflect/validateSourceDirectory.d.ts +9 -0
  204. package/dist/domain.operations/reflect/validateSourceDirectory.js +63 -0
  205. package/dist/domain.operations/reflect/validateSourceDirectory.js.map +1 -0
  206. package/dist/domain.operations/reflect/validateTargetDirectory.d.ts +10 -0
  207. package/dist/domain.operations/reflect/validateTargetDirectory.js +59 -0
  208. package/dist/domain.operations/reflect/validateTargetDirectory.js.map +1 -0
  209. package/dist/domain.operations/review/compileReviewPrompt.d.ts +22 -0
  210. package/dist/domain.operations/review/compileReviewPrompt.js +95 -0
  211. package/dist/domain.operations/review/compileReviewPrompt.js.map +1 -0
  212. package/dist/domain.operations/review/enumFilesFromDiffs.d.ts +8 -0
  213. package/dist/domain.operations/review/enumFilesFromDiffs.js +74 -0
  214. package/dist/domain.operations/review/enumFilesFromDiffs.js.map +1 -0
  215. package/dist/domain.operations/review/enumFilesFromGlob.d.ts +8 -0
  216. package/dist/domain.operations/review/enumFilesFromGlob.js +31 -0
  217. package/dist/domain.operations/review/enumFilesFromGlob.js.map +1 -0
  218. package/dist/domain.operations/review/estimateTokenCount.d.ts +9 -0
  219. package/dist/domain.operations/review/estimateTokenCount.js +20 -0
  220. package/dist/domain.operations/review/estimateTokenCount.js.map +1 -0
  221. package/dist/domain.operations/review/formatReviewOutput.d.ts +14 -0
  222. package/dist/domain.operations/review/formatReviewOutput.js +42 -0
  223. package/dist/domain.operations/review/formatReviewOutput.js.map +1 -0
  224. package/dist/domain.operations/review/genTokenBreakdownMarkdown.d.ts +19 -0
  225. package/dist/domain.operations/review/genTokenBreakdownMarkdown.js +110 -0
  226. package/dist/domain.operations/review/genTokenBreakdownMarkdown.js.map +1 -0
  227. package/dist/domain.operations/review/genTokenBreakdownReport.d.ts +24 -0
  228. package/dist/domain.operations/review/genTokenBreakdownReport.js +64 -0
  229. package/dist/domain.operations/review/genTokenBreakdownReport.js.map +1 -0
  230. package/dist/domain.operations/review/invokeClaudeCode.d.ts +22 -0
  231. package/dist/domain.operations/review/invokeClaudeCode.js +92 -0
  232. package/dist/domain.operations/review/invokeClaudeCode.js.map +1 -0
  233. package/dist/domain.operations/review/writeInputArtifacts.d.ts +27 -0
  234. package/dist/domain.operations/review/writeInputArtifacts.js +50 -0
  235. package/dist/domain.operations/review/writeInputArtifacts.js.map +1 -0
  236. package/dist/domain.operations/review/writeOutputArtifacts.d.ts +12 -0
  237. package/dist/domain.operations/review/writeOutputArtifacts.js +46 -0
  238. package/dist/domain.operations/review/writeOutputArtifacts.js.map +1 -0
  239. package/dist/index.js.map +1 -1
  240. package/dist/roles/architect/getArchitectRole.d.ts +6 -0
  241. package/dist/roles/architect/getArchitectRole.js +31 -0
  242. package/dist/roles/architect/getArchitectRole.js.map +1 -0
  243. package/dist/roles/brain/getBrainRole.d.ts +6 -0
  244. package/dist/roles/brain/getBrainRole.js +28 -0
  245. package/dist/roles/brain/getBrainRole.js.map +1 -0
  246. package/dist/roles/brain/skills/act/skillAct.d.ts +5 -0
  247. package/dist/roles/brain/skills/act/skillAct.js +147 -0
  248. package/dist/roles/brain/skills/act/skillAct.js.map +1 -0
  249. package/dist/roles/brain/skills/act/skillAct.ts +186 -0
  250. package/dist/roles/brain/skills/act/stepAct.d.ts +27 -0
  251. package/dist/roles/brain/skills/act/stepAct.js +95 -0
  252. package/dist/roles/brain/skills/act/stepAct.js.map +1 -0
  253. package/dist/roles/brain/skills/act/stepAct.ts +123 -0
  254. package/dist/roles/getRoleRegistry.js +5 -3
  255. package/dist/roles/getRoleRegistry.js.map +1 -1
  256. package/dist/roles/getRoleRegistry.readme.js +6 -0
  257. package/dist/roles/getRoleRegistry.readme.js.map +1 -1
  258. package/dist/roles/reviewer/briefs/on.rules/rules101.[article].md +41 -0
  259. package/dist/roles/reviewer/briefs/on.rules/rules101.citations.[article].md +88 -0
  260. package/dist/roles/reviewer/briefs/on.rules/rules101.collocated.[article].md +97 -0
  261. package/dist/roles/reviewer/briefs/on.rules/rules101.content.[article].md +228 -0
  262. package/dist/roles/reviewer/briefs/on.rules/rules101.content.[demo].forbid.failhide.md +87 -0
  263. package/dist/roles/reviewer/briefs/on.rules/rules101.content.[demo].forbid.gerunds.md +85 -0
  264. package/dist/roles/reviewer/briefs/on.rules/rules101.content.[demo].require.failfast.md +73 -0
  265. package/dist/roles/reviewer/briefs/on.rules/rules101.structure.[article].md +70 -0
  266. package/dist/roles/reviewer/briefs/review.tactics.md +60 -0
  267. package/dist/roles/reviewer/getReviewerRole.d.ts +6 -0
  268. package/dist/roles/reviewer/getReviewerRole.js +80 -0
  269. package/dist/roles/reviewer/getReviewerRole.js.map +1 -0
  270. package/dist/roles/reviewer/skills/reflect/reflect.d.ts +30 -0
  271. package/dist/roles/reviewer/skills/reflect/reflect.js +305 -0
  272. package/dist/roles/reviewer/skills/reflect/reflect.js.map +1 -0
  273. package/dist/roles/reviewer/skills/reflect/reflect.sh +38 -0
  274. package/dist/roles/reviewer/skills/reflect/reflect.ts +356 -0
  275. package/dist/roles/reviewer/skills/review/review.d.ts +57 -0
  276. package/dist/roles/reviewer/skills/review/review.js +445 -0
  277. package/dist/roles/reviewer/skills/review/review.js.map +1 -0
  278. package/dist/roles/reviewer/skills/review/review.sh +21 -0
  279. package/dist/roles/reviewer/skills/review/review.ts +575 -0
  280. package/dist/roles/thinker/getThinkerBrief.d.ts +1 -1
  281. package/dist/roles/thinker/getThinkerRole.js +9 -9
  282. package/dist/roles/thinker/getThinkerRole.js.map +1 -1
  283. package/dist/roles/thinker/skills/brief.articulate/.demo/article.vision.v2025_08_19..i1.via_chatgpt.md +47 -0
  284. package/dist/roles/thinker/skills/brief.articulate/.demo/article.vision.v2025_08_19.i2.via_rhachet.md +60 -0
  285. package/dist/roles/thinker/skills/brief.articulate/.demo/diverge.v2025_08_17.i1.md +62 -0
  286. package/dist/roles/thinker/skills/brief.articulate/.demo/diverge.v2025_08_17.i1.with_feedback.md +89 -0
  287. package/dist/roles/thinker/skills/brief.articulate/.demo/diverge.v2025_08_17.i2.md +47 -0
  288. package/dist/roles/thinker/skills/brief.articulate/.demo/joke.v2025_08_15.i1.md +44 -0
  289. package/dist/roles/thinker/skills/brief.articulate/.demo/joke.v2025_08_15.i2.md +63 -0
  290. package/dist/roles/thinker/skills/brief.articulate/.demo/joke.v2025_08_15.i3.md +51 -0
  291. package/dist/roles/thinker/skills/brief.articulate/.demo/user-journey.v2025_08_17.i1.md +62 -0
  292. package/dist/roles/thinker/skills/brief.articulate/.demo/user-journey.v2025_08_17.i2.md +49 -0
  293. package/dist/roles/thinker/skills/brief.articulate/.readme.md +0 -0
  294. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.skill.js +1 -1
  295. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.skill.js.map +1 -1
  296. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.skill.ts +168 -0
  297. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.ts +157 -0
  298. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_08_28.i1.md +93 -0
  299. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_08_28.i2.md +84 -0
  300. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_09_28.i1.no_focus_context.md +8 -0
  301. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_09_28.i2.md +54 -0
  302. package/dist/roles/thinker/skills/brief.catalogize/.demo/persona.usecases.v2025_08_28.i1.md +62 -0
  303. package/dist/roles/thinker/skills/brief.catalogize/.demo/persona.usecases.v2025_08_28.i2.md +64 -0
  304. package/dist/roles/thinker/skills/brief.catalogize/.readme.md +5 -0
  305. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.skill.js +1 -1
  306. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.skill.js.map +1 -1
  307. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.skill.ts +173 -0
  308. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.ts +132 -0
  309. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.i4.md +3 -0
  310. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.i5.md +3 -0
  311. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.i6.md +3 -0
  312. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.md +3 -0
  313. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i1.md +52 -0
  314. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i2.md +51 -0
  315. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i3.md +47 -0
  316. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i4.md +62 -0
  317. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i5.md +47 -0
  318. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i6.md +53 -0
  319. package/dist/roles/thinker/skills/brief.demonstrate/.readme +3 -0
  320. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.skill.js +1 -1
  321. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.skill.js.map +1 -1
  322. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.skill.ts +190 -0
  323. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.ts +164 -0
  324. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i1.md +72 -0
  325. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i2.md +53 -0
  326. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i3.which_objectives.md +58 -0
  327. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i5.which_personas.md +64 -0
  328. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input2.cluster.v2025_08_17.i1.md +67 -0
  329. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input2.cluster.v2025_08_17.i2.md +49 -0
  330. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input2.cluster.v2025_08_17.i3.md +59 -0
  331. package/dist/roles/thinker/skills/khue.cluster/.readme.md +0 -0
  332. package/dist/roles/thinker/skills/khue.cluster/stepCluster.skill.js +1 -1
  333. package/dist/roles/thinker/skills/khue.cluster/stepCluster.skill.js.map +1 -1
  334. package/dist/roles/thinker/skills/khue.cluster/stepCluster.skill.ts +174 -0
  335. package/dist/roles/thinker/skills/khue.cluster/stepCluster.ts +150 -0
  336. package/dist/roles/thinker/skills/khue.decompose/.readme.md +9 -0
  337. package/dist/roles/thinker/skills/khue.diverge/.demo/joke.examples.v2025_08_17.i2.md +23 -0
  338. package/dist/roles/thinker/skills/khue.diverge/.demo/joke.examples.v2025_08_17.i3.md +23 -0
  339. package/dist/roles/thinker/skills/khue.diverge/.demo/joke.varieties.v2025_08_17.i1.md +23 -0
  340. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i1.md +9 -0
  341. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i2.md +9 -0
  342. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i3.md +23 -0
  343. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i4.folksy.md +9 -0
  344. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i5.folksy.md +23 -0
  345. package/dist/roles/thinker/skills/khue.diverge/.readme.md +0 -0
  346. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.skill.js +1 -1
  347. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.skill.js.map +1 -1
  348. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.skill.ts +149 -0
  349. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.ts +151 -0
  350. package/dist/roles/thinker/skills/khue.encompose/.readme.md +7 -0
  351. package/dist/roles/thinker/skills/khue.instantiate/.readme.md +14 -0
  352. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.skill.js +1 -1
  353. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.skill.js.map +1 -1
  354. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.skill.ts +190 -0
  355. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.ts +132 -0
  356. package/dist/roles/thinker/skills/khue.triage/.demo/laughs.v2025_08_18.i1.md +29 -0
  357. package/dist/roles/thinker/skills/khue.triage/.demo/user.journeys.v2025_08_17.i1.md +86 -0
  358. package/dist/roles/thinker/skills/khue.triage/.demo/user.journeys.v2025_08_17.i2.md +68 -0
  359. package/dist/roles/thinker/skills/khue.triage/.readme.md +0 -0
  360. package/dist/roles/thinker/skills/khue.triage/stepTriage.skill.js +1 -1
  361. package/dist/roles/thinker/skills/khue.triage/stepTriage.skill.js.map +1 -1
  362. package/dist/roles/thinker/skills/khue.triage/stepTriage.skill.ts +174 -0
  363. package/dist/roles/thinker/skills/khue.triage/stepTriage.ts +153 -0
  364. package/package.json +11 -8
  365. package/readme.md +55 -0
@@ -0,0 +1,97 @@
1
+ # rules collocated
2
+
3
+ ## .what
4
+
5
+ collocated documents are support materials that live alongside rule files, providing examples, references, and educational content.
6
+
7
+ ## collocation pattern
8
+
9
+ support documents follow the rule file name with a suffix:
10
+
11
+ ```
12
+ rule.$directive.$topic.[suffix].$qualifier.md
13
+ ```
14
+
15
+ - **[suffix]** = document type: `[demo]`, `[ref]`, `[lesson]`
16
+ - **$qualifier** = distinguishing name for multiple documents
17
+
18
+ ## suffix types
19
+
20
+ ### [demo] - examples and demonstrations
21
+
22
+ concrete examples showing the rule in action:
23
+
24
+ ```
25
+ rule.forbid.error_hiding.[demo].try_catch.md
26
+ rule.prefer.early_returns.[demo].guard_clauses.md
27
+ rule.require.tests.[demo].integration.md
28
+ ```
29
+
30
+ demos typically include:
31
+ - working code samples
32
+ - before/after comparisons
33
+ - annotated walkthroughs
34
+
35
+ ### [ref] - reference materials
36
+
37
+ supporting documentation and external references:
38
+
39
+ ```
40
+ rule.require.domain_objects.[ref].package.md
41
+ rule.prefer.dependency_injection.[ref].article.md
42
+ rule.forbid.barrel_exports.[ref].circular_deps.md
43
+ ```
44
+
45
+ refs typically include:
46
+ - links to external documentation
47
+ - package usage guides
48
+ - architectural diagrams
49
+
50
+ ### [lesson] - educational content
51
+
52
+ teaching materials that explain concepts in depth:
53
+
54
+ ```
55
+ rule.require.narrative_flow.[lesson].code_paragraphs.md
56
+ rule.prefer.transformers.[lesson].pipelines_vs_conditionals.md
57
+ rule.require.idempotency.[lesson].findsert_upsert.md
58
+ ```
59
+
60
+ lessons typically include:
61
+ - conceptual explanations
62
+ - mental models
63
+ - learning progressions
64
+
65
+ ## directory layout
66
+
67
+ collocated documents appear alongside their parent rule:
68
+
69
+ ```
70
+ practices/code.prod/evolvable.procedures/
71
+ ├── rule.forbid.positional_args.md
72
+ ├── rule.forbid.positional_args.[demo].shell.md
73
+ ├── rule.forbid.positional_args.[lesson].named_args.md
74
+ ├── rule.require.input_context_pattern.md
75
+ ├── rule.require.input_context_pattern.[ref].package.md
76
+ └── rule.require.dependency_injection.md
77
+ ```
78
+
79
+ ## .when to collocate
80
+
81
+ collocate when:
82
+ - a rule benefits from concrete examples
83
+ - external resources clarify the rule
84
+ - deeper explanation aids understanding
85
+ - multiple examples illustrate different aspects
86
+
87
+ keep separate when:
88
+ - the document applies to multiple rules
89
+ - the content is general reference (put in briefs/knowledge/)
90
+ - the document is too large to be a quick supplement
91
+
92
+ ## .note
93
+
94
+ - collocated documents inherit context from their parent rule
95
+ - multiple suffixed documents can exist for one rule
96
+ - qualifiers should be descriptive but concise
97
+ - load order: rule first, then demos, refs, lessons
@@ -0,0 +1,228 @@
1
+ # rules content
2
+
3
+ ## .what
4
+
5
+ rules follow a two-section structure that separates quick reference from detailed guidance.
6
+
7
+ ## two-section structure
8
+
9
+ every rule has two sections separated by a triple separator:
10
+
11
+ ```md
12
+ # tldr
13
+
14
+ [quick reference content]
15
+
16
+ ---
17
+ ---
18
+ ---
19
+
20
+ # deets
21
+
22
+ [detailed content]
23
+ ```
24
+
25
+ ## # tldr section
26
+
27
+ the tldr section provides at-a-glance understanding:
28
+
29
+ ### ## severity header
30
+
31
+ ```md
32
+ ## severity: blocker
33
+ ```
34
+
35
+ or
36
+
37
+ ```md
38
+ ## severity: nitpick
39
+ ```
40
+
41
+ the severity must match the directive:
42
+ - `forbid` / `require` → `blocker`
43
+ - `avoid` / `prefer` → `nitpick`
44
+
45
+ ### .what summary
46
+
47
+ immediately after severity, state what the rule is:
48
+
49
+ ```md
50
+ ## severity: blocker
51
+
52
+ never use positional arguments in procedure signatures
53
+
54
+ use named arguments via destructured input objects instead
55
+ ```
56
+
57
+ ### .why rationale
58
+
59
+ explain why this rule matters:
60
+
61
+ ```md
62
+ positional arguments are fragile - adding, removing, or reordering parameters breaks callers.
63
+ named arguments are self-documenting and order-independent.
64
+ ```
65
+
66
+ ## # deets section
67
+
68
+ the deets section provides expanded guidance:
69
+
70
+ ### ## .what (optional)
71
+
72
+ expanded explanation of what the rule covers.
73
+
74
+ ### ## .why (optional)
75
+
76
+ deeper rationale, including tradeoffs and edge cases.
77
+
78
+ ### ## severity (required)
79
+
80
+ repeat the severity and explain why this level was chosen, tying to hazard, time cost, and money cost.
81
+
82
+ for negative directives (`forbid`/`avoid`), explain the cost of violation:
83
+
84
+ ```md
85
+ ## severity: blocker
86
+
87
+ hidden errors reach production and cost hours to debug, damaging customer trust.
88
+ ```
89
+
90
+ for positive directives (`require`/`prefer`), explain the benefit of compliance:
91
+
92
+ ```md
93
+ ## severity: blocker
94
+
95
+ fail-fast surfaces errors immediately with rich context, cutting debug time from hours to minutes.
96
+ ```
97
+
98
+ ### ## .where (optional)
99
+
100
+ scope or location where this rule applies:
101
+
102
+ ```md
103
+ ## .where
104
+
105
+ - all exported procedures in domain.operations/
106
+ - all public API endpoints
107
+ - exempt: anonymous inline callbacks
108
+ ```
109
+
110
+ ### ## .when (optional)
111
+
112
+ conditions under which the rule applies:
113
+
114
+ ```md
115
+ ## .when
116
+
117
+ - applies when defining function signatures
118
+ - applies when refactoring existing code
119
+ - does not apply to third-party API callbacks
120
+ ```
121
+
122
+ ### ## .how (optional)
123
+
124
+ guidance on detecting violations and applying the rule:
125
+
126
+ ```md
127
+ ## .how
128
+
129
+ search for patterns like:
130
+ - `function foo(a, b, c)`
131
+ - `const bar = (x, y) =>`
132
+
133
+ refactor to:
134
+ - `const foo = ({ a, b, c }: Input) =>`
135
+ ```
136
+
137
+ ### ## .note (optional)
138
+
139
+ caveats, edge cases, or special considerations:
140
+
141
+ ```md
142
+ ## .note
143
+
144
+ legacy code may still use positional args.
145
+ prioritize new code; refactor legacy opportunistically.
146
+ ```
147
+
148
+ ### ## .examples (optional)
149
+
150
+ concrete positive and negative patterns:
151
+
152
+ ```md
153
+ ## .examples
154
+
155
+ ### positive
156
+
157
+ const setCustomerPhone = ({ customer, phone }: Input) => {
158
+ return { ...customer, phone };
159
+ };
160
+
161
+ ### negative
162
+
163
+ function setCustomerPhone(customer, phone) { // forbidden
164
+ return { ...customer, phone };
165
+ }
166
+ ```
167
+
168
+ ## complete template
169
+
170
+ ```md
171
+ # tldr
172
+
173
+ ## severity: blocker|nitpick
174
+
175
+ [.what summary - what the rule is]
176
+
177
+ [.why rationale - why it matters]
178
+
179
+ ---
180
+ ---
181
+ ---
182
+
183
+ # deets
184
+
185
+ ## .what
186
+
187
+ [expanded summary]
188
+
189
+ ## .why
190
+
191
+ [expanded rationale]
192
+
193
+ ## severity: blocker|nitpick
194
+
195
+ [for forbid/avoid: cost of violation | for require/prefer: benefit of compliance]
196
+
197
+ ## .where
198
+
199
+ [scope/location]
200
+
201
+ ## .when
202
+
203
+ [conditions]
204
+
205
+ ## .how
206
+
207
+ [detection and usage guidance]
208
+
209
+ ## .note
210
+
211
+ [caveats]
212
+
213
+ ## .examples
214
+
215
+ ### positive
216
+
217
+ [correct usage]
218
+
219
+ ### negative
220
+
221
+ [violation]
222
+
223
+ ## .citations
224
+
225
+ > [quote from origin feedback]
226
+
227
+ source: [github url]
228
+ ```
@@ -0,0 +1,87 @@
1
+ # tldr
2
+
3
+ ## severity: blocker
4
+
5
+ never hide errors via blanket try/catch blocks.
6
+
7
+ hidden errors lead to silent defects and hours of pointless debugging. if an error is thrown, it must be rethrown unless explicitly allowlisted and carefully handled.
8
+
9
+ ---
10
+ ---
11
+ ---
12
+
13
+ # deets
14
+
15
+ ## .what
16
+
17
+ forbid any scenario where real errors are silently swallowed or hidden, commonly via try/catch blocks that catch all errors without rethrowing unexpected ones.
18
+
19
+ ## .why
20
+
21
+ - hidden errors cause silent defects that are extremely hard to diagnose
22
+ - blanket catch blocks mask the root cause of failures
23
+ - debugging becomes exponentially harder when errors don't surface
24
+ - fail-fast is impossible when errors are swallowed
25
+
26
+ ## severity: blocker
27
+
28
+ swallowed exceptions cause silent defects that cost hours or days to diagnose and erode customer trust.
29
+
30
+ ## .when
31
+
32
+ the only acceptable try/catch pattern:
33
+ - the catch has an explicit allowlist of expected errors
34
+ - those specific errors are carefully handled
35
+ - all other errors are rethrown
36
+
37
+ ## .how
38
+
39
+ search for patterns:
40
+ - `try { ... } catch (e) { }` — empty catch blocks
41
+ - `try { ... } catch (e) { return null; }` — swallowing with fallback
42
+ - `try { ... } catch (e) { console.log(e); }` — logging without rethrowing
43
+
44
+ ## .examples
45
+
46
+ ### positive
47
+
48
+ ```ts
49
+ try {
50
+ await doSomething({ userUuid });
51
+ } catch (error) {
52
+ if (!(error instanceof Error)) throw error;
53
+
54
+ // only handle specific expected error
55
+ if (error.message.includes('NOT_FOUND')) {
56
+ return null; // expected case: resource doesn't exist
57
+ }
58
+
59
+ // rethrow all unexpected errors
60
+ throw error;
61
+ }
62
+ ```
63
+
64
+ ### negative
65
+
66
+ ```ts
67
+ // ⛔ blanket catch hides all errors
68
+ try {
69
+ await doSomething({ userUuid });
70
+ } catch (error) {
71
+ console.log('something went wrong');
72
+ return null;
73
+ }
74
+ ```
75
+
76
+ ```ts
77
+ // ⛔ empty catch block
78
+ try {
79
+ await riskyOperation();
80
+ } catch (e) {
81
+ // silently swallowed
82
+ }
83
+ ```
84
+
85
+ ## .note
86
+
87
+ this is a mega blocker. any detection of failhide patterns should immediately halt review until resolved.
@@ -0,0 +1,85 @@
1
+ # tldr
2
+
3
+ ## severity: blocker
4
+
5
+ never use gerunds like `existing` in variable names.
6
+
7
+ gerunds signal unclear domain thought. use explicit names like `userBefore`, `userFound`, or `orderCreated` that force clarity about the domain model.
8
+
9
+ ---
10
+ ---
11
+ ---
12
+
13
+ # deets
14
+
15
+ ## .what
16
+
17
+ forbid gerund forms (words ending in `-ing`) in variable names. they signal unclear domain thought.
18
+
19
+ ## .why
20
+
21
+ - gerunds indicate the domain model was not thought through
22
+ - vague names like `existing` hide temporal state: existing when? before or after?
23
+ - they are a lead indicator of domain model issues that compound downstream
24
+ - explicit names (`userBefore`, `userFound`) force clarity about the domain
25
+
26
+ ## severity: blocker
27
+
28
+ gerunds signal unclear domain thought. they are a lead indicator of domain model issues that compound into costly refactors.
29
+
30
+ ## .where
31
+
32
+ - applies to all variable names in business logic
33
+ - especially important in update/upsert flows where before/after state matters
34
+ - applies to domain object references and database query results
35
+
36
+ ## .how
37
+
38
+ search for patterns:
39
+ - `existing*` — replace with `foundBefore` or `*Before`
40
+ - `running*` — replace with `isActive` or `hasStarted`
41
+ - `pending*` — replace with `needsApproval` or explicit state
42
+
43
+ common replacements:
44
+ | gerund | replacement |
45
+ | ----------------- | --------------------------------- |
46
+ | `existingUser` | `userBefore`, `userFound` |
47
+ | `existingInvoice` | `invoiceBefore`, `invoiceFound` |
48
+ | `runningProcess` | `processActive`, `processStarted` |
49
+
50
+ ## .examples
51
+
52
+ ### positive
53
+
54
+ ```ts
55
+ // clear temporal state
56
+ const userBefore = await userDao.findByUuid({ uuid });
57
+ const userAfter = userBefore.clone({ phone: newPhone });
58
+
59
+ // clear capture point
60
+ const invoiceFound = await invoiceDao.findByRef({ ref });
61
+ if (!invoiceFound) return BadRequestError.throw('invoice not found');
62
+
63
+ // clear lifecycle state
64
+ const orderCreated = await orderDao.insert({ order });
65
+ ```
66
+
67
+ ### negative
68
+
69
+ ```ts
70
+ // ⛔ "existing" is vague
71
+ const existingUser = await userDao.findByUuid({ uuid });
72
+ // existing when? before what operation?
73
+
74
+ // ⛔ gerund hides state
75
+ const runningJobs = await jobDao.findActive();
76
+ // are these currently running or were they running?
77
+ ```
78
+
79
+ ## .note
80
+
81
+ prefer `[noun][state]` order per the `name:treestruct` tactic:
82
+ - `userFound` not `foundUser`
83
+ - `invoiceBefore` not `beforeInvoice`
84
+
85
+ this enables autocomplete groups by domain noun.
@@ -0,0 +1,73 @@
1
+ # tldr
2
+
3
+ ## severity: blocker
4
+
5
+ fail fast using early exits and HelpfulError subclasses to reject invalid state or input immediately.
6
+
7
+ early returns and throws collapse failure paths, eliminate nested branches, and make core logic shine. rich error context via `helpful-errors` makes bugs easier to debug.
8
+
9
+ ---
10
+ ---
11
+ ---
12
+
13
+ # deets
14
+
15
+ ## .what
16
+
17
+ enforce fail-fast logic in all procedures by using guard clauses with early returns or throws.
18
+
19
+ ## .why
20
+
21
+ - improves readability by collapsing failure paths early
22
+ - eliminates nested branches and lets core logic shine
23
+ - increases safety by clearly documenting and halting on invalid input
24
+ - makes bugs easier to debug with rich context using `helpful-errors`
25
+
26
+ ## severity: blocker
27
+
28
+ fail-fast surfaces errors immediately with rich context, cutting debug time from hours to minutes.
29
+
30
+ ## .where
31
+
32
+ - required in all stitched logic, business procedures, and service flows
33
+ - applies to guard checks, validations, and branching paths
34
+
35
+ ## .how
36
+
37
+ - use early returns or throws for all guard clauses
38
+ - never use `if (...) else` or deep nesting to control flow
39
+ - prefer `UnexpectedCodePathError.throw(...)` for internal invariant violations
40
+ - prefer `BadRequestError.throw(...)` for rejecting invalid input
41
+ - include context objects in all thrown errors to aid debugging
42
+
43
+ ## .examples
44
+
45
+ ### positive
46
+
47
+ ```ts
48
+ // reject if user does not exist
49
+ if (!user) return BadRequestError.throw('user not found', { userUuid });
50
+
51
+ // halt if state is invalid
52
+ if (!input.customer.phone)
53
+ UnexpectedCodePathError.throw('customer lacks phone, invalid state', { customer });
54
+
55
+ // continue with core logic after guards
56
+ const result = await processCustomer(input.customer);
57
+ ```
58
+
59
+ ### negative
60
+
61
+ ```ts
62
+ // ⛔ nested branches hide the core logic
63
+ if (user) {
64
+ if (input.customer.phone) {
65
+ const result = await processCustomer(input.customer);
66
+ return result;
67
+ } else {
68
+ throw new Error('no phone');
69
+ }
70
+ } else {
71
+ throw new Error('no user');
72
+ }
73
+ ```
@@ -0,0 +1,70 @@
1
+ # rules structure
2
+
3
+ ## .what
4
+
5
+ rules follow a strict file name convention and directory organization that encodes semantics into the file system.
6
+
7
+ ## file name convention
8
+
9
+ rule files follow the pattern:
10
+
11
+ ```
12
+ rule.$directive.$topic.md
13
+ ```
14
+
15
+ - **rule** = literal prefix identifying the file as a rule
16
+ - **$directive** = severity and action: `forbid`, `avoid`, `prefer`, `require`
17
+ - **$topic** = snake_case description of what the rule addresses
18
+
19
+ ### examples
20
+
21
+ ```
22
+ rule.forbid.positional_args.md
23
+ rule.avoid.gerunds.md
24
+ rule.prefer.early_returns.md
25
+ rule.require.tests.md
26
+ ```
27
+
28
+ ## directive taxonomy
29
+
30
+ directives indicate what action to take and at what severity:
31
+
32
+ | directive | action | severity | description |
33
+ |-----------|------------------|----------|-------------------------|
34
+ | `forbid` | must not do | blocker | violation blocks merge |
35
+ | `require` | must do | blocker | absence blocks merge |
36
+ | `avoid` | discouraged | nitpick | flag but don't block |
37
+ | `prefer` | encouraged | nitpick | suggest but don't block |
38
+
39
+ ### severity map
40
+
41
+ | severity | directives | review impact |
42
+ |-----------|--------------------|-----------------------------|
43
+ | blocker | forbid, require | must resolve before merge |
44
+ | nitpick | avoid, prefer | optional to resolve |
45
+
46
+ ## practices directory structure
47
+
48
+ rules are organized into practice directories by domain concern. the specific practice domains vary by project and role - there is no prescribed set.
49
+
50
+ typical patterns include:
51
+ - group by artifact type (e.g., code, docs, config)
52
+ - group by quality dimension (e.g., readability, reliability)
53
+ - group by lifecycle stage (e.g., design, test, deploy)
54
+
55
+ nested subdirectories further refine the domain:
56
+
57
+ ```
58
+ practices/
59
+ └── $domain/
60
+ └── $subdomain/
61
+ ├── rule.$directive.$topic.md
62
+ └── rule.$directive.$topic.[demo].$qualifier.md
63
+ ```
64
+
65
+ ## .note
66
+
67
+ the directory structure groups related rules, making it easier to:
68
+ - discover rules relevant to a domain
69
+ - maintain consistent naming within a practice
70
+ - navigate rules by concern rather than alphabetically
@@ -0,0 +1,60 @@
1
+ # review tactics
2
+
3
+ ## purpose
4
+
5
+ the reviewer role performs automated code review against declared rules, using claude-code as the underlying brain.
6
+
7
+ ## modes
8
+
9
+ ### soft mode
10
+
11
+ - includes only file paths in the prompt
12
+ - instructs brain to read files directly
13
+ - lower token usage
14
+ - best for: large codebases, exploratory reviews
15
+
16
+ ### hard mode
17
+
18
+ - includes full file contents in the prompt
19
+ - no additional file reads required
20
+ - higher token usage, faster execution
21
+ - best for: focused reviews, smaller scopes
22
+
23
+ ## mode selection criteria
24
+
25
+ use `--soft` when:
26
+ - scope is large (>50 files)
27
+ - context window would exceed 60%
28
+ - reviewing for general patterns
29
+
30
+ use `--hard` when:
31
+ - scope is small (<20 files)
32
+ - precision is critical
33
+ - reviewing specific changes
34
+
35
+ ## context window thresholds
36
+
37
+ - **60% warning**: emits warning but continues
38
+ - **75% failfast**: throws error with recommendation to reduce scope or use soft mode
39
+
40
+ ## scope combination
41
+
42
+ targets are the union of `--diffs` and `--paths`:
43
+ - `--diffs uptil-main`: files changed since main branch
44
+ - `--diffs uptil-staged`: only staged files
45
+ - `--paths`: explicit glob patterns
46
+
47
+ ## artifacts
48
+
49
+ all invocations log to `.log/bhrain/review/$timestamp/`:
50
+ - `input.args.json`: original arguments and computed metrics
51
+ - `input.prompt.md`: exact prompt sent to brain
52
+ - `output.response.json`: raw brain response
53
+ - `output.review.md`: formatted review output
54
+
55
+ ## output format
56
+
57
+ reviews follow the feedback template format:
58
+ - blockers appear first (severity: blocker)
59
+ - nitpicks appear second (severity: nitpick)
60
+ - each finding includes file path and line number when available
@@ -0,0 +1,6 @@
1
+ import { Role } from 'rhachet';
2
+ /**
3
+ * .what = reviewer role definition
4
+ * .why = enables code review against declared rules via brain invocation
5
+ */
6
+ export declare const ROLE_REVIEWER: Role;