@windyroad/retrospective 0.1.5 → 0.1.6-preview.104

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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "wr-retrospective",
3
- "version": "0.1.0",
3
+ "version": "0.1.5",
4
4
  "description": "Session retrospective reminders and plan review for Claude Code"
5
- }
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/retrospective",
3
- "version": "0.1.5",
3
+ "version": "0.1.6-preview.104",
4
4
  "description": "Session retrospectives that update briefings and create problem tickets",
5
5
  "bin": {
6
6
  "windyroad-retrospective": "./bin/install.mjs"
@@ -28,6 +28,13 @@ Consider the work done in this session and identify:
28
28
 
29
29
  **What should we make easier or automate** — repetitive manual steps, missing tooling, things that could be scripted. These should become problem tickets via the `/problem` skill.
30
30
 
31
+ **What recurring workflow did I (or the assistant) perform that would be better as a skill?** — multi-step sequences that (a) were invoked multiple times in one session, (b) have a deterministic action order, and (c) are reusable across projects, not project-specific logic. These are **skill candidates**, not problem tickets, and route through Step 4b below.
32
+
33
+ Examples of skill candidates vs problem tickets:
34
+ - `fetch origin → check changesets → score risk → commit → push → release → sync manifest → mark Fix Released` — deterministic, recurring, cross-project → **skill candidate** (e.g. `wr-itil:ship-fix`).
35
+ - "The commit gate rejected my work twice because X was misconfigured" — diagnostic, project-specific → **problem ticket**.
36
+ - "I always forget to run `npm run verify` before pushing" — short, user-habit rather than codifiable sequence → **BRIEFING.md** note, not a skill.
37
+
31
38
  ### 3. Update BRIEFING.md
32
39
 
33
40
  Edit `docs/BRIEFING.md`:
@@ -50,6 +57,32 @@ For each item identified in "What was harder than it should have been", "What fa
50
57
  - If yes: update it with new evidence from this session
51
58
  - If no: create a new problem ticket
52
59
 
60
+ ### 4b. Recommend new skills
61
+
62
+ For each **skill candidate** identified in Step 2, route the decision through `AskUserQuestion`. This is the ADR-013 Rule 1 structured-interaction pattern — do not present the choices as prose enumeration in the skill output.
63
+
64
+ For each candidate, invoke `AskUserQuestion` with:
65
+ - `header: "Skill candidate"`
66
+ - `multiSelect: false`
67
+ - Three options:
68
+ 1. `Create a new skill` — description: "Scaffold a new skill for this recurring workflow. Requires suggested name, scope, and triggers — Step 4b records them for a future scaffolding flow to pick up."
69
+ 2. `Track as a problem ticket instead` — description: "File the candidate via /wr-itil:manage-problem so it can be planned and WSJF-ranked alongside other backlog items."
70
+ 3. `Skip — not skill-worthy` — description: "Neither create nor track. The candidate is too small, too ambiguous, or too project-specific to codify."
71
+
72
+ When the user chooses **Create a new skill**, record a candidate entry with:
73
+ - **Suggested skill name** (e.g. `wr-itil:ship-fix`) — kebab-case, namespaced to the owning plugin
74
+ - **Scope** — one sentence on what the skill does and when it should fire
75
+ - **Triggers** — example user prompts that should invoke it
76
+ - **Prior uses** — 2-3 observed invocations from this session
77
+
78
+ Store the candidate entry in the Step 5 summary under "Skill Candidates". Skill scaffolding itself is out of scope for this retrospective — scaffolding may land in a future skill (see P012 skill testing harness for the testing side of that).
79
+
80
+ When the user chooses **Track as a problem ticket**, fall through to the Step 4 flow with a "this should be a skill" note in the ticket description.
81
+
82
+ When the user chooses **Skip**, record the candidate in the Step 5 summary under "Skill Candidates" with a `skipped` marker so the pattern is still visible in the session audit trail.
83
+
84
+ **Non-interactive fallback (per ADR-013 Rule 6):** if `AskUserQuestion` is unavailable, record each candidate in the Step 5 summary under "Skill Candidates" with a `flagged — not actioned (non-interactive)` marker and do not create tickets or scaffold. The user can review the flags and decide when they return.
85
+
53
86
  ### 5. Summary
54
87
 
55
88
  Present a summary to the user:
@@ -65,8 +98,13 @@ Present a summary to the user:
65
98
  ### Problems Created/Updated
66
99
  - [problem ticket]: [summary]
67
100
 
101
+ ### Skill Candidates
102
+ - [suggested name] — [scope]. Triggers: [examples]. Decision: [created / tracked as P<NNN> / skipped / flagged (non-interactive)].
103
+
68
104
  ### No Action Needed
69
105
  - [learnings that were already captured]
70
106
  ```
71
107
 
108
+ If the "Skill Candidates" section is empty, omit it rather than rendering an empty header.
109
+
72
110
  $ARGUMENTS
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/env bats
2
+ # Doc-lint guard: run-retro SKILL.md must include the skill-recommendation branch.
3
+ #
4
+ # Structural assertion — Permitted Exception to the source-grep ban (ADR-005 / P011).
5
+ # These tests do not assert hook behaviour; they assert that the skill specification
6
+ # document includes the skill-candidate branch added in P044.
7
+ #
8
+ # Cross-reference:
9
+ # P044 (docs/problems/044-run-retro-does-not-recommend-new-skills.known-error.md)
10
+ # ADR-013 Rule 1 / Rule 6 (docs/decisions/013-structured-user-interaction-for-governance-decisions.proposed.md)
11
+ # @jtbd JTBD-001 (enforce governance without slowing down)
12
+ # @jtbd JTBD-101 (extend the suite with clear patterns)
13
+
14
+ setup() {
15
+ SKILL_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
16
+ SKILL_FILE="${SKILL_DIR}/SKILL.md"
17
+ }
18
+
19
+ @test "SKILL.md exists and has frontmatter" {
20
+ [ -f "$SKILL_FILE" ]
21
+ run head -1 "$SKILL_FILE"
22
+ [ "$status" -eq 0 ]
23
+ [ "$output" = "---" ]
24
+ }
25
+
26
+ @test "SKILL.md Step 2 includes the skill-candidate reflection category (P044)" {
27
+ # P044 fix: Step 2 must prompt for recurring workflows that would be better as skills.
28
+ # Regression guard: if Step 2 is rewritten and the skill-candidate prompt is dropped,
29
+ # this test fails.
30
+ run grep -n "recurring workflow.*better as a skill\|would be better as a skill" "$SKILL_FILE"
31
+ [ "$status" -eq 0 ]
32
+ }
33
+
34
+ @test "SKILL.md includes a Step 4b Recommend new skills branch (P044)" {
35
+ # P044 fix: a dedicated output branch for skill candidates, distinct from Step 4
36
+ # (problem tickets) and Step 5 (summary).
37
+ run grep -n "Recommend new skills\|Step 4b" "$SKILL_FILE"
38
+ [ "$status" -eq 0 ]
39
+ }
40
+
41
+ @test "SKILL.md Step 4b uses AskUserQuestion (ADR-013 Rule 1)" {
42
+ # ADR-013 Rule 1: the skill-candidate decision branch must use AskUserQuestion,
43
+ # not prose '(a)/(b)/(c)' enumeration. Architect review flagged this as the
44
+ # gotcha to avoid when implementing P044.
45
+ run grep -n "AskUserQuestion" "$SKILL_FILE"
46
+ [ "$status" -eq 0 ]
47
+ }
48
+
49
+ @test "SKILL.md Step 4b header matches ADR-013 structured-interaction pattern" {
50
+ # Header: "Skill candidate" identifies the AskUserQuestion call site and is what
51
+ # other tests / review tooling can grep for.
52
+ run grep -n "Skill candidate" "$SKILL_FILE"
53
+ [ "$status" -eq 0 ]
54
+ }
55
+
56
+ @test "SKILL.md Step 4b names the three structured options (P044)" {
57
+ # The three decision options must be explicit: create, track, skip.
58
+ run grep -n "Create a new skill" "$SKILL_FILE"
59
+ [ "$status" -eq 0 ]
60
+ run grep -n "Track as a problem ticket" "$SKILL_FILE"
61
+ [ "$status" -eq 0 ]
62
+ run grep -n "Skip — not skill-worthy\|Skip - not skill-worthy" "$SKILL_FILE"
63
+ [ "$status" -eq 0 ]
64
+ }
65
+
66
+ @test "SKILL.md Step 4b has non-interactive fallback per ADR-013 Rule 6" {
67
+ # ADR-013 Rule 6: if AskUserQuestion is unavailable, flag candidates instead of
68
+ # silently choosing. P044 implementation uses "flagged — not actioned" wording.
69
+ run grep -n "non-interactive\|Rule 6" "$SKILL_FILE"
70
+ [ "$status" -eq 0 ]
71
+ }
72
+
73
+ @test "SKILL.md Step 5 summary template has a Skill Candidates slot (P044)" {
74
+ # P044 fix: the summary template must include a Skill Candidates section so
75
+ # recommendations are visible in the session audit alongside BRIEFING changes
76
+ # and problem tickets.
77
+ run grep -n "### Skill Candidates" "$SKILL_FILE"
78
+ [ "$status" -eq 0 ]
79
+ }
80
+
81
+ @test "SKILL.md does not contain 'Options: (a)' prose option list (ADR-013)" {
82
+ # ADR-013 Rule 1: user-facing decisions must use AskUserQuestion, not prose
83
+ # "Options: (a)/(b)/(c)". This matches the narrow pattern used by
84
+ # manage-problem-no-prose-options.bats so criteria lists using (a)/(b)/(c)
85
+ # as internal enumeration (which are fine) don't trip the test.
86
+ run grep -n "Options: (a)" "$SKILL_FILE"
87
+ [ "$status" -ne 0 ]
88
+ }
89
+
90
+ @test "SKILL.md does not contain 'Your call:' prose option prompt (ADR-013)" {
91
+ # ADR-013 Rule 1: mirrors the manage-problem regression guard.
92
+ run grep -n "Your call:" "$SKILL_FILE"
93
+ [ "$status" -ne 0 ]
94
+ }