@pennyfarthing/core 7.6.1 → 7.8.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 (109) hide show
  1. package/README.md +109 -201
  2. package/package.json +1 -1
  3. package/packages/core/dist/cli/commands/doctor.d.ts.map +1 -1
  4. package/packages/core/dist/cli/commands/doctor.js +205 -0
  5. package/packages/core/dist/cli/commands/doctor.js.map +1 -1
  6. package/packages/core/dist/cli/commands/init.js +31 -0
  7. package/packages/core/dist/cli/commands/init.js.map +1 -1
  8. package/packages/core/dist/cli/commands/update.js +31 -0
  9. package/packages/core/dist/cli/commands/update.js.map +1 -1
  10. package/pennyfarthing-dist/agents/architect.md +48 -53
  11. package/pennyfarthing-dist/agents/dev.md +74 -164
  12. package/pennyfarthing-dist/agents/devops.md +44 -39
  13. package/pennyfarthing-dist/agents/handoff.md +46 -23
  14. package/pennyfarthing-dist/agents/orchestrator.md +84 -255
  15. package/pennyfarthing-dist/agents/pm.md +40 -50
  16. package/pennyfarthing-dist/agents/reviewer-preflight.md +58 -26
  17. package/pennyfarthing-dist/agents/reviewer.md +107 -298
  18. package/pennyfarthing-dist/agents/sm-file-summary.md +51 -30
  19. package/pennyfarthing-dist/agents/sm-finish.md +59 -38
  20. package/pennyfarthing-dist/agents/sm-handoff.md +40 -33
  21. package/pennyfarthing-dist/agents/sm-setup.md +122 -45
  22. package/pennyfarthing-dist/agents/sm.md +204 -545
  23. package/pennyfarthing-dist/agents/tea.md +77 -146
  24. package/pennyfarthing-dist/agents/tech-writer.md +43 -24
  25. package/pennyfarthing-dist/agents/testing-runner.md +73 -30
  26. package/pennyfarthing-dist/agents/ux-designer.md +39 -25
  27. package/pennyfarthing-dist/agents/workflow-status-check.md +45 -17
  28. package/pennyfarthing-dist/commands/benchmark.md +19 -1
  29. package/pennyfarthing-dist/commands/continue-session.md +1 -1
  30. package/pennyfarthing-dist/commands/git-cleanup.md +43 -308
  31. package/pennyfarthing-dist/commands/solo.md +36 -0
  32. package/pennyfarthing-dist/commands/theme-maker.md +5 -5
  33. package/pennyfarthing-dist/commands/work.md +1 -1
  34. package/pennyfarthing-dist/guides/agent-behavior.md +22 -9
  35. package/pennyfarthing-dist/guides/agent-tag-taxonomy.md +432 -0
  36. package/pennyfarthing-dist/guides/patterns/approval-gates-pattern.md +27 -7
  37. package/pennyfarthing-dist/guides/scale-levels.md +114 -0
  38. package/pennyfarthing-dist/guides/xml-tags.md +335 -0
  39. package/pennyfarthing-dist/personas/themes/gilligans-island.yaml +83 -83
  40. package/pennyfarthing-dist/personas/themes/star-trek-tos.yaml +1 -1
  41. package/pennyfarthing-dist/personas/themes/the-expanse.yaml +11 -11
  42. package/pennyfarthing-dist/scripts/core/agent-session.sh +13 -7
  43. package/pennyfarthing-dist/scripts/core/check-context.sh +9 -1
  44. package/pennyfarthing-dist/scripts/core/handoff-marker.sh +13 -2
  45. package/pennyfarthing-dist/scripts/core/prime.sh +3 -132
  46. package/pennyfarthing-dist/scripts/core/run.sh +9 -0
  47. package/pennyfarthing-dist/scripts/git/create-feature-branches.sh +45 -4
  48. package/pennyfarthing-dist/scripts/git/git-status-all.sh +32 -7
  49. package/pennyfarthing-dist/scripts/hooks/__pycache__/question_reflector_check.cpython-314.pyc +0 -0
  50. package/pennyfarthing-dist/scripts/hooks/bell-mode-hook.sh +30 -11
  51. package/pennyfarthing-dist/scripts/hooks/pre-commit.sh +80 -23
  52. package/pennyfarthing-dist/scripts/hooks/question-reflector-check.sh +4 -4
  53. package/pennyfarthing-dist/scripts/hooks/question_reflector_check.py +499 -0
  54. package/pennyfarthing-dist/scripts/hooks/session-stop.sh +7 -0
  55. package/pennyfarthing-dist/scripts/hooks/welcome-hook.sh +94 -0
  56. package/pennyfarthing-dist/scripts/jira/README.md +10 -7
  57. package/pennyfarthing-dist/scripts/jira/jira-claim-story.sh +10 -152
  58. package/pennyfarthing-dist/scripts/jira/jira-sync-story.sh +14 -4
  59. package/pennyfarthing-dist/scripts/jira/jira-sync.sh +12 -4
  60. package/pennyfarthing-dist/scripts/jira/sync-epic-jira.sh +11 -99
  61. package/pennyfarthing-dist/scripts/lib/common.sh +55 -0
  62. package/pennyfarthing-dist/scripts/maintenance/sidecar-health.sh +97 -0
  63. package/pennyfarthing-dist/scripts/misc/add-short-names.sh +13 -0
  64. package/pennyfarthing-dist/scripts/misc/add_short_names.py +226 -0
  65. package/pennyfarthing-dist/scripts/misc/migrate-bmad-workflow.sh +6 -5
  66. package/pennyfarthing-dist/scripts/misc/migrate_bmad_workflow.py +319 -0
  67. package/pennyfarthing-dist/scripts/misc/statusline.sh +27 -22
  68. package/pennyfarthing-dist/scripts/sprint/import-epic-to-future.sh +6 -5
  69. package/pennyfarthing-dist/scripts/sprint/import_epic_to_future.py +270 -0
  70. package/pennyfarthing-dist/scripts/story/create-story.sh +14 -154
  71. package/pennyfarthing-dist/scripts/story/size-story.sh +12 -192
  72. package/pennyfarthing-dist/scripts/story/story-template.sh +12 -156
  73. package/pennyfarthing-dist/scripts/test/ensure-swebench-data.sh +59 -0
  74. package/pennyfarthing-dist/scripts/test/ground-truth-judge.py +24 -93
  75. package/pennyfarthing-dist/scripts/test/swebench-judge.py +33 -59
  76. package/pennyfarthing-dist/scripts/theme/compute-theme-tiers.sh +8 -6
  77. package/pennyfarthing-dist/scripts/theme/compute_theme_tiers.py +402 -0
  78. package/pennyfarthing-dist/scripts/validation/validate-agent-schema.sh +575 -0
  79. package/pennyfarthing-dist/scripts/workflow/check.py +502 -0
  80. package/pennyfarthing-dist/scripts/workflow/check.sh +3 -476
  81. package/pennyfarthing-dist/scripts/workflow/get-workflow-type.py +61 -0
  82. package/pennyfarthing-dist/scripts/workflow/get-workflow-type.sh +13 -0
  83. package/pennyfarthing-dist/skills/judge/SKILL.md +57 -0
  84. package/pennyfarthing-dist/skills/skill-registry.yaml +52 -16
  85. package/pennyfarthing-dist/skills/sprint/scripts/sync-epic-jira.sh +4 -22
  86. package/pennyfarthing-dist/skills/sprint/skill.md +1 -1
  87. package/pennyfarthing-dist/templates/settings.local.json.template +11 -0
  88. package/pennyfarthing-dist/workflows/git-cleanup/steps/step-01-analyze.md +83 -0
  89. package/pennyfarthing-dist/workflows/git-cleanup/steps/step-02-categorize.md +116 -0
  90. package/pennyfarthing-dist/workflows/git-cleanup/steps/step-03-execute.md +210 -0
  91. package/pennyfarthing-dist/workflows/git-cleanup/steps/step-04-verify.md +88 -0
  92. package/pennyfarthing-dist/workflows/git-cleanup/steps/step-05-complete.md +71 -0
  93. package/pennyfarthing-dist/workflows/git-cleanup.yaml +59 -0
  94. package/pennyfarthing-dist/guides/XML-TAGS.md +0 -156
  95. package/pennyfarthing-dist/scripts/hooks/question-reflector-check.mjs +0 -380
  96. package/pennyfarthing-dist/scripts/hooks/tests/question-reflector.test.mjs +0 -545
  97. package/pennyfarthing-dist/scripts/jira/jira-bidirectional-sync.mjs +0 -327
  98. package/pennyfarthing-dist/scripts/jira/jira-bidirectional-sync.test.mjs +0 -503
  99. package/pennyfarthing-dist/scripts/jira/jira-lib.mjs +0 -443
  100. package/pennyfarthing-dist/scripts/jira/jira-sync-story.mjs +0 -208
  101. package/pennyfarthing-dist/scripts/jira/jira-sync.mjs +0 -198
  102. package/pennyfarthing-dist/scripts/misc/add-short-names.mjs +0 -264
  103. package/pennyfarthing-dist/scripts/misc/migrate-bmad-workflow.mjs +0 -474
  104. package/pennyfarthing-dist/scripts/sprint/import-epic-to-future.mjs +0 -377
  105. package/pennyfarthing-dist/scripts/theme/compute-theme-tiers.js +0 -492
  106. /package/pennyfarthing-dist/guides/{AGENT-COORDINATION.md → agent-coordination.md} +0 -0
  107. /package/pennyfarthing-dist/guides/{HOOKS.md → hooks.md} +0 -0
  108. /package/pennyfarthing-dist/guides/{PROMPT-PATTERNS.md → prompt-patterns.md} +0 -0
  109. /package/pennyfarthing-dist/guides/{SESSION-ARTIFACTS.md → session-artifacts.md} +0 -0
