@pennyfarthing/core 8.1.0 → 9.0.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.
- package/README.md +3 -3
- package/package.json +3 -3
- package/pennyfarthing-dist/agents/README.md +1 -1
- package/pennyfarthing-dist/agents/dev.md +1 -1
- package/pennyfarthing-dist/agents/handoff.md +1 -1
- package/pennyfarthing-dist/agents/reviewer-preflight.md +1 -1
- package/pennyfarthing-dist/agents/sm-setup.md +3 -3
- package/pennyfarthing-dist/agents/sm.md +1 -1
- package/pennyfarthing-dist/agents/tea.md +1 -1
- package/pennyfarthing-dist/agents/testing-runner.md +3 -3
- package/pennyfarthing-dist/commands/architect.md +2 -0
- package/pennyfarthing-dist/commands/continue-session.md +2 -2
- package/pennyfarthing-dist/commands/dev.md +2 -0
- package/pennyfarthing-dist/commands/devops.md +2 -0
- package/pennyfarthing-dist/commands/health-check.md +2 -0
- package/pennyfarthing-dist/commands/new-work.md +23 -0
- package/pennyfarthing-dist/commands/orchestrator.md +2 -0
- package/pennyfarthing-dist/commands/parallel-work.md +4 -2
- package/pennyfarthing-dist/commands/pm.md +2 -0
- package/pennyfarthing-dist/commands/reviewer.md +2 -0
- package/pennyfarthing-dist/commands/sm.md +2 -0
- package/pennyfarthing-dist/commands/tea.md +2 -0
- package/pennyfarthing-dist/commands/tech-writer.md +2 -0
- package/pennyfarthing-dist/commands/ux-designer.md +2 -0
- package/pennyfarthing-dist/commands/work.md +2 -0
- package/pennyfarthing-dist/guides/agent-behavior.md +29 -264
- package/pennyfarthing-dist/scripts/core/agent-session.sh +7 -0
- package/pennyfarthing-dist/scripts/core/check-context.sh +140 -226
- package/pennyfarthing-dist/scripts/core/handoff-marker.sh +13 -2
- package/pennyfarthing-dist/scripts/git/worktree-manager.sh +4 -1
- package/pennyfarthing-dist/scripts/health/drift-detection.sh +1 -7
- package/pennyfarthing-dist/scripts/hooks/post-merge.sh +4 -11
- package/pennyfarthing-dist/scripts/hooks/pre-commit.sh +3 -8
- package/pennyfarthing-dist/scripts/hooks/pre-push.sh +3 -3
- package/pennyfarthing-dist/scripts/jira/create-jira-epic.sh +1 -7
- package/pennyfarthing-dist/scripts/jira/create-jira-story.sh +2 -8
- package/pennyfarthing-dist/scripts/jira/jira-reconcile.sh +2 -8
- package/pennyfarthing-dist/scripts/lib/find-root.sh +17 -45
- package/pennyfarthing-dist/scripts/maintenance/sidecar-health.sh +1 -7
- package/pennyfarthing-dist/scripts/sprint/archive-story.sh +2 -8
- package/pennyfarthing-dist/scripts/sprint/available-stories.sh +2 -8
- package/pennyfarthing-dist/scripts/sprint/check-story.sh +2 -8
- package/pennyfarthing-dist/scripts/sprint/get-epic-field.sh +2 -8
- package/pennyfarthing-dist/scripts/sprint/get-story-field.sh +2 -8
- package/pennyfarthing-dist/scripts/sprint/list-future.sh +2 -8
- package/pennyfarthing-dist/scripts/sprint/new-sprint.sh +2 -8
- package/pennyfarthing-dist/scripts/sprint/promote-epic.sh +2 -8
- package/pennyfarthing-dist/scripts/sprint/sprint-info.sh +2 -8
- package/pennyfarthing-dist/scripts/tests/test-character-voice.sh +2 -1
- package/pennyfarthing-dist/scripts/workflow/finish-story.sh +4 -9
- package/pennyfarthing-dist/scripts/workflow/fix-session-phase.sh +2 -8
- package/pennyfarthing-dist/scripts/workflow/list-workflows.sh +2 -8
- package/pennyfarthing-dist/scripts/workflow/phase-owner.sh +1 -7
- package/pennyfarthing-dist/scripts/workflow/resume-workflow.sh +2 -8
- package/pennyfarthing-dist/scripts/workflow/show-workflow.sh +2 -8
- package/pennyfarthing-dist/scripts/workflow/start-workflow.sh +2 -8
- package/pennyfarthing-dist/scripts/workflow/workflow-status.sh +2 -8
- package/pennyfarthing-dist/skills/dev-patterns/SKILL.md +1 -1
- package/pennyfarthing-dist/skills/jira/SKILL.md +48 -24
- package/pennyfarthing-dist/skills/sprint/scripts/sync-epic-jira.sh +7 -0
- package/pennyfarthing-dist/skills/sprint/skill.md +30 -30
- package/pennyfarthing-dist/workflows/patch.yaml +68 -0
- package/pennyfarthing_scripts/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/config.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/output.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/context.py +414 -0
- package/pennyfarthing_scripts/patch_mode.py +449 -0
- package/pennyfarthing_scripts/prime/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/loader.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/persona.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/session.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/tiers.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/workflow.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/cli.py +201 -0
- package/pennyfarthing_scripts/prime/models.py +9 -0
- package/pennyfarthing_scripts/prime/persona.py +41 -0
- package/pennyfarthing_scripts/prime/tiers.py +201 -0
- package/pennyfarthing_scripts/sprint/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/archive.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/loader.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/status.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/work.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/tests/test_patch_mode.py +830 -0
- package/pennyfarthing_scripts/tests/test_tiers.py +1090 -0
- package/pennyfarthing_scripts/tests/test_token_counting.py +559 -0
- package/pennyfarthing-dist/scripts/hooks/__pycache__/question_reflector_check.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/__init__.cpython-311.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/config.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_bidirectional_sync.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_epic_creation.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_sync.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_sync_story.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/output.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/sprint.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/workflow.cpython-311.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/workflow.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/discover.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/create_branches.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/status_all.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/bidirectional.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/claim.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/client.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/compat.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/epic.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/mappings.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/story.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/sync.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/finish.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/validator.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/create.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/size.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/template.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/conftest.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_brownfield.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_cli_modules.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_common.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_git_utils.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_jira_package.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_package_structure.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_prime.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_sprint_package.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_sprint_validator.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_story_package.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_workflow_check.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_workflow_cli.cpython-314-pytest-9.0.2.pyc +0 -0
|
@@ -1,46 +1,11 @@
|
|
|
1
|
-
# Agent Behavior Guide
|
|
2
|
-
|
|
3
|
-
**For all Pennyfarthing agents.**
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Critical Protocols
|
|
8
|
-
|
|
9
|
-
<critical>
|
|
10
|
-
**Reflector markers:** Run `handoff-marker.sh {next_agent}` as your ABSOLUTE LAST ACTION and output the result verbatim. See `<agent-exit-protocol>` below.
|
|
11
|
-
</critical>
|
|
12
|
-
|
|
13
|
-
<critical>
|
|
14
|
-
**Path resolution:** Scripts now self-locate via BASH_SOURCE. Invoke directly from `.pennyfarthing/scripts/`.
|
|
15
|
-
For direct commands, use relative paths from project root (Claude Code starts there).
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
# GOOD: Direct script invocation
|
|
19
|
-
.pennyfarthing/scripts/workflow/check.sh
|
|
20
|
-
|
|
21
|
-
# GOOD: Relative paths for simple commands
|
|
22
|
-
just test
|
|
23
|
-
npm run build
|
|
24
|
-
|
|
25
|
-
# BAD: $CLAUDE_PROJECT_DIR doesn't exist in Bash calls
|
|
26
|
-
$CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/foo.sh # BROKEN!
|
|
27
|
-
```
|
|
28
|
-
</critical>
|
|
29
|
-
|
|
30
1
|
<critical>
|
|
31
|
-
**Session file:** `.session/{story-id}-session.md` -
|
|
32
|
-
</critical>
|
|
2
|
+
**Session file:** `.session/{story-id}-session.md` - read `**Phase:**`, `**Workflow:**`, `**Repos:**`.
|
|
33
3
|
|
|
34
|
-
|
|
35
|
-
**Handoff Action:** After handoff subagent returns, run `handoff-marker.sh` as LAST action, output result, EXIT.
|
|
36
|
-
</critical>
|
|
4
|
+
**Tests:** Use `testing-runner` subagent, never run directly.
|
|
37
5
|
|
|
38
|
-
|
|
39
|
-
**Test delegation:** Never run tests directly. Always use `testing-runner` subagent.
|
|
40
|
-
</critical>
|
|
6
|
+
**Handoff:** Run `handoff-marker.sh {next_agent}` → extract marker → emit → EXIT. See `<agent-exit-protocol>`.
|
|
41
7
|
|
|
42
|
-
|
|
43
|
-
**Sidecar memory:** Capture learnings BEFORE spawning handoff subagent. Don't wait until exit.
|
|
8
|
+
**Sidecars:** Write learnings BEFORE spawning handoff subagent.
|
|
44
9
|
</critical>
|
|
45
10
|
|
|
46
11
|
<critical>
|
|
@@ -60,117 +25,15 @@ $CLAUDE_PROJECT_DIR/.pennyfarthing/scripts/foo.sh # BROKEN!
|
|
|
60
25
|
## Reference
|
|
61
26
|
|
|
62
27
|
<info>
|
|
63
|
-
**Workflow:** SM → TEA → Dev → Reviewer
|
|
64
|
-
|
|
65
|
-
**Story completion:** Reviewer merges PR on approval. SM runs `finish-story.sh` to archive and update Jira. A story is NOT complete until SM runs finish.
|
|
66
|
-
|
|
67
|
-
**Confidence:** HIGH=proceed, MEDIUM=ask before risky, LOW=always ask.
|
|
68
|
-
|
|
69
|
-
**Skills:** `/sprint-context`, `/testing`, `/dev-patterns`, `/jira`, `/just`
|
|
70
|
-
|
|
71
|
-
**Reflector:** HTML comments parsed by Cyclist UI (see below).
|
|
72
|
-
|
|
73
|
-
**Turn efficiency:** Parallelize reads, batch bash with `&&`, spawn independent subagents together.
|
|
74
|
-
|
|
75
|
-
**Background tasks:** Don't block unless result needed. Cyclist notifies on completion.
|
|
76
|
-
|
|
77
|
-
**Sidecar location:** `.pennyfarthing/sidecars/{agent}/` with `patterns.md`, `gotchas.md`, `decisions.md`.
|
|
78
|
-
|
|
79
|
-
**Subagent skills:** Include skill paths in prompts - subagents don't auto-load skills.
|
|
80
|
-
|
|
81
|
-
**Worktree:** Get path from session: `WORKTREE_PATH=$(grep "^path:" "$SESSION_FILE" | cut -d' ' -f2)`
|
|
82
|
-
|
|
83
|
-
**Dogfooding:** Write to `pennyfarthing-dist/` not `.claude/` (symlink permission issue).
|
|
84
|
-
</info>
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## Project Context
|
|
89
|
-
|
|
90
|
-
<info>
|
|
91
|
-
**Project:** Pennyfarthing - Claude Code agent orchestration (pnpm monorepo, TypeScript)
|
|
28
|
+
**Workflow:** SM → TEA → Dev → Reviewer → SM. Trivial skips TEA.
|
|
92
29
|
|
|
93
|
-
**
|
|
94
|
-
- `pennyfarthing-dist/` - agents, commands, skills, guides, personas
|
|
95
|
-
- `sprint/current-sprint.yaml` - active sprint
|
|
96
|
-
- `.session/` - active work sessions
|
|
30
|
+
**Skills:** `/sprint`, `/testing`, `/dev-patterns`, `/jira`, `/just`
|
|
97
31
|
|
|
98
|
-
**
|
|
32
|
+
**Efficiency:** Parallelize reads, batch bash with `&&`, spawn independent subagents together.
|
|
99
33
|
|
|
100
|
-
**
|
|
34
|
+
**Subagents:** Include skill paths in prompts - they don't auto-load.
|
|
101
35
|
|
|
102
|
-
**
|
|
103
|
-
</info>
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## Sprint YAML and Jira Interaction Rules
|
|
108
|
-
|
|
109
|
-
<critical>
|
|
110
|
-
**Never directly edit sprint YAML.** All sprint YAML modifications MUST go through dedicated scripts.
|
|
111
|
-
</critical>
|
|
112
|
-
|
|
113
|
-
<info>
|
|
114
|
-
**Rule 1:** Use `/sprint` skill for sprint operations
|
|
115
|
-
- `/sprint status` - View sprint
|
|
116
|
-
- `/sprint backlog` - View available stories
|
|
117
|
-
- `/sprint work` - Start a story
|
|
118
|
-
- `/sprint archive` - Archive completed story
|
|
119
|
-
|
|
120
|
-
**Rule 2:** Use `/story` skill for story operations
|
|
121
|
-
- `/story finish` - Complete story (handles YAML, Jira, merge, archive)
|
|
122
|
-
- `/story create` - Add new story to sprint
|
|
123
|
-
|
|
124
|
-
**Rule 3:** Use `/jira` skill for all Jira operations
|
|
125
|
-
- `/jira claim` - Assign and move to In Progress
|
|
126
|
-
- `/jira move` - Transition status
|
|
127
|
-
- `/jira view` - Check status
|
|
128
|
-
- `/jira sync` - Sync YAML ↔ Jira
|
|
129
|
-
|
|
130
|
-
**Rule 4:** All sprint YAML access goes through scripts
|
|
131
|
-
```bash
|
|
132
|
-
# GOOD: Use scripts for ALL operations
|
|
133
|
-
.pennyfarthing/scripts/sprint/get-story-field.sh X-Y workflow
|
|
134
|
-
.pennyfarthing/scripts/sprint/get-epic-field.sh 35 jira
|
|
135
|
-
.pennyfarthing/scripts/sprint/check-story.sh X-Y
|
|
136
|
-
|
|
137
|
-
# BAD: Direct yq queries (even read-only)
|
|
138
|
-
yq '.epics[].stories[] | ...' sprint/current-sprint.yaml
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
**Script Responsibilities:**
|
|
142
|
-
| Operation | Script | Skill |
|
|
143
|
-
|-----------|--------|-------|
|
|
144
|
-
| Get story field | `get-story-field.sh` | - |
|
|
145
|
-
| Get epic field | `get-epic-field.sh` | - |
|
|
146
|
-
| Check story/epic | `check-story.sh` | `/sprint work` |
|
|
147
|
-
| Start story | `jira-claim-story.sh` | `/jira claim` |
|
|
148
|
-
| Finish story | `finish-story.sh` | `/story finish` |
|
|
149
|
-
| Archive story | `archive-story.sh --apply` | `/sprint archive` |
|
|
150
|
-
| Sync to Jira | `sync-epic-jira.sh` | `/jira sync` |
|
|
151
|
-
| Create epic | `create-jira-epic.sh` | `/jira create epic` |
|
|
152
|
-
</info>
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
## Persona System
|
|
158
|
-
|
|
159
|
-
<info>
|
|
160
|
-
**Config:** `.pennyfarthing/config.local.yaml` with `theme:` field.
|
|
161
|
-
|
|
162
|
-
**many themes available:** `/list-themes` to browse, `/show-theme <name>` for details, `/set-theme <name>` to change.
|
|
163
|
-
|
|
164
|
-
**Categories:** TV Series, Film, Literature, Anime, Games, History/Mythology.
|
|
165
|
-
|
|
166
|
-
**Attributes:** `verbosity` (low/medium/high), `formality` (formal/casual/playful), `humor` (enabled/disabled/subtle).
|
|
167
|
-
|
|
168
|
-
**Per-agent override:**
|
|
169
|
-
```yaml
|
|
170
|
-
overrides:
|
|
171
|
-
reviewer:
|
|
172
|
-
theme: discworld # Keep Granny even in Star Trek mode
|
|
173
|
-
```
|
|
36
|
+
**Dogfooding:** Write to `pennyfarthing-dist/` not `.claude/` (symlink issue).
|
|
174
37
|
</info>
|
|
175
38
|
|
|
176
39
|
---
|
|
@@ -178,148 +41,50 @@ overrides:
|
|
|
178
41
|
## Reflector
|
|
179
42
|
|
|
180
43
|
<critical>
|
|
181
|
-
**EVERY TURN MUST END WITH A CYCLIST MARKER.**
|
|
182
|
-
</critical>
|
|
183
|
-
|
|
184
|
-
<info>
|
|
185
|
-
HTML comments that agents emit to signal Cyclist UI. Format: `<!-- CYCLIST:TYPE:value -->`
|
|
186
|
-
|
|
187
|
-
| Type | Value | Cyclist Action |
|
|
188
|
-
|------|-------|----------------|
|
|
189
|
-
| `HANDOFF` | `/agent` | Shows "Continue with /agent" button |
|
|
190
|
-
| `CONTEXT_CLEAR` | `/agent` | Clears session, reloads with agent |
|
|
191
|
-
| `QUESTION` | `yesno` or `open` | Shows input dialog |
|
|
192
|
-
| `CHOICES` | `opt1,opt2,opt3` | Shows choice buttons |
|
|
193
|
-
| `CONTINUE` | (none) | Shows "Continue" button for status updates |
|
|
194
|
-
|
|
195
|
-
**Examples:**
|
|
196
|
-
```
|
|
197
|
-
<!-- CYCLIST:HANDOFF:/tea -->
|
|
198
|
-
<!-- CYCLIST:CONTEXT_CLEAR:/dev -->
|
|
199
|
-
<!-- CYCLIST:QUESTION:yesno -->
|
|
200
|
-
<!-- CYCLIST:QUESTION:open -->
|
|
201
|
-
<!-- CYCLIST:CHOICES:option1,option2,option3 -->
|
|
202
|
-
<!-- CYCLIST:CONTINUE -->
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
**When to use:**
|
|
206
|
-
- `HANDOFF` - End of phase (TEA→Dev, Dev→Reviewer)
|
|
207
|
-
- `CONTEXT_CLEAR` - Context >80% at handoff
|
|
208
|
-
- `QUESTION`/`CHOICES` - User input needed mid-work
|
|
209
|
-
- `CONTINUE` - Status updates, task completion, any turn that isn't a handoff or question
|
|
210
|
-
</info>
|
|
211
|
-
|
|
212
|
-
<critical>
|
|
213
|
-
**Marker Selection Guide:**
|
|
44
|
+
**EVERY TURN MUST END WITH A CYCLIST MARKER.** Stop hook enforces this.
|
|
214
45
|
|
|
215
46
|
| Situation | Marker |
|
|
216
47
|
|-----------|--------|
|
|
217
|
-
| Workflow handoff
|
|
218
|
-
| Handoff
|
|
48
|
+
| Workflow handoff | `<!-- CYCLIST:HANDOFF:/agent -->` |
|
|
49
|
+
| Handoff + context >80% | `<!-- CYCLIST:CONTEXT_CLEAR:/agent -->` |
|
|
219
50
|
| Yes/no question | `<!-- CYCLIST:QUESTION:yesno -->` |
|
|
220
51
|
| Open-ended question | `<!-- CYCLIST:QUESTION:open -->` |
|
|
221
52
|
| Multiple choice | `<!-- CYCLIST:CHOICES:a,b,c -->` |
|
|
222
|
-
|
|
|
223
|
-
| Providing information | `<!-- CYCLIST:CONTINUE -->` |
|
|
224
|
-
| Reporting an error/blocker | `<!-- CYCLIST:CONTINUE -->` |
|
|
225
|
-
|
|
226
|
-
**Question types requiring QUESTION/CHOICES markers:**
|
|
227
|
-
- Direct questions ending with `?`
|
|
228
|
-
- Implicit questions: "let me know if...", "would you like...", "should I..."
|
|
229
|
-
- Choice offerings: "Option A or Option B"
|
|
230
|
-
- Requests for input: "what do you think", "your preference"
|
|
231
|
-
- Clarification requests: "could you clarify"
|
|
232
|
-
|
|
233
|
-
**Exempt from question detection (but still need CONTINUE):**
|
|
234
|
-
- Rhetorical questions you answer yourself
|
|
235
|
-
- Questions inside code blocks or examples
|
|
236
|
-
- Historical context ("the question was...")
|
|
53
|
+
| Everything else | `<!-- CYCLIST:CONTINUE -->` |
|
|
237
54
|
</critical>
|
|
238
55
|
|
|
239
56
|
---
|
|
240
57
|
|
|
241
58
|
<agent-exit-protocol>
|
|
242
|
-
##
|
|
243
|
-
|
|
244
|
-
### Exit Sequence
|
|
59
|
+
## Exit Protocol
|
|
245
60
|
|
|
246
|
-
1. Write assessment to session
|
|
247
|
-
2. Spawn `handoff` subagent
|
|
248
|
-
3.
|
|
249
|
-
4.
|
|
250
|
-
5.
|
|
251
|
-
```bash
|
|
252
|
-
.pennyfarthing/scripts/handoff-marker.sh {next_agent}
|
|
61
|
+
1. Write assessment to session
|
|
62
|
+
2. Spawn `handoff` subagent → returns `HANDOFF_RESULT: {status, next_agent}`
|
|
63
|
+
3. If blocked → report error, stop
|
|
64
|
+
4. Run `.pennyfarthing/scripts/core/handoff-marker.sh {next_agent}`
|
|
65
|
+
5. Extract marker from YAML output, emit it:
|
|
253
66
|
```
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
### HANDOFF_RESULT Format
|
|
257
|
-
|
|
258
|
-
```
|
|
259
|
-
HANDOFF_RESULT:
|
|
260
|
-
status: success|blocked
|
|
261
|
-
next_agent: {agent_name}
|
|
262
|
-
error: "{message}" # if blocked
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
### Script Output (emit verbatim)
|
|
67
|
+
<!-- CYCLIST:HANDOFF:/dev -->
|
|
266
68
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
marker: "<!-- CYCLIST:HANDOFF:/dev -->"
|
|
271
|
-
fallback: "Run `/dev` to continue"
|
|
272
|
-
---
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
**Nothing after the marker. EXIT.**
|
|
69
|
+
Run `/dev` to continue
|
|
70
|
+
```
|
|
71
|
+
6. EXIT (nothing after marker)
|
|
276
72
|
</agent-exit-protocol>
|
|
277
73
|
|
|
278
74
|
<wrong-phase-detection>
|
|
279
75
|
## Wrong Phase Detection
|
|
280
76
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
### How to Check (works with custom workflows)
|
|
284
|
-
|
|
285
|
-
1. Read `**Workflow:**` and `**Phase:**` from session file
|
|
286
|
-
2. Query the phase owner:
|
|
287
|
-
```bash
|
|
288
|
-
OWNER=$(.pennyfarthing/scripts/workflow/phase-owner.sh {workflow} {phase})
|
|
289
|
-
```
|
|
290
|
-
3. If `$OWNER` != your agent name → story belongs to another agent
|
|
291
|
-
|
|
292
|
-
### Action When Not Your Phase
|
|
77
|
+
On activation, check if story phase belongs to you:
|
|
293
78
|
|
|
294
79
|
```bash
|
|
295
|
-
.pennyfarthing/scripts/
|
|
80
|
+
OWNER=$(.pennyfarthing/scripts/workflow/phase-owner.sh {workflow} {phase})
|
|
81
|
+
# If OWNER != your agent → emit handoff marker and EXIT
|
|
296
82
|
```
|
|
297
83
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
### Example
|
|
301
|
-
|
|
302
|
-
Dev reads session: `**Workflow:** tdd`, `**Phase:** review`
|
|
303
|
-
|
|
304
|
-
```bash
|
|
305
|
-
OWNER=$(.pennyfarthing/scripts/workflow/phase-owner.sh tdd review)
|
|
306
|
-
# Returns: reviewer
|
|
84
|
+
Output:
|
|
307
85
|
```
|
|
86
|
+
<!-- CYCLIST:HANDOFF:/{OWNER} -->
|
|
308
87
|
|
|
309
|
-
|
|
310
|
-
```bash
|
|
311
|
-
.pennyfarthing/scripts/handoff-marker.sh reviewer
|
|
88
|
+
Run `/{OWNER}` to continue
|
|
312
89
|
```
|
|
313
|
-
|
|
314
|
-
### Do NOT just say "run /reviewer"
|
|
315
|
-
|
|
316
|
-
Wrong:
|
|
317
|
-
> The story is in review. Run `/reviewer` to continue.
|
|
318
|
-
|
|
319
|
-
Right:
|
|
320
|
-
> The story is in review phase.
|
|
321
|
-
>
|
|
322
|
-
> <!-- CYCLIST:HANDOFF:/reviewer -->
|
|
323
|
-
>
|
|
324
|
-
> Run `/reviewer` to continue
|
|
325
90
|
</wrong-phase-detection>
|
|
@@ -8,6 +8,13 @@
|
|
|
8
8
|
#
|
|
9
9
|
# Session files stored in .session/agents/<session-id> for multi-session support
|
|
10
10
|
|
|
11
|
+
# Find package root (where pennyfarthing_scripts lives) from script location
|
|
12
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd -P)"
|
|
13
|
+
PACKAGE_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd -P)"
|
|
14
|
+
|
|
15
|
+
# Set PYTHONPATH so Python can find pennyfarthing_scripts
|
|
16
|
+
export PYTHONPATH="${PACKAGE_ROOT}:${PYTHONPATH:-}"
|
|
17
|
+
|
|
11
18
|
# Agents directory for multi-session support
|
|
12
19
|
AGENTS_DIR="$PROJECT_ROOT/.session/agents"
|
|
13
20
|
|