@v11g/agents-rock 1.0.4 → 1.0.5

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 +9 -5
  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 +610 -601
  8. package/plugins/solution-architect/skills/estimate/assets/scores-review-template.html +118 -0
  9. package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +5 -9
  10. package/plugins/solution-architect/skills/estimate/references/interview.md +121 -10
  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 +21 -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 +61 -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 +93 -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,118 @@
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
+ --bg:#f7f5f0; --ink:#1c1b18; --ink-dim:#6f6a5e;
11
+ --accent:#0f766e; --accent-ink:#0b5a54; --accent-soft:rgba(15,118,110,.08);
12
+ --warn:#b45309; --warn-soft:rgba(180,83,9,.1);
13
+ --bad:#b91c1c; --card:#fffdf9; --border:#e6e1d5;
14
+ }
15
+ * { box-sizing:border-box; }
16
+ body { margin:0; padding:1.5rem; font-family:system-ui,sans-serif; font-size:.9rem; background:var(--bg); color:var(--ink); }
17
+ h1 { font-size:1.2rem; margin:0 0 .3rem; }
18
+ p.lead { color:var(--ink-dim); margin:0 0 1rem; max-width:60rem; }
19
+ table { border-collapse:collapse; width:100%; background:var(--card); }
20
+ th, td { border-bottom:1px solid var(--border); padding:.4rem .5rem; text-align:left; vertical-align:top; }
21
+ th.score, td.score { text-align:center; width:3.6rem; }
22
+ td.score select { font:inherit; font-family:ui-monospace,monospace; width:3.2rem; text-align:center; }
23
+ td.score select.hot { color:var(--bad); font-weight:600; }
24
+ .tier { font-family:ui-monospace,monospace; font-size:.72rem; font-weight:600; padding:.12rem .45rem; border-radius:.25rem; background:var(--border); }
25
+ .tier.l { background:var(--warn-soft); color:var(--warn); }
26
+ .tier.xl { background:rgba(185,28,28,.1); color:var(--bad); }
27
+ .edge { color:var(--warn); cursor:help; margin-left:.15rem; }
28
+ .cite { color:var(--ink-dim); font-size:.78rem; }
29
+ .cite.stale { opacity:.5; }
30
+ td.note textarea { width:100%; min-height:2.6rem; font:inherit; font-size:.82rem; }
31
+ details.guide { margin:1.2rem 0; }
32
+ details.guide summary { cursor:pointer; font-weight:600; color:var(--ink-dim); }
33
+ .guide-table { font-size:.8rem; margin-top:.6rem; }
34
+ .guide-table td.dim { font-weight:600; white-space:nowrap; }
35
+ #feedback-wrap { margin-top:1.2rem; }
36
+ #feedback { width:100%; min-height:7rem; font-family:ui-monospace,monospace; font-size:.75rem; }
37
+ button { font:inherit; padding:.35rem .8rem; border:1px solid var(--border); border-radius:.3rem; background:var(--card); cursor:pointer; }
38
+ button:hover { border-color:var(--accent); color:var(--accent-ink); }
39
+ </style>
40
+ </head>
41
+ <body>
42
+ <h1><!-- slot:TITLE --> — score review</h1>
43
+ <p class="lead">Each score is the agent's proposal; hover a dropdown for the rubric sentence it matched, read the evidence beside it. Change any cell, rewrite the plain-words note if it reads wrong, then copy the feedback block back into the chat.</p>
44
+ <div id="review"></div>
45
+ <details class="guide" open><summary>Scoring guide — what each 1–5 means</summary><!-- slot:GUIDE --></details>
46
+ <div id="feedback-wrap">
47
+ <button type="button" id="copy">copy feedback</button> <span id="copied" hidden>copied</span>
48
+ <textarea id="feedback" readonly aria-label="feedback JSON"></textarea>
49
+ </div>
50
+ <script type="application/json" id="draft-data"><!-- slot:DATA --></script>
51
+ <script>
52
+ <!-- slot:MATH -->
53
+ const DRAFT = JSON.parse(document.getElementById('draft-data').textContent);
54
+ const KEYS = ['tech', 'size', 'deps', 'unc', 'risk'];
55
+ const LABELS = { tech: 'Tech', size: 'Size', deps: 'Deps', unc: 'Unc', risk: 'Risk' };
56
+ const EDGE = [11, 17, 22];
57
+ const esc = (s) => String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;');
58
+ const state = Object.fromEntries(DRAFT.features.map((f) => [f.id, {
59
+ scores: Object.fromEntries(KEYS.map((k) => [k, f.scores[k].n])), scoreNote: f.scoreNote,
60
+ }]));
61
+
62
+ // The number comes from `state`, never from the draft: render() rebuilds the
63
+ // whole table, so a select that re-read f.scores[k].n would snap back to the
64
+ // agent's proposal and disagree with the Σ beside it. The anchor and cite stay
65
+ // the draft's — re-anchoring a changed score is the CLI's job, not the page's
66
+ // — so an edited cell says so instead of showing the old score's sentence as
67
+ // if it explained the new one.
68
+ const STALE_TITLE = 'rubric sentence changes with the score — re-anchored when the agent reads this back';
69
+
70
+ function scoreCell(f, k) {
71
+ const s = f.scores[k];
72
+ const n = state[f.id].scores[k];
73
+ const stale = n !== s.n;
74
+ const opts = [1, 2, 3, 4, 5].map((v) => `<option value="${v}"${v === n ? ' selected' : ''}>${v}</option>`).join('');
75
+ return `<td class="score"><select data-id="${esc(f.id)}" data-key="${k}" class="${n === 5 ? 'hot' : ''}"
76
+ title="${stale ? STALE_TITLE : esc(s.anchor)}">${opts}</select><div class="cite${stale ? ' stale' : ''}">${esc(s.cite)}</div></td>`;
77
+ }
78
+
79
+ function row(f) {
80
+ const { total, tier } = tierFor(state[f.id].scores);
81
+ const edge = EDGE.includes(total) ? ' <span class="edge" title="one point from the next tier">&#9873;</span>' : '';
82
+ return `<tr><td><strong>${esc(f.name)}</strong><div class="cite">${esc(f.id)} · ${esc(f.scoreProvenance)}</div></td>
83
+ ${KEYS.map((k) => scoreCell(f, k)).join('')}
84
+ <td class="score"><span data-total="${esc(f.id)}">${total}</span>${edge}</td>
85
+ <td class="score"><span class="tier ${tier.toLowerCase()}" data-tier="${esc(f.id)}">${tier}</span></td>
86
+ <td class="note"><textarea data-note="${esc(f.id)}" aria-label="why this tier">${esc(state[f.id].scoreNote)}</textarea></td></tr>`;
87
+ }
88
+
89
+ function render() {
90
+ const head = `<tr><th>Feature</th>${KEYS.map((k) => `<th class="score">${LABELS[k]}</th>`).join('')}
91
+ <th class="score">&Sigma;</th><th class="score">Tier</th><th>Why this tier (plain words, for the client)</th></tr>`;
92
+ document.getElementById('review').innerHTML = `<table><thead>${head}</thead><tbody>${DRAFT.features.map(row).join('')}</tbody></table>`;
93
+ document.getElementById('feedback').value = JSON.stringify(window.__feedback(), null, 1);
94
+ }
95
+
96
+ window.__feedback = () => ({ features: DRAFT.features.map((f) => ({ id: f.id, ...state[f.id] })) });
97
+
98
+ function onChange(e) {
99
+ const sel = e.target.closest('select[data-id]');
100
+ const note = e.target.closest('textarea[data-note]');
101
+ if (sel) state[sel.dataset.id].scores[sel.dataset.key] = Number(sel.value);
102
+ if (note) state[note.dataset.note].scoreNote = note.value;
103
+ if (sel || note) render();
104
+ }
105
+
106
+ document.getElementById('review').addEventListener('change', onChange);
107
+ document.getElementById('review').addEventListener('input', (e) => {
108
+ if (e.target.matches('textarea[data-note]')) state[e.target.dataset.note].scoreNote = e.target.value;
109
+ });
110
+ document.getElementById('copy').addEventListener('click', async () => {
111
+ const text = JSON.stringify(window.__feedback());
112
+ document.getElementById('feedback').value = text;
113
+ try { await navigator.clipboard.writeText(text); document.getElementById('copied').hidden = false; } catch { /* file:// may refuse; the textarea holds it */ }
114
+ });
115
+ render();
116
+ </script>
117
+ </body>
118
+ </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,7 +32,7 @@ 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
37
  ## 2b. Delivery mode — ask second
