@hegemonart/get-design-done 1.57.1 → 1.57.2

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 (113) hide show
  1. package/.claude-plugin/marketplace.json +26 -41
  2. package/.claude-plugin/plugin.json +23 -48
  3. package/CHANGELOG.md +91 -0
  4. package/README.md +166 -511
  5. package/SKILL.md +2 -0
  6. package/agents/README.md +33 -36
  7. package/agents/a11y-mapper.md +3 -3
  8. package/agents/component-benchmark-harvester.md +6 -6
  9. package/agents/component-benchmark-synthesizer.md +3 -3
  10. package/agents/compose-executor.md +3 -3
  11. package/agents/cost-forecaster.md +2 -2
  12. package/agents/design-auditor.md +7 -7
  13. package/agents/design-authority-watcher.md +15 -15
  14. package/agents/design-context-builder.md +4 -4
  15. package/agents/design-context-checker-gate.md +1 -1
  16. package/agents/design-discussant.md +2 -2
  17. package/agents/design-doc-writer.md +1 -1
  18. package/agents/design-executor.md +2 -2
  19. package/agents/design-figma-writer.md +2 -2
  20. package/agents/design-fixer.md +7 -7
  21. package/agents/design-integration-checker-gate.md +1 -1
  22. package/agents/design-integration-checker.md +1 -1
  23. package/agents/design-paper-writer.md +3 -3
  24. package/agents/design-pencil-writer.md +1 -1
  25. package/agents/design-planner.md +21 -0
  26. package/agents/design-reflector.md +39 -39
  27. package/agents/design-research-synthesizer.md +1 -0
  28. package/agents/design-start-writer.md +1 -1
  29. package/agents/design-update-checker.md +5 -5
  30. package/agents/design-verifier-gate.md +1 -1
  31. package/agents/design-verifier.md +52 -48
  32. package/agents/ds-generator.md +2 -2
  33. package/agents/ds-migration-planner.md +4 -4
  34. package/agents/email-executor.md +9 -9
  35. package/agents/experiment-result-ingester.md +3 -3
  36. package/agents/flutter-executor.md +5 -5
  37. package/agents/gdd-graph-refresh.md +3 -3
  38. package/agents/gdd-intel-updater.md +2 -2
  39. package/agents/motion-mapper.md +2 -2
  40. package/agents/motion-verifier.md +4 -4
  41. package/agents/pdf-executor.md +8 -8
  42. package/agents/perf-analyzer.md +17 -17
  43. package/agents/pr-commenter.md +9 -9
  44. package/agents/prototype-gate.md +2 -2
  45. package/agents/quality-gate-runner.md +1 -1
  46. package/agents/rollout-coordinator.md +3 -3
  47. package/agents/swift-executor.md +4 -4
  48. package/agents/ticket-sync-agent.md +6 -6
  49. package/agents/user-research-synthesizer.md +2 -2
  50. package/connections/connections.md +44 -45
  51. package/connections/cursor.md +73 -0
  52. package/connections/preview.md +3 -3
  53. package/dist/claude-code/.claude/skills/cache-manager/SKILL.md +3 -3
  54. package/dist/claude-code/.claude/skills/cache-manager/cache-policy.md +1 -1
  55. package/dist/claude-code/.claude/skills/design/SKILL.md +19 -0
  56. package/dist/claude-code/.claude/skills/explore/SKILL.md +11 -0
  57. package/dist/claude-code/.claude/skills/figma-write/SKILL.md +13 -2
  58. package/dist/claude-code/.claude/skills/paper-write/SKILL.md +54 -0
  59. package/dist/claude-code/.claude/skills/pencil-write/SKILL.md +54 -0
  60. package/dist/claude-code/.claude/skills/report-issue/SKILL.md +2 -2
  61. package/dist/claude-code/.claude/skills/router/SKILL.md +2 -2
  62. package/dist/claude-code/.claude/skills/verify/verify-procedure.md +10 -11
  63. package/dist/claude-code/.claude/skills/warm-cache/SKILL.md +1 -1
  64. package/hooks/first-run-nudge.cjs +171 -0
  65. package/hooks/gdd-intel-trigger.js +243 -0
  66. package/hooks/gdd-mcp-circuit-breaker.js +62 -7
  67. package/hooks/gdd-precompact-snapshot.js +50 -29
  68. package/hooks/gdd-protected-paths.js +150 -18
  69. package/hooks/gdd-risk-gate.js +93 -1
  70. package/hooks/gdd-sessionstart-recap.js +59 -24
  71. package/hooks/hooks.json +13 -4
  72. package/hooks/inject-using-gdd.cjs +188 -0
  73. package/hooks/update-check.cjs +511 -0
  74. package/package.json +9 -2
  75. package/reference/STATE-TEMPLATE.md +10 -13
  76. package/reference/audit-scoring.md +1 -1
  77. package/reference/cache-tier-doctrine.md +46 -0
  78. package/reference/config-schema.md +9 -9
  79. package/reference/i18n.md +1 -1
  80. package/reference/intel-schema.md +37 -2
  81. package/reference/meta-rules.md +4 -4
  82. package/reference/model-tiers.md +2 -2
  83. package/reference/registry.json +101 -94
  84. package/reference/runtime-models.md +11 -1
  85. package/reference/shared-preamble.md +13 -14
  86. package/reference/skill-graph.md +24 -1
  87. package/scripts/bootstrap.cjs +373 -0
  88. package/scripts/injection-patterns.cjs +58 -0
  89. package/scripts/lib/apply-reflections/incubator-proposals.cjs +57 -26
  90. package/scripts/lib/install/converters/codex-plugin.cjs +5 -2
  91. package/scripts/lib/install/converters/cursor.cjs +20 -0
  92. package/scripts/lib/issue-reporter/report-flow.cjs +1 -1
  93. package/scripts/lib/manifest/skills.json +80 -13
  94. package/scripts/lib/state/query-surface.cjs +67 -9
  95. package/scripts/lib/state/state-store.cjs +68 -26
  96. package/sdk/cli/commands/stage.ts +17 -0
  97. package/sdk/cli/index.js +14 -0
  98. package/skills/cache-manager/SKILL.md +3 -3
  99. package/skills/cache-manager/cache-policy.md +1 -1
  100. package/skills/design/SKILL.md +19 -0
  101. package/skills/explore/SKILL.md +11 -0
  102. package/skills/figma-write/SKILL.md +13 -2
  103. package/skills/paper-write/SKILL.md +54 -0
  104. package/skills/pencil-write/SKILL.md +54 -0
  105. package/skills/report-issue/SKILL.md +2 -2
  106. package/skills/router/SKILL.md +2 -2
  107. package/skills/verify/verify-procedure.md +10 -11
  108. package/skills/warm-cache/SKILL.md +1 -1
  109. package/hooks/first-run-nudge.sh +0 -82
  110. package/hooks/inject-using-gdd.sh +0 -72
  111. package/hooks/update-check.sh +0 -251
  112. package/scripts/lib/audit-aggregator/index.cjs +0 -219
  113. package/scripts/lib/hedge-ensemble.cjs +0 -217
