@windyroad/jtbd 0.2.1 → 0.3.0-preview.38

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/agents/agent.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agent
3
- description: Jobs To Be Done reviewer. Use before editing any user-facing UI files.
4
- Reads docs/JOBS_TO_BE_DONE.md and PRODUCT_DISCOVERY.md and reviews proposed changes
3
+ description: Jobs To Be Done reviewer. Use before editing any project file.
4
+ Reads docs/jtbd/ (or docs/JOBS_TO_BE_DONE.md) and reviews proposed changes
5
5
  against documented jobs, persona constraints, and screen mappings. Reports alignment
6
6
  or gaps.
7
7
  tools:
@@ -12,7 +12,7 @@ tools:
12
12
  model: inherit
13
13
  ---
14
14
 
15
- You are the JTBD Lead. You review proposed UI changes against the project's Jobs To Be Done documentation and persona definitions before any user-facing code is edited. You are a reviewer, not an editor.
15
+ You are the JTBD Lead. You review proposed changes against the project's Jobs To Be Done documentation and persona definitions before project files are edited. You are a reviewer, not an editor.
16
16
 
17
17
  ## Your Role
18
18
 
@@ -91,7 +91,7 @@ After completing your review, write your verdict to `/tmp/jtbd-verdict`:
91
91
  ## Constraints
92
92
 
93
93
  - You are read-only. You do not edit files (except writing the verdict file).
94
- - You review user-facing UI files.
94
+ - You review all project files (not just UI files).
95
95
  - If the change is purely structural with no user-visible impact (CSS refactor, types, imports), report PASS.
96
96
  - Do not review accessibility (that is accessibility-lead's job).
97
97
  - Do not review styling (that is style-guide-lead's job).
@@ -1,6 +1,7 @@
1
1
  #!/bin/bash
2
2
  # JTBD - PreToolUse enforcement hook
3
3
  # BLOCKS Edit/Write to project files until jtbd-lead is consulted.
4
+ # Supports both docs/jtbd/ directory (preferred) and docs/JOBS_TO_BE_DONE.md (legacy).
4
5
  # Uses shared review-gate.sh for TTL, drift detection, and fail-closed.
5
6
 
6
7
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
@@ -63,20 +64,30 @@ case "$FILE_PATH" in
63
64
  exit 0 ;;
64
65
  */docs/problems/*.md|docs/problems/*.md)
65
66
  exit 0 ;;
67
+ */docs/jtbd/*|docs/jtbd/*)
68
+ exit 0 ;;
66
69
  */docs/JOBS_TO_BE_DONE.md|docs/JOBS_TO_BE_DONE.md)
67
70
  exit 0 ;;
68
71
  */docs/PRODUCT_DISCOVERY.md|docs/PRODUCT_DISCOVERY.md)
69
72
  exit 0 ;;
70
73
  esac
71
74
 
72
- # If no JTBD doc exists, block and direct to create skill
73
- if [ ! -f "docs/JOBS_TO_BE_DONE.md" ]; then
74
- review_gate_deny "BLOCKED: Cannot edit '${BASENAME}' because docs/JOBS_TO_BE_DONE.md does not exist. Run /wr-jtbd:update-guide to generate a JTBD document for this project, then delegate to wr-jtbd:agent for review."
75
+ # Determine JTBD path — prefer directory, fall back to single file
76
+ JTBD_PATH=""
77
+ if [ -d "docs/jtbd" ]; then
78
+ JTBD_PATH="docs/jtbd"
79
+ elif [ -f "docs/JOBS_TO_BE_DONE.md" ]; then
80
+ JTBD_PATH="docs/JOBS_TO_BE_DONE.md"
81
+ fi
82
+
83
+ # If no JTBD docs exist, block and direct to create skill
84
+ if [ -z "$JTBD_PATH" ]; then
85
+ review_gate_deny "BLOCKED: Cannot edit '${BASENAME}' because no JTBD documentation exists. Run /wr-jtbd:update-guide to generate JTBD docs for this project, then delegate to wr-jtbd:agent for review."
75
86
  exit 0
