@pennyfarthing/core 11.2.0 → 11.2.2

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 (367) hide show
  1. package/README.md +100 -40
  2. package/package.json +2 -1
  3. package/packages/core/dist/cli/commands/doctor.d.ts.map +1 -1
  4. package/packages/core/dist/cli/commands/doctor.js +474 -66
  5. package/packages/core/dist/cli/commands/doctor.js.map +1 -1
  6. package/packages/core/dist/cli/commands/init.js +4 -4
  7. package/packages/core/dist/cli/commands/init.js.map +1 -1
  8. package/packages/core/dist/cli/commands/update.d.ts.map +1 -1
  9. package/packages/core/dist/cli/commands/update.js +4 -5
  10. package/packages/core/dist/cli/commands/update.js.map +1 -1
  11. package/packages/core/dist/cli/utils/constants.d.ts +3 -8
  12. package/packages/core/dist/cli/utils/constants.d.ts.map +1 -1
  13. package/packages/core/dist/cli/utils/constants.js +3 -4
  14. package/packages/core/dist/cli/utils/constants.js.map +1 -1
  15. package/packages/core/dist/cli/utils/settings.d.ts +7 -0
  16. package/packages/core/dist/cli/utils/settings.d.ts.map +1 -1
  17. package/packages/core/dist/cli/utils/settings.js +70 -29
  18. package/packages/core/dist/cli/utils/settings.js.map +1 -1
  19. package/packages/core/dist/cli/utils/symlinks.js +16 -16
  20. package/packages/core/dist/cli/utils/symlinks.js.map +1 -1
  21. package/packages/core/dist/consultation/dialogue-manager.d.ts +1 -1
  22. package/packages/core/dist/consultation/dialogue-manager.d.ts.map +1 -1
  23. package/packages/core/dist/consultation/dialogue-manager.js +1 -1
  24. package/packages/core/dist/consultation/dialogue-manager.js.map +1 -1
  25. package/packages/core/dist/consultation/dialogue-manager.test.js.map +1 -1
  26. package/packages/core/dist/consultation/tandem-metrics.d.ts +91 -0
  27. package/packages/core/dist/consultation/tandem-metrics.d.ts.map +1 -0
  28. package/packages/core/dist/consultation/tandem-metrics.js +131 -0
  29. package/packages/core/dist/consultation/tandem-metrics.js.map +1 -0
  30. package/packages/core/dist/consultation/tandem-metrics.test.d.ts +18 -0
  31. package/packages/core/dist/consultation/tandem-metrics.test.d.ts.map +1 -0
  32. package/packages/core/dist/consultation/tandem-metrics.test.js +457 -0
  33. package/packages/core/dist/consultation/tandem-metrics.test.js.map +1 -0
  34. package/packages/core/dist/public/css/react.css +1 -1
  35. package/packages/core/dist/public/js/react/react.js +14 -14
  36. package/packages/core/dist/server/api/agent-load.js +1 -1
  37. package/packages/core/dist/server/api/agent-load.js.map +1 -1
  38. package/packages/core/dist/server/api/git.d.ts.map +1 -1
  39. package/packages/core/dist/server/api/git.js +0 -1
  40. package/packages/core/dist/server/api/git.js.map +1 -1
  41. package/packages/core/dist/server/api/index.d.ts +2 -0
  42. package/packages/core/dist/server/api/index.d.ts.map +1 -1
  43. package/packages/core/dist/server/api/index.js +2 -0
  44. package/packages/core/dist/server/api/index.js.map +1 -1
  45. package/packages/core/dist/server/api/project-info.d.ts +11 -0
  46. package/packages/core/dist/server/api/project-info.d.ts.map +1 -0
  47. package/packages/core/dist/server/api/project-info.js +18 -0
  48. package/packages/core/dist/server/api/project-info.js.map +1 -0
  49. package/packages/core/dist/server/otlp-receiver.d.ts.map +1 -1
  50. package/packages/core/dist/server/otlp-receiver.js +18 -1
  51. package/packages/core/dist/server/otlp-receiver.js.map +1 -1
  52. package/packages/core/dist/server/otlp-receiver.test.js +1 -1
  53. package/packages/core/dist/server/otlp-receiver.test.js.map +1 -1
  54. package/packages/core/dist/server/server.d.ts +0 -3
  55. package/packages/core/dist/server/server.d.ts.map +1 -1
  56. package/packages/core/dist/server/server.js +5 -38
  57. package/packages/core/dist/server/server.js.map +1 -1
  58. package/packages/core/dist/server/server.test.d.ts +1 -1
  59. package/packages/core/dist/server/server.test.js +12 -23
  60. package/packages/core/dist/server/server.test.js.map +1 -1
  61. package/packages/core/dist/server/settings.d.ts +1 -0
  62. package/packages/core/dist/server/settings.d.ts.map +1 -1
  63. package/packages/core/dist/server/settings.js +13 -0
  64. package/packages/core/dist/server/settings.js.map +1 -1
  65. package/packages/core/dist/shared/capabilities.d.ts +88 -0
  66. package/packages/core/dist/shared/capabilities.d.ts.map +1 -0
  67. package/packages/core/dist/shared/capabilities.js +133 -0
  68. package/packages/core/dist/shared/capabilities.js.map +1 -0
  69. package/packages/core/dist/shared/capabilities.test.d.ts +2 -0
  70. package/packages/core/dist/shared/capabilities.test.d.ts.map +1 -0
  71. package/packages/core/dist/shared/capabilities.test.js +217 -0
  72. package/packages/core/dist/shared/capabilities.test.js.map +1 -0
  73. package/packages/core/dist/shared/spawn-prompt.d.ts +47 -0
  74. package/packages/core/dist/shared/spawn-prompt.d.ts.map +1 -0
  75. package/packages/core/dist/shared/spawn-prompt.js +82 -0
  76. package/packages/core/dist/shared/spawn-prompt.js.map +1 -0
  77. package/packages/core/dist/shared/spawn-prompt.test.d.ts +2 -0
  78. package/packages/core/dist/shared/spawn-prompt.test.d.ts.map +1 -0
  79. package/packages/core/dist/shared/spawn-prompt.test.js +251 -0
  80. package/packages/core/dist/shared/spawn-prompt.test.js.map +1 -0
  81. package/packages/core/dist/workflow/tandem-workflow-templates.test.d.ts +18 -0
  82. package/packages/core/dist/workflow/tandem-workflow-templates.test.d.ts.map +1 -0
  83. package/packages/core/dist/workflow/tandem-workflow-templates.test.js +434 -0
  84. package/packages/core/dist/workflow/tandem-workflow-templates.test.js.map +1 -0
  85. package/packages/core/dist/workflow/team-lifecycle.d.ts +169 -0
  86. package/packages/core/dist/workflow/team-lifecycle.d.ts.map +1 -0
  87. package/packages/core/dist/workflow/team-lifecycle.js +217 -0
  88. package/packages/core/dist/workflow/team-lifecycle.js.map +1 -0
  89. package/packages/core/dist/workflow/team-lifecycle.test.d.ts +20 -0
  90. package/packages/core/dist/workflow/team-lifecycle.test.d.ts.map +1 -0
  91. package/packages/core/dist/workflow/team-lifecycle.test.js +966 -0
  92. package/packages/core/dist/workflow/team-lifecycle.test.js.map +1 -0
  93. package/packages/core/dist/workflow/workflow-schema.d.ts +32 -0
  94. package/packages/core/dist/workflow/workflow-schema.d.ts.map +1 -1
  95. package/packages/core/dist/workflow/workflow-schema.js +120 -0
  96. package/packages/core/dist/workflow/workflow-schema.js.map +1 -1
  97. package/packages/core/dist/workflow/workflow-schema.test.d.ts.map +1 -1
  98. package/packages/core/dist/workflow/workflow-schema.test.js +570 -1
  99. package/packages/core/dist/workflow/workflow-schema.test.js.map +1 -1
  100. package/packages/core/dist/workflow/workflow-team-templates.test.d.ts +17 -0
  101. package/packages/core/dist/workflow/workflow-team-templates.test.d.ts.map +1 -0
  102. package/packages/core/dist/workflow/workflow-team-templates.test.js +275 -0
  103. package/packages/core/dist/workflow/workflow-team-templates.test.js.map +1 -0
  104. package/pennyfarthing-dist/agents/dev.md +21 -12
  105. package/pennyfarthing-dist/agents/reviewer.md +23 -4
  106. package/pennyfarthing-dist/agents/sm-finish.md +19 -2
  107. package/pennyfarthing-dist/agents/sm-setup.md +7 -7
  108. package/pennyfarthing-dist/agents/sm.md +12 -12
  109. package/pennyfarthing-dist/agents/tea.md +2 -2
  110. package/pennyfarthing-dist/agents/testing-runner.md +1 -1
  111. package/pennyfarthing-dist/commands/pf-architect.md +1 -1
  112. package/pennyfarthing-dist/commands/pf-ba.md +1 -1
  113. package/pennyfarthing-dist/commands/pf-chore.md +2 -2
  114. package/pennyfarthing-dist/commands/pf-dev.md +1 -1
  115. package/pennyfarthing-dist/commands/pf-devops.md +1 -1
  116. package/pennyfarthing-dist/commands/pf-epic.md +6 -6
  117. package/pennyfarthing-dist/commands/pf-git.md +12 -10
  118. package/pennyfarthing-dist/commands/pf-health-check.md +1 -1
  119. package/pennyfarthing-dist/commands/pf-help.md +12 -12
  120. package/pennyfarthing-dist/commands/pf-orchestrator.md +1 -1
  121. package/pennyfarthing-dist/commands/pf-pm.md +1 -1
  122. package/pennyfarthing-dist/commands/pf-prime.md +8 -8
  123. package/pennyfarthing-dist/commands/pf-reviewer.md +1 -1
  124. package/pennyfarthing-dist/commands/pf-session.md +7 -7
  125. package/pennyfarthing-dist/commands/pf-sm.md +1 -1
  126. package/pennyfarthing-dist/commands/pf-sprint.md +7 -7
  127. package/pennyfarthing-dist/commands/pf-tea.md +1 -1
  128. package/pennyfarthing-dist/commands/pf-tech-writer.md +1 -1
  129. package/pennyfarthing-dist/commands/pf-theme.md +9 -9
  130. package/pennyfarthing-dist/commands/pf-ux-designer.md +1 -1
  131. package/pennyfarthing-dist/commands/pf-work.md +1 -1
  132. package/pennyfarthing-dist/gates/approval.md +63 -0
  133. package/pennyfarthing-dist/gates/confidence-sm.md +71 -0
  134. package/pennyfarthing-dist/gates/context-ok.md +56 -0
  135. package/pennyfarthing-dist/gates/evaluations/confidence-sm.md +54 -0
  136. package/pennyfarthing-dist/gates/quality-pass.md +67 -0
  137. package/pennyfarthing-dist/gates/tests-fail.md +84 -0
  138. package/pennyfarthing-dist/gates/tests-pass.md +79 -0
  139. package/pennyfarthing-dist/guides/agent-behavior.md +84 -29
  140. package/pennyfarthing-dist/guides/agent-coordination.md +10 -10
  141. package/pennyfarthing-dist/guides/agent-tag-taxonomy.md +6 -6
  142. package/pennyfarthing-dist/guides/agent-template-tactical.md +1 -1
  143. package/pennyfarthing-dist/guides/bell-mode.md +1 -1
  144. package/pennyfarthing-dist/guides/bikerack.md +10 -10
  145. package/pennyfarthing-dist/guides/brownfield-tools.md +24 -24
  146. package/pennyfarthing-dist/guides/command-tag-taxonomy.md +1 -1
  147. package/pennyfarthing-dist/guides/gate-schema.md +2 -2
  148. package/pennyfarthing-dist/guides/gates.md +3 -3
  149. package/pennyfarthing-dist/guides/handoff-cli.md +8 -8
  150. package/pennyfarthing-dist/guides/hooks.md +29 -29
  151. package/pennyfarthing-dist/guides/prime.md +2 -2
  152. package/pennyfarthing-dist/guides/reflector.md +1 -1
  153. package/pennyfarthing-dist/guides/skill-schema.md +6 -6
  154. package/pennyfarthing-dist/guides/tandem-protocol.md +3 -3
  155. package/pennyfarthing-dist/guides/workflow-schema.md +1 -1
  156. package/pennyfarthing-dist/guides/worktree-mode.md +3 -3
  157. package/pennyfarthing-dist/guides/xml-tags.md +8 -8
  158. package/pennyfarthing-dist/scripts/README.md +4 -4
  159. package/pennyfarthing-dist/scripts/core/agent-session.sh +2 -5
  160. package/pennyfarthing-dist/scripts/core/check-context.sh +3 -1
  161. package/pennyfarthing-dist/scripts/core/pf.sh +5 -0
  162. package/pennyfarthing-dist/scripts/core/phase-check-start.sh +4 -89
  163. package/pennyfarthing-dist/scripts/core/prime.sh +2 -25
  164. package/pennyfarthing-dist/scripts/git/README.md +14 -14
  165. package/pennyfarthing-dist/scripts/git/create-feature-branches.sh +2 -3
  166. package/pennyfarthing-dist/scripts/git/git-status-all.sh +2 -3
  167. package/pennyfarthing-dist/scripts/git/install-git-hooks.sh +2 -3
  168. package/pennyfarthing-dist/scripts/git/worktree-manager.sh +2 -4
  169. package/pennyfarthing-dist/scripts/hooks/README.md +6 -6
  170. package/pennyfarthing-dist/scripts/hooks/bell-mode-hook.sh +4 -183
  171. package/pennyfarthing-dist/scripts/hooks/context-circuit-breaker.sh +4 -95
  172. package/pennyfarthing-dist/scripts/hooks/context-warning.sh +4 -65
  173. package/pennyfarthing-dist/scripts/hooks/cyclist-pretooluse-hook.sh +3 -31
  174. package/pennyfarthing-dist/scripts/hooks/otel-auto-config.sh +5 -4
  175. package/pennyfarthing-dist/scripts/hooks/pre-commit.sh +29 -34
  176. package/pennyfarthing-dist/scripts/hooks/pre-edit-check.sh +4 -71
  177. package/pennyfarthing-dist/scripts/hooks/question-reflector-check.sh +3 -19
  178. package/pennyfarthing-dist/scripts/hooks/schema-validation.sh +4 -30
  179. package/pennyfarthing-dist/scripts/hooks/session-start.sh +3 -32
  180. package/pennyfarthing-dist/scripts/hooks/session-stop.sh +4 -65
  181. package/pennyfarthing-dist/scripts/hooks/sprint-yaml-validation.sh +4 -78
  182. package/pennyfarthing-dist/scripts/hooks/welcome-hook.sh +3 -93
  183. package/pennyfarthing-dist/scripts/lib/env.sh +34 -0
  184. package/pennyfarthing-dist/scripts/lib/run-pf.sh +39 -0
  185. package/pennyfarthing-dist/scripts/misc/README.md +1 -1
  186. package/pennyfarthing-dist/scripts/misc/statusline.sh +4 -301
  187. package/pennyfarthing-dist/scripts/sprint/README.md +21 -21
  188. package/pennyfarthing-dist/scripts/workflow/README.md +2 -2
  189. package/pennyfarthing-dist/scripts/workflow/finish-story.sh +2 -16
  190. package/pennyfarthing-dist/scripts/workflow/fix-session-phase.sh +3 -3
  191. package/pennyfarthing-dist/scripts/workflow/get-workflow-type.sh +3 -3
  192. package/pennyfarthing-dist/scripts/workflow/list-workflows.sh +3 -3
  193. package/pennyfarthing-dist/scripts/workflow/phase-owner.sh +3 -3
  194. package/pennyfarthing-dist/scripts/workflow/resume-workflow.sh +3 -3
  195. package/pennyfarthing-dist/scripts/workflow/show-workflow.sh +3 -3
  196. package/pennyfarthing-dist/scripts/workflow/start-workflow.sh +3 -3
  197. package/pennyfarthing-dist/scripts/workflow/workflow-status.sh +3 -3
  198. package/pennyfarthing-dist/skills/pf-bc/examples.md +23 -23
  199. package/pennyfarthing-dist/skills/pf-bc/skill.md +17 -17
  200. package/pennyfarthing-dist/skills/pf-bc/usage.md +8 -8
  201. package/pennyfarthing-dist/skills/pf-jira/SKILL.md +15 -15
  202. package/pennyfarthing-dist/skills/pf-jira/examples.md +48 -48
  203. package/pennyfarthing-dist/skills/pf-jira/usage.md +15 -15
  204. package/pennyfarthing-dist/skills/pf-sprint/examples.md +80 -80
  205. package/pennyfarthing-dist/skills/pf-sprint/skill.md +35 -35
  206. package/pennyfarthing-dist/skills/pf-sprint/usage.md +30 -30
  207. package/pennyfarthing-dist/skills/pf-theme/examples.md +15 -15
  208. package/pennyfarthing-dist/skills/pf-theme/skill.md +6 -6
  209. package/pennyfarthing-dist/skills/pf-theme/usage.md +5 -5
  210. package/pennyfarthing-dist/skills/pf-workflow/examples.md +27 -27
  211. package/pennyfarthing-dist/skills/pf-workflow/skill.md +11 -11
  212. package/pennyfarthing-dist/skills/pf-workflow/usage.md +11 -11
  213. package/pennyfarthing-dist/skills/skill-registry.yaml +19 -19
  214. package/pennyfarthing-dist/templates/settings.local.json.template +19 -10
  215. package/pennyfarthing-dist/workflows/bdd-team.yaml +89 -0
  216. package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-05-import-to-future.md +1 -1
  217. package/pennyfarthing-dist/workflows/git-cleanup/steps/step-01-analyze.md +1 -1
  218. package/pennyfarthing-dist/workflows/git-cleanup/steps/step-04-verify.md +1 -1
  219. package/pennyfarthing-dist/workflows/git-cleanup/steps/step-05-complete.md +1 -1
  220. package/pennyfarthing-dist/workflows/project-setup/steps/step-01-discover.md +47 -0
  221. package/pennyfarthing-dist/workflows/tdd-team.yaml +80 -0
  222. package/pennyfarthing-dist/workflows/tdd.yaml +11 -2
  223. package/pennyfarthing_scripts/CLAUDE.md +19 -10
  224. package/pennyfarthing_scripts/__init__.py +1 -1
  225. package/pennyfarthing_scripts/__pycache__/__init__.cpython-314.pyc +0 -0
  226. package/pennyfarthing_scripts/__pycache__/bellmode_hook.cpython-314.pyc +0 -0
  227. package/pennyfarthing_scripts/__pycache__/cli.cpython-314.pyc +0 -0
  228. package/pennyfarthing_scripts/__pycache__/context.cpython-314.pyc +0 -0
  229. package/pennyfarthing_scripts/__pycache__/hooks.cpython-314.pyc +0 -0
  230. package/pennyfarthing_scripts/__pycache__/pretooluse_hook.cpython-314.pyc +0 -0
  231. package/pennyfarthing_scripts/__pycache__/schema_validation_hook.cpython-314.pyc +0 -0
  232. package/pennyfarthing_scripts/__pycache__/session_start_hook.cpython-314.pyc +0 -0
  233. package/pennyfarthing_scripts/bc/__pycache__/cli.cpython-314.pyc +0 -0
  234. package/pennyfarthing_scripts/bc/__pycache__/focus.cpython-314.pyc +0 -0
  235. package/pennyfarthing_scripts/bc/__pycache__/split.cpython-314.pyc +0 -0
  236. package/pennyfarthing_scripts/bc/cli.py +2 -2
  237. package/pennyfarthing_scripts/bellmode_hook.py +9 -296
  238. package/pennyfarthing_scripts/bikerack/__pycache__/audit_log_panel.cpython-314.pyc +0 -0
  239. package/pennyfarthing_scripts/bikerack/__pycache__/background_panel.cpython-314.pyc +0 -0
  240. package/pennyfarthing_scripts/bikerack/__pycache__/base_panel.cpython-314.pyc +0 -0
  241. package/pennyfarthing_scripts/bikerack/__pycache__/changed_panel.cpython-314.pyc +0 -0
  242. package/pennyfarthing_scripts/bikerack/__pycache__/context_meter_footer.cpython-314.pyc +0 -0
  243. package/pennyfarthing_scripts/bikerack/__pycache__/debug_panel.cpython-314.pyc +0 -0
  244. package/pennyfarthing_scripts/bikerack/__pycache__/diffs_panel.cpython-314.pyc +0 -0
  245. package/pennyfarthing_scripts/bikerack/__pycache__/events.cpython-314.pyc +0 -0
  246. package/pennyfarthing_scripts/bikerack/__pycache__/git_panel.cpython-314.pyc +0 -0
  247. package/pennyfarthing_scripts/bikerack/__pycache__/launcher.cpython-314.pyc +0 -0
  248. package/pennyfarthing_scripts/bikerack/__pycache__/portrait_resolver.cpython-314.pyc +0 -0
  249. package/pennyfarthing_scripts/bikerack/__pycache__/progress_panel.cpython-314.pyc +0 -0
  250. package/pennyfarthing_scripts/bikerack/__pycache__/sprint_panel.cpython-314.pyc +0 -0
  251. package/pennyfarthing_scripts/bikerack/__pycache__/story_detail_data.cpython-314.pyc +0 -0
  252. package/pennyfarthing_scripts/bikerack/__pycache__/story_detail_screen.cpython-314.pyc +0 -0
  253. package/pennyfarthing_scripts/bikerack/__pycache__/tui.cpython-314.pyc +0 -0
  254. package/pennyfarthing_scripts/bikerack/__pycache__/ws_client.cpython-314.pyc +0 -0
  255. package/pennyfarthing_scripts/bikerack/audit_log_panel.py +161 -0
  256. package/pennyfarthing_scripts/bikerack/base_panel.py +27 -4
  257. package/pennyfarthing_scripts/bikerack/changed_panel.py +96 -4
  258. package/pennyfarthing_scripts/bikerack/context_meter_footer.py +88 -0
  259. package/pennyfarthing_scripts/bikerack/debug_panel.py +1 -1
  260. package/pennyfarthing_scripts/bikerack/diffs_panel.py +30 -0
  261. package/pennyfarthing_scripts/bikerack/events.py +28 -0
  262. package/pennyfarthing_scripts/bikerack/launcher.py +6 -6
  263. package/pennyfarthing_scripts/bikerack/portrait_resolver.py +139 -0
  264. package/pennyfarthing_scripts/bikerack/progress_panel.py +0 -1
  265. package/pennyfarthing_scripts/bikerack/sprint_panel.py +373 -142
  266. package/pennyfarthing_scripts/bikerack/story_detail_data.py +247 -0
  267. package/pennyfarthing_scripts/bikerack/story_detail_screen.py +177 -0
  268. package/pennyfarthing_scripts/bikerack/tui.py +304 -62
  269. package/pennyfarthing_scripts/bikerack/ws_client.py +2 -2
  270. package/pennyfarthing_scripts/cli.py +5 -0
  271. package/pennyfarthing_scripts/common/__pycache__/config.cpython-314.pyc +0 -0
  272. package/pennyfarthing_scripts/common/config.py +29 -2
  273. package/pennyfarthing_scripts/common/pr_config.py +38 -0
  274. package/pennyfarthing_scripts/consultation/__pycache__/__init__.cpython-314.pyc +0 -0
  275. package/pennyfarthing_scripts/consultation/__pycache__/cli.cpython-314.pyc +0 -0
  276. package/pennyfarthing_scripts/consultation/cli.py +3 -3
  277. package/pennyfarthing_scripts/context.py +3 -3
  278. package/pennyfarthing_scripts/git/__pycache__/__init__.cpython-314.pyc +0 -0
  279. package/pennyfarthing_scripts/git/__pycache__/create_branches.cpython-314.pyc +0 -0
  280. package/pennyfarthing_scripts/git/__pycache__/repos.cpython-314.pyc +0 -0
  281. package/pennyfarthing_scripts/git/__pycache__/status_all.cpython-314.pyc +0 -0
  282. package/pennyfarthing_scripts/git/hooks_installer.py +2 -3
  283. package/pennyfarthing_scripts/git/status_all.py +1 -1
  284. package/pennyfarthing_scripts/git/worktree.py +2 -2
  285. package/pennyfarthing_scripts/git_group/__pycache__/cli.cpython-314.pyc +0 -0
  286. package/pennyfarthing_scripts/handoff/__pycache__/cli.cpython-314.pyc +0 -0
  287. package/pennyfarthing_scripts/handoff/__pycache__/complete_phase.cpython-314.pyc +0 -0
  288. package/pennyfarthing_scripts/handoff/__pycache__/marker.cpython-314.pyc +0 -0
  289. package/pennyfarthing_scripts/handoff/__pycache__/phase_check.cpython-314.pyc +0 -0
  290. package/pennyfarthing_scripts/handoff/__pycache__/resolve_gate.cpython-314.pyc +0 -0
  291. package/pennyfarthing_scripts/handoff/cli.py +33 -1
  292. package/pennyfarthing_scripts/handoff/complete_phase.py +28 -0
  293. package/pennyfarthing_scripts/handoff/marker.py +15 -15
  294. package/pennyfarthing_scripts/handoff/phase_check.py +96 -0
  295. package/pennyfarthing_scripts/handoff/resolve_gate.py +13 -1
  296. package/pennyfarthing_scripts/hooks/__init__.py +442 -0
  297. package/pennyfarthing_scripts/hooks/__pycache__/__init__.cpython-314.pyc +0 -0
  298. package/pennyfarthing_scripts/hooks/__pycache__/bell_mode.cpython-314.pyc +0 -0
  299. package/pennyfarthing_scripts/hooks/__pycache__/cli.cpython-314.pyc +0 -0
  300. package/pennyfarthing_scripts/hooks/__pycache__/context_breaker.cpython-314.pyc +0 -0
  301. package/pennyfarthing_scripts/hooks/__pycache__/context_warning.cpython-314.pyc +0 -0
  302. package/pennyfarthing_scripts/hooks/__pycache__/cyclist_pretooluse.cpython-314.pyc +0 -0
  303. package/pennyfarthing_scripts/hooks/__pycache__/pre_edit_check.cpython-314.pyc +0 -0
  304. package/pennyfarthing_scripts/hooks/__pycache__/reflector_check.cpython-314.pyc +0 -0
  305. package/pennyfarthing_scripts/hooks/__pycache__/schema_validation.cpython-314.pyc +0 -0
  306. package/pennyfarthing_scripts/hooks/__pycache__/session_start.cpython-314.pyc +0 -0
  307. package/pennyfarthing_scripts/hooks/__pycache__/session_stop.cpython-314.pyc +0 -0
  308. package/pennyfarthing_scripts/hooks/__pycache__/sprint_yaml_validation.cpython-314.pyc +0 -0
  309. package/pennyfarthing_scripts/hooks/__pycache__/statusline.cpython-314.pyc +0 -0
  310. package/pennyfarthing_scripts/hooks/bell_mode.py +214 -0
  311. package/pennyfarthing_scripts/hooks/cli.py +96 -0
  312. package/pennyfarthing_scripts/hooks/context_breaker.py +104 -0
  313. package/pennyfarthing_scripts/hooks/context_warning.py +66 -0
  314. package/pennyfarthing_scripts/hooks/cyclist_pretooluse.py +129 -0
  315. package/pennyfarthing_scripts/hooks/pre_edit_check.py +77 -0
  316. package/pennyfarthing_scripts/hooks/reflector_check.py +270 -0
  317. package/pennyfarthing_scripts/hooks/schema_validation.py +202 -0
  318. package/pennyfarthing_scripts/hooks/session_start.py +294 -0
  319. package/pennyfarthing_scripts/hooks/session_stop.py +111 -0
  320. package/pennyfarthing_scripts/hooks/sprint_yaml_validation.py +97 -0
  321. package/pennyfarthing_scripts/hooks/statusline.py +429 -0
  322. package/pennyfarthing_scripts/hooks.py +27 -432
  323. package/pennyfarthing_scripts/pretooluse_hook.py +3 -185
  324. package/pennyfarthing_scripts/prime/__pycache__/workflow.cpython-314.pyc +0 -0
  325. package/pennyfarthing_scripts/prime/heatmap.py +3 -15
  326. package/pennyfarthing_scripts/prime/workflow.py +2 -1
  327. package/pennyfarthing_scripts/schema_validation_hook.py +3 -298
  328. package/pennyfarthing_scripts/session_start_hook.py +4 -186
  329. package/pennyfarthing_scripts/sprint/__pycache__/cli.cpython-314.pyc +0 -0
  330. package/pennyfarthing_scripts/sprint/__pycache__/loader.cpython-314.pyc +0 -0
  331. package/pennyfarthing_scripts/sprint/__pycache__/story_finish.cpython-314.pyc +0 -0
  332. package/pennyfarthing_scripts/sprint/__pycache__/story_update.cpython-314.pyc +0 -0
  333. package/pennyfarthing_scripts/sprint/cli.py +121 -0
  334. package/pennyfarthing_scripts/sprint/loader.py +154 -3
  335. package/pennyfarthing_scripts/sprint/story_update.py +26 -0
  336. package/pennyfarthing_scripts/tests/__pycache__/test_bikerack.cpython-314-pytest-9.0.2.pyc +0 -0
  337. package/pennyfarthing_scripts/tests/__pycache__/test_handoff_cli.cpython-314-pytest-9.0.2.pyc +0 -0
  338. package/pennyfarthing_scripts/tests/__pycache__/test_workflow_list_team.cpython-314-pytest-9.0.2.pyc +0 -0
  339. package/pennyfarthing_scripts/tests/test_bikerack.py +26 -26
  340. package/pennyfarthing_scripts/tests/test_dialogue_manager.py +0 -1
  341. package/pennyfarthing_scripts/tests/test_sprint_panel.py +344 -265
  342. package/pennyfarthing_scripts/tests/test_workflow_list_team.py +147 -0
  343. package/pennyfarthing_scripts/validate/__pycache__/cli.cpython-314.pyc +0 -0
  344. package/pennyfarthing_scripts/validate/adapters/__pycache__/skill_command.cpython-314.pyc +0 -0
  345. package/pennyfarthing_scripts/validate/adapters/__pycache__/tandem_awareness.cpython-314.pyc +0 -0
  346. package/pennyfarthing_scripts/validate/adapters/__pycache__/team_mode.cpython-314.pyc +0 -0
  347. package/pennyfarthing_scripts/validate/adapters/__pycache__/workflow.cpython-314.pyc +0 -0
  348. package/pennyfarthing_scripts/validate/adapters/team_mode.py +323 -0
  349. package/pennyfarthing_scripts/validate/adapters/workflow.py +19 -0
  350. package/pennyfarthing_scripts/welcome_hook.py +3 -149
  351. package/pennyfarthing_scripts/workflow/__pycache__/__init__.cpython-314.pyc +0 -0
  352. package/pennyfarthing_scripts/workflow/__pycache__/cli.cpython-314.pyc +0 -0
  353. package/pennyfarthing_scripts/workflow/__pycache__/helpers.cpython-314.pyc +0 -0
  354. package/pennyfarthing_scripts/workflow/__pycache__/scale.cpython-314.pyc +0 -0
  355. package/pennyfarthing_scripts/workflow/__pycache__/state.cpython-314.pyc +0 -0
  356. package/pennyfarthing_scripts/workflow/__pycache__/team_lifecycle.cpython-314.pyc +0 -0
  357. package/pennyfarthing_scripts/workflow/cli.py +22 -20
  358. package/pennyfarthing_scripts/workflow/state.py +0 -1
  359. package/pennyfarthing_scripts/workflow/team_lifecycle.py +256 -0
  360. package/packages/core/dist/cli/cyclist-migration.test.d.ts +0 -16
  361. package/packages/core/dist/cli/cyclist-migration.test.d.ts.map +0 -1
  362. package/packages/core/dist/cli/cyclist-migration.test.js +0 -229
  363. package/packages/core/dist/cli/cyclist-migration.test.js.map +0 -1
  364. package/packages/core/dist/scripts/theme-detail.test.d.ts +0 -10
  365. package/packages/core/dist/scripts/theme-detail.test.d.ts.map +0 -1
  366. package/packages/core/dist/scripts/theme-detail.test.js +0 -199
  367. package/packages/core/dist/scripts/theme-detail.test.js.map +0 -1
