@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
@@ -0,0 +1,231 @@
1
+ ---
2
+ name: upg-schema-changelog
3
+ description: "Generate a schema changelog — what changed between versions, migration notes, breaking changes"
4
+ user-invocable: false
5
+ audience: advanced
6
+ argument-hint: "[from_version] [to_version] or 'latest'"
7
+ category: schema
8
+ ---
9
+
10
+ > ⚠️ **Advanced skill** — intended for UPG contributors and power users who understand the spec internals. Not for general use. Running mutation skills (schema-update, schema-consolidate, schema-evolve) without understanding the cascade can corrupt your graph.
11
+
12
+ # /upg-schema-changelog — Schema Changelog Generator
13
+
14
+ You are a schema changelog generator. Your job is to diff the UPG schema between versions and produce a human-readable changelog that tells adopters what changed, why, and how to migrate.
15
+
16
+ **This is an internal development skill for schema governance and external communication.**
17
+
18
+ ## When to Use
19
+
20
+ - After a batch of schema changes — before cutting a release
21
+ - When preparing documentation for external adopters
22
+ - When someone asks "what changed in v0.2.0?"
23
+ - Before merging a PR that touches `packages/upg-spec/src/`
24
+
25
+ ## Input Modes
26
+
27
+ **Mode 1: Diff against git**
28
+ ```
29
+ /upg-schema-changelog latest
30
+ ```
31
+ Compares current working state against the last tagged version.
32
+
33
+ **Mode 2: Between specific versions**
34
+ ```
35
+ /upg-schema-changelog 0.1.0 0.2.0
36
+ ```
37
+
38
+ **Mode 3: Current PR changes**
39
+ ```
40
+ /upg-schema-changelog pr
41
+ ```
42
+ Compares current branch against `origin/dev`.
43
+
44
+ ## Data Sources
45
+
46
+ ### Entity Types
47
+ ```bash
48
+ # Current state
49
+ grep "name:" packages/upg-spec/src/registry/entity-meta.ts
50
+
51
+ # Previous state (from git)
52
+ git show origin/dev:packages/upg-spec/src/registry/entity-meta.ts | grep "name:"
53
+ ```
54
+
55
+ ### Edge Types
56
+ ```bash
57
+ # Current edge catalog entries
58
+ grep -cE "^ [a-z_]+: \{" packages/upg-spec/src/catalog/edge-catalog.ts
59
+ git show origin/dev:packages/upg-spec/src/catalog/edge-catalog.ts | grep -cE "^ [a-z_]+: \{"
60
+ ```
61
+
62
+ ### Properties
63
+ ```bash
64
+ # Current property interfaces
65
+ grep "export interface.*Properties" packages/upg-spec/src/properties/domains/*.ts
66
+ ```
67
+
68
+ ### UPGEdge / UPGBaseNode
69
+ ```bash
70
+ # Check for structural shape changes
71
+ git diff origin/dev -- packages/upg-spec/src/shapes/
72
+ ```
73
+
74
+ ## Analysis Steps
75
+
76
+ ### Step 1: Diff Entity Types
77
+
78
+ Compare `entity-meta.ts` between versions:
79
+
80
+ **Added types:** New entries (new `type_id` values)
81
+ **Deprecated types:** Entries where `maturity` changed to `'deprecated'`
82
+ **Removed types:** Entries where `maturity` changed to `'removed'`
83
+ **Renamed types:** Entries where `name` changed but `type_id` stayed the same
84
+
85
+ ### Step 2: Diff Edge Types
86
+
87
+ Compare the `UPG_EDGE_CATALOG` in `catalog/edge-catalog.ts` (and the derived `UPG_EDGE_PAIR_MAP`):
88
+
89
+ **Added edges:** New key-value pairs
90
+ **Removed edges:** Pairs that existed before but don't now
91
+ **Renamed edges:** Same key, different value (semantic rename)
92
+
93
+ ### Step 3: Diff Properties
94
+
95
+ Compare property interfaces in `properties/*.ts`:
96
+
97
+ **New interfaces:** New `export interface XxxProperties`
98
+ **Modified interfaces:** Changed fields in existing interfaces
99
+ **New base fields:** Changes to `UPGBaseNode` or `UPGEdge` in `schema.ts` / `types.ts`
100
+
101
+ ### Step 4: Diff Domains
102
+
103
+ Compare `domains.ts`:
104
+
105
+ **New domains:** New entries in `UPG_DOMAINS`
106
+ **Modified domains:** Types added or removed from existing domains
107
+ **Domain renames:** Same types, different domain id/label
108
+
109
+ ### Step 5: Classify Changes
110
+
111
+ For each change, classify as:
112
+
113
+ | Classification | Meaning | Migration impact |
114
+ |----------------|---------|-----------------|
115
+ | **Additive** | New types, edges, properties, or domains | None — old files still valid |
116
+ | **Deprecation** | Type marked deprecated with replacement | Warn on load, auto-migrate if possible |
117
+ | **Breaking** | Type removed, property renamed, edge direction changed | Old files need migration |
118
+ | **Enhancement** | New optional fields on existing interfaces | None — backwards compatible |
119
+
120
+ ## Output Format
121
+
122
+ Generate a markdown changelog:
123
+
124
+ ```markdown
125
+ # UPG Schema Changelog
126
+
127
+ ## [0.2.0] — YYYY-MM-DD
128
+
129
+ ### Summary
130
+ One paragraph describing the theme of this release (e.g., "Engineering lens support —
131
+ four new entity types for debugging workflows, causal edge vocabulary, and edge confidence.")
132
+
133
+ ### Added
134
+
135
+ #### Entity Types
136
+ - `investigation` (Engineering) — Active thread of inquiry for debugging and architecture exploration
137
+ - `root_cause` (Engineering) — Underlying architectural or systemic issue
138
+ - `symptom` (Engineering) — Observable behavior produced by a root cause
139
+ - `fix` (Engineering) — Specific change that resolved an issue
140
+ - (Note: v0.2.0 consolidated `design_decision`, `architecture_decision`, and `product_decision` into the single `decision` type with a `layer` property — see 0.2.0 migration entry.)
141
+
142
+ #### Edge Types
143
+ - `causes` — root_cause → symptom/bug (causal production)
144
+ - `revealed_by` — investigation/fix → bug/root_cause (discovery)
145
+ - `same_root_cause` — symptom ↔ symptom (shared cause)
146
+ - `subsumes` — root_cause → bug (architectural fix eliminates quick-fix)
147
+ - `affects` — bug/root_cause → service/feature (impact)
148
+ - `screen_implements_feature` — screen → feature (design-to-spec bridge)
149
+ [... and others]
150
+
151
+ #### Properties
152
+ - `InvestigationProperties` — investigation_status, hypothesis, findings, session_id, category
153
+ - `RootCauseProperties` — severity, category, affected_area, verified
154
+ - `SymptomProperties` — reproducibility, frequency, steps_to_reproduce
155
+ - `FixProperties` — commit, files_changed, verified, fixed_date
156
+ - `DecisionProperties` — layer ('engineering' | 'design' | 'product'), status, context, decision, consequences
157
+
158
+ #### Edge Interface
159
+ - `UPGEdge.confidence` — Optional causal confidence: `'verified' | 'likely' | 'speculative'`
160
+ - `UPGEdge.note` — Optional note explaining why this relationship exists
161
+
162
+ ### Changed
163
+ - Engineering domain expanded from 22 to 26 entity types
164
+ - Design domain expanded from 21 to 22 entity types
165
+
166
+ ### Deprecated
167
+ (none in this release)
168
+
169
+ ### Breaking Changes
170
+ (none in this release)
171
+
172
+ ### Migration Guide
173
+ No migration needed — all changes are additive. Existing .upg files are fully compatible.
174
+ Old tools that don't recognise new types will preserve them as opaque nodes (type stored as string).
175
+
176
+ ### Cascade Status
177
+ | Layer | Status |
178
+ |-------|--------|
179
+ | @unified-product-graph/core | ✅ Updated |
180
+ | upg-mcp-server | ✅ Updated (lens-aware context) |
181
+ | apps/graph | ✅ Updated (all registries) |
182
+ | upg-cloud-server | 🟡 Edge confidence/note not persisted yet |
183
+ | apps/upg-site | ⏸️ Docs update deferred |
184
+ ```
185
+
186
+ ## Where to Save
187
+
188
+ Save the changelog in two places:
189
+
190
+ 1. **`packages/upg-spec/CHANGELOG.md`** — Cumulative, all versions. Append new version at the top.
191
+ 2. **PR description** — Include the summary section in the PR body for review.
192
+
193
+ If the file doesn't exist yet, create it with a header:
194
+
195
+ ```markdown
196
+ # UPG Schema Changelog
197
+
198
+ All notable changes to the UPG specification are documented in this file.
199
+ Format follows [Keep a Changelog](https://keepachangelog.com/).
200
+
201
+ ---
202
+ ```
203
+
204
+ ## Automation Hooks
205
+
206
+ ### Pre-release Check
207
+
208
+ Before tagging a release, run this skill to ensure the changelog is up to date:
209
+
210
+ ```bash
211
+ # Compare current vs last tag
212
+ git diff $(git describe --tags --abbrev=0) -- packages/upg-spec/src/
213
+ ```
214
+
215
+ If there are schema changes not reflected in CHANGELOG.md, flag them.
216
+
217
+ ### PR Template Integration
218
+
219
+ When a PR touches `packages/upg-spec/src/`, the changelog section should be included in the PR description. The skill can generate this automatically.
220
+
221
+ ## Key Principles
222
+
223
+ - **Theme over list.** Start with a one-paragraph summary that tells the story ("Engineering lens support"), not just a list of changes.
224
+ - **Migration is the most important section.** External adopters care most about "will my files break?"
225
+ - **Cascade status shows completeness.** A schema change isn't done until all layers are updated.
226
+ - **Additive changes are safe.** Any change that only adds new types, edges, or optional properties is backwards compatible. Say so explicitly.
227
+ - **Breaking changes need a migration guide.** Step-by-step instructions, not just "things changed."
228
+ - **Keep it diffable.** The changelog should itself be git-friendly. Each version is a section with clear headers.
229
+
230
+ ---
231
+ Internal development skill for UPG schema governance.
@@ -0,0 +1,243 @@
1
+ ---
2
+ name: upg-schema-consolidate
3
+ description: "Evaluate whether entity types should merge — shared properties, structural analysis, migration path"
4
+ user-invocable: false
5
+ audience: advanced
6
+ argument-hint: "[type_a] [type_b] or [domain]"
7
+ category: schema
8
+ ---
9
+
10
+ > ⚠️ **Advanced skill** — intended for UPG contributors and power users who understand the spec internals. Not for general use. Running mutation skills (schema-update, schema-consolidate, schema-evolve) without understanding the cascade can corrupt your graph.
11
+
12
+ # /upg-schema-consolidate — Entity Type Consolidation
13
+
14
+ You are a schema analyst. Your job is to evaluate whether two or more entity types should be consolidated into a single type with a discriminator property, or kept separate. You do this through structured analysis — not gut feeling.
15
+
16
+ **This is an internal development skill for schema governance.**
17
+
18
+ ## When to Use
19
+
20
+ - Someone notices two types that "feel the same" (e.g., `architecture_decision` and `design_decision`)
21
+ - Schema review reveals types with >70% property overlap
22
+ - User feedback suggests confusion between similar types
23
+ - Domain audit surfaces redundancy
24
+ - Before adding a new type that resembles an existing one
25
+
26
+ ## Input Modes
27
+
28
+ **Mode 1: Compare specific types**
29
+ ```
30
+ /upg-schema-consolidate architecture_decision design_decision
31
+ ```
32
+
33
+ **Mode 2: Scan a domain for candidates**
34
+ ```
35
+ /upg-schema-consolidate engineering
36
+ ```
37
+
38
+ ## Analysis Framework
39
+
40
+ ### Step 1: Property Overlap Analysis
41
+
42
+ Read the property interfaces from `packages/upg-spec/src/properties/`. Compare field by field:
43
+
44
+ ```
45
+ ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
46
+ PROPERTY OVERLAP: [type_a] vs [type_b]
47
+
48
+ | Property | type_a | type_b | Shared? |
49
+ |----------|--------|--------|---------|
50
+ | status | ✓ (proposed/accepted/deprecated/superseded) | ✓ (proposed/accepted/deprecated/superseded) | ✓ identical |
51
+ | context | ✓ string | ✓ string | ✓ identical |
52
+ | severity | ✓ UPGAssessment | ✗ | ✗ |
53
+
54
+ Overlap: X/Y properties shared (Z%)
55
+ ```
56
+
57
+ **Threshold:** >70% overlap = consolidation candidate. <40% = keep separate. 40-70% = needs deeper analysis.
58
+
59
+ ### Step 2: Structural Position Analysis
60
+
61
+ This is the critical test. Check 4 structural dimensions:
62
+
63
+ **2a. Parent types** — Do they have the same canonical parent?
64
+ ```
65
+ Read UPG_VALID_CHILDREN in grammar/hierarchy.ts
66
+ - type_a parent: bounded_context
67
+ - type_b parent: design_system
68
+ → DIFFERENT parents = structural divergence
69
+ ```
70
+
71
+ **2b. Child types** — Do they have the same children?
72
+ ```
73
+ Search UPG_VALID_CHILDREN for entries where value = type_a or type_b
74
+ - type_a children: technical_debt_item
75
+ - type_b children: (none)
76
+ → DIFFERENT children = structural divergence
77
+ ```
78
+
79
+ **2c. Edge types** — Do they participate in the same relationships?
80
+ ```
81
+ Search UPG_EDGE_CATALOG in catalog/edge-catalog.ts for both types
82
+ - type_a edges: context_has_decision, decision_has_technical_debt_item
83
+ - type_b edges: decision_informs_decision, decision_affects_component
84
+ → DIFFERENT edges = semantic divergence
85
+ ```
86
+
87
+ **2d. Domain membership** — Are they in the same domain?
88
+ ```
89
+ Check registry/domains.ts
90
+ - type_a: engineering
91
+ - type_b: design
92
+ → DIFFERENT domains = role divergence
93
+ ```
94
+
95
+ **Score the structural analysis:**
96
+ - 4/4 same → Strong consolidation candidate
97
+ - 3/4 same → Likely consolidation candidate
98
+ - 2/4 same → Probably keep separate, but discuss
99
+ - 0-1/4 same → Keep separate
100
+
101
+ ### Step 3: Usage Context Analysis
102
+
103
+ Check how each type is used in practice:
104
+
105
+ **3a. Skill references** — Which skills create/reference each type?
106
+ ```
107
+ grep -r "type_a\|type_b" packages/upg-mcp-server/skills/
108
+ ```
109
+
110
+ **3b. Lens relevance** — Do they appear in different lenses?
111
+ If type_a is surfaced in the engineering lens and type_b in the design lens, consolidation would muddy lens clarity.
112
+
113
+ **3c. Real-world mental models** — Would users think of these as "the same thing with a label" or "fundamentally different activities"?
114
+
115
+ This is where you engage the human. Ask:
116
+
117
+ > When you think about [type_a] and [type_b], do they feel like:
118
+ > 1. The same thing in different contexts (like "meeting" whether it's a standup or a retro)
119
+ > 2. Related but distinct activities (like "writing" vs "editing")
120
+ > 3. Completely different things that happen to share some fields
121
+
122
+ ### Step 4: Consolidation Decision
123
+
124
+ Present the verdict as a structured recommendation:
125
+
126
+ ```
127
+ ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
128
+ VERDICT: [CONSOLIDATE | KEEP SEPARATE | NEEDS DISCUSSION]
129
+
130
+ Property overlap: X% [HIGH/MEDIUM/LOW]
131
+ Structural alignment: Y/4 [ALIGNED/DIVERGENT]
132
+ Usage context: [SAME/DIFFERENT]
133
+
134
+ Recommendation: [explanation]
135
+ ```
136
+
137
+ ### Step 5: If Consolidating — Migration Design
138
+
139
+ If the decision is to consolidate:
140
+
141
+ **5a. Define the unified type:**
142
+ ```
143
+ Unified type: decision
144
+ Discriminator: layer: 'engineering' | 'design' | 'product'
145
+ Properties: union of both property sets
146
+ - Shared properties remain as-is
147
+ - Type-specific properties become optional (only relevant when discriminator matches)
148
+ ```
149
+
150
+ **5b. Define the migration:**
151
+ ```
152
+ Deprecated types: architecture_decision → decision (layer: 'engineering')
153
+ design_decision → decision (layer: 'design')
154
+ product_decision → decision (layer: 'product')
155
+
156
+ Edge migrations (v0.2.0):
157
+ context_has_architecture_decision → context_has_decision
158
+ design_decision_informs_architecture_decision → decision_informs_decision
159
+
160
+ Parent migration:
161
+ architecture_decision parent=bounded_context → decision parent=bounded_context (when layer='engineering')
162
+ design_decision parent=design_system → decision parent=design_system (when layer='design')
163
+ ```
164
+
165
+ **5c. Backwards compatibility:**
166
+ - Old types stay in `DeprecatedUPGEntityType` in types.ts
167
+ - `entity-meta.ts` marks them as `deprecated` with `replacement: 'decision'`
168
+ - `upg-migrate` skill handles the retyping
169
+ - Old `.upg` files with `architecture_decision` still parse and auto-migrate
170
+
171
+ **5d. Cascade the change** using `/upg-schema-update`
172
+
173
+ ### Step 5 (Alternative): If Keeping Separate — Document Why
174
+
175
+ If the decision is to keep separate, create a brief decision record:
176
+
177
+ ```
178
+ ## Schema Decision: [type_a] vs [type_b]
179
+
180
+ **Date:** YYYY-MM-DD
181
+ **Decision:** Keep separate
182
+ **Why:** [structural divergence explanation]
183
+ **Revisit when:** [conditions that would change this decision]
184
+ ```
185
+
186
+ Save to a decisions log in your project (wherever your team keeps ADRs) for future reference.
187
+
188
+ ## Domain Scan Mode
189
+
190
+ When called with a domain name instead of specific types:
191
+
192
+ 1. List all types in the domain (from `domains.ts`)
193
+ 2. For each pair, compute property overlap percentage
194
+ 3. Flag pairs with >60% overlap as candidates
195
+ 4. Present a summary table:
196
+
197
+ ```
198
+ CONSOLIDATION CANDIDATES IN [DOMAIN]
199
+
200
+ | Pair | Overlap | Parents | Verdict |
201
+ |------|---------|---------|---------|
202
+ | type_a ↔ type_b | 85% | Same | 🟡 Review |
203
+ | type_c ↔ type_d | 45% | Different | ✅ Keep |
204
+ | type_e ↔ type_f | 92% | Same | 🔴 Consolidate |
205
+ ```
206
+
207
+ Then deep-dive into any pair the user wants to investigate.
208
+
209
+ ## Known Consolidation Precedents
210
+
211
+ These consolidations have already happened in UPG and can be referenced as patterns:
212
+
213
+ | Old Types | Unified As | Discriminator | Version |
214
+ |-----------|-----------|---------------|---------|
215
+ | `pain_point`, `user_need` | `need` | `valence: 'pain' \| 'gap' \| 'desire' \| 'constraint'` | 0.1.0 |
216
+ | `north_star_metric`, `input_metric`, `kpi`, `metric_definition` | `metric` | `designation` property | 0.1.0 |
217
+ | `research_insight`, `finding`, `ux_insight` | `insight` | `source_domain` / `insight_level` | 0.1.0 |
218
+ | `ab_test`, `growth_experiment`, `pricing_experiment` | `experiment` | `experiment_type` | 0.1.0 |
219
+ | `security_incident` | `incident` | `incident_type: 'security'` | 0.1.0 |
220
+ | `defect_report` | `support_ticket` | `ticket_designation: 'defect'` | 0.1.0 |
221
+ | `onboarding_flow` | `user_flow` | `flow_type: 'onboarding'` | 0.1.0 |
222
+ | `risk_item` | `risk` | `risk_domain: 'program'` | 0.1.0 |
223
+ | `architecture_decision`, `design_decision`, `product_decision` | `decision` | `layer: 'engineering' \| 'design' \| 'product'` | 0.2.0 |
224
+ | `jtbd` | `job` | (renamed, no discriminator) | 0.2.0 |
225
+ | `how_might_we` | `design_question` | (renamed — framework-neutral) | 0.2.0 |
226
+ | `sli`, `slo`, `sla` | `service_level_indicator`, `service_level_objective`, `service_level_agreement` | (acronyms expanded) | 0.2.0 |
227
+ | `customer_segment_bm`, `target_customer_segment` | `market_segment` | — | 0.2.0 |
228
+ | `channel_bm` | `distribution_channel` | — | 0.2.0 |
229
+ | `campaign` | `growth_campaign` | (disambiguated from marketing_campaign_plan) | 0.2.0 |
230
+ | `segment` | `behavioral_segment` | (disambiguated from market_segment) | 0.2.0 |
231
+ | `package` | `pricing_tier` | — | 0.2.0 |
232
+ | `internal_doc` | `document` | `document_type` — audience=internal | 0.2.0 |
233
+
234
+ ## Key Principles
235
+
236
+ - **Structure trumps semantics.** Two types with the same name but different parents, children, and edges are genuinely different. Two types with different names but identical structural positions should merge.
237
+ - **The discriminator must be a property, not a tag.** Tags are freeform; properties are typed. Use an enum property (e.g., `decision_domain: 'architecture' | 'design'`).
238
+ - **Migration is non-negotiable.** Every consolidation must preserve existing data. Old types become deprecated, not deleted.
239
+ - **Ask the user.** The mental model test (Step 3c) can't be automated. Engage.
240
+ - **Document the decision either way.** Whether you consolidate or keep separate, record why.
241
+
242
+ ---
243
+ Internal development skill for UPG schema governance.