product-playbook 1.2.7 → 1.2.9

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 (86) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/SKILL.md +68 -10
  3. package/agents/strategy-critic.md +61 -2
  4. package/commands/product-feature.md +1 -1
  5. package/hooks/hooks.json +5 -0
  6. package/hooks/user-prompt-detect-specialist-dispatch.py +141 -0
  7. package/i18n/es/SKILL.md +1 -1
  8. package/i18n/ja/SKILL.md +1 -1
  9. package/i18n/ko/SKILL.md +1 -1
  10. package/i18n/zh-CN/SKILL.md +1 -1
  11. package/i18n/zh-TW/SKILL.md +1 -1
  12. package/install.sh +20 -24
  13. package/package.json +2 -1
  14. package/references/00-opportunity-check.md +29 -29
  15. package/references/01-strategy.md +56 -56
  16. package/references/02a-persona.md +37 -37
  17. package/references/02b-jtbd.md +110 -104
  18. package/references/02c-ost-journey.md +38 -38
  19. package/references/03-define.md +73 -73
  20. package/references/04a-prfaq.md +111 -69
  21. package/references/04b-solutions.md +134 -134
  22. package/references/04c-mvp.md +10 -10
  23. package/references/05a-northstar-aha.md +64 -64
  24. package/references/05b-pmf-gtm.md +70 -70
  25. package/references/05c-validation-spec.md +69 -69
  26. package/references/06-html-report.md +96 -91
  27. package/references/07a-handoff-core.md +93 -93
  28. package/references/07b-tasks-tickets.md +149 -149
  29. package/references/07c-architecture-setup.md +98 -98
  30. package/references/08-security-checklist.md +138 -138
  31. package/references/rules-build.md +84 -84
  32. package/references/rules-change-propagation.md +48 -48
  33. package/references/rules-commands.md +89 -89
  34. package/references/rules-context.md +6 -0
  35. package/references/rules-end-of-flow.md +112 -112
  36. package/references/rules-product-type.md +12 -12
  37. package/references/rules-progress.md +39 -39
  38. package/references/rules-quality-review.md +22 -5
  39. package/references/rules-quick.md +13 -13
  40. package/references/rules-revision.md +26 -0
  41. package/references/rules-subagent-dispatch.md +6 -1
  42. package/i18n/en/SKILL.md +0 -195
  43. package/i18n/en/commands/product-build.md +0 -13
  44. package/i18n/en/commands/product-dev.md +0 -24
  45. package/i18n/en/commands/product-feature.md +0 -15
  46. package/i18n/en/commands/product-full.md +0 -13
  47. package/i18n/en/commands/product-prd.md +0 -14
  48. package/i18n/en/commands/product-quick.md +0 -13
  49. package/i18n/en/commands/product-report.md +0 -12
  50. package/i18n/en/commands/product-revision.md +0 -13
  51. package/i18n/en/references/00-opportunity-check.md +0 -44
  52. package/i18n/en/references/01-strategy.md +0 -90
  53. package/i18n/en/references/02a-persona.md +0 -57
  54. package/i18n/en/references/02b-jtbd.md +0 -137
  55. package/i18n/en/references/02c-ost-journey.md +0 -65
  56. package/i18n/en/references/03-define.md +0 -118
  57. package/i18n/en/references/04a-prfaq.md +0 -112
  58. package/i18n/en/references/04b-solutions.md +0 -269
  59. package/i18n/en/references/04c-mvp.md +0 -21
  60. package/i18n/en/references/05a-northstar-aha.md +0 -93
  61. package/i18n/en/references/05b-pmf-gtm.md +0 -102
  62. package/i18n/en/references/05c-validation-spec.md +0 -117
  63. package/i18n/en/references/06-html-report.md +0 -128
  64. package/i18n/en/references/07a-handoff-core.md +0 -152
  65. package/i18n/en/references/07b-tasks-tickets.md +0 -215
  66. package/i18n/en/references/07c-architecture-setup.md +0 -199
  67. package/i18n/en/references/08-security-checklist.md +0 -221
  68. package/i18n/en/references/rules-build.md +0 -152
  69. package/i18n/en/references/rules-change-propagation.md +0 -74
  70. package/i18n/en/references/rules-commands.md +0 -98
  71. package/i18n/en/references/rules-context-template.md +0 -177
  72. package/i18n/en/references/rules-context.md +0 -123
  73. package/i18n/en/references/rules-custom.md +0 -77
  74. package/i18n/en/references/rules-document-tools.md +0 -126
  75. package/i18n/en/references/rules-end-of-flow.md +0 -150
  76. package/i18n/en/references/rules-export-document.md +0 -346
  77. package/i18n/en/references/rules-file-integration.md +0 -65
  78. package/i18n/en/references/rules-full.md +0 -102
  79. package/i18n/en/references/rules-import-document.md +0 -261
  80. package/i18n/en/references/rules-optional-trigger.md +0 -118
  81. package/i18n/en/references/rules-product-type.md +0 -14
  82. package/i18n/en/references/rules-progress.md +0 -60
  83. package/i18n/en/references/rules-quality-review.md +0 -48
  84. package/i18n/en/references/rules-quick.md +0 -29
  85. package/i18n/en/references/rules-revision.md +0 -95
  86. package/i18n/en/references/rules-subagent-dispatch.md +0 -61
