@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
@@ -3,7 +3,7 @@
3
3
  // currently visible rows, and keeps every tier/price formula live in-cell.
4
4
  import { test } from 'node:test';
5
5
  import assert from 'node:assert/strict';
6
- import { mkdtempSync } from 'node:fs';
6
+ import { mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
7
7
  import { execFileSync } from 'node:child_process';
8
8
  import { tmpdir } from 'node:os';
9
9
  import { join } from 'node:path';
@@ -15,11 +15,11 @@ import { readZip } from './zip.mjs';
15
15
  const skip = { skip: !findChrome() && 'no chrome on PATH' };
16
16
  const fixture = new URL('./fixtures/booking-inputs.json', import.meta.url).pathname;
17
17
 
18
- function buildPage() {
18
+ function buildPage(inputsPath = fixture) {
19
19
  const dir = mkdtempSync(join(tmpdir(), 'estimate-xlsx-'));
20
20
  const scripts = new URL('..', import.meta.url).pathname;
21
21
  const passMd = join(scripts, 'test/fixtures/estimation-pass.md');
22
- execFileSync('node', [join(scripts, 'compute.mjs'), '--inputs', fixture, '--out', join(dir, 'estimation.json')]);
22
+ execFileSync('node', [join(scripts, 'compute.mjs'), '--inputs', inputsPath, '--out', join(dir, 'estimation.json')]);
23
23
  execFileSync('node', [join(scripts, 'render.mjs'), '--json', join(dir, 'estimation.json'), '--md', passMd, '--out', dir]);
24
24
  return pathToFileURL(join(dir, 'estimate.html')).href;
25
25
  }
@@ -30,17 +30,19 @@ async function exportedFiles(page) {
30
30
  }
31
31
 
32
32
  const sheet1 = (files) => files.get('xl/worksheets/sheet1.xml').toString('utf8');
33
- const cell = (xml, ref) => new RegExp(`<c r="${ref}"[^>]*>(.*?)</c>`, 's').exec(xml)?.[1] ?? '';
33
+ const cell = (xml, ref) => new RegExp(`<c r="${ref}"[^>]*?(?:/>|>(.*?)</c>)`, 's').exec(xml)?.[1] ?? '';
34
34
  const inlineText = (frag) => /<t[^>]*>([^<]*)<\/t>/.exec(frag)?.[1];
35
35
  const cellNumber = (frag) => Number(/<v>([^<]*)<\/v>/.exec(frag)?.[1]);
36
36
  const cellFormula = (frag) => /<f>([^<]*)<\/f>/.exec(frag)?.[1];
37
37
 
38
- test('the breakdown filter bar carries an internal-only download button', skip, async () => {
38
+ // The workbook carries a Task Breakdown sheet and a Score Rationale sheet, so
39
+ // the export answers for the whole section rather than for either tab.
40
+ test('the section heading carries an internal-only download button', skip, async () => {
39
41
  const page = await openPage(buildPage());
40
42
  try {
41
43
  assert.ok(await page.eval(
42
- `!!document.querySelector('#feature-table .bd-filters button[data-download][data-internal]')`),
43
- 'expected a data-download button marked data-internal in the filter bar');
44
+ `!!document.querySelector('#feature-table .sec-head button[data-download][data-internal]')`),
45
+ 'expected a data-download button marked data-internal on the section heading');
44
46
  } finally { page.close(); }
45
47
  });
46
48
 
@@ -58,35 +60,90 @@ test('the export clones the sample workbook with its guide tabs intact', skip, a
58
60
  } finally { page.close(); }
59
61
  });
60
62
 
