@unified-product-graph/mcp-server 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.
Files changed (63) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/LICENSE +21 -0
  3. package/README.md +166 -0
  4. package/TOOLS.md +2574 -0
  5. package/dist/index.d.ts +17 -0
  6. package/dist/index.js +50284 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/preflight.d.ts +2 -0
  9. package/dist/preflight.js +35 -0
  10. package/dist/preflight.js.map +1 -0
  11. package/dist/tools-manifest.json +3849 -0
  12. package/package.json +76 -0
  13. package/scripts/claudemd-snippet.md +19 -0
  14. package/scripts/install-skills.sh +259 -0
  15. package/skills/upg/SKILL.md +245 -0
  16. package/skills/upg-analytics/SKILL.md +135 -0
  17. package/skills/upg-capture/SKILL.md +274 -0
  18. package/skills/upg-connect/SKILL.md +167 -0
  19. package/skills/upg-context/SKILL.md +506 -0
  20. package/skills/upg-context-intelligence/SKILL.md +227 -0
  21. package/skills/upg-design-system/SKILL.md +265 -0
  22. package/skills/upg-diff/SKILL.md +150 -0
  23. package/skills/upg-discover/SKILL.md +290 -0
  24. package/skills/upg-explore/SKILL-DETAIL.md +481 -0
  25. package/skills/upg-explore/SKILL.md +297 -0
  26. package/skills/upg-export/SKILL.md +385 -0
  27. package/skills/upg-feedback/SKILL.md +141 -0
  28. package/skills/upg-gaps/SKILL.md +376 -0
  29. package/skills/upg-hypothesis/SKILL.md +190 -0
  30. package/skills/upg-impact/SKILL.md +229 -0
  31. package/skills/upg-import/SKILL.md +189 -0
  32. package/skills/upg-init/SKILL.md +410 -0
  33. package/skills/upg-inspect/SKILL.md +167 -0
  34. package/skills/upg-journey/SKILL.md +207 -0
  35. package/skills/upg-launch/SKILL-DETAIL.md +392 -0
  36. package/skills/upg-launch/SKILL.md +141 -0
  37. package/skills/upg-migrate/SKILL.md +146 -0
  38. package/skills/upg-okr/SKILL-DETAIL.md +351 -0
  39. package/skills/upg-okr/SKILL.md +88 -0
  40. package/skills/upg-persona/SKILL.md +230 -0
  41. package/skills/upg-prioritise/SKILL.md +195 -0
  42. package/skills/upg-pull/SKILL-DETAIL.md +398 -0
  43. package/skills/upg-pull/SKILL.md +57 -0
  44. package/skills/upg-push/SKILL-DETAIL.md +385 -0
  45. package/skills/upg-push/SKILL.md +113 -0
  46. package/skills/upg-reflect/SKILL.md +201 -0
  47. package/skills/upg-research/SKILL.md +336 -0
  48. package/skills/upg-rollback/SKILL.md +163 -0
  49. package/skills/upg-run/SKILL.md +126 -0
  50. package/skills/upg-schema-changelog/SKILL.md +231 -0
  51. package/skills/upg-schema-consolidate/SKILL.md +243 -0
  52. package/skills/upg-schema-edges/SKILL.md +287 -0
  53. package/skills/upg-schema-evolve/SKILL.md +313 -0
  54. package/skills/upg-schema-health/SKILL.md +279 -0
  55. package/skills/upg-schema-update/SKILL.md +206 -0
  56. package/skills/upg-snapshot/SKILL.md +108 -0
  57. package/skills/upg-status/SKILL.md +340 -0
  58. package/skills/upg-strategy/SKILL.md +334 -0
  59. package/skills/upg-template/SKILL.md +145 -0
  60. package/skills/upg-trace/SKILL.md +197 -0
  61. package/skills/upg-tree/SKILL.md +233 -0
  62. package/skills/upg-verify/SKILL.md +223 -0
  63. package/skills/upg-workspace/SKILL.md +103 -0
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@unified-product-graph/mcp-server",
3
+ "version": "0.6.0",
4
+ "description": "Local MCP server for .upg files. Read and write product knowledge graphs offline.",
5
+ "license": "MIT",
6
+ "author": "The Product Creator <hello@theproductcreator.com>",
7
+ "homepage": "https://unifiedproductgraph.org",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/unified-product-graph/mcp-server.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/unified-product-graph/mcp-server/issues"
14
+ },
15
+ "engines": {
16
+ "node": ">=20"
17
+ },
18
+ "type": "module",
19
+ "bin": {
20
+ "upg-mcp-server": "dist/index.js"
21
+ },
22
+ "main": "./dist/index.js",
23
+ "types": "./dist/index.d.ts",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js"
28
+ }
29
+ },
30
+ "files": [
31
+ "dist",
32
+ "skills",
33
+ "scripts/install-skills.sh",
34
+ "scripts/claudemd-snippet.md",
35
+ "TOOLS.md",
36
+ "CHANGELOG.md"
37
+ ],
38
+ "scripts": {
39
+ "build": "tsup",
40
+ "postbuild": "npm run generate-tools",
41
+ "dev": "echo '@unified-product-graph/mcp-server: standalone only. Run with: npx upg-mcp-server --file <path.upg>'",
42
+ "generate-tools": "tsx scripts/generate-tool-reference.ts",
43
+ "generate-tools:check": "tsx scripts/generate-tool-reference.ts --check",
44
+ "test": "vitest run",
45
+ "test:watch": "vitest",
46
+ "lint": "eslint src/",
47
+ "type-check": "tsc --noEmit",
48
+ "prepublishOnly": "npm run build"
49
+ },
50
+ "dependencies": {
51
+ "@modelcontextprotocol/sdk": "^1.27.0",
52
+ "@unified-product-graph/core": "*",
53
+ "@unified-product-graph/sdk": "*",
54
+ "chokidar": "^4.0.0",
55
+ "nanoid": "^5.1.0"
56
+ },
57
+ "devDependencies": {
58
+ "@types/node": "^25.6.0",
59
+ "tsup": "^8.5.1",
60
+ "tsx": "^4.0.0",
61
+ "typescript": "^5.8.0",
62
+ "@unified-product-graph/frameworks": "*",
63
+ "@unified-product-graph/mcp-tooling": "*"
64
+ },
65
+ "keywords": [
66
+ "mcp",
67
+ "upg",
68
+ "unified-product-graph",
69
+ "product-management",
70
+ "model-context-protocol",
71
+ "knowledge-graph"
72
+ ],
73
+ "publishConfig": {
74
+ "access": "public"
75
+ }
76
+ }
@@ -0,0 +1,19 @@
1
+ ## Unified Product Graph
2
+
3
+ This project uses the Unified Product Graph to structure product thinking. A `.upg` file in the repo root contains the product graph.
4
+
5
+ ### Available Commands
6
+ - `/upg` — See your product graph status and all available commands
7
+ - `/upg-journey` — Guided 7-phase product journey with progress tracking
8
+ - `/upg-init` — Bootstrap a new product graph (~5 min guided setup)
9
+ - `/upg-explore` — Create any entity (90+ types across 32 domains)
10
+ - `/upg-status` — Health dashboard with maturity scoring
11
+ - `/upg-gaps` — Gap analysis across 8 business areas
12
+ - `/upg-capture` — Capture session work into the graph
13
+
14
+ ### Graph Awareness
15
+ When a `.upg` file exists, be aware of the product graph context. During conversations about product decisions, features, user research, or business strategy, offer to capture relevant insights into the graph. Don't be pushy — only suggest when the work is clearly graph-worthy (new features, strategic decisions, user insights). Routine code changes are not graph-worthy.
16
+
17
+ At natural checkpoints (after commits, before session end, after design discussions), suggest running `/upg-capture` to review and save session work.
18
+
19
+ Learn more: unifiedproductgraph.org
@@ -0,0 +1,259 @@
1
+ #!/bin/bash
2
+ # Install UPG skills into AI coding tool skill directories
3
+ # Run from anywhere: bash /path/to/install-skills.sh
4
+ #
5
+ # Flags:
6
+ # --no-claudemd Skip CLAUDE.md awareness snippet
7
+ # --target=claude,cursor Install for specific IDEs (skip prompt)
8
+ #
9
+ # Supported targets: claude, cursor, codex, gemini, opencode, kiro
10
+
11
+ set -e
12
+
13
+ # ── Auto-detect package location ──────────────────────────────────────────────
14
+
15
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
16
+ PACKAGE_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
17
+ SKILLS_SOURCE="$PACKAGE_DIR/skills"
18
+ SNIPPET_FILE="$SCRIPT_DIR/claudemd-snippet.md"
19
+
20
+ # Find project root (git root or current directory)
21
+ PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
22
+
23
+ if [ ! -d "$SKILLS_SOURCE" ]; then
24
+ echo "Error: Skills source not found at $SKILLS_SOURCE"
25
+ exit 1
26
+ fi
27
+
28
+ # ── Parse flags ───────────────────────────────────────────────────────────────
29
+
30
+ NO_CLAUDEMD=false
31
+ TARGET_FLAG=""
32
+
33
+ for arg in "$@"; do
34
+ case "$arg" in
35
+ --no-claudemd)
36
+ NO_CLAUDEMD=true
37
+ ;;
38
+ --target=*)
39
+ TARGET_FLAG="${arg#--target=}"
40
+ ;;
41
+ esac
42
+ done
43
+
44
+ # ── IDE target definitions ────────────────────────────────────────────────────
45
+
46
+ # Each target: name, directory, has MCP support
47
+ declare -a ALL_TARGETS=("claude" "cursor" "codex" "gemini" "opencode" "kiro")
48
+
49
+ target_dir() {
50
+ case "$1" in
51
+ claude) echo ".claude/skills" ;;
52
+ cursor) echo ".cursor/skills" ;;
53
+ codex) echo ".codex/skills" ;;
54
+ gemini) echo ".gemini/skills" ;;
55
+ opencode) echo ".opencode/skills" ;;
56
+ kiro) echo ".kiro/skills" ;;
57
+ esac
58
+ }
59
+
60
+ target_label() {
61
+ case "$1" in
62
+ claude) echo "Claude Code" ;;
63
+ cursor) echo "Cursor" ;;
64
+ codex) echo "Codex CLI" ;;
65
+ gemini) echo "Gemini CLI" ;;
66
+ opencode) echo "OpenCode" ;;
67
+ kiro) echo "Kiro" ;;
68
+ esac
69
+ }
70
+
71
+ # ── Select targets ────────────────────────────────────────────────────────────
72
+
73
+ SELECTED_TARGETS=()
74
+
75
+ if [ -n "$TARGET_FLAG" ]; then
76
+ # Parse comma-separated targets from flag
77
+ IFS=',' read -ra SELECTED_TARGETS <<< "$TARGET_FLAG"
78
+ else
79
+ # Interactive prompt
80
+ echo ""
81
+ echo " · ·"
82
+ echo " ◉"
83
+ echo " · ·"
84
+ echo ""
85
+ echo "UPG Skills Installer"
86
+ echo "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄"
87
+ echo ""
88
+ echo "Where do you want to install UPG skills?"
89
+ echo ""
90
+ echo " 1) Claude Code only (.claude/skills/)"
91
+ echo " 2) Claude Code + Cursor (.claude/skills/ + .cursor/skills/)"
92
+ echo " 3) Claude Code + all supported IDEs"
93
+ echo " 4) Pick specific IDEs"
94
+ echo ""
95
+ echo "Supported: Claude Code, Cursor, Codex CLI, Gemini CLI, OpenCode, Kiro"
96
+ echo ""
97
+ printf "Choice [1]: "
98
+ read -r choice
99
+
100
+ case "${choice:-1}" in
101
+ 1)
102
+ SELECTED_TARGETS=("claude")
103
+ ;;
104
+ 2)
105
+ SELECTED_TARGETS=("claude" "cursor")
106
+ ;;
107
+ 3)
108
+ SELECTED_TARGETS=("${ALL_TARGETS[@]}")
109
+ ;;
110
+ 4)
111
+ echo ""
112
+ echo "Select IDEs (comma-separated, e.g. claude,cursor,gemini):"
113
+ echo " Available: ${ALL_TARGETS[*]}"
114
+ printf "> "
115
+ read -r picks
116
+ IFS=',' read -ra SELECTED_TARGETS <<< "$picks"
117
+ ;;
118
+ *)
119
+ SELECTED_TARGETS=("claude")
120
+ ;;
121
+ esac
122
+ fi
123
+
124
+ # Validate targets
125
+ VALID_TARGETS=()
126
+ for t in "${SELECTED_TARGETS[@]}"; do
127
+ t="$(echo "$t" | tr -d ' ')" # trim whitespace
128
+ dir="$(target_dir "$t")"
129
+ if [ -n "$dir" ]; then
130
+ VALID_TARGETS+=("$t")
131
+ else
132
+ echo "Warning: Unknown target '$t' — skipping"
133
+ fi
134
+ done
135
+
136
+ if [ ${#VALID_TARGETS[@]} -eq 0 ]; then
137
+ echo "Error: No valid targets selected"
138
+ exit 1
139
+ fi
140
+
141
+ # ── Count skills ──────────────────────────────────────────────────────────────
142
+
143
+ SKILL_COUNT=0
144
+ for skill_dir in "$SKILLS_SOURCE"/upg*; do
145
+ [ -d "$skill_dir" ] && SKILL_COUNT=$((SKILL_COUNT + 1))
146
+ done
147
+
148
+ # ── Install skills ────────────────────────────────────────────────────────────
149
+
150
+ echo ""
151
+ echo "Installing UPG skills..."
152
+ echo " Source: $SKILLS_SOURCE"
153
+ echo ""
154
+
155
+ HAS_NON_CLAUDE=false
156
+
157
+ for target in "${VALID_TARGETS[@]}"; do
158
+ dir="$(target_dir "$target")"
159
+ label="$(target_label "$target")"
160
+ full_path="$PROJECT_ROOT/$dir"
161
+
162
+ mkdir -p "$full_path"
163
+
164
+ echo " $label → $dir/"
165
+
166
+ for skill_dir in "$SKILLS_SOURCE"/upg*; do
167
+ [ -d "$skill_dir" ] || continue
168
+ skill_name=$(basename "$skill_dir")
169
+ target_link="$full_path/$skill_name"
170
+
171
+ # Remove existing (symlink or directory)
172
+ if [ -L "$target_link" ]; then
173
+ rm "$target_link"
174
+ elif [ -d "$target_link" ]; then
175
+ rm -rf "$target_link"
176
+ fi
177
+
178
+ # Create symlink
179
+ ln -s "$skill_dir" "$target_link"
180
+ done
181
+
182
+ echo " ✓ $SKILL_COUNT skills symlinked"
183
+
184
+ if [ "$target" != "claude" ]; then
185
+ HAS_NON_CLAUDE=true
186
+ fi
187
+ done
188
+
189
+ # ── Note about slash commands vs skills for non-Claude IDEs ───────────────────
190
+
191
+ if [ "$HAS_NON_CLAUDE" = true ]; then
192
+ echo ""
193
+ echo " Note: /slash-command syntax is Claude Code specific. In other IDEs,"
194
+ echo " the skill files work as rules/instructions that guide the AI assistant."
195
+ echo " MCP tools work in any IDE that supports the Model Context Protocol."
196
+ fi
197
+
198
+ # ── CLAUDE.md awareness snippet ───────────────────────────────────────────────
199
+
200
+ CLAUDEMD_UPDATED=false
201
+
202
+ if [ "$NO_CLAUDEMD" = false ]; then
203
+ echo ""
204
+ CLAUDEMD_PATH="$PROJECT_ROOT/CLAUDE.md"
205
+
206
+ # Check if snippet already exists
207
+ if [ -f "$CLAUDEMD_PATH" ] && grep -q "## Unified Product Graph" "$CLAUDEMD_PATH" 2>/dev/null; then
208
+ echo " CLAUDE.md already has UPG awareness — skipping"
209
+ CLAUDEMD_UPDATED=true
210
+ else
211
+ printf "Add UPG awareness to your CLAUDE.md? [Y/n] "
212
+ read -r answer
213
+
214
+ if [ "${answer:-Y}" != "n" ] && [ "${answer:-Y}" != "N" ]; then
215
+ if [ ! -f "$SNIPPET_FILE" ]; then
216
+ echo "Warning: Snippet file not found at $SNIPPET_FILE — skipping"
217
+ else
218
+ # Create CLAUDE.md if it doesn't exist
219
+ if [ ! -f "$CLAUDEMD_PATH" ]; then
220
+ echo "# $(basename "$PROJECT_ROOT")" > "$CLAUDEMD_PATH"
221
+ echo "" >> "$CLAUDEMD_PATH"
222
+ fi
223
+
224
+ # Append snippet
225
+ echo "" >> "$CLAUDEMD_PATH"
226
+ cat "$SNIPPET_FILE" >> "$CLAUDEMD_PATH"
227
+ CLAUDEMD_UPDATED=true
228
+ fi
229
+ fi
230
+ fi
231
+ fi
232
+
233
+ # ── Summary ───────────────────────────────────────────────────────────────────
234
+
235
+ echo ""
236
+ echo "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄"
237
+
238
+ TARGETS_LIST=""
239
+ for target in "${VALID_TARGETS[@]}"; do
240
+ label="$(target_label "$target")"
241
+ if [ -z "$TARGETS_LIST" ]; then
242
+ TARGETS_LIST="$label"
243
+ else
244
+ TARGETS_LIST="$TARGETS_LIST, $label"
245
+ fi
246
+ done
247
+
248
+ echo "✓ $SKILL_COUNT skills installed → $TARGETS_LIST"
249
+ if [ "$CLAUDEMD_UPDATED" = true ]; then
250
+ echo "✓ CLAUDE.md updated with UPG awareness"
251
+ fi
252
+ echo ""
253
+ echo "Quick start:"
254
+ echo " /upg — see your product graph"
255
+ echo " /upg-init — bootstrap a new graph (~5 min)"
256
+ echo " /upg-journey — guided product journey"
257
+ echo ""
258
+ echo "Skills are symlinked — edits in the source are live immediately."
259
+ echo ""
@@ -0,0 +1,245 @@
1
+ ---
2
+ name: upg
3
+ description: "Unified Product Graph — your product graph, right here in the terminal"
4
+ user-invocable: true
5
+ argument-hint: "[command or natural-language question]"
6
+ category: aggregator
7
+ ---
8
+
9
+ # /upg — Unified Product Graph
10
+
11
+ You are the front door to the Unified Product Graph experience inside Claude Code. Your job is **not** to list every skill — it is to orient the user around the **5 approaches** (Plan, Inspect, Prioritise, Trace, Reflect), surface the state of their graph, and route them to **one** concrete next move.
12
+
13
+ If they want a phonebook, they can ask for it. The default is conversation.
14
+
15
+ **Before producing any output, load the design system:** `/upg-context` (interaction principles, design system, lens rules) and `/upg-context-intelligence` (benchmarks, user personas, product philosophy).
16
+
17
+ ## Tools
18
+
19
+ Use the `mcp__unified-product-graph__*` MCP tools:
20
+ - **State:** `get_product_context`, `get_graph_digest`, `get_session_context`
21
+ - **Approaches:** `list_approaches`, `get_approach`
22
+ - **Regions / playbooks (when relevant):** `list_regions`, `get_region`, `list_playbooks`, `get_playbook`
23
+
24
+ ## The Cartographic Frame
25
+
26
+ UPG is a chart of your product knowledge. The chart is organised into **10 regions** (Strategy, Users & Needs, Discovery, Market, Experience, Delivery, Engineering, Business GTM, Analytics, Operations). The chart is read through one of **5 approaches** — five paths of arrival to five different questions:
27
+
28
+ | Approach | Question | Cartographic sense |
29
+ |---|---|---|
30
+ | 🧠 **Plan** | *"What should I build next?"* | Walk the coastline, mark missing contour |
31
+ | 🔍 **Inspect** | *"What's broken?"* | Survey for hazards before approach |
32
+ | 📊 **Prioritise** | *"What's most important?"* | Compute order of arrival from a chosen vantage |
33
+ | 🧵 **Trace** | *"Walk a meaningful path through what exists"* | Trace a route across charted terrain |
34
+ | 🪞 **Reflect** | *"What should I be questioning?"* | Mark the parts of the chart that may be conjecture |
35
+
36
+ Skills (`/upg-*`) are the user-invocable surfaces. Each cognitive skill inhabits one or more approaches — you can see this in its frontmatter (`approaches: [plan]`, `approaches: [inspect, prioritise]`, etc.).
37
+
38
+ ## Behavior
39
+
40
+ ### Step 1 — Read state
41
+
42
+ Always start by checking:
43
+
44
+ ```
45
+ get_product_context() // graph exists? what's in it?
46
+ get_session_context() // what's the active lens?
47
+ ```
48
+
49
+ Branch based on whether a graph exists.
50
+
51
+ ---
52
+
53
+ ### Branch A — Graph exists
54
+
55
+ Render the orientation card (real markdown, NOT inside a code block):
56
+
57
+ ---
58
+
59
+ ```
60
+ · ·
61
+
62
+ · ·
63
+ ```
64
+ # Unified Product Graph
65
+ ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
66
+
67
+ **<Product Name>** · *<stage>* · <N> entities · <N> edges · <N> regions active
68
+
69
+ Maturity ● ● ● ○ ○ **3/5** *<stage label>*
70
+
71
+ > **Lens:** `<active>` — <render the lens description from this table: product → "personas, outcomes, features" · engineering → "services, APIs, data flows" · design → "screens, flows, components" · growth → "funnels, channels, campaigns">. Say "switch to [product|engineering|design|growth]" to change.
72
+
73
+ ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
74
+
75
+ **What do you want to do?**
76
+
77
+ | | Approach | Question | Common entry |
78
+ |---|---|---|---|
79
+ | 🧠 | **Plan** | What should I build next? | `/upg-explore <region>` · `/upg-strategy` · `/upg-journey` |
80
+ | 🔍 | **Inspect** | What's broken? | `/upg-status` · `/upg-tree` · `/upg-inspect <entity>` |
81
+ | 📊 | **Prioritise** | What's most important? | `/upg-prioritise` · `/upg-gaps` · `/upg-impact` |
82
+ | 🧵 | **Trace** | Walk a path through what exists | `/upg-trace <anchor> → <destination>` · `/upg-impact <entity>` · `/upg-connect` |
83
+ | 🪞 | **Reflect** | What should I be questioning? | `/upg-reflect` · *Five Whys · Pre-mortem · Red Team · Devil's Advocate · Second-order* |
84
+
85
+ **Tell me which approach, or just describe what's on your mind.**
86
+
87
+ ---
88
+
89
+ ### Routing Hints
90
+
91
+ When the user selects an approach (or you infer one from their description), pre-call the listed tool before routing — it gives the downstream skill the data it needs without a cold start.
92
+
93
+ | Approach | Pre-call | Entry skill |
94
+ |---|---|---|
95
+ | 🧠 Plan | `mcp__unified-product-graph__list_playbooks()` — see region options | `/upg-explore <region>` |
96
+ | 🔍 Inspect | `mcp__unified-product-graph__get_graph_digest()` — health metrics | `/upg-status` |
97
+ | 📊 Prioritise | `mcp__unified-product-graph__get_graph_digest()` — gap + coverage data | `/upg-gaps` |
98
+ | 🧵 Trace | `mcp__unified-product-graph__get_product_context()` — find anchor entities | `/upg-impact <entity>` |
99
+ | 🪞 Reflect | `mcp__unified-product-graph__get_session_context()` — recent decisions | `/upg-reflect` |
100
+
101
+ ---
102
+
103
+ After the card, **make ONE concrete suggestion** based on the graph state. Pick the highest-value next move from this priority order:
104
+
105
+ 1. **No anchor entity for an active region** → suggest `/upg-explore <region>` to fill the missing scaffolding (Plan)
106
+ 2. **Anti-pattern violations present** → suggest `/upg-status` then `/upg-gaps` (Inspect)
107
+ 3. **A `decision` entity has no rationale or has gone stale** → suggest `/upg-reflect <decision>` (Reflect)
108
+ 4. **A `hypothesis` has no `evidence`** → suggest `/upg-hypothesis` to design the experiment (Plan)
109
+ 5. **A `feature` is `in_progress` with no linked outcome** → suggest `/upg-impact <feature>` (Trace)
110
+ 6. **Otherwise** → suggest `/upg-status` for a 30-second pulse
111
+
112
+ Surface that one suggestion as: *"Looking at your graph, the highest-value next move is **X**. Want to start there?"*
113
+
114
+ ---
115
+
116
+ ### Branch B — No graph yet
117
+
118
+ Render (real markdown, NOT a code block):
119
+
120
+ ---
121
+
122
+ ```
123
+ · ·
124
+
125
+ · ·
126
+ ```
127
+ # Unified Product Graph
128
+ ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
129
+
130
+ **Structure your product thinking as a connected graph — right here in the terminal.**
131
+
132
+ Your graph lives in a `.upg` file — a portable JSON format you own and track with git. No cloud required, no lock-in.
133
+
134
+ UPG is a chart of your product knowledge across **10 regions** — Strategy, Users & Needs, Discovery, Market, Experience, Delivery, Engineering, Business GTM, Analytics, Operations.
135
+
136
+ You read the chart through **5 approaches** — Plan, Inspect, Prioritise, Trace, Reflect.
137
+
138
+ ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
139
+
140
+ **Get started**
141
+
142
+ | | Command | What it does |
143
+ |---|---|---|
144
+ | 🌱 | `/upg-init` | Bootstrap your first product graph (guided, ~5 minutes) |
145
+ | 📋 | `/upg-template` | Start from a proven pattern (SaaS, marketplace, mobile, OSS, agency) |
146
+
147
+ > Learn more: **unifiedproductgraph.org**
148
+
149
+ ---
150
+
151
+ ### Step 2 — If the user passes an argument
152
+
153
+ If `/upg <something>` is given:
154
+
155
+ 1. **Match a subcommand:** `init`, `status`, `tree`, `gaps`, `inspect`, `reflect`, `explore`, `journey`, etc. → run the corresponding `/upg-<x>` skill.
156
+ 2. **Match an approach name:** `plan`, `inspect`, `prioritise`, `trace`, `reflect` → call `get_approach({ approach_id })` and route the user to the most-fitting skill for their graph state.
157
+ 3. **Match a region name:** `strategy`, `users_needs`, `experience_design_brand`, etc. → suggest `/upg-explore <region>`.
158
+ 4. **Free-text question:** parse intent into one of the 5 approaches, then suggest a skill.
159
+
160
+ If unmatched, show the orientation card and ask: *"Did you mean one of these? Or tell me in your own words."*
161
+
162
+ ---
163
+
164
+ ### Step 3 — When the user asks "show me everything"
165
+
166
+ Only then, surface the complete catalogue. Default behaviour stays focused.
167
+
168
+ When asked, show this expanded view:
169
+
170
+ **Cognitive skills (organised by approach)**
171
+
172
+ 🧠 **Plan**
173
+ | Skill | What |
174
+ |---|---|
175
+ | `/upg-explore <region>` | Walk a region's canonical playbook |
176
+ | `/upg-run <playbook-id>` | Run any canonical playbook directly |
177
+ | `/upg-journey` | 7-phase product journey |
178
+ | `/upg-strategy` | Vision → mission → themes → outcomes |
179
+ | `/upg-okr` | Objectives & key results |
180
+ | `/upg-launch` | Go-to-market planning |
181
+ | `/upg-research` | User research session |
182
+ | `/upg-discover` | OST-guided discovery |
183
+ | `/upg-hypothesis` | Structured hypothesis creation |
184
+ | `/upg-persona` | Guided persona building |
185
+
186
+ 🔍 **Inspect**
187
+ | Skill | What |
188
+ |---|---|
189
+ | `/upg-status` | Health dashboard |
190
+ | `/upg-tree` | Framework-aware tree view |
191
+ | `/upg-inspect <entity>` | Deep-dive on one entity |
192
+ | `/upg-analytics` | Product thinking metrics |
193
+ | `/upg-verify` | Code-to-graph sync audit |
194
+ | `/upg-diff` | What changed since last commit |
195
+
196
+ 📊 **Prioritise**
197
+ | Skill | What |
198
+ |---|---|
199
+ | `/upg-prioritise` | RICE / WSJF / Eisenhower / ICE scoring across candidate items |
200
+ | `/upg-gaps` | Strategic gap analysis + maturity scoring |
201
+ | `/upg-impact` | Forward blast radius (Trace + Prioritise) |
202
+
203
+ 🧵 **Trace**
204
+ | Skill | What |
205
+ |---|---|
206
+ | `/upg-trace <anchor> → <destination>` | Walk a directed path through the graph (canonical Trace entry) |
207
+ | `/upg-impact <entity>` | Forward / `--upstream` causal chain |
208
+ | `/upg-connect` | Wire relationships between entities |
209
+
210
+ 🪞 **Reflect**
211
+ | Skill | What |
212
+ |---|---|
213
+ | `/upg-reflect [scope]` | Five Whys / Pre-mortem / Red Team / Devil's Advocate / Second-order |
214
+
215
+ **Tooling** (graph state operations — `/upg-init`, `/upg-capture`, `/upg-push`, `/upg-pull`, `/upg-snapshot`, `/upg-rollback`, `/upg-migrate`, `/upg-import`, `/upg-export`, `/upg-feedback`, `/upg-template`, `/upg-workspace`)
216
+
217
+ **Schema** (spec evolution — `/upg-schema-update`, `/upg-schema-consolidate`, `/upg-schema-evolve`, `/upg-schema-health`, `/upg-schema-changelog`, `/upg-schema-edges`)
218
+
219
+ **Meta** (system reference — `/upg-context`, `/upg-design-system`)
220
+
221
+ ---
222
+
223
+ ## Key Principles
224
+
225
+ - **Orient, don't overwhelm.** Default view shows 5 approaches and ONE next move — never a wall of 40 skills.
226
+ - **Approaches are the spine.** Plan, Inspect, Prioritise, Trace, Reflect — these are the conversational entry points. Skills implement them.
227
+ - **Tooling is plumbing.** `/upg-init`, `/upg-push`, `/upg-snapshot` etc. are real and important, but they don't belong in the main view. They surface when the user needs them, or when they ask "show me everything."
228
+ - **State-aware.** If a graph exists, show its state and one concrete suggestion. If not, show the get-started path.
229
+ - **Listen before you list.** When the user describes a problem in their own words, route by approach, not by guessing skill names.
230
+ - **Always write "Unified Product Graph" in full** when introducing it. Never abbreviate to "UPG" in user-facing text.
231
+ - **The `.upg` file is the hero.** Open standard, portable, git-friendly. Reinforce ownership.
232
+ - **Follow the design system.** Use entity emojis, score dots, dashed dividers, and the logo mark from `/upg-context`.
233
+
234
+ After routing the user to the next skill, call:
235
+ `update_session_context({ skill_invoked: "upg", recommendation: "<the next skill you routed to>" })`
236
+
237
+ ## What Changed in v0.3
238
+
239
+ If a returning user asks "what's new?":
240
+
241
+ - **5 approaches** (Plan / Inspect / Prioritise / Trace / Reflect) replace the old "14 canonical workflows" framing — cognitive operations, not menus.
242
+ - **23 region-anchored playbooks** organised under 10 canonical regions.
243
+ - **89 MCP tools** (was 40) across 6 buckets — primitives, approaches, catalog readers, spec metadata, mutations, workspace ops.
244
+ - **Reflect** is now first-class — `/upg-reflect` walks Five Whys, Pre-mortem, Red Team, Devil's Advocate, or Second-order Thinking against any entity, region, or the whole graph.
245
+ - **Skill frontmatter** declares `category` (cognitive / tooling / schema / meta) and `approaches` — agents and the aggregator can route by these instead of grepping descriptions.