@@ -1,183 +1,4 @@
1
- #!/bin/bash
2
- #
3
- # PostToolUse Hook Bell Mode + Tandem Injection
4
- #
5
- # Called by Claude Code after each tool execution. Handles two independent
6
- # injection systems:
7
- #
8
- # 1. Bell queue (Cyclist only) — injects queued user messages when Cyclist
9
- # is running and bell_mode is enabled. In CLI sessions this is a no-op.
10
- # 2. Tandem observations (always active) — injects backseat agent observations
11
- # when tandem observation files exist. No configuration required.
12
- #
13
- # Bell queue takes precedence: if a queued message exists, tandem is
14
- # deferred to the next hook invocation.
15
- #
16
- # Output format (when injecting):
17
- # {
18
- # "hookSpecificOutput": {
19
- # "hookEventName": "PostToolUse",
20
- # "additionalContext": "<message>"
21
- # }
22
- # }
23
- #
24
- # Output when nothing to inject: (nothing - exit 0)
25
-
26
- # Find project root (walk up to find .pennyfarthing)
27
- PROJECT_ROOT="$PWD"
28
- while [[ "$PROJECT_ROOT" != "/" ]]; do
29
- if [[ -d "$PROJECT_ROOT/.pennyfarthing" ]]; then
30
- break
31
- fi
32
- PROJECT_ROOT="$(dirname "$PROJECT_ROOT")"
33
- done
34
-
35
- if [[ ! -d "$PROJECT_ROOT/.pennyfarthing" ]]; then
36
- exit 0
37
- fi
38
-
39
- CONFIG_LOCAL_YAML="$PROJECT_ROOT/.pennyfarthing/config.local.yaml"
40
- BELL_QUEUE_FILE="$PROJECT_ROOT/.pennyfarthing/bell-queue.json"
41
-
42
- # Detect Cyclist — bell queue is a Cyclist-only feature
43
- IS_CYCLIST=false
44
- CYCLIST_PORT=""
45
- PORT_FILE="$PROJECT_ROOT/.wheelhub-port"
46
- if [[ -f "$PORT_FILE" ]]; then
47
- CYCLIST_PORT=$(cat "$PORT_FILE" 2>/dev/null)
48
- if [[ -n "$CYCLIST_PORT" ]] && [[ "$CYCLIST_PORT" =~ ^[0-9]+$ ]]; then
49
- IS_CYCLIST=true
50
- fi
51
- fi
52
-
53
- # --- Bell queue check (Cyclist only, requires bell_mode: true) ---
54
- # Takes precedence over tandem injection when active.
55
-
56
- if [[ "$IS_CYCLIST" == "true" ]] && [[ -f "$CONFIG_LOCAL_YAML" ]]; then
57
- BELL_ENABLED=$(grep -E '^\s*bell_mode:\s*true' "$CONFIG_LOCAL_YAML" 2>/dev/null || true)
58
-
59
- if [[ -n "$BELL_ENABLED" ]] && [[ -f "$BELL_QUEUE_FILE" ]]; then
60
- QUEUE_CONTENT=$(cat "$BELL_QUEUE_FILE" 2>/dev/null)
61
- if [[ -n "$QUEUE_CONTENT" ]] && [[ "$QUEUE_CONTENT" != "[]" ]]; then
62
- FIRST_MESSAGE_TEXT=$(echo "$QUEUE_CONTENT" | sed -n 's/.*"text"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | head -1)
63
-
64
- if [[ -n "$FIRST_MESSAGE_TEXT" ]]; then
65
- cat << EOF
66
- {
67
- "hookSpecificOutput": {
68
- "hookEventName": "PostToolUse",
69
- "additionalContext": "User feedback: $FIRST_MESSAGE_TEXT"
70
- }
71
- }
72
- EOF
73
-
74
- # Dequeue and notify Cyclist in background
75
- (
76
- if command -v jq &> /dev/null; then
77
- jq 'if length > 0 then .[1:] else [] end' "$BELL_QUEUE_FILE" > "$BELL_QUEUE_FILE.tmp" 2>/dev/null && mv "$BELL_QUEUE_FILE.tmp" "$BELL_QUEUE_FILE"
78
- fi
79
-
80
- curl -s -X POST "http://localhost:$CYCLIST_PORT/api/bell-consumed" \
81
- -H "Content-Type: application/json" \
82
- -d "{\"text\": \"$FIRST_MESSAGE_TEXT\"}" \
83
- >/dev/null 2>&1 || true
84
- ) &
85
-
86
- exit 0
87
- fi
88
- fi
89
- fi
90
- fi
91
-
92
- # --- Tandem observation injection ---
93
- # Always active. No configuration required.
94
- # Checks .session/*-tandem-*.md files for new observations via mtime comparison.
95
-
96
- SESSION_DIR="$PROJECT_ROOT/.session"
97
- if [[ ! -d "$SESSION_DIR" ]]; then
98
- exit 0
99
- fi
100
-
101
- # Find tandem observation files
102
- TANDEM_FILES=$(find "$SESSION_DIR" -maxdepth 1 -name "*-tandem-*.md" 2>/dev/null)
103
- if [[ -z "$TANDEM_FILES" ]]; then
104
- exit 0
105
- fi
106
-
107
- # Check each tandem file for new content
108
- for TANDEM_FILE in $TANDEM_FILES; do
109
- # Extract agent name from filename: *-tandem-{agent}.md
110
- AGENT=$(echo "$TANDEM_FILE" | sed -n 's/.*-tandem-\([a-zA-Z_]*\)\.md$/\1/p')
111
- if [[ -z "$AGENT" ]]; then
112
- continue
113
- fi
114
-
115
- # Get file mtime (portable: stat -f %m on macOS, stat -c %Y on Linux)
116
- if [[ "$(uname)" == "Darwin" ]]; then
117
- FILE_MTIME=$(stat -f %m "$TANDEM_FILE" 2>/dev/null)
118
- else
119
- FILE_MTIME=$(stat -c %Y "$TANDEM_FILE" 2>/dev/null)
120
- fi
121
- if [[ -z "$FILE_MTIME" ]]; then
122
- continue
123
- fi
124
-
125
- # Compare with saved mtime sidecar
126
- MTIME_SIDECAR="$SESSION_DIR/.tandem-mtime-$AGENT"
127
- SAVED_MTIME="0"
128
- if [[ -f "$MTIME_SIDECAR" ]]; then
129
- SAVED_MTIME=$(cat "$MTIME_SIDECAR" 2>/dev/null)
130
- fi
131
-
132
- if [[ "$FILE_MTIME" == "$SAVED_MTIME" ]]; then
133
- continue
134
- fi
135
-
136
- # Read tandem file and extract latest observation
137
- CONTENT=$(cat "$TANDEM_FILE" 2>/dev/null)
138
- if [[ -z "$CONTENT" ]]; then
139
- continue
140
- fi
141
-
142
- # Extract persona from header: **Observer:** agent (Persona Name)
143
- PERSONA=$(echo "$CONTENT" | sed -n 's/.*\*\*Observer:\*\*[[:space:]]*[a-zA-Z_]*[[:space:]]*(\([^)]*\)).*/\1/p' | head -1)
144
- if [[ -z "$PERSONA" ]]; then
145
- PERSONA="Unknown"
146
- fi
147
-
148
- # Extract latest observation text (last ## [HH:MM] Observation block)
149
- # Get text between last observation header and trailing ---
150
- OBS_TEXT=$(echo "$CONTENT" | awk '
151
- /^## \[[0-9]+:[0-9]+\] Observation/ { found=1; text=""; next }
152
- found && /^---/ { next }
153
- found && /^\*\*Trigger:\*\*/ { next }
154
- found { text = text (text ? "\n" : "") $0 }
155
- END { if (text) print text }
156
- ' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
157
-
158
- if [[ -z "$OBS_TEXT" ]]; then
159
- # Update mtime even if no parseable observation
160
- echo "$FILE_MTIME" > "$MTIME_SIDECAR"
161
- continue
162
- fi
163
-
164
- # Format as [Tandem] prefix and output
165
- TANDEM_MSG="[Tandem] $PERSONA: $OBS_TEXT"
166
-
167
- cat << EOF
168
- {
169
- "hookSpecificOutput": {
170
- "hookEventName": "PostToolUse",
171
- "additionalContext": "$TANDEM_MSG"
172
- }
173
- }
174
- EOF
175
-
176
- # Save mtime sidecar
177
- echo "$FILE_MTIME" > "$MTIME_SIDECAR"
178
-
179
- # Only inject one tandem observation per hook invocation
180
- exit 0
181
- done
182
-
183
- exit 0
1
+ #!/usr/bin/env bash
2
+ # Shim: delegates to Python CLI via uv run (dogfooding) or global pf (consumer).
3
+ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)/../lib/run-pf.sh"
4
+ exec_pf hooks bell-mode
@@ -1,95 +1,4 @@
1
- #!/usr/bin/env zsh
2
- # Context circuit breaker hook: Block tool execution at 85% context usage
3
- # Called by Claude Code before tool calls (PreToolUse)
4
- #
5
- # Input: JSON via stdin with tool_name, tool_input, session_id
6
- # Output: Exit 0 to allow, Exit 2 to block (stderr shown to Claude)
7
- #
8
- # This hook provides a hard stop when context is critically high,
9
- # unlike context-warning.sh which only warns.
10
- #
11
- # When triggered, automatically saves the active agent to a checkpoint
12
- # so /continue-session can restore it with FULL tier.
13
-
14
- # Read stdin to get session_id (required by hook protocol)
15
- INPUT=$(cat)
16
-
17
- # Script location for sibling script references
18
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
19
-
20
- # Get context percentage from check-context.sh
21
- CONTEXT_SCRIPT="$SCRIPT_DIR/../check-context.sh"
22
- if [[ ! -x "$CONTEXT_SCRIPT" ]]; then
23
- # graceful degradation: if check-context.sh not found, allow the tool
24
- exit 0
25
- fi
26
-
27
- # Run check-context.sh and parse output
28
- eval "$("$CONTEXT_SCRIPT" 2>/dev/null)" 2>/dev/null
29
-
30
- # graceful degradation: if we can't get context, allow the tool
31
- if [[ -z "$CONTEXT_PERCENT" ]] || [[ "$CONTEXT_PERCENT" == "null" ]]; then
32
- exit 0
33
- fi
34
-
35
- # Load critical threshold (default 80%)
36
- CRITICAL_THRESHOLD="${CRITICAL_THRESHOLD:-80}"
37
-
38
- # Check if at or above critical threshold
39
- if [[ "$CONTEXT_PERCENT" -ge "$CRITICAL_THRESHOLD" ]] 2>/dev/null; then
40
- # Auto-save active agent to checkpoint before blocking
41
- # This allows /continue-session to restore with FULL tier
42
- source "$SCRIPT_DIR/../lib/checkpoint.sh" 2>/dev/null || true
43
-
44
- # Get session_id from input JSON
45
- SESSION_ID=""
46
- if command -v jq &>/dev/null && [[ -n "$INPUT" ]]; then
47
- SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // empty' 2>/dev/null)
48
- fi
49
-
50
- # Look up active agent for this session
51
- ACTIVE_AGENT=""
52
- AGENT_FILE="${CLAUDE_PROJECT_DIR:-.}/.session/agents/${SESSION_ID}"
53
- if [[ -n "$SESSION_ID" && -f "$AGENT_FILE" ]]; then
54
- ACTIVE_AGENT=$(cat "$AGENT_FILE" 2>/dev/null)
55
- fi
56
-
57
- # Save agent checkpoint if we found one
58
- if [[ -n "$ACTIVE_AGENT" ]]; then
59
- checkpoint_save "circuit_breaker_agent" "$ACTIVE_AGENT" 2>/dev/null || true
60
- fi
61
-
62
- # Send error message to stderr (Claude will see this)
63
- cat >&2 << EOF
64
- CONTEXT CIRCUIT BREAKER TRIGGERED
65
-
66
- Context usage: ${CONTEXT_PERCENT}% - CRITICAL (threshold: ${CRITICAL_THRESHOLD}%)
67
-
68
- Tool execution BLOCKED. You must stop and hand off.
69
- EOF
70
-
71
- # Include agent info if available
72
- if [[ -n "$ACTIVE_AGENT" ]]; then
73
- cat >&2 << EOF
74
-
75
- Active agent saved: ${ACTIVE_AGENT}
76
- The agent will be restored with FULL context when you run /continue-session.
77
- EOF
78
- fi
79
-
80
- cat >&2 << EOF
81
-
82
- Required actions:
83
- 1. Commit any pending changes
84
- 2. Tell user to start fresh session with /continue-session
85
-
86
- DO NOT attempt further tool calls. This is a hard stop.
87
-
88
- To resume later: /continue-session
89
- EOF
90
- # Exit 2 blocks the tool execution
91
- exit 2
92
- fi
93
-
94
- # Below threshold: allow the tool
95
- exit 0
1
+ #!/usr/bin/env bash
2
+ # Shim: delegates to Python CLI via uv run (dogfooding) or global pf (consumer).
3
+ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)/../lib/run-pf.sh"
4
+ exec_pf hooks context-breaker
@@ -1,65 +1,4 @@
1
- #!/usr/bin/env zsh
2
- # Context warning hook: Warn agent when context usage is high
3
- # Called by Claude Code before tool calls (PreToolUse)
4
- #
5
- # Input: JSON via stdin with tool_name, tool_input
6
- # Output: Warning message to stdout if context > 60%
7
- # Always exits 0 (warning only, never blocks)
8
-
9
- # Read and discard stdin (required by hook protocol)
10
- cat > /dev/null
11
-
12
- # Script location for sibling script references
13
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
14
-
15
- # Get context percentage from check-context.sh
16
- CONTEXT_SCRIPT="$SCRIPT_DIR/../check-context.sh"
17
- if [[ ! -x "$CONTEXT_SCRIPT" ]]; then
18
- exit 0 # Can't check, allow silently
19
- fi
20
-
21
- # Run check-context.sh and parse output
22
- eval "$("$CONTEXT_SCRIPT" 2>/dev/null)" 2>/dev/null
23
-
24
- # Check if we got a valid percentage
25
- if [[ -z "$CONTEXT_PERCENT" ]] || [[ "$CONTEXT_PERCENT" == "null" ]]; then
26
- exit 0 # Can't determine, allow silently
27
- fi
28
-
29
- # Load thresholds from settings (defaults match check-context.sh)
30
- WARNING_THRESHOLD="${WARNING_THRESHOLD:-60}"
31
- CRITICAL_THRESHOLD="${CRITICAL_THRESHOLD:-85}"
32
-
33
- # Output warning if above threshold
34
- if [[ "$CONTEXT_PERCENT" -ge "$CRITICAL_THRESHOLD" ]] 2>/dev/null; then
35
- cat << EOF
36
-
37
- ---
38
- CONTEXT WARNING: ${CONTEXT_PERCENT}% (CRITICAL)
39
-
40
- Context usage is critically high. Recommended actions:
41
- 1. Complete current task immediately
42
- 2. Commit any pending changes
43
- 3. Hand off to next agent or ask user to start fresh session
44
-
45
- Do NOT start new subtasks. Wrap up and hand off.
46
- ---
47
-
48
- EOF
49
- elif [[ "$CONTEXT_PERCENT" -ge "$WARNING_THRESHOLD" ]] 2>/dev/null; then
50
- cat << EOF
51
-
52
- ---
53
- CONTEXT WARNING: ${CONTEXT_PERCENT}%
54
-
55
- Context usage is high. Consider:
56
- - Wrapping up current task soon
57
- - Preparing for handoff to next agent
58
- - Avoiding large file reads or complex operations
59
- ---
60
-
61
- EOF
62
- fi
63
-
64
- # Always allow the tool (we're warning, not blocking)
65
- exit 0
1
+ #!/usr/bin/env bash
2
+ # Shim: delegates to Python CLI via uv run (dogfooding) or global pf (consumer).
3
+ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)/../lib/run-pf.sh"
4
+ exec_pf hooks context-warning
@@ -1,32 +1,4 @@
1
1
  #!/usr/bin/env bash
