@unified-product-graph/cli 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 (55) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +21 -0
  3. package/README.md +247 -0
  4. package/dist/cli.cjs +141010 -0
  5. package/package.json +65 -0
  6. package/skills/README.md +10 -0
  7. package/skills/upg/SKILL.md +245 -0
  8. package/skills/upg-analytics/SKILL.md +135 -0
  9. package/skills/upg-capture/SKILL.md +274 -0
  10. package/skills/upg-connect/SKILL.md +167 -0
  11. package/skills/upg-context/SKILL.md +506 -0
  12. package/skills/upg-context-intelligence/SKILL.md +227 -0
  13. package/skills/upg-design-system/SKILL.md +265 -0
  14. package/skills/upg-diff/SKILL.md +150 -0
  15. package/skills/upg-discover/SKILL.md +290 -0
  16. package/skills/upg-explore/SKILL-DETAIL.md +481 -0
  17. package/skills/upg-explore/SKILL.md +297 -0
  18. package/skills/upg-export/SKILL.md +385 -0
  19. package/skills/upg-feedback/SKILL.md +141 -0
  20. package/skills/upg-gaps/SKILL.md +376 -0
  21. package/skills/upg-hypothesis/SKILL.md +190 -0
  22. package/skills/upg-impact/SKILL.md +229 -0
  23. package/skills/upg-import/SKILL.md +189 -0
  24. package/skills/upg-init/SKILL.md +410 -0
  25. package/skills/upg-inspect/SKILL.md +167 -0
  26. package/skills/upg-journey/SKILL.md +207 -0
  27. package/skills/upg-launch/SKILL-DETAIL.md +392 -0
  28. package/skills/upg-launch/SKILL.md +141 -0
  29. package/skills/upg-migrate/SKILL.md +146 -0
  30. package/skills/upg-okr/SKILL-DETAIL.md +351 -0
  31. package/skills/upg-okr/SKILL.md +88 -0
  32. package/skills/upg-persona/SKILL.md +230 -0
  33. package/skills/upg-prioritise/SKILL.md +195 -0
  34. package/skills/upg-pull/SKILL-DETAIL.md +398 -0
  35. package/skills/upg-pull/SKILL.md +57 -0
  36. package/skills/upg-push/SKILL-DETAIL.md +385 -0
  37. package/skills/upg-push/SKILL.md +113 -0
  38. package/skills/upg-reflect/SKILL.md +201 -0
  39. package/skills/upg-research/SKILL.md +336 -0
  40. package/skills/upg-rollback/SKILL.md +163 -0
  41. package/skills/upg-run/SKILL.md +126 -0
  42. package/skills/upg-schema-changelog/SKILL.md +231 -0
  43. package/skills/upg-schema-consolidate/SKILL.md +243 -0
  44. package/skills/upg-schema-edges/SKILL.md +287 -0
  45. package/skills/upg-schema-evolve/SKILL.md +313 -0
  46. package/skills/upg-schema-health/SKILL.md +279 -0
  47. package/skills/upg-schema-update/SKILL.md +206 -0
  48. package/skills/upg-snapshot/SKILL.md +108 -0
  49. package/skills/upg-status/SKILL.md +340 -0
  50. package/skills/upg-strategy/SKILL.md +334 -0
  51. package/skills/upg-template/SKILL.md +145 -0
  52. package/skills/upg-trace/SKILL.md +197 -0
  53. package/skills/upg-tree/SKILL.md +233 -0
  54. package/skills/upg-verify/SKILL.md +223 -0
  55. package/skills/upg-workspace/SKILL.md +103 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ Changes to `@unified-product-graph/mcp` follow [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
+
5
+ ## [0.6.0] - 2026-05-22
6
+
7
+ Aligned with `@unified-product-graph/core@0.6.0` launch train. No CLI surface changes; co-versioned for clean install matrix across `@unified-product-graph/*`.
8
+
9
+ ## [0.5.0] - 2026-05-19
10
+
11
+ **Co-version:** pairs with `@unified-product-graph/core@0.5.0`.
12
+
13
+ First public release. 22 commands across 6 groups.
14
+
15
+ ### Added
16
+
17
+ - Governance: `health`, `verify`, `diff`, `gaps`.
18
+ - Explore: `list`, `tree`, `search`.
19
+ - Create & edit: `create`, `update`, `delete`, `connect`.
20
+ - Workspace: `init`, `workspace`, `import`, `export`.
21
+ - Cloud: `login`, `logout`, `push`, `pull`, `products`, `log`.
22
+ - Setup: `mcp setup`, `mcp status`, `mcp run`, `install-skills`.
23
+ - Bundled UPG skills for Claude Code.
24
+ - Import adapters: Markdown, Notion, Linear, Vistaly, Dovetail, GitHub.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Arkheiev UG
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,247 @@
1
+ # @unified-product-graph/mcp
2
+
3
+ The `upg` CLI. 22 commands across 6 groups: setup, workspace, governance, explore, create/edit, cloud.
4
+
5
+ ```
6
+ • · •
7
+ · ● ·
8
+ • · •
9
+
10
+ Unified Product Graph
11
+ ```
12
+
13
+ ## Get started in 60 seconds
14
+
15
+ ```bash
16
+ npm install -g @unified-product-graph/mcp
17
+ upg init --title "My Product" # create a .upg file in the current directory
18
+ upg install-skills # install UPG skills into Claude Code
19
+ # wire the MCP server (see "MCP server setup" below)
20
+ # open Claude Code, then type /upg
21
+ ```
22
+
23
+ Or run without installing:
24
+
25
+ ```bash
26
+ npx @unified-product-graph/mcp health
27
+ ```
28
+
29
+ ## Two surfaces
30
+
31
+ The package ships two surfaces against the same `.upg` file.
32
+
33
+ **CLI (`upg <command>`)** governs the file: CI gates, CRUD, cloud sync, scripts, pre-commit hooks.
34
+
35
+ **MCP server** surfaces the file to Claude Code as AI-native tools: exploration, entity creation, strategic analysis, playbooks.
36
+
37
+ ## MCP server setup
38
+
39
+ Wire the MCP server once per project. 1 file, 1 entry.
40
+
41
+ ### Add to `.claude/settings.json`
42
+
43
+ ```json
44
+ {
45
+ "mcpServers": {
46
+ "upg-local": {
47
+ "command": "npx",
48
+ "args": ["@unified-product-graph/mcp", "mcp", "run"],
49
+ "env": {
50
+ "UPG_FILE": ".upg/product.upg"
51
+ }
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ Point `UPG_FILE` at your `.upg` file. Commit `.claude/settings.json` so the team shares the config.
58
+
59
+ Or let the CLI write it:
60
+
61
+ ```bash
62
+ upg mcp setup --scope project # writes .claude/settings.json
63
+ upg mcp status # confirm the entry landed
64
+ ```
65
+
66
+ ### Verify
67
+
68
+ Open Claude Code. The MCP status indicator shows `unified-product-graph` connected. Type `/upg` to confirm skills loaded.
69
+
70
+ `upg install-skills` and `upg mcp setup` are 2 separate steps. Skills register the slash commands; the MCP server connects them to your graph. Run both.
71
+
72
+ ## Commands
73
+
74
+ ### Setup
75
+
76
+ | Command | Description |
77
+ |---------|-------------|
78
+ | `upg mcp setup` | Write the MCP server entry into `.claude/settings.json`. `--scope user`, `--force` |
79
+ | `upg mcp status` | Report MCP server config across scopes |
80
+ | `upg install-skills` | Install UPG skills into Claude Code. See [Install skills](#install-skills) |
81
+
82
+ ### Workspace
83
+
84
+ | Command | Description |
85
+ |---------|-------------|
86
+ | `upg init` | Create a `.upg` file. `--title`, `--workspace` |
87
+ | `upg workspace` | List products. `workspace switch <name>` to change active |
88
+ | `upg export` | Export as JSON, Markdown, or CSV. `--format=md --type=persona` |
89
+
90
+ ### Governance
91
+
92
+ | Command | Description |
93
+ |---------|-------------|
94
+ | `upg health` | Score the graph 0–100. `--min-score=60` for CI gate |
95
+ | `upg verify` | Structural validation. `--no-orphans`, `--max-orphan-rate=0.1` |
96
+ | `upg diff` | Show changes since a git ref. `--since=main` for PR reviews |
97
+ | `upg gaps` | Empty domains, broken chains, sparse areas |
98
+
99
+ ### Explore
100
+
101
+ | Command | Description |
102
+ |---------|-------------|
103
+ | `upg list` | Query entities. `--type`, `--status`, `--orphans`, `--count` |
104
+ | `upg tree` | Tree view. `upg tree persona`, `--depth=2` |
105
+ | `upg search <query>` | Fuzzy search across titles and descriptions |
106
+
107
+ ### Create & Edit
108
+
109
+ | Command | Description |
110
+ |---------|-------------|
111
+ | `upg create <type> <title>` | Create entity (type-validated). `--parent=<id>` |
112
+ | `upg update <id>` | Update fields. `--title`, `--status`, `--data='{"key":val}'` |
113
+ | `upg delete <id>` | Delete entity + edges. `--force` skips confirm |
114
+ | `upg connect <src> <tgt>` | Create edge. Type auto-inferred |
115
+
116
+ ### Cloud
117
+
118
+ | Command | Description |
119
+ |---------|-------------|
120
+ | `upg login` | Browser OAuth or `--key` |
121
+ | `upg logout` | Remove stored credentials |
122
+ | `upg push` | Push to cloud. `--dry-run`, `--strategy=merge` |
123
+ | `upg pull` | Pull cloud changes. `--force` overwrites local |
124
+ | `upg products` | List your cloud products |
125
+ | `upg log` | Activity log: who changed what, when |
126
+
127
+ ## Install skills
128
+
129
+ The package ships UPG skills as a `skills/` directory. `upg install-skills` links each one into `.claude/skills/`.
130
+
131
+ Symlinks are the default, so updates to `@unified-product-graph/mcp` propagate automatically. Windows falls back to copy. A `.upg-manifest.json` records UPG-owned skills, so `--remove` only touches them.
132
+
133
+ ```bash
134
+ # Project scope (default): <cwd>/.claude/skills/, committable with the team
135
+ upg install-skills
136
+
137
+ # User scope: ~/.claude/skills/, available in every project
138
+ upg install-skills --scope user
139
+
140
+ # Preview without installing
141
+ upg install-skills --list
142
+
143
+ # Force copy instead of symlink (useful for CI reproducibility)
144
+ upg install-skills --mode copy
145
+
146
+ # Overwrite pre-existing skills without prompting
147
+ upg install-skills --force
148
+
149
+ # Uninstall (removes only the skills recorded in the manifest)
150
+ upg install-skills --remove
151
+ ```
152
+
153
+ ## CI/CD
154
+
155
+ ### GitHub Actions
156
+
157
+ ```yaml
158
+ name: UPG Graph Quality
159
+ on:
160
+ pull_request:
161
+ paths: ['**/*.upg']
162
+
163
+ jobs:
164
+ graph-check:
165
+ runs-on: ubuntu-latest
166
+ steps:
167
+ - uses: actions/checkout@v4
168
+ - run: npx @unified-product-graph/mcp health --min-score=50
169
+ - run: npx @unified-product-graph/mcp verify --no-orphans --max-orphan-rate=0.15
170
+ - run: npx @unified-product-graph/mcp diff --since=origin/main --summary
171
+ ```
172
+
173
+ Governance commands read the `.upg` file directly. CI runs skip MCP setup.
174
+
175
+ ### Git hook (pre-commit)
176
+
177
+ ```bash
178
+ #!/bin/sh
179
+ if git diff --cached --name-only | grep -q '\.upg$'; then
180
+ npx @unified-product-graph/mcp verify --no-orphans || exit 1
181
+ fi
182
+ ```
183
+
184
+ ### Exit codes
185
+
186
+ | Code | Meaning |
187
+ |------|---------|
188
+ | 0 | Success / pass |
189
+ | 1 | Failure / below threshold / violations found |
190
+ | 2 | Error (file not found, invalid JSON, etc.) |
191
+
192
+ ## Output formats
193
+
194
+ `--json` works on most commands:
195
+
196
+ ```bash
197
+ upg health --json
198
+ upg list --type persona --json
199
+ upg diff --since=main --json
200
+ upg gaps --json
201
+ ```
202
+
203
+ Badge for README:
204
+
205
+ ```bash
206
+ upg health --format=badge
207
+ # → ![UPG Health](https://img.shields.io/badge/UPG_Health-62%25-yellow)
208
+ ```
209
+
210
+ ## File discovery
211
+
212
+ The CLI resolves the `.upg` file in 5 steps:
213
+
214
+ 1. `--file <path>` flag.
215
+ 2. `.upg/workspace.json` → default product.
216
+ 3. `.upg/` directory with `.upg` files → auto-creates `workspace.json`.
217
+ 4. `*.upg` files in the current directory.
218
+ 5. Falls through to `upg init` suggestion.
219
+
220
+ ## Authentication
221
+
222
+ Cloud commands (`push`, `pull`, `products`) need credentials:
223
+
224
+ ```bash
225
+ # Browser OAuth (opens login page, receives key via callback)
226
+ upg login
227
+
228
+ # Manual API key
229
+ upg login --key upg_YOUR_KEY
230
+
231
+ # Environment variable (for CI)
232
+ UPG_API_KEY=xxx upg push
233
+ ```
234
+
235
+ Credentials live in `~/.upg/credentials.json` at 0600.
236
+
237
+ ## Positioning
238
+
239
+ `@unified-product-graph/mcp` ships the **UPG open standard** (MIT). The CLI runs offline against `.upg` files; cloud commands connect to UPG cloud. `git` (open tool) → hosted Git provider (product).
240
+
241
+ ## Contributing
242
+
243
+ See [CONTRIBUTING.md](./CONTRIBUTING.md).
244
+
245
+ ## License
246
+
247
+ MIT