76
87
  fi
77
88
 
78
89
  # Check gate with TTL + drift detection
79
- if check_review_gate "$SESSION_ID" "jtbd" "docs/JOBS_TO_BE_DONE.md"; then
90
+ if check_review_gate "$SESSION_ID" "jtbd" "$JTBD_PATH"; then
80
91
  exit 0
81
92
  fi
82
93
 
@@ -1,9 +1,30 @@
1
1
  #!/bin/bash
2
2
  # JTBD - UserPromptSubmit hook
3
- # Detects JOBS_TO_BE_DONE.md in the project and injects delegation instruction.
4
- # If the file doesn't exist, instructs Claude to create it via the update-guide skill.
3
+ # Detects JTBD docs in the project and injects delegation instruction.
4
+ # Supports both docs/jtbd/ directory (preferred) and docs/JOBS_TO_BE_DONE.md (legacy).
5
+ # If neither exists, instructs Claude to create via the update-guide skill.
5
6
 
6
- if [ -f "docs/JOBS_TO_BE_DONE.md" ]; then
7
+ if [ -f "docs/jtbd/README.md" ]; then
8
+ cat <<'HOOK_OUTPUT'
9
+ INSTRUCTION: MANDATORY JTBD CHECK. YOU MUST FOLLOW THIS.
10
+ DETECTED: docs/jtbd/ exists in this project.
11
+
12
+ This is a NON-OPTIONAL instruction. You MUST use the jtbd-lead agent
13
+ before editing any project file. This is proactive. Do not wait for the
14
+ user to ask.
15
+
16
+ REQUIRED ACTIONS:
17
+ 1. Use the Agent tool to delegate to wr-jtbd:agent
18
+ (subagent_type: "wr-jtbd:agent")
19
+ 2. The jtbd-lead will review proposed changes against docs/jtbd/ persona
20
+ and job definitions
21
+ 3. Do NOT write or edit project files without jtbd-lead review FIRST
22
+ 4. Do NOT skip this step even if you think you can handle it yourself
23
+
24
+ SCOPE: All project files.
25
+ Does NOT apply to: CSS, images, fonts, lockfiles, changesets, memory files, plan files.
26
+ HOOK_OUTPUT
27
+ elif [ -f "docs/JOBS_TO_BE_DONE.md" ]; then
7
28
  cat <<'HOOK_OUTPUT'
8
29
  INSTRUCTION: MANDATORY JTBD CHECK. YOU MUST FOLLOW THIS.
9
30
  DETECTED: docs/JOBS_TO_BE_DONE.md exists in this project.
@@ -25,7 +46,7 @@ Does NOT apply to: CSS, images, fonts, lockfiles, changesets, memory files, plan
25
46
  HOOK_OUTPUT
26
47
  else
27
48
  cat <<'HOOK_OUTPUT'
28
- NOTE: This project has no docs/JOBS_TO_BE_DONE.md.
49
+ NOTE: This project has no docs/jtbd/ directory or docs/JOBS_TO_BE_DONE.md.
29
50
  Edits to project files will be blocked until a JTBD document exists.
30
51
  Run /wr-jtbd:update-guide to generate one.
31
52
  HOOK_OUTPUT
@@ -1,7 +1,7 @@
1
1
  #!/bin/bash
2
2
  # JTBD - PostToolUse hook for Agent tool
3
3
  # Creates session markers when jtbd-lead has been consulted with PASS verdict.
4
- # Handles both edit review and plan review verdicts.
4
+ # Supports both docs/jtbd/ directory (preferred) and docs/JOBS_TO_BE_DONE.md (legacy).
5
5
 
6
6
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7
7
  source "$SCRIPT_DIR/lib/review-gate.sh"
@@ -15,6 +15,12 @@ if [ -z "$SESSION_ID" ]; then
15
15
  exit 0
