from @unified-product-graph/core/intelligence · re-exported by @sdk
Intelligence
v0.4 anti-patterns and heuristics.
57 exports · 12 const · 7 type · 21 interface · 17 fn
Since v0.4.0Quick import
import { UPG_ANTI_PATTERNS, UPG_RELATIONSHIP_BENCHMARKS } from '@unified-product-graph/core'Example
// Walk the anti-pattern catalogue
import { UPG_ANTI_PATTERNS } from '@unified-product-graph/core'
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 UPGAntiPatternConcern = 'product_spine' | 'universal' | 'operating'The concern family an anti-pattern belongs to — the axis a per-member-kind profile switches on.
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.
type UPGMemberKindKey = 'product' | 'org_rollup' | 'watched' | 'operating_function'Member-kind keys for the profile table.
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.
(kind: string | undefined, concern: UPGAntiPatternConcern) => booleanIs an anti-pattern of this concern EVALUATED (run + reported) for this kind?
(antiPatternId: string) => UPGAntiPatternConcernThe concern family for a curated anti-pattern id (default `product_spine`).
(kind: string | undefined, concern: UPGAntiPatternConcern) => booleanDoes a fired violation of this concern GATE `valid` for this kind?
(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" | ... 25 more ... | "foundations"; 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.
(antiPatternId: string, totalEntityCount: number) => booleanTrue when a fired coverage anti-pattern should be advisory (not gating) because the graph is still too thin to expect breadth.