@@ -7,7 +7,7 @@
7
7
  {
8
8
  "name": "product-playbook",
9
9
  "description": "MUST use when user wants to plan or strategize a product/feature. 22 PM frameworks, 6 modes, multi-language, from idea to dev handoff",
10
- "version": "1.2.5",
10
+ "version": "1.2.9",
11
11
  "source": "./."
12
12
  }
13
13
  ]
package/SKILL.md CHANGED
@@ -40,9 +40,26 @@ Also switch if the user explicitly requests a language (e.g., "用中文進行")
40
40
 
41
41
  Use **progressive confirmation** — avoid dumping all options. If the user already specified, apply directly.
42
42
 
43
- **Step 1 — Confirm mode** (always ask unless already specified):
43
+ **Step 1 — Confirm mode**
44
44
 
45
- > Select a mode (number or name), or just describe your product and I'll recommend:
45
+ **Step 1a Quick triggers (check FIRST; auto-apply matching mode without showing the menu):**
46
+
47
+ Scan the user's first message for these phrases or close paraphrases. If ANY match, skip the menu entirely and enter the matched mode at S1 immediately.
48
+
49
+ | Trigger phrase (or close paraphrase) | Auto-apply mode |
50
+ |---|---|
51
+ | "validate idea quickly", "30 min direction", "quick check" | 🚀 Quick |
52
+ | "full product plan", "comprehensive planning", "do the full thing" | 📦 Full |
53
+ | "I already know what to build", "skip discovery", "straight to MVP" | ⚡ Build |
54
+ | "revamp my product", "optimize existing", "redesign our app" | 🔄 Revision |
55
+ | **"add a feature", "feature for existing product", "plan this feature", "build [X] feature for our app"** | 🔧 Feature Extension |
56
+ | "pre-mortem", "what could go wrong", "find failure modes" | route to `pre-mortem-runner` per Specialist Dispatch Protocol |
57
+
58
+ When a Quick trigger fires, your reply opens with: *"Detected '[trigger phrase]' — entering [Mode] at S1."* Do NOT present the 6-mode menu. Proceed to Step 2 product-type confirmation (or directly to the mode's S1 if product type is already implied).
59
+
60
+ **Step 1b — Menu (only if NO quick trigger matched):**
61
+
62
+ > Select a mode (number or name) — pick the one that matches your situation. If you're unsure, briefly describe your product and I'll narrow to **two candidates** for you to choose between (never one).
46
63
  > 1. 🚀 **Quick Mode** — 3 steps, ~30 min (JTBD → PR-FAQ → North Star)
47
64
  > 2. 📦 **Full Mode** — 9–11 steps, comprehensive planning document
48
65
  > 3. 🔄 **Revision Mode** — 6–8 steps, optimize existing product
@@ -50,12 +67,7 @@ Use **progressive confirmation** — avoid dumping all options. If the user alre
50
67
  > 5. ⚡ **Build Mode** — 7 steps, skip Discovery, go straight to solution
51
68
  > 6. 🔧 **Feature Extension Mode** — 4 steps, add a feature to existing product
52
69
 
53
- Quick triggers (auto-apply matching mode):
54
- - "validate idea quickly" / "30 min direction" → Quick
55
- - "full product plan" → Full
56
- - "I already know what to build" → Build
57
- - "revamp my product" / "optimize" → Revision
58
- - "add a feature" / "feature for existing product" → Feature Extension
70
+ **Neutrality rule (applies to Step 1b only):** when no Quick trigger matched and you DO show the menu, present all 6 modes. You may add a short note like *"based on what you described, options 1 and 2 might fit best"* — but you must **NOT** close the menu by recommending exactly one mode ("I'd recommend Quick Mode"). Mode choice is the user's, not yours.
59
71
 
60
72
  **Step 2 — Confirm product type and audience** (after mode confirmed):
61
73
 
@@ -95,7 +107,7 @@ After confirming the mode, read the corresponding mode rules file for step seque
95
107
  | Product type confirmed | `rules-product-type.md` (B2B/B2C adjustments) |
96
108
  | Mode has Optional steps | `rules-optional-trigger.md` (triggers + Persona-Journey bundle + Phase Decision Point) |
97
109
  | Product context read/write | `rules-context.md` |
98
- | About to dispatch to a specialist sub-agent (discovery / strategy-critic / pre-mortem-runner) — load on first dispatch consideration in any mode | `rules-subagent-dispatch.md` |
110
+ | About to dispatch to a specialist sub-agent (discovery / strategy-critic / pre-mortem-runner) — load on first dispatch consideration in any mode, OR immediately when the user pastes a strategy / persona / JTBD-shaped artifact and asks for critique/review (even outside the canonical step) | `rules-subagent-dispatch.md` |
99
111
  | User asks for framework list / supplementary commands | `rules-commands.md` |
100
112
  | User uploads file | `rules-file-integration.md` |
101
113
  | User says pause/save/continue | `rules-progress.md` |
@@ -154,7 +166,53 @@ Other rules:
154
166
  3. **No skipping steps** — follow the mode's step sequence; do not skip because "the user probably just wants the final result."
155
167
  4. **Dev handoff only after full completion** — "start development" / "generate dev handoff package" requires all steps marked ✅. Mid-process requests get: *"We're at S[X]/S[Y]. Recommend completing remaining steps. Continue, or proceed at current progress?"*
156
168
  5. **Progress indicator is single source of truth** — completion = all steps ✅ in the indicator; don't infer.
157
- 6. **Quality self-checks must surface issues** — after each step, run the inline checklist (in your mode rules file) or load `rules-quality-review.md`. The checklist must NOT have every item ✅; if all pass, proactively identify "the weakest aspect of this output" and explain how to strengthen.
169
+ 6. **Quality self-checks must surface issues** — after each step, you MUST load `references/rules-quality-review.md` and follow its protocol exactly. The "Format" block in that file is authoritative (✅/❌ markers only, no ⚠️/partial/blank substitutes, each ❌ includes downstream impact). Mode rule files do NOT contain a substitute inline checklist — `rules-quality-review.md` is the single source of truth. The checklist must NOT have every item ✅; if all pass, lower the bar and re-review until at least one surfaces on a substantive content gap.
170
+ 7. **Specialist sub-agents must be dispatched, not inline-simulated** — when the trigger conditions in the table below fire, you MUST invoke the specialist via the Task tool with the matching `subagent_type`. Inline-running the critique/discovery yourself fails the contract (specialists exist precisely because separated context = higher-quality output). See `## 🤝 Specialist Dispatch Protocol` below.
171
+
172
+ ---
173
+
174
+ ## 🤝 Specialist Dispatch Protocol (always check before responding)
175
+
176
+ Three specialist sub-agents live in isolated contexts: `strategy-critic`, `discovery-specialist`, `pre-mortem-runner`. Their value comes from focused context — running their job inline in the main agent dilutes it.
177
+
178
+ **Dispatch trigger table** (any row matches → dispatch immediately, even mid-mode, even outside the canonical step):
179
+
180
+ | Trigger | Specialist | Example user message |
181
+ |---|---|---|
182
+ | User pastes a strategy artifact ("our mission is…", "our strategy is…", Strategy Blocks, Rumelt kernel, DHM, Empowered Teams charter) AND asks for review/critique/feedback | `strategy-critic` | "Review this strategy: 'Our mission is to delight customers…'" |
183
+ | Persona / JTBD / OST / Journey Map / Continuous Discovery work | `discovery-specialist` | Full Mode S2-S6, Build Mode S2, any Custom step selecting discovery |
184
+ | User asks "what could go wrong" / pre-mortem / risk analysis | `pre-mortem-runner` | "Pre-mortem this MVP", or Full Mode S10 / Build Mode S4 |
185
+
186
+ ### Required response shape when a trigger fires
187
+
188
+ When any row matches, your reply MUST be structured as exactly these three parts, in order. No other shape is acceptable — no prose, no mode menu, no progress indicator, and no inline analysis before the Task call.
189
+
190
+ **Part 1 — first line of output, verbatim** (replace `{specialist}` with the matching specialist name):
191
+
192
+ > Dispatching to `{specialist}` subagent via Task tool with `subagent_type={specialist}`.
193
+
194
+ **Part 2 — immediately call the Task tool**:
195
+
196
+ ```
197
+ Task(
198
+ subagent_type="{specialist}",
199
+ description="<short 2-3 word summary>",
200
+ prompt="<paste the user's original prompt verbatim, then add a final line: 'Reply in [user's working language].'>"
201
+ )
202
+ ```
203
+
204
+ **Part 3 — after the specialist returns YAML**, integrate `three_questions_to_ask_the_writer` (strategy-critic) / `open_questions` (discovery) / `priority_three` + `pre_launch_experiments` (pre-mortem) **verbatim** into your reply. Do not soften, do not paraphrase, do not skip.
205
+
206
+ ### Anti-patterns (each is a contract failure)
207
+
208
+ - ❌ Producing a Persona / JTBD / critique / pre-mortem yourself before the Task call — even partially, even "to warm up."
209
+ - ❌ Writing prose, a mode menu, or a progress indicator before the dispatch marker.
210
+ - ❌ Skipping the Task call because you "already know the answer." The specialist's focused context produces materially higher-quality output than you can inline.
211
+ - ❌ Paraphrasing the dispatch marker. The first-line shape is verbatim.
212
+
213
+ **Genuine false-positive exception**: if the prompt has no real connection to a specialist's scope (e.g., the user mentions "JTBD" only to ask what the acronym means), state that in one short sentence and proceed without dispatching. When in doubt, dispatch — the sub-agent's `status: out_of_scope` reply cleanly bounces non-matching requests back to you.
214
+
215
+ Full per-trigger invocation templates: `references/rules-subagent-dispatch.md`. A `UserPromptSubmit` hook (`hooks/user-prompt-detect-specialist-dispatch.py`) also enforces this protocol at the harness layer — its reminder and this section are intentional duplicates so the rule is unmissable.
158
216
 
159
217
  ---
160
218
 
@@ -9,7 +9,7 @@ model: inherit
9
9
 
10
10
  You are a hostile-but-fair strategy reviewer trained in the lineage of Richard Rumelt (*Good Strategy / Bad Strategy*), Marty Cagan (empowered teams vs feature teams), Gibson Biddle (DHM), and Shreyas Doshi (strategy as the root of most "execution" problems).
11
11
 
12
- Your only job: **find what is wrong with a strategy artifact** so the team fixes it before they spend a quarter building against bad logic. Do not rewrite. Do not soften. Do not validate work that does not deserve validation.
12
+ Your only job: **find what is wrong with a strategy artifact** so the team fixes it before they spend a quarter building against bad logic. **You return questions, not rewrites.** Do not soften. Do not validate work that does not deserve validation.
13
13
 
14
14
  ## Scope
15
15
 
@@ -43,6 +43,65 @@ But hostile ≠ cruel:
43
43
 
44
44
  Never write "this is bad". Always write *why* it is bad, *which principle* is violated, *what question* fixes it.
45
45
 
46
+ ## Hard rule: critic, not author
47
+
48
+ The following output patterns are **forbidden anywhere in your YAML or surrounding text**. If your draft contains any of them, regenerate before returning:
49
+
50
+ - "Our [mission/vision/strategy] should be..."
51
+ - "A better [strategy/diagnosis/policy] would be..."
52
+ - "Here is a revised [strategy/diagnosis/policy]:"
53
+ - "Try something like: ..."
54
+ - "Consider rewriting as: ..."
55
+ - Offers to "help rebuild", "draft a new version", "rewrite this for you"
56
+ - Any rewritten artifact text — even partial, even as "example", even inside a `critique:` field
57
+
58
+ The only new text in your output is inside `strengthening_question` and `three_questions_to_ask_the_writer` fields, and those are **questions** (end with `?`), not statements that hint at the answer.
59
+
60
+ Why this is a hard rule: a critic who rewrites teaches the writer nothing. The writer must own the revision, or the next version will be just as bad.
61
+
62
+ ## Step 0: classify before you critique
63
+
64
+ Before applying any framework, classify **every line** of the artifact into one bucket:
65
+
66
+ | Bucket | Examples | What it is NOT |
67
+ |---|---|---|
68
+ | Value | "delight customers", "be customer-obsessed" | not a diagnosis, not a policy |
69
+ | Aspiration | "be the leader in X", "become #1 in Y" | not a guiding policy |
70
+ | Goal | "grow ARR 50%", "ship faster than competitors" | not a diagnosis |
71
+ | Tactic | "add more features", "redesign onboarding" | not a coherent action set |
72
+ | Market condition | "market is growing", "AI is disrupting" | not a diagnosis |
73
+ | **Diagnosis** | names *the* binding constraint + mechanism | — |
74
+ | **Guiding Policy** | creates leverage, names what's off-limits | — |
75
+ | **Coherent Action** | actions reinforcing the policy | — |
76
+
77
+ **If the artifact contains ONLY items in the top 5 rows with NO diagnosis or guiding policy, your `overall_verdict` MUST be `not_yet_a_strategy` and `rumelt_kernel.diagnosis.score` MUST be `missing`.** State explicitly in the critique: "this names a goal/aspiration but no central challenge."
78
+
79
+ Literal high-frequency patterns — if you see these verbatim, flag immediately:
80
+ - "Our mission is to delight customers" → value (not a diagnosis)
81
+ - "Be/become the leader in [X]" → aspiration (Rumelt: aspiration ≠ guiding policy)
82
+ - "Add more features faster than competitors" → tactic, not coherent action
83
+
84
+ Worked example (the canonical bad-strategy shape):
85
+
86
+ ```yaml
87
+ overall_verdict: not_yet_a_strategy
88
+ rumelt_kernel:
89
+ diagnosis:
90
+ score: missing
91
+ quoted_text: "(none present)"
92
+ critique: |
93
+ The artifact names no central challenge. "Delight customers" is a
94
+ value; "leader in calendar tools" is an aspiration; "more features
95
+ faster" is a tactic list. Rumelt: a diagnosis must identify *the*
96
+ binding constraint and explain *why* it binds. Without one, there
97
+ is nothing for guiding policy to be derived from.
98
+ strengthening_question: "What single obstacle, if removed, would
99
+ unlock everything else? Name it in one sentence — without it, there
100
+ is no strategy to critique."
101
+ ```
102
+
103
+ ---
104
+
46
105
  ## Critique frameworks
47
106
 
48
107
  ### Rumelt's Kernel (always score, even if artifact doesn't name it)
@@ -160,7 +219,7 @@ All narrative content (critiques, questions, summaries) in orchestrator's langua
160
219
 
161
220
  1. Avoided generic feedback? Every critique points at a specific quoted sentence?
162
221
  2. Cited which principle is violated, not just "this is unclear"?
163
- 3. Produced strengthening questions, not rewrites?
222
+ 3. Produced strengthening questions, not rewrites? Re-scan output for forbidden patterns ("should be" / "would be" / "revised" / "rebuild" / "try something like"). Every newly-added sentence either critiques the existing artifact or asks the writer a question — never proposes replacement text.
164
223
  4. Scored Rumelt's kernel even when artifact didn't explicitly use it?
165
224
  5. Found at least one blind spot? Zero blind spots is suspicious — look harder.
166
225
  6. `overall_verdict` honest? If everything critiqued but verdict is "strong", recalibrate.
@@ -12,4 +12,4 @@ Feature description: $ARGUMENTS
12
12
 
13
13
  Follow the Feature Extension step sequence (S1 → S4). Load product context first per rules-context.md. Display a progress indicator at each step.
14
14
 
15
- **S0 → S1 sequencing (important)**: If Context Bootstrap (S0) is triggered because `.product-context.md` is missing, you MUST complete Bootstrap and S1 in the **same turn**, then pause **after S1 completion** awaiting user confirmation before S2. Do NOT pause between S0 and S1 — even if some Bootstrap fields are still missing, write a baseline `.product-context.md` with placeholders, enter S1, and ask for the missing fields as part of the S1 confirmation question. See `references/rules-context.md` "Bootstrap S1 的順序" for details.
15
+ **S0 → S1 sequencing (important)**: If Context Bootstrap (S0) is triggered because `.product-context.md` is missing, you MUST complete Bootstrap and S1 in the **same turn**, then pause **after S1 completion** awaiting user confirmation before S2. Do NOT pause between S0 and S1 — even if some Bootstrap fields are still missing, write a baseline `.product-context.md` with placeholders, enter S1, and ask for the missing fields as part of the S1 confirmation question. See `references/rules-context.md` "Bootstrap S1 Sequencing" for details.
package/hooks/hooks.json CHANGED
@@ -20,6 +20,11 @@
20
20
  "type": "command",
21
21
  "command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/user-prompt-detect-topic-switch.py",
22
22
  "timeout": 5
23
+ },
24
+ {
25
+ "type": "command",
26
+ "command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/user-prompt-detect-specialist-dispatch.py",
27
+ "timeout": 5
23
28
  }
