@pennyfarthing/core 11.2.2 → 11.3.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 (168) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/packages/core/dist/cli/commands/doctor-legacy.test.js +2 -2
  4. package/packages/core/dist/cli/commands/doctor-legacy.test.js.map +1 -1
  5. package/packages/core/dist/cli/commands/doctor.d.ts +63 -0
  6. package/packages/core/dist/cli/commands/doctor.d.ts.map +1 -1
  7. package/packages/core/dist/cli/commands/doctor.js +280 -43
  8. package/packages/core/dist/cli/commands/doctor.js.map +1 -1
  9. package/packages/core/dist/cli/commands/init.d.ts +12 -0
  10. package/packages/core/dist/cli/commands/init.d.ts.map +1 -1
  11. package/packages/core/dist/cli/commands/init.js +45 -0
  12. package/packages/core/dist/cli/commands/init.js.map +1 -1
  13. package/packages/core/dist/cli/commands/pyproject-install.test.d.ts +19 -0
  14. package/packages/core/dist/cli/commands/pyproject-install.test.d.ts.map +1 -0
  15. package/packages/core/dist/cli/commands/pyproject-install.test.js +261 -0
  16. package/packages/core/dist/cli/commands/pyproject-install.test.js.map +1 -0
  17. package/packages/core/dist/cli/commands/update-consolidation.test.js +14 -6
  18. package/packages/core/dist/cli/commands/update-consolidation.test.js.map +1 -1
  19. package/packages/core/dist/cli/commands/update.d.ts.map +1 -1
  20. package/packages/core/dist/cli/commands/update.js +5 -1
  21. package/packages/core/dist/cli/commands/update.js.map +1 -1
  22. package/packages/core/dist/cli/index.js +2 -0
  23. package/packages/core/dist/cli/index.js.map +1 -1
  24. package/packages/core/dist/cli/utils/python.d.ts +1 -0
  25. package/packages/core/dist/cli/utils/python.d.ts.map +1 -1
  26. package/packages/core/dist/cli/utils/python.js +22 -1
  27. package/packages/core/dist/cli/utils/python.js.map +1 -1
  28. package/packages/core/dist/cli/utils/settings-hook-migration.test.d.ts +17 -0
  29. package/packages/core/dist/cli/utils/settings-hook-migration.test.d.ts.map +1 -0
  30. package/packages/core/dist/cli/utils/settings-hook-migration.test.js +382 -0
  31. package/packages/core/dist/cli/utils/settings-hook-migration.test.js.map +1 -0
  32. package/packages/core/dist/cli/utils/settings-pf-wrapper.test.d.ts +16 -0
  33. package/packages/core/dist/cli/utils/settings-pf-wrapper.test.d.ts.map +1 -0
  34. package/packages/core/dist/cli/utils/settings-pf-wrapper.test.js +377 -0
  35. package/packages/core/dist/cli/utils/settings-pf-wrapper.test.js.map +1 -0
  36. package/packages/core/dist/cli/utils/settings.d.ts.map +1 -1
  37. package/packages/core/dist/cli/utils/settings.js +15 -2
  38. package/packages/core/dist/cli/utils/settings.js.map +1 -1
  39. package/packages/core/dist/server/paths.d.ts.map +1 -1
  40. package/packages/core/dist/server/paths.js +6 -0
  41. package/packages/core/dist/server/paths.js.map +1 -1
  42. package/packages/core/dist/server/settings.d.ts.map +1 -1
  43. package/packages/core/dist/server/settings.js +5 -0
  44. package/packages/core/dist/server/settings.js.map +1 -1
  45. package/packages/core/dist/workflow/tandem-workflow-templates.test.js +7 -5
  46. package/packages/core/dist/workflow/tandem-workflow-templates.test.js.map +1 -1
  47. package/packages/core/dist/workflow/workflow-graph-validation.d.ts +65 -0
  48. package/packages/core/dist/workflow/workflow-graph-validation.d.ts.map +1 -0
  49. package/packages/core/dist/workflow/workflow-graph-validation.js +190 -0
  50. package/packages/core/dist/workflow/workflow-graph-validation.js.map +1 -0
  51. package/packages/core/dist/workflow/workflow-graph-validation.test.d.ts +18 -0
  52. package/packages/core/dist/workflow/workflow-graph-validation.test.d.ts.map +1 -0
  53. package/packages/core/dist/workflow/workflow-graph-validation.test.js +706 -0
  54. package/packages/core/dist/workflow/workflow-graph-validation.test.js.map +1 -0
  55. package/packages/core/dist/workflow/workflow-migration.test.js +6 -5
  56. package/packages/core/dist/workflow/workflow-migration.test.js.map +1 -1
  57. package/pennyfarthing-dist/agents/dev.md +4 -2
  58. package/pennyfarthing-dist/agents/devops.md +2 -10
  59. package/pennyfarthing-dist/agents/reviewer-preflight.md +4 -5
  60. package/pennyfarthing-dist/agents/sm.md +4 -17
  61. package/pennyfarthing-dist/commands/pf-health-check.md +30 -11
  62. package/pennyfarthing-dist/gates/{confidence-sm.md → confidence.md} +16 -17
  63. package/pennyfarthing-dist/gates/dev-exit.md +75 -0
  64. package/pennyfarthing-dist/gates/merge-ready.md +49 -0
  65. package/pennyfarthing-dist/gates/release-ready.md +95 -0
  66. package/pennyfarthing-dist/gates/reviewer-preflight-check.md +90 -0
  67. package/pennyfarthing-dist/gates/sm-setup-exit.md +82 -0
  68. package/pennyfarthing-dist/guides/agent-behavior.md +88 -30
  69. package/pennyfarthing-dist/guides/gates.md +7 -2
  70. package/pennyfarthing-dist/scripts/lib/find-root.sh +5 -0
  71. package/pennyfarthing-dist/scripts/lib/run-pf.sh +7 -0
  72. package/pennyfarthing-dist/skills/pf-settings/skill.md +42 -0
  73. package/pennyfarthing-dist/skills/skill-registry.yaml +15 -0
  74. package/pennyfarthing-dist/templates/pyproject.toml +27 -0
  75. package/pennyfarthing-dist/workflows/bdd-tandem.yaml +7 -3
  76. package/pennyfarthing-dist/workflows/bdd.yaml +7 -3
  77. package/pennyfarthing-dist/workflows/installation-check/steps/step-01-foundation.md +77 -0
  78. package/pennyfarthing-dist/workflows/installation-check/steps/step-02-commands.md +82 -0
  79. package/pennyfarthing-dist/workflows/installation-check/steps/step-03-hooks.md +121 -0
  80. package/pennyfarthing-dist/workflows/installation-check/steps/step-04-scripts.md +83 -0
  81. package/pennyfarthing-dist/workflows/installation-check/steps/step-05-layout.md +81 -0
  82. package/pennyfarthing-dist/workflows/installation-check/steps/step-06-legacy.md +94 -0
  83. package/pennyfarthing-dist/workflows/installation-check/steps/step-07-tools.md +80 -0
  84. package/pennyfarthing-dist/workflows/installation-check/steps/step-08-summary.md +99 -0
  85. package/pennyfarthing-dist/workflows/installation-check/workflow.yaml +47 -0
  86. package/pennyfarthing-dist/workflows/tdd-tandem.yaml +7 -3
  87. package/pennyfarthing-dist/workflows/tdd.yaml +7 -3
  88. package/pennyfarthing-dist/workflows/trivial.yaml +7 -3
  89. package/pennyfarthing_scripts/__pycache__/__init__.cpython-314.pyc +0 -0
  90. package/pennyfarthing_scripts/__pycache__/cli.cpython-314.pyc +0 -0
  91. package/pennyfarthing_scripts/__pycache__/context.cpython-314.pyc +0 -0
  92. package/pennyfarthing_scripts/bc/__pycache__/cli.cpython-314.pyc +0 -0
  93. package/pennyfarthing_scripts/bc/__pycache__/focus.cpython-314.pyc +0 -0
  94. package/pennyfarthing_scripts/bc/__pycache__/split.cpython-314.pyc +0 -0
  95. package/pennyfarthing_scripts/bc/cli.py +21 -0
  96. package/pennyfarthing_scripts/bc/focus.py +1 -0
  97. package/pennyfarthing_scripts/bc/split.py +52 -0
  98. package/pennyfarthing_scripts/bikerack/__pycache__/audit_log_panel.cpython-314.pyc +0 -0
  99. package/pennyfarthing_scripts/bikerack/__pycache__/base_panel.cpython-314.pyc +0 -0
  100. package/pennyfarthing_scripts/bikerack/__pycache__/changed_panel.cpython-314.pyc +0 -0
  101. package/pennyfarthing_scripts/bikerack/__pycache__/context_meter_footer.cpython-314.pyc +0 -0
  102. package/pennyfarthing_scripts/bikerack/__pycache__/debug_panel.cpython-314.pyc +0 -0
  103. package/pennyfarthing_scripts/bikerack/__pycache__/diffs_panel.cpython-314.pyc +0 -0
  104. package/pennyfarthing_scripts/bikerack/__pycache__/events.cpython-314.pyc +0 -0
  105. package/pennyfarthing_scripts/bikerack/__pycache__/launcher.cpython-314.pyc +0 -0
  106. package/pennyfarthing_scripts/bikerack/__pycache__/portrait_resolver.cpython-314.pyc +0 -0
  107. package/pennyfarthing_scripts/bikerack/__pycache__/progress_panel.cpython-314.pyc +0 -0
  108. package/pennyfarthing_scripts/bikerack/__pycache__/sprint_panel.cpython-314.pyc +0 -0
  109. package/pennyfarthing_scripts/bikerack/__pycache__/tui.cpython-314.pyc +0 -0
  110. package/pennyfarthing_scripts/bikerack/__pycache__/ws_client.cpython-314.pyc +0 -0
  111. package/pennyfarthing_scripts/bikerack/context_meter_footer.py +53 -3
  112. package/pennyfarthing_scripts/bikerack/tui.py +202 -8
  113. package/pennyfarthing_scripts/bmad/__init__.py +1 -0
  114. package/pennyfarthing_scripts/bmad/__pycache__/__init__.cpython-314.pyc +0 -0
  115. package/pennyfarthing_scripts/bmad/__pycache__/cli.cpython-314.pyc +0 -0
  116. package/pennyfarthing_scripts/bmad/__pycache__/parser.cpython-314.pyc +0 -0
  117. package/pennyfarthing_scripts/bmad/__pycache__/sync.cpython-314.pyc +0 -0
  118. package/pennyfarthing_scripts/bmad/__pycache__/test_parser.cpython-314-pytest-9.0.2.pyc +0 -0
  119. package/pennyfarthing_scripts/bmad/__pycache__/test_sync.cpython-314-pytest-9.0.2.pyc +0 -0
  120. package/pennyfarthing_scripts/bmad/cli.py +197 -0
  121. package/pennyfarthing_scripts/bmad/importer.py +200 -0
  122. package/pennyfarthing_scripts/bmad/parser.py +233 -0
  123. package/pennyfarthing_scripts/bmad/sync.py +464 -0
  124. package/pennyfarthing_scripts/bmad/test_parser.py +253 -0
  125. package/pennyfarthing_scripts/bmad/test_sync.py +223 -0
  126. package/pennyfarthing_scripts/cli.py +10 -0
  127. package/pennyfarthing_scripts/common/__pycache__/config.cpython-314.pyc +0 -0
  128. package/pennyfarthing_scripts/consultation/__pycache__/cli.cpython-314.pyc +0 -0
  129. package/pennyfarthing_scripts/handoff/__pycache__/cli.cpython-314.pyc +0 -0
  130. package/pennyfarthing_scripts/handoff/__pycache__/complete_phase.cpython-314.pyc +0 -0
  131. package/pennyfarthing_scripts/handoff/__pycache__/gate_file.cpython-314.pyc +0 -0
  132. package/pennyfarthing_scripts/handoff/__pycache__/gate_runner.cpython-314.pyc +0 -0
  133. package/pennyfarthing_scripts/handoff/__pycache__/marker.cpython-314.pyc +0 -0
  134. package/pennyfarthing_scripts/handoff/__pycache__/resolve_gate.cpython-314.pyc +0 -0
  135. package/pennyfarthing_scripts/hooks/__pycache__/__init__.cpython-314.pyc +0 -0
  136. package/pennyfarthing_scripts/hooks/__pycache__/bell_mode.cpython-314.pyc +0 -0
  137. package/pennyfarthing_scripts/hooks/__pycache__/cli.cpython-314.pyc +0 -0
  138. package/pennyfarthing_scripts/hooks/__pycache__/context_breaker.cpython-314.pyc +0 -0
  139. package/pennyfarthing_scripts/hooks/__pycache__/context_warning.cpython-314.pyc +0 -0
  140. package/pennyfarthing_scripts/hooks/__pycache__/cyclist_pretooluse.cpython-314.pyc +0 -0
  141. package/pennyfarthing_scripts/hooks/__pycache__/pre_edit_check.cpython-314.pyc +0 -0
  142. package/pennyfarthing_scripts/hooks/__pycache__/reflector_check.cpython-314.pyc +0 -0
  143. package/pennyfarthing_scripts/hooks/__pycache__/schema_validation.cpython-314.pyc +0 -0
  144. package/pennyfarthing_scripts/hooks/__pycache__/session_start.cpython-314.pyc +0 -0
  145. package/pennyfarthing_scripts/hooks/__pycache__/session_stop.cpython-314.pyc +0 -0
  146. package/pennyfarthing_scripts/hooks/__pycache__/sprint_yaml_validation.cpython-314.pyc +0 -0
  147. package/pennyfarthing_scripts/hooks/__pycache__/statusline.cpython-314.pyc +0 -0
  148. package/pennyfarthing_scripts/prime/__pycache__/workflow.cpython-314.pyc +0 -0
  149. package/pennyfarthing_scripts/settings/__init__.py +0 -0
  150. package/pennyfarthing_scripts/settings/__pycache__/__init__.cpython-314.pyc +0 -0
  151. package/pennyfarthing_scripts/settings/__pycache__/cli.cpython-314.pyc +0 -0
  152. package/pennyfarthing_scripts/settings/__pycache__/settings.cpython-314.pyc +0 -0
  153. package/pennyfarthing_scripts/settings/cli.py +55 -0
  154. package/pennyfarthing_scripts/settings/settings.py +98 -0
  155. package/pennyfarthing_scripts/sprint/__pycache__/cli.cpython-314.pyc +0 -0
  156. package/pennyfarthing_scripts/sprint/__pycache__/loader.cpython-314.pyc +0 -0
  157. package/pennyfarthing_scripts/sprint/__pycache__/story_update.cpython-314.pyc +0 -0
  158. package/pennyfarthing_scripts/tests/__pycache__/test_confidence_sm_evaluation.cpython-314-pytest-9.0.2.pyc +0 -0
  159. package/pennyfarthing_scripts/tests/__pycache__/test_confidence_sm_gate.cpython-314-pytest-9.0.2.pyc +0 -0
  160. package/pennyfarthing_scripts/tests/__pycache__/test_gate_file_resolution.cpython-314-pytest-9.0.2.pyc +0 -0
  161. package/pennyfarthing_scripts/tests/__pycache__/test_gate_runner.cpython-314-pytest-9.0.2.pyc +0 -0
  162. package/pennyfarthing_scripts/tests/__pycache__/test_resolve_gate_file_field.cpython-314-pytest-9.0.2.pyc +0 -0
  163. package/pennyfarthing_scripts/tests/__pycache__/test_workflow_list_team.cpython-314.pyc +0 -0
  164. package/pennyfarthing_scripts/tests/test_confidence_sm_gate.py +17 -16
  165. package/pennyfarthing_scripts/tests/test_resolve_gate_file_field.py +45 -47
  166. package/pennyfarthing_scripts/tests/test_workflow_list_team.py +0 -4
  167. package/pennyfarthing_scripts/workflow/__pycache__/cli.cpython-314.pyc +0 -0
  168. package/pennyfarthing_scripts/workflow/__pycache__/state.cpython-314.pyc +0 -0
