@v11g/agents-rock 1.0.4 → 1.0.6

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 (48) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/plugins/solution-architect/.claude-plugin/plugin.json +1 -1
  4. package/plugins/solution-architect/skills/estimate/README.md +8 -5
  5. package/plugins/solution-architect/skills/estimate/SKILL.md +13 -7
  6. package/plugins/solution-architect/skills/estimate/assets/estimate-template-agentic.html +142 -376
  7. package/plugins/solution-architect/skills/estimate/assets/estimate-template.html +619 -601
  8. package/plugins/solution-architect/skills/estimate/assets/scores-review-template.html +363 -0
  9. package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +5 -9
  10. package/plugins/solution-architect/skills/estimate/references/interview.md +132 -12
  11. package/plugins/solution-architect/skills/estimate/references/scoring-guide.md +23 -0
  12. package/plugins/solution-architect/skills/estimate/references/techniques.md +9 -2
  13. package/plugins/solution-architect/skills/estimate/references/writing.md +28 -5
  14. package/plugins/solution-architect/skills/estimate/scripts/lib/agentic-checks.mjs +1 -1
  15. package/plugins/solution-architect/skills/estimate/scripts/lib/checks.mjs +4 -30
  16. package/plugins/solution-architect/skills/estimate/scripts/lib/estimate-math.mjs +14 -10
  17. package/plugins/solution-architect/skills/estimate/scripts/lib/inline.mjs +6 -8
  18. package/plugins/solution-architect/skills/estimate/scripts/lib/md-tables.mjs +31 -0
  19. package/plugins/solution-architect/skills/estimate/scripts/lib/redact.mjs +14 -3
  20. package/plugins/solution-architect/skills/estimate/scripts/lib/rollup.mjs +5 -4
  21. package/plugins/solution-architect/skills/estimate/scripts/lib/scenario-schema.mjs +39 -0
  22. package/plugins/solution-architect/skills/estimate/scripts/lib/schema.mjs +4 -14
  23. package/plugins/solution-architect/skills/estimate/scripts/lib/score-csv.mjs +58 -0
  24. package/plugins/solution-architect/skills/estimate/scripts/lib/score-diff.mjs +30 -0
  25. package/plugins/solution-architect/skills/estimate/scripts/lib/score-html.mjs +17 -0
  26. package/plugins/solution-architect/skills/estimate/scripts/lib/scoring-checks.mjs +24 -0
  27. package/plugins/solution-architect/skills/estimate/scripts/lib/scoring-schema.mjs +48 -0
  28. package/plugins/solution-architect/skills/estimate/scripts/lib/scoring.mjs +45 -0
  29. package/plugins/solution-architect/skills/estimate/scripts/render.mjs +14 -13
  30. package/plugins/solution-architect/skills/estimate/scripts/score-review.mjs +59 -0
  31. package/plugins/solution-architect/skills/estimate/scripts/test/browser.test.mjs +403 -316
  32. package/plugins/solution-architect/skills/estimate/scripts/test/compute.test.mjs +25 -1
  33. package/plugins/solution-architect/skills/estimate/scripts/test/estimate-math.test.mjs +29 -10
  34. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-inputs.json +2 -2
  35. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/booking-inputs.json +21 -3
  36. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/estimation-fail.md +1 -1
  37. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/estimation-pass.md +4 -4
  38. package/plugins/solution-architect/skills/estimate/scripts/test/references.test.mjs +64 -6
  39. package/plugins/solution-architect/skills/estimate/scripts/test/render.test.mjs +96 -13
  40. package/plugins/solution-architect/skills/estimate/scripts/test/schema.test.mjs +105 -4
  41. package/plugins/solution-architect/skills/estimate/scripts/test/score-review.test.mjs +187 -0
  42. package/plugins/solution-architect/skills/estimate/scripts/test/scoring.test.mjs +49 -0
  43. package/plugins/solution-architect/skills/estimate/scripts/test/url-state.test.mjs +198 -0
  44. package/plugins/solution-architect/skills/estimate/scripts/test/validate.test.mjs +38 -0
  45. package/plugins/solution-architect/skills/estimate/scripts/test/xlsx-export.test.mjs +114 -28
  46. package/plugins/solution-architect/skills/new-lead/scripts/lib/map-nodes.mjs +1 -1
  47. package/plugins/solution-architect/skills/proposal/scripts/test/checks-client.test.mjs +2 -2
  48. package/plugins/solution-architect/skills/proposal/scripts/test/figures.test.mjs +1 -1