@@ -10,6 +10,12 @@ Universal entry point telling agents: what work exists, what phase, and whether
10
10
  Uses `/sprint` skill scripts for deterministic output.
11
11
  </info>
12
12
 
13
+ <arguments>
14
+ | Argument | Required | Description |
15
+ |----------|----------|-------------|
16
+ | `CALLING_AGENT` | Yes | Agent requesting status check (e.g., "SM", "Architect", "PM") |
17
+ </arguments>
18
+
13
19
  ---
14
20
 
15
21
  ## Execution
@@ -37,32 +43,54 @@ fi
37
43
  | State | Condition |
38
44
  |-------|-----------|
39
45
  | `FINISH_STATE` | Session exists with Phase=approved OR Status=approved |
40
- | `IN_PROGRESS_STATE` | Session exists with active phase (tea/dev/review) |
46
+ | `IN_PROGRESS_STATE` | Phased workflow session with active phase (setup/red/green/impl/review) |
47
+ | `STEPPED_WORKFLOW_STATE` | Stepped workflow session (workflow type = stepped) |
41
48
  | `NEW_WORK_STATE` | No sessions AND sprint has backlog/ready stories |
42
49
  | `EMPTY_BACKLOG_STATE` | No sessions AND sprint has NO backlog/ready stories |
