from @unified-product-graph/core/intelligence · re-exported by @sdk
Intelligence
v0.4 anti-patterns and heuristics.
45 exports · 8 const · 5 type · 20 interface · 12 fn
Since v0.4.0Quick import
import { UPG_ANTI_PATTERNS, UPG_RELATIONSHIP_BENCHMARKS } from '@unified-product-graph/core/intelligence'Example
// Walk the v0.4 anti-pattern catalogue
import { UPG_ANTI_PATTERNS } from '@unified-product-graph/core/intelligence'
for (const pattern of UPG_ANTI_PATTERNS) {
console.log(`${pattern.id} — ${pattern.severity}`)
}v0.4 anti-patterns and heuristics. The rules a graph is validated against: UPG_ANTI_PATTERNS for cross-domain health checks, domain guides for per-domain authoring guidance, and benchmarks for stage-appropriate coverage targets. These are the rules the MCP get_anti_pattern and list_anti_patterns tools surface.
Exports
Constants
readonly ["concept", "validation", "build", "beta", "launch", "growth", "mature", "maintenance", "sunset"]Types
type IntelligenceCondition = | { check: | EntityCheck | RelationshipCheck | BenchmarkCheck | TotalEntityCountCheck | DomainCountCheck | DomainPopu...A structured, machine-evaluable condition for intelligence prompts.
type UPGAntiPatternSeverity = 'high' | 'medium' | 'low'Severity tier for a curated anti-pattern.
type UPGBenchmarkSource = | { kind: 'book'; citation: string } /** Attributed to a specific practitioner or method author. */ | { kind: 'practi...Where a benchmark's range or expectation comes from.
Interfaces
interface AntiPatternViolationOne fired anti-pattern, lifted from the catalog with prose attached.
interface ProductStageCoercionResult of a soft-coercion attempt on a product `stage` value.
interface UPGCuratedAntiPatternA curated, cross-domain anti-pattern with a machine-evaluable detector.
Functions
(value: unknown) => ProductStageCoercionSoft-coerce a stage value to canonical UPGProductStage, falling back to the documented mapping for known legacy values.
(inputs: AntiPatternInputs, options?: EvaluateAntiPatternsOptions) => AntiPatternViolation[]Evaluate the curated anti-pattern catalog against a graph's pre-computed stats.
(domainId: UPGDomainId | string) => UPGEntityType | undefinedGet the anchor entity for a domain (the entity you create first).
(id: string) => UPGCuratedAntiPattern | undefinedLook up a curated anti-pattern by its slug id.
() => { domain: "design_system" | "business_model" | "portfolio" | "workspace" | "strategy" | "user" | "discovery" | "validation" | "market_intelligence" | "user_research" | "ux_design" | ... 24 more ... | "compliance"; anti_pattern: UPGAntiPattern; }[]Get all anti-patterns across all domains, flattened and tagged by domain.
(severity: UPGAntiPatternSeverity) => readonly UPGCuratedAntiPattern[]Filter the curated set by severity tier.
(stage: UPGProductStage) => readonly UPGCuratedAntiPattern[]Filter the curated set to anti-patterns relevant at a given product stage.
(entityType: UPGEntityType | string, stage: UPGProductStage) => StageRangeLook up the expected range for a type at a given stage.
(domain: UPGDomainId | string) => CountBenchmark[]Get all benchmarks for a given domain.
(domainId: UPGDomainId | string) => UPGDomainUsageGuide | undefinedLook up the usage guide for a domain.