@pennyfarthing/core 8.1.0 → 9.0.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 (329) hide show
  1. package/README.md +18 -9
  2. package/package.json +3 -3
  3. package/packages/core/dist/cli/commands/doctor.d.ts +5 -2
  4. package/packages/core/dist/cli/commands/doctor.d.ts.map +1 -1
  5. package/packages/core/dist/cli/commands/doctor.js +225 -17
  6. package/packages/core/dist/cli/commands/doctor.js.map +1 -1
  7. package/packages/core/dist/cli/commands/init.d.ts.map +1 -1
  8. package/packages/core/dist/cli/commands/init.js +3 -246
  9. package/packages/core/dist/cli/commands/init.js.map +1 -1
  10. package/packages/core/dist/cli/commands/update.d.ts.map +1 -1
  11. package/packages/core/dist/cli/commands/update.js +4 -140
  12. package/packages/core/dist/cli/commands/update.js.map +1 -1
  13. package/packages/core/dist/cli/utils/constants.d.ts +7 -1
  14. package/packages/core/dist/cli/utils/constants.d.ts.map +1 -1
  15. package/packages/core/dist/cli/utils/constants.js +2 -0
  16. package/packages/core/dist/cli/utils/constants.js.map +1 -1
  17. package/packages/core/dist/cli/utils/settings.d.ts +22 -0
  18. package/packages/core/dist/cli/utils/settings.d.ts.map +1 -0
  19. package/packages/core/dist/cli/utils/settings.js +300 -0
  20. package/packages/core/dist/cli/utils/settings.js.map +1 -0
  21. package/pennyfarthing-dist/agents/README.md +1 -1
  22. package/pennyfarthing-dist/agents/dev.md +1 -1
  23. package/pennyfarthing-dist/agents/handoff.md +1 -1
  24. package/pennyfarthing-dist/agents/reviewer-preflight.md +1 -1
  25. package/pennyfarthing-dist/agents/sm-setup.md +3 -3
  26. package/pennyfarthing-dist/agents/sm.md +1 -1
  27. package/pennyfarthing-dist/agents/tea.md +1 -1
  28. package/pennyfarthing-dist/agents/testing-runner.md +3 -3
  29. package/pennyfarthing-dist/commands/architect.md +2 -0
  30. package/pennyfarthing-dist/commands/chore.md +18 -17
  31. package/pennyfarthing-dist/commands/continue-session.md +43 -9
  32. package/pennyfarthing-dist/commands/dev.md +2 -0
  33. package/pennyfarthing-dist/commands/devops.md +2 -0
  34. package/pennyfarthing-dist/commands/fix-blocker.md +22 -0
  35. package/pennyfarthing-dist/commands/git-cleanup.md +25 -19
  36. package/pennyfarthing-dist/commands/health-check.md +2 -0
  37. package/pennyfarthing-dist/commands/new-work.md +23 -0
  38. package/pennyfarthing-dist/commands/orchestrator.md +2 -0
  39. package/pennyfarthing-dist/commands/parallel-work.md +4 -2
  40. package/pennyfarthing-dist/commands/patch.md +210 -0
  41. package/pennyfarthing-dist/commands/pm.md +2 -0
  42. package/pennyfarthing-dist/commands/reviewer.md +2 -0
  43. package/pennyfarthing-dist/commands/sm.md +2 -0
  44. package/pennyfarthing-dist/commands/tea.md +2 -0
  45. package/pennyfarthing-dist/commands/tech-writer.md +2 -0
  46. package/pennyfarthing-dist/commands/ux-designer.md +2 -0
  47. package/pennyfarthing-dist/commands/work.md +2 -0
  48. package/pennyfarthing-dist/guides/agent-behavior.md +29 -264
  49. package/pennyfarthing-dist/guides/session-schema.md +346 -0
  50. package/pennyfarthing-dist/guides/skill-schema.md +412 -0
  51. package/pennyfarthing-dist/guides/workflow-step-schema.md +512 -0
  52. package/pennyfarthing-dist/guides/xml-tags.md +292 -0
  53. package/pennyfarthing-dist/scripts/core/agent-session.sh +7 -0
  54. package/pennyfarthing-dist/scripts/core/check-context.sh +140 -226
  55. package/pennyfarthing-dist/scripts/core/handoff-marker.sh +13 -2
  56. package/pennyfarthing-dist/scripts/git/worktree-manager.sh +4 -1
  57. package/pennyfarthing-dist/scripts/health/drift-detection.sh +1 -7
  58. package/pennyfarthing-dist/scripts/hooks/context-circuit-breaker.sh +43 -8
  59. package/pennyfarthing-dist/scripts/hooks/post-merge.sh +4 -11
  60. package/pennyfarthing-dist/scripts/hooks/pre-commit.sh +3 -8
  61. package/pennyfarthing-dist/scripts/hooks/pre-push.sh +3 -3
  62. package/pennyfarthing-dist/scripts/hooks/schema-validation.sh +30 -0
  63. package/pennyfarthing-dist/scripts/jira/create-jira-epic.sh +1 -7
  64. package/pennyfarthing-dist/scripts/jira/create-jira-story.sh +2 -8
  65. package/pennyfarthing-dist/scripts/jira/jira-reconcile.sh +2 -8
  66. package/pennyfarthing-dist/scripts/lib/find-root.sh +41 -44
  67. package/pennyfarthing-dist/scripts/maintenance/sidecar-health.sh +1 -7
  68. package/pennyfarthing-dist/scripts/sprint/archive-story.sh +2 -8
  69. package/pennyfarthing-dist/scripts/sprint/available-stories.sh +2 -8
  70. package/pennyfarthing-dist/scripts/sprint/check-story.sh +2 -8
  71. package/pennyfarthing-dist/scripts/sprint/get-epic-field.sh +2 -8
  72. package/pennyfarthing-dist/scripts/sprint/get-story-field.sh +2 -8
  73. package/pennyfarthing-dist/scripts/sprint/list-future.sh +2 -8
  74. package/pennyfarthing-dist/scripts/sprint/new-sprint.sh +2 -8
  75. package/pennyfarthing-dist/scripts/sprint/promote-epic.sh +2 -8
  76. package/pennyfarthing-dist/scripts/sprint/sprint-info.sh +2 -8
  77. package/pennyfarthing-dist/scripts/tests/test-character-voice.sh +2 -1
  78. package/pennyfarthing-dist/scripts/workflow/finish-story.sh +4 -9
  79. package/pennyfarthing-dist/scripts/workflow/fix-session-phase.sh +2 -8
  80. package/pennyfarthing-dist/scripts/workflow/list-workflows.sh +2 -8
  81. package/pennyfarthing-dist/scripts/workflow/phase-owner.sh +1 -7
  82. package/pennyfarthing-dist/scripts/workflow/resume-workflow.sh +2 -8
  83. package/pennyfarthing-dist/scripts/workflow/show-workflow.sh +2 -8
  84. package/pennyfarthing-dist/scripts/workflow/start-workflow.sh +2 -8
  85. package/pennyfarthing-dist/scripts/workflow/workflow-status.sh +2 -8
  86. package/pennyfarthing-dist/skills/agentic-patterns/SKILL.md +4 -0
  87. package/pennyfarthing-dist/skills/changelog/SKILL.md +18 -0
  88. package/pennyfarthing-dist/skills/code-review/SKILL.md +5 -1
  89. package/pennyfarthing-dist/skills/context-engineering/SKILL.md +3 -0
  90. package/pennyfarthing-dist/skills/cyclist/SKILL.md +2 -2
  91. package/pennyfarthing-dist/skills/dev-patterns/SKILL.md +25 -1
  92. package/pennyfarthing-dist/skills/finalize-run/SKILL.md +3 -0
  93. package/pennyfarthing-dist/skills/jira/SKILL.md +48 -24
  94. package/pennyfarthing-dist/skills/judge/SKILL.md +8 -0
  95. package/pennyfarthing-dist/skills/just/SKILL.md +11 -0
  96. package/pennyfarthing-dist/skills/mermaid/SKILL.md +16 -0
  97. package/pennyfarthing-dist/skills/otel/skill.md +4 -0
  98. package/pennyfarthing-dist/skills/permissions/skill.md +3 -0
  99. package/pennyfarthing-dist/skills/persona-benchmark/SKILL.md +9 -0
  100. package/pennyfarthing-dist/skills/sprint/scripts/sync-epic-jira.sh +7 -0
  101. package/pennyfarthing-dist/skills/sprint/skill.md +30 -30
  102. package/pennyfarthing-dist/skills/story/skill.md +16 -16
  103. package/pennyfarthing-dist/skills/systematic-debugging/SKILL.md +56 -0
  104. package/pennyfarthing-dist/skills/testing/SKILL.md +22 -0
  105. package/pennyfarthing-dist/skills/theme/skill.md +12 -0
  106. package/pennyfarthing-dist/skills/theme-creation/SKILL.md +4 -0
  107. package/pennyfarthing-dist/skills/workflow/skill.md +22 -14
  108. package/pennyfarthing-dist/skills/yq/SKILL.md +8 -0
  109. package/pennyfarthing-dist/templates/settings.local.json.template +9 -0
  110. package/pennyfarthing-dist/workflows/architecture/steps/step-01-initialize.md +12 -0
  111. package/pennyfarthing-dist/workflows/architecture/steps/step-01b-continue.md +12 -0
  112. package/pennyfarthing-dist/workflows/architecture/steps/step-02-context.md +12 -0
  113. package/pennyfarthing-dist/workflows/architecture/steps/step-03-patterns.md +12 -0
  114. package/pennyfarthing-dist/workflows/architecture/steps/step-04-components.md +12 -0
  115. package/pennyfarthing-dist/workflows/architecture/steps/step-05-interfaces.md +12 -0
  116. package/pennyfarthing-dist/workflows/architecture/steps/step-06-risks.md +12 -0
  117. package/pennyfarthing-dist/workflows/architecture/steps/step-07-document.md +12 -0
  118. package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-01-validate-prerequisites.md +25 -0
  119. package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-02-design-epics.md +23 -0
  120. package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-03-create-stories.md +26 -0
  121. package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-04-final-validation.md +24 -0
  122. package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-05-import-to-future.md +23 -0
  123. package/pennyfarthing-dist/workflows/git-cleanup/steps/step-01-analyze.md +43 -41
  124. package/pennyfarthing-dist/workflows/git-cleanup/steps/step-02-categorize.md +50 -19
  125. package/pennyfarthing-dist/workflows/git-cleanup/steps/step-03-execute.md +102 -111
  126. package/pennyfarthing-dist/workflows/git-cleanup/steps/step-04-verify.md +48 -39
  127. package/pennyfarthing-dist/workflows/git-cleanup/steps/step-05-complete.md +30 -31
  128. package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-01-document-discovery.md +21 -0
  129. package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-02-prd-analysis.md +21 -0
  130. package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-03-epic-coverage-validation.md +23 -0
  131. package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-04-ux-alignment.md +23 -0
  132. package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-05-epic-quality-review.md +28 -0
  133. package/pennyfarthing-dist/workflows/implementation-readiness/steps/step-06-final-assessment.md +25 -0
  134. package/pennyfarthing-dist/workflows/interactive-debug/steps/step-01-connect.md +257 -0
  135. package/pennyfarthing-dist/workflows/interactive-debug/steps/step-02-explore.md +107 -0
  136. package/pennyfarthing-dist/workflows/interactive-debug/steps/step-03-fix.md +127 -0
  137. package/pennyfarthing-dist/workflows/interactive-debug/steps/step-04-commit.md +122 -0
  138. package/pennyfarthing-dist/workflows/interactive-debug/workflow.yaml +51 -0
  139. package/pennyfarthing-dist/workflows/patch.yaml +68 -0
  140. package/pennyfarthing-dist/workflows/prd/steps-c/step-01-init.md +6 -0
  141. package/pennyfarthing-dist/workflows/prd/steps-c/step-01b-continue.md +6 -0
  142. package/pennyfarthing-dist/workflows/prd/steps-c/step-02-discovery.md +6 -0
  143. package/pennyfarthing-dist/workflows/prd/steps-c/step-03-success.md +6 -0
  144. package/pennyfarthing-dist/workflows/prd/steps-c/step-04-journeys.md +6 -0
  145. package/pennyfarthing-dist/workflows/prd/steps-c/step-05-domain.md +6 -0
  146. package/pennyfarthing-dist/workflows/prd/steps-c/step-06-innovation.md +6 -0
  147. package/pennyfarthing-dist/workflows/prd/steps-c/step-07-project-type.md +6 -0
  148. package/pennyfarthing-dist/workflows/prd/steps-c/step-08-scoping.md +6 -0
  149. package/pennyfarthing-dist/workflows/prd/steps-c/step-09-functional.md +6 -0
  150. package/pennyfarthing-dist/workflows/prd/steps-c/step-10-nonfunctional.md +6 -0
  151. package/pennyfarthing-dist/workflows/prd/steps-c/step-11-polish.md +6 -0
  152. package/pennyfarthing-dist/workflows/prd/steps-c/step-12-complete.md +6 -0
  153. package/pennyfarthing-dist/workflows/prd/steps-e/step-e-01-discovery.md +6 -0
  154. package/pennyfarthing-dist/workflows/prd/steps-e/step-e-01b-legacy-conversion.md +6 -0
  155. package/pennyfarthing-dist/workflows/prd/steps-e/step-e-02-review.md +6 -0
  156. package/pennyfarthing-dist/workflows/prd/steps-e/step-e-03-edit.md +6 -0
  157. package/pennyfarthing-dist/workflows/prd/steps-e/step-e-04-complete.md +6 -0
  158. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-01-discovery.md +6 -0
  159. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-02-format-detection.md +6 -0
  160. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-02b-parity-check.md +6 -0
  161. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-03-density-validation.md +6 -0
  162. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-04-brief-coverage-validation.md +6 -0
  163. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-05-measurability-validation.md +6 -0
  164. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-06-traceability-validation.md +6 -0
  165. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-07-implementation-leakage-validation.md +6 -0
  166. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-08-domain-compliance-validation.md +6 -0
  167. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-09-project-type-validation.md +6 -0
  168. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-10-smart-validation.md +6 -0
  169. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-11-holistic-quality-validation.md +6 -0
  170. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-12-completeness-validation.md +6 -0
  171. package/pennyfarthing-dist/workflows/prd/steps-v/step-v-13-report-complete.md +6 -0
  172. package/pennyfarthing-dist/workflows/product-brief/steps/step-01-init.md +18 -0
  173. package/pennyfarthing-dist/workflows/product-brief/steps/step-01b-continue.md +19 -0
  174. package/pennyfarthing-dist/workflows/product-brief/steps/step-02-vision.md +22 -0
  175. package/pennyfarthing-dist/workflows/product-brief/steps/step-03-users.md +22 -0
  176. package/pennyfarthing-dist/workflows/product-brief/steps/step-04-metrics.md +23 -0
  177. package/pennyfarthing-dist/workflows/product-brief/steps/step-05-scope.md +24 -0
  178. package/pennyfarthing-dist/workflows/product-brief/steps/step-06-complete.md +22 -0
  179. package/pennyfarthing-dist/workflows/project-context/steps/step-01-discover.md +22 -0
  180. package/pennyfarthing-dist/workflows/project-context/steps/step-02-generate.md +31 -0
  181. package/pennyfarthing-dist/workflows/project-context/steps/step-03-complete.md +28 -0
  182. package/pennyfarthing-dist/workflows/quick-dev/steps/step-01-mode-detection.md +21 -0
  183. package/pennyfarthing-dist/workflows/quick-dev/steps/step-02-context-gathering.md +23 -0
  184. package/pennyfarthing-dist/workflows/quick-dev/steps/step-03-execute.md +25 -0
  185. package/pennyfarthing-dist/workflows/quick-dev/steps/step-04-self-check.md +22 -0
  186. package/pennyfarthing-dist/workflows/quick-dev/steps/step-05-adversarial-review.md +23 -0
  187. package/pennyfarthing-dist/workflows/quick-dev/steps/step-06-resolve-findings.md +23 -0
  188. package/pennyfarthing-dist/workflows/quick-spec/steps/step-01-understand.md +12 -0
  189. package/pennyfarthing-dist/workflows/quick-spec/steps/step-02-investigate.md +12 -0
  190. package/pennyfarthing-dist/workflows/quick-spec/steps/step-03-generate.md +12 -0
  191. package/pennyfarthing-dist/workflows/quick-spec/steps/step-04-review.md +12 -0
  192. package/pennyfarthing-dist/workflows/research/steps-domain/step-01-init.md +22 -0
  193. package/pennyfarthing-dist/workflows/research/steps-domain/step-02-domain-analysis.md +24 -0
  194. package/pennyfarthing-dist/workflows/research/steps-domain/step-03-competitive-landscape.md +25 -0
  195. package/pennyfarthing-dist/workflows/research/steps-domain/step-04-regulatory-focus.md +26 -0
  196. package/pennyfarthing-dist/workflows/research/steps-domain/step-05-technical-trends.md +26 -0
  197. package/pennyfarthing-dist/workflows/research/steps-domain/step-06-research-synthesis.md +34 -0
  198. package/pennyfarthing-dist/workflows/research/steps-market/step-01-init.md +23 -0
  199. package/pennyfarthing-dist/workflows/research/steps-market/step-02-customer-behavior.md +25 -0
  200. package/pennyfarthing-dist/workflows/research/steps-market/step-02-customer-insights.md +27 -0
  201. package/pennyfarthing-dist/workflows/research/steps-market/step-03-customer-pain-points.md +26 -0
  202. package/pennyfarthing-dist/workflows/research/steps-market/step-04-customer-decisions.md +27 -0
  203. package/pennyfarthing-dist/workflows/research/steps-market/step-05-competitive-analysis.md +26 -0
  204. package/pennyfarthing-dist/workflows/research/steps-market/step-06-research-completion.md +35 -0
  205. package/pennyfarthing-dist/workflows/research/steps-technical/step-01-init.md +22 -0
  206. package/pennyfarthing-dist/workflows/research/steps-technical/step-02-technical-overview.md +25 -0
  207. package/pennyfarthing-dist/workflows/research/steps-technical/step-03-integration-patterns.md +26 -0
  208. package/pennyfarthing-dist/workflows/research/steps-technical/step-04-architectural-patterns.md +26 -0
  209. package/pennyfarthing-dist/workflows/research/steps-technical/step-05-implementation-research.md +29 -1
  210. package/pennyfarthing-dist/workflows/research/steps-technical/step-06-research-synthesis.md +37 -1
  211. package/pennyfarthing-dist/workflows/sprint-planning/steps/step-01-parse-epic-files.md +15 -0
  212. package/pennyfarthing-dist/workflows/sprint-planning/steps/step-02-build-sprint-status.md +17 -0
  213. package/pennyfarthing-dist/workflows/sprint-planning/steps/step-03-status-detection.md +16 -0
  214. package/pennyfarthing-dist/workflows/sprint-planning/steps/step-04-generate-status-file.md +17 -0
  215. package/pennyfarthing-dist/workflows/sprint-planning/steps/step-05-validate-and-report.md +22 -0
  216. package/pennyfarthing-dist/workflows/ux-design/steps/step-01-init.md +6 -0
  217. package/pennyfarthing-dist/workflows/ux-design/steps/step-01b-continue.md +6 -0
  218. package/pennyfarthing-dist/workflows/ux-design/steps/step-02-discovery.md +6 -0
  219. package/pennyfarthing-dist/workflows/ux-design/steps/step-03-core-experience.md +6 -0
  220. package/pennyfarthing-dist/workflows/ux-design/steps/step-04-emotional-response.md +6 -0
  221. package/pennyfarthing-dist/workflows/ux-design/steps/step-05-inspiration.md +6 -0
  222. package/pennyfarthing-dist/workflows/ux-design/steps/step-06-design-system.md +6 -0
  223. package/pennyfarthing-dist/workflows/ux-design/steps/step-07-defining-experience.md +6 -0
  224. package/pennyfarthing-dist/workflows/ux-design/steps/step-08-visual-foundation.md +6 -0
  225. package/pennyfarthing-dist/workflows/ux-design/steps/step-09-design-directions.md +6 -0
  226. package/pennyfarthing-dist/workflows/ux-design/steps/step-10-user-journeys.md +6 -0
  227. package/pennyfarthing-dist/workflows/ux-design/steps/step-11-component-strategy.md +6 -0
  228. package/pennyfarthing-dist/workflows/ux-design/steps/step-12-ux-patterns.md +6 -0
  229. package/pennyfarthing-dist/workflows/ux-design/steps/step-13-responsive-accessibility.md +6 -0
  230. package/pennyfarthing-dist/workflows/ux-design/steps/step-14-complete.md +6 -0
  231. package/pennyfarthing_scripts/__pycache__/__init__.cpython-314.pyc +0 -0
  232. package/pennyfarthing_scripts/__pycache__/cli.cpython-314.pyc +0 -0
  233. package/pennyfarthing_scripts/common/__pycache__/__init__.cpython-314.pyc +0 -0
  234. package/pennyfarthing_scripts/common/__pycache__/config.cpython-314.pyc +0 -0
  235. package/pennyfarthing_scripts/common/__pycache__/output.cpython-314.pyc +0 -0
  236. package/pennyfarthing_scripts/context.py +414 -0
  237. package/pennyfarthing_scripts/migration/__init__.py +39 -0
  238. package/pennyfarthing_scripts/migration/__main__.py +10 -0
  239. package/pennyfarthing_scripts/migration/cli.py +304 -0
  240. package/pennyfarthing_scripts/migration/session.py +384 -0
  241. package/pennyfarthing_scripts/migration/skill.py +188 -0
  242. package/pennyfarthing_scripts/migration/step.py +229 -0
  243. package/pennyfarthing_scripts/migration/validate.py +282 -0
  244. package/pennyfarthing_scripts/patch_mode.py +449 -0
  245. package/pennyfarthing_scripts/prime/__pycache__/__init__.cpython-314.pyc +0 -0
  246. package/pennyfarthing_scripts/prime/__pycache__/cli.cpython-314.pyc +0 -0
  247. package/pennyfarthing_scripts/prime/__pycache__/loader.cpython-314.pyc +0 -0
  248. package/pennyfarthing_scripts/prime/__pycache__/models.cpython-314.pyc +0 -0
  249. package/pennyfarthing_scripts/prime/__pycache__/persona.cpython-314.pyc +0 -0
  250. package/pennyfarthing_scripts/prime/__pycache__/session.cpython-314.pyc +0 -0
  251. package/pennyfarthing_scripts/prime/__pycache__/tiers.cpython-314.pyc +0 -0
  252. package/pennyfarthing_scripts/prime/__pycache__/workflow.cpython-314.pyc +0 -0
  253. package/pennyfarthing_scripts/prime/cli.py +201 -0
  254. package/pennyfarthing_scripts/prime/models.py +9 -0
  255. package/pennyfarthing_scripts/prime/persona.py +41 -0
  256. package/pennyfarthing_scripts/prime/tiers.py +201 -0
  257. package/pennyfarthing_scripts/schema_validation_hook.py +306 -0
  258. package/pennyfarthing_scripts/sprint/__pycache__/__init__.cpython-314.pyc +0 -0
  259. package/pennyfarthing_scripts/sprint/__pycache__/__main__.cpython-314.pyc +0 -0
  260. package/pennyfarthing_scripts/sprint/__pycache__/archive.cpython-314.pyc +0 -0
  261. package/pennyfarthing_scripts/sprint/__pycache__/cli.cpython-314.pyc +0 -0
  262. package/pennyfarthing_scripts/sprint/__pycache__/loader.cpython-314.pyc +0 -0
  263. package/pennyfarthing_scripts/sprint/__pycache__/status.cpython-314.pyc +0 -0
  264. package/pennyfarthing_scripts/sprint/__pycache__/work.cpython-314.pyc +0 -0
  265. package/pennyfarthing_scripts/sprint/archive_epic.py +399 -0
  266. package/pennyfarthing_scripts/sprint/cli.py +100 -0
  267. package/pennyfarthing_scripts/sprint/import_epic.py +431 -0
  268. package/pennyfarthing_scripts/story/__pycache__/__init__.cpython-314.pyc +0 -0
  269. package/pennyfarthing_scripts/story/__pycache__/__main__.cpython-314.pyc +0 -0
  270. package/pennyfarthing_scripts/story/__pycache__/cli.cpython-314.pyc +0 -0
  271. package/pennyfarthing_scripts/story/__pycache__/create.cpython-314.pyc +0 -0
  272. package/pennyfarthing_scripts/story/__pycache__/size.cpython-314.pyc +0 -0
  273. package/pennyfarthing_scripts/story/__pycache__/template.cpython-314.pyc +0 -0
  274. package/pennyfarthing_scripts/tests/test_patch_mode.py +830 -0
  275. package/pennyfarthing_scripts/tests/test_tiers.py +1090 -0
  276. package/pennyfarthing_scripts/tests/test_token_counting.py +559 -0
  277. package/pennyfarthing-dist/scripts/hooks/__pycache__/question_reflector_check.cpython-314.pyc +0 -0
  278. package/pennyfarthing-dist/scripts/sprint/import-epic-to-future.sh +0 -10
  279. package/pennyfarthing-dist/scripts/sprint/import_epic_to_future.py +0 -270
  280. package/pennyfarthing_scripts/__pycache__/__init__.cpython-311.pyc +0 -0
  281. package/pennyfarthing_scripts/__pycache__/config.cpython-314.pyc +0 -0
  282. package/pennyfarthing_scripts/__pycache__/jira.cpython-314.pyc +0 -0
  283. package/pennyfarthing_scripts/__pycache__/jira_bidirectional_sync.cpython-314.pyc +0 -0
  284. package/pennyfarthing_scripts/__pycache__/jira_epic_creation.cpython-314.pyc +0 -0
  285. package/pennyfarthing_scripts/__pycache__/jira_sync.cpython-314.pyc +0 -0
  286. package/pennyfarthing_scripts/__pycache__/jira_sync_story.cpython-314.pyc +0 -0
  287. package/pennyfarthing_scripts/__pycache__/output.cpython-314.pyc +0 -0
  288. package/pennyfarthing_scripts/__pycache__/sprint.cpython-314.pyc +0 -0
  289. package/pennyfarthing_scripts/__pycache__/workflow.cpython-311.pyc +0 -0
  290. package/pennyfarthing_scripts/__pycache__/workflow.cpython-314.pyc +0 -0
  291. package/pennyfarthing_scripts/brownfield/__pycache__/__init__.cpython-314.pyc +0 -0
  292. package/pennyfarthing_scripts/brownfield/__pycache__/__main__.cpython-314.pyc +0 -0
  293. package/pennyfarthing_scripts/brownfield/__pycache__/cli.cpython-314.pyc +0 -0
  294. package/pennyfarthing_scripts/brownfield/__pycache__/discover.cpython-314.pyc +0 -0
  295. package/pennyfarthing_scripts/git/__pycache__/__init__.cpython-314.pyc +0 -0
  296. package/pennyfarthing_scripts/git/__pycache__/create_branches.cpython-314.pyc +0 -0
  297. package/pennyfarthing_scripts/git/__pycache__/status_all.cpython-314.pyc +0 -0
  298. package/pennyfarthing_scripts/jira/__pycache__/__init__.cpython-314.pyc +0 -0
  299. package/pennyfarthing_scripts/jira/__pycache__/__main__.cpython-314.pyc +0 -0
  300. package/pennyfarthing_scripts/jira/__pycache__/bidirectional.cpython-314.pyc +0 -0
  301. package/pennyfarthing_scripts/jira/__pycache__/claim.cpython-314.pyc +0 -0
  302. package/pennyfarthing_scripts/jira/__pycache__/cli.cpython-314.pyc +0 -0
  303. package/pennyfarthing_scripts/jira/__pycache__/client.cpython-314.pyc +0 -0
  304. package/pennyfarthing_scripts/jira/__pycache__/compat.cpython-314.pyc +0 -0
  305. package/pennyfarthing_scripts/jira/__pycache__/epic.cpython-314.pyc +0 -0
  306. package/pennyfarthing_scripts/jira/__pycache__/mappings.cpython-314.pyc +0 -0
  307. package/pennyfarthing_scripts/jira/__pycache__/models.cpython-314.pyc +0 -0
  308. package/pennyfarthing_scripts/jira/__pycache__/story.cpython-314.pyc +0 -0
  309. package/pennyfarthing_scripts/jira/__pycache__/sync.cpython-314.pyc +0 -0
  310. package/pennyfarthing_scripts/preflight/__pycache__/__init__.cpython-314.pyc +0 -0
  311. package/pennyfarthing_scripts/preflight/__pycache__/__main__.cpython-314.pyc +0 -0
  312. package/pennyfarthing_scripts/preflight/__pycache__/cli.cpython-314.pyc +0 -0
  313. package/pennyfarthing_scripts/preflight/__pycache__/finish.cpython-314.pyc +0 -0
  314. package/pennyfarthing_scripts/prime/__pycache__/__main__.cpython-314.pyc +0 -0
  315. package/pennyfarthing_scripts/sprint/__pycache__/validator.cpython-314.pyc +0 -0
  316. package/pennyfarthing_scripts/tests/__pycache__/__init__.cpython-314.pyc +0 -0
  317. package/pennyfarthing_scripts/tests/__pycache__/conftest.cpython-314-pytest-9.0.2.pyc +0 -0
  318. package/pennyfarthing_scripts/tests/__pycache__/test_brownfield.cpython-314-pytest-9.0.2.pyc +0 -0
  319. package/pennyfarthing_scripts/tests/__pycache__/test_cli_modules.cpython-314-pytest-9.0.2.pyc +0 -0
  320. package/pennyfarthing_scripts/tests/__pycache__/test_common.cpython-314-pytest-9.0.2.pyc +0 -0
  321. package/pennyfarthing_scripts/tests/__pycache__/test_git_utils.cpython-314-pytest-9.0.2.pyc +0 -0
  322. package/pennyfarthing_scripts/tests/__pycache__/test_jira_package.cpython-314-pytest-9.0.2.pyc +0 -0
  323. package/pennyfarthing_scripts/tests/__pycache__/test_package_structure.cpython-314-pytest-9.0.2.pyc +0 -0
  324. package/pennyfarthing_scripts/tests/__pycache__/test_prime.cpython-314-pytest-9.0.2.pyc +0 -0
  325. package/pennyfarthing_scripts/tests/__pycache__/test_sprint_package.cpython-314-pytest-9.0.2.pyc +0 -0
  326. package/pennyfarthing_scripts/tests/__pycache__/test_sprint_validator.cpython-314-pytest-9.0.2.pyc +0 -0
  327. package/pennyfarthing_scripts/tests/__pycache__/test_story_package.cpython-314-pytest-9.0.2.pyc +0 -0
  328. package/pennyfarthing_scripts/tests/__pycache__/test_workflow_check.cpython-314-pytest-9.0.2.pyc +0 -0
  329. package/pennyfarthing_scripts/tests/__pycache__/test_workflow_cli.cpython-314-pytest-9.0.2.pyc +0 -0
