@pennyfarthing/core 7.4.1 → 7.6.0

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 (127) hide show
  1. package/package.json +1 -1
  2. package/packages/core/dist/cli/commands/doctor-legacy.test.d.ts +13 -0
  3. package/packages/core/dist/cli/commands/doctor-legacy.test.d.ts.map +1 -0
  4. package/packages/core/dist/cli/commands/doctor-legacy.test.js +207 -0
  5. package/packages/core/dist/cli/commands/doctor-legacy.test.js.map +1 -0
  6. package/packages/core/dist/cli/commands/doctor.d.ts +16 -0
  7. package/packages/core/dist/cli/commands/doctor.d.ts.map +1 -1
  8. package/packages/core/dist/cli/commands/doctor.js +130 -2
  9. package/packages/core/dist/cli/commands/doctor.js.map +1 -1
  10. package/packages/core/dist/cli/commands/init.d.ts.map +1 -1
  11. package/packages/core/dist/cli/commands/init.js +17 -27
  12. package/packages/core/dist/cli/commands/init.js.map +1 -1
  13. package/packages/core/dist/cli/commands/update.d.ts.map +1 -1
  14. package/packages/core/dist/cli/commands/update.js +21 -52
  15. package/packages/core/dist/cli/commands/update.js.map +1 -1
  16. package/packages/core/dist/cli/utils/symlinks.d.ts +15 -0
  17. package/packages/core/dist/cli/utils/symlinks.d.ts.map +1 -1
  18. package/packages/core/dist/cli/utils/symlinks.js +148 -2
  19. package/packages/core/dist/cli/utils/symlinks.js.map +1 -1
  20. package/packages/core/dist/cli/utils/themes.d.ts.map +1 -1
  21. package/packages/core/dist/cli/utils/themes.js +9 -0
  22. package/packages/core/dist/cli/utils/themes.js.map +1 -1
  23. package/pennyfarthing-dist/agents/dev.md +29 -24
  24. package/pennyfarthing-dist/agents/handoff.md +42 -119
  25. package/pennyfarthing-dist/agents/reviewer.md +32 -37
  26. package/pennyfarthing-dist/agents/sm-handoff.md +43 -66
  27. package/pennyfarthing-dist/agents/sm.md +52 -35
  28. package/pennyfarthing-dist/agents/tea.md +25 -8
  29. package/pennyfarthing-dist/agents/testing-runner.md +4 -4
  30. package/pennyfarthing-dist/commands/architect.md +0 -55
  31. package/pennyfarthing-dist/commands/dev.md +1 -54
  32. package/pennyfarthing-dist/commands/devops.md +0 -52
  33. package/pennyfarthing-dist/commands/health-check.md +33 -0
  34. package/pennyfarthing-dist/commands/orchestrator.md +0 -49
  35. package/pennyfarthing-dist/commands/pm.md +0 -53
  36. package/pennyfarthing-dist/commands/reviewer.md +1 -58
  37. package/pennyfarthing-dist/commands/sm.md +1 -64
  38. package/pennyfarthing-dist/commands/sprint.md +133 -0
  39. package/pennyfarthing-dist/commands/standalone.md +194 -0
  40. package/pennyfarthing-dist/commands/tea.md +1 -57
  41. package/pennyfarthing-dist/commands/tech-writer.md +0 -46
  42. package/pennyfarthing-dist/commands/theme-maker.md +10 -5
  43. package/pennyfarthing-dist/commands/ux-designer.md +0 -55
  44. package/pennyfarthing-dist/guides/XML-TAGS.md +156 -0
  45. package/pennyfarthing-dist/guides/agent-behavior.md +64 -38
  46. package/pennyfarthing-dist/guides/measurement-framework.md +210 -0
  47. package/pennyfarthing-dist/personas/themes/a-team.yaml +130 -0
  48. package/pennyfarthing-dist/personas/themes/alice-in-wonderland.yaml +1 -1
  49. package/pennyfarthing-dist/personas/themes/ancient-strategists.yaml +1 -1
  50. package/pennyfarthing-dist/personas/themes/arcane.yaml +1 -1
  51. package/pennyfarthing-dist/personas/themes/better-call-saul.yaml +1 -1
  52. package/pennyfarthing-dist/personas/themes/big-lebowski.yaml +1 -1
  53. package/pennyfarthing-dist/personas/themes/black-sails.yaml +1 -1
  54. package/pennyfarthing-dist/personas/themes/blade-runner.yaml +1 -1
  55. package/pennyfarthing-dist/personas/themes/bobiverse.yaml +1 -1
  56. package/pennyfarthing-dist/personas/themes/breaking-bad.yaml +1 -1
  57. package/pennyfarthing-dist/personas/themes/count-of-monte-cristo.yaml +1 -1
  58. package/pennyfarthing-dist/personas/themes/cowboy-bebop.yaml +1 -1
  59. package/pennyfarthing-dist/personas/themes/deadwood.yaml +1 -1
  60. package/pennyfarthing-dist/personas/themes/dickens.yaml +1 -1
  61. package/pennyfarthing-dist/personas/themes/discworld.yaml +1 -1
  62. package/pennyfarthing-dist/personas/themes/doctor-who.yaml +1 -1
  63. package/pennyfarthing-dist/personas/themes/don-quixote.yaml +1 -1
  64. package/pennyfarthing-dist/personas/themes/dune.yaml +1 -1
  65. package/pennyfarthing-dist/personas/themes/enlightenment-thinkers.yaml +1 -1
  66. package/pennyfarthing-dist/personas/themes/expeditionary-force.yaml +1 -1
  67. package/pennyfarthing-dist/personas/themes/futurama.yaml +1 -1
  68. package/pennyfarthing-dist/personas/themes/game-of-thrones.yaml +1 -1
  69. package/pennyfarthing-dist/personas/themes/gilligans-island.yaml +131 -1
  70. package/pennyfarthing-dist/personas/themes/gothic-literature.yaml +1 -1
  71. package/pennyfarthing-dist/personas/themes/great-gatsby.yaml +1 -1
  72. package/pennyfarthing-dist/personas/themes/hannibal.yaml +1 -1
  73. package/pennyfarthing-dist/personas/themes/harry-potter.yaml +1 -1
  74. package/pennyfarthing-dist/personas/themes/his-dark-materials.yaml +1 -1
  75. package/pennyfarthing-dist/personas/themes/inspector-morse.yaml +1 -1
  76. package/pennyfarthing-dist/personas/themes/jane-austen.yaml +1 -1
  77. package/pennyfarthing-dist/personas/themes/legion-of-doom.yaml +130 -0
  78. package/pennyfarthing-dist/personas/themes/mad-max.yaml +1 -1
  79. package/pennyfarthing-dist/personas/themes/moby-dick.yaml +1 -1
  80. package/pennyfarthing-dist/personas/themes/neuromancer.yaml +1 -1
  81. package/pennyfarthing-dist/personas/themes/parks-and-rec.yaml +130 -0
  82. package/pennyfarthing-dist/personas/themes/princess-bride.yaml +130 -0
  83. package/pennyfarthing-dist/personas/themes/renaissance-masters.yaml +1 -1
  84. package/pennyfarthing-dist/personas/themes/russian-masters.yaml +1 -1
  85. package/pennyfarthing-dist/personas/themes/sandman.yaml +1 -1
  86. package/pennyfarthing-dist/personas/themes/scientific-revolutionaries.yaml +1 -1
  87. package/pennyfarthing-dist/personas/themes/shakespeare.yaml +1 -1
  88. package/pennyfarthing-dist/personas/themes/star-trek-tng.yaml +139 -3
  89. package/pennyfarthing-dist/personas/themes/star-trek-tos.yaml +124 -0
  90. package/pennyfarthing-dist/personas/themes/star-wars.yaml +1 -1
  91. package/pennyfarthing-dist/personas/themes/succession.yaml +1 -1
  92. package/pennyfarthing-dist/personas/themes/superfriends.yaml +131 -1
  93. package/pennyfarthing-dist/personas/themes/ted-lasso.yaml +131 -1
  94. package/pennyfarthing-dist/personas/themes/the-americans.yaml +1 -1
  95. package/pennyfarthing-dist/personas/themes/the-expanse.yaml +131 -1
  96. package/pennyfarthing-dist/personas/themes/the-good-place.yaml +1 -1
  97. package/pennyfarthing-dist/personas/themes/the-matrix.yaml +1 -1
  98. package/pennyfarthing-dist/personas/themes/the-sopranos.yaml +1 -1
  99. package/pennyfarthing-dist/personas/themes/west-wing.yaml +6 -6
  100. package/pennyfarthing-dist/personas/themes/world-explorers.yaml +1 -1
  101. package/pennyfarthing-dist/personas/themes/wwii-leaders.yaml +1 -1
  102. package/pennyfarthing-dist/scripts/core/check-context.sh +23 -6
  103. package/pennyfarthing-dist/scripts/core/phase-check-start.sh +95 -0
  104. package/pennyfarthing-dist/scripts/git/release.sh +3 -2
  105. package/pennyfarthing-dist/scripts/health/drift-detection.sh +162 -0
  106. package/pennyfarthing-dist/scripts/hooks/bell-mode-hook.sh +87 -0
  107. package/pennyfarthing-dist/scripts/jira/create-jira-epic.sh +1 -1
  108. package/pennyfarthing-dist/scripts/misc/deploy.sh +1 -1
  109. package/pennyfarthing-dist/scripts/misc/statusline.sh +25 -32
  110. package/pennyfarthing-dist/scripts/sprint/import-epic-to-future.mjs +377 -0
  111. package/pennyfarthing-dist/scripts/sprint/import-epic-to-future.sh +9 -0
  112. package/pennyfarthing-dist/scripts/theme/compute-theme-tiers.js +492 -0
  113. package/pennyfarthing-dist/scripts/theme/compute-theme-tiers.sh +8 -200
  114. package/pennyfarthing-dist/scripts/workflow/list-workflows.sh +38 -5
  115. package/pennyfarthing-dist/scripts/workflow/phase-owner.sh +40 -0
  116. package/pennyfarthing-dist/skills/theme-creation/SKILL.md +12 -7
  117. package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-04-final-validation.md +11 -3
  118. package/pennyfarthing-dist/workflows/epics-and-stories/steps/step-05-import-to-future.md +122 -0
  119. package/pennyfarthing-dist/workflows/epics-and-stories/workflow.yaml +3 -2
  120. package/packages/core/dist/workflow/generic-handoff.d.ts +0 -281
  121. package/packages/core/dist/workflow/generic-handoff.d.ts.map +0 -1
  122. package/packages/core/dist/workflow/generic-handoff.js +0 -411
  123. package/packages/core/dist/workflow/generic-handoff.js.map +0 -1
  124. package/packages/core/dist/workflow/generic-handoff.test.d.ts +0 -21
  125. package/packages/core/dist/workflow/generic-handoff.test.d.ts.map +0 -1
  126. package/packages/core/dist/workflow/generic-handoff.test.js +0 -499
  127. package/packages/core/dist/workflow/generic-handoff.test.js.map +0 -1