@@ -0,0 +1,82 @@
1
+ # Step 2: Commands & Skills
2
+
3
+ <step-meta>
4
+ step: 2
5
+ name: commands
6
+ workflow: installation-check
7
+ agent: devops
8
+ gate: false
9
+ next: step-03-hooks
10
+ </step-meta>
11
+
12
+ <purpose>
13
+ Verify that slash commands, skills, user project files, and configuration are properly installed. These are the agent interface layer — what users and agents interact with directly.
14
+ </purpose>
15
+
16
+ <prerequisites>
17
+ - Foundation check (step 1) completed
18
+ - `.claude/` directory exists
19
+ </prerequisites>
20
+
21
+ <instructions>
22
+ 1. Run the doctor command for the commands category
23
+ 2. For each result, explain what it checks and why it matters:
24
+ - **core/commands**: Slash commands (`.claude/commands/pf-*.md`) should be file copies (not symlinks) to avoid node_modules drift. Stale copies mean agents use outdated instructions.
25
+ - **core/skills**: Skills (`.claude/skills/pf-*/`) should also be file copies. Missing skills break agent workflows.
26
+ - **project/directory**: `.claude/project/` holds user-specific project configuration.
27
+ - **project/sidecars**: `.pennyfarthing/sidecars/` stores per-agent learning files that accumulate context across sessions.
28
+ - **persona-config**: `.pennyfarthing/config.local.yaml` sets the active theme. Without it, agents use default (unthemed) personas.
29
+ - **settings.local.json**: The most critical user file — registers hooks with Claude Code. Missing = no hooks, no OTEL, no bell mode.
30
+ 3. For warnings about stale/symlinked commands, explain the migration from symlinks to copies (v11.3.0+)
31
+ 4. Present the collaboration menu
32
+ </instructions>
33
+
34
+ <actions>
35
+ - Run: `pennyfarthing doctor --json --category commands`
36
+ - Check: `.claude/commands/` contains `pf-*` files (copies, not symlinks)
37
+ - Check: `.claude/skills/` contains `pf-*` directories (copies, not symlinks)
38
+ - Check: `.pennyfarthing/config.local.yaml` exists
39
+ </actions>
40
+
41
+ <output>
42
+ Present results in a clear table format:
43
+
44
+ ```markdown
45
+ ## Commands & Skills Check Results
46
+
47
+ | Check | Status | Detail |
48
+ |-------|--------|--------|
49
+ | commands | ... | ... |
50
+ | skills | ... | ... |
51
+ | project dir | ... | ... |
52
+ | sidecars | ... | ... |
53
+ | persona config | ... | ... |
54
+ | settings.local.json | ... | ... |
55
+
56
+ ### Issues Found
57
+ [Explain each failure/warning with remediation steps]
58
+ ```
59
+ </output>
60
+
61
+ <collaboration-menu>
62
+ - **[F] Fix** - Run `pennyfarthing doctor --fix --category commands` to auto-repair
63
+ - **[E] Explain** - Deep dive on a specific check result
64
+ - **[C] Continue** - Proceed to Hook Configuration check
65
+ - **[R] Recheck** - Re-run after manual changes
66
+ </collaboration-menu>
67
+
68
+ <next-step>
69
+ After reviewing command and skill results, proceed to step-03-hooks.md for Hook Configuration verification.
70
+ </next-step>
71
+
72
+ ## Failure Modes
73
+
74
+ - Commands still symlinked from pre-v11.3 installs
75
+ - Skills missing after partial update
76
+ - settings.local.json deleted by user accidentally
77
+
78
+ ## Success Metrics
79
+
80
+ - All commands and skills are file copies (not symlinks)
81
+ - settings.local.json exists
82
+ - User understands the symlink-to-copy migration
@@ -0,0 +1,121 @@
1
+ # Step 3: Hook Configuration
2
+
3
+ <step-meta>
4
+ step: 3
5
+ name: hooks
6
+ workflow: installation-check
7
+ agent: devops
8
+ gate: true
9
+ next: step-04-scripts
10
+ </step-meta>
11
+
12
+ <purpose>
13
+ Verify all 9 hook configurations in settings.local.json. Hooks are the runtime integration between Pennyfarthing and Claude Code — each one controls a critical behavior. This is the most complex and consequential category, which is why it has a gate.
14
+ </purpose>
15
+
16
+ <prerequisites>
17
+ - settings.local.json exists (verified in step 2)
18
+ - User understands that hooks are registered in `.claude/settings.local.json`
19
+ </prerequisites>
20
+
21
+ <instructions>
22
+ 1. Run the doctor command for the hooks category
23
+ 2. For each of the 9 hook checks, explain what it does, why it matters, and the impact of it being missing:
24
+
25
+ **SessionStart hooks:**
26
+ - **session-start-hook**: Exports `PROJECT_ROOT` env var. Without it, agents can't find project files. The most critical hook.
27
+ - **otel-auto-start**: Starts WheelHub server and configures 5 OTEL env vars for telemetry. Legacy `.sh` version only sets 2 of 5 vars.
28
+ - **auto-load-sm**: Auto-invokes `/sm` agent on new sessions. Without it, users must manually run `/sm` every time.
29
+
30
+ **Stop hooks:**
31
+ - **stop-hook**: Runs reflector-check to enforce CYCLIST markers at turn end. Without it, Cyclist QuickActions won't render.
32
+
33
+ **PostToolUse hooks:**
34
+ - **post-tool-use-hook**: Bell mode — injects queued messages via `additionalContext`. Without it, `/bell` messages are lost.
35
+ - **sprint-yaml-validation**: Validates sprint YAML after edits. Without it, malformed YAML breaks SprintPanel.
36
+
37
+ **PreToolUse hooks:**
38
+ - **context-circuit-breaker**: Auto-saves session when context exceeds threshold. Without it, long sessions lose work.
39
+ - **schema-validation**: Validates XML schema on Write to session/skill/step files. Without it, malformed files slip through.
40
+
41
+ **Permissions:**
42
+ - **benchmark-permissions**: `Bash(claude:*)` needed for parallel benchmarks. Without it, only sequential runs work.
43
+
44
+ 3. For each warning/failure, explain the specific impact and offer targeted fix
45
+ 4. Present gate criteria for user approval
46
+
47
+ **IMPORTANT:** Modifying settings.local.json affects all Claude Code sessions. Explain this to the user before applying fixes.
48
+ </instructions>
49
+
50
+ <actions>
51
+ - Run: `pennyfarthing doctor --json --category hooks`
52
+ - Read: `.claude/settings.local.json` to show current hook configuration
53
+ </actions>
54
+
55
+ <output>
56
+ Present results grouped by hook type:
57
+
58
+ ```markdown
59
+ ## Hook Configuration Results
60
+
61
+ ### SessionStart Hooks
62
+ | Hook | Status | Detail |
63
+ |------|--------|--------|
64
+ | session-start | ... | ... |
65
+ | otel-auto-start | ... | ... |
66
+ | auto-load-sm | ... | ... |
67
+
68
+ ### Stop Hooks
69
+ | Hook | Status | Detail |
70
+ |------|--------|--------|
71
+ | reflector-check | ... | ... |
72
+
73
+ ### PostToolUse Hooks
74
+ | Hook | Status | Detail |
75
+ |------|--------|--------|
76
+ | bell-mode | ... | ... |
77
+ | sprint-yaml | ... | ... |
78
+
79
+ ### PreToolUse Hooks
80
+ | Hook | Status | Detail |
81
+ |------|--------|--------|
82
+ | context-circuit-breaker | ... | ... |
83
+ | schema-validation | ... | ... |
84
+
85
+ ### Permissions
86
+ | Check | Status | Detail |
87
+ |-------|--------|--------|
88
+ | benchmark-permissions | ... | ... |
89
+ ```
90
+ </output>
91
+
92
+ <gate>
93
+ ## Completion Criteria
94
+ - [ ] All 9 hook checks reviewed with user
95
+ - [ ] User understands what each hook controls
96
+ - [ ] Any fixes to settings.local.json approved by user
97
+ - [ ] User confirmed hook configuration is acceptable
98
+ </gate>
99
+
100
+ <collaboration-menu>
101
+ - **[F] Fix** - Run `pennyfarthing doctor --fix --category hooks` to add missing hooks
102
+ - **[E] Explain** - Deep dive on a specific hook's behavior
103
+ - **[C] Continue** - Approve configuration and proceed to Scripts check
104
+ - **[R] Recheck** - Re-run after manual edits to settings.local.json
105
+ </collaboration-menu>
106
+
107
+ <next-step>
108
+ After user approves hook configuration, proceed to step-04-scripts.md for Hook Scripts verification.
109
+ </next-step>
110
+
111
+ ## Failure Modes
112
+
113
+ - Applying fixes without understanding what each hook does
114
+ - Not realizing settings.local.json changes affect all sessions
115
+ - Skipping gate without reviewing critical hooks (session-start, context-circuit-breaker)
116
+
117
+ ## Success Metrics
118
+
119
+ - All 9 hooks configured or user made informed decision to skip
120
+ - User understands the relationship between hooks and features
121
+ - Gate approval recorded
@@ -0,0 +1,83 @@
1
+ # Step 4: Hook Scripts
2
+
3
+ <step-meta>
4
+ step: 4
5
+ name: scripts
6
+ workflow: installation-check
7
+ agent: devops
8
+ gate: false
9
+ next: step-05-layout
10
+ </step-meta>
11
+
12
+ <purpose>
13
+ Verify that hook script files exist on disk and are executable. Step 3 checked that hooks are registered in settings.local.json — this step checks that the script files those hooks point to actually exist and can run.
14
+ </purpose>
15
+
16
+ <prerequisites>
17
+ - Hook configuration reviewed (step 3)
18
+ - Installation type known (symlink vs copy mode)
19
+ </prerequisites>
20
+
21
+ <instructions>
22
+ 1. Run the doctor command for the scripts category
23
+ 2. For each result, explain the relationship between the settings entry and the script file:
24
+ - **hook/* checks**: Scripts in `.pennyfarthing/scripts/hooks/` (symlink mode) or `.claude/pennyfarthing/scripts/hooks/` (copy mode). These are the actual bash scripts that hooks execute.
25
+ - **Execute permissions**: Scripts must be executable (`chmod +x`). A registered hook pointing to a non-executable script causes "Permission denied" errors on every tool use.
26
+ - **git-hook/* checks**: Scripts in `.git/hooks/` (pre-commit, pre-push, post-merge). Framework repos should use symlinks to `pennyfarthing-dist/scripts/hooks/`; end-user repos use copies.
27
+ 3. For git hooks, explain the difference between framework symlinks and user copies
28
+ 4. Present the collaboration menu
29
+ </instructions>
30
+
31
+ <actions>
32
+ - Run: `pennyfarthing doctor --json --category scripts`
33
+ - Check: Hook scripts at `.pennyfarthing/scripts/hooks/` are executable
34
+ - Check: Git hooks at `.git/hooks/` are up-to-date
35
+ </actions>
36
+
37
+ <output>
38
+ Present results in two sections:
39
+
40
+ ```markdown
41
+ ## Hook Scripts
42
+
43
+ | Script | Status | Detail |
44
+ |--------|--------|--------|
45
+ | session-start.sh | ... | ... |
46
+ | pre-edit-check.sh | ... | ... |
47
+ | context-warning.sh | ... | ... |
48
+ | context-circuit-breaker.sh | ... | ... |
49
+ | bell-mode-hook.sh | ... | ... |
50
+ | question-reflector-check.sh | ... | ... |
51
+ | sprint-yaml-validation.sh | ... | ... |
52
+
53
+ ## Git Hooks
54
+
55
+ | Hook | Status | Detail |
56
+ |------|--------|--------|
57
+ | pre-commit | ... | ... |
58
+ | pre-push | ... | ... |
59
+ | post-merge | ... | ... |
60
+ ```
61
+ </output>
62
+
63
+ <collaboration-menu>
64
+ - **[F] Fix** - Run `pennyfarthing doctor --fix --category scripts` to fix permissions and stale hooks
65
+ - **[E] Explain** - Deep dive on a specific script's behavior
66
+ - **[C] Continue** - Proceed to Layout check
67
+ - **[R] Recheck** - Re-run after manual changes
68
+ </collaboration-menu>
69
+
70
+ <next-step>
71
+ After reviewing script results, proceed to step-05-layout.md for Directory & File Layout verification.
72
+ </next-step>
73
+
74
+ ## Failure Modes
75
+
76
+ - Scripts missing after partial update (need `pennyfarthing update`)
77
+ - Execute permission stripped by git or file copy operations
78
+ - Git hooks stale after package version bump
79
+
80
+ ## Success Metrics
81
+
82
+ - All hook scripts exist and are executable
83
+ - Git hooks match package source (or are custom non-pennyfarthing hooks)
@@ -0,0 +1,81 @@
1
+ # Step 5: Directory & File Layout
2
+
3
+ <step-meta>
4
+ step: 5
5
+ name: layout
6
+ workflow: installation-check
7
+ agent: devops
8
+ gate: false
9
+ next: step-06-legacy
10
+ </step-meta>
11
+
12
+ <purpose>
13
+ Verify that files and directories are at their correct locations. Pennyfarthing has migrated file locations across versions — this step ensures everything is at the current canonical paths and flags any files stuck at old locations.
14
+ </purpose>
15
+
16
+ <prerequisites>
17
+ - Foundation and commands checks completed (steps 1-2)
18
+ </prerequisites>
19
+
20
+ <instructions>
21
+ 1. Run the doctor command for the layout category
22
+ 2. For each result, explain the expected location and why it matters:
23
+ - **dir/sprint**: `sprint/` directory holds sprint tracking YAML files.
24
+ - **dir/session**: `.session/` stores active work session files for each story.
25
+ - **layout/manifest**: `.pennyfarthing/manifest.json` tracks installed version.
26
+ - **layout/config**: `.pennyfarthing/config.local.yaml` stores theme and local settings.
27
+ - **layout/settings**: `.claude/settings.local.json` registers hooks with Claude Code.
28
+ - **layout/sidecars**: `.pennyfarthing/sidecars/` stores per-agent learning files.
29
+ - **layout/project-hooks**: `.pennyfarthing/project/hooks/` stores user-customized hook scripts (setup-env.sh, auto-load-sm.sh).
30
+ - **layout/*-old-location**: Files found at legacy paths that should be migrated.
31
+ 3. For old-location warnings, explain when the migration happened and what the fix does
32
+ 4. Present the collaboration menu
33
+ </instructions>
34
+
35
+ <actions>
36
+ - Run: `pennyfarthing doctor --json --category layout`
37
+ - Check: `sprint/` and `.session/` directories exist
38
+ - Check: Files at canonical `.pennyfarthing/` locations
39
+ </actions>
40
+
41
+ <output>
42
+ Present results:
43
+
44
+ ```markdown
45
+ ## Directory & File Layout Results
46
+
47
+ | Check | Status | Detail |
48
+ |-------|--------|--------|
49
+ | sprint dir | ... | ... |
50
+ | session dir | ... | ... |
51
+ | manifest location | ... | ... |
52
+ | config location | ... | ... |
53
+ | settings location | ... | ... |
54
+ | sidecars location | ... | ... |
55
+ | project hooks | ... | ... |
56
+
57
+ ### Migration Needed
58
+ [List any files at old locations with migration path]
59
+ ```
60
+ </output>
61
+
62
+ <collaboration-menu>
63
+ - **[F] Fix** - Run `pennyfarthing doctor --fix --category layout` to migrate files
64
+ - **[E] Explain** - Deep dive on the file layout evolution
65
+ - **[C] Continue** - Proceed to Legacy cleanup check
66
+ - **[R] Recheck** - Re-run after manual moves
67
+ </collaboration-menu>
68
+
69
+ <next-step>
70
+ After reviewing layout results, proceed to step-06-legacy.md for Legacy artifact cleanup.
71
+ </next-step>
72
+
73
+ ## Failure Modes
74
+
75
+ - Moving files manually without updating references in settings.local.json
76
+ - Missing sprint/ or .session/ directories (need `pennyfarthing init`)
77
+
78
+ ## Success Metrics
79
+
80
+ - All files at canonical locations
81
+ - No old-location warnings remaining
@@ -0,0 +1,94 @@
1
+ # Step 6: Legacy Artifact Cleanup
2
+
3
+ <step-meta>
4
+ step: 6
5
+ name: legacy
6
+ workflow: installation-check
7
+ agent: devops
8
+ gate: true
9
+ next: step-07-tools
10
+ </step-meta>
11
+
12
+ <purpose>
13
+ Detect and clean up legacy artifacts from previous Pennyfarthing versions. These include old statusline scripts, persona configs at deprecated paths, legacy sidecar directories, and hook commands still using `.sh` scripts instead of `pf hooks` commands. This step has a gate because some fixes delete files.
14
+ </purpose>
15
+
16
+ <prerequisites>
17
+ - Layout check completed (step 5)
18
+ - User understands current vs legacy file locations
19
+ </prerequisites>
20
+
21
+ <instructions>
22
+ 1. Run the doctor command for the legacy category
23
+ 2. For each result, explain what the legacy artifact is and why it should be cleaned up:
24
+ - **legacy/.claude/scripts/statusline.sh**: Old statusline location that may shadow the proper `.pennyfarthing/scripts/misc/statusline.sh`.
25
+ - **legacy/.claude/persona-config.yaml**: Pre-v7 theme config. Should be migrated to `.pennyfarthing/config.local.yaml`.
26
+ - **legacy/.claude/project/agents/sidecars**: Pre-v8 sidecar location. Should be at `.pennyfarthing/sidecars/`.
27
+ - **legacy/sprint/sidecars**: Another pre-v8 sidecar location.
28
+ - **legacy/.claude/project/hooks/setup-env.sh**: Pre-v9 hook location. Should be at `.pennyfarthing/project/hooks/`.
29
+ - **settings/statusline-path**: settings.local.json references a legacy statusline script path.
30
+ - **legacy/hook-commands**: Hook entries in settings.local.json still use `.sh` script paths instead of `pf hooks` commands. The `.sh` scripts work (they're shims) but `pf hooks` is faster — no shell indirection.
31
+ 3. For each fix, explain what will be deleted or moved and whether it's reversible
32
+ 4. Present gate criteria — user must approve before files are deleted
33
+
34
+ **IMPORTANT:** Legacy cleanup deletes files. The user may have customized legacy locations. Always explain what will be removed before applying fixes.
35
+ </instructions>
36
+
37
+ <actions>
38
+ - Run: `pennyfarthing doctor --json --category legacy`
39
+ - Check: No legacy artifacts at `.claude/scripts/`, `.claude/persona-config.yaml`
40
+ - Check: No legacy sidecar directories
41
+ - Check: Hook commands use `pf hooks` not `.sh` scripts
42
+ </actions>
43
+
44
+ <output>
45
+ Present results:
46
+
47
+ ```markdown
48
+ ## Legacy Artifact Check Results
49
+
50
+ | Artifact | Status | Detail |
51
+ |----------|--------|--------|
52
+ | statusline.sh | ... | ... |
53
+ | persona-config.yaml | ... | ... |
54
+ | agent sidecars | ... | ... |
55
+ | sprint sidecars | ... | ... |
56
+ | project hooks | ... | ... |
57
+ | statusline path | ... | ... |
58
+ | hook commands | ... | ... |
59
+
60
+ ### Cleanup Actions
61
+ [For each warning, explain what the fix will do: delete, move, or update]
62
+ ```
63
+ </output>
64
+
65
+ <gate>
66
+ ## Completion Criteria
67
+ - [ ] All legacy artifacts reviewed with user
68
+ - [ ] User understands what each cleanup action will do
69
+ - [ ] User approved or declined each destructive cleanup
70
+ - [ ] No unapproved file deletions performed
71
+ </gate>
72
+
73
+ <collaboration-menu>
74
+ - **[F] Fix** - Run `pennyfarthing doctor --fix --category legacy` to clean up (requires gate approval)
75
+ - **[E] Explain** - Deep dive on a specific legacy artifact's history
76
+ - **[C] Continue** - Approve cleanup and proceed to Tools check
77
+ - **[R] Recheck** - Re-run after manual cleanup
78
+ </collaboration-menu>
79
+
80
+ <next-step>
81
+ After user approves legacy cleanup, proceed to step-07-tools.md for Optional Tools verification.
82
+ </next-step>
83
+
84
+ ## Failure Modes
85
+
86
+ - Deleting customized legacy files without checking for user modifications
87
+ - Not explaining that `.sh` shims still work (migration is optional optimization)
88
+ - Removing sidecar directories before confirming new location has the content
89
+
90
+ ## Success Metrics
91
+
92
+ - All legacy artifacts addressed (cleaned up or acknowledged)
93
+ - User made informed decisions about each cleanup action
94
+ - Gate approval recorded
@@ -0,0 +1,80 @@
1
+ # Step 7: Optional Tools
2
+
3
+ <step-meta>
4
+ step: 7
5
+ name: tools
6
+ workflow: installation-check
7
+ agent: devops
8
+ gate: false
9
+ next: step-08-summary
10
+ </step-meta>
11
+
12
+ <purpose>
13
+ Check optional components that enhance but are not required for core Pennyfarthing functionality. These include the Cyclist visual terminal and the pf Python CLI.
14
+ </purpose>
15
+
16
+ <prerequisites>
17
+ - Core installation verified (steps 1-6)
18
+ </prerequisites>
19
+
20
+ <instructions>
21
+ 1. Run the doctor command for the tools category
22
+ 2. For each result, explain what the tool provides and when it's needed:
23
+ - **cyclist/installed**: Cyclist is the Electron visual terminal for Pennyfarthing. It provides a graphical UI with panels for sprint tracking, diffs, workflow visualization, and more. Not required for CLI-only usage.
24
+ - **cyclist/node-pty**: node-pty powers the terminal panel in Cyclist. Without it, the embedded terminal won't work but other panels still function.
25
+ - **cyclist/spawn-helper**: The native binary that node-pty uses to spawn processes. Must have execute permission on macOS/Linux. Missing permission causes `posix_spawnp` failures.
26
+ - **tools/pf-cli**: The Python `pf` command provides agent activation (`pf agent start`), hook dispatch (`pf hooks`), and sprint management. Required for agent workflows. Installable via `uv tool install pennyfarthing-scripts` or `pipx install pennyfarthing-scripts`.
27
+ 3. For missing tools, explain whether they're required or optional based on the user's workflow
28
+ 4. Present the collaboration menu
29
+ </instructions>
30
+
31
+ <actions>
32
+ - Run: `pennyfarthing doctor --json --category tools`
33
+ - Check: Cyclist package location and node-pty health
34
+ - Check: `pf` CLI is available and reports a version
35
+ </actions>
36
+
37
+ <output>
38
+ Present results:
39
+
40
+ ```markdown
41
+ ## Optional Tools Check Results
42
+
43
+ ### Cyclist Visual Terminal
44
+ | Check | Status | Detail |
45
+ |-------|--------|--------|
46
+ | installed | ... | ... |
47
+ | node-pty | ... | ... |
48
+ | spawn-helper | ... | ... |
49
+
50
+ ### Python CLI
51
+ | Check | Status | Detail |
52
+ |-------|--------|--------|
53
+ | pf CLI | ... | ... |
54
+
55
+ ### Recommendation
56
+ [Based on results, recommend which tools to install for the user's use case]
57
+ ```
58
+ </output>
59
+
60
+ <collaboration-menu>
61
+ - **[F] Fix** - Run `pennyfarthing doctor --fix --category tools` to fix permissions or install pf CLI
62
+ - **[E] Explain** - Deep dive on a specific tool's purpose
63
+ - **[C] Continue** - Proceed to Summary
64
+ - **[R] Recheck** - Re-run after installing tools
65
+ </collaboration-menu>
66
+
67
+ <next-step>
68
+ After reviewing tools, proceed to step-08-summary.md for the final health report.
69
+ </next-step>
70
+
71
+ ## Failure Modes
72
+
73
+ - Installing Cyclist when only CLI usage is needed (unnecessary complexity)
74
+ - spawn-helper permission issues after pnpm install (common on macOS)
75
+
76
+ ## Success Metrics
77
+
78
+ - User understands which tools they need
79
+ - Required tools (pf CLI) are installed
80
+ - Optional tools have clear install path if wanted
@@ -0,0 +1,99 @@
1
+ # Step 8: Health Summary
2
+
3
+ <step-meta>
4
+ step: 8
5
+ name: summary
6
+ workflow: installation-check
7
+ agent: devops
8
+ gate: false
9
+ next: complete
10
+ </step-meta>
11
+
12
+ <purpose>
13
+ Aggregate results from all previous steps into a final health report with an overall score and prioritized recommendations.
14
+ </purpose>
15
+
16
+ <prerequisites>
17
+ - All previous steps (1-7) completed
18
+ </prerequisites>
19
+
20
+ <instructions>
21
+ 1. Run the full doctor command to get a complete picture
22
+ 2. Aggregate results into a health score:
23
+ - **HEALTHY**: All checks pass (0 failures, 0 warnings)
24
+ - **GOOD**: No failures, some warnings (non-critical issues)
25
+ - **NEEDS_ATTENTION**: 1-3 failures (some features broken)
26
+ - **NEEDS_FIX**: 4+ failures (significant functionality impaired)
27
+ 3. Group remaining issues by priority:
28
+ - **Critical**: Failures that break core functionality (missing settings.local.json, broken symlinks, missing manifest)
29
+ - **Important**: Warnings that degrade features (missing hooks, stale commands, non-executable scripts)
30
+ - **Optional**: Informational items (legacy artifacts, missing optional tools)
31
+ 4. For each remaining issue, provide the specific fix command
32
+ 5. Write the summary to the output file if configured
33
+ 6. Suggest next steps based on the health score
34
+ </instructions>
35
+
36
+ <actions>
37
+ - Run: `pennyfarthing doctor --json`
38
+ - Write: `{output_file}` with full health report
39
+ </actions>
40
+
41
+ <output>
42
+ Present the final report:
43
+
44
+ ```markdown
45
+ # Pennyfarthing Health Report
46
+
47
+ **Project:** {project_root}
48
+ **Version:** {installed_version} / {package_version}
49
+ **Mode:** {installation_type}
50
+ **Health:** {HEALTHY | GOOD | NEEDS_ATTENTION | NEEDS_FIX}
51
+ **Score:** {pass_count}/{total_count} checks passing
52
+
53
+ ## Results by Category
54
+
55
+ | Category | Pass | Warn | Fail |
56
+ |----------|------|------|------|
57
+ | Installation | ... | ... | ... |
58
+ | Commands & Skills | ... | ... | ... |
59
+ | Hook Configuration | ... | ... | ... |
60
+ | Hook Scripts | ... | ... | ... |
61
+ | Directory Layout | ... | ... | ... |
62
+ | Legacy Artifacts | ... | ... | ... |
63
+ | Optional Tools | ... | ... | ... |
64
+
65
+ ## Remaining Issues (by priority)
66
+
67
+ ### Critical
68
+ [List failures with fix commands]
69
+
70
+ ### Important
71
+ [List warnings with fix commands]
72
+
73
+ ### Optional
74
+ [List informational items]
75
+
76
+ ## Recommended Next Steps
77
+ 1. [Based on health score]
78
+ 2. [Specific to findings]
79
+ ```
80
+ </output>
81
+
82
+ <collaboration-menu>
83
+ - **[F] Fix** - Run `pennyfarthing doctor --fix` to auto-repair all fixable issues
84
+ - **[E] Explain** - Deep dive on any remaining issue
85
+ - **[C] Continue** - Complete the health check workflow
86
+ - **[R] Recheck** - Run full check again to verify fixes
87
+ </collaboration-menu>
88
+
89
+ ## Failure Modes
90
+
91
+ - Reporting HEALTHY when critical issues were skipped in earlier steps
92
+ - Not prioritizing issues (user doesn't know what to fix first)
93
+
94
+ ## Success Metrics
95
+
96
+ - Complete health report generated
97
+ - All issues categorized by priority
98
+ - Clear next steps provided
99
+ - User has actionable path to resolve any remaining issues
@@ -0,0 +1,47 @@
1
+ # Installation Check Workflow
2
+ # Interactive health check with AI-guided explanation and remediation
3
+ #
4
+ # Flow: Foundation → Commands → Hooks (gate) → Scripts → Layout → Legacy (gate) → Tools → Summary
5
+ # Wraps `pennyfarthing doctor --category` for step-by-step guided verification
6
+ #
7
+ # Use for: onboarding, post-update verification, troubleshooting broken installs
8
+
9
+ workflow:
10
+ name: installation-check
11
+ description: Interactive installation health check with AI-guided remediation. Walks through each check category with explanation and targeted fixes.
12
+ version: "1.0.0"
13
+ type: stepped
14
+
15
+ steps:
16
+ path: ./steps/
17
+ pattern: step-{nn}-*.md
18
+
19
+ variables:
20
+ project_root: .
21
+ doctor_command: pennyfarthing doctor --json
22
+ output_file: .session/doctor-results.md
23
+
24
+ gates:
25
+ after_steps: [3, 6]
26
+ gate_marker: "<!-- GATE -->"
27
+
28
+ collaboration:
29
+ menus:
30
+ - key: F
31
+ name: Fix
32
+ description: Apply recommended fixes for this category
33
+ - key: E
34
+ name: Explain
35
+ description: Get detailed explanation of a specific check
36
+ - key: C
37
+ name: Continue
38
+ description: Proceed to next check category
39
+ - key: R
40
+ name: Recheck
41
+ description: Re-run checks after manual changes
42
+
43
+ agent: devops
44
+
45
+ triggers:
46
+ types: [installation-check, doctor, health-check]
47
+ tags: [installation, health, diagnostics]