@@ -19,13 +19,7 @@ if [[ -z "$EPIC_ID" ]]; then
19
19
  fi
20
20
 
21
21
  # Find project root
22
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
23
- d="$PWD"
24
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
25
- d="$(dirname "$d")"
26
- done
27
- PROJECT_ROOT="$d"
28
- fi
22
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
29
23
 
30
24
  SPRINT_FILE="$PROJECT_ROOT/sprint/current-sprint.yaml"
31
25
  SCRIPTS_DIR="$PROJECT_ROOT/.pennyfarthing/scripts"
@@ -14,14 +14,8 @@ if [[ -z "$EPIC_JIRA_KEY" || -z "$STORY_ID" ]]; then
14
14
  exit 1
15
15
  fi
16
16
 
17
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
18
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
19
- d="$PWD"
20
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
21
- d="$(dirname "$d")"
22
- done
23
- PROJECT_ROOT="$d"
24
- fi
17
+ # Find project root
18
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
25
19
 
26
20
  SPRINT_FILE="$PROJECT_ROOT/sprint/current-sprint.yaml"
27
21
  JIRA_PROJECT="${JIRA_PROJECT_KEY:-MSSCI}"
@@ -13,14 +13,8 @@
13
13
 
14
14
  set -euo pipefail
15
15
 
