@hegemonart/get-design-done 1.52.0 → 1.54.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +90 -0
- package/README.md +4 -0
- package/SKILL.md +2 -1
- package/agents/component-taxonomy-mapper.md +3 -0
- package/agents/design-context-reviewer-gate.md +102 -0
- package/agents/design-context-reviewer.md +186 -0
- package/agents/motion-mapper.md +1 -0
- package/agents/token-mapper.md +3 -0
- package/dist/claude-code/.claude/skills/discover/SKILL.md +7 -1
- package/dist/claude-code/.claude/skills/explore/SKILL.md +3 -1
- package/dist/claude-code/.claude/skills/new-addendum/SKILL.md +81 -0
- package/package.json +1 -1
- package/reference/frameworks/astro.md +43 -0
- package/reference/frameworks/nextjs.md +44 -0
- package/reference/frameworks/remix.md +44 -0
- package/reference/frameworks/storybook.md +44 -0
- package/reference/frameworks/sveltekit.md +43 -0
- package/reference/frameworks/vite-react.md +43 -0
- package/reference/interaction.md +1 -0
- package/reference/motion/framer-motion.md +45 -0
- package/reference/motion/gsap.md +45 -0
- package/reference/motion/motion-one.md +44 -0
- package/reference/motion/react-spring.md +44 -0
- package/reference/motion.md +1 -0
- package/reference/registry.json +163 -1
- package/reference/registry.schema.json +18 -1
- package/reference/skill-graph.md +2 -1
- package/reference/systems/chakra.md +44 -0
- package/reference/systems/css-modules.md +44 -0
- package/reference/systems/mui.md +44 -0
- package/reference/systems/radix-themes.md +43 -0
- package/reference/systems/shadcn.md +45 -0
- package/reference/systems/styled-components.md +44 -0
- package/reference/systems/tailwind.md +44 -0
- package/reference/systems/vanilla-extract.md +44 -0
- package/scripts/lib/detect/stack.cjs +455 -0
- package/scripts/lib/detect/stack.d.cts +44 -0
- package/scripts/lib/explore-parallel-runner/index.ts +196 -1
- package/scripts/lib/explore-parallel-runner/types.ts +85 -0
- package/scripts/lib/health-mirror/index.cjs +73 -1
- package/scripts/lib/manifest/skills.json +10 -2
- package/scripts/lib/mapper-spawn.cjs +257 -0
- package/scripts/lib/mapper-spawn.d.cts +60 -0
- package/scripts/lib/mappers/compute-batches.mjs +625 -0
- package/scripts/lib/mappers/graph-adjacency.mjs +129 -0
- package/scripts/lib/mappers/incremental-discover.cjs +617 -0
- package/scripts/lib/mappers/incremental-discover.d.cts +133 -0
- package/scripts/lib/mappers/neighbor-map.mjs +0 -0
- package/scripts/lib/new-addendum.cjs +204 -0
- package/sdk/cli/index.js +1504 -3
- package/sdk/fingerprint/classify.cjs +406 -0
- package/sdk/fingerprint/index.ts +405 -0
- package/sdk/fingerprint/store.cjs +523 -0
- package/sdk/index.ts +1 -0
- package/sdk/mcp/gdd-mcp/server.js +1047 -0
- package/skills/discover/SKILL.md +7 -1
- package/skills/explore/SKILL.md +3 -1
- package/skills/new-addendum/SKILL.md +81 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// scripts/lib/mappers/graph-adjacency.mjs — Phase 53 (Semantic Mapper Engine), executor A.
|
|
2
|
+
//
|
|
3
|
+
// Shared adjacency substrate factored from design-context-query.cjs#_adjacency
|
|
4
|
+
// (Phase 52). Pure, dependency-free ESM. Where design-context-query builds an
|
|
5
|
+
// unweighted direction-aware Map<id, Set<id>> for traversal/path/cycle work,
|
|
6
|
+
// this builder additionally ACCUMULATES edge weights into a weighted adjacency
|
|
7
|
+
// (Map<id, Map<neighborId, weight>>) so the Louvain batcher and the neighborMap
|
|
8
|
+
// can rank/score on tie strength. Direction handling is identical to Phase 52:
|
|
9
|
+
// forward -> source reaches target
|
|
10
|
+
// backward -> target reaches source
|
|
11
|
+
// bidirectional -> both
|
|
12
|
+
//
|
|
13
|
+
// Determinism: no Math.random, no Date.now, no iteration over insertion-order
|
|
14
|
+
// that leaks into output (callers sort before emitting). Self-loops are dropped
|
|
15
|
+
// (a node is never its own neighbor) since communities/neighbors are external by
|
|
16
|
+
// definition.
|
|
17
|
+
//
|
|
18
|
+
// Public API:
|
|
19
|
+
// buildAdjacency(graph, {undirected=false})
|
|
20
|
+
// -> Map<id, Map<neighborId, weight>> (weights summed across parallel edges)
|
|
21
|
+
// degreeIndex(graph)
|
|
22
|
+
// -> Map<id, number> (total incident edge count, undirected)
|
|
23
|
+
|
|
24
|
+
/** Node array accessor tolerant of a malformed graph. */
|
|
25
|
+
function nodeList(graph) {
|
|
26
|
+
return Array.isArray(graph && graph.nodes) ? graph.nodes : [];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Edge array accessor tolerant of a malformed graph. */
|
|
30
|
+
function edgeList(graph) {
|
|
31
|
+
return Array.isArray(graph && graph.edges) ? graph.edges : [];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** A finite, non-negative numeric weight; defaults to 1 when absent/invalid. */
|
|
35
|
+
function edgeWeight(e) {
|
|
36
|
+
const w = e && e.weight;
|
|
37
|
+
return typeof w === 'number' && Number.isFinite(w) && w >= 0 ? w : 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Build a weighted adjacency map honoring edge direction (Phase-52 semantics),
|
|
42
|
+
* accumulating weights across parallel edges between the same pair.
|
|
43
|
+
*
|
|
44
|
+
* Directed mode (default): a `forward` edge adds source->target; `backward`
|
|
45
|
+
* adds target->source; `bidirectional` adds both. Each entry's weight is the
|
|
46
|
+
* SUM of all qualifying edge weights for that ordered (from,to) pair.
|
|
47
|
+
*
|
|
48
|
+
* Undirected mode ({undirected:true}): direction is folded away — every edge
|
|
49
|
+
* (regardless of `direction`) contributes its weight to BOTH from->to and
|
|
50
|
+
* to->from, exactly once per edge. A `bidirectional` edge is therefore counted
|
|
51
|
+
* once (not twice) in each direction, matching the intuition that an undirected
|
|
52
|
+
* tie has a single strength. Parallel edges still sum.
|
|
53
|
+
*
|
|
54
|
+
* Self-loops (source === target) are dropped in both modes.
|
|
55
|
+
*
|
|
56
|
+
* Every node id present in graph.nodes is seeded with an (possibly empty) entry
|
|
57
|
+
* so callers can iterate the full node set; edge endpoints not present as nodes
|
|
58
|
+
* are also indexed (callers needing strict membership intersect with the id set).
|
|
59
|
+
*
|
|
60
|
+
* @param {object} graph
|
|
61
|
+
* @param {{undirected?: boolean}} [opts]
|
|
62
|
+
* @returns {Map<string, Map<string, number>>}
|
|
63
|
+
*/
|
|
64
|
+
export function buildAdjacency(graph, opts = {}) {
|
|
65
|
+
const undirected = opts.undirected === true;
|
|
66
|
+
const adj = new Map();
|
|
67
|
+
|
|
68
|
+
const ensure = (id) => {
|
|
69
|
+
let m = adj.get(id);
|
|
70
|
+
if (!m) { m = new Map(); adj.set(id, m); }
|
|
71
|
+
return m;
|
|
72
|
+
};
|
|
73
|
+
const addDirected = (from, to, w) => {
|
|
74
|
+
if (from === to) return; // drop self-loops
|
|
75
|
+
const m = ensure(from);
|
|
76
|
+
m.set(to, (m.get(to) || 0) + w);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
for (const n of nodeList(graph)) {
|
|
80
|
+
if (n && typeof n.id === 'string') ensure(n.id);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
for (const e of edgeList(graph)) {
|
|
84
|
+
if (!e || typeof e.source !== 'string' || typeof e.target !== 'string') continue;
|
|
85
|
+
const w = edgeWeight(e);
|
|
86
|
+
if (undirected) {
|
|
87
|
+
// Fold direction away: one undirected tie of strength w, both ways once.
|
|
88
|
+
addDirected(e.source, e.target, w);
|
|
89
|
+
addDirected(e.target, e.source, w);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const dir = e.direction;
|
|
93
|
+
if (dir === 'forward' || dir === 'bidirectional') addDirected(e.source, e.target, w);
|
|
94
|
+
if (dir === 'backward' || dir === 'bidirectional') addDirected(e.target, e.source, w);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return adj;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Total incident edge count per node (undirected degree), counting every edge
|
|
102
|
+
* once per endpoint regardless of direction. Parallel edges each count. A node
|
|
103
|
+
* with no incident edge maps to 0 (it is still present in the index). Self-loops
|
|
104
|
+
* are excluded (consistent with buildAdjacency dropping them).
|
|
105
|
+
*
|
|
106
|
+
* This is a structural count (number of edges touching the node), independent of
|
|
107
|
+
* edge weights — distinct from the weighted-degree (Σ weights) a modularity pass
|
|
108
|
+
* computes from buildAdjacency. Used to rank neighbors by connectedness.
|
|
109
|
+
*
|
|
110
|
+
* @param {object} graph
|
|
111
|
+
* @returns {Map<string, number>}
|
|
112
|
+
*/
|
|
113
|
+
export function degreeIndex(graph) {
|
|
114
|
+
const deg = new Map();
|
|
115
|
+
const bump = (id, by) => deg.set(id, (deg.get(id) || 0) + by);
|
|
116
|
+
|
|
117
|
+
for (const n of nodeList(graph)) {
|
|
118
|
+
if (n && typeof n.id === 'string' && !deg.has(n.id)) deg.set(n.id, 0);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
for (const e of edgeList(graph)) {
|
|
122
|
+
if (!e || typeof e.source !== 'string' || typeof e.target !== 'string') continue;
|
|
123
|
+
if (e.source === e.target) continue; // self-loop excluded
|
|
124
|
+
bump(e.source, 1);
|
|
125
|
+
bump(e.target, 1);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return deg;
|
|
129
|
+
}
|