38
38
 
@@ -77,17 +77,128 @@ Ask one thing at a time, in this order:
77
77
  entirely (the `milestone` field stays off every feature). Ordering
78
78
  provenance is `proposed` unless the client stated the order — then
79
79
  `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.
80
+ 3. **Factor scores per feature** — all depths. Read
81
+ `references/scoring-guide.md` first; every anchor you show is quoted from
82
+ it verbatim, never paraphrased. TRADITIONAL-only: in AGENTIC mode this
83
+ step is replaced entirely — ask shape + scope + seed minutes per task
84
+ instead (§2b, `task-shapes.md`).
85
+
86
+ **Review channel** — ask once, before the first card, with a one-line
87
+ reason per option and a recommendation from the feature count
88
+ (≤ 8 → terminal, 9–14 → csv, 15+ → html; the human overrides freely):
89
+
90
+ ```text
91
+ 25 features to score. How do you want to review them?
92
+ 1. terminal cards here, 4–6 per turn, reply "accept" or "F03 deps 4"
93
+ — fastest for ≤ 8 features, no file to open
94
+ 2. csv I write scores-draft.csv, you edit in Sheets/Excel, say "done"
95
+ — all rows on one screen, notes column, fits the workbook habit
96
+ 3. html I write scores-review.html, you open it, set dropdowns, copy
97
+ the feedback block back here
98
+ — anchor text on hover, edge/XL badges, best for 15+ features
99
+ Recommended: 2 (25 features).
100
+ ```
101
+
102
+ For csv and html, write your proposals as `draft.json` (`{ project,
103
+ features: [{ id, name, scores, scoreNote, scoreProvenance }] }`), then
104
+ `node scripts/score-review.mjs --write draft.json --format csv|html --out
105
+ <file>`. When the human says done, `node scripts/score-review.mjs --read
106
+ <file> --draft draft.json` prints the diff and the re-anchored features;
107
+ report the diff (`3 changes: F07 risk 5→4, … — all stated. Σ moves F12 to
108
+ L. Proceed?`) before writing them into `estimation-inputs.json`.
109
+
110
+ **html channel — design it there.** The page `--write --format html`
111
+ produces is a functional baseline, not the deliverable. After writing it
112
+ into the lead directory, invoke the `frontend-design:frontend-design`
113
+ skill on that file so the reviewer gets a page designed for the job.
114
+ Whatever the redesign does, it must keep the read-back contract or
115
+ `--read` cannot parse the feedback: one `<select data-id="<feature id>"
116
+ data-key="<tech|size|deps|unc|risk>">` per score (values 1–5, `title` =
117
+ the rubric anchor), `[data-total="<id>"]` and `[data-tier="<id>"]` text
118
+ updated on change, one `<textarea data-note="<id>">` for the plain note,
119
+ `window.__feedback()` returning `{ features: [{ id, scores: { k: n },
120
+ scoreNote }] }`, a `#feedback` textarea holding that JSON and a `#copy`
121
+ button that puts it on the clipboard, and the scoring guide visible on
122
+ the page. Do not run the design skill on the template in this skill's
123
+ `assets/` — that copy stays the baseline every lead starts from.
124
+
125
+ **Cards** (terminal channel, and the shape every channel's row carries):
126
+ one per feature, 4–6 per turn, every cell filled from evidence you already
127
+ read, cite inline. The human answers `accept`, `<factor> <n>`, `why
128
+ <text>`, or `split`.
129
+
130
+ ```text
131
+ ┌ F07 Payment reconciliation ──────────────────────────────────── proposed ┐
132
+ │ Tech 4 Non-trivial algorithms, real-time systems, ML inference, │
133
+ │ complex data transforms │
134
+ │ ← ARCHITECTURE.md §6: fuzzy match bank rows to invoices │
135
+ │ Size 3 Medium feature with multiple components and backend logic │
136
+ │ ← PRD §4.2: 3 screens + nightly job │
137
+ │ Deps 4 Multiple third-party APIs or tightly coupled internal systems │
138
+ │ ← Stripe API + bank CSV import │
139
+ │ Unc 3 Some open questions, design decisions to be made during build │
140
+ │ ← PRD §4.2: "reconciliation rules undecided" │
141
+ │ Risk 5 Core infrastructure, compliance requirements, irreversible ops │
142
+ │ ← payments; rubric puts payments at 4–5, chose 5: irreversible │
143
+ │ Σ 19 → L → 160–400 h │
144
+ │ Why (client): handles payments and two outside services; matching │
145
+ │ rules still to be decided │
146
+ │ accept · change <factor> <n> · why <text> · split │
147
+ └───────────────────────────────────────────────────────────────────────────┘
148
+ ```
149
+
150
+ Rules: the anchor is the guide's full sentence for that factor and score;
151
+ the cite quotes the fact it rests on; no evidence for a factor → the cell
152
+ is `?` and you ask, never a silent 3. Σ at 11, 17 or 22 shows `one point
153
+ from <tier>; <factor> +1 moves this to <band>`; Σ > 22 recommends `split`
154
+ before `accept`; any 5 shows `review`. `Why` is one plain sentence for a
155
+ non-technical reader — what the feature touches and what is still
156
+ unknown; no file names, no factor names, no rubric wording. `split`
157
+ returns to the clear-vs-assumed gate (the loop rule, §5).
158
+
159
+ **Writing it down.** STANDARD/DEEP: every feature gets `scores` (per
160
+ factor `{ n, anchor, cite }`), `scoreNote` (the `Why` sentence) and
161
+ `scoreProvenance` — `proposed` when accepted as offered, `stated` when
162
+ any cell or the note was changed. QUICK: use the scores for the tier and
163
+ the calibration band as today; do not write them (`schema.mjs` refuses
164
+ them at QUICK).
165
+
166
+ **Ask why.** A changed score keeps a cite that argued for the *old*
167
+ number, so every entry in `--read`'s `needsReason` list is a question you
168
+ owe the reviewer before writing: show the old anchor with its cite, the
169
+ new anchor, and ask what makes it that score. Use `AskUserQuestion` when
170
+ available — one question per changed cell, up to four per call, with
171
+ your best guesses at the reason as options plus "keep it, no reason" and
172
+ "agree — back to <old>" — and plain chat otherwise. The answer becomes
173
+ the cite as `reviewer: <answer>`. You may push back **once** when the
174
+ answer contradicts evidence you read (quote it); the reviewer's second
175
+ word is final. Declining is allowed: write `reviewer: no reason given` so
176
+ the gap is visible on the page and in the Score Rationale tab, and never
177
+ ask twice. A rewritten `Why` sentence needs no reason — it is the
178
+ reviewer's own words.
179
+
180
+ 3b. **Tasks + O/M/P** — STANDARD/DEEP only, per `techniques.md` §3. After a
181
+ feature's tasks are sized, compare `Σ pert(e)` with its tier's calibration
182
+ band. Outside the band, say so once — `Σ19 → L → 160–400 h, tasks sum to
183
+ 85 h; tasks missing or scores high?` — and let the human decide. Nothing
184
+ is refused and nothing new is written; the page marks the row ⚠.
185
+ 4. **Team + rates + seniority mix** — how many engineers, what they cost
186
+ per hour, and whether each is junior/mid/senior. Default is **one team**
187
+ → one scenario; ask "compare staffing options?" and only then collect
188
+ more rosters. With two or more, ask why the recommended one wins and
189
+ write it to `recommendedReason` — the page shows a choice it must be
190
+ able to explain.
191
+ 5. **AI-assisted delivery** — per scenario, default **yes**; ask only
192
+ "humans unaided?" as the opt-out. Then **tooling cost per seat per
193
+ month** — one number, vendor-neutral (a Claude Max seat, Codex, Cursor —
194
+ whatever the client will actually run), written to `toolingCostPerSeat`.
195
+ The human may skip it: write `null` and add an assumption to the gate
196
+ whose text names the tooling cost gap and its impact-if-wrong (~2% of
197
+ total at typical seat prices). The validator refuses a null seat cost on
198
+ an AI-assisted scenario without that assumption.
88
199
  6. **Deadline / constraints** — any hard date or budget ceiling.
89
200
  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`.
201
+ none exists, offer the defaults `S 20-60h, M 60-160h, L 160-400h, XL 400-800h`.
91
202
  8. **Expose-rates-to-client** — y/n; controls whether the client-facing render
92
203
  shows labor rates or only totals.
93
204
 
@@ -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
@@ -14,7 +14,18 @@ top-level `project`, `technique`, `depth`, `calibration`, `overheadPct`,
14
14
  `verificationPct`, `exposeRatesToClient`, `features` (each with `id`, `name`,
15
15
  `provenance`, `tasks`), `risks`, `assumptions`, `scenarios`, and
16
16
  `recommendedScenario`. Every task carries `id`, `name`, `category`, `o`,
17
- `m`, `p`, `confidence`, `assumptions`, `provenance`. `schema.mjs` is the
17
+ `m`, `p`, `confidence`, `assumptions`, `provenance`.
18
+
19
+ At `STANDARD`/`DEEP` every feature also carries `scores` — one entry per
20
+ factor `tech`, `size`, `deps`, `unc`, `risk`, each `{ "n": 1–5, "anchor":
21
+ "<the scoring-guide.md sentence for that factor and score, verbatim>",
22
+ "cite": "<the evidence it rests on>" }` — a `scoreNote` (one plain sentence
23
+ for a non-technical reader: no file names, factor names or `§`) and a
24
+ `scoreProvenance` of `stated` or `proposed`. `schema.mjs` checks the anchor
25
+ against the guide byte for byte. At `QUICK` these fields must be absent.
26
+
27
+ Optional top-level `recommendedReason` (non-empty string) says why the
28
+ recommended scenario wins when several are compared. `schema.mjs` is the
18
29
  enforced half of this contract (`checkInputs`) — this doc is the readable
19
30
  half; if the two ever disagree, the code wins.
20
31
 
@@ -53,7 +64,7 @@ sections, in this order:
53
64
  | --- | --- | --- | --- |
54
65
  | <feature name> | S/M/L | <low>–<high> | stated|proposed |
55
66
 
56
- Recommended delivery: <team + plan summary> — see detail.
67
+ Recommended delivery: <team + AI-assisted summary> — see detail.
57
68
 
58
69
  | Line | Hours |
59
70
  | --- | --- |
@@ -93,9 +104,9 @@ Technique: <technique name> — <one line on why>.
93
104
 
94
105
  ### Scenario comparison
95
106
 
96
- | Scenario | Team | Plan | Months | Cost | Notes |
107
+ | Scenario | Team | AI-assisted | Months | Cost | Notes |
97
108
  | --- | --- | --- | --- | --- | --- |
98
- | <scenario id> | <team summary> | <plan> | <months> | <cost> | <"recommended" or "—"> |
109
+ | <scenario id> | <team summary> | yes|no | <months> | <cost> | <"recommended" or "—"> |
99
110
 
100
111
  ### Calibration
101
112
 
@@ -118,7 +129,7 @@ Structure:
118
129
  4. Summary must contain a line item matching `/buffer/i` (the buffer table
119
130
  row above).
120
131
  5. Estimation detail must contain a table with a `Scenario` column and at
121
- least 2 rows.
132
+ least 1 row.
122
133
  6. Estimation detail must contain a line matching `/calibration/i`.
123
134
 
124
135
  Row-level, on the task table (found by header, needs `Task`, `Confidence`,
@@ -138,6 +149,11 @@ column but no `Task` column):
138
149
  split itself, so it does not carry the full four-word provenance
139
150
  vocabulary.
140
151
 
152
+ 11b. At `STANDARD`/`DEEP` the scope table has a `Tier` column and every
153
+ row's Tier must match `computed.features[<id>].tier` (the letter the
154
+ scores produced — `scoring-checks.mjs`). At `QUICK` the Tier cell is
155
+ the agent's own call, unchecked.
156
+
141
157
  JSON-side (checked against `estimation.json`, not the prose):
142
158
 
143
159
  12. The `computed` block must equal a fresh recompute of `computed` from
@@ -3,7 +3,7 @@
3
3
  // masked as measured, invented evidence, missing planning work, and the
4
4
  // mandatory "Delivery: agentic" header line. Split out of checks.mjs to stay
5
5
  // under the file's function/line quality gates.
6
- import { heading, tables } from './checks.mjs';
6
+ import { heading, tables } from './md-tables.mjs';
7
7
 
8
8
  const VAGUE_PATTERNS = [
9
9
  /\b\d+\s*[–—-]\s*\d+\s*(hours?|hrs|minutes?|mins)\b/i,
@@ -4,39 +4,12 @@
4
4
  import { computeEstimation } from './rollup.mjs';
5
5
  import { loadMeasurements, resolveMeasurementsPath } from './measurements.mjs';
6
6
  import { agenticFindings } from './agentic-checks.mjs';
7
+ import { heading, tables } from './md-tables.mjs';
8
+ import { scoringFindings } from './scoring-checks.mjs';
7
9
 
8
10
  const PROVENANCE = ['observed', 'stated', 'researched', 'proposed'];
9
11
  const CONFIDENCE = ['HIGH', 'MED', 'LOW'];
10
12
 
11
- // Returns the text of the section/subsection starting at heading `name`, up
12
- // to (not including) the next heading of the same or shallower level.
13
- export function heading(md, name) {
14
- const m = new RegExp(`^(#{2,4})\\s*${name}\\b.*$`, 'm').exec(md);
15
- if (!m) return null;
16
- const rest = md.slice(m.index + m[0].length);
17
- const next = rest.search(new RegExp(`^#{1,${m[1].length}}\\s`, 'm'));
18
- return rest.slice(0, next === -1 ? undefined : next);
19
- }
20
-
21
- function cells(line) {
22
- return line.trim().replace(/^\|/, '').replace(/\|$/, '').split('|').map((c) => c.trim());
23
- }
24
-
25
- // Groups contiguous `| ... |` lines into tables, dropping the `| --- |`
26
- // separator row, and returns each as { header, rows } of trimmed cells.
27
- export function tables(text) {
28
- const groups = [];
29
- let cur = [];
30
- for (const line of (text ?? '').split('\n')) {
31
- if (/^\s*\|/.test(line)) cur.push(line);
32
- else if (cur.length) { groups.push(cur); cur = []; }
33
- }
34
- if (cur.length) groups.push(cur);
35
- return groups
36
- .map((g) => g.filter((l) => !/^\s*\|?[\s:|-]+\|?\s*$/.test(l)))
37
- .map((g) => ({ header: cells(g[0]), rows: g.slice(1).map(cells) }));
38
- }
39
-
40
13
  function checkStructure(md) {
41
14
  const out = [];
42
15
  const summary = heading(md, 'Summary');
@@ -48,7 +21,7 @@ function checkStructure(md) {
48
21
  if (assumptionRows.length < 1) out.push('assumptions register is empty (### Assumptions needs >= 1 row)');
49
22
  if (!/\|.*buffer.*\|/i.test(summary ?? '')) out.push('no buffer line item found in Summary (/buffer/i)');
50
23
  const scenarioTable = tables(detail ?? '').find((t) => t.header.includes('Scenario'));
51
- if (!scenarioTable || scenarioTable.rows.length < 2) out.push('scenario comparison table missing or has fewer than 2 rows');
24
+ if (!scenarioTable || scenarioTable.rows.length < 1) out.push('scenario comparison table missing or empty');
52
25
  if (!/calibration/i.test(detail ?? '')) out.push('no calibration line found in Estimation detail');
53
26
  return out;
54
27
  }
@@ -132,6 +105,7 @@ function checkNumbers(estimation) {
132
105
  export function checkDeliverables({ md, estimation }) {
133
106
  const out = [...checkStructure(md), ...checkRows(md, estimation), ...checkNumbers(estimation)];
134
107
  checkRoadmap(md, estimation, out);
108
+ out.push(...scoringFindings({ md, estimation }));
135
109
  if (estimation.inputs.deliveryMode === 'agentic') out.push(...agenticFindings({ md, estimation }));
136
110
  return out;
137
111
  }
@@ -1,6 +1,7 @@
1
- // Every formula the estimate ships — imported by compute.mjs at build time and
2
- // inlined verbatim into estimate-template.html at render time, so the browser's
3
- // what-if math and the committed numbers cannot drift apart.
1
+ // Every formula the estimate ships — imported by compute.mjs at build time.
2
+ // The estimate pages inline nothing: every number they show is committed in
3
+ // estimation.json. The score review page inlines TIER_BREAKS and tierFor
4
+ // alone, so an edited score re-tiers in the browser on the same scale.
4
5
 
5
6
  export const AI_CATEGORIES = {
6
7
  boilerplate: { min: 0.5, max: 0.8 },
@@ -10,9 +11,10 @@ export const AI_CATEGORIES = {
10
11
  export const SENIORITY_FACTOR = { junior: 1.15, mid: 1.0, senior: 0.85 };
11
12
  export const HOURS_PER_MONTH = 140;
12
13
  export const COORDINATION_TAX = 0.10;
13
- export const PLAN_PRICES = { none: 0, max5x: 100, max20x: 200 };
14
+ // The team workbook's tier scale (its sheet-1 formula and Tier Reference tab):
15
+ // one scale for the interview, the validator, the page and the xlsx export.
14
16
  export const TIER_BREAKS = [
15
- { max: 10, tier: 'S' }, { max: 17, tier: 'M' }, { max: Infinity, tier: 'L' },
17
+ { max: 11, tier: 'S' }, { max: 17, tier: 'M' }, { max: 22, tier: 'L' }, { max: Infinity, tier: 'XL' },
16
18
  ];
17
19
 
18
20
  export function pert({ o, m, p }) {
@@ -41,9 +43,9 @@ export function aiAdjust({ e, category, verificationPct, scale = 1 }) {
41
43
  // Seniority scales the base effort on every path; the AI reduction is a
42
44
  // property of the task category alone. Scaling the reduction by seniority
43
45
  // instead made juniors come out faster than seniors on AI plans.
44
- export function taskHours({ e, seniority, plan, category, verificationPct, scale = 1 }) {
46
+ export function taskHours({ e, seniority, aiAssisted, category, verificationPct, scale = 1 }) {
45
47
  const base = e * SENIORITY_FACTOR[seniority];
46
- return plan === 'none' ? base : aiAdjust({ e: base, category, verificationPct, scale });
48
+ return aiAssisted ? aiAdjust({ e: base, category, verificationPct, scale }) : base;
47
49
  }
48
50
 
49
51
  // One seniority drives effort for a whole team: the most common level wins,
@@ -64,11 +66,13 @@ export function effectiveCapacity(engineers) {
64
66
  return Math.max(1, engineers * (1 - COORDINATION_TAX * (engineers - 1)));
65
67
  }
66
68
 
67
- export function scenarioRollup({ hours, team, plan }) {
69
+ // Tooling is priced per seat per month, vendor-neutral. A null seat cost is
70
+ // a recorded gap (the schema demands an assumption for it) and prices as 0.
71
+ export function scenarioRollup({ hours, team, toolingCostPerSeat }) {
68
72
  const months = hours / (effectiveCapacity(team.length) * HOURS_PER_MONTH);
69
73
  const laborCost = months * team.reduce((sum, t) => sum + t.rate * HOURS_PER_MONTH, 0);
70
- const planCost = months * PLAN_PRICES[plan] * team.length;
71
- return { months, laborCost, planCost, totalCost: laborCost + planCost };
74
+ const toolingCost = months * (toolingCostPerSeat ?? 0) * team.length;
75
+ return { months, laborCost, toolingCost, totalCost: laborCost + toolingCost };
72
76
  }
73
77
 
74
78
  // Sequential roadmap: each milestone's band width is its share of total task
@@ -1,6 +1,8 @@
1
1
  // The math module is written once as ESM and shipped twice: imported by
2
- // compute.mjs, and inlined here as a plain script so the page's what-if
3
- // controls run the very same formulas the committed numbers came from.
2
+ // compute.mjs, and inlined into a page as a plain script. Only the score
3
+ // review page needs any of it — score-html.mjs extracts TIER_BREAKS and
4
+ // tierFor so the page can re-tier an edited row — so the extraction is
5
+ // by name, never the whole module.
4
6
  export function inlineModule(src) {
5
7
  return src.replaceAll(/^export /gm, '');
6
8
  }
@@ -9,12 +11,8 @@ export function stripInternal(html) {
9
11
  return html.replaceAll(/<!-- internal:start -->[\s\S]*?<!-- internal:end -->/g, '');
10
12
  }
11
13
 
12
- // The agentic what-if rail only needs a handful of the math module's
13
- // exports (team/plan capacity and cost, not the AI-category/PERT machinery
14
- // the agentic page never uses) — inlining the whole file would leak
15
- // AI_CATEGORIES' category names onto a page that must never show them.
16
- // Anchors on `export const NAME` / `export function NAME` at line start,
17
- // same declaration shapes estimate-math.mjs uses throughout.
14
+ // Anchors on `export const NAME` / `export function NAME` at line start, the
15
+ // declaration shapes estimate-math.mjs uses throughout.
18
16
  export function extractExports(src, names) {
19
17
  const starts = [...src.matchAll(/^export (?:const|function) (\w+)/gm)];
20
18
  return starts
@@ -0,0 +1,31 @@
1
+ // Markdown readers shared by the deliverable checks: find a section by its
2
+ // heading, and read every `| … |` table in a slice of text.
3
+
4
+ // Returns the text of the section/subsection starting at heading `name`, up
5
+ // to (not including) the next heading of the same or shallower level.
6
+ export function heading(md, name) {
7
+ const m = new RegExp(`^(#{2,4})\\s*${name}\\b.*$`, 'm').exec(md);
8
+ if (!m) return null;
9
+ const rest = md.slice(m.index + m[0].length);
10
+ const next = rest.search(new RegExp(`^#{1,${m[1].length}}\\s`, 'm'));
11
+ return rest.slice(0, next === -1 ? undefined : next);
12
+ }
13
+
14
+ function cells(line) {
15
+ return line.trim().replace(/^\|/, '').replace(/\|$/, '').split('|').map((c) => c.trim());
16
+ }
17
+
18
+ // Groups contiguous `| ... |` lines into tables, dropping the `| --- |`
19
+ // separator row, and returns each as { header, rows } of trimmed cells.
20
+ export function tables(text) {
21
+ const groups = [];
22
+ let cur = [];
23
+ for (const line of (text ?? '').split('\n')) {
24
+ if (/^\s*\|/.test(line)) cur.push(line);
25
+ else if (cur.length) { groups.push(cur); cur = []; }
26
+ }
27
+ if (cur.length) groups.push(cur);
28
+ return groups
29
+ .map((g) => g.filter((l) => !/^\s*\|?[\s:|-]+\|?\s*$/.test(l)))
30
+ .map((g) => ({ header: cells(g[0]), rows: g.slice(1).map(cells) }));
31
+ }
@@ -1,5 +1,5 @@
1
1
  // The --client-only export embeds the full estimation JSON in the page; this
2
- // strips the internal money detail (rates, labor/plan cost split, per-task
2
+ // strips the internal money detail (rates, labor/tooling cost split, per-task
3
3
  // hours per scenario) before it ships, unless the inputs opt out via
4
4
  // exposeRatesToClient. Assumptions/risks are left alone — those are
5
5
  // client-facing per spec.
@@ -17,7 +17,7 @@ function redactScenarioTeam(team) {
17
17
 
18
18
  function redactComputedScenarios(scenarios) {
19
19
  return Object.fromEntries(Object.entries(scenarios).map(([id, s]) => {
20
- const { laborCost, planCost, taskHours, ...rest } = s;
20
+ const { laborCost, toolingCost, taskHours, ...rest } = s;
21
21
  return [id, rest];
22
22
  }));
23
23
  }
@@ -28,6 +28,16 @@ function redactAgenticInputs({ measurementsPath, agentContext, ...rest }) {
28
28
  return { ...rest, agentContext: clientAgentContext };
29
29
  }
30
30
 
31
+ // A score's cite is internal shorthand — the ticket phrase, file name or
32
+ // meeting wording the judgment rests on — so it is blanked unconditionally,
33
+ // like the agentic fields above. The rubric anchor is the sentence the client
34
+ // can read and it stays, so the page still explains every score.
35
+ function blankCites(feature) {
36
+ if (!feature.scores) return feature;
37
+ const scores = Object.entries(feature.scores).map(([k, s]) => [k, { ...s, cite: '' }]);
38
+ return { ...feature, scores: Object.fromEntries(scores) };
39
+ }
40
+
31
41
  function redactComputedTasks(tasks) {
32
42
  return Object.fromEntries(Object.entries(tasks).map(([id, t]) => [
33
43
  id,
@@ -36,7 +46,8 @@ function redactComputedTasks(tasks) {
36
46
  }
37
47
 
38
48
  export function redactForClient(estimation) {
39
- const inputs = redactAgenticInputs(estimation.inputs);
49
+ const agentic = redactAgenticInputs(estimation.inputs);
50
+ const inputs = { ...agentic, features: agentic.features.map(blankCites) };
40
51
  const computed = { ...estimation.computed, tasks: redactComputedTasks(estimation.computed.tasks) };
41
52
  if (estimation.inputs.exposeRatesToClient) return { ...estimation, inputs, computed };
42
53
  return {