@@ -0,0 +1,363 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title><!-- slot:TITLE --> — score review</title>
7
+ <style>
8
+ :root {
9
+ color-scheme:light;
10
+ --paper:#e8ecef; --sheet:#fbfcfd; --ink:#141c24; --ink-dim:#5d6c78;
11
+ --rule:#d3dbe1; --grid:#edf1f4; --meter:#44586a; --mark:#b4232f; --mark-soft:#b4232f14;
12
+ --t-s:#dfe6ec; --t-s-ink:#4a5a68; --t-m:#c3d2df; --t-m-ink:#2b3d4c;
13
+ --t-l:#7d96ab; --t-l-ink:#fff; --t-xl:#2f4a60; --t-xl-ink:#fff;
14
+ --serif:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,"Liberation Serif",serif;
15
+ --sans:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
16
+ }
17
+ @media (prefers-color-scheme:dark) {
18
+ :root:not([data-theme="light"]) {
19
+ color-scheme:dark;
20
+ --paper:#11171c; --sheet:#1a2229; --ink:#e6ecf1; --ink-dim:#93a3b0;
21
+ --rule:#2c3740; --grid:#222c34; --meter:#8fa8bb; --mark:#e26c60; --mark-soft:#e26c6021;
22
+ --t-s:#263039; --t-s-ink:#9fb0bd; --t-m:#3a4a57; --t-m-ink:#d3dfe8;
23
+ --t-l:#7d96ab; --t-l-ink:#0f161b; --t-xl:#bacdda; --t-xl-ink:#0f161b;
24
+ }
25
+ }
26
+ :root[data-theme="dark"] {
27
+ color-scheme:dark;
28
+ --paper:#11171c; --sheet:#1a2229; --ink:#e6ecf1; --ink-dim:#93a3b0;
29
+ --rule:#2c3740; --grid:#222c34; --meter:#8fa8bb; --mark:#e26c60; --mark-soft:#e26c6021;
30
+ --t-s:#263039; --t-s-ink:#9fb0bd; --t-m:#3a4a57; --t-m-ink:#d3dfe8;
31
+ --t-l:#7d96ab; --t-l-ink:#0f161b; --t-xl:#bacdda; --t-xl-ink:#0f161b;
32
+ }
33
+ * { box-sizing:border-box; }
34
+ body {
35
+ margin:0; padding:2rem 1.5rem 4rem; background:var(--paper); color:var(--ink);
36
+ font-family:var(--sans); font-size:.9rem; line-height:1.5;
37
+ }
38
+ .page { max-width:78rem; margin:0 auto; }
39
+ :focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
40
+
41
+ /* ---- header ---- */
42
+ .head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; }
43
+ #theme {
44
+ flex:none; font-size:.78rem; font-weight:600; padding:.3rem .7rem; color:var(--ink-dim);
45
+ border:1px solid var(--rule); border-radius:.2rem; background:var(--sheet); cursor:pointer;
46
+ }
47
+ #theme:hover { color:var(--ink); border-color:var(--ink-dim); }
48
+ h1 { font-family:var(--serif); font-size:2.1rem; font-weight:600; letter-spacing:-.015em; margin:0; }
49
+ .sub { margin:.15rem 0 .9rem; color:var(--ink-dim); font-size:.82rem; }
50
+ .lead { margin:0 0 1.4rem; max-width:64ch; color:var(--ink-dim); }
51
+
52
+ /* ---- the spine: one dot per feature, placed on the total ---- */
53
+ .spine-wrap { max-width:46rem; background:var(--sheet); border:1px solid var(--rule); padding:.9rem 1rem .7rem; margin-bottom:2rem; }
54
+ .spine, .zones { display:grid; grid-template-columns:repeat(21,1fr); }
55
+ .spine { align-items:end; min-height:2.6rem; }
56
+ .spine .col { display:flex; flex-direction:column-reverse; align-items:center; gap:2px; border-left:1px solid var(--grid); }
57
+ .dot {
58
+ width:11px; height:11px; padding:0; border:1px solid var(--ink); border-radius:50%;
59
+ background:var(--sheet); cursor:pointer;
60
+ }
61
+ .dot span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
62
+ .dot:hover { background:var(--ink); }
63
+ .dot.changed { border-color:var(--mark); background:var(--mark); }
64
+ .zones { border-top:1px solid var(--rule); margin-top:.35rem; padding-top:.3rem; font-size:.72rem; color:var(--ink-dim); }
65
+ .zones span { border-left:1px solid var(--rule); padding-left:.35rem; }
66
+ .zones span:first-child { border-left:0; }
67
+ .zones b { font-weight:600; color:var(--ink); }
68
+ .spine-note { margin:.45rem 0 0; font-size:.75rem; color:var(--ink-dim); }
69
+
70
+ /* ---- feature bands ---- */
71
+ .feat { display:grid; grid-template-columns:16rem 1fr; gap:1.6rem; padding:1rem 0; border-top:1px solid var(--rule); }
72
+ .feat:last-child { border-bottom:1px solid var(--rule); }
73
+ .feat.flash { background:var(--sheet); }
74
+ .rail h2 { font-family:var(--serif); font-size:1.05rem; font-weight:600; margin:0 0 .15rem; }
75
+ .rail .meta { margin:0; font-size:.74rem; color:var(--ink-dim); }
76
+ .verdict { display:flex; align-items:center; gap:.5rem; margin:.6rem 0 .25rem; }
77
+ .total { font-variant-numeric:tabular-nums; font-size:.8rem; color:var(--ink-dim); }
78
+ .total b { font-size:1.05rem; color:var(--ink); }
79
+ .tier { font-size:.75rem; font-weight:600; padding:.1rem .45rem; border:1px solid var(--rule); border-radius:.2rem; }
80
+ .tier.t-s { background:var(--t-s); color:var(--t-s-ink); }
81
+ .tier.t-m { background:var(--t-m); color:var(--t-m-ink); }
82
+ .tier.t-l { background:var(--t-l); border-color:var(--t-l); color:var(--t-l-ink); }
83
+ .tier.t-xl { background:var(--t-xl); border-color:var(--t-xl); color:var(--t-xl-ink); }
84
+ .hint, .prov { margin:0; font-size:.74rem; color:var(--ink-dim); }
85
+ .prov.edited { color:var(--mark); }
86
+
87
+ /* ---- five factors ---- */
88
+ .factors { display:grid; grid-template-columns:repeat(auto-fit,minmax(9rem,1fr)); gap:.9rem 1.1rem; }
89
+ .factor label { display:flex; align-items:center; gap:.45rem; }
90
+ .flabel { font-size:.74rem; font-weight:600; color:var(--ink-dim); }
91
+ .factor select {
92
+ font:inherit; font-variant-numeric:tabular-nums; padding:.1rem .15rem;
93
+ border:1px solid var(--rule); border-radius:.2rem; background:var(--sheet); color:var(--ink);
94
+ }
95
+ .factor select.hot { font-weight:700; border-color:var(--meter); }
96
+ .meter { display:flex; gap:2px; margin:.3rem 0 .25rem; }
97
+ .meter i { flex:1; height:3px; background:var(--rule); }
98
+ .meter i.on { background:var(--meter); }
99
+ .cite { margin:0; font-size:.76rem; line-height:1.4; color:var(--ink-dim); }
100
+ .was { margin:.15rem 0 0; font-size:.72rem; color:var(--mark); }
101
+ .factor.changed select { border-color:var(--mark); background:var(--mark-soft); }
102
+ .factor.changed .cite { text-decoration:line-through; opacity:.55; }
103
+
104
+ /* ---- the note ---- */
105
+ .note { display:block; max-width:68ch; margin-top:.7rem; }
106
+ .note textarea {
107
+ display:block; width:100%; margin-top:.25rem; padding:.4rem .5rem; min-height:2.3rem; field-sizing:content;
108
+ font-family:var(--serif); font-size:.88rem; line-height:1.45; color:var(--ink);
109
+ border:1px solid var(--rule); border-radius:.2rem; background:var(--sheet); resize:vertical;
110
+ }
111
+
112
+ /* ---- guide + feedback ---- */
113
+ details.guide { margin:2rem 0 1.4rem; }
114
+ details.guide summary { cursor:pointer; font-weight:600; }
115
+ .guide-scroll { overflow-x:auto; }
116
+ .guide-table { min-width:34rem; border-collapse:collapse; width:100%; margin-top:.7rem; font-size:.78rem; background:var(--sheet); }
117
+ .guide-table th, .guide-table td { border:1px solid var(--rule); padding:.35rem .45rem; text-align:left; vertical-align:top; }
118
+ .guide-table th { font-weight:600; color:var(--ink-dim); }
119
+ .guide-table td.dim { font-weight:600; white-space:nowrap; }
120
+ #feedback-wrap { border-top:1px solid var(--rule); padding-top:1.2rem; }
121
+ #feedback-wrap h2 { font-family:var(--serif); font-size:1.1rem; font-weight:600; margin:0 0 .2rem; }
122
+ #feedback-wrap p { margin:0 0 .7rem; color:var(--ink-dim); font-size:.82rem; }
123
+ button {
124
+ font:inherit; font-weight:600; padding:.4rem .9rem; border:1px solid var(--ink);
125
+ border-radius:.2rem; background:var(--ink); color:var(--sheet); cursor:pointer;
126
+ }
127
+ button:hover { filter:brightness(.85); }
128
+ #copied { margin-left:.6rem; font-size:.8rem; color:var(--ink-dim); }
129
+ #feedback {
130
+ display:block; width:100%; min-height:6rem; margin-top:.8rem; padding:.5rem;
131
+ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.72rem;
132
+ border:1px solid var(--rule); background:var(--sheet); color:var(--ink-dim);
133
+ }
134
+
135
+ @media (max-width:820px) {
136
+ .feat { grid-template-columns:1fr; gap:.9rem; }
137
+ }
138
+ @media (prefers-reduced-motion:no-preference) {
139
+ .dot { transition:background .15s ease, border-color .15s ease; }
140
+ .feat { transition:background .5s ease; }
141
+ }
142
+ </style>
143
+ </head>
144
+ <body>
145
+ <div class="page">
146
+ <div class="head">
147
+ <div>
148
+ <h1><!-- slot:TITLE --></h1>
149
+ <p class="sub">Score review. <span id="tally"></span></p>
150
+ </div>
151
+ <button type="button" id="theme" aria-live="polite">Dark theme</button>
152
+ </div>
153
+ <p class="lead">Every score below is the agent's proposal. Hover a number to read the rubric sentence it
154
+ matched; the line under it is the evidence that score rests on. Change what reads wrong, rewrite the note
155
+ in your own words, then copy the feedback block at the bottom back into the chat.</p>
156
+
157
+ <div class="spine-wrap">
158
+ <div class="spine" id="spine"></div>
159
+ <div class="zones">
160
+ <span style="grid-column:1/8">S <b>&le;11</b></span>
161
+ <span style="grid-column:8/14">M <b>12&ndash;17</b></span>
162
+ <span style="grid-column:14/19">L <b>18&ndash;22</b></span>
163
+ <span style="grid-column:19/22">XL <b>23+</b></span>
164
+ </div>
165
+ <p class="spine-note">Each dot is one feature, placed on its total. Click a dot to jump to it; a red dot is one you changed.</p>
166
+ </div>
167
+
168
+ <div id="review"></div>
169
+
170
+ <details class="guide" open><summary>Scoring guide — what each 1–5 means</summary>
171
+ <div class="guide-scroll"><!-- slot:GUIDE --></div>
172
+ </details>
173
+
174
+ <div id="feedback-wrap">
175
+ <h2>Send it back</h2>
176
+ <p>Copy this block into the chat. The agent re-reads the rubric for every score you moved and asks why.</p>
177
+ <button type="button" id="copy">Copy feedback</button> <span id="copied" role="status" hidden>Copied. Paste it into the chat.</span>
178
+ <textarea id="feedback" readonly aria-label="feedback JSON"></textarea>
179
+ </div>
180
+ </div>
181
+ <script type="application/json" id="draft-data"><!-- slot:DATA --></script>
182
+ <script>
183
+ <!-- slot:MATH -->
184
+ const DRAFT = JSON.parse(document.getElementById('draft-data').textContent);
185
+ const KEYS = ['tech', 'size', 'deps', 'unc', 'risk'];
186
+ const LABELS = { tech: 'Tech', size: 'Size', deps: 'Deps', unc: 'Unc', risk: 'Risk' };
187
+ const NEXT_TIER = { 11: 'M', 17: 'L', 22: 'XL' };
188
+ const ORIGIN = { proposed: 'agent proposed', stated: 'reviewer changed' };
189
+ const MIN_TOTAL = 5;
190
+ const MAX_TOTAL = 25;
191
+ const esc = (s) => String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;');
192
+ const state = Object.fromEntries(DRAFT.features.map((f) => [f.id, {
193
+ scores: Object.fromEntries(KEYS.map((k) => [k, f.scores[k].n])), scoreNote: f.scoreNote,
194
+ }]));
195
+
196
+ // The number comes from `state`, never from the draft: a select that re-read
197
+ // f.scores[k].n would snap back to the agent's proposal and disagree with the
198
+ // Σ beside it. The anchor and cite stay the draft's — re-anchoring a changed
199
+ // score is the CLI's job, not the page's — so an edited cell strikes its old
200
+ // evidence through instead of showing it as if it explained the new score.
201
+ const STALE_TITLE = 'rubric sentence changes with the score — re-anchored when the agent reads this back';
202
+ const featureOf = (id) => DRAFT.features.find((f) => f.id === id);
203
+ const edited = (f) => KEYS.some((k) => state[f.id].scores[k] !== f.scores[k].n)
204
+ || state[f.id].scoreNote !== f.scoreNote;
205
+ const originText = (f) => (edited(f) ? 'you changed this' : ORIGIN[f.scoreProvenance] ?? '');
206
+ const hintFor = (total) => (NEXT_TIER[total] ? `one point from ${NEXT_TIER[total]}` : (total >= 23 ? 'big enough to split' : ''));
207
+ const meter = (n) => `<span class="meter" aria-hidden="true">${
208
+ [1, 2, 3, 4, 5].map((i) => `<i class="${i <= n ? 'on' : ''}"></i>`).join('')}</span>`;
209
+
210
+ function factorCell(f, k) {
211
+ const s = f.scores[k];
212
+ const n = state[f.id].scores[k];
213
+ const stale = n !== s.n;
214
+ const opts = [1, 2, 3, 4, 5].map((v) => `<option value="${v}"${v === n ? ' selected' : ''}>${v}</option>`).join('');
215
+ return `<div class="factor${stale ? ' changed' : ''}">
216
+ <label><span class="flabel">${LABELS[k]}</span><select data-id="${esc(f.id)}" data-key="${k}"
217
+ class="${n === 5 ? 'hot' : ''}" title="${stale ? STALE_TITLE : esc(s.anchor)}">${opts}</select></label>
218
+ ${meter(n)}
219
+ <p class="cite">${esc(s.cite)}</p>
220
+ <p class="was">${stale ? `changed from ${s.n}` : ''}</p>
221
+ </div>`;
222
+ }
223
+
224
+ function rail(f) {
225
+ const { total, tier } = tierFor(state[f.id].scores);
226
+ return `<div class="rail">
227
+ <h2>${esc(f.name)}</h2>
228
+ <p class="meta">${esc(f.id)}</p>
229
+ <p class="verdict"><span class="total">&Sigma; <b data-total="${esc(f.id)}">${total}</b></span>
230
+ <span class="tier t-${tier.toLowerCase()}" data-tier="${esc(f.id)}">${tier}</span></p>
231
+ <p class="hint" data-hint="${esc(f.id)}">${hintFor(total)}</p>
232
+ <p class="prov${edited(f) ? ' edited' : ''}" data-prov="${esc(f.id)}">${originText(f)}</p>
233
+ </div>`;
234
+ }
235
+
236
+ function band(f) {
237
+ return `<article class="feat" id="feat-${esc(f.id)}">${rail(f)}
238
+ <div class="body">
239
+ <div class="factors">${KEYS.map((k) => factorCell(f, k)).join('')}</div>
240
+ <label class="note"><span class="flabel">Why this tier, in plain words for the client</span>
241
+ <textarea data-note="${esc(f.id)}">${esc(state[f.id].scoreNote)}</textarea></label>
242
+ </div>
243
+ </article>`;
244
+ }
245
+
246
+ function dotsAt(total) {
247
+ return DRAFT.features.filter((f) => tierFor(state[f.id].scores).total === total)
248
+ .map((f) => `<button type="button" class="dot${edited(f) ? ' changed' : ''}" data-goto="${esc(f.id)}"
249
+ title="${esc(f.name)} — &Sigma; ${total}"><span>${esc(f.name)}</span></button>`).join('');
250
+ }
251
+
252
+ function tallyText() {
253
+ const n = DRAFT.features.filter(edited).length;
254
+ const features = `${DRAFT.features.length} ${DRAFT.features.length === 1 ? 'feature' : 'features'}.`;
255
+ return `${features} ${n === 0 ? 'Nothing changed yet.' : `${n} changed.`}`;
256
+ }
257
+
258
+ // The spine, the tally and the feedback block all read every feature, so they
259
+ // refresh together whenever any one score or note moves.
260
+ function refreshSpine() {
261
+ const cols = [];
262
+ for (let t = MIN_TOTAL; t <= MAX_TOTAL; t += 1) cols.push(`<div class="col">${dotsAt(t)}</div>`);
263
+ document.getElementById('spine').innerHTML = cols.join('');
264
+ document.getElementById('tally').textContent = tallyText();
265
+ document.getElementById('feedback').value = JSON.stringify(window.__feedback(), null, 1);
266
+ }
267
+
268
+ // Surgical, not a full rebuild: the reviewer is standing in this select with
269
+ // the keyboard, and re-rendering the page under them would drop the focus and
270
+ // the scroll position on every arrow press.
271
+ function syncCell(sel) {
272
+ const s = featureOf(sel.dataset.id).scores[sel.dataset.key];
273
+ const n = Number(sel.value);
274
+ const cell = sel.closest('.factor');
275
+ const stale = n !== s.n;
276
+ cell.classList.toggle('changed', stale);
277
+ sel.classList.toggle('hot', n === 5);
278
+ sel.title = stale ? STALE_TITLE : s.anchor;
279
+ cell.querySelector('.meter').outerHTML = meter(n);
280
+ cell.querySelector('.was').textContent = stale ? `changed from ${s.n}` : '';
281
+ }
282
+
283
+ function syncBand(id) {
284
+ const f = featureOf(id);
285
+ const { total, tier } = tierFor(state[id].scores);
286
+ const pick = (attr) => document.querySelector(`[data-${attr}="${CSS.escape(id)}"]`);
287
+ pick('total').textContent = total;
288
+ const chip = pick('tier');
289
+ chip.textContent = tier;
290
+ chip.className = `tier t-${tier.toLowerCase()}`;
291
+ pick('hint').textContent = hintFor(total);
292
+ const prov = pick('prov');
293
+ prov.textContent = originText(f);
294
+ prov.classList.toggle('edited', edited(f));
295
+ refreshSpine();
296
+ }
297
+
298
+ window.__feedback = () => ({ features: DRAFT.features.map((f) => ({ id: f.id, ...state[f.id] })) });
299
+
300
+ function onChange(e) {
301
+ const sel = e.target.closest('select[data-id]');
302
+ const note = e.target.closest('textarea[data-note]');
303
+ if (sel) {
304
+ state[sel.dataset.id].scores[sel.dataset.key] = Number(sel.value);
305
+ syncCell(sel);
306
+ syncBand(sel.dataset.id);
307
+ }
308
+ if (note) {
309
+ state[note.dataset.note].scoreNote = note.value;
310
+ syncBand(note.dataset.note);
311
+ }
312
+ }
313
+
314
+ function goTo(id) {
315
+ const el = document.getElementById(`feat-${id}`);
316
+ if (!el) return;
317
+ const still = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
318
+ el.scrollIntoView({ behavior: still ? 'auto' : 'smooth', block: 'center' });
319
+ el.classList.add('flash');
320
+ setTimeout(() => el.classList.remove('flash'), 900);
321
+ }
322
+
323
+ // The reader's choice outlives the page; a browser that refuses storage
324
+ // (file:// in some setups) still gets a toggle that works for this sitting.
325
+ const THEME_KEY = 'scores-review-theme';
326
+ const stored = (() => { try { return localStorage.getItem(THEME_KEY); } catch { return null; } })();
327
+ const systemDark = () => window.matchMedia('(prefers-color-scheme: dark)').matches;
328
+ const themeBtn = document.getElementById('theme');
329
+
330
+ function applyTheme(mode) {
331
+ const dark = mode ? mode === 'dark' : systemDark();
332
+ if (mode) document.documentElement.dataset.theme = mode;
333
+ themeBtn.textContent = dark ? 'Light theme' : 'Dark theme';
334
+ themeBtn.dataset.dark = String(dark);
335
+ }
336
+
337
+ themeBtn.addEventListener('click', () => {
338
+ const next = themeBtn.dataset.dark === 'true' ? 'light' : 'dark';
339
+ applyTheme(next);
340
+ try { localStorage.setItem(THEME_KEY, next); } catch { /* this sitting only */ }
341
+ });
342
+ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
343
+ if (!document.documentElement.dataset.theme) applyTheme(null);
344
+ });
345
+ applyTheme(stored === 'dark' || stored === 'light' ? stored : null);
346
+
347
+ document.getElementById('review').addEventListener('change', onChange);
348
+ document.getElementById('review').addEventListener('input', onChange);
349
+ document.getElementById('spine').addEventListener('click', (e) => {
350
+ const dot = e.target.closest('[data-goto]');
351
+ if (dot) goTo(dot.dataset.goto);
352
+ });
353
+ document.getElementById('copy').addEventListener('click', async () => {
354
+ const text = JSON.stringify(window.__feedback());
355
+ document.getElementById('feedback').value = text;
356
+ try { await navigator.clipboard.writeText(text); document.getElementById('copied').hidden = false; } catch { /* file:// may refuse; the textarea holds it */ }
357
+ });
358
+
359
+ document.getElementById('review').innerHTML = DRAFT.features.map(band).join('');
360
+ refreshSpine();
361
+ </script>
362
+ </body>
363
+ </html>
@@ -79,16 +79,12 @@ overall. The CRUD tasks might be 20% of total hours; the other 80% is
79
79
  `logic` and `novel` work where AI barely moves the needle. Blending at the