2
- #
3
- # Cyclist PreToolUse Hook - Shell wrapper for Python implementation
4
- #
5
- # Routes tool approval requests through WheelHub when Cyclist is running.
6
- # Falls back to Claude Code's built-in permissions when Cyclist is not active.
7
- #
8
- # Input (stdin): JSON with tool_name, tool_input, session_id, etc.
9
- # Output (stdout): JSON decision (allow/deny/ask)
10
- #
11
- # Story: MSSCI-14320
12
-
13
- set -euo pipefail
14
-
15
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
16
- source "$SCRIPT_DIR/../lib/find-root.sh"
17
-
18
- # Set PYTHONPATH for pennyfarthing_scripts
19
- PENNYFARTHING_SCRIPTS=""
20
- if [[ -d "$PROJECT_ROOT/pennyfarthing" ]]; then
21
- # Dogfooding: framework inlined in orchestrator
22
- PENNYFARTHING_SCRIPTS="$PROJECT_ROOT/pennyfarthing"
23
- elif [[ -d "$PROJECT_ROOT/node_modules/@pennyfarthing/core" ]]; then
24
- # Normal install
25
- PENNYFARTHING_SCRIPTS="$PROJECT_ROOT/node_modules/@pennyfarthing/core"
26
- fi
27
-
28
- if [[ -n "$PENNYFARTHING_SCRIPTS" ]]; then
29
- export PYTHONPATH="$PENNYFARTHING_SCRIPTS:${PYTHONPATH:-}"
30
- fi
31
-
32
- python3 -m pennyfarthing_scripts.pretooluse_hook
2
+ # Shim: delegates to Python CLI via uv run (dogfooding) or global pf (consumer).
3
+ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)/../lib/run-pf.sh"
4
+ exec_pf hooks cyclist-pretooluse
@@ -1,7 +1,7 @@
1
1
  #!/bin/bash
