@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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/plugins/solution-architect/.claude-plugin/plugin.json +1 -1
- package/plugins/solution-architect/skills/estimate/README.md +8 -5
- package/plugins/solution-architect/skills/estimate/SKILL.md +9 -5
- package/plugins/solution-architect/skills/estimate/assets/estimate-template-agentic.html +142 -376
- package/plugins/solution-architect/skills/estimate/assets/estimate-template.html +610 -601
- package/plugins/solution-architect/skills/estimate/assets/scores-review-template.html +118 -0
- package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +5 -9
- package/plugins/solution-architect/skills/estimate/references/interview.md +121 -10
- package/plugins/solution-architect/skills/estimate/references/scoring-guide.md +23 -0
- package/plugins/solution-architect/skills/estimate/references/techniques.md +9 -2
- package/plugins/solution-architect/skills/estimate/references/writing.md +21 -5
- package/plugins/solution-architect/skills/estimate/scripts/lib/agentic-checks.mjs +1 -1
- package/plugins/solution-architect/skills/estimate/scripts/lib/checks.mjs +4 -30
- package/plugins/solution-architect/skills/estimate/scripts/lib/estimate-math.mjs +14 -10
- package/plugins/solution-architect/skills/estimate/scripts/lib/inline.mjs +6 -8
- package/plugins/solution-architect/skills/estimate/scripts/lib/md-tables.mjs +31 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/redact.mjs +14 -3
- package/plugins/solution-architect/skills/estimate/scripts/lib/rollup.mjs +5 -4
- package/plugins/solution-architect/skills/estimate/scripts/lib/scenario-schema.mjs +39 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/schema.mjs +4 -14
- package/plugins/solution-architect/skills/estimate/scripts/lib/score-csv.mjs +58 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/score-diff.mjs +30 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/score-html.mjs +17 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/scoring-checks.mjs +24 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/scoring-schema.mjs +48 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/scoring.mjs +45 -0
- package/plugins/solution-architect/skills/estimate/scripts/render.mjs +14 -13
- package/plugins/solution-architect/skills/estimate/scripts/score-review.mjs +59 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/browser.test.mjs +403 -316
- package/plugins/solution-architect/skills/estimate/scripts/test/compute.test.mjs +25 -1
- package/plugins/solution-architect/skills/estimate/scripts/test/estimate-math.test.mjs +29 -10
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-inputs.json +2 -2
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/booking-inputs.json +21 -3
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/estimation-fail.md +1 -1
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/estimation-pass.md +4 -4
- package/plugins/solution-architect/skills/estimate/scripts/test/references.test.mjs +61 -6
- package/plugins/solution-architect/skills/estimate/scripts/test/render.test.mjs +96 -13
- package/plugins/solution-architect/skills/estimate/scripts/test/schema.test.mjs +105 -4
- package/plugins/solution-architect/skills/estimate/scripts/test/score-review.test.mjs +187 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/scoring.test.mjs +49 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/url-state.test.mjs +198 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/validate.test.mjs +38 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/xlsx-export.test.mjs +93 -28
- package/plugins/solution-architect/skills/new-lead/scripts/lib/map-nodes.mjs +1 -1
- package/plugins/solution-architect/skills/proposal/scripts/test/checks-client.test.mjs +2 -2
- 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',
|
|
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}"[^>]
|
|
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
|
-
|
|
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 .
|
|
43
|
-
'expected a data-download button marked data-internal
|
|
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
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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('
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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:
|
|
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(`
|
|
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(`
|
|
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 ??
|
|
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',
|
|
12
|
-
{ id: 's2-secret',
|
|
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',
|
|
14
|
+
id: 's1', aiAssisted: true, toolingCostPerSeat: 100,
|
|
15
15
|
team: [{ seniority: 'senior', rate: 50 }, { seniority: 'mid', rate: 40 }],
|
|
16
16
|
}],
|
|
17
17
|
},
|