16
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
17
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
18
- d="$PWD"
19
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
20
- d="$(dirname "$d")"
21
- done
22
- PROJECT_ROOT="$d"
23
- fi
16
+ # Find project root
17
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
24
18
 
25
19
  SPRINT_FILE="$PROJECT_ROOT/sprint/current-sprint.yaml"
26
20
  FIX_MODE="${1:-}"
@@ -1,61 +1,58 @@
1
1
  #!/usr/bin/env bash
2
- # Shared utility: Find project root via BASH_SOURCE self-location
2
+ # Shared utility: Find project root
3
3
  #
4
- # Core principle: Scripts derive paths from their own location, not from $PWD.
5
- # A script in pennyfarthing-dist/scripts/<category>/ is always 3 levels below
6
- # the package root. This works regardless of where the user invoked it from.
4
+ # Resolution order:
5
+ # 1. Honor explicit PROJECT_ROOT override (from Claude Code or user)
6
+ # 2. BASH_SOURCE derivation (auto-detect caller's location)
7
+ # 3. PWD walk looking for .pennyfarthing/ (fallback)
7
8
  #
8
9
  # Usage:
9
- # SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
10
- # source "$SCRIPT_DIR/../lib/find-root.sh"
10
+ # source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
11
11
  # # PROJECT_ROOT is now set
