@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.
- package/.claude-plugin/marketplace.json +26 -41
- package/.claude-plugin/plugin.json +23 -48
- package/CHANGELOG.md +91 -0
- package/README.md +166 -511
- package/SKILL.md +2 -0
- package/agents/README.md +33 -36
- package/agents/a11y-mapper.md +3 -3
- package/agents/component-benchmark-harvester.md +6 -6
- package/agents/component-benchmark-synthesizer.md +3 -3
- package/agents/compose-executor.md +3 -3
- package/agents/cost-forecaster.md +2 -2
- package/agents/design-auditor.md +7 -7
- package/agents/design-authority-watcher.md +15 -15
- package/agents/design-context-builder.md +4 -4
- package/agents/design-context-checker-gate.md +1 -1
- package/agents/design-discussant.md +2 -2
- package/agents/design-doc-writer.md +1 -1
- package/agents/design-executor.md +2 -2
- package/agents/design-figma-writer.md +2 -2
- package/agents/design-fixer.md +7 -7
- package/agents/design-integration-checker-gate.md +1 -1
- package/agents/design-integration-checker.md +1 -1
- package/agents/design-paper-writer.md +3 -3
- package/agents/design-pencil-writer.md +1 -1
- package/agents/design-planner.md +21 -0
- package/agents/design-reflector.md +39 -39
- package/agents/design-research-synthesizer.md +1 -0
- package/agents/design-start-writer.md +1 -1
- package/agents/design-update-checker.md +5 -5
- package/agents/design-verifier-gate.md +1 -1
- package/agents/design-verifier.md +52 -48
- package/agents/ds-generator.md +2 -2
- package/agents/ds-migration-planner.md +4 -4
- package/agents/email-executor.md +9 -9
- package/agents/experiment-result-ingester.md +3 -3
- package/agents/flutter-executor.md +5 -5
- package/agents/gdd-graph-refresh.md +3 -3
- package/agents/gdd-intel-updater.md +2 -2
- package/agents/motion-mapper.md +2 -2
- package/agents/motion-verifier.md +4 -4
- package/agents/pdf-executor.md +8 -8
- package/agents/perf-analyzer.md +17 -17
- package/agents/pr-commenter.md +9 -9
- package/agents/prototype-gate.md +2 -2
- package/agents/quality-gate-runner.md +1 -1
- package/agents/rollout-coordinator.md +3 -3
- package/agents/swift-executor.md +4 -4
- package/agents/ticket-sync-agent.md +6 -6
- package/agents/user-research-synthesizer.md +2 -2
- package/connections/connections.md +44 -45
- package/connections/cursor.md +73 -0
- package/connections/preview.md +3 -3
- package/dist/claude-code/.claude/skills/cache-manager/SKILL.md +3 -3
- package/dist/claude-code/.claude/skills/cache-manager/cache-policy.md +1 -1
- package/dist/claude-code/.claude/skills/design/SKILL.md +19 -0
- package/dist/claude-code/.claude/skills/explore/SKILL.md +11 -0
- package/dist/claude-code/.claude/skills/figma-write/SKILL.md +13 -2
- package/dist/claude-code/.claude/skills/paper-write/SKILL.md +54 -0
- package/dist/claude-code/.claude/skills/pencil-write/SKILL.md +54 -0
- package/dist/claude-code/.claude/skills/report-issue/SKILL.md +2 -2
- package/dist/claude-code/.claude/skills/router/SKILL.md +2 -2
- package/dist/claude-code/.claude/skills/verify/verify-procedure.md +10 -11
- package/dist/claude-code/.claude/skills/warm-cache/SKILL.md +1 -1
- package/hooks/first-run-nudge.cjs +171 -0
- package/hooks/gdd-intel-trigger.js +243 -0
- package/hooks/gdd-mcp-circuit-breaker.js +62 -7
- package/hooks/gdd-precompact-snapshot.js +50 -29
- package/hooks/gdd-protected-paths.js +150 -18
- package/hooks/gdd-risk-gate.js +93 -1
- package/hooks/gdd-sessionstart-recap.js +59 -24
- package/hooks/hooks.json +13 -4
- package/hooks/inject-using-gdd.cjs +188 -0
- package/hooks/update-check.cjs +511 -0
- package/package.json +9 -2
- package/reference/STATE-TEMPLATE.md +10 -13
- package/reference/audit-scoring.md +1 -1
- package/reference/cache-tier-doctrine.md +46 -0
- package/reference/config-schema.md +9 -9
- package/reference/i18n.md +1 -1
- package/reference/intel-schema.md +37 -2
- package/reference/meta-rules.md +4 -4
- package/reference/model-tiers.md +2 -2
- package/reference/registry.json +101 -94
- package/reference/runtime-models.md +11 -1
- package/reference/shared-preamble.md +13 -14
- package/reference/skill-graph.md +24 -1
- package/scripts/bootstrap.cjs +373 -0
- package/scripts/injection-patterns.cjs +58 -0
- package/scripts/lib/apply-reflections/incubator-proposals.cjs +57 -26
- package/scripts/lib/install/converters/codex-plugin.cjs +5 -2
- package/scripts/lib/install/converters/cursor.cjs +20 -0
- package/scripts/lib/issue-reporter/report-flow.cjs +1 -1
- package/scripts/lib/manifest/skills.json +80 -13
- package/scripts/lib/state/query-surface.cjs +67 -9
- package/scripts/lib/state/state-store.cjs +68 -26
- package/sdk/cli/commands/stage.ts +17 -0
- package/sdk/cli/index.js +14 -0
- package/skills/cache-manager/SKILL.md +3 -3
- package/skills/cache-manager/cache-policy.md +1 -1
- package/skills/design/SKILL.md +19 -0
- package/skills/explore/SKILL.md +11 -0
- package/skills/figma-write/SKILL.md +13 -2
- package/skills/paper-write/SKILL.md +54 -0
- package/skills/pencil-write/SKILL.md +54 -0
- package/skills/report-issue/SKILL.md +2 -2
- package/skills/router/SKILL.md +2 -2
- package/skills/verify/verify-procedure.md +10 -11
- package/skills/warm-cache/SKILL.md +1 -1
- package/hooks/first-run-nudge.sh +0 -82
- package/hooks/inject-using-gdd.sh +0 -72
- package/hooks/update-check.sh +0 -251
- package/scripts/lib/audit-aggregator/index.cjs +0 -219
- 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
|
-
};
|