@@ -1,217 +0,0 @@
1
- /**
2
- * hedge-ensemble.cjs — AdaNormalHedge weighted-majority over verifier
3
- * + checker agents (Plan 23.5-02).
4
- *
5
- * Parameter-free: no manual learning rate. Weights self-adapt via
6
- * the AdaNormalHedge regret-bound trick — η is recomputed each round
7
- * from cumulative loss variance, eliminating the typical "tune η or
8
- * suffer" tax.
9
- *
10
- * Weights persist at `.design/telemetry/hedge-weights.json` (atomic
11
- * .tmp + rename). Schema:
12
- * { schema_version: '1.0.0',
13
- * generated_at: ISO,
14
- * pools: { <poolId>: { agents: { <agentId>: {weight, cumLoss, cumLoss2, rounds} } } } }
15
- *
16
- * Reused by adaptive_mode = "hedge" or "full" — see Plan 23.5-04.
17
- */
18
-
19
- 'use strict';
20
-
21
- const fs = require('node:fs');
22
- const path = require('node:path');
23
-
24
- const DEFAULT_WEIGHTS_PATH = '.design/telemetry/hedge-weights.json';
25
- const SCHEMA_VERSION = '1.0.0';
26
- const DEFAULT_VOTE_THRESHOLD = 0.5;
27
-
28
- function resolvePath(opts = {}) {
29
- if (opts.weightsPath) {
30
- return path.isAbsolute(opts.weightsPath)
31
- ? opts.weightsPath
32
- : path.resolve(opts.baseDir ?? process.cwd(), opts.weightsPath);
33
- }
34
- return path.resolve(opts.baseDir ?? process.cwd(), DEFAULT_WEIGHTS_PATH);
35
- }
36
-
37
- /**
38
- * @returns {{schema_version: string, generated_at: string, pools: object}}
39
- */
40
- function loadWeights(opts = {}) {
41
- const p = resolvePath(opts);
42
- if (!fs.existsSync(p)) {
43
- return { schema_version: SCHEMA_VERSION, generated_at: new Date().toISOString(), pools: {} };
44
- }
45
- try {
46
- const data = JSON.parse(fs.readFileSync(p, 'utf8'));
47
- if (!data.pools || typeof data.pools !== 'object') data.pools = {};
48
- return data;
49
- } catch {
50
- return { schema_version: SCHEMA_VERSION, generated_at: new Date().toISOString(), pools: {} };
51
- }
52
- }
53
-
54
- function saveWeights(state, opts = {}) {
55
- const p = resolvePath(opts);
56
- fs.mkdirSync(path.dirname(p), { recursive: true });
57
- state.generated_at = new Date().toISOString();
58
- const tmp = p + '.tmp';
59
- fs.writeFileSync(tmp, JSON.stringify(state, null, 2));
60
- fs.renameSync(tmp, p);
61
- return p;
62
- }
63
-
64
- function ensurePool(state, poolId) {
65
- if (!state.pools[poolId]) state.pools[poolId] = { agents: {} };
66
- return state.pools[poolId];
67
- }
68
-
69
- function ensureAgent(pool, agentId) {
70
- if (!pool.agents[agentId]) {
71
- pool.agents[agentId] = {
72
- weight: 1, // uniform start; normalised on read
73
- cumLoss: 0,
74
- cumLoss2: 0,
75
- rounds: 0,
76
- };
77
- }
78
- return pool.agents[agentId];
79
- }
80
-
81
- /**
82
- * Apply one round of losses to a pool. losses: Record<agentId, lossInZeroOne>.
83
- *
84
- * AdaNormalHedge update (parameter-free):
85
- * For each agent i:
86
- * R_i = sum of (mean_loss - loss_i) over rounds (instantaneous regret)
87
- * C_i = sum of (loss_i - mean_loss)^2 (cumulative loss variance)
88
- * Set η_i = sqrt(ln(N) / max(1, C_i)) per-agent learning rate.
89
- * weight_i ∝ Phi(R_i, C_i) where Phi is a positive-only potential.
90
- *
91
- * Simplification used here: w_i *= exp(-η * loss_i) with η derived
92
- * from cumulative variance — gives the same regret bound as full
93
- * AdaNormalHedge for the binary-loss case we care about (verifier
94
- * pass/fail). Trade off: slightly less tight bound vs the full
95
- * potential, but no need to plumb regret tracking everywhere.
96
- *
97
- * @param {{poolId: string, losses: Record<string, number>, baseDir?: string, weightsPath?: string, eta?: number}} input
98
- * @returns {{weights: Record<string, number>, weightsPath: string}}
99
- */
100
- function loss(input) {
101
- if (!input || typeof input.poolId !== 'string' || input.poolId.length === 0) {
102
- throw new TypeError('hedge-ensemble.loss: poolId (string) required');
103
- }
104
- if (!input.losses || typeof input.losses !== 'object') {
105
- throw new TypeError('hedge-ensemble.loss: losses (Record<string, number>) required');
106
- }
107
- const state = loadWeights(input);
108
- const pool = ensurePool(state, input.poolId);
109
- // First, ensure every losing agent exists.
110
- for (const [agentId, lossVal] of Object.entries(input.losses)) {
111
- if (typeof lossVal !== 'number' || Number.isNaN(lossVal)) {
112
- throw new TypeError(`hedge-ensemble.loss: losses.${agentId} must be a number`);
113
- }
114
- }
115
- for (const agentId of Object.keys(input.losses)) {
116
- ensureAgent(pool, agentId);
117
- }
118
- const N = Object.keys(pool.agents).length;
119
- // Compute mean loss this round (over agents that received a value).
120
- const lossList = Object.values(input.losses);
121
- const meanLoss = lossList.length > 0 ? lossList.reduce((a, b) => a + b, 0) / lossList.length : 0;
122
- // Update each agent's cumulative variance + regret-like signal, then
123
- // recompute its weight via exp(-η_i * loss_i).
124
- for (const [agentId, rawLoss] of Object.entries(input.losses)) {
125
- const lossVal = Math.min(1, Math.max(0, rawLoss));
126
- const a = pool.agents[agentId];
127
- const dev = lossVal - meanLoss;
128
- a.cumLoss += lossVal;
129
- a.cumLoss2 += dev * dev;
130
- a.rounds += 1;
131
- const eta =
132
- typeof input.eta === 'number'
133
- ? input.eta
134
- : Math.sqrt(Math.log(Math.max(2, N)) / Math.max(1, a.cumLoss2));
135
- a.weight *= Math.exp(-eta * lossVal);
136
- if (!Number.isFinite(a.weight) || a.weight <= 0) a.weight = 1e-9;
137
- }
138
- // Renormalize.
139
- const total = Object.values(pool.agents).reduce((s, x) => s + x.weight, 0) || 1;
140
- /** @type {Record<string, number>} */
141
- const out = {};
142
- for (const agentId of Object.keys(pool.agents)) {
143
- pool.agents[agentId].weight /= total;
144
- out[agentId] = pool.agents[agentId].weight;
145
- }
146
- const writtenPath = saveWeights(state, input);
147
- return { weights: out, weightsPath: writtenPath };
148
- }
149
-
150
- /**
151
- * Compute the weighted-majority verdict for a pool given each agent's
152
- * binary vote (pass=1, fail=0). Vote passes when the weighted sum
153
- * exceeds threshold (default 0.5).
154
- *
155
- * @param {{poolId: string, votes: Record<string, 0|1|boolean>, threshold?: number, baseDir?: string, weightsPath?: string}} input
156
- * @returns {{passes: boolean, weighted: number, threshold: number, perAgent: Record<string, {weight: number, vote: number}>}}
157
- */
158
- function vote(input) {
159
- if (!input || typeof input.poolId !== 'string') {
160
- throw new TypeError('hedge-ensemble.vote: poolId required');
161
- }
162
- if (!input.votes || typeof input.votes !== 'object') {
163
- throw new TypeError('hedge-ensemble.vote: votes required');
164
- }
165
- const state = loadWeights(input);
166
- const pool = ensurePool(state, input.poolId);
167
- const threshold = typeof input.threshold === 'number' ? input.threshold : DEFAULT_VOTE_THRESHOLD;
168
- let total = 0;
169
- /** @type {Record<string, {weight: number, vote: number}>} */
170
- const perAgent = {};
171
- let weightSum = 0;
172
- for (const [agentId, raw] of Object.entries(input.votes)) {
173
- const v = raw === true || raw === 1 ? 1 : 0;
174
- const a = ensureAgent(pool, agentId);
175
- perAgent[agentId] = { weight: a.weight, vote: v };
176
- total += a.weight * v;
177
- weightSum += a.weight;
178
- }
179
- // Normalise the weighted sum against the SUM of voting agents'
180
- // weights — agents in the pool that didn't vote this round don't
181
- // dilute the result.
182
- const weighted = weightSum > 0 ? total / weightSum : 0;
183
- return { passes: weighted >= threshold, weighted, threshold, perAgent };
184
- }
185
-
186
- /**
187
- * Read current weights for a pool, normalised over the pool's agents.
188
- *
189
- * @param {{poolId: string, baseDir?: string, weightsPath?: string}} input
190
- * @returns {Record<string, number>}
191
- */
192
- function weights(input) {
193
- if (!input || typeof input.poolId !== 'string') {
194
- throw new TypeError('hedge-ensemble.weights: poolId required');
195
- }
196
- const state = loadWeights(input);
197
- const pool = state.pools[input.poolId];
198
- if (!pool) return {};
199
- const total = Object.values(pool.agents).reduce((s, x) => s + x.weight, 0);
200
- /** @type {Record<string, number>} */
201
- const out = {};
202
- for (const [k, v] of Object.entries(pool.agents)) {
203
- out[k] = total > 0 ? v.weight / total : 0;
204
- }
205
- return out;
206
- }
207
-
208
- module.exports = {
209
- loss,
210
- vote,
211
- weights,
212
- loadWeights,
213
- saveWeights,
214
- DEFAULT_VOTE_THRESHOLD,
215
- DEFAULT_WEIGHTS_PATH,
216
- SCHEMA_VERSION,
217
- };