2
2
  # otel-auto-config.sh - Auto-configure OTEL for Cyclist web mode (Story 20-1)
3
3
  #
4
- # This hook checks for a .wheelhub-port file in the project directory.
4
+ # This hook checks for a .bikerack-port file in the project directory.
5
5
  # If found, it sets the OTEL environment variables to connect Claude Code
6
6
  # telemetry to the running Cyclist server.
7
7
  #
@@ -9,15 +9,15 @@
9
9
  # source /path/to/otel-auto-config.sh
10
10
  #
11
11
  # Prerequisites:
12
- # - Cyclist must be running in web mode (writes .wheelhub-port file)
12
+ # - Cyclist must be running in web mode (writes .bikerack-port file)
13
13
  # - CLAUDE_PROJECT_DIR must be set (standard in Claude Code environment)
14
14
 
15
15
  # Determine project directory
16
16
  PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
17
17
 
18
- # Read port from .wheelhub-port (used by both Cyclist and BikeRack)
18
+ # Read port from .bikerack-port (used by both Cyclist and BikeRack)
19
19
  PORT=""
20
- PORT_FILE="$PROJECT_DIR/.wheelhub-port"
20
+ PORT_FILE="$PROJECT_DIR/.bikerack-port"
21
21
  if [[ -f "$PORT_FILE" ]]; then
