@tyroneross/build-loop 0.30.3

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 (389) hide show
  1. package/.agents/plugins/marketplace.json +10 -0
  2. package/.claude-plugin/marketplace.json +38 -0
  3. package/.claude-plugin/plugin.json +30 -0
  4. package/.codex-plugin/plugin.json +41 -0
  5. package/.cursor/rules/build-loop-surface.mdc +22 -0
  6. package/AGENTS.md +498 -0
  7. package/LICENSE +202 -0
  8. package/README.md +403 -0
  9. package/agents/alignment-checker.md +124 -0
  10. package/agents/api-assessor.md +136 -0
  11. package/agents/architecture-scout.md +185 -0
  12. package/agents/assessment-orchestrator.md +163 -0
  13. package/agents/build-orchestrator.md +198 -0
  14. package/agents/database-assessor.md +133 -0
  15. package/agents/design-contract-specialist.md +239 -0
  16. package/agents/fact-checker.md +69 -0
  17. package/agents/fix-critique.md +161 -0
  18. package/agents/frontend-assessor.md +136 -0
  19. package/agents/implementer.md +185 -0
  20. package/agents/independent-auditor.md +143 -0
  21. package/agents/mock-scanner.md +78 -0
  22. package/agents/optimize-runner.md +112 -0
  23. package/agents/overfitting-reviewer.md +96 -0
  24. package/agents/performance-assessor.md +159 -0
  25. package/agents/plan-critic.md +85 -0
  26. package/agents/promotion-reviewer.md +121 -0
  27. package/agents/recurring-pattern-detector.md +248 -0
  28. package/agents/retrospective-synthesizer.md +109 -0
  29. package/agents/root-cause-investigator.md +285 -0
  30. package/agents/scope-auditor.md +121 -0
  31. package/agents/security-reviewer.md +151 -0
  32. package/agents/self-improvement-architect.md +125 -0
  33. package/agents/synthesis-critic.md +99 -0
  34. package/agents/transcript-pattern-miner.md +165 -0
  35. package/agents/ui-validator.md +193 -0
  36. package/codex-skills/build-loop/SKILL.md +20 -0
  37. package/codex-skills/debug-loop/SKILL.md +18 -0
  38. package/codex-skills/handoff/SKILL.md +22 -0
  39. package/codex-skills/knowledge/SKILL.md +21 -0
  40. package/codex-skills/optimize/SKILL.md +18 -0
  41. package/codex-skills/research/SKILL.md +18 -0
  42. package/commands/agent-rally-point.md +301 -0
  43. package/commands/assess.md +41 -0
  44. package/commands/debug.md +20 -0
  45. package/commands/debugger-detail.md +34 -0
  46. package/commands/debugger-scan.md +15 -0
  47. package/commands/debugger-status.md +20 -0
  48. package/commands/debugger.md +32 -0
  49. package/commands/handoff.md +113 -0
  50. package/commands/knowledge-review.md +16 -0
  51. package/commands/optimize.md +31 -0
  52. package/commands/plan-verify.md +39 -0
  53. package/commands/promote-experiment.md +129 -0
  54. package/commands/research.md +22 -0
  55. package/commands/run.md +12 -0
  56. package/commands/self-review.md +51 -0
  57. package/commands/start-prd.md +57 -0
  58. package/commands/test.md +34 -0
  59. package/dist/src/assessment-orchestrator.d.ts +78 -0
  60. package/dist/src/assessment-orchestrator.d.ts.map +1 -0
  61. package/dist/src/assessment-orchestrator.js +304 -0
  62. package/dist/src/assessment-orchestrator.js.map +1 -0
  63. package/dist/src/audit-miner.d.ts +21 -0
  64. package/dist/src/audit-miner.d.ts.map +1 -0
  65. package/dist/src/audit-miner.js +421 -0
  66. package/dist/src/audit-miner.js.map +1 -0
  67. package/dist/src/batch-operations.d.ts +30 -0
  68. package/dist/src/batch-operations.d.ts.map +1 -0
  69. package/dist/src/batch-operations.js +339 -0
  70. package/dist/src/batch-operations.js.map +1 -0
  71. package/dist/src/config.d.ts +83 -0
  72. package/dist/src/config.d.ts.map +1 -0
  73. package/dist/src/config.js +176 -0
  74. package/dist/src/config.js.map +1 -0
  75. package/dist/src/context-engine.d.ts +45 -0
  76. package/dist/src/context-engine.d.ts.map +1 -0
  77. package/dist/src/context-engine.js +135 -0
  78. package/dist/src/context-engine.js.map +1 -0
  79. package/dist/src/debug-wrapper.d.ts +58 -0
  80. package/dist/src/debug-wrapper.d.ts.map +1 -0
  81. package/dist/src/debug-wrapper.js +285 -0
  82. package/dist/src/debug-wrapper.js.map +1 -0
  83. package/dist/src/index.d.ts +31 -0
  84. package/dist/src/index.d.ts.map +1 -0
  85. package/dist/src/index.js +149 -0
  86. package/dist/src/index.js.map +1 -0
  87. package/dist/src/interactive-verifier.d.ts +26 -0
  88. package/dist/src/interactive-verifier.d.ts.map +1 -0
  89. package/dist/src/interactive-verifier.js +435 -0
  90. package/dist/src/interactive-verifier.js.map +1 -0
  91. package/dist/src/lessons.d.ts +59 -0
  92. package/dist/src/lessons.d.ts.map +1 -0
  93. package/dist/src/lessons.js +172 -0
  94. package/dist/src/lessons.js.map +1 -0
  95. package/dist/src/log-reader.d.ts +39 -0
  96. package/dist/src/log-reader.d.ts.map +1 -0
  97. package/dist/src/log-reader.js +291 -0
  98. package/dist/src/log-reader.js.map +1 -0
  99. package/dist/src/logger.d.ts +59 -0
  100. package/dist/src/logger.d.ts.map +1 -0
  101. package/dist/src/logger.js +328 -0
  102. package/dist/src/logger.js.map +1 -0
  103. package/dist/src/parallel-retrieval.d.ts +52 -0
  104. package/dist/src/parallel-retrieval.d.ts.map +1 -0
  105. package/dist/src/parallel-retrieval.js +309 -0
  106. package/dist/src/parallel-retrieval.js.map +1 -0
  107. package/dist/src/pattern-extractor.d.ts +30 -0
  108. package/dist/src/pattern-extractor.d.ts.map +1 -0
  109. package/dist/src/pattern-extractor.js +386 -0
  110. package/dist/src/pattern-extractor.js.map +1 -0
  111. package/dist/src/result-aggregator.d.ts +44 -0
  112. package/dist/src/result-aggregator.d.ts.map +1 -0
  113. package/dist/src/result-aggregator.js +315 -0
  114. package/dist/src/result-aggregator.js.map +1 -0
  115. package/dist/src/retrieval.d.ts +139 -0
  116. package/dist/src/retrieval.d.ts.map +1 -0
  117. package/dist/src/retrieval.js +724 -0
  118. package/dist/src/retrieval.js.map +1 -0
  119. package/dist/src/setup/auto-setup.d.ts +15 -0
  120. package/dist/src/setup/auto-setup.d.ts.map +1 -0
  121. package/dist/src/setup/auto-setup.js +157 -0
  122. package/dist/src/setup/auto-setup.js.map +1 -0
  123. package/dist/src/setup/configure-hooks.d.ts +8 -0
  124. package/dist/src/setup/configure-hooks.d.ts.map +1 -0
  125. package/dist/src/setup/configure-hooks.js +16 -0
  126. package/dist/src/setup/configure-hooks.js.map +1 -0
  127. package/dist/src/setup/create-slash-commands.d.ts +8 -0
  128. package/dist/src/setup/create-slash-commands.d.ts.map +1 -0
  129. package/dist/src/setup/create-slash-commands.js +101 -0
  130. package/dist/src/setup/create-slash-commands.js.map +1 -0
  131. package/dist/src/setup/index.d.ts +8 -0
  132. package/dist/src/setup/index.d.ts.map +1 -0
  133. package/dist/src/setup/index.js +17 -0
  134. package/dist/src/setup/index.js.map +1 -0
  135. package/dist/src/setup/inject-claude-md.d.ts +10 -0
  136. package/dist/src/setup/inject-claude-md.d.ts.map +1 -0
  137. package/dist/src/setup/inject-claude-md.js +150 -0
  138. package/dist/src/setup/inject-claude-md.js.map +1 -0
  139. package/dist/src/setup/uninstall.d.ts +22 -0
  140. package/dist/src/setup/uninstall.d.ts.map +1 -0
  141. package/dist/src/setup/uninstall.js +235 -0
  142. package/dist/src/setup/uninstall.js.map +1 -0
  143. package/dist/src/storage.d.ts +192 -0
  144. package/dist/src/storage.d.ts.map +1 -0
  145. package/dist/src/storage.js +1037 -0
  146. package/dist/src/storage.js.map +1 -0
  147. package/dist/src/string-similarity.d.ts +8 -0
  148. package/dist/src/string-similarity.d.ts.map +1 -0
  149. package/dist/src/string-similarity.js +57 -0
  150. package/dist/src/string-similarity.js.map +1 -0
  151. package/dist/src/traces/adapters/browser.d.ts +69 -0
  152. package/dist/src/traces/adapters/browser.d.ts.map +1 -0
  153. package/dist/src/traces/adapters/browser.js +280 -0
  154. package/dist/src/traces/adapters/browser.js.map +1 -0
  155. package/dist/src/traces/adapters/index.d.ts +23 -0
  156. package/dist/src/traces/adapters/index.d.ts.map +1 -0
  157. package/dist/src/traces/adapters/index.js +67 -0
  158. package/dist/src/traces/adapters/index.js.map +1 -0
  159. package/dist/src/traces/adapters/langchain.d.ts +42 -0
  160. package/dist/src/traces/adapters/langchain.d.ts.map +1 -0
  161. package/dist/src/traces/adapters/langchain.js +151 -0
  162. package/dist/src/traces/adapters/langchain.js.map +1 -0
  163. package/dist/src/traces/adapters/opentelemetry.d.ts +46 -0
  164. package/dist/src/traces/adapters/opentelemetry.d.ts.map +1 -0
  165. package/dist/src/traces/adapters/opentelemetry.js +164 -0
  166. package/dist/src/traces/adapters/opentelemetry.js.map +1 -0
  167. package/dist/src/traces/adapters/sentry.d.ts +58 -0
  168. package/dist/src/traces/adapters/sentry.d.ts.map +1 -0
  169. package/dist/src/traces/adapters/sentry.js +212 -0
  170. package/dist/src/traces/adapters/sentry.js.map +1 -0
  171. package/dist/src/traces/index.d.ts +10 -0
  172. package/dist/src/traces/index.d.ts.map +1 -0
  173. package/dist/src/traces/index.js +45 -0
  174. package/dist/src/traces/index.js.map +1 -0
  175. package/dist/src/traces/storage.d.ts +78 -0
  176. package/dist/src/traces/storage.d.ts.map +1 -0
  177. package/dist/src/traces/storage.js +399 -0
  178. package/dist/src/traces/storage.js.map +1 -0
  179. package/dist/src/traces/summarizer.d.ts +83 -0
  180. package/dist/src/traces/summarizer.d.ts.map +1 -0
  181. package/dist/src/traces/summarizer.js +247 -0
  182. package/dist/src/traces/summarizer.js.map +1 -0
  183. package/dist/src/traces/types.d.ts +365 -0
  184. package/dist/src/traces/types.d.ts.map +1 -0
  185. package/dist/src/traces/types.js +14 -0
  186. package/dist/src/traces/types.js.map +1 -0
  187. package/dist/src/types.d.ts +495 -0
  188. package/dist/src/types.d.ts.map +1 -0
  189. package/dist/src/types.js +27 -0
  190. package/dist/src/types.js.map +1 -0
  191. package/docs/agent-surface-policy.md +45 -0
  192. package/docs/memory-setup.md +226 -0
  193. package/hooks/_arch_scan_bg.py +88 -0
  194. package/hooks/_plugin_drift_check_bg.py +85 -0
  195. package/hooks/_session_start_lib.sh +42 -0
  196. package/hooks/git/pre-push +141 -0
  197. package/hooks/hooks.json +126 -0
  198. package/hooks/post-commit +30 -0
  199. package/hooks/pre-commit +29 -0
  200. package/hooks/pre-edit-apppulse.sh +6 -0
  201. package/hooks/pre-edit-architecture.sh +106 -0
  202. package/hooks/pre-edit-rally-point.sh +92 -0
  203. package/hooks/session-start-apppulse.sh +6 -0
  204. package/hooks/session-start-architecture.sh +10 -0
  205. package/hooks/session-start-git-hooks.sh +12 -0
  206. package/hooks/session-start-plugin-drift.sh +27 -0
  207. package/hooks/session-start-rally-point.sh +44 -0
  208. package/hooks/session-start-retrieval.sh +24 -0
  209. package/hooks/session-start-worktree-gc.sh +105 -0
  210. package/hooks/test_apppulse_hooks.sh +6 -0
  211. package/hooks/test_rally_point_hooks.sh +388 -0
  212. package/hooks/test_sec008_hooks.sh +66 -0
  213. package/package.json +111 -0
  214. package/scripts/README.md +301 -0
  215. package/scripts/_db_url.py +61 -0
  216. package/scripts/_paths.py +445 -0
  217. package/scripts/blm.py +162 -0
  218. package/scripts/blm_api.py +263 -0
  219. package/scripts/check_cache_sync.py +490 -0
  220. package/scripts/embed_backend.py +475 -0
  221. package/scripts/install_memory.py +556 -0
  222. package/scripts/lessons_index/__init__.py +77 -0
  223. package/scripts/lessons_index/__main__.py +135 -0
  224. package/scripts/lessons_index/ingest.py +288 -0
  225. package/scripts/lessons_index/query.py +285 -0
  226. package/scripts/lessons_index/schema.py +114 -0
  227. package/scripts/memory_context/__init__.py +610 -0
  228. package/scripts/memory_graph/__init__.py +393 -0
  229. package/scripts/project_resolver.py +172 -0
  230. package/scripts/prune_codex_plugin_cache.py +23 -0
  231. package/scripts/prune_plugin_cache.py +359 -0
  232. package/scripts/semantic_index/__init__.py +482 -0
  233. package/scripts/semantic_index/_bench_hybrid.py +175 -0
  234. package/scripts/semantic_index/backfill.py +263 -0
  235. package/scripts/semantic_index/hybrid.py +174 -0
  236. package/scripts/semantic_index/test_backfill.py +292 -0
  237. package/scripts/semantic_index/test_hybrid.py +541 -0
  238. package/scripts/sync_navgator_lessons.py +666 -0
  239. package/scripts/sync_plugin_cache.py +388 -0
  240. package/skills/agent-rally-point/SKILL.md +165 -0
  241. package/skills/agent-rally-watcher/SKILL.md +83 -0
  242. package/skills/api-registry-bridge/SKILL.md +59 -0
  243. package/skills/architecture/dead/SKILL.md +56 -0
  244. package/skills/architecture/impact/SKILL.md +88 -0
  245. package/skills/architecture/review/SKILL.md +227 -0
  246. package/skills/architecture/rules/SKILL.md +72 -0
  247. package/skills/architecture/scan/SKILL.md +79 -0
  248. package/skills/architecture/trace/SKILL.md +65 -0
  249. package/skills/attribution-standard/SKILL.md +122 -0
  250. package/skills/authentication/SKILL.md +81 -0
  251. package/skills/authentication/references/better-auth-magic-link.md +135 -0
  252. package/skills/authentication/references/better-auth-setup.md +224 -0
  253. package/skills/authentication/references/google-calendar-sync.md +278 -0
  254. package/skills/authentication/references/google-cloud-console.md +159 -0
  255. package/skills/authentication/references/google-geocoding-directions.md +126 -0
  256. package/skills/authentication/references/google-lessons-example-web-app.md +177 -0
  257. package/skills/authentication/references/google-maps.md +162 -0
  258. package/skills/authentication/references/google-oauth-setup.md +343 -0
  259. package/skills/authentication/references/google-places.md +173 -0
  260. package/skills/authentication/references/lessons-example-web-app-better-auth.md +126 -0
  261. package/skills/authentication/references/resend-email.md +227 -0
  262. package/skills/authentication/references/resend-otp-magic-link.md +153 -0
  263. package/skills/authentication/references/supabase-auth.md +172 -0
  264. package/skills/auto-decision-capture/SKILL.md +419 -0
  265. package/skills/build-loop/SKILL.md +516 -0
  266. package/skills/build-loop/detect-plugins.mjs +82 -0
  267. package/skills/build-loop/eval-guide.md +65 -0
  268. package/skills/build-loop/fallbacks.md +549 -0
  269. package/skills/build-loop/phases/fact-check.md +42 -0
  270. package/skills/build-loop/phases/ui-validation.md +267 -0
  271. package/skills/build-loop/references/apple-native-planning.md +439 -0
  272. package/skills/build-loop/references/capability-routing.md +181 -0
  273. package/skills/build-loop/references/codex-subagents.md +98 -0
  274. package/skills/build-loop/references/coordination.md +161 -0
  275. package/skills/build-loop/references/correction-aware-capture.md +177 -0
  276. package/skills/build-loop/references/independent-auditor.md +72 -0
  277. package/skills/build-loop/references/intent-capability-pack.md +170 -0
  278. package/skills/build-loop/references/intent-exploration-prompts.md +96 -0
  279. package/skills/build-loop/references/leadership.md +72 -0
  280. package/skills/build-loop/references/memory.md +284 -0
  281. package/skills/build-loop/references/modular-systems-pack.md +96 -0
  282. package/skills/build-loop/references/output-style.md +129 -0
  283. package/skills/build-loop/references/pay-it-forward-arch.md +98 -0
  284. package/skills/build-loop/references/phase-1-assess.md +218 -0
  285. package/skills/build-loop/references/phase-2-plan.md +77 -0
  286. package/skills/build-loop/references/phase-3-execute.md +47 -0
  287. package/skills/build-loop/references/phase-4-review.md +310 -0
  288. package/skills/build-loop/references/phase-5-iterate.md +71 -0
  289. package/skills/build-loop/references/phase-6-learn.md +56 -0
  290. package/skills/build-loop/references/recent-design-structures.md +274 -0
  291. package/skills/build-loop/references/refactor-history/ASSESSMENT.md +85 -0
  292. package/skills/build-loop/references/refactor-history/STANDALONE_TEST_RUN.md +149 -0
  293. package/skills/build-loop/references/refactor-history/scenarios/01-simple-bugfix.md +32 -0
  294. package/skills/build-loop/references/refactor-history/scenarios/02-ui-build-with-iteration.md +48 -0
  295. package/skills/build-loop/references/refactor-history/scenarios/03-multi-failure-escalation.md +60 -0
  296. package/skills/build-loop/references/refactor-history/scenarios/04-ui-build-ibr-absent.md +51 -0
  297. package/skills/build-loop/references/refactor-history/scenarios/05-refactor-navgator-absent.md +71 -0
  298. package/skills/build-loop/references/refactor-history/scenarios/06-recurring-bug-debugger-absent.md +52 -0
  299. package/skills/build-loop/references/refactor-history/trace-comparison.md +202 -0
  300. package/skills/build-loop/references/self-recursive-dev.md +77 -0
  301. package/skills/build-loop/references/self-review.md +232 -0
  302. package/skills/build-loop/references/ui-io-contract.md +116 -0
  303. package/skills/build-loop/scanners/audit-design-rules.mjs +476 -0
  304. package/skills/build-loop/scanners/require-visual-evidence.mjs +239 -0
  305. package/skills/build-loop/templates/backlog-item.md +35 -0
  306. package/skills/build-loop/templates/codex-worker-prompt.md +89 -0
  307. package/skills/build-loop/templates/ui-subagent-prompt.md +179 -0
  308. package/skills/build-loop/templates/ux-fix-plan.md +40 -0
  309. package/skills/building-with-deepagents/SKILL.md +195 -0
  310. package/skills/building-with-deepagents/references/anti-patterns.md +141 -0
  311. package/skills/building-with-deepagents/references/api-quick-reference.md +184 -0
  312. package/skills/capabilities/SKILL.md +91 -0
  313. package/skills/debug-loop/SKILL.md +278 -0
  314. package/skills/debug-loop/references/convergence-rules.md +145 -0
  315. package/skills/debug-loop/references/swiftui-macos-clunky-ui-debugger.html +823 -0
  316. package/skills/debugging/assess/SKILL.md +111 -0
  317. package/skills/debugging/debug-loop/SKILL.md +231 -0
  318. package/skills/debugging/memory/SKILL.md +147 -0
  319. package/skills/debugging/store/SKILL.md +153 -0
  320. package/skills/debugging-memory/SKILL.md +440 -0
  321. package/skills/debugging-memory/examples/incident-example.json +67 -0
  322. package/skills/debugging-memory/references/incident-documentation.md +280 -0
  323. package/skills/debugging-memory/references/ios-notification-alarm-playbook.md +300 -0
  324. package/skills/debugging-memory/references/pattern-extraction.md +163 -0
  325. package/skills/debugging-memory/references/subagent-integration.md +312 -0
  326. package/skills/defenseclaw-bridge/SKILL.md +156 -0
  327. package/skills/defenseclaw-bridge/references/dc-config-mapping.md +162 -0
  328. package/skills/defenseclaw-bridge/references/output-format.md +108 -0
  329. package/skills/handoff/SKILL.md +94 -0
  330. package/skills/ibr-bridge/SKILL.md +68 -0
  331. package/skills/knowledge/SKILL.md +127 -0
  332. package/skills/knowledge/references/recall-integration.md +83 -0
  333. package/skills/knowledge/templates/madr-minimal.md +56 -0
  334. package/skills/knowledge-review/SKILL.md +112 -0
  335. package/skills/logging-tracer/SKILL.md +202 -0
  336. package/skills/logging-tracer/references/log-analysis.md +128 -0
  337. package/skills/logging-tracer/references/stack-templates.md +274 -0
  338. package/skills/logging-tracer-bridge/SKILL.md +70 -0
  339. package/skills/mcp-builder/SKILL.md +278 -0
  340. package/skills/mcp-builder/references/mcp-security.md +106 -0
  341. package/skills/model-tiering/SKILL.md +216 -0
  342. package/skills/native-ax-driver/SKILL.md +220 -0
  343. package/skills/native-ax-driver/scripts/layout_fill.py +222 -0
  344. package/skills/native-ax-driver/scripts/native_driver.py +495 -0
  345. package/skills/native-ax-driver/swift/bl-ax-driver/Package.swift +20 -0
  346. package/skills/native-ax-driver/swift/bl-ax-driver/Sources/main.swift +542 -0
  347. package/skills/optimize/SKILL.md +202 -0
  348. package/skills/optimize/profiles.md +61 -0
  349. package/skills/plan-verify/SKILL.md +115 -0
  350. package/skills/plan-verify/test-fixtures/example-app-v20-findings.json +27 -0
  351. package/skills/plan-verify/test-fixtures/example-app-v20.md +42 -0
  352. package/skills/plan-verify/test-fixtures/example-app-v22-findings.json +15 -0
  353. package/skills/plan-verify/test-fixtures/example-app-v22.md +1608 -0
  354. package/skills/plan-verify/test-fixtures/unrelated-good-plan-findings.json +15 -0
  355. package/skills/plan-verify/test-fixtures/unrelated-good-plan.md +55 -0
  356. package/skills/plugin-builder/SKILL.md +329 -0
  357. package/skills/plugin-builder/references/authoritative-sources.md +104 -0
  358. package/skills/plugin-builder/references/build-loop-phase-guidance.md +94 -0
  359. package/skills/plugin-builder/references/components-guide.md +221 -0
  360. package/skills/plugin-builder/references/distribution.md +317 -0
  361. package/skills/plugin-builder/references/dual-host-claude-codex.md +220 -0
  362. package/skills/plugin-builder/references/hooks-reference.md +210 -0
  363. package/skills/plugin-builder/references/manifest-schema.md +111 -0
  364. package/skills/plugin-builder/references/plugin-hygiene-lessons.md +307 -0
  365. package/skills/plugin-tests/SKILL.md +94 -0
  366. package/skills/prd-bridge/SKILL.md +135 -0
  367. package/skills/research/SKILL.md +80 -0
  368. package/skills/security-methodology/SKILL.md +105 -0
  369. package/skills/security-methodology/references/cross-source-matrix.md +77 -0
  370. package/skills/security-methodology/references/mitre-atlas-starter.md +83 -0
  371. package/skills/security-methodology/references/nist-600-1-mapping.md +119 -0
  372. package/skills/security-methodology/references/owasp-agentic-top-10.md +157 -0
  373. package/skills/security-methodology/references/owasp-llm-top-10.md +144 -0
  374. package/skills/security-methodology/references/owasp-web-top-10.md +65 -0
  375. package/skills/self-improve/SKILL.md +298 -0
  376. package/skills/spec-writing/SKILL.md +548 -0
  377. package/skills/spec-writing/scripts/check_checklist.py +478 -0
  378. package/skills/sync-skills/SKILL.md +132 -0
  379. package/skills/telemetry/SKILL.md +66 -0
  380. package/skills/ui-design/SKILL.md +75 -0
  381. package/skills/ui-design/references/design-patterns-multi.md +165 -0
  382. package/skills/ui-design/references/design-preferences-from-owned-apps.md +150 -0
  383. package/skills/ui-design/references/evidence-capture-policy.md +55 -0
  384. package/skills/ui-design/references/ui-guidance-sources.md +330 -0
  385. package/skills/ui-design/references/universal-design-principles.alt.md +182 -0
  386. package/skills/ui-design/references/universal-design-principles.md +419 -0
  387. package/templates/memory/MEMORY.md.template +55 -0
  388. package/templates/memory/constitution.md.template +64 -0
  389. package/templates/memory/manifest.json +47 -0