43
50
 
51
+ **Detecting workflow type from session:**
52
+ ```bash
53
+ # Read workflow name from session
54
+ WORKFLOW=$(grep '^\*\*Workflow:\*\*' .session/*-session.md | head -1 | sed 's/.*: //')
55
+ # Check if stepped
56
+ .pennyfarthing/scripts/core/run.sh workflow/get-workflow-type.sh "$WORKFLOW"
57
+ ```
58
+
44
59
  **Important:** Sprints are fixed two-week periods (kanban-style). Never suggest closing a sprint early or starting sprint planning when backlog is empty. The correct response to `EMPTY_BACKLOG_STATE` is to suggest promoting stories from `future.yaml`.
45
60
 
46
61
  ---
47
62
 
63
+ <output>
48
64
  ## Output Format
49
65
 
50
- ```markdown
51
- ## Workflow Status Report
52
-
53
- ### Detected State
54
- **{STATE}**
66
+ Return a `STATUS_CHECK_RESULT` block:
55
67
 
56
- ### Sprint Summary
57
- [Output from sprint-status.sh]
58
-
59
- ### Active Session
60
- | Story | Phase | Status | Branch |
61
- |-------|-------|--------|--------|
68
+ ### Success
69
+ ```
70
+ STATUS_CHECK_RESULT:
71
+ status: success
72
+ state: {FINISH_STATE|IN_PROGRESS_STATE|NEW_WORK_STATE|EMPTY_BACKLOG_STATE}
73
+ story_id: {ID or null}
74
+ phase: {current phase or null}
75
+ phase_owner: {agent name or null}
76
+ sprint_number: {N}
77
+ backlog_count: {N}
78
+
79
+ next_steps:
80
+ - FINISH_STATE: "Proceed to Finish Flow - spawn sm-finish with PHASE=preflight"
81
+ - IN_PROGRESS_STATE: "Report phase owner '{phase_owner}' should continue. Run handoff-marker.sh {phase_owner}"
82
+ - STEPPED_WORKFLOW_STATE: "Stepped workflow in progress. Tell user to run /workflow resume or /workflow status"
83
+ - NEW_WORK_STATE: "Present available stories to user. Await selection, then spawn sm-setup MODE=setup"
84
+ - EMPTY_BACKLOG_STATE: "Report backlog empty. Suggest promoting from future.yaml"
85
+ ```
62
86
 
63
- ### Recommended Action
64
- - FINISH_STATE → Proceed to finish flow
65
- - IN_PROGRESS_STATE → Report which agent should continue
66
- - NEW_WORK_STATE → Show available stories
67
- - EMPTY_BACKLOG_STATE → Suggest promoting stories from future.yaml
87
+ ### Active Session Details (if IN_PROGRESS_STATE)
88
+ ```
89
+ session:
90
+ story_id: {ID}
91
+ title: "{title}"
92
+ workflow: {workflow}
93
+ phase: {phase}
94
+ branch: {branch}
68
95
  ```
96
+ </output>
@@ -151,7 +151,11 @@ Cross-role mode: Prospero --as dev should see dev scenarios, not SM scenarios.
151
151
  ls scenarios/{category}/*.yaml | xargs -I {} yq -r '"{}|\(.name)|\(.difficulty)|\(.title)|\(.description)"' {}
152
152
  ```
153
153
 