22
22
  PORT=$(cat "$PORT_FILE" 2>/dev/null)
23
23
  # Validate port is a number
@@ -28,6 +28,7 @@ fi
28
28
 
29
29
  # Configure OTEL if a valid port was found
30
30
  if [[ -n "$PORT" ]]; then
31
+ export CLAUDE_CODE_ENABLE_TELEMETRY=1
31
32
  export OTEL_EXPORTER_OTLP_PROTOCOL="http/json"
32
33
  export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:$PORT"
33
34
 
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # Checks:
5
5
  # 1. Prevents direct commits to protected branches (main, develop)
6
- # Exception: sprint/ folder commits allowed on develop
6
+ # Exception: sprint/ folder commits allowed on protected branches
7
7
  # 2. Validates agent files when pennyfarthing-dist/agents/*.md is modified
8
8
  # 3. Validates file references when pennyfarthing-dist/ files are modified (warn only)
9
9
  # 4. Validates sprint YAML files when sprint/*.yaml is modified
@@ -34,40 +34,34 @@ BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
34
34
  PROTECTED_BRANCHES="^(main|develop)$"
35
35
 
36
36
  if [[ $BRANCH =~ $PROTECTED_BRANCHES ]]; then
37
- # Special case: Allow sprint/ folder commits on develop branch
38
- if [[ $BRANCH == "develop" ]]; then
39
- STAGED_FILES=$(git diff --cached --name-only)
40
- NON_SPRINT_FILES=$(echo "$STAGED_FILES" | grep -v "^sprint/")
41
-
42
- # If all staged files are in sprint/, allow the commit
43
- if [ -z "$NON_SPRINT_FILES" ] && [ -n "$STAGED_FILES" ]; then
44
- # Continue to agent validation check
45
- :
46
- else
47
- echo ""
48
- echo "COMMIT BLOCKED"
49
- echo ""
50
- echo "You are trying to commit directly to: $BRANCH"
51
- echo "This violates the git workflow rules."
52
- echo ""
53
- echo "Protected branches: main, develop"
54
- echo ""
55
- echo "What to do:"
56
- echo "1. Create a feature branch:"
57
- echo " git checkout -b <type>/<epic-story>-<description>"
58
- echo ""
59
- echo "2. Example:"
60
- echo " git checkout -b feat/8-2-add-authentication"
61
- echo ""
62
- echo "3. Then commit your changes on the feature branch"
63
- echo ""
64
- echo "Exception: Sprint tracking files (sprint/*) can be committed to develop"
65
- echo ""
66
- exit 1
67
- fi
37
+ # Special case: Allow sprint/ folder commits on protected branches
38
+ # (orchestrator uses trunk-based on main; pennyfarthing uses gitflow on develop)
39
+ STAGED_FILES=$(git diff --cached --name-only)
40
+ NON_SPRINT_FILES=$(echo "$STAGED_FILES" | grep -v "^sprint/")
41
+
42
+ # If all staged files are in sprint/, allow the commit
43
+ if [ -z "$NON_SPRINT_FILES" ] && [ -n "$STAGED_FILES" ]; then
44
+ # Continue to agent validation check
45
+ :
68
46
  else
