@v11g/agents-rock 1.0.2 → 1.0.3

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 (52) hide show
  1. package/package.json +1 -1
  2. package/plugins/business-analyst/.claude-plugin/plugin.json +9 -0
  3. package/plugins/business-analyst/skills/business-analyst/README.md +20 -0
  4. package/plugins/business-analyst/skills/business-analyst/SKILL.md +69 -0
  5. package/plugins/business-analyst/skills/business-analyst/references/ai-extension.md +37 -0
  6. package/plugins/business-analyst/skills/business-analyst/references/frameworks.md +53 -0
  7. package/plugins/business-analyst/skills/business-analyst/references/interview.md +89 -0
  8. package/plugins/business-analyst/skills/business-analyst/references/review.md +25 -0
  9. package/plugins/business-analyst/skills/business-analyst/references/writing.md +102 -0
  10. package/plugins/business-analyst/skills/business-analyst/scripts/lib/checks.mjs +166 -0
  11. package/plugins/business-analyst/skills/business-analyst/scripts/lib/schema.mjs +78 -0
  12. package/plugins/business-analyst/skills/business-analyst/scripts/test/checks.test.mjs +188 -0
  13. package/plugins/business-analyst/skills/business-analyst/scripts/test/e2e.test.mjs +17 -0
  14. package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-fail.json +205 -0
  15. package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-pass.json +59 -0
  16. package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-pass.md +63 -0
  17. package/plugins/business-analyst/skills/business-analyst/scripts/test/schema.test.mjs +41 -0
  18. package/plugins/business-analyst/skills/business-analyst/scripts/validate.mjs +20 -0
  19. package/plugins/solution-architect/skills/estimate/SKILL.md +13 -5
  20. package/plugins/solution-architect/skills/estimate/assets/estimate-template-agentic.html +917 -0
  21. package/plugins/solution-architect/skills/estimate/assets/estimate-template.html +430 -13
  22. package/plugins/solution-architect/skills/estimate/references/agentic-estimation.md +148 -0
  23. package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +10 -0
  24. package/plugins/solution-architect/skills/estimate/references/interview.md +20 -1
  25. package/plugins/solution-architect/skills/estimate/references/task-shapes.md +173 -0
  26. package/plugins/solution-architect/skills/estimate/references/writing.md +31 -0
  27. package/plugins/solution-architect/skills/estimate/scripts/compute.mjs +5 -1
  28. package/plugins/solution-architect/skills/estimate/scripts/lib/agentic-checks.mjs +65 -0
  29. package/plugins/solution-architect/skills/estimate/scripts/lib/baselines.mjs +107 -0
  30. package/plugins/solution-architect/skills/estimate/scripts/lib/checks.mjs +16 -7
  31. package/plugins/solution-architect/skills/estimate/scripts/lib/inline.mjs +14 -0
  32. package/plugins/solution-architect/skills/estimate/scripts/lib/measurements.mjs +59 -0
  33. package/plugins/solution-architect/skills/estimate/scripts/lib/redact.mjs +28 -5
  34. package/plugins/solution-architect/skills/estimate/scripts/lib/rollup.mjs +53 -22
  35. package/plugins/solution-architect/skills/estimate/scripts/lib/schema.mjs +52 -7
  36. package/plugins/solution-architect/skills/estimate/scripts/render.mjs +14 -3
  37. package/plugins/solution-architect/skills/estimate/scripts/test/baselines.test.mjs +120 -0
  38. package/plugins/solution-architect/skills/estimate/scripts/test/browser.test.mjs +69 -0
  39. package/plugins/solution-architect/skills/estimate/scripts/test/compute.test.mjs +44 -0
  40. package/plugins/solution-architect/skills/estimate/scripts/test/e2e.test.mjs +28 -1
  41. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-estimation-fail.md +55 -0
  42. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-estimation-pass.md +54 -0
  43. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-inputs.json +45 -0
  44. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/measurements.jsonl +20 -0
  45. package/plugins/solution-architect/skills/estimate/scripts/test/measurements.test.mjs +54 -0
  46. package/plugins/solution-architect/skills/estimate/scripts/test/references.test.mjs +25 -1
  47. package/plugins/solution-architect/skills/estimate/scripts/test/render.test.mjs +48 -1
  48. package/plugins/solution-architect/skills/estimate/scripts/test/schema.test.mjs +59 -0
  49. package/plugins/solution-architect/skills/estimate/scripts/test/validate.test.mjs +37 -0
  50. package/plugins/solution-architect/skills/estimate/scripts/test/xlsx-export.test.mjs +168 -0
  51. package/plugins/solution-architect/skills/estimate/scripts/test/zip.mjs +41 -0
  52. package/plugins/solution-architect/skills/new-lead/SKILL.md +15 -10