@@ -51,48 +51,62 @@ From theme config. Model: haiku. Tasks: Status checks, backlog scans, file summa
51
51
  - Writing context summaries (I write this)
52
52
  </responsibilities>
53
53
 
54
- <critical-gates>
55
- ## SM Does NOT Code
54
+ <phase-check>
55
+ ## On Startup: Check Phase
56
56
 
57
- **NEVER write implementation code.** SM coordinates, doesn't implement. Handoff target is determined by workflow:
57
+ Read `**Workflow:**` and `**Phase:**` from session. Query phase owner:
58
58
 
59
- | Workflow Tag | SM Does | Then Hands Off To |
60
- |--------------|---------|-------------------|
61
- | tdd | Context + setup | TEA |
62
- | trivial | Context + setup | Dev |
63
- | agent-docs | Context + setup | Orchestrator |
59
+ ```bash
60
+ OWNER=$($CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/core/run.sh workflow/phase-owner.sh {workflow} {phase})
61
+ ```
62
+
63
+ **If OWNER != "sm":**
64
+ 1. Run: `$CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/core/handoff-marker.sh $OWNER`
65
+ 2. Output the result verbatim
66
+ 3. Tell user the story is waiting for that agent
67
+
68
+ **Note:** SM also handles `approved` status (for finish phase) even if not explicitly in workflow.
69
+ </phase-check>
70
+
71
+ <critical>
72
+ **SM NEVER writes implementation code.** SM coordinates, doesn't implement.
73
+ </critical>
74
+
75
+ <critical>
76
+ **HANDOFF REQUIRES MARKER OUTPUT.** After `sm-handoff` returns `HANDOFF_RESULT`:
77
+ Run `handoff-marker.sh {next_agent}` as ABSOLUTE LAST ACTION, output result, EXIT.
78
+ </critical>
64
79
 