154
- **Present choices with AskUserQuestion:**
154
+ **Present choices (Reflector-aware):**
155
+
156
+ First output marker: `<!-- CYCLIST:CHOICES:scenario -->`
157
+
158
+ Then use AskUserQuestion:
155
159
  ```yaml
156
160
  AskUserQuestion:
157
161
  questions:
@@ -416,6 +420,20 @@ agent:
416
420
  cross_role: true
417
421
  ```
418
422
 
423
+ **REQUIRED: Capture Pennyfarthing version in metadata:**
424
+ ```bash
425
+ # Get version from package.json
426
+ version=$(node -p "require('./package.json').version")
427
+ ```
428
+
429
+ Include in summary.yaml:
430
+ ```yaml
431
+ metadata:
432
+ created_at: "{ISO timestamp}"
433
+ pennyfarthing_version: "{version}" # REQUIRED for baseline staleness detection
434
+ model: sonnet
435
+ ```
436
+
419
437
  **ALWAYS save summary.yaml, even for n=1.** This ensures consistent data structure for analysis.
420
438
 
421
439
  Display:
@@ -58,7 +58,7 @@ If checkpoints exist, parse and present them:
58
58
  Which checkpoint would you like to restore? (Enter number or 'all' for most recent of each label)
59
59
  ```
60
60
 
61
- Use `AskUserQuestion` to let user choose.
61
+ Output `<!-- CYCLIST:CHOICES:checkpoint -->` marker, then use AskUserQuestion to let user choose.
62
62
 
63
63
  ## Step 3: Restore Checkpoint
64
64
 
@@ -1,340 +1,75 @@
1
1
  ---
2
2
  description: Clean up git repos by organizing changes into proper commits/branches by initiative
3
+ workflow: git-cleanup
3
4
  ---
4
5
 
5
6
  # Git Cleanup Command
6
7
 
7
8
  Analyze and organize uncommitted changes across all repos into proper commits and branches based on initiative/feature groupings.
8
9
 
9
- ## Git Workflow Rules
10
-
11
- **CRITICAL: Never commit directly to develop. Branch protection hooks will reject direct commits.**
12
-
13
- All changes MUST follow this workflow:
14
- 1. Create a branch from develop
15
- 2. Commit changes to the branch
16
- 3. Merge to develop locally
17
- 4. Push develop (branches don't need to be pushed)
18
-
19
- ## Analysis Phase
20
-
21
- ### 1. Gather Current State and Check for Unpushed Commits
22
-
23
- ```bash
24
- ./scripts/run.sh git/git-status-all.sh
25
- ```
26
-
27
- This shows branch, changes, and unpushed commits for all repos.
28
-
29
- ### 2. Check Recent Commits for Patterns
30
-
31
- ```bash
32
- echo "=== Recent Commit Patterns ==="
33
- git log --oneline -10 | head -10
34
- echo ""
35
- echo "=== Recent Branches ==="
36
- git branch --sort=-committerdate | head -10
37
- ```
38
-
39
- ### 3. Check Active Work Sessions
40
-
41
- ```bash
42
- echo "=== Active Work ==="
43
- if [ -f ".session/{STORY_ID}-session.md" ]; then
44
- head -30 .session/{STORY_ID}-session.md
45
- else
46
- echo "No active work session"
47
- fi
48
- ```
49
-
50
- ### 4. Check Worktree Status
51
-
52
- ```bash
53
- echo "=== Worktree Status ==="
54
- ./scripts/run.sh git/worktree-manager.sh status
55
- ```
56
-
57
- This shows all active worktrees with their branches and uncommitted changes.
58
-
59
- ### 5. Check Epics for Story Context
60
-
61
- ```bash
62
- echo "=== Active Epics ==="
63
- head -60 docs/epics.md
64
- ```
65
-
66
- ## Categorization Guidelines
67
-
68
- Group changes by these initiative types (based on conventional commits):
10
+ ## BikeLane Workflow
69
11
 
70
- | Prefix | Type | Branch Pattern | Example |
71
- |--------|------|----------------|---------|
72
- | `docs:` | Documentation | `docs/description` | docs/update-epics |
73
- | `chore:` | Maintenance | `chore/description` | chore/sprint-cleanup |
74
- | `chore(sprint):` | Sprint tracking | `chore/sprint-update` | - |
75
- | `chore(pennyfarthing):` | Pennyfarthing config | `chore/pennyfarthing-cleanup` | - |
76
- | `feat:` | New feature | `feat/story-id-desc` | feat/4-12-risk-scoring |
77
- | `fix:` | Bug fix | `fix/issue-desc` | fix/validation-error |
78
- | `refactor:` | Code improvement | `refactor/description` | refactor/seed-data |
12
+ This command uses the **git-cleanup** stepped workflow:
79
13
 
80
- ## Common Change Categories
14
+ | Step | Name | Purpose |
15
+ |------|------|---------|
16
+ | 1 | Analyze | Gather git status across all repos |
17
+ | 2 | Categorize | Group changes by initiative type |
18
+ | 3 | Execute | Create branches, commit, merge |
19
+ | 4 | Verify | Confirm clean state, optionally push |
20
+ | 5 | Complete | Summary and next steps |
81
21
 
82
- ### Sprint/Docs Changes
83
- Files: `docs/*.md`, `sprint/*.yaml`, `sprint/*.md`
84
- - Branch: `chore/sprint-cleanup` or `docs/update-[topic]`
85
- - Commit: `chore(sprint): update sprint tracking` or `docs: update documentation`
22
+ ## Quick Start
86
23
 
87
- ### Pennyfarthing Configuration
88
- Files: `.claude/**/*`
89
- - Branch: `chore/pennyfarthing-[description]`
90
- - Commit: `chore(pennyfarthing): description`
91
-
92
- ### Feature Work
93
- Files: `internal/**`, `src/**`, `migrations/**`
94
- - Branch: `feat/[story-id]-description`
95
- - Commit: `feat: description`
96
-
97
- ### Seed/Test Data
98
- Files: `internal/seed/**`, `cmd/seed/**`
99
- - Branch: `chore/seed-improvements` or part of feature branch
100
- - Commit: `chore(seed): description`
101
-
102
- ### Bug Fixes
103
- Files: Various
104
- - Branch: `fix/[issue-description]`
105
- - Commit: `fix: description`
106
-
107
- ## Execution Phase - Branch Workflow
108
-
109
- **For each group of changes, follow this exact workflow:**
110
-
111
- ### Step 1: Stash All Changes First
112
- ```bash
113
- # Stash everything to start clean
114
- git stash push -m "cleanup-wip"
115
- ```
116
-
117
- ### Step 2: Create Branch from Develop
118
- ```bash
119
- # Ensure on develop and up to date
120
- git checkout develop
121
- git pull origin develop
122
-
123
- # Create feature branch
124
- git checkout -b type/description
125
- ```
126
-
127
- ### Step 3: Apply Relevant Changes
128
- ```bash
129
- # Pop stash
130
- git stash pop
131
-
132
- # Stage only files for this group
133
- git add <specific-files>
134
-
135
- # Stash remaining changes for next group
136
- git stash push -m "remaining-cleanup"
137
- ```
138
-
139
- ### Step 4: Commit
140
- ```bash
141
- # Commit with proper message
142
- git commit -m "$(cat <<'EOF'
143
- type(scope): description
144
-
145
- Details if needed.
146
-
147
- 🤖 Generated with [Claude Code](https://claude.com/claude-code)
148
-
149
- Co-Authored-By: Claude <noreply@anthropic.com>
150
- EOF
151
- )"
152
- ```
153
-
154
- ### Step 5: Merge to Develop
155
- ```bash
156
- # Switch to develop
157
- git checkout develop
24
+ Run `/git-cleanup` to start the workflow.
158
25
 
159
- # Merge the branch
160
- git merge type/description
161
-
162
- # Delete local branch
163
- git branch -d type/description
164
- ```
165
-
166
- ### Step 6: Repeat for Next Group
167
- ```bash
168
- # Pop remaining stash and repeat from Step 2
169
- git stash pop
170
- ```
171
-
172
- ## Multi-Repo Cleanup Pattern
173
-
174
- When cleaning up changes across multiple repos (configured in `.claude/project/repos.yaml`):
175
-
176
- ```bash
177
- # Source repo utilities
178
- source $CLAUDE_PROJECT_DIR/scripts/repo-utils.sh
179
-
180
- # For each configured repo, run the same workflow
181
- for_each_repo '
182
- # ... branch workflow ...
183
- git status --short
184
- '
185
- ```
186
-
187
- Or manually iterate:
188
-
189
- ```bash
190
- source $CLAUDE_PROJECT_DIR/scripts/repo-utils.sh
191
- for repo in $(get_repos); do
192
- repo_path=$(get_repo_full_path "$repo")
193
- echo "=== Processing $repo ==="
194
- cd "$repo_path"
195
- # ... branch workflow ...
196
- cd -
197
- done
198
- ```
199
-
200
- ## Interactive Cleanup Process
201
-
202
- When running this command, Claude should:
26
+ ## Git Workflow Rules
203
27
 
204
- 1. **Show current state** - Display all uncommitted changes grouped by repo
205
- 2. **Check for unpushed commits** - Identify any commits on develop not yet pushed
206
- 3. **Analyze changes** - Look for patterns in file paths, recent commits, and epics
207
- 4. **Propose groupings** - Suggest how to organize changes:
208
- ```
209
- Group 1: Sprint Updates
210
- - docs/epics.md
211
- - sprint/current-sprint.yaml
212
- → Branch: chore/sprint-cleanup
213
- → Commit: "chore(sprint): clean up sprint tracking files"
28
+ **CRITICAL: Never commit directly to develop.** Branch protection hooks will reject direct commits.
214
29
 
215
- Group 2: Migration Fix
216
- - migrations/056_*.sql
217
- Branch: fix/risk-scoring-migration
218
- Commit: "fix(db): add missing risk scoring migration"
30
+ All changes follow this pattern:
31
+ 1. Create branch from develop
32
+ 2. Commit changes to branch
33
+ 3. Merge to develop locally
34
+ 4. Push develop (branches stay local)
219
35
 
220
- Group 3: Seed Improvements
221
- - internal/seed/*.go
222
- → Branch: chore/seed-improvements
223
- → Commit: "chore(seed): improve demo data generation"
224
- ```
225
- 4. **Ask for confirmation** - Let user approve or modify groupings
226
- 5. **Execute** - Create branches, commit, merge to develop for each group
227
- 6. **Push develop** - Push all merged changes at the end
228
- 7. **Verify** - Show clean git status at the end
36
+ ## Categorization Reference
229
37
 
230
- ## Safety Rules
38
+ | Prefix | Type | Branch Pattern |
39
+ |--------|------|----------------|
40
+ | `docs:` | Documentation | `docs/description` |
41
+ | `chore:` | Maintenance | `chore/description` |
42
+ | `chore(sprint):` | Sprint tracking | `chore/sprint-update` |
43
+ | `feat:` | New feature | `feat/story-id-desc` |
44
+ | `fix:` | Bug fix | `fix/issue-desc` |
45
+ | `refactor:` | Code improvement | `refactor/description` |
46
+ | `test:` | Test changes | `test/description` |
231
47
 
232
- - **NEVER commit directly to develop** - hooks will reject it
233
- - **Never force push**
234
- - **Never commit secrets** (.env, credentials, etc.)
235
- - **Show diff before committing**
236
- - **Respect .gitignore**
237
- - **Handle unpushed commits on develop before starting cleanup**
48
+ ## Manual Quick Reference
238
49
 
239
- ## Quick Reference
50
+ For quick cleanup without the full workflow:
240
51
 
241
52
  ```bash
242
- # View what needs cleanup (all repos)
53
+ # View what needs cleanup
243
54
  ./scripts/run.sh git/git-status-all.sh
244
55
 
245
- # Create cleanup branch
56
+ # Standard cleanup sequence
57
+ git stash push -m "cleanup-wip"
246
58
  git checkout develop && git pull
247
59
  git checkout -b chore/cleanup-$(date +%Y%m%d)
248
-
249
- # Stage specific files
250
- git add "docs/*.md"
251
- git add "sprint/*.yaml"
252
-
253
- # Commit with proper message (use heredoc for multiline)
254
- git commit -m "$(cat <<'EOF'
255
- chore(sprint): update sprint status
256
-
257
- 🤖 Generated with [Claude Code](https://claude.com/claude-code)
258
-
259
- Co-Authored-By: Claude <noreply@anthropic.com>
260
- EOF
261
- )"
262
-
263
- # Merge to develop (local)
60
+ git stash pop
61
+ git add <files>
62
+ git commit -m "chore: description"
264
63
  git checkout develop
265
64
  git merge chore/cleanup-$(date +%Y%m%d)
266
65
  git branch -d chore/cleanup-$(date +%Y%m%d)
267
-
268
- # Push develop after all merges complete
269
66
  git push origin develop
270
67
  ```
271
68
 
272
- ## Branch Cleanup
273
-
274
- Stale feature branches can accumulate over time. Include branch cleanup as part of git hygiene.
275
-
276
- ### Check for Stale Branches
277
-
278
- ```bash
279
- echo "=== Branch Status ==="
280
-
281
- ./scripts/run.sh misc/check-status.sh
282
- ```
283
-
284
- ### Remove Merged Branches
285
-
286
- **Only remove branches that are fully merged:**
287
-
288
- ```bash
289
- # Source repo utilities
290
- source $CLAUDE_PROJECT_DIR/scripts/repo-utils.sh
291
-
292
- # For each configured repo
293
- for repo in $(get_repos); do
294
- repo_path=$(get_repo_full_path "$repo")
295
- echo "=== $repo ==="
296
- cd "$repo_path"
297
-
298
- git checkout develop
299
- git pull origin develop
300
-
301
- # List branches merged into develop
302
- git branch --merged develop | grep -v "develop\|main"
303
-
304
- # Delete merged branches
305
- git branch --merged develop | grep -v "develop\|main" | xargs -r git branch -d
306
-
307
- cd -
308
- done
309
- ```
310
-
311
- ### Branch Cleanup Criteria
312
-
313
- | Branch Type | When to Remove |
314
- |-------------|----------------|
315
- | `feat/*` | After PR merged to develop |
316
- | `fix/*` | After PR merged to develop |
317
- | `chore/*` | After PR merged to develop |
318
-
319
- **Note:** Never delete `main` or `develop` branches.
320
-
321
- ## Post-Cleanup Verification
322
-
323
- ```bash
324
- echo "=== Final State ==="
325
- ./scripts/run.sh git/git-status-all.sh
326
- echo ""
327
- echo "=== Branches ==="
328
-
329
- # Source repo utilities
330
- source $CLAUDE_PROJECT_DIR/scripts/repo-utils.sh
331
-
332
- for repo in $(get_repos); do
333
- repo_path=$(get_repo_full_path "$repo")
334
- echo "$repo:" && git -C "$repo_path" branch
335
- done
336
- ```
337
-
338
- ---
69
+ ## Safety Rules
339
70
 
340
- **Start by analyzing, then propose groupings, then execute with user approval. Always use branches!**
71
+ - **NEVER** commit directly to develop
72
+ - **NEVER** force push
73
+ - **NEVER** commit secrets (.env, credentials)
74
+ - **ALWAYS** show diff before committing
75
+ - **ALWAYS** use branches
@@ -249,6 +249,37 @@ It goes directly to a file, then jq reads it safely.
249
249
 
250
250
  ## Step 6: Invoke Judge Skill
251
251
 
252
+ **Detect SWE-bench scenarios for deterministic evaluation:**
253
+
254
+ Check if the scenario is from SWE-bench by looking at its path or category:
255
+ ```python
256
+ is_swebench = (
257
+ 'swe-bench' in scenario_path.lower() or
258
+ scenario.get('category') == 'swe-bench' or
259
+ scenario.get('source') == 'swe-bench'
260
+ )
261
+ ```
262
+
263
+ **If SWE-bench scenario:**
264
+
265
+ Use deterministic Python-based evaluation instead of LLM-as-judge:
266
+
267
+ ```bash
268
+ # Save response to temp file for Python judge
269
+ echo '{"result": "{RESPONSE}"}' > /tmp/solo_response_$$.json
270
+
271
+ # Run SWE-bench judge (deterministic scoring against ground truth)
272
+ python3 .pennyfarthing/scripts/test/swebench-judge.py {scenario_name} /tmp/solo_response_$$.json
273
+ ```
274
+
275
+ The Python script returns:
276
+ - `total`: Score out of 100
277
+ - `scores`: Breakdown by category (root_cause, fix_quality, completeness, persona)
278
+ - `details`: Specific findings and matches
279
+
280
+ **If standard scenario (non-SWE-bench):**
281
+
282
+ Use LLM-as-judge:
252
283
  ```
253
284
  /judge --mode solo --data {
254
285
  "spec": "{spec}",
@@ -380,6 +411,11 @@ else:
380
411
  avg_output_tokens: {avg_out}
381
412
  tokens_per_point: {tpp:.2f}
382
413
 
414
+ metadata:
415
+ created_at: {ISO8601 timestamp}
416
+ pennyfarthing_version: {version from package.json} # REQUIRED
417
+ model: sonnet
418
+
383
419
  # Include baseline comparison if baseline exists and theme != control
384
420
  baseline_comparison:
385
421
  control_mean: {baseline_mean}
@@ -28,7 +28,7 @@ If invalid, explain the rules and ask again.
28
28
 
29
29
  ### Step 2: Mode Selection
30
30
 
31
- Use `AskUserQuestion` to let the user choose their creation mode:
31
+ Output `<!-- CYCLIST:CHOICES:mode -->` marker, then use AskUserQuestion:
32
32
 
33
33
  ```yaml
34
34
  questions:
@@ -253,7 +253,7 @@ Display a preview of all generated agents before confirming:
253
253
 
254
254
  ### Step 4: Confirm or Regenerate
255
255
 
256
- Use `AskUserQuestion` to let the user decide:
256
+ Output `<!-- CYCLIST:CHOICES:confirm -->` marker, then use AskUserQuestion:
257
257
 
258
258
  ```yaml
259
259
  questions:
@@ -380,7 +380,7 @@ Same as AI-Driven mode - ask for the theme concept:
380
380
 
381
381
  ### Step 2: Generate Options for Each Agent
382
382
 
383
- For each agent type, generate 3-4 fitting character suggestions based on the universe. Present options using `AskUserQuestion`:
383
+ For each agent type, generate 3-4 fitting character suggestions based on the universe. Output `<!-- CYCLIST:CHOICES:agent -->` marker, then present options using AskUserQuestion:
384
384
 
385
385
  ```yaml
386
386
  questions:
@@ -458,7 +458,7 @@ Show a preview of the complete theme before confirming. Include OCEAN scores for
458
458
 
459
459
  ### Step 5: Confirm or Edit
460
460
 
461
- Use `AskUserQuestion` to let the user decide:
461
+ Output `<!-- CYCLIST:CHOICES:confirm -->` marker, then use AskUserQuestion:
462
462
 
463
463
  ```yaml
464
464
  questions:
@@ -608,7 +608,7 @@ Show a preview of the complete theme including OCEAN profiles:
608
608
 
609
609
  ### Step 6: Confirm or Edit
610
610
 
611
- Use `AskUserQuestion` to let the user decide:
611
+ Output `<!-- CYCLIST:CHOICES:confirm -->` marker, then use AskUserQuestion:
612
612
 
613
613
  ```yaml
614
614
  questions:
@@ -113,7 +113,7 @@ If multiple session files exist (parallel work):
113
113
  Which would you like to continue?
114
114
  ```
115
115
 
116
- Use AskUserQuestion to let user choose, then invoke appropriate agent.
116
+ Output `<!-- CYCLIST:CHOICES:session -->` marker, then use AskUserQuestion to let user choose, then invoke appropriate agent.
117
117
  </multiple-sessions>
118
118
 
119
119
  <reference>
@@ -151,6 +151,10 @@ overrides:
151
151
 
152
152
  ## Reflector
153
153
 
154
+ <critical>
155
+ **EVERY TURN MUST END WITH A CYCLIST MARKER.** A Stop hook enforces this - you will be blocked if you forget.
156
+ </critical>
157
+
154
158
  <info>
155
159
  HTML comments that agents emit to signal Cyclist UI. Format: `<!-- CYCLIST:TYPE:value -->`
156
160
 
@@ -160,6 +164,7 @@ HTML comments that agents emit to signal Cyclist UI. Format: `<!-- CYCLIST:TYPE:
160
164
  | `CONTEXT_CLEAR` | `/agent` | Clears session, reloads with agent |
161
165
  | `QUESTION` | `yesno` or `open` | Shows input dialog |
162
166
  | `CHOICES` | `opt1,opt2,opt3` | Shows choice buttons |
167
+ | `CONTINUE` | (none) | Shows "Continue" button for status updates |
163
168
 
164
169
  **Examples:**
165
170
  ```
@@ -168,30 +173,38 @@ HTML comments that agents emit to signal Cyclist UI. Format: `<!-- CYCLIST:TYPE:
168
173
  <!-- CYCLIST:QUESTION:yesno -->
169
174
  <!-- CYCLIST:QUESTION:open -->
170
175
  <!-- CYCLIST:CHOICES:option1,option2,option3 -->
176
+ <!-- CYCLIST:CONTINUE -->
171
177
  ```
172
178
 
173
179
  **When to use:**
174
180
  - `HANDOFF` - End of phase (TEA→Dev, Dev→Reviewer)
175
181
  - `CONTEXT_CLEAR` - Context >80% at handoff
176
182
  - `QUESTION`/`CHOICES` - User input needed mid-work
183
+ - `CONTINUE` - Status updates, task completion, any turn that isn't a handoff or question
177
184
  </info>
178
185
 
179
186
  <critical>
180
- **Question Reflector Enforcement:** A Stop hook validates that ANY question to the user has a reflector marker. Emit the marker BEFORE your question.
181
-
182
- **Question types requiring markers:**
187
+ **Marker Selection Guide:**
188
+
189
+ | Situation | Marker |
190
+ |-----------|--------|
191
+ | Workflow handoff to next agent | `<!-- CYCLIST:HANDOFF:/agent -->` |
192
+ | Handoff with context >80% | `<!-- CYCLIST:CONTEXT_CLEAR:/agent -->` |
193
+ | Yes/no question | `<!-- CYCLIST:QUESTION:yesno -->` |
194
+ | Open-ended question | `<!-- CYCLIST:QUESTION:open -->` |
195
+ | Multiple choice | `<!-- CYCLIST:CHOICES:a,b,c -->` |
196
+ | Status update / task complete | `<!-- CYCLIST:CONTINUE -->` |
197
+ | Providing information | `<!-- CYCLIST:CONTINUE -->` |
198
+ | Reporting an error/blocker | `<!-- CYCLIST:CONTINUE -->` |
199
+
200
+ **Question types requiring QUESTION/CHOICES markers:**
183
201
  - Direct questions ending with `?`
184
202
  - Implicit questions: "let me know if...", "would you like...", "should I..."
185
203
  - Choice offerings: "Option A or Option B"
186
204
  - Requests for input: "what do you think", "your preference"
187
205
  - Clarification requests: "could you clarify"
188
206
 
189
- **Marker selection:**
190
- - `<!-- CYCLIST:QUESTION:yesno -->` - Yes/no questions
191
- - `<!-- CYCLIST:QUESTION:open -->` - Open-ended questions
192
- - `<!-- CYCLIST:CHOICES:a,b,c -->` - Multiple choice (list options)
193
-
194
- **Exempt (no marker needed):**
207
+ **Exempt from question detection (but still need CONTINUE):**
195
208
  - Rhetorical questions you answer yourself
196
209
  - Questions inside code blocks or examples
197
210
  - Historical context ("the question was...")