@srobroek/pi-user-journeys 0.0.0-stage → 0.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.
@@ -0,0 +1,18 @@
1
+ ---
2
+ journey: J01
3
+ journey_version: 1
4
+ commit: <sha>
5
+ date: <YYYY-MM-DDTHH:MMZ>
6
+ mode: full
7
+ interface: <profile-name (driver actually used)>
8
+ result: pass
9
+ steps: {S1: pass}
10
+ findings: []
11
+ ---
12
+
13
+ <!-- One section per non-pass step:
14
+ ## S<id> -- FAIL|BLOCKED
15
+ Expected ... Observed ... Evidence: ...
16
+ Triage: <correction|intended-change|suspected-regression|product-question|environment> -- <rationale>
17
+ → <amendment made / finding filed / nothing>
18
+ -->
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: journey-verify
3
+ description: "Use when validating user journeys against the running product: drive each step, triage mismatches, record results."
4
+ metadata:
5
+ opencode/autoinvoke: false
6
+ ---
7
+
8
+ # journey-verify
9
+
10
+ Coordinate validation of one or more journeys. `FORMAT.md` in the journeys
11
+ directory is normative; read it plus `README.md` (config) and the target
12
+ `journey.md` files first.
13
+
14
+ Formula templates live in this skill's directory:
15
+ `formulas/*.formula.toml`.
16
+
17
+ ## Beads formula provisioning
18
+
19
+ When the repository contains `.beads/`, run the `journey_install_formulas` tool
20
+ with `repoRoot` before validation. Without the tool, as in Claude Code, copy the
21
+ files from `formulas/` into `.beads/formulas/` yourself, never overwriting a file
22
+ that differs; in Claude Code they are in `${CLAUDE_SKILL_DIR}/formulas/`. The tool copies the package-owned formulas into
23
+ `.beads/formulas/` and leaves identical copies unchanged. If a destination
24
+ differs, stop and ask before rerunning with `force`.
25
+
26
+ Use `journey-step-agentic-verification` when the result needs no human gate.
27
+ Use `journey-step-human-verification` when a human must approve the triaged
28
+ result before evidence is recorded. Pour one molecule per selected journey
29
+ step; both formulas fan out runtime, definition, and acceptance checks before
30
+ triage.
31
+
32
+ ## Who validates
33
+
34
+ Launch one `journey-validator` subagent (`journeys:journey-validator` in Claude
35
+ Code) per journey -- the complete validation
36
+ procedure (driving, evidence, triage, intent-gated amendment, run file,
37
+ findings) is owned by that agent's definition, not restated here. Respect
38
+ profile `exclusive: true`: serialize journeys sharing an exclusive profile;
39
+ the rest run in parallel.
40
+
41
+ - If the `journey-validator` agent is unavailable, validate inline one
42
+ journey at a time: read the agent definition
43
+ (`agents/journey-validator.md` in the journeys plugin package) and follow
44
+ it verbatim.
45
+ - Never validate a journey your own context authored or amended in this
46
+ conversation -- that is self-review. Hand it to a validator agent or
47
+ report that first validation needs a fresh context.
48
+
49
+ ## Coordinator duties
50
+
51
+ 1. **Resolve scope and inputs.** Which journeys; for each, the profile from
52
+ its `interfaces:` and README.md. Pass each validator: journey path,
53
+ journeys dir, run mode (`full` or `changed-only(S…)`), profile name, and
54
+ the repo's commit convention. Validators own only their journey and run
55
+ files; the coordinator owns shared INDEX.md/TRACKER.md and commits.
56
+ 2. **Aggregate.** Collect the validators' structured results. Local finding
57
+ id assignment is single-writer: append returned finding payloads to
58
+ TRACKER.md yourself in one pass. Explicitly assigned github-issues
59
+ reporters may file directly.
60
+ 3. **Promotion.** A `draft` journey may become `active` only when every
61
+ step passed AND its Known gaps are all user-confirmed; note the
62
+ promotion in the run file. Otherwise leave `status` untouched.
63
+ 4. **Reindex once** per wave: `journeys_index` command `index` in OpenCode (or
64
+ `python3 <journeys-dir>/journeys.py index <journeys-dir>` when using the copied helper), then lint.
65
+ 5. **Commit** journeys-dir changes as
66
+ `journey(J<id>): validate v<version> -- <result>` -- unless the caller or
67
+ repo workflow forbids committing; then leave uncommitted and say so.
68
+
69
+ ## Journeys and E2E specs
70
+
71
+ When a journey has a deterministic spec (its id is in the spec title or annotation; see
72
+ `journey-write`), the journey remains the source of truth.
73
+
74
+ - List journeys without a spec in the report, so the owner can decide which to automate.
75
+ - When a spec fails, re-validate its journey first. A journey that still passes means the spec
76
+ has a stale selector or timing fault, so fix the spec. A journey that fails is a product
77
+ regression.
78
+ - Never commit a healer rewrite of a spec without review.
79
+
80
+ ## Close the loop
81
+
82
+ Report per-journey results, amendments (with evidence), findings filed.
83
+ Then offer next actions -- never auto-run them when invoked directly:
84
+ `journey-consolidate` when green with Δ entries or when `runs/` exceeds
85
+ README `runs_keep` (retention is enforced only at consolidation -- say so);
86
+ the fix loop per README `fix_loop` for regressions (`journey-campaign`
87
+ owns the autonomous loop).
@@ -0,0 +1,72 @@
1
+ formula = "journey-step-agentic-verification"
2
+ description = "Agent-only verification workflow for one user-journey step"
3
+ version = 1
4
+ type = "workflow"
5
+
6
+ [vars.journey_id]
7
+ description = "Journey identifier, for example J01"
8
+ required = true
9
+ pattern = "^J[0-9]+$"
10
+
11
+ [vars.step_id]
12
+ description = "Journey step identifier, for example S1 or S3a"
13
+ required = true
14
+ pattern = "^S[0-9]+[a-z]?$"
15
+
16
+ [vars.step_title]
17
+ description = "Short human-readable title for the step"
18
+ required = true
19
+
20
+ [vars.journey_path]
21
+ description = "Repository path to the journey definition"
22
+ required = true
23
+
24
+ [vars.validated_sha]
25
+ description = "Exact Git commit used for validation"
26
+ required = true
27
+ pattern = "^[0-9a-f]{40}$"
28
+
29
+ [vars.profile]
30
+ description = "Validation profile used by the step"
31
+ default = "default"
32
+
33
+ [[steps]]
34
+ id = "preflight"
35
+ title = "Preflight {{journey_id}}/{{step_id}}: {{step_title}}"
36
+ type = "task"
37
+ description = "Confirm {{journey_path}}, validation profile {{profile}}, exact commit {{validated_sha}}, runtime prerequisites, and disposable-state policy before driving the step."
38
+
39
+ [[steps]]
40
+ id = "drive-step"
41
+ title = "Agent-drive {{journey_id}}/{{step_id}}: {{step_title}}"
42
+ type = "task"
43
+ needs = ["preflight"]
44
+ description = "Execute the journey step through the selected profile and capture reproducible runtime evidence."
45
+
46
+ [[steps]]
47
+ id = "inspect-definition"
48
+ title = "Inspect {{journey_id}}/{{step_id}} journey definition"
49
+ type = "task"
50
+ needs = ["preflight"]
51
+ description = "Check the journey's stated intent, expected result, step ordering, and required evidence without starting another runtime session."
52
+
53
+ [[steps]]
54
+ id = "inspect-acceptance"
55
+ title = "Inspect {{journey_id}}/{{step_id}} acceptance and tracking"
56
+ type = "task"
57
+ needs = ["preflight"]
58
+ description = "Check the acceptance criteria, related Beads, residual-work constraints, and exact-commit evidence requirements for this step."
59
+
60
+ [[steps]]
61
+ id = "triage"
62
+ title = "Fan in and triage {{journey_id}}/{{step_id}} verification"
63
+ type = "task"
64
+ needs = ["drive-step", "inspect-definition", "inspect-acceptance"]
65
+ description = "Combine the independent runtime, definition, and acceptance checks; classify the result as pass, finding, or blocked; and preserve close constraints."
66
+
67
+ [[steps]]
68
+ id = "record"
69
+ title = "Record {{journey_id}}/{{step_id}} verification"
70
+ type = "task"
71
+ needs = ["triage"]
72
+ description = "Append the evidence to the relevant Beads, link findings, and close only step work whose acceptance criteria are met."
@@ -0,0 +1,82 @@
1
+ formula = "journey-step-human-verification"
2
+ description = "Human-gated verification workflow for one user-journey step"
3
+ version = 1
4
+ type = "workflow"
5
+
6
+ [vars.journey_id]
7
+ description = "Journey identifier, for example J01"
8
+ required = true
9
+ pattern = "^J[0-9]+$"
10
+
11
+ [vars.step_id]
12
+ description = "Journey step identifier, for example S1 or S3a"
13
+ required = true
14
+ pattern = "^S[0-9]+[a-z]?$"
15
+
16
+ [vars.step_title]
17
+ description = "Short human-readable title for the step"
18
+ required = true
19
+
20
+ [vars.journey_path]
21
+ description = "Repository path to the journey definition"
22
+ required = true
23
+
24
+ [vars.validated_sha]
25
+ description = "Exact Git commit used for validation"
26
+ required = true
27
+ pattern = "^[0-9a-f]{40}$"
28
+
29
+ [vars.profile]
30
+ description = "Validation profile used by the step"
31
+ default = "default"
32
+
33
+ [[steps]]
34
+ id = "preflight"
35
+ title = "Preflight {{journey_id}}/{{step_id}}: {{step_title}}"
36
+ type = "task"
37
+ description = "Confirm {{journey_path}}, validation profile {{profile}}, exact commit {{validated_sha}}, runtime prerequisites, and disposable-state policy before driving the step."
38
+
39
+ [[steps]]
40
+ id = "drive-step"
41
+ title = "Agent-drive {{journey_id}}/{{step_id}}: {{step_title}}"
42
+ type = "task"
43
+ needs = ["preflight"]
44
+ description = "Execute the journey step through the selected profile and capture reproducible runtime evidence for a human reviewer."
45
+
46
+ [[steps]]
47
+ id = "inspect-definition"
48
+ title = "Inspect {{journey_id}}/{{step_id}} journey definition"
49
+ type = "task"
50
+ needs = ["preflight"]
51
+ description = "Check the journey's stated intent, expected result, step ordering, and required evidence without starting another runtime session."
52
+
53
+ [[steps]]
54
+ id = "inspect-acceptance"
55
+ title = "Inspect {{journey_id}}/{{step_id}} acceptance and tracking"
56
+ type = "task"
57
+ needs = ["preflight"]
58
+ description = "Check the acceptance criteria, related Beads, residual-work constraints, and exact-commit evidence requirements for this step."
59
+
60
+ [[steps]]
61
+ id = "triage"
62
+ title = "Fan in and triage {{journey_id}}/{{step_id}} verification"
63
+ type = "task"
64
+ needs = ["drive-step", "inspect-definition", "inspect-acceptance"]
65
+ description = "Combine the independent runtime, definition, and acceptance checks and prepare a pass, finding, or blocked decision for human review."
66
+
67
+ [[steps]]
68
+ id = "human-review"
69
+ title = "Human review {{journey_id}}/{{step_id}}: {{step_title}}"
70
+ type = "task"
71
+ needs = ["triage"]
72
+ description = "Inspect the agent evidence and decide whether the step passes, needs a finding, or is blocked. Resolve this gate with bd gate resolve."
73
+
74
+ [steps.gate]
75
+ type = "human"
76
+
77
+ [[steps]]
78
+ id = "record"
79
+ title = "Record {{journey_id}}/{{step_id}} verification"
80
+ type = "task"
81
+ needs = ["human-review"]
82
+ description = "Append the evidence and human decision to the relevant Beads, link findings, and close only step work whose acceptance criteria are met."
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: journey-verify-changed
3
+ description: Use when validating only the journeys affected by a diff, PR, or branch change rather than the full journey suite.
4
+ metadata:
5
+ opencode/autoinvoke: false
6
+ ---
7
+
8
+ # journey-verify-changed
9
+
10
+ Scope first, then delegate execution to the journey-verify procedure in
11
+ changed-only mode. FORMAT.md and README.md in the journeys directory are
12
+ normative.
13
+
14
+ ## 1 -- Determine the change set
15
+
16
+ In order of preference:
17
+ 1. What the user named (PR number, ref range, feature description).
18
+ 2. Merge-base diff with the default branch on a feature branch.
19
+ 3. On the default branch: since the last release tag, else recent merges.
20
+
21
+ Collect both the **file list** and the **stated intent** (PR titles/bodies,
22
+ commit messages, changelog entries) -- files say where, intent says what.
23
+
24
+ ## 2 -- Map changes to journeys and steps
25
+
26
+ 1. Apply README.md's surface map (globs → surfaces) to the file list.
27
+ 2. Read INDEX.md; select journeys whose `surfaces:` intersect.
28
+ 3. Bridge gaps with judgment: read the diff enough to understand
29
+ user-visible impact; a change can hit journeys no glob names (shared
30
+ components, API contracts). Note additions the surface map should learn
31
+ and propose them for README.md.
32
+ 4. Within each selected journey, mark the steps plausibly affected. When in
33
+ doubt about a step, include it -- false inclusion costs a step run, false
34
+ exclusion misses a regression. Always include steps whose
35
+ `Expect (negative):` guards the changed area.
36
+ 5. If the change is user-visible but NO journey covers it, that is a
37
+ coverage gap: report it and offer journey-write before validating.
38
+
39
+ ## 3 -- Validate
40
+
41
+ Run the journey-verify procedure for the selected journeys with
42
+ `mode: changed-only(S…)` -- selected steps plus any earlier steps needed to
43
+ reach them (those run as setup; their expectations still count). Everything
44
+ else in journey-verify applies unchanged: triage, intent gating, run files,
45
+ reporter, commit.
46
+
47
+ ## 4 -- Report
48
+
49
+ Per journey: scope chosen and why, results, amendments, findings. State
50
+ explicitly what was NOT validated (unselected journeys/steps) so a green
51
+ result is never mistaken for full coverage.
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: journey-write
3
+ description: Use when authoring or amending user journeys from feature evidence, grilling on unknowns and checking readiness.
4
+ metadata:
5
+ opencode/autoinvoke: false
6
+ ---
7
+
8
+ # journey-write
9
+
10
+ Write or amend journeys per the format spec. The journeys directory's
11
+ `FORMAT.md` is normative -- read it first, along with `README.md` (config)
12
+ and `INDEX.md`. If no journeys directory exists, run `journey-init` first.
13
+
14
+ Delegate the drafting to the `journey-scribe` subagent (`journeys:journey-scribe` in
15
+ Claude Code) when working on more
16
+ than one journey; do it inline for a single journey. If the
17
+ `journey-scribe` agent is not available in this environment, draft
18
+ inline under the same boundaries. Elicitation always
19
+ happens HERE, in the main context -- subagents cannot question the user.
20
+ The scribe receives the answers and returns open questions.
21
+
22
+ ## Gather authoring input
23
+
24
+ The journey is **spec-informed but independently owned**: read whatever
25
+ change record exists -- feature spec, merged PRs, diff, design docs, the
26
+ running feature itself -- to learn intended behavior. Record references in
27
+ `trace:` (repo's own vocabulary). Never copy acceptance scenarios verbatim;
28
+ a journey describes what a *user* does and observes end to end, which spans
29
+ many specs and includes glue no spec contains.
30
+
31
+ ## Elicitation -- the grilling protocol
32
+
33
+ Draft first when there is evidence to draft from: read it, produce the
34
+ best draft it supports, and interrogate the user only on the genuine
35
+ holes -- decisions the evidence cannot answer. Asking what the repo already
36
+ answers is noise; asking about real forks is signal.
37
+
38
+ When the repo has little or no relevant evidence (greenfield journey, a
39
+ feature that exists mostly in the user's head), grilling IS the primary
40
+ input: skip the evidence hunt, open with a skeleton draft of your best
41
+ understanding, and grill from there. Gather info first only when it makes
42
+ sense -- never stall a journey waiting for documents that don't exist.
43
+
44
+ In a headless context with no question channel (e.g. running as a
45
+ subagent), owner-supplied statements from the invocation stand in for
46
+ grilling answers; anything they don't cover goes to your report as an open
47
+ question.
48
+
49
+ Grill with the `question` tool (`AskUserQuestion` in Claude Code), up to 4 questions per round:
50
+
51
+ - Each question states a **tension** -- why the answer isn't obvious, what
52
+ breaks under each reading -- then offers 2 to 4 concrete, mutually exclusive
53
+ options with their consequences spelled out. Mark a recommendation and
54
+ put it first.
55
+ - Challenge the user's framing when the evidence contradicts it. If they
56
+ describe the feature one way and the code/spec says another, surface the
57
+ conflict as a question, not silently pick a side.
58
+ - Target the definition-of-ready gaps by name: an unmeasurable success
59
+ criterion, a missing "done" observation, an unguarded trust point, an
60
+ unscoped error branch. Quote the draft text you would write under each
61
+ option when it sharpens the choice.
62
+ - Never ask permission ("shall I write it?"), only decisions.
63
+
64
+ **How far:** grill until the FORMAT.md definition-of-ready audit passes,
65
+ capped at 3 rounds by default (the user saying "good enough" ends it
66
+ early). At the cap, do NOT silently park unknowns: present every remaining
67
+ gap in one final question -- provide the missing information, or explicitly
68
+ accept each ambiguity. Only a user-confirmed ambiguity becomes a **Known
69
+ gaps** entry (recorded with "accepted by user, <date>"); an unconfirmed
70
+ gap keeps the journey at `status: draft` with the open questions in your
71
+ report. MUST never invent missing information or accept an ambiguity on the
72
+ user's behalf.
73
+
74
+ ## The definition-of-ready audit
75
+
76
+ Before a journey is reported done, audit it line by line against
77
+ FORMAT.md's "Definition of ready" checklist and include the audit in your
78
+ report: each item pass/fail, and for each fail either the grill question
79
+ it raised or the Known-gaps entry that records it. A journey with open
80
+ audit fails stays `status: draft`.
81
+
82
+ ## New journey
83
+
84
+ 1. Allocate the next free `J<n>` id (check INDEX.md; ids are never reused).
85
+ 2. Draft from `templates/journey.template.md` in the journey-init skill's directory:
86
+ - Steps are interface-agnostic user actions with observable `Expect:`
87
+ assertions. Add `Expect (negative):` wherever trust depends on
88
+ something NOT happening (no silent writes, no data loss).
89
+ - `surfaces:` must name the product surfaces touched -- this powers
90
+ changed-only validation. Add new globs to README.md's surface map if
91
+ the mapping is not obvious.
92
+ - `interfaces:` names README.md profiles able to run this journey.
93
+ - Status `draft` until first validated; `version: 1`;
94
+ `last_reviewed:` today.
95
+ 3. Lint + reindex:
96
+ `python3 <journeys-dir>/journeys.py lint <journeys-dir>` then
97
+ `python3 <journeys-dir>/journeys.py index <journeys-dir>`.
98
+
99
+ ## Amend an existing journey
100
+
101
+ Classify the change first (FORMAT.md, "three change species"):
102
+
103
+ - **Correction** (doc is wrong about existing reality): fix the body, no
104
+ delta entry, no version bump. Commit as `journey(J<id>): correct ...`.
105
+ - **Behavior delta** (product intentionally changed): edit the body to the
106
+ new truth, bump `version`, add one compact Δ entry citing intent evidence
107
+ (PR/spec/commit -- you were given it or found it; if you cannot cite any,
108
+ stop and ask, do not amend).
109
+ - New steps get inserted ids (`S3a`), never renumber; removed steps retire
110
+ their ids.
111
+
112
+ ## Migration of an existing doc
113
+
114
+ Rewrite, don't transliterate: extract goal, preconditions, user-visible
115
+ steps and assertions from the legacy doc; drop tool-specific mechanics into
116
+ the relevant README.md interface profile notes instead of the journey.
117
+ Carry over known-gaps. Legacy history does not become delta
118
+ entries -- the new journey starts at `version: 1` as current truth, with the
119
+ legacy doc linked in `trace:`. Propose deleting or pointer-stubbing the
120
+ legacy doc; let the user decide.
121
+
122
+ ## Journeys and deterministic E2E specs
123
+
124
+ A journey stays the agent-validated source of truth. Once it passes, its stable steps may become
125
+ a deterministic spec. Pick the tool for the surface from the `e2e` row in the `toolchain-languages`
126
+ skill's `references/surfaces.md`.
127
+
128
+ - Bootstrap the spec from the passed run with Playwright Test Agents (planner, generator) or
129
+ `playwright codegen`, then edit it by hand.
130
+ - Tag each spec with its journey id in the title or an annotation, for example
131
+ `test('J-012 checkout with saved card', ...)`.
132
+ - Keep the journey's `Expect (negative):` assertions as assertions in the spec.
133
+ - Never commit a healer rewrite without review.
134
+
135
+ ## Always
136
+
137
+ - Never validate as part of authoring: do not invoke journey-verify (or
138
+ drive the product against the steps) on a journey you just wrote or
139
+ amended. First validation must come from a fresh context -- a validator
140
+ certifying a document its own context authored is self-review. End by
141
+ offering journey-verify as the next step instead.
142
+ - End by running lint + index; both must be clean.
143
+ - Report which journeys were created/amended, at which versions, and any
144
+ surface-map or profile updates made to README.md.
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: journeys-guide
3
+ description: "Use for user journeys: set up a journeys dir, write, verify all or changed, run campaigns, consolidate checkpoints."
4
+ ---
5
+
6
+ # Journeys guide
7
+
8
+ This guide only routes. Before you answer or act, load the matching skill with the skill
9
+ tool, by id, in this same turn, and every other row the task spans. Answer from the loaded
10
+ skill, not from this table.
11
+
12
+ | Situation | Load skill |
13
+ | --- | --- |
14
+ | The repo has no user-journeys directory yet: investigate, interview, scaffold the format | `journey-init` |
15
+ | Authoring or amending journeys from feature evidence | `journey-write` |
16
+ | Validating journeys against the running product: drive steps, triage, record results | `journey-verify` |
17
+ | Validating only the journeys a diff, PR or branch touches | `journey-verify-changed` |
18
+ | Fleet-scale journey or issue validation: fan out validators, fix, re-validate until green | `journey-campaign` |
19
+ | Advancing a journey checkpoint with approval: flush delta logs, prune runs, regenerate the index | `journey-consolidate` |
20
+
21
+ Turning a passed journey into a deterministic E2E spec, and telling a spec failure from a regression, is covered in `journey-write` and `journey-verify`.