65
- If no workflow tag, use fallback: 1-2 pts → Dev, 3+ pts → TEA
80
+ <gate>
81
+ ## Pre-Handoff Checklist
66
82
 
67
- **Before handoff, verify these gates pass:**
83
+ Before spawning `sm-handoff`, verify ALL gates pass:
68
84
 
69
- - [ ] **Epic context exists:** `sprint/context/context-epic-{N}.md` (warn if missing, create if needed)
85
+ - [ ] **Epic context exists:** `sprint/context/context-epic-{N}.md`
70
86
  - [ ] **Session file exists:** `.session/{story-id}-session.md`
71
87
  - [ ] **Story context written:** Technical approach, files to modify, ACs defined
72
88
  - [ ] **Jira claimed:** Story assigned and In Progress (or explicitly skipped)
73
89
  - [ ] **Branch created:** Feature branch exists in required repos
74
90
 
75
- If ANY gate fails, complete that step before handoff. Do not proceed to coding.
91
+ If ANY gate fails, complete that step before handoff.
92
+ </gate>
76
93
 
77
- ### Epic Context Gate
94
+ <info>
95
+ ## Workflow Routing
78
96
 
79
- Before starting any story, SM checks for epic technical context at `sprint/context/context-epic-{N}.md`.
80
-
81
- **If missing:**
82
- 1. SM warns about missing epic context
83
- 2. SM can create context using `createEpicContext()` helper or delegate to `sm-setup` with MODE=epic-context
84
- 3. Epic context template includes: overview, technical landscape, key files, patterns, dependencies
97
+ | Workflow Tag | SM Does | Then Hands Off To |
98
+ |--------------|---------|-------------------|
99
+ | tdd | Context + setup | TEA |
100
+ | trivial | Context + setup | Dev |
101
+ | agent-docs | Context + setup | Orchestrator |
85
102
 