24
29
  ]
25
30
  }
@@ -0,0 +1,141 @@
1
+ #!/usr/bin/env python3
2
+ """UserPromptSubmit hook: enforce specialist sub-agent dispatch.
3
+
4
+ The product-playbook skill has three specialist sub-agents
5
+ (discovery-specialist, strategy-critic, pre-mortem-runner). When a
6
+ user message clearly matches one specialist's scope — e.g. pastes a
7
+ strategy and asks for review, or asks for Persona/JTBD analysis — the
8
+ main agent SHOULD dispatch via the Task tool with the matching
9
+ `subagent_type`. In single-shot `claude -p` mode, the main agent
10
+ strongly tends to inline-handle the request instead, because the
11
+ direct ask outranks the dispatch protocol prose in SKILL.md.
12
+
13
+ This hook closes that gap at the harness layer. On every user prompt,
14
+ it pattern-matches against trigger phrases for each specialist. If a
15
+ match fires, it emits a `systemMessage` reminding the agent that
16
+ dispatch is required (with the exact Task tool invocation shape).
17
+ The hook never blocks the user prompt; it just makes the dispatch
18
+ protocol unmissable.
19
+
20
+ Pattern strictness — these are intentional false-positive-tolerant.
21
+ A spurious dispatch reminder costs the agent one re-read of SKILL.md's
22
+ dispatch table (cheap). A missed dispatch costs an inline-simulated
23
+ specialist response that the eval (and the user) will not trust
24
+ (expensive).
25
+ """
26
+
27
+ from __future__ import annotations
28
+
29
+ import json
30
+ import re
31
+ import sys
32
+
33
+
34
+ # Each entry: (specialist subagent_type, list of regex patterns).
35
+ # Patterns are case-insensitive. Match ANY pattern → fire that specialist.
36
+ SPECIALIST_TRIGGERS: list[tuple[str, list[str]]] = [
37
+ (
38
+ "strategy-critic",
39
+ [
40
+ # Direct ask to review/critique strategy-shaped artifact
41
+ r"\breview\s+(this|our|the|my)\s+strategy\b",
42
+ r"\bcritique\s+(this|our|the|my)\s+strategy\b",
43
+ r"\bhow\s+strong\s+is\s+(this|our|the|my)\s+strategy\b",
44
+ r"\btell\s+me\s+how\s+strong\s+this\s+strategy\s+is\b",
45
+ # User pastes a strategy artifact (mission/vision/strategy triplet)
46
+ r"\bour\s+mission\s+is\b.*\bour\s+(vision|strategy)\s+is\b",
47
+ r"\bour\s+strategy\s+is\b",
48
+ # Rumelt / DHM / Empowered Teams artifacts
49
+ r"\b(diagnosis|guiding\s+policy|coherent\s+action)\b.*\b(diagnosis|guiding\s+policy|coherent\s+action)\b",
50
+ r"\bdhm\s+(model|critique|analysis)\b",
51
+ r"\bempowered\s+team(s)?\s+charter\b",
52
+ ],
53
+ ),
54
+ (
55
+ "discovery-specialist",
56
+ [
57
+ # Direct ask for Persona/JTBD/OST/Journey/Continuous Discovery
58
+ r"\b(produce|generate|create|do|run)\s+(the\s+)?(persona|jtbd|journey\s+map|opportunity\s+solution\s+tree|ost)\b",
59
+ r"\b(persona\s+and\s+jtbd|jtbd\s+and\s+persona)\b",
60
+ r"\bjtbd\s+analysis\b",
61
+ r"\bpersona\s+analysis\b",
62
+ r"\b(continuous|ongoing)\s+discovery\b",
63
+ r"\bjobs[\s\-]+to[\s\-]+be[\s\-]+done\b",
64
+ ],
65
+ ),
66
+ (
67
+ "pre-mortem-runner",
68
+ [
69
+ r"\bpre[\s\-]?mortem\b",
70
+ r"\bwhat\s+could\s+go\s+wrong\b",
71
+ r"\brisk\s+analysis\s+(for|on|of)\b",
72
+ r"\bfailure\s+modes?\b",
73
+ ],
74
+ ),
75
+ ]
76
+
77
+
78
+ REMINDER_TEMPLATE = (
79
+ "[product-playbook] DISPATCH ENFORCEMENT — the user's prompt is in "
80
+ "the operating scope of the `{specialist}` sub-agent. You MUST "
81
+ "delegate via the Task tool. Inline-handling this request (answering "
82
+ "the user's question yourself) is the failure mode this hook exists "
83
+ "to prevent — the sub-agent's focused context produces materially "
84
+ "higher-quality output than you can inline.\n\n"
85
+ "Required response shape (in this order, no exceptions):\n\n"
86
+ "1. Your first line of output, verbatim:\n\n"
87
+ " > Dispatching to `{specialist}` subagent via Task tool with "
88
+ "`subagent_type={specialist}`.\n\n"
89
+ "2. Immediately after, call the Task tool:\n\n"
90
+ " Task(\n"
91
+ " subagent_type=\"{specialist}\",\n"
92
+ " description=\"<short 2-3 word summary>\",\n"
93
+ " prompt=\"<paste the user's original prompt verbatim, then add a "
94
+ "final line: 'Reply in [user's working language].'>\"\n"
95
+ " )\n\n"
96
+ "3. After the sub-agent returns YAML, integrate its output into your "
97
+ "reply to the user.\n\n"
98
+ "Do NOT do any of the following before the Task call:\n"
99
+ "- Produce a Persona / JTBD / strategy critique / pre-mortem yourself.\n"
100
+ "- Add prose, mode menus, progress indicators, or any explanation.\n"
101
+ "- Skip the Task call because you 'already know the answer.'\n\n"
102
+ "Only false-positive exception: if the prompt genuinely has no "
103
+ "connection to `{specialist}`'s scope, say so in one short sentence, "
104
+ "then proceed without dispatch. When in doubt, dispatch — the "
105
+ "sub-agent's `status: out_of_scope` reply cleanly bounces back."
106
+ )
107
+
108
+
109
+ def detect_specialists(prompt: str) -> list[str]:
110
+ """Return list of specialist names whose patterns match the prompt."""
111
+ matched: list[str] = []
112
+ for specialist, patterns in SPECIALIST_TRIGGERS:
113
+ for pattern in patterns:
114
+ if re.search(pattern, prompt, re.IGNORECASE):
115
+ matched.append(specialist)
116
+ break # one pattern is enough per specialist
117
+ return matched
118
+
119
+
120
+ def main() -> int:
121
+ try:
122
+ payload = json.load(sys.stdin)
123
+ except (json.JSONDecodeError, ValueError):
124
+ return 0
125
+
126
+ prompt = (payload.get("user_prompt") or "").strip()
127
+ if not prompt:
128
+ return 0
129
+
130
+ matched = detect_specialists(prompt)
131
+ if not matched:
132
+ return 0
133
+
134
+ messages = [REMINDER_TEMPLATE.format(specialist=s) for s in matched]
135
+ output = {"systemMessage": "\n\n---\n\n".join(messages)}
136
+ json.dump(output, sys.stdout)
137
+ return 0
138
+
139
+
140
+ if __name__ == "__main__":
141
+ sys.exit(main())
package/i18n/es/SKILL.md CHANGED
@@ -25,7 +25,7 @@ Eres un coach senior de product management que integra metodologías fundamental
25
25
 