69
47
  echo ""
70
- echo "COMMIT BLOCKED - Cannot commit directly to $BRANCH"
48
+ echo "COMMIT BLOCKED"
49
+ echo ""
50
+ echo "You are trying to commit directly to: $BRANCH"
51
+ echo "This violates the git workflow rules."
52
+ echo ""
53
+ echo "Protected branches: main, develop"
54
+ echo ""
55
+ echo "What to do:"
56
+ echo "1. Create a feature branch:"
57
+ echo " git checkout -b <type>/<epic-story>-<description>"
58
+ echo ""
59
+ echo "2. Example:"
60
+ echo " git checkout -b feat/8-2-add-authentication"
61
+ echo ""
62
+ echo "3. Then commit your changes on the feature branch"
63
+ echo ""
64
+ echo "Exception: Sprint tracking files (sprint/*) can be committed directly"
71
65
  echo ""
72
66
  exit 1
73
67
  fi
@@ -140,7 +134,8 @@ fi
140
134
  SPRINT_YAML_FILES=$(git diff --cached --name-only -- 'sprint/*.yaml' 'sprint/archive/*.yaml' 2>/dev/null \
141
135
  | grep -v 'sprint-template\.yaml$' \
142
136
  | grep -v 'sprint/completed\.yaml$' \
143
- | grep -v 'sprint/context/archived/' || true)
137
+ | grep -v 'sprint/context/archived/' \
138
+ | grep -v 'sprints\.yaml$' || true)
144
139
 