12
12
 
13
- # Require SCRIPT_DIR to be set by caller
14
- if [[ -z "${SCRIPT_DIR:-}" ]]; then
15
- echo "Error: SCRIPT_DIR must be set before sourcing find-root.sh" >&2
16
- echo "Add this before sourcing:" >&2
17
- echo ' SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"' >&2
18
- exit 1
19
- fi
20
-
21
- # Allow explicit override via PENNYFARTHING_ROOT (avoids conflict with orchestrator's PROJECT_ROOT)
22
- if [[ -n "${PENNYFARTHING_ROOT:-}" ]]; then
23
- PROJECT_ROOT="$PENNYFARTHING_ROOT"
13
+ # Allow explicit override
14
+ if [[ -n "${PROJECT_ROOT:-}" ]]; then
24
15
  export PROJECT_ROOT
25
16
  return 0 2>/dev/null || exit 0
26
17
  fi
27
18
 
28
- # Resolve SCRIPT_DIR (follow symlinks to real location)
29
- _real_script_dir="$(cd "$SCRIPT_DIR" && pwd -P)"
19
+ # BASH_SOURCE approach: derive from caller's location
20
+ # BASH_SOURCE[1] is the script that sourced us, BASH_SOURCE[0] is this file
21
+ _caller_script="${BASH_SOURCE[1]:-}"
22
+ if [[ -n "$_caller_script" ]]; then
23
+ _real_dir="$(cd "$(dirname "$_caller_script")" && pwd -P)"
24
+ if [[ "$_real_dir" == */pennyfarthing-dist/scripts/* ]] || \
25
+ [[ "$_real_dir" == */.pennyfarthing/scripts/* ]]; then
26
+ # Extract package root from path
27
+ _pkg="${_real_dir%/scripts/*}"
28
+ _pkg="${_pkg%/pennyfarthing-dist}"
29
+ _pkg="${_pkg%/.pennyfarthing}"
30
+ if [[ "$_pkg" == */node_modules/* ]]; then
31
+ PROJECT_ROOT="${_pkg%/node_modules/*}"
32
+ else
33
+ PROJECT_ROOT="$_pkg"
34
+ fi
35
+ unset _real_dir _pkg _caller_script
36
+ export PROJECT_ROOT
37
+ return 0 2>/dev/null || exit 0
38
+ fi
39
+ unset _real_dir
40
+ fi
41
+ unset _caller_script
30
42
 
31
- # Derive package root from script location
32
- # Scripts can be in:
33
- # - pennyfarthing-dist/scripts/<category>/ (npm package or framework dev)
34
- # - .pennyfarthing/scripts/<category>/ (consumer project after init)
35
- if [[ "$_real_script_dir" == */pennyfarthing-dist/scripts/* ]]; then
36
- # Extract everything before /pennyfarthing-dist/scripts/
37
- _pkg_root="${_real_script_dir%/pennyfarthing-dist/scripts/*}"
43
+ # Fallback: walk up from PWD looking for .pennyfarthing/
44
+ _d="$PWD"
45
+ while [[ ! -d "$_d/.pennyfarthing" ]] && [[ "$_d" != "/" ]]; do
46
+ _d="$(dirname "$_d")"
47
+ done
38
48
 
39
- # Determine context: framework dev or consumer?
40
- # Check node_modules FIRST - if we're in node_modules, we're always a consumer
41
- if [[ "$_pkg_root" == */node_modules/* ]]; then
42
- # Consumer context: walk up from node_modules to project
43
- PROJECT_ROOT="${_pkg_root%/node_modules/*}"
44
- elif [[ -d "$_pkg_root/pennyfarthing-dist" && ! -L "$_pkg_root/pennyfarthing-dist" ]]; then
45
- # Framework context: package root IS project root
46
- PROJECT_ROOT="$_pkg_root"
47
- else
48
- PROJECT_ROOT="$_pkg_root"
49
- fi
50
- elif [[ "$_real_script_dir" == */.pennyfarthing/scripts/* ]]; then
51
- # Consumer project context: scripts copied to .pennyfarthing/scripts/
52
- # Extract everything before /.pennyfarthing/scripts/
53
- PROJECT_ROOT="${_real_script_dir%/.pennyfarthing/scripts/*}"
49
+ if [[ -d "$_d/.pennyfarthing" ]]; then
50
+ PROJECT_ROOT="$_d"
54
51
  else
55
- echo "Error: Script not in expected location (pennyfarthing-dist/scripts/ or .pennyfarthing/scripts/)" >&2
56
- echo "SCRIPT_DIR=$_real_script_dir" >&2
52
+ echo "Error: Could not find .pennyfarthing/ directory" >&2
53
+ echo "Are you in a Pennyfarthing-enabled project?" >&2
57
54
  exit 1
58
55
  fi
59
56
 
60
- unset _real_script_dir _pkg_root
57
+ unset _d
61
58
  export PROJECT_ROOT
@@ -12,13 +12,7 @@
12
12
  set -euo pipefail
13
13
 
14
14
  # Find project root
15
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
16
- d="$PWD"
17
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
18
- d="$(dirname "$d")"
19
- done
20
- PROJECT_ROOT="$d"
21
- fi
15
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
22
16
 
23
17
  SIDECAR_DIR="$PROJECT_ROOT/.pennyfarthing/sidecars"
24
18
  FIX_MODE="${1:-}"
@@ -40,14 +40,8 @@ if [[ -z "$STORY_ID" ]]; then
40
40
  exit 1
41
41
  fi
42
42
 
43
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
44
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
45
- d="$PWD"
46
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
47
- d="$(dirname "$d")"
48
- done
49
- PROJECT_ROOT="$d"
50
- fi
43
+ # Find project root
44
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
51
45
 
52
46
  SPRINT_FILE="$PROJECT_ROOT/sprint/current-sprint.yaml"
53
47
 
@@ -6,14 +6,8 @@
6
6
 
7
7
  set -euo pipefail
8
8
 
9
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
10
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
11
- d="$PWD"
12
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
13
- d="$(dirname "$d")"
14
- done
15
- PROJECT_ROOT="$d"
16
- fi
9
+ # Find project root
10
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
17
11
 
18
12
  SPRINT_FILE="$PROJECT_ROOT/sprint/current-sprint.yaml"
19
13
 
@@ -18,14 +18,8 @@ if [[ -z "$ID" ]]; then
18
18
  exit 1
19
19
  fi
20
20
 
21
- # PROJECT_ROOT should be set by find-root.sh
22
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
23
- d="$PWD"
24
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
25
- d="$(dirname "$d")"
26
- done
27
- PROJECT_ROOT="$d"
28
- fi
21
+ # Find project root
22
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
29
23
 
30
24
  SPRINT_FILE="$PROJECT_ROOT/sprint/current-sprint.yaml"
31
25
 
@@ -32,14 +32,8 @@ if [[ ! "$EPIC_ID" =~ ^epic- ]]; then
32
32
  EPIC_ID="epic-$EPIC_ID"
33
33
  fi
34
34
 
35
- # PROJECT_ROOT should be set by find-root.sh
36
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
37
- d="$PWD"
38
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
39
- d="$(dirname "$d")"
40
- done
41
- PROJECT_ROOT="$d"
42
- fi
35
+ # Find project root
36
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
43
37
 
44
38
  SPRINT_FILE="$PROJECT_ROOT/sprint/current-sprint.yaml"
45
39
 
@@ -27,14 +27,8 @@ if [[ -z "$STORY_ID" || -z "$FIELD" ]]; then
27
27
  exit 1
28
28
  fi
29
29
 
30
- # PROJECT_ROOT should be set by find-root.sh
31
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
32
- d="$PWD"
33
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
34
- d="$(dirname "$d")"
35
- done
36
- PROJECT_ROOT="$d"
37
- fi
30
+ # Find project root
31
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
38
32
 
39
33
  SPRINT_FILE="$PROJECT_ROOT/sprint/current-sprint.yaml"
40
34
 
@@ -7,14 +7,8 @@
7
7
 
8
8
  set -euo pipefail
9
9
 
10
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
11
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
12
- d="$PWD"
13
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
14
- d="$(dirname "$d")"
15
- done
16
- PROJECT_ROOT="$d"
17
- fi
10
+ # Find project root
11
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
18
12
 
19
13
  FUTURE_FILE="$PROJECT_ROOT/sprint/future.yaml"
20
14
 
@@ -27,14 +27,8 @@ if [[ -z "$SPRINT_YYWW" || -z "$JIRA_ID" || -z "$START_DATE" || -z "$END_DATE" |
27
27
  exit 1
28
28
  fi
29
29
 
30
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
31
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
32
- d="$PWD"
33
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
34
- d="$(dirname "$d")"
35
- done
36
- PROJECT_ROOT="$d"
37
- fi
30
+ # Find project root
31
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
38
32
  TEMPLATE_FILE="$PROJECT_ROOT/sprint/sprint-template.yaml"
39
33
  SPRINT_FILE="$PROJECT_ROOT/sprint/current-sprint.yaml"
40
34
  ARCHIVE_FILE="$PROJECT_ROOT/sprint/archive/sprint-${SPRINT_YYWW}-completed.yaml"
@@ -21,14 +21,8 @@ if [[ -z "$EPIC_ID" ]]; then
21
21
  exit 1
22
22
  fi
23
23
 
24
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
25
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
26
- d="$PWD"
27
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
28
- d="$(dirname "$d")"
29
- done
30
- PROJECT_ROOT="$d"
31
- fi
24
+ # Find project root
25
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
32
26
 
33
27
  FUTURE_FILE="$PROJECT_ROOT/sprint/future.yaml"
34
28
  SPRINT_FILE="$PROJECT_ROOT/sprint/current-sprint.yaml"
@@ -6,14 +6,8 @@
6
6
 
7
7
  set -euo pipefail
8
8
 
9
- # PROJECT_ROOT should be set by find-root.sh
10
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
11
- d="$PWD"
12
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
13
- d="$(dirname "$d")"
14
- done
15
- PROJECT_ROOT="$d"
16
- fi
9
+ # Find project root
10
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
17
11
 
18
12
  SPRINT_FILE="$PROJECT_ROOT/sprint/current-sprint.yaml"
19
13
 
@@ -28,8 +28,9 @@ mkdir -p "$TEST_DIR/scripts"
28
28
 
29
29
  # Copy core scripts (including agent-session.sh)
30
30
  mkdir -p "$TEST_DIR/scripts/core"
31
+ mkdir -p "$TEST_DIR/scripts/lib"
31
32
  cp "$PROJECT_ROOT/scripts/core/agent-session.sh" "$TEST_DIR/scripts/core/"
32
- cp "$PROJECT_ROOT/scripts/core/run.sh" "$TEST_DIR/scripts/"
33
+ cp "$PROJECT_ROOT/scripts/lib/find-root.sh" "$TEST_DIR/scripts/lib/"
33
34
 
34
35
  # Create minimal theme file
35
36
  cat > "$TEST_DIR/.pennyfarthing/personas/themes/test-theme.yaml" << 'EOF'
@@ -40,14 +40,8 @@ if [[ -z "$STORY_ID" ]]; then
40
40
  exit 1
41
41
  fi
42
42
 
43
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
44
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
45
- d="$PWD"
46
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
47
- d="$(dirname "$d")"
48
- done
49
- PROJECT_ROOT="$d"
50
- fi
43
+ # Find project root
44
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
51
45
 
52
46
  SESSION_FILE="$PROJECT_ROOT/.session/${STORY_ID}-session.md"
53
47
  SPRINT_FILE="$PROJECT_ROOT/sprint/current-sprint.yaml"
@@ -63,7 +57,8 @@ if [[ ! -f "$SESSION_FILE" ]]; then
63
57
  fi
64
58
 
65
59
  # Extract metadata from session file (handle both "**Jira:**" and "- **Jira:**" formats)
66
- JIRA_KEY=$(grep -E '\*\*Jira:\*\*' "$SESSION_FILE" | sed 's/.*\*\*Jira:\*\* //' | tr -d ' ' || echo "")
60
+ # Also handle markdown link format: [MSSCI-12721](https://...)
61
+ JIRA_KEY=$(grep -E '\*\*Jira:\*\*' "$SESSION_FILE" | sed 's/.*\*\*Jira:\*\* //' | sed 's/\[//' | sed 's/\].*//' | tr -d ' ' || echo "")
67
62
  # Extract branch - strip any trailing annotations like "(pushed)"
68
63
  BRANCH=$(grep -E '\*\*Branch:\*\*' "$SESSION_FILE" | sed 's/.*\*\*Branch:\*\* //' | sed 's/ *(.*//' | tr -d ' ' || echo "")
69
64
 
@@ -46,14 +46,8 @@ if [[ -z "$STORY_ID" ]] || [[ -z "$TARGET_PHASE" ]]; then
46
46
  exit 1
47
47
  fi
48
48
 
49
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
50
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
51
- d="$PWD"
52
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
53
- d="$(dirname "$d")"
54
- done
55
- PROJECT_ROOT="$d"
56
- fi
49
+ # Find project root
50
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
57
51
 
58
52
  # Try multiple session file naming patterns
59
53
  SESSION_FILE=""
@@ -7,14 +7,8 @@
7
7
 
8
8
  set -euo pipefail
9
9
 
10
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
11
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
12
- d="$PWD"
13
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
14
- d="$(dirname "$d")"
15
- done
16
- PROJECT_ROOT="$d"
17
- fi
10
+ # Find project root
11
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
18
12
 
19
13
  WORKFLOWS_DIR="$PROJECT_ROOT/.pennyfarthing/workflows"
20
14
 
@@ -14,13 +14,7 @@ if [[ -z "$WORKFLOW" || -z "$PHASE" ]]; then
14
14
  fi
15
15
 
16
16
  # Find project root
17
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
18
- d="$PWD"
19
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
20
- d="$(dirname "$d")"
21
- done
22
- PROJECT_ROOT="$d"
23
- fi
17
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
24
18
 
25
19
  WORKFLOW_FILE="$PROJECT_ROOT/.pennyfarthing/workflows/${WORKFLOW}.yaml"
26
20
 
@@ -6,14 +6,8 @@
6
6
 
7
7
  set -euo pipefail
8
8
 
9
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
10
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
11
- d="$PWD"
12
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
13
- d="$(dirname "$d")"
14
- done
15
- PROJECT_ROOT="$d"
16
- fi
9
+ # Find project root
10
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
17
11
 
18
12
  WORKFLOWS_DIR="$PROJECT_ROOT/.pennyfarthing/workflows"
19
13
  SESSION_DIR="$PROJECT_ROOT/.session"
@@ -8,14 +8,8 @@
8
8
 
9
9
  set -euo pipefail
10
10
 
11
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
12
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
13
- d="$PWD"
14
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
15
- d="$(dirname "$d")"
16
- done
17
- PROJECT_ROOT="$d"
18
- fi
11
+ # Find project root
12
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
19
13
 
20
14
  WORKFLOWS_DIR="$PROJECT_ROOT/.pennyfarthing/workflows"
21
15
  SESSION_DIR="$PROJECT_ROOT/.session"
@@ -7,14 +7,8 @@
7
7
 
8
8
  set -euo pipefail
9
9
 
10
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
11
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
12
- d="$PWD"
13
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
14
- d="$(dirname "$d")"
15
- done
16
- PROJECT_ROOT="$d"
17
- fi
10
+ # Find project root
11
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
18
12
 
19
13
  WORKFLOWS_DIR="$PROJECT_ROOT/.pennyfarthing/workflows"
20
14
  SESSION_DIR="$PROJECT_ROOT/.session"
@@ -6,14 +6,8 @@
6
6
 
7
7
  set -euo pipefail
8
8
 
9
- # PROJECT_ROOT should be set by find-root.sh, but find it if not
10
- if [[ -z "${PROJECT_ROOT:-}" ]]; then
11
- d="$PWD"
12
- while [[ ! -d "$d/.pennyfarthing" ]] && [[ "$d" != "/" ]]; do
13
- d="$(dirname "$d")"
14
- done
15
- PROJECT_ROOT="$d"
16
- fi
9
+ # Find project root
10
+ source "$(dirname "${BASH_SOURCE[0]}")/../lib/find-root.sh"
17
11
 
18
12
  WORKFLOWS_DIR="$PROJECT_ROOT/.pennyfarthing/workflows"
19
13
  SESSION_DIR="$PROJECT_ROOT/.session"
@@ -6,6 +6,10 @@ allowed_tools: [Read, Glob, Grep, Task]
6
6
 
7
7
  # Agentic Patterns Skill
8
8
 
9
+ <run>When designing agent behavior, debugging agent failures, improving agent reliability.</run>
10
+
11
+ <output>Core reasoning patterns for building effective LLM agents. Includes ReAct, Plan-and-Execute, Self-Reflection, confidence calibration, error recovery, multi-agent coordination, and context management strategies.</output>
12
+
9
13
  **Purpose:** Core reasoning patterns for building effective LLM agents.
10
14
 
11
15
  **Use when:** Designing agent behavior, debugging agent failures, improving agent reliability.
@@ -3,6 +3,24 @@ name: changelog
3
3
  description: Maintain changelogs following Keep a Changelog format. Use when creating release notes, parsing conventional commits for changelog entries, auto-generating changelog sections from git history, or preparing CHANGELOG.md for releases.
4
4
  ---
5
5
 
6
+ <run>
7
+ Commands for changelog maintenance:
8
+ - Parse conventional commits for changelog entries
9
+ - Auto-generate changelog sections from git history
10
+ - Version bump decisions using semantic versioning
11
+ - Create release notes and CHANGELOG.md updates
12
+ </run>
13
+
14
+ <output>
15
+ Changelog entries in Keep a Changelog format:
16
+ - Added (new features from `feat:` commits)
17
+ - Changed (changes from `perf:` commits, breaking changes)
18
+ - Deprecated (features marked for removal)
19
+ - Removed (removed features)
20
+ - Fixed (bug fixes from `fix:` commits)
21
+ - Security (vulnerability fixes)
22
+ </output>
23
+
6
24
  # Changelog Management Skill
7
25
 
8
26
  ## When to Use This Skill
@@ -3,7 +3,11 @@ name: code-review
3
3
  description: Code review checklists and patterns for Pennyfarthing. Use when reviewing PRs, self-reviewing code, or checking for common issues before commit.
4
4
  ---
5
5
 
6
- # Code Review Skill
6
+ # Code Review Skill
7
+
8
+ <run>Review code against the checklists below. Focus on authorization, error handling, TypeScript/React patterns, and performance.</run>
9
+
10
+ <output>Code review comments using [MUST FIX], [SUGGESTION], [QUESTION], [NICE] prefixes</output>
7
11
 
8
12
  ## Overview
9
13
 
@@ -6,6 +6,9 @@ allowed_tools: [Read, Glob, Grep, Task]
6
6
 
7
7
  # Context Engineering Skill
8
8
 
9
+ <run>context-engineering</run>
10
+ <output>strategies for managing context windows in long-running agent sessions</output>
11
+
9
12
  **Purpose:** Strategies for managing context windows efficiently in long-running agent sessions.
10
13
 
11
14
  **Use when:** Working on complex tasks, approaching context limits, designing subagent prompts.
@@ -15,7 +15,7 @@ args: "[check|status]"
15
15
  Check if running inside Cyclist visual terminal.
16
16
 
17
17
  <run>
18
- .pennyfarthing/scripts cyclist/is-cyclist.sh
18
+ .pennyfarthing/scripts/cyclist/is-cyclist.sh
19
19
  </run>
20
20
 
21
21
  <output>
@@ -23,7 +23,7 @@ JSON: `{"cyclist": true}` with exit 0 if in Cyclist, `{"cyclist": false}` with e
23
23
  </output>
24
24
 
25
25
  <example>
26
- .pennyfarthing/scripts cyclist/is-cyclist.sh
26
+ .pennyfarthing/scripts/cyclist/is-cyclist.sh
27
27
  # Returns: {"cyclist": true}
28
28
  </example>
29
29
 
@@ -4,6 +4,30 @@ description: Common development patterns, fixes, and gotchas. Use when implement
4
4
  allowed_tools: [Read, Glob, Grep, Task]
5
5
  ---
6
6
 
7
+ <run>
8
+ Reference this skill when implementing features, debugging issues, or avoiding known pitfalls in development. Use these patterns to guide:
9
+ - Working directory management in bash commands
10
+ - TypeScript type system decisions
11
+ - Error handling in Go
12
+ - Test structure and isolation
13
+ - HTTP status code selection
14
+ - Turn-efficient coding practices
15
+ - Background task execution
16
+
17
+ The patterns capture common gotchas and solutions across multiple languages and frameworks.
18
+ </run>
19
+
20
+ <output>
21
+ Following these patterns produces:
22
+ - Reliable bash commands that work regardless of current directory
23
+ - TypeScript builds that pass verbatimModuleSyntax validation
24
+ - Go code with proper error handling and validation
25
+ - Well-isolated, maintainable test suites
26
+ - Consistent HTTP API behavior
27
+ - Faster task completion through turn-efficient techniques
28
+ - Properly tracked background operations
29
+ </output>
30
+
7
31
  # Dev Patterns Skill
8
32
 
9
33
  ## Overview
@@ -381,7 +405,7 @@ TaskOutput tool:
381
405
  Use the background task tracking utilities to manage session file entries:
382
406
 
383
407
  ```bash
384
- source $CLAUDE_PROJECT_DIR/scripts/utils/background-tasks.sh
408
+ source $CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/lib/background-tasks.sh
385
409
  SESSION_FILE="$CLAUDE_PROJECT_DIR/.session/${STORY_ID}-session.md"
386
410
 
387
411
  # After spawning background task, record it:
@@ -5,6 +5,9 @@ description: Validate and save benchmark run results. Use when completing a benc
5
5
 
6
6
  # Finalize Run Skill
7
7
 
8
+ <run>Validates and saves benchmark run results</run>
9
+ <output>JSON with validation success status and saved file path</output>
10
+
8
11
  All runs MUST pass through this skill before saving. This is the guardrail.
9
12
 
10
13
  ## Invocation