26
26
  Detecta el idioma del primer mensaje del usuario y cambia silenciosamente:
27
27
 
28
- - English → `i18n/en/SKILL.md`
28
+ - English → `SKILL.md` (root)
29
29
  - 繁體中文 → `i18n/zh-TW/SKILL.md`
30
30
  - 日本語 → `i18n/ja/SKILL.md`
31
31
  - 简体中文 → `i18n/zh-CN/SKILL.md`
package/i18n/ja/SKILL.md CHANGED
@@ -26,7 +26,7 @@ description: |
26
26
  ユーザーの最初のメッセージの言語を検出し、サイレントに切り替え:
27
27
 
28
28
  - 繁體中文 → `i18n/zh-TW/SKILL.md`
29
- - English → `i18n/en/SKILL.md`
29
+ - English → `SKILL.md` (root)
30
30
  - 简体中文 → `i18n/zh-CN/SKILL.md`
31
31
  - Español → `i18n/es/SKILL.md`
32
32
  - 한국어 → `i18n/ko/SKILL.md`
package/i18n/ko/SKILL.md CHANGED
@@ -29,7 +29,7 @@ description: |
29
29
  - 日本語 → `i18n/ja/SKILL.md`
30
30
  - 简体中文 → `i18n/zh-CN/SKILL.md`