145
140
  if [[ -n "$SPRINT_YAML_FILES" ]]; then
146
141
  echo "Sprint YAML files staged for commit:"
@@ -1,71 +1,4 @@
1
- #!/usr/bin/env zsh
2
- # Pre-edit hook: Verify edits don't touch protected files
3
- # Called by Claude Code before Edit/Write tool calls
4
- #
5
- # Input: JSON via stdin with tool_name, tool_input
6
- # Output: Exit 0 to allow, Exit 2 to block (stderr shown to Claude)
7
-
8
- set -euo pipefail
9
-
10
- # Read input from stdin
11
- input=$(cat)
12
-
13
- # Extract file path from tool input
14
- file_path=$(echo "$input" | jq -r '.tool_input.file_path // .tool_input.path // ""')
15
-
16
- # Protected patterns (files that should never be edited automatically)
17
- protected_patterns=(
18
- "*.env"
19
- "*.pem"
20
- "*.key"
21
- "*credentials*"
22
- "*secrets*"
23
- ".git/*"
24
- "node_modules/*"
25
- "vendor/*"
26
- )
27
-
28
- # Pennyfarthing managed files protection
29
- # These are managed by `pennyfarthing update`, don't edit directly
30
- # EXCEPTION: If we ARE in the pennyfarthing library itself, allow edits
31
- is_pennyfarthing_lib=false
32
- if [[ -d "${CLAUDE_PROJECT_DIR:-$PWD}/pennyfarthing-dist" ]]; then
33
- is_pennyfarthing_lib=true
34
- fi
35
-
36
- if [[ "$file_path" == *".claude/pennyfarthing/"* ]] && [[ "$is_pennyfarthing_lib" == "false" ]]; then
37
- echo "BLOCKED: Cannot edit managed pennyfarthing files." >&2
38
- echo "File: $file_path" >&2
39
- echo "" >&2
40
- echo "These files are managed by pennyfarthing and will be overwritten on update." >&2
41
- echo "Instead:" >&2
42
- echo " - Put project-specific customizations in .claude/project/" >&2
43
- echo " - For framework changes, edit the pennyfarthing repo and run 'pennyfarthing update'" >&2
44
- exit 2
45
- fi
46
-
47
- # Check if file matches any protected pattern
48
- for pattern in "${protected_patterns[@]}"; do
49
- if [[ "$file_path" == $pattern ]]; then
50
- echo "BLOCKED: Cannot edit protected file matching pattern: $pattern" >&2
51
- echo "File: $file_path" >&2
52
- exit 2
53
- fi
54
- done
55
-
56
- # Additional check: warn on certain file types but allow
57
- warn_patterns=(
58
- "*.md"
59
- "*.json"
60
- )
61
-
62
- # For warnings, just log to stderr but allow (exit 0)
63
- for pattern in "${warn_patterns[@]}"; do
64
- if [[ "$file_path" == $pattern ]]; then
65
- # Could log warnings here if needed
66
- :
67
- fi
68
- done
69
-
70
- # Allow the edit
71
- exit 0
1
+ #!/usr/bin/env bash
2
+ # Shim: delegates to Python CLI via uv run (dogfooding) or global pf (consumer).
3
+ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)/../lib/run-pf.sh"
4
+ exec_pf hooks pre-edit-check
@@ -1,20 +1,4 @@
1
1
  #!/usr/bin/env bash