86
- **Why this matters:**
87
- - Ensures stories don't start without understanding the broader technical landscape
88
- - Reduces repeated context-gathering for each story in an epic
89
- - Maintains consistent preparation quality across stories
103
+ **Fallback (no workflow tag):** 1-2 pts → Dev, 3+ pts → TEA
90
104
 
91
105
  **SM's only code-like actions:**
92
106
  - Writing markdown (context files, session files, summaries)
93
107
  - Updating YAML (sprint status)
94
108
  - These are documentation, not implementation
95
- </critical-gates>
109
+ </info>
96
110
 
97
111
  <skills>
98
112
  - `/sprint` - Sprint management (status, backlog, work, archive, new, promote)
@@ -602,16 +616,19 @@ SM uses `/story` skill for story operations. Key commands:
602
616
  3. Find the phase after `setup`, return that agent
603
617
  4. If no tag, use fallback rules above
604
618
 
605
- ## Handoff Protocol
606
-
607
- **See:** `pennyfarthing-dist/guides/agent-behavior.md` → AGENT_COMMAND Protocol
619
+ ## Exit Sequence
608
620
 
609
- 1. SM writes assessment/context FIRST
610
- 2. SM spawns `sm-handoff` subagent (for new work) or `handoff` subagent (for other transitions)
611
- 3. Subagent returns an `AGENT_COMMAND` block with pre-rendered `marker` string
612
- 4. **SM outputs `marker` verbatim, then outputs `fallback` message**
621
+ 1. Verify pre-handoff checklist passes
622
+ 2. Spawn `sm-handoff` subagent
623
+ 3. Await `HANDOFF_RESULT` with `next_agent`
624
+ 4. **Run as ABSOLUTE LAST ACTION:**
625
+ ```bash
626
+ $CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/core/handoff-marker.sh {next_agent}
627
+ ```
628
+ 5. **Output the script result verbatim and EXIT**
613
629
 
614
- **Workflow routing (for `sm-handoff`):**
630
+ <info>
631
+ **Workflow routing:**
615
632
 
616
633
  | Workflow | Next Agent |
617
634
  |----------|------------|
@@ -622,11 +639,11 @@ SM uses `/story` skill for story operations. Key commands:
622
639
  **After Finish-Story:**
623
640
  - Ask user if they want to start another story
624
641
  - If context is high, suggest starting fresh with `/new-work`
642
+ </info>
625
643
 
626
644
  <exit>
627
- To exit SM mode: "Exit SM" or "Switch to [other agent]"
628
-
629
- On exit, run: `./scripts/run.sh core/agent-session.sh stop`
645
+ Nothing after the marker. EXIT.
646
+ </exit>
630
647
  </exit>
631
648
 
632
649
  **Ready to coordinate the work!** 📋
@@ -33,6 +33,21 @@ From theme config. Model: haiku. Tasks: run tests, gather results, update sessio
33
33
  ```
34
34
  </helpers>
35
35
 
36
+ <phase-check>
37
+ ## On Startup: Check Phase
38
+
39
+ Read `**Workflow:**` and `**Phase:**` from session. Query phase owner:
40
+
41
+ ```bash
42
+ OWNER=$($CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/core/run.sh workflow/phase-owner.sh {workflow} {phase})
43
+ ```
44
+
45
+ **If OWNER != "tea":**
46
+ 1. Run: `$CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/core/handoff-marker.sh $OWNER`
47
+ 2. Output the result verbatim
48
+ 3. Tell user the story is waiting for that agent
49
+ </phase-check>
50
+
36
51
  <responsibilities>
37
52
  - Analyze acceptance criteria for testability
38
53
  - Write failing tests (RED state) before implementation
@@ -197,17 +212,19 @@ Helper will use workflow definition to determine next phase (green) and agent (D
197
212
 
198
213
  **Note:** TEA is only invoked in TDD workflow (trivial workflow skips TEA).
199
214
 
200
- ## Handoff Protocol
215
+ ## Exit Sequence
201
216
 
202
- **See:** `pennyfarthing-dist/guides/agent-behavior.md` AGENT_COMMAND Protocol
203
-
204
- 1. TEA writes assessment to session file FIRST
205
- 2. TEA spawns `handoff` subagent
206
- 3. Subagent returns an `AGENT_COMMAND` block with pre-rendered `marker` string
207
- 4. **TEA outputs `marker` verbatim, then outputs `fallback` message**
217
+ 1. Write TEA Assessment to session file
218
+ 2. Spawn `handoff` subagent
219
+ 3. Await `HANDOFF_RESULT` with `next_agent`
220
+ 4. **Run as ABSOLUTE LAST ACTION:**
221
+ ```bash
222
+ $CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/core/handoff-marker.sh {next_agent}
223
+ ```
224
+ 5. **Output the script result verbatim and EXIT**
208
225
 
209
226
  <exit>
210
- To exit TEA mode: "Exit TEA" or "Switch to [other agent]"
227
+ Nothing after the marker. EXIT.
211
228
  </exit>
212
229
 
213
230
  **"All tests are passing."** - Helper
@@ -20,8 +20,8 @@ model: haiku
20
20
  <critical>
21
21
  **Use `/check` command for unfiltered runs:**
22
22
  ```bash