@@ -0,0 +1,168 @@
1
+ // The Feature breakdown's spreadsheet export: an internal-only button that
2
+ // clones the sample estimator workbook in the browser, fills tab 1 with the
3
+ // currently visible rows, and keeps every tier/price formula live in-cell.
4
+ import { test } from 'node:test';
5
+ import assert from 'node:assert/strict';
6
+ import { mkdtempSync } from 'node:fs';
7
+ import { execFileSync } from 'node:child_process';
8
+ import { tmpdir } from 'node:os';
9
+ import { join } from 'node:path';
10
+ import { pathToFileURL } from 'node:url';
11
+ import { findChrome } from '../../../analyze-requirements/scripts/lib/chrome.mjs';
12
+ import { openPage } from '../../../analyze-requirements/scripts/lib/cdp.mjs';
13
+ import { readZip } from './zip.mjs';
14
+
15
+ const skip = { skip: !findChrome() && 'no chrome on PATH' };
16
+ const fixture = new URL('./fixtures/booking-inputs.json', import.meta.url).pathname;
17
+
18
+ function buildPage() {
19
+ const dir = mkdtempSync(join(tmpdir(), 'estimate-xlsx-'));
20
+ const scripts = new URL('..', import.meta.url).pathname;
21
+ const passMd = join(scripts, 'test/fixtures/estimation-pass.md');
22
+ execFileSync('node', [join(scripts, 'compute.mjs'), '--inputs', fixture, '--out', join(dir, 'estimation.json')]);
23
+ execFileSync('node', [join(scripts, 'render.mjs'), '--json', join(dir, 'estimation.json'), '--md', passMd, '--out', dir]);
24
+ return pathToFileURL(join(dir, 'estimate.html')).href;
25
+ }
26
+
27
+ async function exportedFiles(page) {
28
+ const b64 = await page.eval('window.__buildWorkbook()');
29
+ return readZip(Buffer.from(b64, 'base64'));
30
+ }
31
+
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] ?? '';
34
+ const inlineText = (frag) => /<t[^>]*>([^<]*)<\/t>/.exec(frag)?.[1];
35
+ const cellNumber = (frag) => Number(/<v>([^<]*)<\/v>/.exec(frag)?.[1]);
36
+ const cellFormula = (frag) => /<f>([^<]*)<\/f>/.exec(frag)?.[1];
37
+
38
+ test('the breakdown filter bar carries an internal-only download button', skip, async () => {
39
+ const page = await openPage(buildPage());
40
+ try {
41
+ 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
+ } finally { page.close(); }
45
+ });
46
+
47
+ test('the export clones the sample workbook with its guide tabs intact', skip, async () => {
48
+ const page = await openPage(buildPage());
49
+ try {
50
+ const files = await exportedFiles(page);
51
+ for (const name of ['xl/worksheets/sheet1.xml', 'xl/worksheets/sheet2.xml',
52
+ 'xl/worksheets/sheet3.xml', 'xl/styles.xml', '[Content_Types].xml']) {
53
+ assert.ok(files.has(name), `${name} missing from the exported archive`);
54
+ }
55
+ const workbook = files.get('xl/workbook.xml').toString('utf8');
56
+ assert.match(workbook, /Scoring Guide/);
57
+ assert.match(workbook, /Tier Reference/);
58
+ } finally { page.close(); }
59
+ });
60
+
61
+ test('rows land as inline strings ordered by milestone with derived 1-5 scores', skip, async () => {
62
+ const page = await openPage(buildPage());
63
+ try {
64
+ const xml = sheet1(await exportedFiles(page));
65
+ // M1 feature before M2 feature regardless of the table's hour sort
66
+ assert.equal(inlineText(cell(xml, 'A7')), 'User can book appointment');
67
+ 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
+ }
74
+ } finally { page.close(); }
75
+ });
76
+
77
+ test('tech and size scores follow the Scoring Guide definitions', skip, async () => {
78
+ const page = await openPage(buildPage());
79
+ try {
80
+ 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);
90
+ } finally { page.close(); }
91
+ });
92
+
93
+ test('score math stays in the sheet: G-K are formulas, total row uses SUMIF', skip, async () => {
94
+ const page = await openPage(buildPage());
95
+ try {
96
+ const xml = sheet1(await exportedFiles(page));
97
+ assert.match(cellFormula(cell(xml, 'G7')) ?? '', /SUM\(B7:F7\)/);
98
+ assert.match(cellFormula(cell(xml, 'H7')) ?? '', /IF\(/);
99
+ for (const ref of ['I7', 'J7', 'K7']) {
100
+ assert.ok(cellFormula(cell(xml, ref)), `${ref} must hold a formula, not a baked value`);
101
+ }
102
+ assert.equal(inlineText(cell(xml, 'A27')), 'PROJECT TOTAL');
103
+ assert.match(cellFormula(cell(xml, 'G27')) ?? '', /SUMIF\(G7:G26/);
104
+ } finally { page.close(); }
105
+ });
106
+
107
+ test('milestone and container fill L/M under an autofiltered header', skip, async () => {
108
+ const page = await openPage(buildPage());
109
+ try {
110
+ const xml = sheet1(await exportedFiles(page));
111
+ assert.equal(inlineText(cell(xml, 'L6')), 'MILESTONE');
112
+ assert.equal(inlineText(cell(xml, 'M6')), 'CONTAINER');
113
+ assert.equal(inlineText(cell(xml, 'L7')), 'M1 - Booking core');
114
+ assert.equal(inlineText(cell(xml, 'M7')), 'Booking API');
115
+ assert.equal(inlineText(cell(xml, 'M8')), 'Notification Service');
116
+ assert.match(xml, /<autoFilter ref="A6:M26"\/>/);
117
+ } finally { page.close(); }
118
+ });
119
+
120
+ test('the export honours the active source filter', skip, async () => {
121
+ const page = await openPage(buildPage());
122
+ try {
123
+ await page.eval(`document.querySelector('#feature-table [data-prov="stated"]').click()`);
124
+ const xml = sheet1(await exportedFiles(page));
125
+ assert.match(xml, /User can book appointment/);
126
+ assert.doesNotMatch(xml, /Email reminders/);
127
+ assert.equal(inlineText(cell(xml, 'A27')), 'PROJECT TOTAL', 'total row must survive filtering');
128
+ } finally { page.close(); }
129
+ });
130
+
131
+ const sheetTasks = (files) => files.get('xl/worksheets/sheet4.xml')?.toString('utf8') ?? '';
132
+
133
+ test('the export adds a registered Task Breakdown tab', skip, async () => {
134
+ const page = await openPage(buildPage());
135
+ try {
136
+ const files = await exportedFiles(page);
137
+ assert.ok(files.has('xl/worksheets/sheet4.xml'), 'sheet4.xml missing');
138
+ assert.match(files.get('xl/workbook.xml').toString('utf8'), /name="Task Breakdown"/);
139
+ assert.match(files.get('xl/_rels/workbook.xml.rels').toString('utf8'), /Target="worksheets\/sheet4\.xml"/);
140
+ assert.match(files.get('[Content_Types].xml').toString('utf8'), /PartName="\/xl\/worksheets\/sheet4\.xml"/);
141
+ } finally { page.close(); }
142
+ });
143
+
144
+ test('task rows carry the PERT formula in-cell and ride the feature filter', skip, async () => {
145
+ const page = await openPage(buildPage());
146
+ try {
147
+ await page.eval(`document.querySelector('#feature-table [data-prov="stated"]').click()`);
148
+ const xml = sheetTasks(await exportedFiles(page));
149
+ assert.equal(inlineText(cell(xml, 'A2')), 'User can book appointment');
150
+ assert.equal(inlineText(cell(xml, 'B2')), 'Booking CRUD API');
151
+ assert.deepEqual(['D2', 'E2', 'F2'].map((r) => cellNumber(cell(xml, r))), [16, 24, 40]);
152
+ assert.match(cellFormula(cell(xml, 'G2')) ?? '', /\(D2\+4\*E2\+F2\)\/6/);
153
+ assert.equal(inlineText(cell(xml, 'H2')), 'HIGH');
154
+ assert.equal(inlineText(cell(xml, 'K2')), 'Booking API');
155
+ assert.doesNotMatch(xml, /Scheduled reminder jobs/, 'filtered-out feature tasks must not export');
156
+ } finally { page.close(); }
157
+ });
158
+
159
+ test('the task tab is filterable and sortable: autofilter over a frozen header', skip, async () => {
160
+ const page = await openPage(buildPage());
161
+ try {
162
+ const xml = sheetTasks(await exportedFiles(page));
163
+ assert.equal(inlineText(cell(xml, 'A1')), 'FEATURE');
164
+ // 3 fixture tasks under rows 2-4
165
+ assert.match(xml, /<autoFilter ref="A1:K4"\/>/);
166
+ assert.match(xml, /<pane ySplit="1"[^>]*state="frozen"/);
167
+ } finally { page.close(); }
168
+ });
@@ -0,0 +1,41 @@
1
+ // Minimal zip reader for asserting on workbooks the page exports.
2
+ // Central-directory driven: find EOCD, walk entries, inflate each.
3
+ import { inflateRawSync } from 'node:zlib';
4
+
5
+ function eocdOffset(buf) {
6
+ for (let i = buf.length - 22; i >= 0; i--) {
7
+ if (buf.readUInt32LE(i) === 0x06054b50) return i;
8
+ }
9
+ throw new Error('no end-of-central-directory record');
10
+ }
11
+
12
+ function entryData(buf, cd) {
13
+ const method = buf.readUInt16LE(cd + 10);
14
+ const csize = buf.readUInt32LE(cd + 20);
15
+ const local = buf.readUInt32LE(cd + 42);
16
+ const nameLen = buf.readUInt16LE(local + 26);
17
+ const extraLen = buf.readUInt16LE(local + 28);
18
+ const start = local + 30 + nameLen + extraLen;
19
+ const raw = buf.subarray(start, start + csize);
20
+ if (method === 0) return Buffer.from(raw);
21
+ if (method === 8) return inflateRawSync(raw);
22
+ throw new Error(`unsupported compression method ${method}`);
23
+ }
24
+
25
+ // Returns Map<path, Buffer> of every file in the archive.
26
+ export function readZip(buf) {
27
+ const eocd = eocdOffset(buf);
28
+ const count = buf.readUInt16LE(eocd + 10);
29
+ let cd = buf.readUInt32LE(eocd + 16);
30
+ const files = new Map();
31
+ for (let i = 0; i < count; i++) {
32
+ if (buf.readUInt32LE(cd) !== 0x02014b50) throw new Error('bad central directory');
33
+ const nameLen = buf.readUInt16LE(cd + 28);
34
+ const extraLen = buf.readUInt16LE(cd + 30);
35
+ const commentLen = buf.readUInt16LE(cd + 32);
36
+ const name = buf.toString('utf8', cd + 46, cd + 46 + nameLen);
37
+ files.set(name, entryData(buf, cd));
38
+ cd += 46 + nameLen + extraLen + commentLen;
39
+ }
40
+ return files;
41
+ }
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: new-lead
3
- description: Set up a pre-sales lead workspace and walk the human through the three solution-architect skills in order — analyze-requirements, estimate, proposal — plus a local leads dashboard. Use when the user says "new lead", points at a folder under leads/, or asks to see their leads pipeline.
3
+ description: Set up a pre-sales lead workspace and walk the human through the solution-architect skills in order — business-analyst first when installed, then analyze-requirements, estimate, proposal — plus a local leads dashboard. Use when the user says "new lead", points at a folder under leads/, or asks to see their leads pipeline.
4
4
  ---
5
5
 
6
6
  # new-lead
7
7
 
8
- Prepare a lead's workspace, then run `/analyze-requirements`, `/estimate` and
9
- `/proposal` in that order, stopping between each so the human sees what was
10
- produced. Also maintains the leads dashboard: a `leads.json` registry and a
8
+ Prepare a lead's workspace, then run `/business-analyst` (when installed),
9
+ `/analyze-requirements`, `/estimate` and `/proposal` in that order, stopping
10
+ between each so the human sees what was produced. Also maintains the leads dashboard: a `leads.json` registry and a
11
11
  self-contained local server.
12
12
 
13
13
  ## Hard rules
@@ -45,10 +45,15 @@ self-contained local server.
45
45
  - `/new-lead` with no argument → diff `readdir(<root>/leads)` against
46
46
  `leads.json` and print the state table below; the human picks one.
47
47
  4. **Adopt** (only when the folder has no registry entry) — see Adoption.
48
- 5. **Chain**: for each of `/analyze-requirements`, `/estimate`, `/proposal` —
49
- `cd` to the lead directory, invoke the skill, and when it returns, report
50
- what it wrote and wait. Skip any step whose artifact already exists unless
51
- the human asks for a re-run.
48
+ 5. **Chain**: when the `business-analyst` skill is available, the chain is
49
+ `/business-analyst`, `/analyze-requirements`, `/estimate`, `/proposal`;
50
+ otherwise recommend installing the business-analyst plugin in one line
51
+ (requirements discovery before architecture) and run the three-step
52
+ chain. For each step — `cd` to the lead directory, invoke the skill,
53
+ and when it returns, report what it wrote and wait. Skip any step whose
54
+ artifact already exists unless the human asks for a re-run.
55
+ `requirements.json` is soft evidence for the later skills, never a
56
+ prerequisite.
52
57
  6. **Sync the registry** after `/proposal` — see Registry sync.
53
58
  7. **Wrap**: start the dashboard (`sh <root>/start.sh`) if it is not already
54
59
  running, and report the URL.
@@ -58,8 +63,8 @@ self-contained local server.
58
63
  | State | Condition | Offer |
59
64
  | --- | --- | --- |
60
65
  | new | folder present, no registry entry | adopt, then run the chain |
61
- | WIP | entry present, one of `ARCHITECTURE.md` / `estimation.json` / `proposal.md` missing | resume at the first gap |
62
- | done | entry present, all three present | nothing; re-run a named step on request |
66
+ | WIP | entry present, one of `requirements.json` (checked only when the business-analyst skill is installed) / `ARCHITECTURE.md` / `estimation.json` / `proposal.md` missing | resume at the first gap |
67
+ | done | entry present, no artifact from the WIP row missing | nothing; re-run a named step on request |
63
68
  | orphan | entry present, folder gone | report only — never delete |
64
69
 
65
70
  ## Adoption