2
- #
3
- # Question Reflector Enforcement Hook (Stop hook / PreToolUse hook)
4
- #
5
- # Thin wrapper that delegates to question_reflector_check.py for the actual logic.
6
- # This allows the hook to be written in Python for easier testing and maintenance.
7
- #
8
- # Input (stdin): JSON with transcript_path, stop_hook_active, etc.
9
- # Output (stdout): JSON decision to allow or block
10
- #
11
- # Story: MSSCI-12393
12
- #
13
-
14
- set -euo pipefail
15
-
16
- # Get the directory where this script lives
17
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
18
-
19
- # Delegate to Python implementation
20
- exec python3 "$SCRIPT_DIR/question_reflector_check.py"
2
+ # Shim: delegates to Python CLI via uv run (dogfooding) or global pf (consumer).
3
+ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)/../lib/run-pf.sh"
4
+ exec_pf hooks reflector-check
@@ -1,30 +1,4 @@
1
- #!/usr/bin/env zsh
2
- # Schema Validation Hook
3
- # Validates XML schema for session, skill, and workflow step files on Write operations
4
- # Called by Claude Code PreToolUse hook
5
- #
6
- # Input: JSON via stdin with tool_name, tool_input
7
- # Output: JSON with decision (allow/deny)
8
-
9
- set -euo pipefail
10
-
11
- # Find script directory (zsh compatible)
12
- SCRIPT_DIR="${0:A:h}"
13
- source "$SCRIPT_DIR/../lib/find-root.sh"
14
-
15
- # Set PYTHONPATH for pennyfarthing_scripts
16
- PENNYFARTHING_SCRIPTS=""
17
- if [[ -d "$PROJECT_ROOT/pennyfarthing" ]]; then
18
- # Dogfooding: framework inlined in orchestrator
19
- PENNYFARTHING_SCRIPTS="$PROJECT_ROOT/pennyfarthing"
20
- elif [[ -d "$PROJECT_ROOT/node_modules/@pennyfarthing/core" ]]; then
21
- # Normal install
22
- PENNYFARTHING_SCRIPTS="$PROJECT_ROOT/node_modules/@pennyfarthing/core"
23
- fi
24
-
25
- if [[ -n "$PENNYFARTHING_SCRIPTS" ]]; then
26
- export PYTHONPATH="$PENNYFARTHING_SCRIPTS:${PYTHONPATH:-}"
27
- fi
28
-
29
- # Run Python validation hook
30
- python3 -m pennyfarthing_scripts.schema_validation_hook
1
+ #!/usr/bin/env bash
2
+ # Shim: delegates to Python CLI via uv run (dogfooding) or global pf (consumer).
3
+ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)/../lib/run-pf.sh"
4
+ exec_pf hooks schema-validation