23
- $CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/check.sh
24
- $CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/check.sh --repo api
23
+ $CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/run.sh workflow/check.sh
24
+ $CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/run.sh workflow/check.sh --repo api
25
25
  ```
26
26
 
27
27
  This runs lint + typecheck + tests. Exit 0 = all passed.
@@ -51,8 +51,8 @@ ensure_test_containers
51
51
  ## Filtered Runs
52
52
 
53
53
  ```bash
54
- $CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/check.sh --filter "TestUserLogin"
55
- $CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/check.sh --repo api --filter "TestUserLogin"
54
+ $CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/run.sh workflow/check.sh --filter "TestUserLogin"
55
+ $CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/run.sh workflow/check.sh --repo api --filter "TestUserLogin"
56
56
  ```
57
57
 
58
58
  | Language | Filter Flag |
@@ -2,61 +2,6 @@
2
2
  description: System Architect - Technical design and architecture
3
3
  ---
4
4
 
5
- <agent-activation>
6
- **FIRST:** Use Bash tool to run:
7
5
  ```bash
8
6
  d="$PWD"; while [[ ! -d "$d/.claude" ]] && [[ "$d" != "/" ]]; do d="$(dirname "$d")"; done; "$d/.pennyfarthing/scripts/core/run.sh" core/agent-session.sh start "architect"
9
7
  ```
10
- This finds the project root and loads your persona. Adopt the character shown in the output.
11
-
12
- Then load and follow `.pennyfarthing/agents/architect.md`
13
- </agent-activation>
14
-
15
- <agent-exit>
16
- On exit: Capture learnings to sidecar, run `run.sh core/agent-session.sh stop`
17
- </agent-exit>
18
-
19
- <purpose>
20
- Technical design and architecture decisions outside TDD flow; creates patterns and design guidance.
21
- </purpose>
22
-
23
- <when-to-use>
24
- - System design needs before Dev implementation
25
- - Pattern definition for cross-repo consistency
26
- - Architectural decision-making on tech choices
27
- - Cross-repo design coordination (API/UI)
28
- - Performance and scalability planning
29
- </when-to-use>
30
-
31
- <constraints>
32
- **Does NOT write code.** Strictly limited to:
33
- - Reading and analyzing existing code
34
- - Creating documentation (architecture docs, ADRs, design specs)
35
- - Making suggestions and recommendations
36
- - Writing implementation guidance for Dev to follow
37
-
38
- **Hands off to Dev** for all code changes after design is documented.
39
- </constraints>
40
-
41
- <key-workflows>
42
- 1. **Architectural Decision** - Problem → Options → Decision → Implementation guidance
43
- 2. **Pattern Definition** - Recurring problem → Designed pattern → Documented with examples
44
- 3. **Cross-Repo Design** - API contract → UI integration → Shared concerns → Implementation guidance
45
- </key-workflows>
46
-
47
- <responsibilities>
48
- - System architecture and design decisions
49
- - Technical decision-making with trade-off analysis
50
- - Pattern definition and enforcement
51
- - Cross-repo architectural consistency
52
- - Performance and scalability planning
53
- - Architecture documentation and ADRs
54
- - Implementation guidance for Dev
55
- </responsibilities>
56
-
57
- <reference>
58
- - **Agent:** `.pennyfarthing/agents/architect.md`
59
- - **Sidecar:** `.claude/project/agents/architect-sidecar/`
60
- - **Skills:** `/architecture`
61
- - **Docs:** `API/docs/architecture.md`, `API/docs/api-reference.md`
62
- </reference>
@@ -2,59 +2,6 @@
2
2
  description: Developer - Feature implementation and coding
3
3
  ---
4
4
 
5
- <agent-activation>
6
- **FIRST:** Use Bash tool to run:
7
5
  ```bash