16
16
  fi
17
17
 
18
+ # Determine JTBD path — prefer directory, fall back to single file
19
+ JTBD_PATH="docs/JOBS_TO_BE_DONE.md"
20
+ if [ -d "docs/jtbd" ]; then
21
+ JTBD_PATH="docs/jtbd"
22
+ fi
23
+
18
24
  case "$SUBAGENT" in
19
25
  *jtbd-lead*|*wr-jtbd*)
20
26
  # Check for edit review verdict
@@ -28,7 +34,7 @@ case "$SUBAGENT" in
28
34
  case "$VERDICT" in
29
35
  PASS)
30
36
  touch "/tmp/jtbd-reviewed-${SESSION_ID}"
31
- store_review_hash "$SESSION_ID" "jtbd" "docs/JOBS_TO_BE_DONE.md"
37
+ store_review_hash "$SESSION_ID" "jtbd" "$JTBD_PATH"
32
38
  ;;
33
39
  FAIL)
34
40
  # Do NOT create marker — review found issues
@@ -36,13 +42,11 @@ case "$SUBAGENT" in
36
42
  *)
37
43
  # No verdict file — backward compat, allow with marker
38
44
  touch "/tmp/jtbd-reviewed-${SESSION_ID}"
39
- store_review_hash "$SESSION_ID" "jtbd" "docs/JOBS_TO_BE_DONE.md"
45
+ store_review_hash "$SESSION_ID" "jtbd" "$JTBD_PATH"
40
46
  ;;
41
47
  esac
42
48
 
43
49
  # Plan review: agent completion = reviewed.
44
- # The main agent must actually run the review agent to reach this hook.
45
- # No verdict file needed — PostToolUse:Agent is the unforgeable signal.
46
50
  touch "/tmp/jtbd-plan-reviewed-${SESSION_ID}"
47
51
  ;;
48
52
  esac
@@ -1,19 +1,36 @@
1
1
  #!/usr/bin/env bats
2
2
 
3
3
  # Tests for jtbd-enforce-edit.sh — verifies broadened scope with exclusions
4
+ # Mix of grep-based pattern tests and functional execution tests.
4
5
 
5
6
  setup() {
6
7
  SCRIPT_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
7
8
  HOOK="$SCRIPT_DIR/jtbd-enforce-edit.sh"
9
+ ORIG_DIR="$PWD"
10
+ TEST_DIR=$(mktemp -d)
11
+ cd "$TEST_DIR"
8
12
  }
9
13
 
10
- # Helper: check if a file extension is in the exclusion list by grepping the hook
14
+ teardown() {
15
+ cd "$ORIG_DIR"
16
+ rm -rf "$TEST_DIR"
17
+ }
18
+
19
+ # Helper: check if a pattern is in the exclusion list by grepping the hook
11
20
  file_is_excluded() {
12
21
  local pattern="$1"
13
- # The hook should have a case statement that exits 0 for excluded files
14
22
  grep -q "$pattern" "$HOOK"
15
23
  }
16
24
 
25
+ # Helper: run the hook with a mock JSON input for a given file path
26
+ run_hook_with_file() {
27
+ local file_path="$1"
28
+ local json="{\"tool_input\":{\"file_path\":\"${file_path}\"},\"session_id\":\"test-session-$$\"}"
29
+ echo "$json" | bash "$HOOK"
30
+ }
31
+
32
+ # --- Pattern-based exclusion tests (grep) ---
33
+
17
34
  @test "enforce: excludes CSS files" {
18
35
  file_is_excluded '\.css'
19
36
  }
@@ -50,17 +67,48 @@ file_is_excluded() {
50
67
  file_is_excluded 'RISK-POLICY.md'
51
68
  }
52
69
 
