@hegemonart/get-design-done 1.51.0 → 1.53.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 (58) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +96 -0
  4. package/README.md +4 -0
  5. package/SKILL.md +2 -0
  6. package/agents/a11y-mapper.md +30 -1
  7. package/agents/component-taxonomy-mapper.md +30 -1
  8. package/agents/design-context-reviewer-gate.md +102 -0
  9. package/agents/design-context-reviewer.md +186 -0
  10. package/agents/design-debt-crawler.md +60 -60
  11. package/agents/design-research-synthesizer.md +27 -1
  12. package/agents/motion-mapper.md +35 -13
  13. package/agents/token-mapper.md +30 -1
  14. package/agents/visual-hierarchy-mapper.md +30 -1
  15. package/dist/claude-code/.claude/skills/context/SKILL.md +137 -0
  16. package/dist/claude-code/.claude/skills/discover/SKILL.md +7 -1
  17. package/dist/claude-code/.claude/skills/explore/SKILL.md +3 -1
  18. package/dist/claude-code/.claude/skills/migrate-context/SKILL.md +123 -0
  19. package/dist/claude-code/.claude/skills/progress/SKILL.md +4 -0
  20. package/package.json +3 -2
  21. package/reference/design-context-schema.md +159 -0
  22. package/reference/design-context-tag-vocab.md +82 -0
  23. package/reference/registry.json +14 -0
  24. package/reference/schemas/design-context.schema.json +130 -0
  25. package/reference/schemas/mcp-gdd-tools.schema.json +34 -1
  26. package/reference/skill-graph.md +3 -1
  27. package/scripts/lib/design-context/extract-a11y.mjs +188 -0
  28. package/scripts/lib/design-context/extract-components.mjs +243 -0
  29. package/scripts/lib/design-context/extract-motion.mjs +248 -0
  30. package/scripts/lib/design-context/extract-tokens.mjs +234 -0
  31. package/scripts/lib/design-context/extract-visual-hierarchy.mjs +178 -0
  32. package/scripts/lib/design-context/integration-map.mjs +251 -0
  33. package/scripts/lib/design-context/merge-fragments.mjs +227 -0
  34. package/scripts/lib/design-context-query.cjs +0 -0
  35. package/scripts/lib/explore-parallel-runner/index.ts +58 -0
  36. package/scripts/lib/explore-parallel-runner/types.ts +58 -0
  37. package/scripts/lib/manifest/skills.json +18 -2
  38. package/scripts/lib/mappers/compute-batches.mjs +625 -0
  39. package/scripts/lib/mappers/graph-adjacency.mjs +129 -0
  40. package/scripts/lib/mappers/incremental-discover.cjs +617 -0
  41. package/scripts/lib/mappers/incremental-discover.d.cts +133 -0
  42. package/scripts/lib/mappers/neighbor-map.mjs +0 -0
  43. package/scripts/lib/mcp-tools-lint/index.cjs +3 -1
  44. package/sdk/cli/index.js +369 -2
  45. package/sdk/fingerprint/classify.cjs +406 -0
  46. package/sdk/fingerprint/index.ts +405 -0
  47. package/sdk/fingerprint/store.cjs +523 -0
  48. package/sdk/index.ts +1 -0
  49. package/sdk/mcp/gdd-mcp/schemas/gdd_context_query.schema.json +60 -0
  50. package/sdk/mcp/gdd-mcp/server.js +474 -158
  51. package/sdk/mcp/gdd-mcp/server.ts +9 -5
  52. package/sdk/mcp/gdd-mcp/tools/gdd_context_query.ts +35 -0
  53. package/sdk/mcp/gdd-mcp/tools/index.ts +18 -13
  54. package/skills/context/SKILL.md +137 -0
  55. package/skills/discover/SKILL.md +7 -1
  56. package/skills/explore/SKILL.md +3 -1
  57. package/skills/migrate-context/SKILL.md +123 -0
  58. package/skills/progress/SKILL.md +4 -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
+ }