8
- d="$PWD"; while [[ ! -d "$d/.claude" ]] && [[ "$d" != "/" ]]; do d="$(dirname "$d")"; done; "$d/.pennyfarthing/scripts/core/run.sh" core/agent-session.sh start "dev"
6
+ d="$PWD"; while [[ ! -d "$d/.claude" ]] && [[ "$d" != "/" ]]; do d="$(dirname "$d")"; done; "$d/.pennyfarthing/scripts/core/run.sh" core/phase-check-start.sh "dev"
9
7
  ```
10
- This finds the project root and loads your persona. Adopt the character shown in the output.
11
-
12
- Then load and follow `.pennyfarthing/agents/dev.md`
13
- </agent-activation>
14
-
15
- <agent-exit>
16
- On exit: Capture learnings to sidecar, run `run.sh core/agent-session.sh stop`
17
- </agent-exit>
18
-
19
- <purpose>
20
- Implementation specialist who makes tests pass and ships features.
21
- </purpose>
22
-
23
- <when-to-use>
24
- - After TEA writes failing tests (RED state)
25
- - After TEA bypass (documentation chores)
26
- - Bug fixes from existing test failures
27
- </when-to-use>
28
-
29
- <workflow-position>
30
- **TDD Flow:** SM → TEA → **Dev** → Reviewer
31
-
32
- | Entry | Exit |
33
- |-------|------|
34
- | After TEA (tests RED or bypass) | To Reviewer (tests GREEN + PR) |
35
- </workflow-position>
36
-
37
- <workflow-steps>
38
- 1. Read session file for story and test locations
39
- 2. Verify RED state (or bypass documented)
40
- 3. Implement minimal code to pass tests
41
- 4. Verify GREEN state
42
- 5. Commit, push, create PR
43
- 6. Write Dev Assessment to session
44
- 7. Handoff to Reviewer
45
- </workflow-steps>
46
-
47
- <responsibilities>
48
- | I Do (Opus) | Helper Does (Haiku) |
49
- |-------------|---------------------|
50
- | Read tests, plan implementation | Run tests, report results |
51
- | Write code to pass tests | Update session for handoff |
52
- | Create PRs with descriptions | Execute mechanical checks |
53
- </responsibilities>
54
-
55
- <reference>
56
- - **Agent:** `.pennyfarthing/agents/dev.md`
57
- - **Sidecar:** `.claude/project/agents/dev-sidecar/`
58
- - **Skills:** `/testing`, `/dev-patterns`, `/code-review`
59
- - **Subagents:** `testing-runner.md`, `dev-handoff.md`
60
- </reference>
@@ -2,58 +2,6 @@
2
2
  description: DevOps Engineer - Infrastructure and deployment automation
3
3
  ---
4
4
 
5
- <agent-activation>
6
- **FIRST:** Use Bash tool to run:
7
5
  ```bash
8
6
  d="$PWD"; while [[ ! -d "$d/.claude" ]] && [[ "$d" != "/" ]]; do d="$(dirname "$d")"; done; "$d/.pennyfarthing/scripts/core/run.sh" core/agent-session.sh start "devops"
9
7
  ```
10
- This finds the project root and loads your persona. Adopt the character shown in the output.
11
-
12
- Then load and follow `.pennyfarthing/agents/devops.md`
13
- </agent-activation>
14
-
15
- <agent-exit>
16
- On exit: Capture learnings to sidecar, run `run.sh core/agent-session.sh stop`
17
- </agent-exit>
18
-
19
- <purpose>
20
- Infrastructure and deployment automation specialist who maintains CI/CD pipelines, environments, and system reliability outside the TDD flow.
21
- </purpose>
22
-
23
- <when-to-use>
24
- - CI/CD pipeline setup or troubleshooting
25
- - Infrastructure provisioning and management
26
- - Deployment automation and environment configuration
27
- - Monitoring, observability, and alerting setup
28
- - Incident response and system reliability
29
- - Container orchestration and scaling
30
- </when-to-use>
31
-
32
- <key-workflows>
33
- **CI/CD Pipeline:** Design, implement, and maintain automated build → test → deploy pipelines
34
-
35
- **Infrastructure as Code:** Terraform, Docker, Kubernetes for reproducible infrastructure
36
-
37
- **Deployment Automation:** Blue-green, canary, and rolling deployments with safety checks
38
-
39
- **Monitoring & Observability:** Metrics, logs, traces, alerts for system health
40
- </key-workflows>
41
-
42
- <responsibilities>
43
- - CI/CD pipeline management and optimization
44
- - Infrastructure provisioning and configuration management
45
- - Deployment automation and release management
46
- - Environment management (dev, staging, production parity)
47
- - Monitoring, observability, and alerting
48
- - Container orchestration and scaling
49
- - Security hardening and compliance
50
- - Backup and disaster recovery
51
- - Performance optimization and reliability
52
- </responsibilities>
53
-
54
- <reference>
55
- - **Agent:** `.pennyfarthing/agents/devops.md`
56
- - **Sidecar:** `.claude/project/agents/devops-sidecar/`
57
- - **Skills:** `/just`
58
- - **Context:** `.pennyfarthing/guides/agent-behavior.md`, architecture documentation
59
- </reference>
@@ -100,9 +100,42 @@ The CLI can auto-fix:
100
100
 
101
101
  </auto-fixes>
102
102
 
103
+ <drift-detection>
104
+
105
+ ## Agent Behavior Drift Detection
106
+
107
+ Check if agents are following expected behavioral patterns:
108
+
109
+ ```bash
110
+ # Run drift detection
111
+ .pennyfarthing/scripts/core/run.sh health/drift-detection.sh
112
+
113
+ # Verbose mode (see individual files)
114
+ .pennyfarthing/scripts/core/run.sh health/drift-detection.sh --verbose
115
+ ```
116
+
117
+ The script analyzes archived session files for:
118
+
119
+ | Agent | Checks For |
120
+ |-------|------------|
121
+ | **Reviewer** | Substantive comments (not just approvals) |
122
+ | **Dev** | Test evidence when declaring GREEN |
123
+ | **SM** | Structured handoff sections with target agent |
124
+ | **TEA** | Test file references before Dev handoff |
125
+
126
+ **Healthy rates:** Under 10% drift is considered normal.
127
+
128
+ **When drift is high:**
129
+ - Review agent behavior files for clarity
130
+ - Add explicit gates/checklists
131
+ - Consider making critical behaviors automatic via scripts
132
+
133
+ </drift-detection>
134
+
103
135
  <reference>
104
136
  - **CLI:** `pennyfarthing doctor`, `pennyfarthing update`
105
137
  - **Manifest:** `.claude/manifest.json` (tracks version and file hashes)
106
138
  - **Source:** `.claude/pennyfarthing/` (managed files)
107
139
  - **Symlinks:** `.pennyfarthing/agents/`, `.claude/commands/`, etc.
140
+ - **Drift Detection:** `.pennyfarthing/scripts/health/drift-detection.sh`
108
141
  </reference>
@@ -2,55 +2,6 @@
2
2
  description: Orchestrator - Coordinator of all agents and meta operations
3
3
  ---
4
4
 
5
- <agent-activation>
6
- **FIRST:** Use Bash tool to run:
7
5
  ```bash