80
80
  project level erases that mix and produces a number nobody can defend.
81
81
 
82
- ## Claude Code plan pricing (checked 2026-08, update on renewal)
82
+ ## Tooling seat cost
83
83
 
84
- | Plan | USD/seat/month | Constant |
85
- | --- | --- | --- |
86
- | none | 0 | PLAN_PRICES.none |
87
- | Max 5x | 100 | PLAN_PRICES.max5x |
88
- | Max 20x | 200 | PLAN_PRICES.max20x |
89
-
90
- Prices are a manually maintained snapshot. When they change, update BOTH this
91
- table and PLAN_PRICES in scripts/lib/estimate-math.mjs in the same commit.
84
+ Seat pricing is an interview input (`toolingCostPerSeat`, per seat per
85
+ month, any vendor), not a constant — see `interview.md` §4 question 5. It
86
+ prices `toolingCost = months × seat cost × team size` and never touches
87
+ hours; only `aiAssisted` gates the per-category reduction above.
92
88
 
93
89
  ## Sources
94
90
 
@@ -32,14 +32,23 @@ before scope confirmation and before any factor scoring.
32
32
  | --- | --- | --- |
33
33
  | QUICK | feature-level factor-scored tiering only | ±wide |
34
34
  | STANDARD | task-level three-point PERT | ± moderate |
