riskrails 0.0.0-stage → 3.0.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 (336) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.claude-plugin/marketplace.json +21 -0
  3. package/.claude-plugin/plugin.json +21 -0
  4. package/.codex-plugin/plugin.json +37 -0
  5. package/LICENSE +21 -0
  6. package/README.md +302 -2
  7. package/agents/Explore.md.tmpl +21 -0
  8. package/agents/ai-discovery.md.tmpl +65 -0
  9. package/agents/ai-reviewer.md.tmpl +146 -0
  10. package/agents/architect.md.tmpl +22 -0
  11. package/agents/log-reader.md.tmpl +23 -0
  12. package/agents/superseded/reviewer.md +16 -0
  13. package/ai/agents/context.md +59 -0
  14. package/ai/agents/discovery.md +56 -0
  15. package/ai/agents/implementer.md +67 -0
  16. package/ai/agents/manager.md +5 -0
  17. package/ai/agents/planner.md +71 -0
  18. package/ai/agents/release.md +43 -0
  19. package/ai/agents/reviewer.md +106 -0
  20. package/ai/agents/risk.md +46 -0
  21. package/ai/agents/security.md +53 -0
  22. package/ai/agents/tester.md +30 -0
  23. package/ai/policies/context-management.md +85 -0
  24. package/ai/policies/database.md +42 -0
  25. package/ai/policies/git.md +35 -0
  26. package/ai/policies/model-routing.md +112 -0
  27. package/ai/policies/production.md +42 -0
  28. package/ai/policies/release.md +48 -0
  29. package/ai/policies/review-economy.md +214 -0
  30. package/ai/policies/tooling.md +105 -0
  31. package/ai/templates/architecture-decision.md +29 -0
  32. package/ai/templates/impact-report.md +35 -0
  33. package/ai/templates/implementation-plan.md +54 -0
  34. package/ai/templates/release-report.md +52 -0
  35. package/ai/templates/review-report.md +30 -0
  36. package/ai/templates/task-context.md +18 -0
  37. package/ai/using-riskrails.md +75 -0
  38. package/ai/workflows/bugfix.md +4 -0
  39. package/ai/workflows/feature.md +4 -0
  40. package/ai/workflows/hotfix.md +4 -0
  41. package/ai/workflows/investigation.md +4 -0
  42. package/ai/workflows/refactoring.md +4 -0
  43. package/ai/workflows.md +81 -0
  44. package/bin/claude-1m +38 -0
  45. package/bin/riskrails.js +1434 -0
  46. package/codex/hooks.json +126 -0
  47. package/hooks/AGENTS.md +6 -0
  48. package/hooks/CLAUDE.md +6 -0
  49. package/hooks/ai-git-guard-defaults.json +28 -0
  50. package/hooks/ai-guard.py +113 -0
  51. package/hooks/ai-path-guard-defaults.json +50 -0
  52. package/hooks/cap-large-read.py +113 -0
  53. package/hooks/codex-hooks.json +126 -0
  54. package/hooks/context-guard.py +828 -0
  55. package/hooks/dialog-gate.py +105 -0
  56. package/hooks/guard/__init__.py +1 -0
  57. package/hooks/guard/common.py +638 -0
  58. package/hooks/guard/decision.py +123 -0
  59. package/hooks/guard/dialog.py +598 -0
  60. package/hooks/guard/ere.py +592 -0
  61. package/hooks/guard/git.py +291 -0
  62. package/hooks/guard/paths.py +1433 -0
  63. package/hooks/guard/scope.py +387 -0
  64. package/hooks/hooks.json +157 -0
  65. package/hooks/lib/ai-hook-common.sh +285 -0
  66. package/hooks/memory-pre-push.py +28 -0
  67. package/hooks/project-scaffold.py +292 -0
  68. package/hooks/project-scaffold.sh +14 -0
  69. package/hooks/runtime-gate.py +1214 -0
  70. package/hooks/update_notice.py +135 -0
  71. package/instructions/routing.md +137 -0
  72. package/instructions/runtimes.json +48 -0
  73. package/instructions/stub.md +93 -0
  74. package/package.json +13 -4
  75. package/profiles/balanced-max.json +14 -0
  76. package/profiles/codex-balanced-max.json +97 -0
  77. package/profiles/codex-plus.json +96 -0
  78. package/profiles/codex-pro.json +96 -0
  79. package/profiles/max.json +79 -0
  80. package/profiles/max20.json +23 -0
  81. package/profiles/pro.json +76 -0
  82. package/scripts/ai-path +104 -0
  83. package/scripts/merge-codex-config.py +361 -0
  84. package/scripts/render-codex-agents.py +185 -0
  85. package/scripts/resolve-profile.py +140 -0
  86. package/settings.common.json +126 -0
  87. package/settings.gate.json +64 -0
  88. package/skills/AGENTS.md +6 -0
  89. package/skills/CLAUDE.md +6 -0
  90. package/skills/ai-audit/SKILL.md +9 -0
  91. package/skills/ai-audit/templates/ai-sdlc-adoption-plan.md +87 -0
  92. package/skills/ai-audit/templates/play-scoring-rubric.md +122 -0
  93. package/skills/ai-init/SKILL.md +9 -0
  94. package/skills/ai-init/scaffold-ai.sh +10 -0
  95. package/skills/ai-init/templates/.ai/AGENTS.md +67 -0
  96. package/skills/ai-init/templates/.ai/VERSION +1 -0
  97. package/skills/ai-init/templates/.ai/policies/coding.md +32 -0
  98. package/skills/ai-init/templates/.ai/policies/dialog.json +1 -0
  99. package/skills/ai-init/templates/.ai/policies/path-guard.json +5 -0
  100. package/skills/ai-init/templates/.ai/policies/risk-tiers.json +628 -0
  101. package/skills/ai-init/templates/.ai/policies/risk-tiers.md +180 -0
  102. package/skills/ai-init/templates/.ai/policies/safety.md +84 -0
  103. package/skills/ai-init/templates/.ai/policies/security.md +69 -0
  104. package/skills/ai-init/templates/.ai/policies/testing.md +118 -0
  105. package/skills/ai-init/templates/.ai/policies/weight.json +49 -0
  106. package/skills/ai-init/templates/.ai/policies/weight.md +32 -0
  107. package/skills/ai-init/templates/.ai/project/architecture.md +40 -0
  108. package/skills/ai-init/templates/.ai/project/business-rules.md +21 -0
  109. package/skills/ai-init/templates/.ai/project/dependencies.md +27 -0
  110. package/skills/ai-init/templates/.ai/project/glossary.md +8 -0
  111. package/skills/ai-init/templates/.ai/project/initial-assessment.md +8 -0
  112. package/skills/ai-init/templates/.ai/project/integrations.md +20 -0
  113. package/skills/ai-init/templates/.ai/project/known-risks.md +16 -0
  114. package/skills/ai-init/templates/.ai/project/legacy.md +28 -0
  115. package/skills/ai-init/templates/.ai/project/modules.md +18 -0
  116. package/skills/ai-init/templates/.ai/project/overview.md +27 -0
  117. package/skills/ai-init/templates/.ai/reports/.gitkeep +0 -0
  118. package/skills/ai-init/templates/.ai/rules/README.md +24 -0
  119. package/skills/ai-init/templates/.ai/state/README.md +67 -0
  120. package/skills/ai-init/templates/AGENTS.block.md +13 -0
  121. package/skills/ai-init/templates/AGENTS.minimal.md +23 -0
  122. package/skills/ai-init/templates/CLAUDE.block.md +13 -0
  123. package/skills/ai-init/templates/CLAUDE.minimal.md +23 -0
  124. package/skills/ai-init/templates/GEMINI.block.md +13 -0
  125. package/skills/ai-init/templates/GEMINI.minimal.md +23 -0
  126. package/skills/ai-init/templates/gitignore.snippet +5 -0
  127. package/skills/ai-init/templates/junie-guidelines.block.md +13 -0
  128. package/skills/ai-init/templates/junie-guidelines.minimal.md +23 -0
  129. package/skills/ai-status/SKILL.md +9 -0
  130. package/skills/ai-task/SKILL.md +9 -0
  131. package/skills/ai-task/memory_compact.py +968 -0
  132. package/skills/ai-task/memory_format.py +775 -0
  133. package/skills/ai-task/memory_store.py +528 -0
  134. package/skills/ai-task/memory_sync.py +1571 -0
  135. package/skills/ai-task/sensors.py +424 -0
  136. package/skills/ai-task/state.py +5207 -0
  137. package/skills/ai-task/weight.py +300 -0
  138. package/skills/project-init/SKILL.md +9 -0
  139. package/skills/project-init/templates/AGENTS.md +27 -0
  140. package/skills/project-init/templates/CLAUDE.md +27 -0
  141. package/skills/project-init/templates/GEMINI.md +27 -0
  142. package/skills/project-init/templates/adr.md +29 -0
  143. package/skills/project-init/templates/constitution.md +15 -0
  144. package/skills/project-init/templates/gitignore.snippet +4 -0
  145. package/skills/project-init/templates/intent.md +35 -0
  146. package/skills/project-init/templates/junie-guidelines.md +27 -0
  147. package/skills/project-init/templates/memory-README.md +21 -0
  148. package/skills/project-init/templates/plan.md +25 -0
  149. package/skills/project-init/templates/project-config.toml +18 -0
  150. package/skills/project-init/templates/project-settings.json +5 -0
  151. package/skills/project-init/templates/sdlc-README.md +24 -0
  152. package/skills/project-init/templates/spec.md +30 -0
  153. package/skills/project-update/SKILL.md +9 -0
  154. package/skills/project-update/adopt-map.json +91 -0
  155. package/skills/project-update/adopt.py +2211 -0
  156. package/skills/project-update/history/blobs/01c32f8ff038787e49070b8b0eb160eb4b4704a020b050678292051fc73a4fc6 +106 -0
  157. package/skills/project-update/history/blobs/06e9d52c1720fca412803e3b07c4b228ff113e303f4c7ab94665319d832bbfb7 +1 -0
  158. package/skills/project-update/history/blobs/099f3debfe1ce808502661de4a31c3a349f149f5fe7246691d41a4966179a63c +5 -0
  159. package/skills/project-update/history/blobs/0b0a7e354e1d1c86351700d5fb63d16426536875f5fecb759d15e326b7f30289 +180 -0
  160. package/skills/project-update/history/blobs/0bb70da941a7fc0ae2a0dbfcf06441a40f0653b3b9c573328ad9fb6d66f2e133 +27 -0
  161. package/skills/project-update/history/blobs/0cb92e5048badfab2cb78ff030c824f8cccaf45b83b8587bcb20ab795e8d36ae +89 -0
  162. package/skills/project-update/history/blobs/0e221e9337f050ffe0e834be12c1a5b46d82dec446b57ebcfbaa0ec8996bd54c +372 -0
  163. package/skills/project-update/history/blobs/0ec82daa4a17bcd5bf9d4df20ce90fd09312d3d439f7064baf7c8dd77a6c44fc +27 -0
  164. package/skills/project-update/history/blobs/0f00cbb216a20c7f67749ffb88835bcaaa29cc1a4c15d468edb3c6039bd291d3 +53 -0
  165. package/skills/project-update/history/blobs/0fab5540c131185e2ccdc10baad52783d7d4ff164843cae7f1b7f310c7d102ec +73 -0
  166. package/skills/project-update/history/blobs/10159baf262b43a92d95db59dae1f72c645127301661e0a3ce4e38b295a97c58 +1 -0
  167. package/skills/project-update/history/blobs/1121cfccd5913f0a63fec40a6ffd44ea64f9dc135c66634ba001d10bcf4302a2 +1 -0
  168. package/skills/project-update/history/blobs/12288b1b5573ee6e9e18eccdc6f5ae6cef9bee7576f79fde175ad1ac53dae134 +145 -0
  169. package/skills/project-update/history/blobs/164cd34c182de88c33de7df35beb29200d792419e1c13a5f0b2104f944e57be7 +1 -0
  170. package/skills/project-update/history/blobs/17f88e362fa19b7f2741ea1393164dc75b9c300b8727322f91fe205a985e088f +5 -0
  171. package/skills/project-update/history/blobs/17fa7392d1466e286d5aa83a19e364835c1977750ae1f186aec59e2046d688ea +106 -0
  172. package/skills/project-update/history/blobs/1987654b78c747f378109dbde1d51c4f31fd0eabc878ff16b3bcfaeaf99c8ff4 +28 -0
  173. package/skills/project-update/history/blobs/19b1a6390e96136619d23bc2ef9afed8f15e62107de7c1052bc5ea23e5bb5692 +64 -0
  174. package/skills/project-update/history/blobs/1a8995e5f7e51b5be74fca82551e5d9e4d970c546d9fd6eecb6809a7f6af8821 +69 -0
  175. package/skills/project-update/history/blobs/1ad77786ae3fed570aafe7612eac1d94ef1f52c3106fd64733951592dea759ff +62 -0
  176. package/skills/project-update/history/blobs/1b554eff73a270086f8cf8cba73f7d9ce162c6b6b9c288b822db36841b8a9228 +16 -0
  177. package/skills/project-update/history/blobs/1c2c3e5bbb132a152163ebeb678d57f0f7162a56ea92b84acc43cd2dedd4a935 +20 -0
  178. package/skills/project-update/history/blobs/1d1d907449ec74594d0ee923ac142ae746b9aedf0a1eda9469f075a44d23e3d7 +13 -0
  179. package/skills/project-update/history/blobs/1fdc406be22d9ea39f41e738c6bbd36a31ef4adc84ece06cfceebddaa86c9798 +75 -0
  180. package/skills/project-update/history/blobs/21319ce04158178b1d66ee8514e32c43bb1b4cd9cee11a456a9a863a5998c6ce +53 -0
  181. package/skills/project-update/history/blobs/23a42febbacaa7b52a802d428033a99c0694391c81d51fe3b6e1dff608a641d5 +67 -0
  182. package/skills/project-update/history/blobs/28a0455a7b17204171c49891c39043040c8608f4e6f04caf09de3fe8aea68553 +27 -0
  183. package/skills/project-update/history/blobs/30b6dcbdcfbb8e9223af11edacc387b1102868261bbe7051c2d85ad1a18384e5 +27 -0
  184. package/skills/project-update/history/blobs/31bb922076c8dadb4a84bb6a03d331dafc7157893aaf2f92b13792270fbece9b +56 -0
  185. package/skills/project-update/history/blobs/3775eed295a794dda73b14f88af70bc2c99b5590f81da53f165423e4337dceed +13 -0
  186. package/skills/project-update/history/blobs/3a492555cac3198136e239539466fb768cf672d5a972f5afd7d57c038d3cfed6 +104 -0
  187. package/skills/project-update/history/blobs/3dd55bf5f9d9471c68af3353166da11593a11e639f7557397ce46787291fa629 +32 -0
  188. package/skills/project-update/history/blobs/3f40640377c8501ecb50dc044fc7951a9b96caac5335e92e0d54d0c1764de8f2 +30 -0
  189. package/skills/project-update/history/blobs/40ac73f706ba7d2578627f420076cdb9fa6aa146e16d0da6c6a5c63f65c2b03c +66 -0
  190. package/skills/project-update/history/blobs/4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865 +1 -0
  191. package/skills/project-update/history/blobs/465bd61887bae3c68b751ea02af09d00f570086617ff8e1362acf6ed0868396b +39 -0
  192. package/skills/project-update/history/blobs/4d1f9073276936834747199393159f1badc0277b5bb394f78f408d52c36c4e35 +13 -0
  193. package/skills/project-update/history/blobs/4e67b352e2d7a29a83c4fa9f80a0d3ed9272da0f976a084c344b55e349f741b2 +75 -0
  194. package/skills/project-update/history/blobs/504ac6f9c5efb8ecb404bb62fbb08c819e8cff0c6b522efeeeb383cb30d2778e +18 -0
  195. package/skills/project-update/history/blobs/514c8c4bc97f23fe2739954bad34024922464f54b3a057f00ac54d631a4d875d +26 -0
  196. package/skills/project-update/history/blobs/53376d1fca268d8fdb59a5a0d0e0a4fe2d3bc2a7689a79c00a227f41bd5a2165 +27 -0
  197. package/skills/project-update/history/blobs/5353ca529c46f2443e12947ec205a6887fb594a4de1f87f0eb1c0e6c0f826133 +49 -0
  198. package/skills/project-update/history/blobs/53c234e5e8472b6ac51c1ae1cab3fe06fad053beb8ebfd8977b010655bfdd3c3 +1 -0
  199. package/skills/project-update/history/blobs/54eefe3d8cd6cd1ed56764e7bd412a4c919a28fc64b56b69dcafeecd7a921678 +67 -0
  200. package/skills/project-update/history/blobs/5551499579a0bceb74a79731d30213b1ddf9168b92f6d3dd0aecad91d8aff464 +23 -0
  201. package/skills/project-update/history/blobs/5c0619c1ee059477c9d92cf70b72da5d238d9176fc27ab0d38104ecba795624c +3 -0
  202. package/skills/project-update/history/blobs/5cbaaabe2c8d0e24582877aab05eeaaf4d53cb5e9515e81cd18368d13d2fe79e +40 -0
  203. package/skills/project-update/history/blobs/5ccacb666c22a8b6401563bf69ab0ed6bd1df7c93aeb46eacff7d2ff8653cd40 +27 -0
  204. package/skills/project-update/history/blobs/5e38d93c4f82300cc5d331f4ce3022d2872db15d108ae23bf33e2169a19b42f2 +15 -0
  205. package/skills/project-update/history/blobs/5f65bc7ab3fc3c4e75ae05d49eaf4331fafc398c661abe33c69f7380a720344c +32 -0
  206. package/skills/project-update/history/blobs/616a6da3c59073926c5ece428efa251fbe539d25a53bcf50be67522f44848368 +628 -0
  207. package/skills/project-update/history/blobs/61d0e67d59802a695f546e0a77e11a4daf1fafe77f50bead5f94bc7f08fb8457 +30 -0
  208. package/skills/project-update/history/blobs/62010250361ebe8644722d60397ce01e9b8abbfd497ede2c9f79b2ae4bce465d +374 -0
  209. package/skills/project-update/history/blobs/63c6dd07369cd71fad62a22f0ce352792cac0ed5c2998f8e7a4f4d0a64db7803 +102 -0
  210. package/skills/project-update/history/blobs/65acd4be95c695d0cc20cb5f4faffe0f44e0873b385c124140b223c41328cb56 +13 -0
  211. package/skills/project-update/history/blobs/664937c4293d82108a19302d4a55d15e3e1686091e5f3e40fd5510dca2d10af5 +27 -0
  212. package/skills/project-update/history/blobs/6a89cada6dc06bf5e0622a89fe7a8a6745e73c0e01505b7efe462f97d81c0956 +32 -0
  213. package/skills/project-update/history/blobs/6af1b12f814384e517e8f09131b0524930ac1c849350db765d8a77c7a59905b9 +8 -0
  214. package/skills/project-update/history/blobs/6b30b86994c130697aea047256ef20ef724f6fea42a4490dc220919e57453659 +354 -0
  215. package/skills/project-update/history/blobs/6c7b1b9b733f3ec7d8e038e62f484419c5e888cd094f64c1f1471b9cd9bb3fe8 +571 -0
  216. package/skills/project-update/history/blobs/6f098b31327fe52bfe1418b9f53af40e8734f027c7f1e21b02c1db1fabacdf15 +68 -0
  217. package/skills/project-update/history/blobs/70850fc7be7307455233177c1fd85e7f1d94c36430a0efc8e7f205b350505226 +31 -0
  218. package/skills/project-update/history/blobs/732b736e9877263621a0d616d8c466dd3a77eda5092db4e1def0dfb09c573e2a +51 -0
  219. package/skills/project-update/history/blobs/74549e7a525fdbce4a697fdabfab9b648730118b236123028820b5358002b404 +177 -0
  220. package/skills/project-update/history/blobs/7578025c0ce0a64dd37fe4c999541db5681199763df8b373ed0bfba11e2f581e +17 -0
  221. package/skills/project-update/history/blobs/77bd4e864d23176abc6bb8af8fba77775d88a0b135f5c985574d796a396d431d +76 -0
  222. package/skills/project-update/history/blobs/7be527cd648b27cca6e267de30f8e33a2ce17d5631a82694f23ae5c0623efe1f +15 -0
  223. package/skills/project-update/history/blobs/7cc03a94f8421069d92b6d89503beaa045d8162c303abfd996b2c019c9daad57 +27 -0
  224. package/skills/project-update/history/blobs/7de1555df0c2700329e815b93b32c571c3ea54dc967b89e81ab73b9972b72d1d +1 -0
  225. package/skills/project-update/history/blobs/7ee99edafe7cec45ff577376c0d0178fdb2690134d4656488f46e129aba3cc5a +67 -0
  226. package/skills/project-update/history/blobs/7eee4ea9f6e778ff691c263621e717c021505b86386034cc64f8ebbfc9d8fe65 +13 -0
  227. package/skills/project-update/history/blobs/7f3859c34035fe32abf937eebdd7240ac72ab32d254286cff7d939cf0cf6eaef +48 -0
  228. package/skills/project-update/history/blobs/80cf708a42ad6d7851f4063e0d9127b850f274dcb6633c9a9773d01173d437f8 +628 -0
  229. package/skills/project-update/history/blobs/815d78ce95d18454cf0842335f81755bf3aceb87ee9d2197e121d3ff734cd2b5 +13 -0
  230. package/skills/project-update/history/blobs/84c3815fd46498443568285c8d839257ecb91b6f0639690cbdc38ba382fc349d +569 -0
  231. package/skills/project-update/history/blobs/89e7198e1dd42778a6a9af6c7381216aecf561a366426bd914bc57f099ddd390 +10 -0
  232. package/skills/project-update/history/blobs/8a839b7c0f1ec1cc6217d5275b0cd13860a888eb23eef1a0792a4e78f2bd9faf +35 -0
  233. package/skills/project-update/history/blobs/8ad13d2ca4504cfd8e4ab7fe3a49129b228d9979461f0f758a71daeec78b6ae1 +118 -0
  234. package/skills/project-update/history/blobs/8b3ef9586491a426767c01da5d01bdd6b0655c576c68c4cc6dfb093367817dc0 +67 -0
  235. package/skills/project-update/history/blobs/8c97cfd63ee3dfba7aa61d9104e87fdbb086d3bf46cf648d349636912836c6d9 +18 -0
  236. package/skills/project-update/history/blobs/8fc1a5443a2b52a7a5945e2b972579202bd5e3f8c881a22cc1c97b52b7b2da6b +4 -0
  237. package/skills/project-update/history/blobs/917df3320d778ddbaa5c5c7742bc4046bf803c36ed2b050f30844ed206783469 +1 -0
  238. package/skills/project-update/history/blobs/9272fe1cc7ffa1805756c8b80bd14e8de69d03899b94fb0f49db6aa0bcb53b90 +33 -0
  239. package/skills/project-update/history/blobs/930ccfac4ba1306341e32279278410b451246a52223c42e0597b5ee83706ff00 +48 -0
  240. package/skills/project-update/history/blobs/933629cd5c872a11837046b13051a9b02bbc1033e3ba74f41966af2ed4edee5d +23 -0
  241. package/skills/project-update/history/blobs/935af1019931058ec3a0b834fe230e127ec914f75edcc4a6c589cfe733b0b979 +13 -0
  242. package/skills/project-update/history/blobs/962fd396da83337c3fadcc642d45e98429b18e79bb81f58915baaf2b9bffd3c5 +27 -0
  243. package/skills/project-update/history/blobs/965a03be82000866cb5275acda18ebb2172c9a50f0011df2fa475f74a1124c35 +3 -0
  244. package/skills/project-update/history/blobs/990a23740f15f50ec90f37bcabd1b1a8eedf102922a949343fdaf41a9fee07fe +27 -0
  245. package/skills/project-update/history/blobs/a00db51859bb7943174017a34b4a100f98e53d6c3b32f73d8f87d6072016a709 +5 -0
  246. package/skills/project-update/history/blobs/a1167f89faf809477a967aeefe514f443be57502f0afc832039a28ac5575216a +64 -0
  247. package/skills/project-update/history/blobs/a13cb0db5372c3ce3e71470165c17a2db76e7a2415717ba27fccd1b0593c61c4 +66 -0
  248. package/skills/project-update/history/blobs/a1558cb6add0a4d6264757c29ef7172c74626fe0034973983a3a39459cf9a1cb +106 -0
  249. package/skills/project-update/history/blobs/a1ed0b4f3b73b1a29adfdf0d4d495553ba48707aa5a676496ebc28f993a57dcb +24 -0
  250. package/skills/project-update/history/blobs/a349aaad234825ea429df33cafb7928579c0cb5b1801f0a237e103aa8d159642 +29 -0
  251. package/skills/project-update/history/blobs/a5ef05d1ec2323ffd61ae60f98f3dacd212cae507b798d7421c3a9f418806506 +49 -0
  252. package/skills/project-update/history/blobs/a883fab03be6557be0a4205f6e025ee5571098b0931f3bb60f28a9028bb87353 +25 -0
  253. package/skills/project-update/history/blobs/a8cf15b33301a76e1d899064d5cb95914cc49412ab223f00394b702c4a4508f1 +24 -0
  254. package/skills/project-update/history/blobs/aa67a169b0bba217aa0aa88a65346920c84c42447c36ba5f7ea65f422c1fe5d8 +1 -0
  255. package/skills/project-update/history/blobs/ab0ce5062b41aaff12b0525d56b42de6b9dee9ce9e1de2938f72675435013c6a +18 -0
  256. package/skills/project-update/history/blobs/ab13c708e91c1de2adbc9ccdb1caec5c320197708bcaaa6d5cfd30c18a7dac34 +21 -0
  257. package/skills/project-update/history/blobs/ad4c4f81855725f7fe6e0e3d8f557df0de5fc063465d428546f69c54020c69d9 +64 -0
  258. package/skills/project-update/history/blobs/ae49c96abe45e56e88ae5e28e046212f7114d6413785cbe998f692d2914792be +24 -0
  259. package/skills/project-update/history/blobs/ae5ce131d6bae401199ff32d8c3dc4d8aec188010a9111624ac64506e2116ff4 +84 -0
  260. package/skills/project-update/history/blobs/ae9a22907ba9acbb7e80fac1ba4e3d1ff09e5f1df5c4456afb9099d7090fcaa6 +64 -0
  261. package/skills/project-update/history/blobs/b486fe10685d437b73c8fa2a3141621e29c36d70ec88b2a36e4573133504507b +30 -0
  262. package/skills/project-update/history/blobs/b7b697fc987617449ba10634f12f70326281cc182f8b7f20f9e047a75f3f182b +17 -0
  263. package/skills/project-update/history/blobs/b80e6b2b93a4b8a5a0f8eabc2a745247ad53df3235bb84c63fdd3f10ccc1ae99 +21 -0
  264. package/skills/project-update/history/blobs/b81eabd9248527e9abe1b6df7cf75ac772236b049008190d2a235e2eb22a931f +23 -0
  265. package/skills/project-update/history/blobs/b9da99bf05f0f08663469288f694f153fb6f2d806cdedf2cdb10cee3d3722295 +18 -0
  266. package/skills/project-update/history/blobs/ba9bb685dc2bb6de0ed5a8d601ef7ecedb517bb737565f75f6d4fff4ab4cd79c +24 -0
  267. package/skills/project-update/history/blobs/be29b8681b3de26b0120209971aaf0fab05c77baf8a4d65198929ef611f4fc55 +23 -0
  268. package/skills/project-update/history/blobs/be8c1556e8b0de1ce0f0fb0ca39f9f3b56ced57116b65a2812421c77cfff7585 +103 -0
  269. package/skills/project-update/history/blobs/c076d603cffc731823d2acf096bcc17cca1d99eee24b0aa313776d7d01571b4f +13 -0
  270. package/skills/project-update/history/blobs/c735911eb1a744f78213a9f7577b425c1605843f6d05fed798d7f41b47fa1e0c +13 -0
  271. package/skills/project-update/history/blobs/c9152d6dc2a5ddaadd870611675a24f89b442e2831a9207a14f2d438788553b0 +27 -0
  272. package/skills/project-update/history/blobs/c9ddacab2a6943af94c927799ba314877c1f19d40949e927c2d3825689005288 +13 -0
  273. package/skills/project-update/history/blobs/ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356 +1 -0
  274. package/skills/project-update/history/blobs/ca4499d829268c8766fb3b825a515e88dc55c237e9d202816b50959b4dac031f +13 -0
  275. package/skills/project-update/history/blobs/cb2178079b6eda906eee8f3510b72d5c03ae5fe2195f5ee3c859756dd42f9b32 +84 -0
  276. package/skills/project-update/history/blobs/cb8b8328efd818835822dc60537e3ecdb648d4ca04e21a7c47c88bf1198a5474 +63 -0
  277. package/skills/project-update/history/blobs/cc808d5b940109f1703abfb3ca0334a3fcfd34267feefb2323627d0decc8b89a +52 -0
  278. package/skills/project-update/history/blobs/cdc2432f3581ad9dbf5bc215de1e0cb0b49a44e1303b4222a4df4c72d0e96cc3 +27 -0
  279. package/skills/project-update/history/blobs/d7b96902bf9d2078df1e09901327b02f565b174777af34a2b24be660cad81d01 +33 -0
  280. package/skills/project-update/history/blobs/d8011741c086a124cf69b2988e0452ee2eb4ccccc6a6696b02069ddf7db35bd1 +330 -0
  281. package/skills/project-update/history/blobs/d9abea96dbe584fd77c27d5ed0523eb20d048f2d146e4909d16b2a7948db38c5 +8 -0
  282. package/skills/project-update/history/blobs/da848b831443484c831fa630666c004e07c1c9669dd247e8e4066979c8599080 +13 -0
  283. package/skills/project-update/history/blobs/da90fc7cceda6ced501d32924126593b9bf90c59fc067abab9abbc68d43be8b2 +97 -0
  284. package/skills/project-update/history/blobs/dd174b27e5b3a2414d0605484f4e92423e2553931263f05ef15677b4aa389bab +72 -0
  285. package/skills/project-update/history/blobs/ddc088b8a289151c50bf073797c245c254939217970e6d58b75c3d7193b12466 +27 -0
  286. package/skills/project-update/history/blobs/de0685f9bc2ac22c1b0178d6a1fc8d07fa23451f29d0c36571cbf85c69716fc2 +13 -0
  287. package/skills/project-update/history/blobs/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 +0 -0
  288. package/skills/project-update/history/blobs/e584f106c4e65b1bdce69b78d05713347717bdc2228998982313e3eb15b52943 +76 -0
  289. package/skills/project-update/history/blobs/e639e99d3f59015dc21472de081ca7766231135399ac3a6f439e841e458251f4 +32 -0
  290. package/skills/project-update/history/blobs/e66a657a3977884b69435b51f77782e48f37f57c865b6c9ba294e8796b37c378 +101 -0
  291. package/skills/project-update/history/blobs/e7c01b6590c4e308cd2681beaa3b2242cd1e10a5ba851d9f756f4d49d301d144 +22 -0
  292. package/skills/project-update/history/blobs/e7cc8b00983d6022206aa576187a2d4dccc656aaea41b26dc32123b4b064e965 +349 -0
  293. package/skills/project-update/history/blobs/e8df28f07cb784d768bcafbced70fd15771afa61dbec7dc4c1c3f858f9002fec +13 -0
  294. package/skills/project-update/history/blobs/e9adb7a9905eb719ac78ab96671f055da53e5001810f5ad6d6c94306b0323fe7 +74 -0
  295. package/skills/project-update/history/blobs/ebbc147c88c417b18ddc4d0530d87e4aa26b0659e085339f45015cf0be2b61a5 +579 -0
  296. package/skills/project-update/history/blobs/ee7c8321fff228d967c5d200c316967195d93a26196383f57f474e837b1b3d33 +13 -0
  297. package/skills/project-update/history/blobs/f00317bd27dc8184222e4b8ffe97f27e72d442d36a2bd67552f57f802590dd79 +25 -0
  298. package/skills/project-update/history/blobs/f0b5c2c2211c8d67ed15e75e656c7862d086e9245420892a7de62cd9ec582a06 +1 -0
  299. package/skills/project-update/history/blobs/f12f2ac77324b23aa9ef2c5096a2c08788570b32b0c0322671b0889e7a80d8bd +18 -0
  300. package/skills/project-update/history/blobs/f5594606990239af05aa73ba00efc8292c3ecfe0be408c9acd343abcbc9d2155 +156 -0
  301. package/skills/project-update/history/blobs/fae3064e648cdc55be4aeb1177525b302a5e34ebd752e4a904f47dc0f4557b96 +71 -0
  302. package/skills/project-update/history/blobs/fce1ab62e4626119169fb2324a06526805227076359c844690f6374ae28e6804 +51 -0
  303. package/skills/project-update/history/blobs/fe513647c66e8883b326ea884a7e9cb045ce54c49b03d2e75a0b73c4756c423e +67 -0
  304. package/skills/project-update/history/blobs/fff19a00920c2d001d1614d0d7375c89e1e8c062d6de1f01501c24773acef973 +148 -0
  305. package/skills/project-update/history/index.json +429 -0
  306. package/skills/project-update/migrations/0001_schema_version.py +13 -0
  307. package/skills/project-update/migrations/0002_task_journal.py +123 -0
  308. package/skills/project-update/migrations/0003_context_diet.py +65 -0
  309. package/skills/project-update/migrations/0004_deterministic_gates.py +57 -0
  310. package/skills/project-update/migrations/0005_runtimes_and_plans.py +35 -0
  311. package/skills/project-update/migrations/0006_shared_files.py +154 -0
  312. package/skills/project-update/migrations/0007_weight_model.py +188 -0
  313. package/skills/project-update/migrations/0008_renames.py +43 -0
  314. package/skills/project-update/migrations/0009_state_file.py +25 -0
  315. package/skills/project-update/migrations/0010_dialog_switch.py +30 -0
  316. package/skills/project-update/migrations/README.md +61 -0
  317. package/skills/project-update/migrations/__init__.py +181 -0
  318. package/skills/project-update/render_instructions.py +615 -0
  319. package/skills/project-update/update.py +1685 -0
  320. package/skills/rr-build/SKILL.md +194 -0
  321. package/skills/rr-build-all/SKILL.md +190 -0
  322. package/skills/rr-plan/SKILL.md +110 -0
  323. package/skills/rr-review/SKILL.md +109 -0
  324. package/skills/rr-setup/SKILL.md +244 -0
  325. package/skills/rr-setup/scaffold_ai.py +303 -0
  326. package/skills/rr-setup/setup.py +541 -0
  327. package/skills/rr-ship/SKILL.md +118 -0
  328. package/skills/rr-spec/SKILL.md +108 -0
  329. package/skills/rr-status/SKILL.md +73 -0
  330. package/skills/rr-status/status.py +171 -0
  331. package/skills/sdlc-intent/SKILL.md +9 -0
  332. package/skills/sdlc-plan/SKILL.md +9 -0
  333. package/skills/sdlc-spec/SKILL.md +9 -0
  334. package/skills/usage-report/SKILL.md +10 -0
  335. package/skills/usage-report/prices.json +41 -0
  336. package/skills/usage-report/usage-report.py +926 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "riskrails",