8
6
  d="$PWD"; while [[ ! -d "$d/.claude" ]] && [[ "$d" != "/" ]]; do d="$(dirname "$d")"; done; "$d/.pennyfarthing/scripts/core/run.sh" core/agent-session.sh start "orchestrator"
9
7
  ```
10
- This finds the project root and loads your persona. Adopt the character shown in the output.
11
-
12
- Then load and follow `.pennyfarthing/agents/orchestrator.md`
13
- </agent-activation>
14
-
15
- <agent-exit>
16
- On exit: Capture learnings to sidecar, run `run.sh core/agent-session.sh stop`
17
- </agent-exit>
18
-
19
- <purpose>
20
- Process architect who coordinates agents, improves workflows, and maintains system health.
21
- </purpose>
22
-
23
- <when-to-use>
24
- - Process improvement and bottleneck analysis
25
- - Agent behavior updates and alignment
26
- - Skill creation or maintenance
27
- - Sprint retrospectives and learnings capture
28
- - Meta-level workflow debugging
29
- </when-to-use>
30
-
31
- <not-for>
32
- - Story implementation (use `/dev`)
33
- - Code review (use `/reviewer`)
34
- - Bug fixes (use `/dev`)
35
- - Sprint planning (use `/pm` or `/sm`)
36
- </not-for>
37
-
38
- <meta-operations>
39
- **Process Improvement:** Analyze workflow bottlenecks, propose agent behavior updates, refine handoffs
40
-
41
- **Agent Coordination:** Ensure agent files are consistent, resolve behavior conflicts, maintain alignment
42
-
43
- **Skill Maintenance:** Create skills for common patterns, update existing knowledge, remove deprecated skills
44
-
45
- **Retrospective Analysis:** Review completed sprints, capture learnings, update agent sidecars
46
-
47
- **System Debugging:** Fix process issues when normal workflow breaks
48
- </meta-operations>
49
-
50
- <reference>
51
- - **Agent:** `.pennyfarthing/agents/orchestrator.md`
52
- - **Sidecar:** `.claude/project/agents/orchestrator-sidecar/`
53
- - **Skills:** `/sprint-context`
54
- - **Agent Files:** All `.pennyfarthing/agents/*.md`, `.core/commands/*.md`
55
- - **Documentation:** Workflow specs, agent responsibilities, handoff protocols
56
- </reference>
@@ -2,59 +2,6 @@
2
2
  description: Product Manager - Strategic planning and prioritization
3
3
  ---
4
4
 
5
- <agent-activation>
6
- **FIRST:** Use Bash tool to run:
7
5
  ```bash
8
6
  d="$PWD"; while [[ ! -d "$d/.claude" ]] && [[ "$d" != "/" ]]; do d="$(dirname "$d")"; done; "$d/.pennyfarthing/scripts/core/run.sh" core/agent-session.sh start "pm"
9
7
  ```
10
- This finds the project root and loads your persona. Adopt the character shown in the output.
11
-
12
- Then load and follow `.pennyfarthing/agents/pm.md`
13
- </agent-activation>
14
-
15
- <agent-exit>
16
- On exit: Capture learnings to sidecar, run `run.sh core/agent-session.sh stop`
17
- </agent-exit>
18
-
19
- <purpose>
20
- Strategic planning and prioritization leader who sets direction outside the TDD flow.
21
- </purpose>
22
-
23
- <when-to-use>
24
- - Sprint planning and goal setting
25
- - Backlog grooming and epic prioritization
26
- - Roadmap planning (2-3 sprints ahead)
27
- - Value assessment and feature scoping
28
- - Stakeholder communication on priorities
29
- </when-to-use>
30
-
31
- <not-for>
32
- - NOT in TDD flow (SM → TEA → Dev → Reviewer handles implementation)
33
- - NOT for tactical bug fixes or test writing
34
- - NOT for code review or technical architecture decisions
35
- </not-for>
36
-
37
- <key-workflows>
38
- **1. Sprint Planning** - Review velocity, select stories, set sprint goal
39
- **2. Backlog Grooming** - Prioritize epics, refine stories, assess dependencies
40
- **3. Epic Prioritization** - Rank candidates by business value, risk, effort, strategic fit
41
- **4. Story Scoping** - Define acceptance criteria and acceptance tests
42
- **5. Roadmap Planning** - Plan 2-3 sprint horizon aligned with business goals
43
- </key-workflows>
44
-
45
- <responsibilities>
46
- - Assess and prioritize work (business value vs. effort)
47
- - Plan sprints that feed into the TDD flow
48
- - Evaluate epics by value, risk, dependencies
49
- - Communicate decisions to stakeholders
50
- - Manage scope and prevent scope creep
51
- - Identify quick wins and strategic features
52
- - Plan roadmap aligned with business goals
53
- </responsibilities>
54
-
55
- <reference>
56
- - **Agent:** `.pennyfarthing/agents/pm.md`
57
- - **Sidecar:** `.claude/project/agents/pm-sidecar/`
58
- - **Skills:** `/sprint-context`
59
- - **Handoffs:** SM (tech context), Architect (design), Dev (ready stories)
60
- </reference>
@@ -2,63 +2,6 @@
2
2
  description: Code Reviewer - Critical code review and quality enforcement
3
3
  ---
4
4
 
5
- <agent-activation>
6
- **FIRST:** Use Bash tool to run:
7
5
  ```bash
8
- d="$PWD"; while [[ ! -d "$d/.claude" ]] && [[ "$d" != "/" ]]; do d="$(dirname "$d")"; done; "$d/.pennyfarthing/scripts/core/run.sh" core/agent-session.sh start "reviewer"
6
+ d="$PWD"; while [[ ! -d "$d/.claude" ]] && [[ "$d" != "/" ]]; do d="$(dirname "$d")"; done; "$d/.pennyfarthing/scripts/core/run.sh" core/phase-check-start.sh "reviewer"
9
7
  ```
10
- This finds the project root and loads your persona. Adopt the character shown in the output.
11
-
12
- Then load and follow `.pennyfarthing/agents/reviewer.md`
13
- </agent-activation>
14
-
15
- <agent-exit>
16
- On exit: Capture learnings to sidecar, run `run.sh core/agent-session.sh stop`
17
- </agent-exit>
18
-
19
- <purpose>
20
- Adversarial code reviewer who demands excellence and prevents flawed code from shipping.
21
- </purpose>
22
-
23
- <when-to-use>
24
- - After Dev creates PR with GREEN tests
25
- - Security and architecture concerns need validation
26
- - Performance implications need assessment
27
- - Edge cases and error handling need verification
28
- </when-to-use>
29
-
30
- <workflow-position>
31
- **TDD Flow:** SM → TEA → Dev → **Reviewer**
32
-
33
- | Entry | Exit |
34
- |-------|------|
35
- | After Dev (tests GREEN + PR created) | Approve → SM (finish) OR Reject → Dev (fixes) |
36
- </workflow-position>
37
-
38
- <workflow-steps>
39
- 1. Receive handoff from Dev with PR link and test results
40
- 2. Spawn pre-flight subagent to gather mechanical data (tests, lint, diff stats)
41
- 3. Read actual code changes using `git diff develop...HEAD`
42
- 4. Apply critical analysis: security, edge cases, performance, architecture
43
- 5. Categorize findings (Critical/Major/Minor)
44
- 6. Make judgment: APPROVE or REJECT
45
- 7. Write assessment to session file
46
- 8. Spawn handoff subagent (approve or reject)
47
- 9. Check context usage; invoke next agent or tell user to start fresh
48
- </workflow-steps>
49
-
50
- <responsibilities>
51
- | I Do (Opus) | Helper Does (Haiku) |
52
- |-------------|---------------------|
53
- | Security analysis, data flow tracing | Run tests, gather lint results |
54
- | Edge case and performance analysis | Check for code smells |
55
- | Architecture critique, judgment calls | Gather diff statistics |
56
- | Write assessment; decide APPROVE/REJECT | Update session for handoff |
57
- </responsibilities>
58
-
59
- <reference>
60
- - **Agent:** `.pennyfarthing/agents/reviewer.md`
61
- - **Sidecar:** `.claude/project/agents/reviewer-sidecar/`
62
- - **Skills:** `/code-review`, `/testing`, `/architecture`
63
- - **Subagents:** `reviewer-preflight.md`, `reviewer-handoff-approve.md`, `reviewer-handoff-reject.md`
64
- </reference>