35
- | DEEP | STANDARD plus per-scenario detail (multiple team/plan combinations sized individually) | ± narrower |
35
+ | DEEP | STANDARD plus per-scenario detail (multiple team/AI-assistance combinations sized individually) | ± narrower |
36
36
 
37
- ## 2b. Delivery mode — ask second
37
+ ## 2b. Delivery mode — assume second, ask only to leave it
38
38
 
39
39
  | Mode | Meaning | Sizing path |
40
40
  | --- | --- | --- |
41
+ | AGENTIC (default) | AI coding agents write the code, humans plan and review | measurement-based (`agentic-estimation.md`) |
41
42
  | TRADITIONAL | humans write the code | technique menu (`techniques.md`) |
42
- | AGENTIC | AI coding agents write the code, humans plan and review | measurement-based (`agentic-estimation.md`) |
43
+
44
+ Assume **AGENTIC**; ask only "humans writing the code?" as the opt-out, the
45
+ same shape as the AI-assistance question in §5. A client who is hand-writing
46
+ the code will say so; one who is not should not have to answer for it every
47
+ interview.
48
+
49
+ Write `deliveryMode` into `estimation-inputs.json` either way, explicitly. An
50
+ absent field still reads as traditional, which is what estimates written
51
+ before this default relied on — the interview no longer leaves it to that.
43
52
 