31
31
  - Español → `i18n/es/SKILL.md`
32
- - English → `i18n/en/SKILL.md`
32
+ - English → `SKILL.md` (root)
33
33
  - 한국어 → 본 파일 계속 사용
34
34
 
35
35
  사용자가 명시적으로 언어를 요청하는 경우(예: "please use English")에도 전환하세요. 확인을 요청하지 마세요. 전환에 대해 언급하지 마세요.
@@ -27,7 +27,7 @@ description: |
27
27
 
28
28
  - 繁體中文 → `i18n/zh-TW/SKILL.md`
29
29
  - 日本語 → `i18n/ja/SKILL.md`
30
- - English → `i18n/en/SKILL.md`
30
+ - English → `SKILL.md` (root)
31
31
  - Español → `i18n/es/SKILL.md`
32
32
  - 한국어 → `i18n/ko/SKILL.md`
33
33
  - 简体中文 → 继续使用本文件
@@ -25,7 +25,7 @@ description: |
25
25
 
26
26
  偵測使用者第一則訊息的語言,自動靜默切換:
27
27
 
28
- - **English** → `i18n/en/SKILL.md`
28
+ - **English** → `SKILL.md` (root)
29
29
  - **日本語** → `i18n/ja/SKILL.md`
30
30
  - **简体中文** → `i18n/zh-CN/SKILL.md`
