@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.
- package/CHANGELOG.md +24 -0
- package/LICENSE +21 -0
- package/README.md +247 -0
- package/dist/cli.cjs +141010 -0
- package/package.json +65 -0
- package/skills/README.md +10 -0
- package/skills/upg/SKILL.md +245 -0
- package/skills/upg-analytics/SKILL.md +135 -0
- package/skills/upg-capture/SKILL.md +274 -0
- package/skills/upg-connect/SKILL.md +167 -0
- package/skills/upg-context/SKILL.md +506 -0
- package/skills/upg-context-intelligence/SKILL.md +227 -0
- package/skills/upg-design-system/SKILL.md +265 -0
- package/skills/upg-diff/SKILL.md +150 -0
- package/skills/upg-discover/SKILL.md +290 -0
- package/skills/upg-explore/SKILL-DETAIL.md +481 -0
- package/skills/upg-explore/SKILL.md +297 -0
- package/skills/upg-export/SKILL.md +385 -0
- package/skills/upg-feedback/SKILL.md +141 -0
- package/skills/upg-gaps/SKILL.md +376 -0
- package/skills/upg-hypothesis/SKILL.md +190 -0
- package/skills/upg-impact/SKILL.md +229 -0
- package/skills/upg-import/SKILL.md +189 -0
- package/skills/upg-init/SKILL.md +410 -0
- package/skills/upg-inspect/SKILL.md +167 -0
- package/skills/upg-journey/SKILL.md +207 -0
- package/skills/upg-launch/SKILL-DETAIL.md +392 -0
- package/skills/upg-launch/SKILL.md +141 -0
- package/skills/upg-migrate/SKILL.md +146 -0
- package/skills/upg-okr/SKILL-DETAIL.md +351 -0
- package/skills/upg-okr/SKILL.md +88 -0
- package/skills/upg-persona/SKILL.md +230 -0
- package/skills/upg-prioritise/SKILL.md +195 -0
- package/skills/upg-pull/SKILL-DETAIL.md +398 -0
- package/skills/upg-pull/SKILL.md +57 -0
- package/skills/upg-push/SKILL-DETAIL.md +385 -0
- package/skills/upg-push/SKILL.md +113 -0
- package/skills/upg-reflect/SKILL.md +201 -0
- package/skills/upg-research/SKILL.md +336 -0
- package/skills/upg-rollback/SKILL.md +163 -0
- package/skills/upg-run/SKILL.md +126 -0
- package/skills/upg-schema-changelog/SKILL.md +231 -0
- package/skills/upg-schema-consolidate/SKILL.md +243 -0
- package/skills/upg-schema-edges/SKILL.md +287 -0
- package/skills/upg-schema-evolve/SKILL.md +313 -0
- package/skills/upg-schema-health/SKILL.md +279 -0
- package/skills/upg-schema-update/SKILL.md +206 -0
- package/skills/upg-snapshot/SKILL.md +108 -0
- package/skills/upg-status/SKILL.md +340 -0
- package/skills/upg-strategy/SKILL.md +334 -0
- package/skills/upg-template/SKILL.md +145 -0
- package/skills/upg-trace/SKILL.md +197 -0
- package/skills/upg-tree/SKILL.md +233 -0
- package/skills/upg-verify/SKILL.md +223 -0
- package/skills/upg-workspace/SKILL.md +103 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: upg-schema-edges
|
|
3
|
+
description: "Edge design advisor — when to add an edge, naming, direction, edge vs hierarchy vs entity"
|
|
4
|
+
user-invocable: false
|
|
5
|
+
audience: advanced
|
|
6
|
+
argument-hint: "[source_type] [target_type] or [relationship description]"
|
|
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-edges — Edge Design Advisor
|
|
13
|
+
|
|
14
|
+
You are an edge design advisor. Your job is to help decide whether a relationship between entities should be an edge, a parent-child hierarchy link, or a relationship entity — and if it's an edge, how to name and direct it.
|
|
15
|
+
|
|
16
|
+
**This is an internal development skill for schema governance.**
|
|
17
|
+
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
- Before adding a new edge to `UPG_EDGE_CATALOG`
|
|
21
|
+
- When two entity types are clearly related but the right connection type is unclear
|
|
22
|
+
- When the edge catalog feels bloated (700+ and counting)
|
|
23
|
+
- When someone asks "should X be a child of Y, or connected by an edge?"
|
|
24
|
+
- When a relationship needs properties (confidence, weight, note)
|
|
25
|
+
|
|
26
|
+
## The Three Ways to Connect
|
|
27
|
+
|
|
28
|
+
Every relationship between entities in UPG can be expressed as one of three things. Choosing wrong creates schema debt.
|
|
29
|
+
|
|
30
|
+
### Option A: Parent-Child Hierarchy
|
|
31
|
+
|
|
32
|
+
**What it is:** One entity is structurally nested inside another. Defined by `UPG_VALID_CHILDREN` (in `grammar/hierarchy.ts`). The child can't meaningfully exist without the parent.
|
|
33
|
+
|
|
34
|
+
**When to use:**
|
|
35
|
+
- The child is a **component** of the parent (journey_step inside user_journey)
|
|
36
|
+
- The child is a **decomposition** of the parent (epic inside feature)
|
|
37
|
+
- The child's **lifecycle** is bound to the parent — delete the parent, delete the children
|
|
38
|
+
- There's a clear **containment** relationship (acceptance_criterion inside user_story)
|
|
39
|
+
|
|
40
|
+
**Test:** "Would you delete all [children] if you deleted the [parent]?"
|
|
41
|
+
- Yes → parent-child
|
|
42
|
+
- No → probably an edge
|
|
43
|
+
|
|
44
|
+
**Examples:**
|
|
45
|
+
```
|
|
46
|
+
✅ Parent-child: persona → job (a job belongs to a persona)
|
|
47
|
+
✅ Parent-child: feature → epic → user_story (decomposition)
|
|
48
|
+
✅ Parent-child: root_cause → symptom (symptoms are manifestations of the root cause)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Option B: Typed Edge
|
|
52
|
+
|
|
53
|
+
**What it is:** A semantic relationship between two independent entities. Defined in `UPG_EDGE_CATALOG` (in `catalog/edge-catalog.ts`). Both entities can exist without the other.
|
|
54
|
+
|
|
55
|
+
**When to use:**
|
|
56
|
+
- The entities are **independent** — either can exist alone
|
|
57
|
+
- The relationship is **cross-domain** (design → engineering)
|
|
58
|
+
- There are **multiple valid** relationships between the same pair (a service can both `powers` and `has_technical_debt`)
|
|
59
|
+
- The relationship is **discovery-dependent** — you might not know it exists when entities are first created
|
|
60
|
+
|
|
61
|
+
**Test:** "Can [source] and [target] each exist meaningfully on their own?"
|
|
62
|
+
- Yes → edge
|
|
63
|
+
- No → probably parent-child
|
|
64
|
+
|
|
65
|
+
**Examples:**
|
|
66
|
+
```
|
|
67
|
+
✅ Edge: debt_blocks_feature (debt and feature are independent, relationship is discovered)
|
|
68
|
+
✅ Edge: screen_implements_feature (screen and feature live in different domains)
|
|
69
|
+
✅ Edge: causes (root_cause and bug are independently created, link discovered during investigation)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Option C: Relationship Entity
|
|
73
|
+
|
|
74
|
+
**What it is:** The relationship itself is complex enough to be its own entity with properties. The "edge" becomes a node.
|
|
75
|
+
|
|
76
|
+
**When to use:**
|
|
77
|
+
- The relationship has **multiple properties** that matter (not just confidence/note)
|
|
78
|
+
- The relationship has its own **lifecycle** (it can be proposed, active, deprecated)
|
|
79
|
+
- The relationship **connects more than 2 entities** (a dependency involves a from_team, to_team, and multiple features)
|
|
80
|
+
- You need to **query the relationship itself** as a first-class thing
|
|
81
|
+
|
|
82
|
+
**Test:** "Does this relationship have properties beyond source, target, and type?"
|
|
83
|
+
- Many properties → relationship entity
|
|
84
|
+
- Just confidence/note → edge with properties
|
|
85
|
+
- Nothing → simple edge
|
|
86
|
+
|
|
87
|
+
**Examples:**
|
|
88
|
+
```
|
|
89
|
+
✅ Relationship entity: dependency (has from_team, to_team, dependency_type, resolution, status)
|
|
90
|
+
✅ Relationship entity: experiment (connects hypothesis to learning, has its own status, duration, results)
|
|
91
|
+
❌ NOT a relationship entity: screen_implements_feature (just a link, no properties needed)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Decision Flowchart
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
Does [child] belong inside [parent]?
|
|
98
|
+
├─ YES: Would deleting parent delete children?
|
|
99
|
+
│ ├─ YES → PARENT-CHILD (add to UPG_VALID_CHILDREN in grammar/hierarchy.ts)
|
|
100
|
+
│ └─ NO → EDGE (the "belonging" is soft)
|
|
101
|
+
└─ NO: Is the relationship complex?
|
|
102
|
+
├─ YES: Does it have >3 properties of its own?
|
|
103
|
+
│ ├─ YES → RELATIONSHIP ENTITY (create a new type)
|
|
104
|
+
│ └─ NO → EDGE with confidence/note
|
|
105
|
+
└─ NO → SIMPLE EDGE
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Edge Naming Convention
|
|
109
|
+
|
|
110
|
+
### Format
|
|
111
|
+
```
|
|
112
|
+
source_type:target_type → descriptive_verb_phrase
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The key in `UPG_EDGE_CATALOG` is the edge name (e.g. `'service_powers_feature'`), the value is the full edge definition (source_type, target_type, description, cardinality). The `UPG_EDGE_PAIR_MAP` provides `'source:target'` → edge key lookup.
|
|
116
|
+
|
|
117
|
+
### Naming Rules
|
|
118
|
+
|
|
119
|
+
**Rule 1: Verb-based, active voice**
|
|
120
|
+
```
|
|
121
|
+
✅ 'service:feature' → 'service_powers_feature'
|
|
122
|
+
✅ 'root_cause:bug' → 'root_cause_causes_bug'
|
|
123
|
+
❌ 'service:feature' → 'service_feature_connection' (no verb)
|
|
124
|
+
❌ 'root_cause:bug' → 'bug_caused_by_root_cause' (passive)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Rule 2: Source acts on target**
|
|
128
|
+
The source entity is the actor, the target is the receiver:
|
|
129
|
+
```
|
|
130
|
+
✅ debt_blocks_feature (debt is blocking the feature)
|
|
131
|
+
✅ fix_resolved_bug (fix resolved the bug)
|
|
132
|
+
❌ feature_blocked_by_debt (inverted — make debt the source)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Rule 3: Specific over generic**
|
|
136
|
+
```
|
|
137
|
+
✅ 'investigation:root_cause' → 'investigation_revealed_root_cause'
|
|
138
|
+
❌ 'investigation:root_cause' → 'investigation_relates_to_root_cause'
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Reserve `relates_to` for genuinely generic associations. If you can name the semantic relationship, do.
|
|
142
|
+
|
|
143
|
+
**Rule 4: Domain prefix when ambiguous**
|
|
144
|
+
If a source type appears in multiple edge pairs with the same verb, prefix with context:
|
|
145
|
+
```
|
|
146
|
+
'bounded_context:service' → 'context_has_service'
|
|
147
|
+
'bounded_context:aggregate' → 'context_has_aggregate'
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Common Verbs
|
|
151
|
+
|
|
152
|
+
| Verb | Semantics | Examples |
|
|
153
|
+
|------|-----------|---------|
|
|
154
|
+
| `has` | Containment/ownership | product_has_outcome, service_has_endpoint |
|
|
155
|
+
| `causes` | Causal production | root_cause_causes_bug |
|
|
156
|
+
| `blocks` | Prevents progress | debt_blocks_feature |
|
|
157
|
+
| `enables` | Makes possible | fix_enables_feature |
|
|
158
|
+
| `implements` | Realises a spec | screen_implements_feature, component_implements_feature |
|
|
159
|
+
| `informs` | Provides input to | decision_informs_decision (across layers) |
|
|
160
|
+
| `validates` | Tests/proves | experiment_validates_hypothesis |
|
|
161
|
+
| `produces` | Creates as output | experiment_produces_learning |
|
|
162
|
+
| `targets` | Aims at | growth_campaign_targets_behavioral_segment |
|
|
163
|
+
| `measures` | Quantifies | metric_measures_outcome |
|
|
164
|
+
| `powers` | Enables technically | service_powers_feature |
|
|
165
|
+
| `affects` | Impacts (broad) | bug_affects_feature |
|
|
166
|
+
| `revealed` | Discovered through | investigation_revealed_root_cause |
|
|
167
|
+
| `resolved` | Fixed/addressed | fix_resolved_bug |
|
|
168
|
+
| `specifies` | Defines requirements for | wireframe_specifies_screen |
|
|
169
|
+
| `subsumes` | Architectural fix eliminates | root_cause_subsumes_bug |
|
|
170
|
+
|
|
171
|
+
## Edge Direction Rules
|
|
172
|
+
|
|
173
|
+
**Rule: Source is the actor, target is the acted-upon.**
|
|
174
|
+
|
|
175
|
+
When direction is ambiguous, ask: "Which entity would you navigate FROM to find the other?"
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
"Show me what this debt blocks" → debt (source) → feature (target)
|
|
179
|
+
"Show me what caused this bug" → root_cause (source) → bug (target)
|
|
180
|
+
"Show me what this screen shows" → screen (source) → feature (target)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Exception: `has` edges always flow parent → child:**
|
|
184
|
+
```
|
|
185
|
+
product_has_outcome: product (source) → outcome (target)
|
|
186
|
+
service_has_endpoint: service (source) → api_endpoint (target)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Duplicate Detection
|
|
190
|
+
|
|
191
|
+
Before adding any edge, check if it already exists:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Check exact pair (search the edge catalog)
|
|
195
|
+
grep "source_type: 'SOURCE'" packages/upg-spec/src/catalog/edge-catalog.ts
|
|
196
|
+
|
|
197
|
+
# Check if a similar verb already exists for this source
|
|
198
|
+
grep "SOURCE_.*_TARGET" packages/upg-spec/src/catalog/edge-catalog.ts
|
|
199
|
+
|
|
200
|
+
# Or inspect the runtime pair map at build time:
|
|
201
|
+
# UPG_EDGE_PAIR_MAP['source_type:target_type'] -> edge key
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**If a pair already has an edge**, consider whether you need a second edge or if the existing one covers your semantics. Two edges between the same pair should represent genuinely different relationships:
|
|
205
|
+
```
|
|
206
|
+
✅ service:feature has both 'service_powers_feature' AND 'service_has_feature' — different semantics
|
|
207
|
+
❌ service:feature having 'service_connects_to_feature' AND 'service_links_to_feature' — same thing
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Edge Map Hygiene Audit
|
|
211
|
+
|
|
212
|
+
When called without arguments, audit the edge map for problems:
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
/upg-schema-edges
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Check 1: Orphan Edges
|
|
219
|
+
Edge types defined in the map but whose source or target type doesn't exist in the schema:
|
|
220
|
+
```
|
|
221
|
+
ORPHAN EDGES (broken type references)
|
|
222
|
+
| Edge Key | Missing Type | Action |
|
|
223
|
+
|----------|-------------|--------|
|
|
224
|
+
| 'defect_report:service' | defect_report (deprecated → support_ticket) | Remove or migrate to support_ticket |
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Check 2: Duplicate Semantics
|
|
228
|
+
Edge pairs with near-identical verb meanings:
|
|
229
|
+
```
|
|
230
|
+
DUPLICATE SEMANTICS
|
|
231
|
+
| Edge A | Edge B | Same? |
|
|
232
|
+
|--------|--------|-------|
|
|
233
|
+
| component_implements_feature | component_realizes_feature | 🔴 Likely duplicate |
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Check 3: Missing Reverse Lookups
|
|
237
|
+
Important edges that only go one direction but should be queryable both ways. Not proposing reverse edges — just flagging that queries might need to follow edges backwards:
|
|
238
|
+
```
|
|
239
|
+
ONE-WAY EDGES (consider if reverse queries are needed)
|
|
240
|
+
| Edge | Direction | Reverse query use case |
|
|
241
|
+
|------|-----------|----------------------|
|
|
242
|
+
| debt_blocks_feature | debt → feature | "What debt blocks THIS feature?" (reverse lookup needed) |
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Check 4: Coverage by Domain Pair
|
|
246
|
+
Which domain pairs have edges vs which don't:
|
|
247
|
+
```
|
|
248
|
+
CROSS-DOMAIN EDGE COVERAGE
|
|
249
|
+
|
|
250
|
+
| Source Domain | Target Domain | Edges | Status |
|
|
251
|
+
|--------------|--------------|-------|--------|
|
|
252
|
+
| Design | Engineering | 5 | ✅ |
|
|
253
|
+
| Design | Growth | 0 | 🟡 Gap? |
|
|
254
|
+
| Engineering | Growth | 0 | 🟡 Gap? |
|
|
255
|
+
| Engineering | Product Spec | 4 | ✅ |
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Output Format
|
|
259
|
+
|
|
260
|
+
When evaluating a specific relationship:
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
|
|
264
|
+
EDGE DESIGN: [source_type] → [target_type]
|
|
265
|
+
|
|
266
|
+
Connection type: [PARENT-CHILD | EDGE | RELATIONSHIP ENTITY]
|
|
267
|
+
|
|
268
|
+
Existing edges for this pair: [list or "none"]
|
|
269
|
+
Recommended name: [edge_name]
|
|
270
|
+
Direction: [source] → [target]
|
|
271
|
+
Rationale: [why this design choice]
|
|
272
|
+
|
|
273
|
+
Add to: packages/upg-spec/src/catalog/edge-catalog.ts
|
|
274
|
+
Key: '[edge_name]'
|
|
275
|
+
Value: { source_type: '[source_type]', target_type: '[target_type]', description: '...', cardinality: '...' }
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Key Principles
|
|
279
|
+
|
|
280
|
+
- **Hierarchy is structural, edges are semantic.** Parent-child says "X contains Y." Edges say "X relates to Y in this specific way."
|
|
281
|
+
- **When in doubt, prefer an edge.** Hierarchy is harder to change later. Edges can be added and removed without restructuring the graph.
|
|
282
|
+
- **800+ edges is fine if each is distinct.** The problem isn't quantity — it's duplicates, orphans, and vague naming.
|
|
283
|
+
- **Direction matters for queries.** Think about how users will traverse: "show me what blocks this feature" requires debt → feature, not feature → debt.
|
|
284
|
+
- **Edges are cheap, relationship entities are expensive.** Only create a relationship entity when the relationship itself has a lifecycle and multiple properties.
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
Internal development skill for UPG schema governance.
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: upg-schema-evolve
|
|
3
|
+
description: "Domain deep-dive — audit entity coverage, surface gaps, design new types from real needs"
|
|
4
|
+
user-invocable: false
|
|
5
|
+
audience: advanced
|
|
6
|
+
argument-hint: "[domain] or [feedback/requirement description]"
|
|
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-evolve — Schema Evolution Through Domain Analysis
|
|
13
|
+
|
|
14
|
+
You are a schema evolution advisor. Your job is to help the UPG schema grow thoughtfully — not by adding types speculatively, but by analysing real domains, real user feedback, and real cross-domain requirements to determine what's genuinely missing.
|
|
15
|
+
|
|
16
|
+
**This is an internal development skill for schema governance.**
|
|
17
|
+
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
- Zooming into a domain to audit its completeness (e.g., "does our engineering domain cover debugging workflows?")
|
|
21
|
+
- User feedback reveals a concept that doesn't map to any existing type
|
|
22
|
+
- A new use case surfaces that existing types can't model
|
|
23
|
+
- Cross-domain requirements emerge (e.g., "design handoff to engineering needs a bridge entity")
|
|
24
|
+
- Before a batch of new types — to think first, add second
|
|
25
|
+
|
|
26
|
+
## Input Modes
|
|
27
|
+
|
|
28
|
+
**Mode 1: Domain audit**
|
|
29
|
+
```
|
|
30
|
+
/upg-schema-evolve engineering
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Mode 2: Requirement-driven**
|
|
34
|
+
```
|
|
35
|
+
/upg-schema-evolve "Felix needs to track debugging sessions and how bugs relate to root causes"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Mode 3: Cross-domain analysis**
|
|
39
|
+
```
|
|
40
|
+
/upg-schema-evolve design engineering
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Phase 1: Domain Audit
|
|
44
|
+
|
|
45
|
+
### 1a. Inventory Current State
|
|
46
|
+
|
|
47
|
+
Read the domain from `packages/upg-spec/src/domains.ts` and list all entity types. For each, check:
|
|
48
|
+
- Does it have a property interface? (`properties/*.ts`)
|
|
49
|
+
- What edges connect it to other types? (`index.ts`)
|
|
50
|
+
- Is it used in any skills? (`skills/`)
|
|
51
|
+
- Is it registered in `apps/graph`? (`entity-metadata.ts`)
|
|
52
|
+
|
|
53
|
+
Present as a domain health table:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
|
|
57
|
+
DOMAIN AUDIT: [Domain Name]
|
|
58
|
+
|
|
59
|
+
| Entity Type | Properties | Edges | Skills | Graph UI | Status |
|
|
60
|
+
|-------------|-----------|-------|--------|----------|--------|
|
|
61
|
+
| service | ✓ ServiceProperties | 12 edges | `/upg-explore engineering` | ✓ | ✅ Complete |
|
|
62
|
+
| deployment | ✓ DeploymentProperties | 4 edges | (none) | ✓ | 🟡 No skill |
|
|
63
|
+
| data_flow | ✓ DataFlowProperties | 3 edges | (none) | ✓ | 🟡 No skill |
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 1b. Coverage Map
|
|
67
|
+
|
|
68
|
+
Map the domain against the real-world activities it should support. Use industry frameworks as reference:
|
|
69
|
+
|
|
70
|
+
**Engineering domain reference activities:**
|
|
71
|
+
- Architecture design (bounded_context, service, decision with `layer: "engineering"` ✓)
|
|
72
|
+
- Implementation (feature, epic, user_story, task ✓)
|
|
73
|
+
- Debugging & troubleshooting (investigation, root_cause, symptom, fix ✓)
|
|
74
|
+
- Deployment & operations (deployment, feature_flag ✓)
|
|
75
|
+
- Technical debt management (technical_debt_item ✓)
|
|
76
|
+
- Code management (code_repository, library_dependency ✓)
|
|
77
|
+
- API design (api_contract, api_endpoint ✓)
|
|
78
|
+
- Data modelling (database_schema, data_flow ✓)
|
|
79
|
+
- Testing (→ qa_testing domain)
|
|
80
|
+
- Security (→ security domain)
|
|
81
|
+
- Observability & monitoring (→ devops domain)
|
|
82
|
+
- Performance (? — gap?)
|
|
83
|
+
- Documentation (? — partial, documentation_template in content domain)
|
|
84
|
+
|
|
85
|
+
**Design domain reference activities:**
|
|
86
|
+
- User research (→ ux_research domain)
|
|
87
|
+
- Journey mapping (user_journey, journey_step ✓)
|
|
88
|
+
- Information architecture (screen, user_flow ✓)
|
|
89
|
+
- Visual design (design_component, design_token, brand_* ✓)
|
|
90
|
+
- Prototyping (prototype, wireframe ✓)
|
|
91
|
+
- Design systems (design_system ✓)
|
|
92
|
+
- Design governance (decision with `layer: "design"` ✓)
|
|
93
|
+
- Interaction design (interaction_spec ✓)
|
|
94
|
+
- Accessibility (→ accessibility domain)
|
|
95
|
+
- Content design (→ content domain)
|
|
96
|
+
- Handoff to engineering (? — gap? screen_implements_feature edge exists but no handoff entity)
|
|
97
|
+
|
|
98
|
+
Present gaps as opportunities:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
COVERAGE GAPS
|
|
102
|
+
|
|
103
|
+
| Activity | Current Coverage | Gap | Severity |
|
|
104
|
+
|----------|-----------------|-----|----------|
|
|
105
|
+
| Performance | No entity type | performance_issue? benchmark? | 🟡 Medium |
|
|
106
|
+
| Design handoff | Edge only (screen→feature) | handoff_checklist? design_spec? | 🟡 Medium |
|
|
107
|
+
| Code review | No entity type | Covered by task? Or needs code_review? | ⚪ Low |
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 1c. Discuss Each Gap
|
|
111
|
+
|
|
112
|
+
For each gap, don't immediately propose a new type. Ask these questions:
|
|
113
|
+
|
|
114
|
+
1. **Can an existing type model this?** (e.g., "performance issue" could be a `bug` with `bug_severity: 'performance'`)
|
|
115
|
+
2. **Is this a property or a type?** If it's a variant of something existing, it's a property. If it has unique parent-child relationships and edges, it's a type.
|
|
116
|
+
3. **Who asked for this?** Real user need → worth adding. Speculative completeness → defer.
|
|
117
|
+
4. **How often would this be created?** Types that would have 0-1 instances in most graphs probably aren't worth the schema overhead.
|
|
118
|
+
|
|
119
|
+
Present the analysis:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
GAP: Performance tracking
|
|
123
|
+
|
|
124
|
+
Option A: New type `performance_benchmark`
|
|
125
|
+
+ Has unique properties (target_metric, current_value, threshold)
|
|
126
|
+
+ Would parent to service or api_endpoint
|
|
127
|
+
+ Edge: benchmark_measures_endpoint
|
|
128
|
+
- Only 1-2 instances per service — low cardinality
|
|
129
|
+
- Overlaps with `metric` (which already has value tracking)
|
|
130
|
+
|
|
131
|
+
Option B: Use `metric` with tag `performance`
|
|
132
|
+
+ No schema change needed
|
|
133
|
+
+ Works today
|
|
134
|
+
- Loses the parent-child relationship to service
|
|
135
|
+
- No structured properties for threshold/SLA
|
|
136
|
+
|
|
137
|
+
→ RECOMMENDATION: [A or B or defer], because [reason]
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Phase 2: Cross-Domain Analysis
|
|
141
|
+
|
|
142
|
+
When two domains are specified, analyse their boundary:
|
|
143
|
+
|
|
144
|
+
### 2a. Current Bridges
|
|
145
|
+
|
|
146
|
+
Find all edges that connect entity types across the two domains:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
CROSS-DOMAIN BRIDGES: Design ↔ Engineering
|
|
150
|
+
|
|
151
|
+
| Edge | Source (Design) | Target (Engineering) | Purpose |
|
|
152
|
+
|------|----------------|---------------------|---------|
|
|
153
|
+
| component_implements_feature | design_component | feature | Design → Spec |
|
|
154
|
+
| screen_uses_feature | screen | feature | Design → Spec |
|
|
155
|
+
| decision_informs_decision (across layers) | decision (layer: design) | decision (layer: engineering) | Design → Engineering |
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 2b. Missing Bridges
|
|
159
|
+
|
|
160
|
+
Identify activities that cross the boundary but have no edge:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
MISSING BRIDGES
|
|
164
|
+
|
|
165
|
+
| Activity | From | To | Proposed Edge |
|
|
166
|
+
|----------|------|-----|--------------|
|
|
167
|
+
| Design handoff | wireframe | task | wireframe_becomes_task? |
|
|
168
|
+
| Component to service mapping | design_component | service | component_uses_service ✓ (exists) |
|
|
169
|
+
| Design token to code | design_token | code_repository | token_implemented_in_repo? |
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### 2c. Bridging Entity Candidates
|
|
173
|
+
|
|
174
|
+
Sometimes the gap isn't an edge — it's a missing entity that lives at the boundary:
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
BOUNDARY ENTITY CANDIDATES
|
|
178
|
+
|
|
179
|
+
| Concept | Domains | Why it might be needed |
|
|
180
|
+
|---------|---------|----------------------|
|
|
181
|
+
| design_spec | Design + Engineering | A formalised handoff artifact with measurements, states, interactions |
|
|
182
|
+
| tech_requirement | Engineering + Product Spec | A non-functional requirement (performance, security, scalability) |
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
For each candidate, apply the same analysis as Phase 1c: can existing types cover it, or is a new type genuinely needed?
|
|
186
|
+
|
|
187
|
+
## Phase 3: Requirement-Driven Evolution
|
|
188
|
+
|
|
189
|
+
When called with a specific requirement or feedback:
|
|
190
|
+
|
|
191
|
+
### 3a. Extract Concepts
|
|
192
|
+
|
|
193
|
+
Parse the requirement for nouns that might be entity types and verbs that might be edge types:
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
Requirement: "Felix needs to track debugging sessions and how bugs relate to root causes"
|
|
197
|
+
|
|
198
|
+
Nouns (potential types): debugging session, bug, root cause
|
|
199
|
+
Verbs (potential edges): track, relate to
|
|
200
|
+
|
|
201
|
+
Mapping to existing types:
|
|
202
|
+
- debugging session → investigation (exists)
|
|
203
|
+
- bug → bug (exists)
|
|
204
|
+
- root cause → root_cause (exists)
|
|
205
|
+
- relate to → causes, revealed_by (exist)
|
|
206
|
+
|
|
207
|
+
→ FULLY COVERED by existing schema. No new types needed.
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
If NOT covered:
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
Requirement: "Users want to track their design system adoption across teams"
|
|
214
|
+
|
|
215
|
+
Nouns: design system adoption, team
|
|
216
|
+
Verbs: track, adopt
|
|
217
|
+
|
|
218
|
+
Mapping:
|
|
219
|
+
- design system → design_system (exists)
|
|
220
|
+
- team → team (exists)
|
|
221
|
+
- adoption → ? (no entity type)
|
|
222
|
+
- track adoption → ? (no edge type)
|
|
223
|
+
|
|
224
|
+
Gap: "adoption" is a measurable relationship between a team and a design system.
|
|
225
|
+
|
|
226
|
+
Options:
|
|
227
|
+
A) New type: adoption_metric (properties: team_id, design_system_id, adoption_rate, last_measured)
|
|
228
|
+
B) Edge with properties: team_adopts_design_system (with adoption_rate on the edge)
|
|
229
|
+
C) Use metric type with tags: metric { tags: ['adoption'], linked to team + design_system }
|
|
230
|
+
|
|
231
|
+
→ RECOMMENDATION: Option C — adoption is a measurement, not a thing. Use metric.
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### 3b. If New Type Needed — Design It
|
|
235
|
+
|
|
236
|
+
Follow this template:
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
PROPOSED ENTITY TYPE
|
|
240
|
+
|
|
241
|
+
Name: performance_benchmark
|
|
242
|
+
Domain: engineering
|
|
243
|
+
Parent: service (canonical), api_endpoint (also valid)
|
|
244
|
+
|
|
245
|
+
Properties:
|
|
246
|
+
- target_metric: string (what's being measured)
|
|
247
|
+
- target_value: number (SLA/threshold)
|
|
248
|
+
- current_value: number (latest measurement)
|
|
249
|
+
- measurement_frequency: 'continuous' | 'hourly' | 'daily' | 'weekly'
|
|
250
|
+
- status: 'passing' | 'warning' | 'failing'
|
|
251
|
+
|
|
252
|
+
Edges:
|
|
253
|
+
- service_has_benchmark (service → performance_benchmark)
|
|
254
|
+
- benchmark_measures_endpoint (performance_benchmark → api_endpoint)
|
|
255
|
+
|
|
256
|
+
Lens relevance: Engineering (primary), DevOps (secondary)
|
|
257
|
+
Skill: Would be created by `/upg-explore engineering` (or a new `/upg-explore performance` playbook if the domain emerges as separate).
|
|
258
|
+
|
|
259
|
+
Similar existing types:
|
|
260
|
+
- metric — but lacks SLA/threshold semantics
|
|
261
|
+
- service_level_indicator / service_level_objective — in DevOps domain, more operational than development-focused
|
|
262
|
+
|
|
263
|
+
Decision: [ADD / DEFER / USE EXISTING]
|
|
264
|
+
Reason: [why]
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### 3c. Before Adding — Consolidation Check
|
|
268
|
+
|
|
269
|
+
Before approving any new type, run a quick consolidation check:
|
|
270
|
+
|
|
271
|
+
1. Is there an existing type with >60% property overlap?
|
|
272
|
+
2. Could this be a discriminator value on an existing type?
|
|
273
|
+
3. Would this type have >3 instances in a typical graph?
|
|
274
|
+
|
|
275
|
+
If any answer is "no", reconsider. Suggest running `/upg-schema-consolidate` for a deeper look.
|
|
276
|
+
|
|
277
|
+
## Phase 4: Action
|
|
278
|
+
|
|
279
|
+
Once analysis is complete and the user agrees on what to add/change:
|
|
280
|
+
|
|
281
|
+
1. **New types** → hand off to `/upg-schema-update` for the cascade
|
|
282
|
+
2. **Consolidations** → hand off to `/upg-schema-consolidate` for migration design
|
|
283
|
+
3. **New edges only** → add directly to `UPG_EDGE_CATALOG` in `catalog/edge-catalog.ts`
|
|
284
|
+
4. **Defer** → document the decision in your project's decisions log for future reference
|
|
285
|
+
|
|
286
|
+
## Output Format
|
|
287
|
+
|
|
288
|
+
Always end with a clear action summary:
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
|
|
292
|
+
EVOLUTION SUMMARY
|
|
293
|
+
|
|
294
|
+
✅ Covered by existing schema: [list]
|
|
295
|
+
🆕 New types recommended: [list with reasons]
|
|
296
|
+
🔗 New edges recommended: [list]
|
|
297
|
+
🔀 Consolidation candidates: [list — run /upg-schema-consolidate]
|
|
298
|
+
⏸️ Deferred: [list with revisit conditions]
|
|
299
|
+
|
|
300
|
+
Next: /upg-schema-update [type] to implement approved additions
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## Key Principles
|
|
304
|
+
|
|
305
|
+
- **Real needs over speculative completeness.** Don't add types because a framework says they should exist. Add them because someone tried to model something and couldn't.
|
|
306
|
+
- **Properties before types.** If a discriminator property on an existing type would work, prefer it. Every new type costs ~14 registration points in the cascade.
|
|
307
|
+
- **Cross-domain is where the gaps hide.** Single-domain audits miss boundary entities. Always check the seams.
|
|
308
|
+
- **Ask who asked.** A type with no user behind it is speculative. A type born from "I tried to do X and couldn't" is validated.
|
|
309
|
+
- **The 3-instance rule.** If a typical graph would have 0-2 instances of this type, it's probably a property on something else, not its own type.
|
|
310
|
+
- **Feed forward.** Every evolution decision should be recorded so future audits don't re-debate settled questions.
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
Internal development skill for UPG schema governance.
|