61
- test('rows land as inline strings ordered by milestone with derived 1-5 scores', skip, async () => {
63
+ test('rows land ordered by milestone with the interview scores verbatim', skip, async () => {
62
64
  const page = await openPage(buildPage());
63
65
  try {
64
66
  const xml = sheet1(await exportedFiles(page));
65
- // M1 feature before M2 feature regardless of the table's hour sort
66
67
  assert.equal(inlineText(cell(xml, 'A7')), 'User can book appointment');
67
68
  assert.equal(inlineText(cell(xml, 'A8')), 'Email reminders');
68
- for (const row of [7, 8]) {
69
- for (const col of ['B', 'C', 'D', 'E', 'F']) {
70
- const v = cellNumber(cell(xml, `${col}${row}`));
71
- assert.ok(Number.isInteger(v) && v >= 1 && v <= 5, `${col}${row} must be 1-5, got ${v}`);
72
- }
73
- }
69
+ assert.deepEqual(['B', 'C', 'D', 'E', 'F'].map((c) => cellNumber(cell(xml, `${c}7`))), [3, 3, 2, 3, 3]);
70
+ assert.deepEqual(['B', 'C', 'D', 'E', 'F'].map((c) => cellNumber(cell(xml, `${c}8`))), [2, 2, 3, 2, 2]);
71
+ } finally { page.close(); }
72
+ });
73
+
74
+ // Row 6 is the sample workbook's own header row — the export never writes it,
75
+ // it writes scores into B–F underneath. Pin the seam: if the sample's score
76
+ // columns are ever reordered or renamed, every exported score lands under the
77
+ // wrong heading and nothing else would notice. The sample keeps these as
78
+ // shared strings, unlike the cells the export writes inline.
79
+ function sharedText(files, frag) {
80
+ const idx = Number(/<v>(\d+)<\/v>/.exec(frag)?.[1]);
81
+ const items = [...files.get('xl/sharedStrings.xml').toString('utf8').matchAll(/<si>([\s\S]*?)<\/si>/g)];
82
+ return [...items[idx][1].matchAll(/<t[^>]*>([^<]*)<\/t>/g)].map((m) => m[1]).join('');
83
+ }
84
+
85
+ const headerText = (files, frag) => inlineText(frag) ?? sharedText(files, frag);
86
+
87
+ test('the score columns sit under the sample workbook\'s five score headers', skip, async () => {
88
+ const page = await openPage(buildPage());
89
+ try {
90
+ const files = await exportedFiles(page);
91
+ const xml = sheet1(files);
92
+ assert.deepEqual(['B', 'C', 'D', 'E', 'F'].map((c) => headerText(files, cell(xml, `${c}6`))),
93
+ ['TECH\nCOMPLEXITY\n(1–5)', 'FEATURE\nSIZE\n(1–5)', 'DEPEND-\nENCIES\n(1–5)',
94
+ 'UNCER-\nTAINTY\n(1–5)', 'RISK\n(1–5)']);
74
95
  } finally { page.close(); }
75
96
  });
76
97
 
77
- test('tech and size scores follow the Scoring Guide definitions', skip, async () => {
98
+ test('column N carries the plain-words note for sales readers', skip, async () => {
78
99
  const page = await openPage(buildPage());
79
100
  try {
80
101
  const xml = sheet1(await exportedFiles(page));
81
- // TECH: hours-weighted category score (boilerplate 1.5, logic 3, novel 5).
82
- // Booking mixes boilerplate(25.3h) + logic(44h) → 2.45 → 2; reminders is
83
- // logic-only → 3.
84
- assert.equal(cellNumber(cell(xml, 'B7')), 2);
85
- assert.equal(cellNumber(cell(xml, 'B8')), 3);
86
- // SIZE: absolute expected-hour bands [8, 24, 64, 128] per the guide's
87
- // "<1 day → epic" scale. Booking ≈69h → 4; reminders ≈21h → 2.
88
- assert.equal(cellNumber(cell(xml, 'C7')), 4);
89
- assert.equal(cellNumber(cell(xml, 'C8')), 2);
102
+ assert.equal(inlineText(cell(xml, 'N6')), 'WHY THIS TIER');
103
+ assert.match(inlineText(cell(xml, 'N7')) ?? '', /open questions/);
104
+ assert.match(xml, /<autoFilter ref="A6:N26"\/>/);
105
+ } finally { page.close(); }
106
+ });
107
+
108
+ const sheetRationale = (files) => files.get('xl/worksheets/sheet5.xml')?.toString('utf8') ?? '';
109
+
110
+ test('a Score Rationale tab lists anchor, evidence and provenance per factor', skip, async () => {
111
+ const page = await openPage(buildPage());
112
+ try {
113
+ const files = await exportedFiles(page);
114
+ assert.match(files.get('xl/workbook.xml').toString('utf8'), /name="Score Rationale"/);
115
+ assert.match(files.get('xl/_rels/workbook.xml.rels').toString('utf8'), /Target="worksheets\/sheet5\.xml"/);
116
+ assert.match(files.get('[Content_Types].xml').toString('utf8'), /PartName="\/xl\/worksheets\/sheet5\.xml"/);
117
+ const xml = sheetRationale(files);
118
+ assert.deepEqual(['A1', 'B1', 'C1', 'D1', 'E1', 'F1'].map((r) => inlineText(cell(xml, r))),
119
+ ['FEATURE', 'FACTOR', 'SCORE', 'ANCHOR', 'EVIDENCE', 'PROVENANCE']);
120
+ assert.equal(inlineText(cell(xml, 'A2')), 'User can book appointment');
121
+ assert.equal(inlineText(cell(xml, 'B2')), 'Tech');
122
+ assert.equal(cellNumber(cell(xml, 'C2')), 3);
123
+ assert.equal(inlineText(cell(xml, 'D2')), 'Custom business logic, moderate algorithm complexity, multiple states');
124
+ assert.equal(inlineText(cell(xml, 'E2')), 'slot conflict + cancellation rules');
125
+ assert.equal(inlineText(cell(xml, 'F2')), 'stated');
126
+ assert.match(xml, /<autoFilter ref="A1:F11"\/>/); // 2 features × 5 factors
127
+ } finally { page.close(); }
128
+ });
129
+
130
+ test('QUICK inputs export blank score cells and an empty rationale tab', skip, async () => {
131
+ const dir = mkdtempSync(join(tmpdir(), 'estimate-xlsx-quick-'));
132
+ const inputs = JSON.parse(readFileSync(fixture, 'utf8'));
133
+ inputs.depth = 'QUICK';
134
+ for (const f of inputs.features) {
135
+ delete f.scores; delete f.scoreNote; delete f.scoreProvenance;
136
+ f.tasks = [{ ...f.tasks[0], id: `${f.id}-band`, o: 60, m: 110, p: 160 }];
137
+ }
138
+ const inputsPath = join(dir, 'inputs.json');
139
+ writeFileSync(inputsPath, JSON.stringify(inputs));
140
+ const page = await openPage(buildPage(inputsPath));
141
+ try {
142
+ const files = await exportedFiles(page);
143
+ const xml = sheet1(files);
144
+ assert.equal(cell(xml, 'B7'), '', 'no score value at QUICK');
145
+ assert.match(xml, /<c r="B7" s="\d+"\/>/);
146
+ assert.match(sheetRationale(files), /<autoFilter ref="A1:F1"\/>/);
90
147
  } finally { page.close(); }
91
148
  });
92
149
 
@@ -113,14 +170,18 @@ test('milestone and container fill L/M under an autofiltered header', skip, asyn
113
170
  assert.equal(inlineText(cell(xml, 'L7')), 'M1 - Booking core');
114
171
  assert.equal(inlineText(cell(xml, 'M7')), 'Booking API');
115
172
  assert.equal(inlineText(cell(xml, 'M8')), 'Notification Service');
116
- assert.match(xml, /<autoFilter ref="A6:M26"\/>/);
173
+ assert.match(xml, /<autoFilter ref="A6:N26"\/>/);
117
174
  } finally { page.close(); }
118
175
  });
119
176
 
120
177
  test('the export honours the active source filter', skip, async () => {
121
178
  const page = await openPage(buildPage());
122
179
  try {
123
- await page.eval(`document.querySelector('#feature-table [data-prov="stated"]').click()`);
180
+ await page.eval(`(() => {
181
+ const sel = document.querySelector('#feature-table select[data-select="prov"]');
182
+ sel.value = 'stated';
183
+ sel.dispatchEvent(new Event('change', { bubbles: true }));
184
+ })()`);
124
185
  const xml = sheet1(await exportedFiles(page));
125
186
  assert.match(xml, /User can book appointment/);
126
187
  assert.doesNotMatch(xml, /Email reminders/);
@@ -144,7 +205,11 @@ test('the export adds a registered Task Breakdown tab', skip, async () => {
144
205
  test('task rows carry the PERT formula in-cell and ride the feature filter', skip, async () => {
145
206
  const page = await openPage(buildPage());
146
207
  try {
147
- await page.eval(`document.querySelector('#feature-table [data-prov="stated"]').click()`);
208
+ await page.eval(`(() => {
209
+ const sel = document.querySelector('#feature-table select[data-select="prov"]');
210
+ sel.value = 'stated';
211
+ sel.dispatchEvent(new Event('change', { bubbles: true }));
212
+ })()`);
148
213
  const xml = sheetTasks(await exportedFiles(page));
149
214
  assert.equal(inlineText(cell(xml, 'A2')), 'User can book appointment');
150
215
  assert.equal(inlineText(cell(xml, 'B2')), 'Booking CRUD API');
@@ -127,6 +127,6 @@ function scenarioNodes(est) {
127
127
  id: `scenario-${s.id ?? s.name}`,
128
128
  type: 'scenario',
129
129
  position: { x: 0, y: 0 },
130
- data: { label: s.label ?? s.plan ?? String(s.id ?? s.name), status: 'ready', href: null, detail: null },
130
+ data: { label: s.label ?? String(s.id ?? s.name), status: 'ready', href: null, detail: null },
131
131
  }));
132
132
  }
@@ -8,8 +8,8 @@ import { JARGON } from '../lib/jargon.mjs';
8
8
  const estimation = {
9
9
  inputs: {
10
10
  scenarios: [
11
- { id: 's1', plan: 'max5x', team: [{ seniority: 'senior', rate: 50 }] },
12
- { id: 's2-secret', plan: 'none', team: [{ seniority: 'mid', rate: 40 }] },
11
+ { id: 's1', aiAssisted: true, toolingCostPerSeat: 100, team: [{ seniority: 'senior', rate: 50 }] },
12
+ { id: 's2-secret', aiAssisted: false, toolingCostPerSeat: null, team: [{ seniority: 'mid', rate: 40 }] },
13
13
  ],
14
14
  },
15
15
  computed: {
@@ -11,7 +11,7 @@ import { deriveFigures, formatMoney } from '../lib/figures.mjs';
11
11
  const estimation = {
12
12
  inputs: {
13
13
  scenarios: [{
14
- id: 's1', plan: 'max5x',
14
+ id: 's1', aiAssisted: true, toolingCostPerSeat: 100,
15
15
  team: [{ seniority: 'senior', rate: 50 }, { seniority: 'mid', rate: 40 }],
16
16
  }],
17
17
  },