31
31
  - **Español** → `i18n/es/SKILL.md`
package/install.sh CHANGED
@@ -279,39 +279,35 @@ do_install() {
279
279
  # SKILL.md default language is always English; runtime language detection
280
280
  # in SKILL.md handles switching to the user's language dynamically.
281
281
  # INSTALL_LANG is only used for CLI installer messages (msg() function).
282
- local en_lang_dir="$src_dir/i18n/en"
283
- local has_i18n=false
284
-
285
- if [ -d "$src_dir/i18n" ]; then
286
- has_i18n=true
287
- fi
288
282
 
289
283
  # Copy Skill files
290
284
  info "$(msg installing_skill)"
291
285
  cp "$src_dir/LICENSE" "$SKILL_DIR/"
292
286
 
293
- if [ "$has_i18n" = true ]; then
294
- # Install ALL languages
287
+ # Root is the canonical English source — copy unconditionally.
288
+ cp "$src_dir/SKILL.md" "$SKILL_DIR/"
289
+ [ -d "$src_dir/references" ] && cp -r "$src_dir/references" "$SKILL_DIR/"
290
+ [ -d "$src_dir/commands" ] && cp -r "$src_dir/commands" "$SKILL_DIR/"
291
+
292
+ # Other-language overrides live under i18n/<lang>/. Runtime SKILL.md
293
+ # language detection switches to i18n/<lang>/SKILL.md when needed.
294
+ if [ -d "$src_dir/i18n" ]; then
295
295
  cp -r "$src_dir/i18n" "$SKILL_DIR/"
296
- ok "Installed all 6 languages to $SKILL_DIR/i18n/"
297
-
298
- # Set default language: always use English as the entry point
299
- # Runtime language detection in SKILL.md will switch to i18n/{lang}/ as needed
300
- if [ -d "$en_lang_dir" ]; then
301
- cp "$en_lang_dir/SKILL.md" "$SKILL_DIR/"
302
- cp -r "$en_lang_dir/references" "$SKILL_DIR/"
303
- cp -r "$en_lang_dir/commands" "$SKILL_DIR/"
304
- fi
305
- else
306
- # Legacy fallback: no i18n directory
307
- cp "$src_dir/SKILL.md" "$SKILL_DIR/"
308
- [ -d "$src_dir/references" ] && cp -r "$src_dir/references" "$SKILL_DIR/"
309
- [ -d "$src_dir/commands" ] && cp -r "$src_dir/commands" "$SKILL_DIR/"
296
+ ok "Installed $(ls "$src_dir/i18n" | wc -l | tr -d ' ') additional language(s) under $SKILL_DIR/i18n/"
310
297
  fi
311
298
 
312
299
  # Sub-agents (language-agnostic — each agent's system prompt instructs it
313
- # to reply in the orchestrator's language, so there is no per-language copy)
314
- [ -d "$src_dir/agents" ] && cp -r "$src_dir/agents" "$SKILL_DIR/"
300
+ # to reply in the orchestrator's language, so there is no per-language copy).
301
+ # Install in two locations:
302
+ # 1. Inside the skill dir for bundling/inspection.
303
+ # 2. At ~/.claude/agents/ so Claude Code's Task tool can discover them
304
+ # as `subagent_type` values. Without (2), `claude -p` and many
305
+ # non-plugin install paths can't actually dispatch to specialists.
306
+ if [ -d "$src_dir/agents" ]; then
307
+ cp -r "$src_dir/agents" "$SKILL_DIR/"
308
+ mkdir -p "$HOME/.claude/agents"
309
+ cp "$src_dir/agents"/*.md "$HOME/.claude/agents/" 2>/dev/null || true
310
+ fi
315
311
 
316
312
  # Write version marker (semver from package.json for npm comparison)
317
313
  local pkg_version=""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "product-playbook",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "description": "MUST use when user wants to plan or strategize a product/feature. 22 PM frameworks, 6 modes, from idea to dev handoff",
5
5
  "bin": {
6
6
  "product-playbook": "./install.sh"
@@ -12,6 +12,7 @@
12
12
  "eval:zh-TW": "python3 evals/run_behavioral_eval.py --eval-file evals/evals-zh-TW.json --runs 3 --workers 2 --fail-on critical",
13
13
  "eval:quick": "python3 evals/run_behavioral_eval.py --runs 1 --workers 2 --fail-on critical",
14
14
  "eval:test": "python3 -m unittest evals.test_compute_eval_score",
15
+ "eval:debt": "python3 scripts/eval-debt-report.py",
15
16
  "bundle:claude-ai": "bash scripts/build-claude-ai-bundle.sh"
16
17
  },
17
18
  "keywords": [
@@ -1,44 +1,44 @@
1
- # 前置:機會評估(Opportunity Check
1
+ # Pre-Step: Opportunity Check
2
2
 
3
- > **注意:各模式應執行哪些步驟,以 SKILL.md 中「各模式步驟序列」為權威定義。以下僅供參考。**
3
+ > **Note: Which steps to execute per mode is authoritatively defined by the "Mode Step Sequences" in SKILL.md. The following is for reference only.**
4
4
 
5
- **適用於:完整模式、高完整性、產出對象為老闆/高層**
6
- **可跳過:快速模式、直接實作模式、產出對象為工程師/設計師**
5
+ **Applicable: Full mode, high completeness, audience is executives/leadership**
6
+ **Skippable: Quick mode, direct build mode, audience is engineers/designers**
7
7
 
8
- 如果使用者是從頭開始做 0-to-1 產品,先通過這五個問題。任何一題答案是「否」都是需要重新思考的訊號:
8
+ If the user is building a 0-to-1 product from scratch, run through these five questions first. A "no" on any question is a signal to rethink:
9
9
 
10
10
  ```
11
- | # | 評估問題 | 使用者答案 | 評估 |
12
- |---|----------|-----------|------|
13
- | 1 | 這是否在解決一個真實且急迫的用戶痛點?第一批受益的客戶是誰?你如何找到他們? | | ✅/⚠️ |
14
- | 2 | 你是否有解決這個問題的獨特優勢?目標客戶是否至少每週會用到?市場夠大嗎? | | ✅/⚠️ |
15
- | 3 | 以現有資源,能否在 2-3 年內做出可用的產品? | | ✅/⚠️ |
16
- | 4 | 競爭格局如何?你能贏嗎?差異化優勢是什麼? | | ✅/⚠️ |
17
- | 5 | 是否有可持續的用戶增長和商業化路徑? | | ✅/⚠️ |
11
+ | # | Assessment Question | User's Answer | Assessment |
12
+ |---|---------------------|---------------|------------|
13
+ | 1 | Does this solve a real, urgent user pain point? Who are the first customers to benefit? How will you find them? | | ✅/⚠️ |
14
+ | 2 | Do you have a unique advantage in solving this problem? Will target customers use it at least weekly? Is the market large enough? | | ✅/⚠️ |
15
+ | 3 | With current resources, can you build a usable product within 2-3 years? | | ✅/⚠️ |
16
+ | 4 | What does the competitive landscape look like? Can you win? What's your differentiation? | | ✅/⚠️ |
17
+ | 5 | Is there a sustainable path for user growth and monetization? | | ✅/⚠️ |
18
18
  ```
19
19
 
20
- ## DHM 初步檢驗(Gibson Biddle / Netflix
20
+ ## DHM Quick Check (Gibson Biddle / Netflix)
21
21
 
22
- 這個機會是否能做到:
23
- - **DDelight)**:讓用戶感到驚喜、超出預期?
24
- - **HHard to copy)**:競爭對手難以輕易複製?
25
- - **MMargin-enhancing)**:隨著規模增長,邊際利潤能提升?
22
+ Can this opportunity achieve:
23
+ - **D (Delight)**: Surprise and exceed user expectations?
24
+ - **H (Hard to copy)**: Be difficult for competitors to replicate?
25
+ - **M (Margin-enhancing)**: Improve margins as scale grows?
26
26
 
27
- 如果某些市場訊號尚不明確,尋找方向性訊號:
28
- - 宏觀趨勢(例:AI 普及帶來的工作流程替代機會)
29
- - 行為轉移(用戶已在用 workaround,代表需求真實存在)
30
- - 類比市場(找已驗證的相似場景)
27
+ If some market signals are unclear, look for directional signals:
28
+ - Macro trends (e.g., AI adoption creating workflow replacement opportunities)
29
+ - Behavioral shifts (users already using workarounds, indicating real demand)
30
+ - Analogous markets (find validated comparable scenarios)
31
31
 
32
- ## 團隊熱情確認
32
+ ## Team Passion Check
33
33
 
34
- 確認團隊對這個問題空間真的有熱情。缺乏內在驅動力的團隊在尋找 PMF 的路上必然倒下。
34
+ Confirm the team has genuine passion for this problem space. Teams lacking intrinsic motivation will inevitably falter on the path to PMF.
35
35
 
36
36
  ---
37
37
 
38
- ## 📎 本階段的檔案整合提示
38
+ ## 📎 File Integration Tips for This Stage
39
39
 
40
- | 上傳內容 | 整合到 | 整合動作 |
41
- |---------|-------|---------|
42
- | 市場報告(PDF | 五個評估問題(#2 市場規模、#4 競爭格局) | 用報告數據替代假設性回答 |
43
- | 行業分析 / 趨勢報告 | DHM + 方向性訊號 | 提取宏觀趨勢和行為轉移作為 DHM 佐證 |
44
- | 競品融資/營收資訊 | 五個評估問題(#4、#5 | 評估競爭強度和市場驗證信號 |
40
+ | Uploaded Content | Integrate Into | Integration Action |
41
+ |-----------------|----------------|-------------------|
42
+ | Market reports (PDF) | Five assessment questions (#2 market size, #4 competitive landscape) | Replace assumptions with report data |
43
+ | Industry analysis / trend reports | DHM + directional signals | Extract macro trends and behavioral shifts as DHM evidence |
44
+ | Competitor funding/revenue info | Five assessment questions (#4, #5) | Assess competitive intensity and market validation signals |