53
- @test "enforce: excludes JOBS_TO_BE_DONE.md (P002 chicken-and-egg fix)" {
54
- # Must have a case pattern that exempts the policy file itself
55
- grep -q 'JOBS_TO_BE_DONE.md)' "$HOOK"
70
+ @test "enforce: does NOT have UI-only case guard" {
71
+ ! grep -q '\*) exit 0 ;;' "$HOOK"
56
72
  }
57
73
 
58
- @test "enforce: excludes PRODUCT_DISCOVERY.md" {
59
- file_is_excluded 'PRODUCT_DISCOVERY.md'
74
+ # --- Functional tests (execute hook with mock JSON) ---
75
+
76
+ @test "functional: exempts docs/jtbd/ files" {
77
+ run run_hook_with_file "docs/jtbd/solo-developer/persona.md"
78
+ [ "$status" -eq 0 ]
79
+ [[ "$output" != *"BLOCKED"* ]]
60
80
  }
61
81
 
62
- @test "enforce: does NOT have UI-only case guard" {
63
- # The old guard matched only UI extensions then exited for everything else.
64
- # The new hook should NOT exit 0 for all non-UI files.
65
- ! grep -q '\*) exit 0 ;;' "$HOOK"
82
+ @test "functional: exempts docs/jtbd/ job files" {
83
+ run run_hook_with_file "docs/jtbd/solo-developer/JTBD-001-governance.proposed.md"
84
+ [ "$status" -eq 0 ]
85
+ [[ "$output" != *"BLOCKED"* ]]
86
+ }
87
+
88
+ @test "functional: exempts docs/jtbd/README.md" {
89
+ run run_hook_with_file "docs/jtbd/README.md"
90
+ [ "$status" -eq 0 ]
91
+ [[ "$output" != *"BLOCKED"* ]]
92
+ }
93
+
94
+ @test "functional: exempts docs/JOBS_TO_BE_DONE.md (backward compat)" {
95
+ run run_hook_with_file "docs/JOBS_TO_BE_DONE.md"
96
+ [ "$status" -eq 0 ]
97
+ [[ "$output" != *"BLOCKED"* ]]
98
+ }
99
+
100
+ @test "functional: blocks src/index.ts when no JTBD docs exist" {
101
+ run run_hook_with_file "src/index.ts"
102
+ [ "$status" -eq 0 ]
103
+ [[ "$output" == *"BLOCKED"* ]]
104
+ [[ "$output" == *"wr-jtbd:update-guide"* ]]
105
+ }
106
+
107
+ @test "functional: blocks src/index.ts when docs/jtbd exists (needs review)" {
108
+ mkdir -p docs/jtbd
109
+ echo "# Index" > docs/jtbd/README.md
110
+ run run_hook_with_file "src/index.ts"
111
+ [ "$status" -eq 0 ]
112
+ [[ "$output" == *"BLOCKED"* ]]
113
+ [[ "$output" == *"wr-jtbd:agent"* ]]
66
114
  }
@@ -38,9 +38,25 @@ teardown() {
38
38
  [[ "$output" == *"MANDATORY JTBD CHECK"* ]]
39
39
  }
40
40
 
41
+ @test "eval: injects enforcement when docs/jtbd/README.md exists" {
42
+ mkdir -p docs/jtbd
43
+ echo "# Index" > docs/jtbd/README.md
44
+ run bash "$HOOK"
45
+ [ "$status" -eq 0 ]
46
+ [[ "$output" == *"MANDATORY JTBD CHECK"* ]]
47
+ }
48
+
49
+ @test "eval: prefers docs/jtbd/ over docs/JOBS_TO_BE_DONE.md when both exist" {
50
+ mkdir -p docs/jtbd
51
+ echo "# Index" > docs/jtbd/README.md
52
+ echo "# Jobs" > docs/JOBS_TO_BE_DONE.md
53
+ run bash "$HOOK"
54
+ [ "$status" -eq 0 ]
55
+ [[ "$output" == *"docs/jtbd"* ]]
56
+ }
57
+
41
58
  @test "eval: does not reference UI-only scoping in output" {
42
59
  run bash "$HOOK"
43
60
  [ "$status" -eq 0 ]
44
- # Should not contain the old UI-only messaging
45
61
  [[ "$output" != *"UI files"* ]]
46
62
  }
@@ -1,20 +1,19 @@
1
1
  #!/usr/bin/env bats
2
2
 
3
- # Tests for JTBD mark-reviewed hook — verifies hash path matches enforce hook
3
+ # Tests for JTBD mark-reviewed hook — verifies hash path supports both formats
4
4
 
5
- @test "mark-reviewed uses docs/JOBS_TO_BE_DONE.md path" {
5
+ @test "mark-reviewed supports docs/jtbd directory path" {
6
6
  SCRIPT_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
7
- grep -q 'docs/JOBS_TO_BE_DONE.md' "$SCRIPT_DIR/jtbd-mark-reviewed.sh"
7
+ grep -q '"docs/jtbd"' "$SCRIPT_DIR/jtbd-mark-reviewed.sh"
8
8
  }
9
9
 
10
- @test "mark-reviewed does NOT use docs/jtbd path" {
10
+ @test "mark-reviewed supports docs/JOBS_TO_BE_DONE.md fallback" {
11
11
  SCRIPT_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
12
- ! grep -q '"docs/jtbd"' "$SCRIPT_DIR/jtbd-mark-reviewed.sh"
12
+ grep -q 'docs/JOBS_TO_BE_DONE.md' "$SCRIPT_DIR/jtbd-mark-reviewed.sh"
13
13
  }
14
14
 
15
- @test "enforce-edit and mark-reviewed use same policy path" {
15
+ @test "enforce-edit and mark-reviewed both support docs/jtbd" {
16
16
  SCRIPT_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
17
- ENFORCE_PATH=$(grep -o 'docs/JOBS_TO_BE_DONE.md' "$SCRIPT_DIR/jtbd-enforce-edit.sh" | head -1)
18
- MARK_PATH=$(grep -o 'docs/JOBS_TO_BE_DONE.md' "$SCRIPT_DIR/jtbd-mark-reviewed.sh" | head -1)
19
- [ "$ENFORCE_PATH" = "$MARK_PATH" ]
17
+ grep -q '"docs/jtbd"' "$SCRIPT_DIR/jtbd-enforce-edit.sh"
18
+ grep -q '"docs/jtbd"' "$SCRIPT_DIR/jtbd-mark-reviewed.sh"
20
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/jtbd",
3
- "version": "0.2.1",
3
+ "version": "0.3.0-preview.38",
4
4
  "description": "Jobs-to-be-done enforcement for UI changes",
5
5
  "bin": {
6
6
  "windyroad-jtbd": "./bin/install.mjs"
@@ -1,21 +1,24 @@
1
1
  ---
2
2
  name: wr-jtbd:update-guide
3
- description: Create or update the project's docs/JOBS_TO_BE_DONE.md by examining existing features and asking the user about user jobs, personas, and desired outcomes.
3
+ description: Create or update the project's docs/jtbd/ directory with per-persona directories and individual job files. Migrates from docs/JOBS_TO_BE_DONE.md if present.
4
4
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
5
5
  ---
6
6
 
7
7
  # Jobs To Be Done Document Generator
8
8
 
9
- Create or update `docs/JOBS_TO_BE_DONE.md` tailored to this project's users and their goals. The jtbd-lead agent reads this file to review UI changes against user jobs.
9
+ Create or update `docs/jtbd/` with per-persona directories and individual job files.
10
+ The wr-jtbd:agent reads these files to review changes against user jobs.
10
11
 
11
- ## What belongs in docs/JOBS_TO_BE_DONE.md
12
+ ## Directory Structure
12
13
 
13
- - **User personas**: Who uses this product and what characterises them
14
- - **Jobs**: What users are trying to accomplish (functional, emotional, social)
15
- - **Job stories**: "When [situation], I want to [motivation], so I can [expected outcome]"
16
- - **Desired outcomes**: Measurable results users want from each job
17
- - **Current solutions**: How users currently accomplish these jobs (competitors, workarounds)
18
- - **Last reviewed date**: When the document was last reviewed or updated
14
+ ```
15
+ docs/jtbd/
16
+ README.md # Index tables of personas and jobs by status
17
+ <persona-name>/
18
+ persona.md # Persona definition
19
+ JTBD-NNN-<kebab-title>.proposed.md # Proposed job
20
+ JTBD-NNN-<kebab-title>.validated.md # Validated job
21
+ ```
19
22
 
20
23
  ## Steps
21
24
 
@@ -36,61 +39,138 @@ Examine the project to understand what it does and who uses it.
36
39
  - Look for onboarding flows, dashboards, settings, or admin areas
37
40
  - Check for different user roles (admin, member, viewer, etc.)
38
41
 
39
- **Discover existing JTBD artefacts**:
40
- - User stories in issues or project boards
41
- - Persona documents
42
- - User research notes or interview transcripts
43
- - Analytics configuration (what events are tracked?)
42
+ ### 2. Check for existing JTBD artefacts
44
43
 
45
- ### 2. Check for existing document
44
+ Check in order of preference:
46
45
 
47
- If `docs/JOBS_TO_BE_DONE.md` already exists, read it. Identify:
48
- - Whether jobs still match the current feature set
49
- - Whether personas still reflect the actual user base
50
- - Whether the last reviewed date is stale (> 2 weeks)
46
+ 1. `docs/jtbd/README.md` — directory structure already exists. Read and update.
47
+ 2. `docs/JOBS_TO_BE_DONE.md` legacy single file. Offer to migrate to directory structure.
48
+ 3. Neither fresh creation.
51
49
 
52
- ### 3. Draft the JTBD document
50
+ If migrating from `docs/JOBS_TO_BE_DONE.md`, extract existing personas and jobs and
51
+ convert them into the directory structure. Ask the user before proceeding.
53
52
 
54
- Based on project discovery, draft sections covering:
53
+ ### 3. Draft personas
55
54
 
56
- **Personas** (2-4):
57
- For each persona, describe: who they are, what characterises them, what they care about, and what frustrates them. Ground these in the actual product, not generic archetypes.
55
+ For each persona (2-4), create a file at `docs/jtbd/<persona-name>/persona.md`:
58
56
 
59
- **Jobs** (3-8):
60
- For each job:
61
- - A job statement: "Help [persona] [accomplish goal] when [situation]"
62
- - Whether it's functional, emotional, or social
63
- - Priority (must-have, important, nice-to-have)
57
+ ```markdown
58
+ ---
59
+ name: <persona-name>
60
+ description: <one-line description>
61
+ ---
62
+
63
+ # <Persona Display Name>
64
+
65
+ ## Who
66
+ <who this persona is>
67
+
68
+ ## Context Constraints
69
+ <bullet list of constraints relevant to using this product>
70
+
71
+ ## Pain Points
72
+ <bullet list of frustrations this product addresses>
73
+ ```
74
+
75
+ Use kebab-case for the directory name (e.g., `solo-developer`, `tech-lead`).
76
+
77
+ ### 4. Confirm personas with the user
78
+
79
+ Use AskUserQuestion to present the drafted personas and ask:
80
+ - Are these the right personas?
81
+ - Any missing user segments?
82
+ - Any constraints or pain points to add?
83
+
84
+ ### 5. Draft jobs
85
+
86
+ For each job (3-8 per persona), create a file at
87
+ `docs/jtbd/<persona-name>/JTBD-NNN-<kebab-title>.proposed.md`:
88
+
89
+ ```markdown
90
+ ---
91
+ status: proposed
92
+ job-id: <kebab-case-id>
93
+ persona: <persona-name>
94
+ date-created: YYYY-MM-DD
95
+ screens:
96
+ - <route or screen path, if applicable>
97
+ ---
98
+
99
+ # JTBD-NNN: <Title>
100
+
101
+ ## Job Statement
102
+ When [situation], I want to [motivation], so I can [expected outcome].
103
+
104
+ ## Desired Outcomes
105
+ <bullet list of measurable outcomes>
106
+
107
+ ## Persona Constraints
108
+ <relevant constraints from persona definition>
109
+
110
+ ## Current Solutions
111
+ <how users currently accomplish this without the product>
112
+ ```
113
+
114
+ **ID ranges** — assign non-overlapping ranges per persona:
115
+ - First persona: 001-099
116
+ - Second persona: 100-199
117
+ - Third persona: 200-299
118
+
119
+ **Status** — new jobs start as `proposed`. They become `validated` when confirmed
120
+ by user research or production use. To validate: rename the file from
121
+ `.proposed.md` to `.validated.md` and update the status field.
122
+
123
+ ### 6. Confirm jobs with the user
124
+
125
+ Use AskUserQuestion to present the drafted jobs and ask:
126
+ - Do these jobs cover the core value proposition?
127
+ - Do the job statements ring true?
128
+ - Any missing jobs or user flows?
129
+
130
+ ### 7. Generate README.md index
131
+
132
+ Write `docs/jtbd/README.md` with tables grouping jobs by persona and status:
133
+
134
+ ```markdown
135
+ # Jobs To Be Done (JTBD) Index
136
+
137
+ ## <Persona Name>
138
+
139
+ <one-line description>
140
+
141
+ [Persona definition](<persona-name>/persona.md)
142
+
143
+ ### Validated
64
144
 
65
- **Job Stories** (1-2 per job):
66
- "When [situation], I want to [motivation], so I can [expected outcome]"
145
+ | ID | Job | File |
146
+ |----|-----|------|
147
+ | JTBD-NNN | <title> | [JTBD-NNN-<title>.validated.md](<path>) |
67
148
 
68
- **Desired Outcomes** (per job):
69
- What does success look like? How would the user measure it?
149
+ ### Proposed
70
150
 
71
- **Current Solutions**:
72
- How do users currently accomplish these jobs without (or with competitors to) this product?
151
+ | ID | Job | File |
152
+ |----|-----|------|
153
+ | JTBD-NNN | <title> | [JTBD-NNN-<title>.proposed.md](<path>) |
154
+ ```
73
155
 
74
- ### 4. Confirm with the user
156
+ ### 8. Handle legacy file
75
157
 
76
- You MUST use the AskUserQuestion tool to collect user confirmation.
158
+ If `docs/JOBS_TO_BE_DONE.md` exists, replace its content with a pointer:
77
159
 
78
- Present:
79
- 1. The drafted personas and ask if they're accurate
80
- 2. The jobs identified and ask if they cover the core value proposition
81
- 3. The job stories and ask if the situations and motivations ring true
82
- 4. Whether any user segments or jobs are missing
160
+ ```markdown
161
+ # Jobs To Be Done
83
162
 
84
- ### 5. Write docs/JOBS_TO_BE_DONE.md
163
+ Job definitions have been migrated to individual files in `docs/jtbd/`.
164
+ Each persona has its own directory with a persona definition and individual
165
+ job files. See `docs/jtbd/README.md` for the full index.
166
+ ```
85
167
 
86
- Write the document including:
87
- - A header with "Last reviewed" date (today's date)
88
- - All sections from step 3, refined based on user feedback from step 4
89
- - A note that the wr-jtbd:agent reads this file to review UI changes against user jobs
168
+ ### 9. Summary
90
169
 
91
- If updating rather than creating:
92
- - Preserve existing content the user hasn't asked to change
93
- - Show the user a diff of what changed
94
- - Update the "Last reviewed" date
170
+ Report what was created:
171
+ - Number of personas and their names
172
+ - Number of jobs and their IDs
173
+ - Files created/updated
174
+ - Whether migration from legacy file was performed
95
175
 
96
176
  $ARGUMENTS