@@ -0,0 +1,98 @@
1
+ <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
+
3
+ # Codex Subagent Adapter
4
+
5
+ Use this adapter when Build Loop runs inside Codex. It translates Build Loop's host-neutral "parallel subagents" concept into Codex-native delegation without changing Claude Code's `agents/*.md` runtime.
6
+
7
+ ## Core Rule
8
+
9
+ Codex may use subagents only when the user explicitly authorizes delegation or parallel agent work. Examples: "use subagents", "parallelize this", "delegate", "spin up workers", or `/build-loop --parallel ...`.
10
+
11
+ If authorization is absent, keep the work local in the lead Codex session. Still write the same MECE plan and ownership packets, but do not spawn workers.
12
+
13
+ ## Role Mapping
14
+
15
+ | Build Loop need | Codex role | Use when |
16
+ |---|---|---|
17
+ | Codebase question | `explorer` | The answer can be read-only, bounded, and returned as facts with file paths. |
18
+ | Implementation slice | `worker` | The write set is disjoint from other workers and the interface contract is clear. |
19
+ | Phase 4 review passes | lead session inline, or `explorer` if authorized | See the enumerated passes below — the lead owns these whether or not delegation is allowed. |
20
+ | Final integration | lead session | The lead must own merge, validation, and final judgment. |
21
+
22
+ **Phase 4 review is not one pass — it is a set.** Whether run inline (default) or via an authorized `explorer`, the lead must cover all of these every non-trivial build; do not skip a pass just because Codex lacks a dedicated agent file for it:
23
+
24
+ - **Adversarial audit (independent-auditor)** — read the diff against intent/goal/PRD/constitution; verdict `yay`/`nay`/`suggest_correction`/`look_again`. Advisory at chunk close, gating at build scope.
25
+ - **Fact-check** — trace every rendered metric (%, $, score, count) to its source; flag absolute claims. *Blocking* when a rendered number is unverifiable.
26
+ - **Mock-data scan** — production paths only; lorem/faker/hardcoded/`Math.random()`-in-display. *Blocking* when it renders to the user.
27
+ - **Security review** — only when Assess flagged a risk-surface change (auth, network, persistence, secrets, external input); OWASP LLM/Agentic/Web top-10. *Blocking* on critical/high (feeds the exit gate).
28
+
29
+ The first row's "read-only, does not block" applies to the adversarial-audit *critic* pass; the fact-check, mock-scan, and security passes CAN block and route to Iterate.
30
+
31
+ ## Permission Gate
32
+
33
+ Before spawning any Codex subagent:
34
+
35
+ 1. Confirm user authorization is explicit in the current request or command flags.
36
+ 2. Confirm the task is not on the immediate critical path.
37
+ 3. Confirm the subtask has a bounded write set or read-only question.
38
+ 4. Confirm the prompt includes a MECE ownership packet.
39
+
40
+ If any condition fails, do the work locally.
41
+
42
+ ## When Not To Delegate
43
+
44
+ - Ambiguous product decisions.
45
+ - Final integration or final report.
46
+ - Destructive git operations.
47
+ - Push/deploy confirmation.
48
+ - A task whose result is required before the lead can make the next local move.
49
+ - Files already owned by another active worker.
50
+ - Cross-file architecture decisions that were not settled in the plan.
51
+
52
+ ## Prompt Packet Required
53
+
54
+ Every Codex worker prompt must include:
55
+
56
+ - `task`: one concrete outcome.
57
+ - `owns`: exact files or directories the worker may edit.
58
+ - `does_not_own`: files, directories, or responsibilities the worker must avoid.
59
+ - `context`: condensed facts from Phase 1 and Phase 2.
60
+ - `interface_contract`: functions, routes, schemas, props, CLI flags, or docs the worker must preserve or expose.
61
+ - `integration_checkpoint`: what the lead will verify before merging the worker result.
62
+ - `validation`: commands the worker should run if feasible.
63
+ - `return_format`: changed files, summary, validation, unresolved risks, integration notes.
64
+
65
+ Tell every worker: "You are not alone in the codebase. Do not revert edits made by others; adapt around them and report conflicts."
66
+
67
+ ## Context Policy
68
+
69
+ Prefer explicit prompt packets over full context forks. Use full context only when the worker genuinely needs the thread history to avoid a wrong implementation.
70
+
71
+ Shared reads should happen once in the lead session, then be condensed into worker prompts. This keeps workers focused and reduces contradictory interpretations.
72
+
73
+ ## Parallel Pattern
74
+
75
+ 1. Lead creates the plan and identifies parallel-safe groups.
76
+ 2. Lead spawns only independent sidecar work.
77
+ 3. Lead continues non-overlapping local work while workers run.
78
+ 4. Lead waits only when blocked on a worker result.
79
+ 5. Lead reviews changed files and integrates deliberately.
80
+ 6. Lead runs final validation locally.
81
+
82
+ ## Return Format
83
+
84
+ Workers should finish with:
85
+
86
+ ```text
87
+ Changed files:
88
+ - <path>: <what changed>
89
+
90
+ Validation:
91
+ - <command or "not run">: <result or reason>
92
+
93
+ Integration notes:
94
+ - <contract, migration, or ordering notes>
95
+
96
+ Unresolved risks:
97
+ - <risk or "none known">
98
+ ```
@@ -0,0 +1,161 @@
1
+ <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
+
3
+ # Coordination — How build-loop consumes agent-rally
4
+
5
+ Build-loop is a **consumer** of the agent-rally architecture, but it currently
6
+ vendors native embedded copies of the substrate and watcher while the standalone
7
+ repos mature. Treat `agent-rally-point` and `agent-rally-watcher` as
8
+ mini-plugins inside build-loop: grouped scripts, skills, docs, tests, and thin
9
+ build-loop adapters first; full spin-out later. Cross-reference the upstream
10
+ architecture docs before changing how build-loop reads or writes events, but do
11
+ not make build-loop depend on those external repos at runtime yet.
12
+
13
+ > **Binding constitution** (verdict-gating, MECE briefs, Phase D closeout, peer-no-mutate, release-surface verification) lives in [`references/coordination-rules.md`](../../../references/coordination-rules.md). This file documents the **integration shape**, not the rules of engagement.
14
+
15
+ ## Build-loop's position in the three-layer model
16
+
17
+ ```
18
+ Layer 3 — CONSUMERS (build-loop, codex, claude_code, ...)
19
+
20
+ │ build-loop is one of many
21
+
22
+ Layer 2 — agent-rally-watcher (embedded watcher namespace; optional listener)
23
+
24
+ │ build-loop CAN subscribe, OR poll Layer 1 directly
25
+
26
+ Layer 1 — agent-rally-point (embedded substrate; channel, schema, post API)
27
+ ```
28
+
29
+ Build-loop **always** uses Layer 1 (it posts events and calls `checkpoint_read`). It uses Layer 2 **opportunistically** — when a peer session is detected via Rally Point presence, the coordination polling gate spins up a `coordination_watch.py` loop or installs a watcher subscription so chunk-close, commit, and feedback events surface within seconds rather than at the next phase boundary.
30
+
31
+ Native skill entrypoints:
32
+
33
+ - `skills/agent-rally-point/SKILL.md` — substrate workflow, CLI, boundary,
34
+ run identity, and spin-out rules.
35
+ - `skills/agent-rally-watcher/SKILL.md` — watcher workflow, JSONL sensor
36
+ behavior, closeout, and spin-out rules.
37
+
38
+ The machine-readable boundary is `scripts/rally_point/plugin_boundary.json`.
39
+
40
+ ## What build-loop posts
41
+
42
+ Every cross-session signal goes through `scripts/rally_point/post.py::post()` (the canonical writer that bumps revision *before* appending — see [`agent-rally-point/docs/SCHEMA.md`](https://github.com/tyroneross/agent-rally-point/blob/main/docs/SCHEMA.md) for the field-by-field record format). Raw `append_change(...)` without a subsequent `bump_revision(...)` is a silent-no-op for peers (`feedback_codex_pass_is_gate_not_comment`).
43
+
44
+ | When | `kind` | `payload` shape | Triggered by |
45
+ |---------------------------------------|--------------|------------------------------------------------------------------|------------------------------------|
46
+ | Chunk closes and lands on the branch | `phase` | `{phase: "chunk-close", chunk_id, commit_sha, files_changed}` | Phase 3 commit step |
47
+ | Phase boundary (Phase 1, 4, 5) | `phase` | `{phase: "<phase-name>", summary, ...}` | Orchestrator phase entry |
48
+ | Build run closes (Phase D) | `phase` | `{phase: "run-closeout", session_id, coord_file, outcomes}` | Phase D closeout sequence |
49
+ | Peer hands off work to a verifier | `handoff` | `{from_tool, to_tool, work_item, deadline_ts}` | Sub-step F when a peer is present |
50
+ | Verifier returns a verdict | `feedback` | `{step, verdict: PASS|VARIANCE|BLOCKED, rationale, evidence}` | After verifier runs on a step |
51
+ | Architecture scan completes | `arch-scan-complete` | `{digest_path, files_scanned}` | Phase 1 architecture baseline |
52
+ | Dependency manifest changed | `dep-change` | `{manifest, added, removed, session_id}` | Phase 3 commit step on manifest |
53
+ | Coordination announcement / take-over | `phase` | `{phase: "leadership", role, scope}` | Multi-orchestrator handoff |
54
+
55
+ All writes are fire-and-forget — a coordination failure must never crash the build.
56
+
57
+ ## What build-loop reads
58
+
59
+ ### Phase 1 Assess — inbox pickup + presence check
60
+
61
+ At Phase 1 entry, the orchestrator (see `agents/build-orchestrator.md` §"Phase 1: Assess") runs:
62
+
63
+ ```bash
64
+ python3 scripts/coordination_status.py --workdir "$PWD" --session-id "$SESSION_ID" --json
65
+ ```
66
+
67
+ The status reports: active peers (live sessions in the channel's `sessions/`), session-ack-aware unread inbox messages (`inbox/<my-tool>.jsonl`, `inbox/all.jsonl`), task-heartbeat health when `--task-ref` is set, and any active coordination file. If `active_peers > 0` OR `inbox_unread_count > 0`, the orchestrator MUST drain the inbox before dispatching any chunk; otherwise the peer's last verdict/handoff is invisible to the new run. After acting on the inbox payload, run `python3 scripts/agent_rally.py ack-inbox --workdir "$PWD" --session-id "$SESSION_ID" --tool "$TOOL_ID" --json` so stale notes stop ringing the doorbell.
68
+
69
+ ### Coordination polling gate — watcher install when a peer is present
70
+
71
+ When the Phase 1 status returns peers, build-loop installs a cheap continuous watcher:
72
+
73
+ ```bash
74
+ python3 scripts/coordination_watch.py --workdir "$PWD" --session-id "$SESSION_ID" --tool claude_code --task-ref "$TASK_REF" --interval 5 --jsonl --baseline-current
75
+ ```
76
+
77
+ The watcher reports revision changes, inbox deltas, and task-heartbeat health as line-delimited JSON. The orchestrator polls it before commits, before final responses, and after any 30-second work interval. When a peer posts (e.g. a verifier returns a `feedback` verdict), the orchestrator routes the response into the active coordination file's "Codex feedback log" section rather than asking the user to paste it.
78
+
79
+ For long-running work, write `agent_rally.py heartbeat --task-ref "$TASK_REF"`
80
+ at task start and at least every 10 minutes. Presence says the session is live;
81
+ task heartbeat says it is still on the claimed task.
82
+
83
+ The watcher process is OPTIONAL — if the daemon process can't start (no FS-watch support, sandboxed environment), the orchestrator falls back to per-checkpoint `coordination_status.py` polls. The same flow works; latency is higher.
84
+
85
+ ### Chunk-close — checkpoint read for downstream chunks
86
+
87
+ After each chunk's commit step closes, the orchestrator runs `checkpoint_read` against this session's cursor to surface any peer events that landed during the chunk. Reactions (`reinstall`, `re-baseline`, `soft-claim`) are documented in [`agent-rally-point/docs/SCHEMA.md`](https://github.com/tyroneross/agent-rally-point/blob/main/docs/SCHEMA.md). Reactions are **awareness only** — `soft-claim` warns when a peer touched files this session also plans to touch; the orchestrator decides whether to wait, rebase, or proceed.
88
+
89
+ ## Peer-no-mutate rule
90
+
91
+ When a peer presence record indicates active work AND that work isn't already merged (`branch_merge_status: unmerged` AND files differ from `origin/main`), build-loop's orchestrator MUST NOT modify the same files. The rule and the merge-status pre-check are in [`references/coordination-rules.md`](../../../references/coordination-rules.md) §"Peer-no-mutate" and `feedback_verify_peer_merged_before_blocking`.
92
+
93
+ Read-only operations (Phase 1 architecture baseline, plan drafting, fact-check) are always safe and do not invoke the rule.
94
+
95
+ ## Embedded mini-plugin boundary
96
+
97
+ For now, the Rally Point substrate and watcher still ship inside the
98
+ build-loop plugin, but they are treated as embedded mini-plugins with
99
+ explicit extraction edges:
100
+
101
+ | Future plugin | Embedded namespace | Build-loop compatibility entrypoints |
102
+ |---|---|---|
103
+ | `agent-rally-point` | `scripts/rally_point/**` | `scripts/agent_rally.py`, `commands/agent-rally-point.md`, `hooks/*rally-point.sh`, `scripts/coordination_status.py`, `scripts/coordination_rally.py`, `scripts/coordination_bootstrap.py` |
104
+ | `agent-rally-watcher` | `scripts/agent_rally_watcher/**` | `scripts/coordination_watch.py` |
105
+
106
+ The machine-readable contract lives at
107
+ `scripts/rally_point/plugin_boundary.json` and is validated by:
108
+
109
+ ```bash
110
+ python3 scripts/rally_point/boundary.py --repo "$PWD" --check --json
111
+ python3 scripts/agent_rally.py boundary --workdir "$PWD" --check --json
112
+ ```
113
+
114
+ Boundary rule: put substrate behavior in `scripts/rally_point/**`, watcher
115
+ behavior in `scripts/agent_rally_watcher/**`, and leave build-loop files as
116
+ thin adapters. Do not import build-loop memory-store or orchestration internals
117
+ from those namespaces unless the dependency is explicitly isolated as an
118
+ adapter in the boundary manifest.
119
+
120
+ ## Discovery integration (current)
121
+
122
+ Build-loop uses `scripts/rally_point/discovery_bridge.py` as the shared
123
+ channel resolver. It prefers the standalone `agent-rally-point` discovery
124
+ surface when installed and falls back to build-loop's embedded resolver only
125
+ when needed. Both native discovery and the embedded fallback default to
126
+ `~/.agent-rally-point/apps/...`; the fallback uses the local worktree-aware
127
+ `<slug>` when no native `<repo-id>` is available.
128
+
129
+ The discovery layer (see
130
+ [`agent-rally-point/docs/DISCOVERY.md`](https://github.com/tyroneross/agent-rally-point/blob/main/docs/DISCOVERY.md))
131
+ provides:
132
+
133
+ ```python
134
+ from agent_rally_point.discover import discover
135
+ info = discover() # returns dict with channel_dir, channel_layout, active_revision, active_peers, ...
136
+ channel_dir = info["channel_dir"] # canonical OR legacy-fallback path
137
+ ```
138
+
139
+ Current build-loop callers route through the bridge:
140
+
141
+ 1. `scripts/agent_rally.py` resolves `where`, `presence`, `handoff`, `lead`,
142
+ and `boundary` through the shared namespace.
143
+ 2. `scripts/coordination_status.py` reads status from the resolved channel
144
+ instead of deriving a parallel channel path.
145
+ 3. `scripts/rally_point/session_probe.py` and `scripts/rally_point/hooks.py`
146
+ use the resolved channel for session-start and pre-edit hook behavior.
147
+ 4. `scripts/coordination_watch.py` remains a compatibility wrapper; watcher
148
+ behavior lives under `scripts/agent_rally_watcher/`.
149
+
150
+ ## Cross-references
151
+
152
+ - **Substrate (channel format, post API, presence, lifecycle)** — [`agent-rally-point/ARCHITECTURE.md`](https://github.com/tyroneross/agent-rally-point/blob/main/ARCHITECTURE.md)
153
+ - **Record schema (all 6 kinds + payloads)** — [`agent-rally-point/docs/SCHEMA.md`](https://github.com/tyroneross/agent-rally-point/blob/main/docs/SCHEMA.md)
154
+ - **Discovery protocol (manifest, CLI, `discover()`)** — [`agent-rally-point/docs/DISCOVERY.md`](https://github.com/tyroneross/agent-rally-point/blob/main/docs/DISCOVERY.md)
155
+ - **Push-based daemon (consumers.toml, sinks)** — [`agent-rally-watcher/ARCHITECTURE.md`](https://github.com/tyroneross/agent-rally-watcher/blob/main/ARCHITECTURE.md)
156
+ - **Binding constitution (verdicts gating, MECE briefs, Phase D closeout)** — [`references/coordination-rules.md`](../../../references/coordination-rules.md)
157
+ - **Per-run coordination file template** — [`references/coordination-file-template.md`](../../../references/coordination-file-template.md)
158
+
159
+ ## Why a separate doc
160
+
161
+ `coordination-rules.md` is the binding *constitution* — operating rule, verdict gating, MECE field list, closeout sequence. This file is the *integration map* — where build-loop sits in the three-layer architecture, what it posts, what it reads, where the path-hardcoding lives, and what the discovery migration looks like. Conceptually distinct audiences: the rules file is for any participant; this file is for build-loop's orchestrator and anyone modifying how build-loop talks to rally-point.
@@ -0,0 +1,177 @@
1
+ <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
+
3
+ # Correction-aware lesson capture — three-tier design
4
+
5
+ ## Why
6
+
7
+ Two gaps in the prior capture stack:
8
+
9
+ 1. **`scan_transcript_for_decisions.py` no-ops entirely without Ollama.**
10
+ The script gates on `shutil.which("ollama")`; absent the binary, an
11
+ entire session's worth of decisions is silently dropped.
12
+ 2. **No lessons / feedback lane from live conversation.** The decisions
13
+ scanner captures decisions only. A user correcting the assistant's
14
+ just-taken action — the highest-signal lesson event in a session —
15
+ had no trigger and no destination.
16
+
17
+ The three-tier design closes both gaps without disrupting the existing
18
+ decisions pipeline.
19
+
20
+ ## Three tiers
21
+
22
+ ### Tier 1 — Deterministic Stop-hook (always runs, no LLM)
23
+
24
+ **Script:** `scripts/scan_corrections/`
25
+ **Hook:** `hooks/hooks.json` Stop entry, fires alongside (not instead of)
26
+ the decisions scanner.
27
+
28
+ Detects three classes of high-signal patterns in USER turns:
29
+
30
+ | Class | Patterns | Confidence |
31
+ |---|---|---|
32
+ | Correction | `revert that`, `don't X`, `undo`, `stop X`, `back that out`, `wrong approach` | `confirmed` (extra: `prior_assistant_acted: true` when assistant just used tools) |
33
+ | Preference | `always X`, `never X`, `must X`, `default to X`, `we use X for Y`, `prefer X` | `confirmed` |
34
+ | Tradeoff | `X instead of Y`, `actually X not Y`, `X over Y because Z` | `confirmed` |
35
+
36
+ Scope routing: keywords like `across projects`, `globally`, `for all projects`,
37
+ `as a rule`, `standing rule` flag the candidate as `scope: global` (otherwise
38
+ `project`). Anti-false-positive: wh-question turns ending in `?` are skipped
39
+ by hard-skip patterns; greetings/thanks/ok are skipped.
40
+
41
+ Writes one `.build-loop/pending-lessons/<ts>-<kind>-<id>.md` per candidate
42
+ with YAML frontmatter:
43
+
44
+ ```yaml
45
+ ---
46
+ id: <16-char sha1>
47
+ kind: correction|preference|tradeoff
48
+ signal_type: <named pattern>
49
+ confidence: confirmed
50
+ scope: project|global
51
+ turn_index: <int>
52
+ captured_chars: <int>
53
+ tier: 1-deterministic
54
+ source: stop-hook
55
+ captured_at: <iso8601>
56
+ extras:
57
+ prior_assistant_acted: true|false
58
+ ---
59
+
60
+ ## Quote
61
+ > <verbatim user span>
62
+
63
+ ## Context (±200 chars)
64
+ ```
65
+
66
+ Idempotent: `id_hash` is a SHA-1 of (kind, signal_type, normalized quote),
67
+ so re-running the scanner on the same transcript does not duplicate files.
68
+ Promoted/discarded subdirs are also checked for dedup.
69
+
70
+ Fail-open contract: any exception logs to stderr and exits 0. The
71
+ `.build-loop/.no-capture` opt-out short-circuits before any work.
72
+ `SCAN_CORRECTIONS_BUDGET_S` (default 10s) caps wall-clock.
73
+
74
+ ### Tier 2 — Optional Ollama accelerator (existing path, unchanged)
75
+
76
+ **Script:** `scripts/scan_transcript_for_decisions.py` (the existing
77
+ decisions scanner, untouched). When Ollama is installed AND the
78
+ transcript is large enough to benefit from clustering, this path
79
+ distills/dedups decisions and writes to
80
+ `build-loop-memory/projects/<slug>/decisions/` (or `_review/` for
81
+ quarantine).
82
+
83
+ Tier 2 is **strictly optional**. The user installed Ollama on this
84
+ machine, so it runs; on a fresh machine without Ollama, tier 1 alone
85
+ guarantees capture and the session continues uninterrupted.
86
+
87
+ ### Tier 3 — Host-agent refinement (the primary intelligence)
88
+
89
+ **Script:** `scripts/surface_pending_lessons.py`
90
+ **Consumed by:** the host coding agent (Claude Code in this build,
91
+ Codex on a Codex host, etc.) at SessionStart.
92
+
93
+ Per the user's standing "host-agent-is-the-LLM" rule, the host coding
94
+ agent is the primary refinement layer. Each session, the host reads
95
+ `.build-loop/pending-lessons/` (and optionally
96
+ `build-loop-memory/projects/<slug>/decisions/_review/`), classifies each
97
+ candidate, and promotes via:
98
+
99
+ - `scripts/memory_writer.py` — for `kind=lesson|feedback|preference`
100
+ (routes to `build-loop-memory/lessons/` for `scope=global` or
101
+ `build-loop-memory/projects/<slug>/lessons/` for `scope=project`)
102
+ - `scripts/write_decision/__main__.py` — for `kind=decision`
103
+
104
+ Discarded candidates move into
105
+ `.build-loop/pending-lessons/discarded/` (any file there is silently
106
+ skipped on re-runs, so the discard is durable).
107
+
108
+ The same surface also exposes the existing Ollama `_review/` quarantine
109
+ when `--include-decisions-review` is set, so the host agent has one
110
+ queue to drain.
111
+
112
+ ## Store bridge (harness ↔ build-loop-memory)
113
+
114
+ **Script:** `scripts/bridge_lesson_to_harness.py`
115
+
116
+ Once a lesson lands in build-loop-memory (via tier-3 promotion or any
117
+ other path), it can be mirrored into the harness auto-memory store the
118
+ host coding agent auto-loads at session start
119
+ (`~/.claude/projects/-Users-<u>/memory/`). The bridge:
120
+
121
+ - Resolves a deterministic target basename `<kind>_<slug>.md` matching
122
+ the harness convention
123
+ - Augments the bridged copy's frontmatter with `bridged_from`,
124
+ `bridged_at`, `source_store: build-loop-memory`
125
+ - Appends a one-line entry to harness `MEMORY.md` under
126
+ `## Bridged from build-loop-memory` (creates the section if absent;
127
+ preserves other sections; dedup'd on target basename)
128
+
129
+ Idempotent and reversible. Only `lesson | feedback | preference | convention | gotcha`
130
+ types bridge; decisions stay in their own canonical store.
131
+
132
+ ## Triggers — what fires when
133
+
134
+ | Event | Tier | Effect |
135
+ |---|---|---|
136
+ | Session ends (Stop hook) | 1 | tier-1 scanner writes raw candidates to `.build-loop/pending-lessons/` |
137
+ | Session ends (Stop hook) | 2 | tier-2 scanner (Ollama, if present) writes distilled decisions |
138
+ | Session starts (host agent reads context-bootstrap) | 3 | pending-lessons queue count surfaces in queue summary; host agent runs `surface_pending_lessons.py` to refine |
139
+ | Lesson promoted to build-loop-memory | — | `bridge_lesson_to_harness.py` mirrors to harness auto-memory |
140
+
141
+ ## File layout summary
142
+
143
+ ```
144
+ scripts/
145
+ scan_corrections/
146
+ __init__.py
147
+ detect.py — patterns + Candidate dataclass + JSONL parser
148
+ __main__.py — Stop-hook CLI (tier 1)
149
+ test_detect.py — 26 unit tests
150
+ test_cli.py — 8 CLI integration tests
151
+ surface_pending_lessons.py — tier 3 host-agent surface
152
+ test_surface_pending_lessons.py — 10 tests
153
+ bridge_lesson_to_harness.py — store bridge
154
+ test_bridge_lesson_to_harness.py — 11 tests
155
+ scan_transcript_for_decisions.py — UNCHANGED (tier 2)
156
+
157
+ hooks/hooks.json — Stop hook now runs both scanners in parallel
158
+
159
+ scripts/context_bootstrap.py — QUEUE_NAMES extended with "pending-lessons"
160
+
161
+ .build-loop/pending-lessons/ — tier-1 candidate queue (this run)
162
+ /promoted/ — host-agent promoted (silenced)
163
+ /discarded/ — host-agent discarded (silenced)
164
+ ```
165
+
166
+ ## Non-goals + tradeoffs
167
+
168
+ - **Not a replacement for `auto-decision-capture`.** That skill is for
169
+ the host agent's in-session reasoning — explicit captures during the
170
+ conversation. Tier-1 + tier-3 fire at session boundaries; the skill
171
+ fires inline. They compose.
172
+ - **Tier 1 is intentionally narrow.** Adding fuzzy patterns would
173
+ produce false positives. The host agent (tier 3) is where ambiguous
174
+ cases get judged — that's the design intent of "host-agent-is-the-LLM."
175
+ - **Bridge runs on demand, not automatically.** A future enhancement
176
+ could fire it via a post-promotion hook; the durable lesson lives in
177
+ build-loop-memory either way, and the bridge is reversible.
@@ -0,0 +1,72 @@
1
+ <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> -->
2
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
3
+
4
+ # Independent Commit Auditor
5
+
6
+ Single source of truth for build-loop commit/build-scope adversarial review. **Consolidated 2026-05-23** — replaces both the retired `commit-auditor` agent (chunk + build scope) and the earlier retired `sonnet-critic`. Operates on two surfaces sharing one context-gathering procedure and one verdict taxonomy:
7
+
8
+ 1. **Boundary-gated hook (every commit).** A PreToolUse Bash hook in `hooks/hooks.json` invokes `scripts/audit_before_commit.py` whenever the Bash tool runs a command matching `git commit`. The orchestrator cannot skip it. Manual user commits, Codex commits, IDE commits, and build-loop commits all pass through it.
9
+ 2. **Self-contextualizing.** The script gathers its own context from on-disk `.build-loop/intent.md`, `.build-loop/goal.md`, repo `CLAUDE.md` + `README.md`, the first PRD found (`docs/PRD.md` -> `docs/prd.md` -> `docs/prd/*.md` -> `.build-loop/prd.md`), canonical build-loop-memory constitution context, and the last 5 commit subjects. No upstream packet needed.
10
+ 3. **LLM-grade dispatched agent.** The `independent-auditor` agent (`agents/independent-auditor.md`) is dispatched at Phase 3 chunk-close (chunk advisory) and Phase 4 Review-A (build scope). Same context procedure as the hook, plus diff range — emits a structured JSON envelope. Verdict rendered in conversation by the running Claude session.
11
+
12
+ ## Four-verdict taxonomy
13
+
14
+ - **yay (approve)** — packet aligns with intent + constitution; ship.
15
+ - **nay (reject)** — packet contradicts intent or trips a constitution rule; do not land.
16
+ - **suggest correction** — partial alignment; name file:line edits the implementer should make before re-committing.
17
+ - **look again** — context insufficient to judge; name the missing artifact (PRD section, prior decision, test result) and gather it.
18
+
19
+ ## When the hook fires
20
+
21
+ Every Bash tool invocation whose command matches `\bgit\s+commit\b`. The hook timeout is 5000ms; the script is fast (no LLM call, no network). It runs at the Bash boundary, so it fires before the commit lands — the running session can short-circuit by not actually committing if the packet shows a contradiction.
22
+
23
+ ## Exit codes
24
+
25
+ | Code | Meaning | Caller behavior |
26
+ |---|---|---|
27
+ | 0 | Packet emitted, no deterministic block | Commit proceeds; running session renders a verdict in chat |
28
+ | 2 | Deterministic block (secrets file staged, merge-conflict markers in diff) | Caller / hook framework signals the commit should not proceed |
29
+ | 1 | Reserved | — |
30
+
31
+ Deterministic blocks are zero-judgment hard fails (filenames matching `*.pem` / `id_rsa*` / `id_ed25519*`, `.env*` files with credential-shaped content, or `<<<<<<< HEAD` / `=======` / `>>>>>>>` markers in the staged diff).
32
+
33
+ ## Bypass
34
+
35
+ Emergency commits can bypass the audit by setting `BUILDLOOP_AUDIT_BYPASS=1` in the environment:
36
+
37
+ ```bash
38
+ BUILDLOOP_AUDIT_BYPASS=1 git commit -m "emergency hotfix"
39
+ ```
40
+
41
+ Each bypass is logged to `~/.build-loop/audit-bypass.log` with timestamp + cwd + reason. Bypasses are valid but visible — Phase 6 Learn can mine the log for chronic-bypass patterns.
42
+
43
+ ## Dispatched-agent surface
44
+
45
+ For LLM-grade judgment on a specific commit or commit range, dispatch `Agent(subagent_type="build-loop:independent-auditor", ...)`. The agent uses the same context-gathering procedure as the script and renders a structured JSON envelope (with explicit `context_seen` flags and `missing_artifacts[]`). The agent is Sonnet-tier; use it for per-chunk advisory, cross-chunk reviews, and Phase 4 Review-A build-scope critique.
46
+
47
+ ## Dispatch ladder & `auditor_status` — the LLM auditor is never silently skipped (GAP-1)
48
+
49
+ `Agent(subagent_type=...)` only works from a context that HAS the Agent tool. When the build-loop **orchestrator itself runs as a nested subagent** (dispatched via the Agent tool as `build-loop:build-orchestrator`, or running per-commit mode), the harness blocks sub-subagents — so that orchestrator **cannot** dispatch this agent. The historical defect (2026-06-06 IBR retro): the nested orchestrator silently fell back to inline self-reasoning and reported "independent-auditor ran inline", which rubber-stamped a HIGH cookie-leak + 2 MEDIUM findings that a real dispatch later caught. **Inline self-audit is not the independent auditor.**
50
+
51
+ There are exactly **three honest ways a real auditor verdict enters `judge_decisions[]`**, and one honest "didn't run" signal:
52
+
53
+ | `auditor_status` | How the verdict was produced | `judge_id` written |
54
+ |---|---|---|
55
+ | `ran:dispatched-agent` | `Agent(subagent_type="build-loop:independent-auditor")` — Agent tool present (top-level / Mode A) | `independent-auditor` |
56
+ | `ran:peer-host(<host>)` | Auditor run as a peer process (rally channel / `codex exec`) — used when the orchestrator is nested but a peer host is reachable (Bash survives nesting) | `independent-auditor` |
57
+ | (hook) | The PreToolUse boundary hook `scripts/audit_before_commit.py` | `independent-auditor-hook` |
58
+ | `not-run:parent-must-dispatch` / `cross-vendor-deferred` | No Agent tool AND no peer host could execute. **No `independent-auditor`-labeled verdict is written.** | — |
59
+
60
+ **Never-masquerade rule:** do not write a `judge_id` containing `independent-auditor` for inline orchestrator reasoning. If neither a dispatched agent, a peer-host process, nor the hook produced a verdict, the only honest record is `auditor_status: not-run:parent-must-dispatch` in the orchestrator's return envelope — never a fabricated verdict. A `not-run` run is **not review-complete**: the dispatching parent (which has the Agent tool) owes the audit before Report. Full ladder + parent-dispatch contract in `phase-4-review.md` §"Sub-step A"; the structural backstop is `scripts/write_run_entry` (`review_completeness_error` → exit 3 on a `scope=build` code-touching `pass` that lacks a real auditor verdict).
61
+
62
+ ## How the running session should interpret a packet
63
+
64
+ When a Bash `git commit` returns with the packet appended to stderr:
65
+
66
+ 1. **Read the packet sections** (Intent, Goal, PRD reference, Trajectory, etc.).
67
+ 2. **Pick a verdict** explicitly in your next assistant message — the user (and any audit-trail tooling) needs to see the verdict named, not implied.
68
+ 3. **If `yay`**, no further action — the commit is in.
69
+ 4. **If `nay` or `suggest correction`**, do not push. State which finding triggered the verdict and either revert (`git reset HEAD~1`) or make the suggested edits and amend.
70
+ 5. **If `look again`**, gather the missing artifact (read the PRD section, dispatch the escalation agent, etc.) and re-render the verdict.
71
+
72
+ The verdict belongs in the running session's transcript so future readers (and Phase 6 Learn) can see what the auditor saw and what the operator did with it.