44
53
  AGENTIC replaces the technique question and AI-category scoring entirely.
45
54
  Follow-ups it adds: which agent + model executes (calibration context,
@@ -77,17 +86,128 @@ Ask one thing at a time, in this order:
77
86
  entirely (the `milestone` field stays off every feature). Ordering
78
87
  provenance is `proposed` unless the client stated the order — then
79
88
  `stated`, recorded in the deliverable's Roadmap section.
80
- 3. **Factor scores per feature** — five factors, each scored 1-5: tech
81
- complexity, feature size, dependencies, uncertainty, risk. (STANDARD/DEEP
82
- also want task-level O/M/P — see `techniques.md`.) TRADITIONAL-only: in
83
- AGENTIC mode this step is replaced entirely — ask shape + scope + seed
84
- minutes per task instead (§2b, `task-shapes.md`).
85
- 4. **Team options + rates + seniority mix** — how many engineers, what they
86
- cost per hour, and whether each is junior/mid/senior.
87
- 5. **Claude plan availability** — none / Max 5x / Max 20x, per scenario.
89
+ 3. **Factor scores per feature** — all depths. Read
90
+ `references/scoring-guide.md` first; every anchor you show is quoted from
91
+ it verbatim, never paraphrased. TRADITIONAL-only: in AGENTIC mode this
92
+ step is replaced entirely — ask shape + scope + seed minutes per task
93
+ instead (§2b, `task-shapes.md`).
94
+
95
+ **Review channel** — ask once, before the first card, with a one-line
96
+ reason per option and a recommendation from the feature count
97
+ (≤ 8 → terminal, 9–14 → csv, 15+ → html; the human overrides freely):
98
+
99
+ ```text
100
+ 25 features to score. How do you want to review them?
101
+ 1. terminal cards here, 4–6 per turn, reply "accept" or "F03 deps 4"
102
+ — fastest for ≤ 8 features, no file to open
103
+ 2. csv I write scores-draft.csv, you edit in Sheets/Excel, say "done"
104
+ — all rows on one screen, notes column, fits the workbook habit
105
+ 3. html I write scores-review.html, you open it, set dropdowns, copy
106
+ the feedback block back here
107
+ — anchor on hover, a plot of where every feature lands,
108
+ best for 15+ features
109
+ Recommended: 2 (25 features).
110
+ ```
111
+
112
+ For csv and html, write your proposals as `draft.json` (`{ project,
113
+ features: [{ id, name, scores, scoreNote, scoreProvenance }] }`), then
114
+ `node scripts/score-review.mjs --write draft.json --format csv|html --out
115
+ <file>`. When the human says done, `node scripts/score-review.mjs --read
116
+ <file> --draft draft.json` prints the diff and the re-anchored features;
117
+ report the diff (`3 changes: F07 risk 5→4, … — all stated. Σ moves F12 to
118
+ L. Proceed?`) before writing them into `estimation-inputs.json`.
119
+
120
+ **html channel — the page ships designed.** `--write --format html`
121
+ renders the reviewer page from `assets/scores-review-template.html`,
122
+ which is the deliverable, not a baseline to redesign. Write it into the
123
+ lead directory and hand the human the path; do not run a design pass on
124
+ it per lead. Any edit to the template keeps the read-back contract or
125
+ `--read` cannot parse the feedback: one `<select data-id="<feature id>"
126
+ data-key="<tech|size|deps|unc|risk>">` per score (values 1–5, `title` =
127
+ the rubric anchor), `[data-total="<id>"]` and `[data-tier="<id>"]` text
128
+ updated on change, one `<textarea data-note="<id>">` for the plain note,
129
+ `window.__feedback()` returning `{ features: [{ id, scores: { k: n },
130
+ scoreNote }] }`, a `#feedback` textarea holding that JSON and a `#copy`
131
+ button that puts it on the clipboard, and the scoring guide visible on
132
+ the page.
133
+
134
+ **Cards** (terminal channel, and the shape every channel's row carries):
135
+ one per feature, 4–6 per turn, every cell filled from evidence you already
136
+ read, cite inline. The human answers `accept`, `<factor> <n>`, `why
137
+ <text>`, or `split`.
138
+
139
+ ```text
140
+ ┌ F07 Payment reconciliation ──────────────────────────────────── proposed ┐
141
+ │ Tech 4 Non-trivial algorithms, real-time systems, ML inference, │
142
+ │ complex data transforms │
143
+ │ ← ARCHITECTURE.md §6: fuzzy match bank rows to invoices │
144
+ │ Size 3 Medium feature with multiple components and backend logic │
145
+ │ ← PRD §4.2: 3 screens + nightly job │
146
+ │ Deps 4 Multiple third-party APIs or tightly coupled internal systems │
147
+ │ ← Stripe API + bank CSV import │
148
+ │ Unc 3 Some open questions, design decisions to be made during build │
149
+ │ ← PRD §4.2: "reconciliation rules undecided" │
150
+ │ Risk 5 Core infrastructure, compliance requirements, irreversible ops │
151
+ │ ← payments; rubric puts payments at 4–5, chose 5: irreversible │
152
+ │ Σ 19 → L → 160–400 h │
153
+ │ Why (client): handles payments and two outside services; matching │
154
+ │ rules still to be decided │
155
+ │ accept · change <factor> <n> · why <text> · split │
156
+ └───────────────────────────────────────────────────────────────────────────┘
157
+ ```
158
+
159
+ Rules: the anchor is the guide's full sentence for that factor and score;
160
+ the cite quotes the fact it rests on; no evidence for a factor → the cell
161
+ is `?` and you ask, never a silent 3. Σ at 11, 17 or 22 shows `one point
162
+ from <tier>; <factor> +1 moves this to <band>`; Σ > 22 recommends `split`
163
+ before `accept`; any 5 shows `review`. `Why` is one plain sentence for a
164
+ non-technical reader — what the feature touches and what is still
165
+ unknown; no file names, no factor names, no rubric wording. `split`
166
+ returns to the clear-vs-assumed gate (the loop rule, §5).
167
+
168
+ **Writing it down.** STANDARD/DEEP: every feature gets `scores` (per
169
+ factor `{ n, anchor, cite }`), `scoreNote` (the `Why` sentence) and
170
+ `scoreProvenance` — `proposed` when accepted as offered, `stated` when
171
+ any cell or the note was changed. QUICK: use the scores for the tier and
172
+ the calibration band as today; do not write them (`schema.mjs` refuses
173
+ them at QUICK).
174
+
175
+ **Ask why.** A changed score keeps a cite that argued for the *old*
176
+ number, so every entry in `--read`'s `needsReason` list is a question you
177
+ owe the reviewer before writing: show the old anchor with its cite, the
178
+ new anchor, and ask what makes it that score. Use `AskUserQuestion` when
179
+ available — one question per changed cell, up to four per call, with
180
+ your best guesses at the reason as options plus "keep it, no reason" and
181
+ "agree — back to <old>" — and plain chat otherwise. The answer becomes
182
+ the cite as `reviewer: <answer>`. You may push back **once** when the
183
+ answer contradicts evidence you read (quote it); the reviewer's second
184
+ word is final. Declining is allowed: write `reviewer: no reason given` so
185
+ the gap is visible on the page and in the Score Rationale tab, and never
186
+ ask twice. A rewritten `Why` sentence needs no reason — it is the
187
+ reviewer's own words.
188
+
189
+ 3b. **Tasks + O/M/P** — STANDARD/DEEP only, per `techniques.md` §3. After a
190
+ feature's tasks are sized, compare `Σ pert(e)` with its tier's calibration
191
+ band. Outside the band, say so once — `Σ19 → L → 160–400 h, tasks sum to
192
+ 85 h; tasks missing or scores high?` — and let the human decide. Nothing
193
+ is refused and nothing new is written; the page marks the row ⚠.
194
+ 4. **Team + rates + seniority mix** — how many engineers, what they cost
195
+ per hour, and whether each is junior/mid/senior. Default is **one team**
196
+ → one scenario; ask "compare staffing options?" and only then collect
197
+ more rosters. With two or more, ask why the recommended one wins and
198
+ write it to `recommendedReason` — the page shows a choice it must be
199
+ able to explain.
200
+ 5. **AI-assisted delivery** — per scenario, default **yes**; ask only
201
+ "humans unaided?" as the opt-out. Then **tooling cost per seat per
202
+ month** — one number, vendor-neutral (a Claude Max seat, Codex, Cursor —
203
+ whatever the client will actually run), written to `toolingCostPerSeat`.
204
+ The human may skip it: write `null` and add an assumption to the gate
205
+ whose text names the tooling cost gap and its impact-if-wrong (~2% of
206
+ total at typical seat prices). The validator refuses a null seat cost on
207
+ an AI-assisted scenario without that assumption.
88
208
  6. **Deadline / constraints** — any hard date or budget ceiling.
89
209
  7. **calibration table** — ask for the org's own tier → hour-band history; if
90
- none exists, offer the defaults `S 20-60h, M 60-160h, L 160-400h`.
210
+ none exists, offer the defaults `S 20-60h, M 60-160h, L 160-400h, XL 400-800h`.
91
211
  8. **Expose-rates-to-client** — y/n; controls whether the client-facing render
92
212
  shows labor rates or only totals.
93
213
 
@@ -0,0 +1,23 @@
1
+ # Scoring guide — five factors, 1–5 each
2
+
3
+ Read before proposing any score (interview step 3). Every anchor below is
4
+ quoted verbatim on a score card, in `estimation-inputs.json`
5
+ (`scores.<factor>.anchor`), on the page and in the xlsx Score Rationale tab.
6
+ `schema.mjs` refuses an anchor that is not one of these sentences.
7
+
8
+ | Dimension | 1 | 2 | 3 | 4 | 5 |
9
+ | --- | --- | --- | --- | --- | --- |
10
+ | Tech complexity | Standard CRUD, well-documented library usage, copy-paste patterns | Minor customisation of standard patterns, simple state management | Custom business logic, moderate algorithm complexity, multiple states | Non-trivial algorithms, real-time systems, ML inference, complex data transforms | Novel architecture, distributed systems, low-level optimisation, R&D territory |
11
+ | Feature size | Single UI element or micro-function, <1 day of work | Small self-contained feature, simple form or display component | Medium feature with multiple components and backend logic | Large feature spanning frontend, backend, DB, and tests | Epic-scale feature, multiple sub-features or screens |
12
+ | Dependencies | Fully standalone, no external services or shared state | One internal dependency (e.g. auth check) | 2–3 internal services or one third-party API | Multiple third-party APIs or tightly coupled internal systems | Deep cross-system dependencies, legacy integrations, or shared infrastructure changes |
13
+ | Uncertainty | Fully defined spec, clear acceptance criteria, precedent exists | Minor ambiguities, can be resolved with one clarifying question | Some open questions, design decisions to be made during build | Significant unknowns, exploratory work needed, spec may change | Highly experimental, no clear solution path, outcomes unclear |
14
+ | Risk | Fully reversible, no user data, isolated module | Low stakes, easy rollback, minimal user impact | Moderate impact if broken, requires testing, affects multiple users | Payments, auth, data migrations, or PII — high business impact | Core infrastructure, compliance requirements, irreversible operations |
15
+
16
+ Tier scale (sum of the five scores): S ≤ 11 · M 12–17 · L 18–22 · XL 23+.
17
+ Default calibration bands when the org has no history: S 20–60 h · M 60–160 h
18
+ · L 160–400 h · XL 400–800 h. A card at Σ 11, 17 or 22 sits one point from
19
+ the next tier and says so; Σ 23+ recommends splitting the feature.
20
+
21
+ Provenance: a score the human accepted as the agent proposed it is
22
+ `proposed`; a score the human changed — or a rewritten plain-words note — is
23
+ `stated`. One `scoreProvenance` per feature: `stated` if any cell changed.
@@ -29,14 +29,21 @@ yet. This is also the technique QUICK depth commits to. Score each feature
29
29
  - uncertainty
30
30
  - risk
31
31
 
32
- Sum the five scores per feature. Tier breaks: ≤10 S / 11-17 M / ≥18 L.
32
+ Sum the five scores per feature. Tier breaks: ≤11 S / 12–17 M / 18–22 L / 23+ XL
33
+ (the team workbook's scale; `TIER_BREAKS` in `estimate-math.mjs`).
33
34
 
34
35
  A tier is not itself an hour figure. It is looked up against the
35
36
  **calibration table** — the org's own historical tier → hour-band data if
36
37
  supplied during the interview, or the defaults `S 20-60h, M 60-160h, L
37
- 160-400h` if not. The calibration table is what turns "this is an M" into a
38
+ 160-400h, XL 400-800h` if not. The calibration table is what turns "this is an M" into a
38
39
  number; never assign hours from the tier letter directly.
39
40
 
41
+ At STANDARD/DEEP the five scores are persisted on every feature (`scores`,
42
+ `scoreNote`, `scoreProvenance` — `interview.md` §4 step 3) and the PERT
43
+ total per feature is a soft cross-check against the tier's band: outside it,
44
+ the interviewer says so once and the page marks the row ⚠; nothing is
45
+ refused. Scores are never derived from hours.
46
+
40
47
  At QUICK depth this is the only technique in play, so the tier still has to
41
48
  reach `compute.mjs` through the normal task-shaped path: for each feature,
42
49
  write exactly one synthetic task whose `o`/`m`/`p` are the calibration