3
+ "interface": {
4
+ "displayName": "RiskRails"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "riskrails",
9
+ "source": {
10
+ "source": "local",
11
+ "path": "./"
12
+ },
13
+ "policy": {
14
+ "installation": "AVAILABLE",
15
+ "authentication": "ON_INSTALL"
16
+ },
17
+ "category": "productivity"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "riskrails",
3
+ "owner": {
4
+ "name": "Ivan Kakurov"
5
+ },
6
+ "metadata": {
7
+ "description": "A weight-based engineering pipeline for Claude Code and Codex: each change is weighed on six axes, runs light, guarded or full, edits only the files its plan names, and ends at human approval — enforced by hooks, reviewed adversarially, routed to the cheap model tier by default.",
8
+ "version": "3.0.1"
9
+ },
10
+ "plugins": [
11
+ {
12
+ "name": "riskrails",
13
+ "source": {
14
+ "source": "url",
15
+ "url": "https://github.com/vanssata/claude-agentic-sdlc-module.git"
16
+ },
17
+ "version": "3.0.1",
18
+ "strict": true
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "riskrails",
3
+ "version": "3.0.1",
4
+ "description": "A weight-based engineering pipeline for Claude Code and Codex: each change is weighed on six axes, runs light, guarded or full, edits only the files its plan names, and ends at human approval — enforced by hooks, reviewed adversarially, routed to the cheap model tier by default.",
5
+ "author": {
6
+ "name": "Ivan Kakurov"
7
+ },
8
+ "homepage": "https://github.com/vanssata/claude-agentic-sdlc-module#readme",
9
+ "repository": "https://github.com/vanssata/claude-agentic-sdlc-module",
10
+ "license": "MIT",
11
+ "keywords": [
12
+ "sdlc",
13
+ "agents",
14
+ "code-review",
15
+ "guardrails",
16
+ "model-routing",
17
+ "hooks"
18
+ ],
19
+ "skills": "./skills/",
20
+ "hooks": "./hooks/hooks.json"
21
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "riskrails",
3
+ "version": "3.0.1",
4
+ "description": "A weight-based engineering pipeline for Claude Code and Codex: each change is weighed on six axes, runs light, guarded or full, edits only the files its plan names, and ends at human approval — enforced by hooks, reviewed adversarially, routed to the cheap model tier by default.",
5
+ "author": {
6
+ "name": "Ivan Kakurov"
7
+ },
8
+ "homepage": "https://github.com/vanssata/claude-agentic-sdlc-module#readme",
9
+ "repository": "https://github.com/vanssata/claude-agentic-sdlc-module",
10
+ "license": "MIT",
11
+ "keywords": [
12
+ "sdlc",
13
+ "agents",
14
+ "code-review",
15
+ "guardrails",
16
+ "model-routing",
17
+ "hooks"
18
+ ],
19
+ "skills": "./skills/",
20
+ "hooks": "./hooks/codex-hooks.json",
21
+ "interface": {
22
+ "displayName": "RiskRails",
23
+ "shortDescription": "Weight-based engineering pipeline with enforced scope and cost-aware model routing.",
24
+ "longDescription": "Installs one dual-runtime module: an .ai/ engineering pipeline shared by Codex and Claude Code, agents rendered for whichever runtime you use, and three hooks that enforce the rules mechanically rather than by asking politely. Every change runs discovery → context → impact → risk tier → plan → implementation → test → adversarial review → security review → release report → human approval, with the stages scaled to the tier and none of them skipped. Each implementation step names the files it may touch and anything else is refused, including inside a multi-file apply_patch. Routine workload stays on the cheap tier; the expensive tiers are spent only on a named trigger, and a bundled zero-cost usage report shows where the tokens actually went. No agent merges or deploys; commit, push and approval run only as the command the human picked in the dialog, or the human runs them outside the agent.",
25
+ "developerName": "Ivan Kakurov",
26
+ "category": "Developer Tools",
27
+ "capabilities": [
28
+ "Run a change through a risk-tiered pipeline with the gates its tier requires",
29
+ "Refuse edits outside the current approved step, file by file",
30
+ "Block force pushes, history rewrites, protected-branch pushes and secret staging",
31
+ "Survey an existing production codebase into a reusable .ai/ knowledge base",
32
+ "Audit a repository against the twelve plays of the AI-native SDLC",
33
+ "Report token usage and cost from local transcripts at zero model cost"
34
+ ],
35
+ "defaultPrompt": "Set up RiskRails in this repository with /rr-setup, then run my next change through /rr-build."
36
+ }
37
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ikakarov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,303 @@
1
- # Temporary Holding Version
1
+ # RiskRails
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![Version](https://img.shields.io/badge/version-3.0.1-d2f878?labelColor=101210)](https://github.com/vanssata/claude-agentic-sdlc-module/releases/tag/v3.0.1)
4
+ [![Runtimes](https://img.shields.io/badge/runtimes-Claude%20Code%20%7C%20Codex-d2f878?labelColor=101210)](docs/routing.md)
5
+ [![Known risks](https://img.shields.io/badge/known%20risks-documented-d2f878?labelColor=101210)](docs/known-risks.md)
6
+ [![License: MIT](https://img.shields.io/badge/license-MIT-d2f878?labelColor=101210)](LICENSE)
7
+
8
+ **Let an AI agent work on your legacy production code without the agent
9
+ widening its own scope, reading a production secret, force-pushing or
10
+ deploying.**
11
+
12
+ **RiskRails** (`riskrails`) is a plugin for **Claude Code and Codex**, built for
13
+ codebases with undocumented business rules, old workarounds and behaviour
14
+ customers rely on today. Each change is **weighed** on six axes and runs in one
15
+ of three modes — light, guarded, full — so a typo fix stays a one-line edit and
16
+ a payment change gets a written plan, an adversarial review and a human's
17
+ approval. Risky actions are stopped by a hook, not by a polite request in a
18
+ prompt.
19
+
20
+ ```bash
21
+ npx riskrails@3.0.1 # detects Claude Code, Codex or both (Node 18+, python3)
22
+ ```
23
+
24
+ Then, in any project: `/rr-setup` once, and `/rr-build <what you want>` for
25
+ every change.
26
+
27
+ **What you get**
28
+
29
+ - **Guards, not guidelines.** One hook on every tool call refuses an edit
30
+ outside the task's files, a read of a production secret, a force push, a
31
+ push to a protected branch, a deploy command, `npm publish`. No agent merges
32
+ or deploys; a commit, a push or an approval runs only as the command you
33
+ picked in the runtime's own dialog, verbatim, once — or you run it yourself.
34
+ - **Weight, not ceremony.** Scope, reversibility and coverage are measured
35
+ from the tree; behaviour, domain and novelty are declared with evidence. The
36
+ sum picks the mode, the mode picks who plans, who reviews and whether you
37
+ sign off. The mode only rises during a task; lowering it is yours.
38
+ - **Deterministic gates.** `state.py` measures and refuses; no model decides
39
+ whether a step stayed in scope, whether the suite is green on this tree, or
40
+ whether a budget is spent. Every decision is in a journal a human can read.
41
+ - **Cheap by default.** Readers on the cheapest model, the session on the one
42
+ that thinks, the top tier only on a named trigger, one short always-loaded
43
+ file per runtime. `/rr-status --cost` shows where the tokens went, at zero
44
+ model cost.
45
+ - **One `.ai/` tree for both runtimes.** Start a task in Claude Code and finish
46
+ it in Codex; the knowledge base, the policies, the task state and the compact
47
+ record of every closed task are shared.
48
+
49
+ Tuned for **one developer who knows the codebase**, on a Claude Pro, Max or
50
+ Team plan, or a ChatGPT Plus or Pro plan, following the
51
+ [AI-native SDLC playbook](https://claude.com/blog/the-ai-native-sdlc-playbook).
52
+
53
+ **Version 3.0.1.** The guards have limits: read [Known risks](docs/known-risks.md)
54
+ before relying on them. What is decided but not built is in [ROADMAP.md](ROADMAP.md).
55
+
56
+ ## Upgrade to 3.0
57
+
58
+ 3.0 renames the plugin from `claude-agentic` to `riskrails`, replaces the risk
59
+ tiers with the weight and the three modes, replaces the `/ai-*` and `/sdlc-*`
60
+ commands with `/rr-*`, ports the guards to one Python process, and moves the
61
+ task state to `.ai/state/state.json`. The old names stay as aliases for this
62
+ version. Step by step, in this order:
63
+
64
+ 1. **Commit every project's `.ai/`** before anything else; the update tells you
65
+ when the tree is dirty, and `git restore` is the rollback.
66
+ 2. **Close or abandon tasks in flight.** A task started by 2.x is refused by
67
+ the new commands as `old surface`; finish it with the version that started
68
+ it, or drop it with `python3 ~/.claude/skills/ai-task/state.py close
69
+ --abandon`. Check with `/rr-status`.
70
+ 3. **Update the home** on every machine, for every runtime:
71
+
72
+ ```bash
73
+ npx riskrails@3.0.1 # or: npx -y riskrails@latest --yes
74
+ ```
75
+
76
+ It moves `<home>/claude-agentic/` to `<home>/riskrails/` and leaves a
77
+ symlink at the old path for one version, replaces the old hook entries with
78
+ `ai-guard.py` and `runtime-gate.py`, retires the old agents and shim files
79
+ to `backups/<date>/`, and rewrites the managed block. Restart the runtime.
80
+ In Codex, open `/hooks` and **trust the changed entries** — until you do,
81
+ nothing is enforced. `--dry-run` shows all of it first.
82
+ 4. **Update each project:**
83
+
84
+ ```
85
+ /rr-setup --update # dry run first; read it; then --apply
86
+ ```
87
+
88
+ Four migrations run inside the dry run, in order, before the merge:
89
+ `0007` creates `.ai/policies/weight.json`, carrying over the project's
90
+ edits to its risk-tier table; `0008` renames the managed-block markers and
91
+ the router's routes; `0009` moves `current.json` to `state.json`; `0010`
92
+ creates `.ai/policies/dialog.json` with the dialog on. Edited markdown is
93
+ three-way merged, JSON policies key by key with a confirmation per key;
94
+ `delete?` proposals are left for you to confirm. The schema becomes 10.
95
+ 5. **Decide two things the migrations cannot.** Keep the dialog (then amend
96
+ constitution C5 as `0010` hints) or set `"enabled": false`; and tune the
97
+ weight table — `domain.modules`, `customer_visible`, `hot_paths`,
98
+ `needs_step`, `irreversible` — then `state.py weight --mirror`.
99
+ 6. **Verify**: `/rr-status` shows schema 10 and no task in flight; a
100
+ `/rr-build` on a small change runs light and closes on the two facts.
101
+ Commit `.ai/`.
102
+
103
+ Every machine of a team upgrades the plugin before a project at schema 10 is
104
+ committed; an older plugin refuses such a project. Rollback and the full
105
+ migration table are in [docs/project-update.md](docs/project-update.md); the
106
+ home-side details in [docs/installation.md](docs/installation.md).
107
+
108
+ ## Install
109
+
110
+ ```bash
111
+ npx riskrails@3.0.1 # detects Claude Code, Codex, or both; proposes the detected plan
112
+ npx riskrails@3.0.1 --target codex # auto | claude | codex | both
113
+ npx riskrails@3.0.1 --plan max --fable no # pro | team-pro | team-max | max | max20 | balanced-max
114
+ npx riskrails@3.0.1 --codex-plan plus # plus | pro | balanced-max
115
+ npx riskrails@3.0.1 --context economy # the plan's compaction window; the context guard also blocks
116
+ npx riskrails@3.0.1 --dry-run # print what would be written, write nothing
117
+ npx -y riskrails@latest --yes # update in place, keeping the recorded plan
118
+ ```
119
+
120
+ Pin the version: the hooks it installs see every command an agent runs. It
121
+ installs the managed block, the plan's settings and limits, the five agents
122
+ with their tiers baked in, the hooks, the skills, the shared tree at
123
+ `<home>/riskrails/ai/` and the resolved profile; re-running it updates in
124
+ place with dated backups. The plugin route (`/plugin install riskrails`)
125
+ carries the skills and hooks only — run `npx` as well. Every option, every
126
+ limit it sets and what loads on every turn: [docs/installation.md](docs/installation.md).
127
+
128
+ ## Use
129
+
130
+ The same commands in both runtimes:
131
+
132
+ | You want to | Run |
133
+ |---|---|
134
+ | set up `.ai/` in a project, or bring it up to the installed plugin | `/rr-setup`, `/rr-setup --update` |
135
+ | move another AI tool's files, or the project's own toolbox, into this layout | `/rr-setup --adopt` |
136
+ | score the repository against the twelve plays | `/rr-setup --audit` |
137
+ | turn an idea into intent, requirements and design | `/rr-spec <idea>` |
138
+ | plan a spec into tasks, or one task into a mode and a start | `/rr-plan <spec or task>` |
139
+ | do the work, or resume it | `/rr-build <request>` (no task in flight: it runs `/rr-plan` first) |
140
+ | run a whole plan as one task | `/rr-build-all docs/sdlc/plans/<slug>.md` |
141
+ | review the change | `/rr-review` — guarded and full, or when `close` asks |
142
+ | close the task, get the human's approval | `/rr-ship` |
143
+ | see where the task stands, or what it cost | `/rr-status`, `/rr-status --cost` |
144
+
145
+ The old names — `/ai-init`, `/ai-task`, `/ai-status`, `/ai-audit`,
146
+ `/project-init`, `/project-update`, `/sdlc-intent`, `/sdlc-spec`,
147
+ `/sdlc-plan`, `/usage-report` — are aliases for one version.
148
+
149
+ ### Three modes
150
+
151
+ `state.py weight` scores six axes 0–2 — scope, behaviour, reversibility,
152
+ domain, novelty, coverage — and the sum W picks the mode. The table is the
153
+ project's `.ai/policies/weight.json`; reversibility or domain at 2 is full
154
+ whatever W is ([docs/weight.md](docs/weight.md)).
155
+
156
+ | Mode | When | Plan | Review | Human stops |
157
+ |---|---|---|---|---|
158
+ | **light** | W ≤ 2 | inline: files, test, rollback | only when a fact at close is red | none |
159
+ | **guarded** | W 3–7 | plan mode, which you accept | one pass on BALANCED | the plan |
160
+ | **full** | W ≥ 8, or reversibility or domain = 2 | written; `architect` on STRONG when the design is open | one pass on STRONG, security focus when domain = 2 | the plan, and the tree at close |
161
+
162
+ A `full_irreversible` task (both hard axes at 2, or `DROP`, `TRUNCATE`,
163
+ `DELETE FROM` in the diff) is approved with `approve --confirm <operation>` in
164
+ your own terminal. `verify` and `close` re-score the two hard axes from the
165
+ real diff; a mode never drops during a task.
166
+
167
+ ### The two facts
168
+
169
+ `close` measures, never asks: (a) a green whole-suite `verify` on the tree as
170
+ it is now; (b) every changed file inside the task's files. Green and green in
171
+ light mode closes the task. Tests run once, to the end, with the log under
172
+ `.ai/state/logs/`, and every failure is fixed as one batch; two whole-suite
173
+ runs are the budget, and the third is your decision.
174
+
175
+ ### The dialog
176
+
177
+ With `.ai/policies/dialog.json` on (the default), the approval at close, a
178
+ budget refusal and a guarded `git commit` or `git push` come to you as a
179
+ question in the runtime's own dialog. The pick is recorded by a hook and the
180
+ command runs once, verbatim; a command that is not the pick is refused as
181
+ `CONSENT_REQUIRED`. Off, the same decisions are commands you run in your own
182
+ terminal.
183
+
184
+ ### Batch — one task for a whole plan
185
+
186
+ `/rr-build-all docs/sdlc/plans/<slug>.md` runs every row of a programme plan as
187
+ the steps of one task: the ready rows go to parallel implementers on
188
+ BALANCED (a step's `after` serializes the dependent ones), the suite runs once,
189
+ every failure is fixed by parallel fixers as one batch, one review at the
190
+ mode's tier, its findings fixed as one batch, then tests and the review again
191
+ until it passes. After three failed review passes the next verdict is yours.
192
+
193
+ ### The record
194
+
195
+ A closed task's who, what, how and why travel as a compact record: `state.py
196
+ memory enable` (yours, in a terminal) switches a project to packages mode, in
197
+ which `close` appends the task's entries to a per-developer batch under
198
+ `.ai/memory/` and a pre-push hook validates them; `state.py recall --files …`
199
+ gives an agent what the record holds about the files it is about to touch,
200
+ within a token budget. Task ids are `T-YYYY-MM-DD-HHMM-<slug>`
201
+ ([docs/local-memory.md](docs/local-memory.md)).
202
+
203
+ ## The guards
204
+
205
+ | Hook | Where | Does |
206
+ |---|---|---|
207
+ | `ai-guard.py` — **git** | every repository, both runtimes | refuses force push, remote branch delete, history rewrite, push or merge to a protected branch, `gh pr merge`, `--no-verify`, staging a secret, production deploy commands, `npm publish`; a `git commit` or `push` that is not the dialog's pick |
208
+ | `ai-guard.py` — **paths** | where `.ai/` exists | refuses reading or writing `.env`, `secrets/`, keys, dumps, production logs; writing the task state, the journal, `task.md`, the policies' JSON, the compact record, the installed guards; the human-only `state.py` and `update.py` commands from an agent |
209
+ | `ai-guard.py` — **scope** | during an implementation step | refuses editing a file the step does not name, with `SCOPE_CHANGE_REQUIRED` |
210
+ | `ai-guard.py` — **decision** | while a decision is open | holds every tool until the dialog is answered or settled in the terminal |
211
+ | `cap-large-read.py` | Claude Code | refuses an unbounded `Read` over 4 000 lines or 250 KB; a `limit` within the budget passes |
212
+ | `context-guard.py` | both | warns from 80% of the compaction point, snapshots before a compaction, injects the handoff at session start, checks plan drift |
213
+ | `runtime-gate.py` | both | sends the top model's launches one tier down during an outage or at 90% of the weekly limit; asks before an EXPERT launch past the budget |
214
+ | `dialog-gate.py` | both | records your picks from the runtime's dialog; holds the turn while a decision is open |
215
+
216
+ Every path of a Codex `apply_patch` is checked on its own. The guards are
217
+ regex over a command line or a path — a tripwire for the honest mistake, **not
218
+ a security boundary**; the real backstops are branch protection, secrets off
219
+ the developer machine and human review. Every rule, its configuration and
220
+ how a change is proved behaviour-preserving: [docs/hooks.md](docs/hooks.md).
221
+
222
+ ## Model tiers
223
+
224
+ The prompts name tiers; the installed profile says which model each tier is on
225
+ your plan and runtime (`state.py profile --tier STRONG`).
226
+
227
+ | Tier | Claude Code | Codex | Does |
228
+ |---|---|---|---|
229
+ | FAST | `haiku`, low | Terra, low | reading and running: `Explore`, `log-reader` |
230
+ | BALANCED | `sonnet` | Terra, medium | discovery with judgement (`ai-discovery`), the guarded review, batch implementers |
231
+ | STRONG | `opus`, high | Sol, high | the full review, security review, `architect` in `/rr-spec` |
232
+ | EXPERT | Fable 5.1 [1m] on `architect`; Opus without Fable | Astra | what STRONG could not settle |
233
+
234
+ The session implements — Opus 5.5 [1m] on Max, `opusplan` on Pro, Sol on Codex
235
+ — and the expensive tiers run one at a time on a named trigger. Plans,
236
+ budgets, the runtime gate and the Codex differences: [docs/routing.md](docs/routing.md).
237
+
238
+ ## Known risks
239
+
240
+ What 3.0 knowingly does not protect against, each with why it stays and what
241
+ to do: [docs/known-risks.md](docs/known-risks.md).
242
+
243
+ | Risk | In one line |
244
+ |---|---|
245
+ | The guards are a tripwire, not a sandbox | a determined process gets past a regex |
246
+ | Human approval can be forged by a determined process | a pty, or a written ledger, can approve; every approval is journalled |
247
+ | The deletion gate stops a command, not a script | run `--confirm-delete` in a terminal of your own |
248
+ | `AI_UNATTENDED=1` turns the human gates off | export it only in a launcher, never in a shell |
249
+ | Three hooks are less protected than the guards | review hook diffs by hand |
250
+ | The compaction snapshot runs `git` in the working directory | do not run agents in repositories you do not trust |
251
+ | Codex runs only hooks you re-approved | open `/hooks` after every upgrade |
252
+ | Codex facts are observed, not guaranteed | grep the journals for `missed_reroute` after a Codex upgrade |
253
+ | The dialog switch is read in two places | when the dialog and the terminal disagree, use the terminal |
254
+ | Budgets and quota are advice, not limits | read the quota with its `stale` field |
255
+ | `--adopt` edge cases fail safe, not smoothly | adopt on a committed tree, keep `original/` |
256
+ | The usage report's parse cache trusts mtime and size | `--no-cache` when a number surprises you |
257
+
258
+ ## Tests
259
+
260
+ ```bash
261
+ python3 -I tests/run_suite.py --serial test_guard_characterization.TestTimed --serial test_dialog_gate.TestGateFastPath
262
+ python3 -I -m unittest discover -s tests -p 'test_*.py' # CI's serial oracle, same test ids
263
+ AI_E2E=1 python3 -I -m unittest discover -s tests -p test_end_to_end.py
264
+ ```
265
+
266
+ Fifty-six suites, 979 tests, about 75 seconds in parallel. The guards against JSON fixtures for both runtimes and a
267
+ golden of 1 341 recorded decisions, byte for byte, with timed cases that hold
268
+ the hot path under its budget; the state machine, the weight, the batch loop,
269
+ the dialog contract and the documents rule; the compact record and its
270
+ pre-push validator; the installer for every plan and `--target`, the Codex
271
+ agent renderer and the `config.toml` merge against a fixture full of
272
+ third-party settings; `/rr-setup --update` against projects scaffolded from
273
+ the oldest shipped templates and edited by hand; `--adopt` against Spec Kit,
274
+ Kiro and Cursor fixtures; and an end-to-end run that installs both runtimes
275
+ into scratch directories, drives one task through the guards from Claude and
276
+ then from Codex, and proves both see the same state. No suite reads or writes
277
+ the developer's real `~/.claude` or `~/.codex`.
278
+
279
+ ## Documentation
280
+
281
+ | File | About |
282
+ |---|---|
283
+ | [docs/getting-started.md](docs/getting-started.md) | the first hour: install, `/rr-setup`, a light and a full task, a batch build, the update, the bill |
284
+ | [docs/installation.md](docs/installation.md) | every installer option, what it installs per runtime, what loads on every turn, the limits it sets, the 2.x home-side upgrade |
285
+ | [docs/project-update.md](docs/project-update.md) | shared versus project-owned files, how a file is updated, the migrations and their rollback, `--adopt` |
286
+ | [docs/architecture.md](docs/architecture.md) | how the pieces fit: the installed home, `.ai/`, the pipeline, the state, the hooks, the two adapters |
287
+ | [docs/weight.md](docs/weight.md) | the six axes, the three modes, what is measured and what is declared, tuning the table |
288
+ | [docs/workflows.md](docs/workflows.md) | feature, bugfix, refactoring, hotfix, investigation |
289
+ | [docs/agents.md](docs/agents.md) | the five agents, their contracts, the escalation ladder |
290
+ | [docs/routing.md](docs/routing.md) | the tiers per plan and runtime, the runtime gate, the Codex differences |
291
+ | [docs/hooks.md](docs/hooks.md) | every rule the guards enforce, their configuration and limits |
292
+ | [docs/hook-performance.md](docs/hook-performance.md) | the hot path's budget and how a change is proved behaviour-preserving |
293
+ | [docs/local-memory.md](docs/local-memory.md) | the compact record: task ids, packages, recall, the pre-push check, migration |
294
+ | [docs/known-risks.md](docs/known-risks.md) | what the guards do not protect against, and what to do about it |
295
+ | [docs/faq.md](docs/faq.md) | why something was blocked, and how to change it |
296
+ | [docs/sdlc/README.md](docs/sdlc/README.md) | the spec → plan → build artefacts in a project |
297
+ | [ROADMAP.md](ROADMAP.md) | what is decided but not built; the open rows |
298
+
299
+ ## Contributing, security and license
300
+
301
+ - [CONTRIBUTING.md](CONTRIBUTING.md): setup, tests, how a guard change is proved, how a change gets merged
302
+ - [SECURITY.md](SECURITY.md): what counts as a vulnerability and how to report one privately
303
+ - [LICENSE](LICENSE): MIT
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: Explore
3
+ description: Fast read-only codebase search and file discovery.
4
+ tools: Read, Grep, Glob
5
+ model: {{FAST_MODEL}}
6
+ effort: {{FAST_EFFORT}}
7
+ color: green
8
+ ---
9
+ Find the files, classes, and code paths relevant to the task. Return a concise list with paths and one line on why each matters. Do not explain the code in depth. Never paste file contents back — the caller wants pointers, not the code.
10
+
11
+ You are also the reader for files that are too large for the caller to open. When
12
+ you are asked what a large file says about something:
13
+
14
+ - `grep -n` first, then read only the ranges that matched.
15
+ - Return **only the excerpt that answers the question** — the matching ranges as
16
+ `path:line`, with one line each on why they are there. At most ~30 lines of
17
+ quoted code in total.
18
+ - Never return the file, a whole class, or a range you did not need. An answer
19
+ that pastes the file is the one thing that makes this delegation pointless.
20
+ - If the question is too wide to answer in 30 lines, say so and name the two or
21
+ three narrower questions worth asking instead.
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: ai-discovery
3
+ description: Read-only discovery in a project with .ai/ — locate an implementation, trace its execution flow, find its callers, tests, configuration and hidden coupling. Returns labelled facts with file:line, never code and never a proposed solution. Use one per area when fanning out.
4
+ tools: Read, Grep, Glob
5
+ disallowedTools: Edit, Write, NotebookEdit
6
+ model: {{BALANCED_MODEL}}
7
+ effort: low
8
+ color: cyan
9
+ ---
10
+ You find out where things are and how they are reached. You never change
11
+ anything, and you never propose a solution — that is the planner's job, and
12
+ mixing the two makes your evidence harder to trust.
13
+
14
+ Read first, if they exist: `.ai/policies/safety.md`,
15
+ `.ai/policies/context-management.md`, `.ai/agents/discovery.md`. Follow the
16
+ project layer where it differs from these instructions.
17
+
18
+ A shared file under `.ai/` — a policy, agent contract, workflow or template — is
19
+ read from the project's `.ai/<path>` when it exists, else from
20
+ `{{AI_SHARED}}/<path>`; `.ai/` paths inside those files resolve the same way.
21
+
22
+ ## Find
23
+
24
+ - the implementation, and the entry point that reaches it;
25
+ - the execution flow between them;
26
+ - the callers — including the ones `grep` misses: service ids, event names,
27
+ template names, route names, dynamic dispatch, reflection, configuration;
28
+ - the configuration and environment variables involved;
29
+ - the tests that pin the current behaviour;
30
+ - legacy components on the path;
31
+ - hidden coupling: a shared table, a global event, a cache key, a serialized
32
+ payload, a file on disk.
33
+
34
+ ## Output
35
+
36
+ ```
37
+ ## FACTS
38
+ - KNOWN FACT: <statement> (`path/file.php:120`)
39
+ - INFERENCE: <statement> — drawn from <what>
40
+ - UNKNOWN: <what could not be determined> — <what would answer it>
41
+ - RISK: <what looks dangerous> — <what could go wrong>
42
+
43
+ ## OPEN QUESTIONS
44
+ - <question that blocks planning>
45
+ ```
46
+
47
+ Every fact carries `file:line`. Never paste file contents back — the caller wants
48
+ pointers, not the code. An honest UNKNOWN is worth more than a confident guess.
49
+
50
+ ## QUESTIONS_NEEDED
51
+
52
+ You never ask the user, and you never write `.ai/reports/*/task.md`. When the
53
+ work cannot continue without a human decision, stop at that point and return this
54
+ section — under exactly this heading, before any RESULT:
55
+
56
+ ```
57
+ - question: <one line>
58
+ options: [ "A: <text>", "B: <text>" ] # 2–6, A first; add "(recommended)" to one
59
+ why_it_blocks: <one line>
60
+ context: <file:line or report path>
61
+ ```
62
+
63
+ Partial output that does not depend on the answer follows under its normal
64
+ heading. The main session converts this into `state.py ask --batch`; the answer
65
+ comes back to you in the next brief.