@v11g/agents-rock 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/SKILL.md +4 -2
- package/plugins/solution-architect/skills/estimate/assets/estimate-template.html +11 -2
- package/plugins/solution-architect/skills/estimate/assets/scores-review-template.html +304 -59
- package/plugins/solution-architect/skills/estimate/references/interview.md +19 -10
- package/plugins/solution-architect/skills/estimate/references/writing.md +7 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/references.test.mjs +4 -1
- package/plugins/solution-architect/skills/estimate/scripts/test/xlsx-export.test.mjs +26 -5
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ rather than a hang.
|
|
|
82
82
|
| Plugin | Description | Version |
|
|
83
83
|
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
84
84
|
| `business-analyst` | Business-analysis toolkit: interview-driven requirements discovery that turns raw client input into a validated, traceable requirements package ready for solution architecture. | 0.2.0 |
|
|
85
|
-
| `solution-architect` | Solution-architecture toolkit: interview-driven architecture documentation with interactive diagrams and provenance-tagged facts, AI-aware project estimation, and client-ready proposals. | 2.0.
|
|
85
|
+
| `solution-architect` | Solution-architecture toolkit: interview-driven architecture documentation with interactive diagrams and provenance-tagged facts, AI-aware project estimation, and client-ready proposals. | 2.0.1 |
|
|
86
86
|
| `lmk` | Terminal-native visual explainer: explains the current topic with cheap diagrams (flowcharts, sequences, timelines, tables) rendered directly in the terminal via a bundled Mermaid renderer. | 0.1.0 |
|
|
87
87
|
|
|
88
88
|
## Skills
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solution-architect",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Solution-architecture toolkit: interview-driven architecture documentation with interactive diagrams and provenance-tagged facts, AI-aware project estimation, and client-ready proposals.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Truong Vu",
|
|
@@ -27,8 +27,10 @@ interactive page served on localhost.
|
|
|
27
27
|
|
|
28
28
|
1. **Detect evidence**: requirements/RFP? ARCHITECTURE.md? codebase? none?
|
|
29
29
|
State findings; the user can override. (`references/interview.md` §1)
|
|
30
|
-
2. **Depth and delivery mode**: ask QUICK / STANDARD / DEEP, then
|
|
31
|
-
|
|
30
|
+
2. **Depth and delivery mode**: ask QUICK / STANDARD / DEEP, then assume
|
|
31
|
+
AGENTIC and ask only "humans writing the code?" as the opt-out
|
|
32
|
+
(`references/interview.md` §2b). Delivery mode decides step 4, and is
|
|
33
|
+
written to `estimation-inputs.json` explicitly either way.
|
|
32
34
|
3. **Interview**: follow `references/interview.md` — pre-fill from evidence,
|
|
33
35
|
ask only holes, run the clear-vs-assumed gate before sizing. Read
|
|
34
36
|
`references/scoring-guide.md` before proposing any score; offer the
|
|
@@ -1401,12 +1401,21 @@ function buildTaskSheet(rows) {
|
|
|
1401
1401
|
|
|
1402
1402
|
// --- Score Rationale tab: one row per feature × factor — the engineer's
|
|
1403
1403
|
// view of why each score is what it is (Sheet 1's column N is the sales one).
|
|
1404
|
-
|
|
1404
|
+
// Two source columns, because `provenance` and `scoreProvenance` answer
|
|
1405
|
+
// different questions about different people: did the client ask for this
|
|
1406
|
+
// feature, and did a reviewer override the agent's score. They share the
|
|
1407
|
+
// vocabulary `stated`/`proposed`, which read side by side looks like the same
|
|
1408
|
+
// column disagreeing with itself — so the score's half is spelled out in the
|
|
1409
|
+
// words it actually means, while the feature's half keeps the page's wording.
|
|
1410
|
+
const RATIONALE_HEADERS = ['FEATURE', 'FACTOR', 'SCORE', 'ANCHOR', 'EVIDENCE',
|
|
1411
|
+
'FEATURE SOURCE', 'SCORE ORIGIN'];
|
|
1412
|
+
const SCORE_ORIGIN = { proposed: 'agent proposed', stated: 'reviewer changed' };
|
|
1405
1413
|
|
|
1406
1414
|
function rationaleRowXml(f, key, r) {
|
|
1407
1415
|
const s = f.scores[key];
|
|
1408
1416
|
return `<row r="${r}">` + sCell(`A${r}`, 0, f.name) + sCell(`B${r}`, 0, SCORE_LABELS[key]) + nCell(`C${r}`, 0, s.n)
|
|
1409
|
-
+ sCell(`D${r}`, 0, s.anchor) + sCell(`E${r}`, 0, s.cite) + sCell(`F${r}`, 0, f.
|
|
1417
|
+
+ sCell(`D${r}`, 0, s.anchor) + sCell(`E${r}`, 0, s.cite) + sCell(`F${r}`, 0, f.provenance)
|
|
1418
|
+
+ sCell(`G${r}`, 0, SCORE_ORIGIN[f.scoreProvenance] ?? '') + '</row>';
|
|
1410
1419
|
}
|
|
1411
1420
|
|
|
1412
1421
|
function buildRationaleSheet(rows) {
|
|
@@ -7,112 +7,357 @@
|
|
|
7
7
|
<style>
|
|
8
8
|
:root {
|
|
9
9
|
color-scheme:light;
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--
|
|
13
|
-
--
|
|
10
|
+
--paper:#e8ecef; --sheet:#fbfcfd; --ink:#141c24; --ink-dim:#5d6c78;
|
|
11
|
+
--rule:#d3dbe1; --grid:#edf1f4; --meter:#44586a; --mark:#b4232f; --mark-soft:#b4232f14;
|
|
12
|
+
--t-s:#dfe6ec; --t-s-ink:#4a5a68; --t-m:#c3d2df; --t-m-ink:#2b3d4c;
|
|
13
|
+
--t-l:#7d96ab; --t-l-ink:#fff; --t-xl:#2f4a60; --t-xl-ink:#fff;
|
|
14
|
+
--serif:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,"Liberation Serif",serif;
|
|
15
|
+
--sans:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
|
|
16
|
+
}
|
|
17
|
+
@media (prefers-color-scheme:dark) {
|
|
18
|
+
:root:not([data-theme="light"]) {
|
|
19
|
+
color-scheme:dark;
|
|
20
|
+
--paper:#11171c; --sheet:#1a2229; --ink:#e6ecf1; --ink-dim:#93a3b0;
|
|
21
|
+
--rule:#2c3740; --grid:#222c34; --meter:#8fa8bb; --mark:#e26c60; --mark-soft:#e26c6021;
|
|
22
|
+
--t-s:#263039; --t-s-ink:#9fb0bd; --t-m:#3a4a57; --t-m-ink:#d3dfe8;
|
|
23
|
+
--t-l:#7d96ab; --t-l-ink:#0f161b; --t-xl:#bacdda; --t-xl-ink:#0f161b;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
:root[data-theme="dark"] {
|
|
27
|
+
color-scheme:dark;
|
|
28
|
+
--paper:#11171c; --sheet:#1a2229; --ink:#e6ecf1; --ink-dim:#93a3b0;
|
|
29
|
+
--rule:#2c3740; --grid:#222c34; --meter:#8fa8bb; --mark:#e26c60; --mark-soft:#e26c6021;
|
|
30
|
+
--t-s:#263039; --t-s-ink:#9fb0bd; --t-m:#3a4a57; --t-m-ink:#d3dfe8;
|
|
31
|
+
--t-l:#7d96ab; --t-l-ink:#0f161b; --t-xl:#bacdda; --t-xl-ink:#0f161b;
|
|
14
32
|
}
|
|
15
33
|
* { box-sizing:border-box; }
|
|
16
|
-
body {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
body {
|
|
35
|
+
margin:0; padding:2rem 1.5rem 4rem; background:var(--paper); color:var(--ink);
|
|
36
|
+
font-family:var(--sans); font-size:.9rem; line-height:1.5;
|
|
37
|
+
}
|
|
38
|
+
.page { max-width:78rem; margin:0 auto; }
|
|
39
|
+
:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
|
|
40
|
+
|
|
41
|
+
/* ---- header ---- */
|
|
42
|
+
.head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; }
|
|
43
|
+
#theme {
|
|
44
|
+
flex:none; font-size:.78rem; font-weight:600; padding:.3rem .7rem; color:var(--ink-dim);
|
|
45
|
+
border:1px solid var(--rule); border-radius:.2rem; background:var(--sheet); cursor:pointer;
|
|
46
|
+
}
|
|
47
|
+
#theme:hover { color:var(--ink); border-color:var(--ink-dim); }
|
|
48
|
+
h1 { font-family:var(--serif); font-size:2.1rem; font-weight:600; letter-spacing:-.015em; margin:0; }
|
|
49
|
+
.sub { margin:.15rem 0 .9rem; color:var(--ink-dim); font-size:.82rem; }
|
|
50
|
+
.lead { margin:0 0 1.4rem; max-width:64ch; color:var(--ink-dim); }
|
|
51
|
+
|
|
52
|
+
/* ---- the spine: one dot per feature, placed on the total ---- */
|
|
53
|
+
.spine-wrap { max-width:46rem; background:var(--sheet); border:1px solid var(--rule); padding:.9rem 1rem .7rem; margin-bottom:2rem; }
|
|
54
|
+
.spine, .zones { display:grid; grid-template-columns:repeat(21,1fr); }
|
|
55
|
+
.spine { align-items:end; min-height:2.6rem; }
|
|
56
|
+
.spine .col { display:flex; flex-direction:column-reverse; align-items:center; gap:2px; border-left:1px solid var(--grid); }
|
|
57
|
+
.dot {
|
|
58
|
+
width:11px; height:11px; padding:0; border:1px solid var(--ink); border-radius:50%;
|
|
59
|
+
background:var(--sheet); cursor:pointer;
|
|
60
|
+
}
|
|
61
|
+
.dot span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
|
|
62
|
+
.dot:hover { background:var(--ink); }
|
|
63
|
+
.dot.changed { border-color:var(--mark); background:var(--mark); }
|
|
64
|
+
.zones { border-top:1px solid var(--rule); margin-top:.35rem; padding-top:.3rem; font-size:.72rem; color:var(--ink-dim); }
|
|
65
|
+
.zones span { border-left:1px solid var(--rule); padding-left:.35rem; }
|
|
66
|
+
.zones span:first-child { border-left:0; }
|
|
67
|
+
.zones b { font-weight:600; color:var(--ink); }
|
|
68
|
+
.spine-note { margin:.45rem 0 0; font-size:.75rem; color:var(--ink-dim); }
|
|
69
|
+
|
|
70
|
+
/* ---- feature bands ---- */
|
|
71
|
+
.feat { display:grid; grid-template-columns:16rem 1fr; gap:1.6rem; padding:1rem 0; border-top:1px solid var(--rule); }
|
|
72
|
+
.feat:last-child { border-bottom:1px solid var(--rule); }
|
|
73
|
+
.feat.flash { background:var(--sheet); }
|
|
74
|
+
.rail h2 { font-family:var(--serif); font-size:1.05rem; font-weight:600; margin:0 0 .15rem; }
|
|
75
|
+
.rail .meta { margin:0; font-size:.74rem; color:var(--ink-dim); }
|
|
76
|
+
.verdict { display:flex; align-items:center; gap:.5rem; margin:.6rem 0 .25rem; }
|
|
77
|
+
.total { font-variant-numeric:tabular-nums; font-size:.8rem; color:var(--ink-dim); }
|
|
78
|
+
.total b { font-size:1.05rem; color:var(--ink); }
|
|
79
|
+
.tier { font-size:.75rem; font-weight:600; padding:.1rem .45rem; border:1px solid var(--rule); border-radius:.2rem; }
|
|
80
|
+
.tier.t-s { background:var(--t-s); color:var(--t-s-ink); }
|
|
81
|
+
.tier.t-m { background:var(--t-m); color:var(--t-m-ink); }
|
|
82
|
+
.tier.t-l { background:var(--t-l); border-color:var(--t-l); color:var(--t-l-ink); }
|
|
83
|
+
.tier.t-xl { background:var(--t-xl); border-color:var(--t-xl); color:var(--t-xl-ink); }
|
|
84
|
+
.hint, .prov { margin:0; font-size:.74rem; color:var(--ink-dim); }
|
|
85
|
+
.prov.edited { color:var(--mark); }
|
|
86
|
+
|
|
87
|
+
/* ---- five factors ---- */
|
|
88
|
+
.factors { display:grid; grid-template-columns:repeat(auto-fit,minmax(9rem,1fr)); gap:.9rem 1.1rem; }
|
|
89
|
+
.factor label { display:flex; align-items:center; gap:.45rem; }
|
|
90
|
+
.flabel { font-size:.74rem; font-weight:600; color:var(--ink-dim); }
|
|
91
|
+
.factor select {
|
|
92
|
+
font:inherit; font-variant-numeric:tabular-nums; padding:.1rem .15rem;
|
|
93
|
+
border:1px solid var(--rule); border-radius:.2rem; background:var(--sheet); color:var(--ink);
|
|
94
|
+
}
|
|
95
|
+
.factor select.hot { font-weight:700; border-color:var(--meter); }
|
|
96
|
+
.meter { display:flex; gap:2px; margin:.3rem 0 .25rem; }
|
|
97
|
+
.meter i { flex:1; height:3px; background:var(--rule); }
|
|
98
|
+
.meter i.on { background:var(--meter); }
|
|
99
|
+
.cite { margin:0; font-size:.76rem; line-height:1.4; color:var(--ink-dim); }
|
|
100
|
+
.was { margin:.15rem 0 0; font-size:.72rem; color:var(--mark); }
|
|
101
|
+
.factor.changed select { border-color:var(--mark); background:var(--mark-soft); }
|
|
102
|
+
.factor.changed .cite { text-decoration:line-through; opacity:.55; }
|
|
103
|
+
|
|
104
|
+
/* ---- the note ---- */
|
|
105
|
+
.note { display:block; max-width:68ch; margin-top:.7rem; }
|
|
106
|
+
.note textarea {
|
|
107
|
+
display:block; width:100%; margin-top:.25rem; padding:.4rem .5rem; min-height:2.3rem; field-sizing:content;
|
|
108
|
+
font-family:var(--serif); font-size:.88rem; line-height:1.45; color:var(--ink);
|
|
109
|
+
border:1px solid var(--rule); border-radius:.2rem; background:var(--sheet); resize:vertical;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* ---- guide + feedback ---- */
|
|
113
|
+
details.guide { margin:2rem 0 1.4rem; }
|
|
114
|
+
details.guide summary { cursor:pointer; font-weight:600; }
|
|
115
|
+
.guide-scroll { overflow-x:auto; }
|
|
116
|
+
.guide-table { min-width:34rem; border-collapse:collapse; width:100%; margin-top:.7rem; font-size:.78rem; background:var(--sheet); }
|
|
117
|
+
.guide-table th, .guide-table td { border:1px solid var(--rule); padding:.35rem .45rem; text-align:left; vertical-align:top; }
|
|
118
|
+
.guide-table th { font-weight:600; color:var(--ink-dim); }
|
|
34
119
|
.guide-table td.dim { font-weight:600; white-space:nowrap; }
|
|
35
|
-
#feedback-wrap {
|
|
36
|
-
#feedback {
|
|
37
|
-
|
|
38
|
-
button
|
|
120
|
+
#feedback-wrap { border-top:1px solid var(--rule); padding-top:1.2rem; }
|
|
121
|
+
#feedback-wrap h2 { font-family:var(--serif); font-size:1.1rem; font-weight:600; margin:0 0 .2rem; }
|
|
122
|
+
#feedback-wrap p { margin:0 0 .7rem; color:var(--ink-dim); font-size:.82rem; }
|
|
123
|
+
button {
|
|
124
|
+
font:inherit; font-weight:600; padding:.4rem .9rem; border:1px solid var(--ink);
|
|
125
|
+
border-radius:.2rem; background:var(--ink); color:var(--sheet); cursor:pointer;
|
|
126
|
+
}
|
|
127
|
+
button:hover { filter:brightness(.85); }
|
|
128
|
+
#copied { margin-left:.6rem; font-size:.8rem; color:var(--ink-dim); }
|
|
129
|
+
#feedback {
|
|
130
|
+
display:block; width:100%; min-height:6rem; margin-top:.8rem; padding:.5rem;
|
|
131
|
+
font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.72rem;
|
|
132
|
+
border:1px solid var(--rule); background:var(--sheet); color:var(--ink-dim);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@media (max-width:820px) {
|
|
136
|
+
.feat { grid-template-columns:1fr; gap:.9rem; }
|
|
137
|
+
}
|
|
138
|
+
@media (prefers-reduced-motion:no-preference) {
|
|
139
|
+
.dot { transition:background .15s ease, border-color .15s ease; }
|
|
140
|
+
.feat { transition:background .5s ease; }
|
|
141
|
+
}
|
|
39
142
|
</style>
|
|
40
143
|
</head>
|
|
41
144
|
<body>
|
|
42
|
-
<
|
|
43
|
-
<
|
|
145
|
+
<div class="page">
|
|
146
|
+
<div class="head">
|
|
147
|
+
<div>
|
|
148
|
+
<h1><!-- slot:TITLE --></h1>
|
|
149
|
+
<p class="sub">Score review. <span id="tally"></span></p>
|
|
150
|
+
</div>
|
|
151
|
+
<button type="button" id="theme" aria-live="polite">Dark theme</button>
|
|
152
|
+
</div>
|
|
153
|
+
<p class="lead">Every score below is the agent's proposal. Hover a number to read the rubric sentence it
|
|
154
|
+
matched; the line under it is the evidence that score rests on. Change what reads wrong, rewrite the note
|
|
155
|
+
in your own words, then copy the feedback block at the bottom back into the chat.</p>
|
|
156
|
+
|
|
157
|
+
<div class="spine-wrap">
|
|
158
|
+
<div class="spine" id="spine"></div>
|
|
159
|
+
<div class="zones">
|
|
160
|
+
<span style="grid-column:1/8">S <b>≤11</b></span>
|
|
161
|
+
<span style="grid-column:8/14">M <b>12–17</b></span>
|
|
162
|
+
<span style="grid-column:14/19">L <b>18–22</b></span>
|
|
163
|
+
<span style="grid-column:19/22">XL <b>23+</b></span>
|
|
164
|
+
</div>
|
|
165
|
+
<p class="spine-note">Each dot is one feature, placed on its total. Click a dot to jump to it; a red dot is one you changed.</p>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
44
168
|
<div id="review"></div>
|
|
45
|
-
|
|
169
|
+
|
|
170
|
+
<details class="guide" open><summary>Scoring guide — what each 1–5 means</summary>
|
|
171
|
+
<div class="guide-scroll"><!-- slot:GUIDE --></div>
|
|
172
|
+
</details>
|
|
173
|
+
|
|
46
174
|
<div id="feedback-wrap">
|
|
47
|
-
<
|
|
175
|
+
<h2>Send it back</h2>
|
|
176
|
+
<p>Copy this block into the chat. The agent re-reads the rubric for every score you moved and asks why.</p>
|
|
177
|
+
<button type="button" id="copy">Copy feedback</button> <span id="copied" role="status" hidden>Copied. Paste it into the chat.</span>
|
|
48
178
|
<textarea id="feedback" readonly aria-label="feedback JSON"></textarea>
|
|
49
179
|
</div>
|
|
180
|
+
</div>
|
|
50
181
|
<script type="application/json" id="draft-data"><!-- slot:DATA --></script>
|
|
51
182
|
<script>
|
|
52
183
|
<!-- slot:MATH -->
|
|
53
184
|
const DRAFT = JSON.parse(document.getElementById('draft-data').textContent);
|
|
54
185
|
const KEYS = ['tech', 'size', 'deps', 'unc', 'risk'];
|
|
55
186
|
const LABELS = { tech: 'Tech', size: 'Size', deps: 'Deps', unc: 'Unc', risk: 'Risk' };
|
|
56
|
-
const
|
|
187
|
+
const NEXT_TIER = { 11: 'M', 17: 'L', 22: 'XL' };
|
|
188
|
+
const ORIGIN = { proposed: 'agent proposed', stated: 'reviewer changed' };
|
|
189
|
+
const MIN_TOTAL = 5;
|
|
190
|
+
const MAX_TOTAL = 25;
|
|
57
191
|
const esc = (s) => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/"/g, '"');
|
|
58
192
|
const state = Object.fromEntries(DRAFT.features.map((f) => [f.id, {
|
|
59
193
|
scores: Object.fromEntries(KEYS.map((k) => [k, f.scores[k].n])), scoreNote: f.scoreNote,
|
|
60
194
|
}]));
|
|
61
195
|
|
|
62
|
-
// The number comes from `state`, never from the draft:
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
// if it explained the new one.
|
|
196
|
+
// The number comes from `state`, never from the draft: a select that re-read
|
|
197
|
+
// f.scores[k].n would snap back to the agent's proposal and disagree with the
|
|
198
|
+
// Σ beside it. The anchor and cite stay the draft's — re-anchoring a changed
|
|
199
|
+
// score is the CLI's job, not the page's — so an edited cell strikes its old
|
|
200
|
+
// evidence through instead of showing it as if it explained the new score.
|
|
68
201
|
const STALE_TITLE = 'rubric sentence changes with the score — re-anchored when the agent reads this back';
|
|
202
|
+
const featureOf = (id) => DRAFT.features.find((f) => f.id === id);
|
|
203
|
+
const edited = (f) => KEYS.some((k) => state[f.id].scores[k] !== f.scores[k].n)
|
|
204
|
+
|| state[f.id].scoreNote !== f.scoreNote;
|
|
205
|
+
const originText = (f) => (edited(f) ? 'you changed this' : ORIGIN[f.scoreProvenance] ?? '');
|
|
206
|
+
const hintFor = (total) => (NEXT_TIER[total] ? `one point from ${NEXT_TIER[total]}` : (total >= 23 ? 'big enough to split' : ''));
|
|
207
|
+
const meter = (n) => `<span class="meter" aria-hidden="true">${
|
|
208
|
+
[1, 2, 3, 4, 5].map((i) => `<i class="${i <= n ? 'on' : ''}"></i>`).join('')}</span>`;
|
|
69
209
|
|
|
70
|
-
function
|
|
210
|
+
function factorCell(f, k) {
|
|
71
211
|
const s = f.scores[k];
|
|
72
212
|
const n = state[f.id].scores[k];
|
|
73
213
|
const stale = n !== s.n;
|
|
74
214
|
const opts = [1, 2, 3, 4, 5].map((v) => `<option value="${v}"${v === n ? ' selected' : ''}>${v}</option>`).join('');
|
|
75
|
-
return `<
|
|
76
|
-
|
|
215
|
+
return `<div class="factor${stale ? ' changed' : ''}">
|
|
216
|
+
<label><span class="flabel">${LABELS[k]}</span><select data-id="${esc(f.id)}" data-key="${k}"
|
|
217
|
+
class="${n === 5 ? 'hot' : ''}" title="${stale ? STALE_TITLE : esc(s.anchor)}">${opts}</select></label>
|
|
218
|
+
${meter(n)}
|
|
219
|
+
<p class="cite">${esc(s.cite)}</p>
|
|
220
|
+
<p class="was">${stale ? `changed from ${s.n}` : ''}</p>
|
|
221
|
+
</div>`;
|
|
77
222
|
}
|
|
78
223
|
|
|
79
|
-
function
|
|
224
|
+
function rail(f) {
|
|
80
225
|
const { total, tier } = tierFor(state[f.id].scores);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
<
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
226
|
+
return `<div class="rail">
|
|
227
|
+
<h2>${esc(f.name)}</h2>
|
|
228
|
+
<p class="meta">${esc(f.id)}</p>
|
|
229
|
+
<p class="verdict"><span class="total">Σ <b data-total="${esc(f.id)}">${total}</b></span>
|
|
230
|
+
<span class="tier t-${tier.toLowerCase()}" data-tier="${esc(f.id)}">${tier}</span></p>
|
|
231
|
+
<p class="hint" data-hint="${esc(f.id)}">${hintFor(total)}</p>
|
|
232
|
+
<p class="prov${edited(f) ? ' edited' : ''}" data-prov="${esc(f.id)}">${originText(f)}</p>
|
|
233
|
+
</div>`;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function band(f) {
|
|
237
|
+
return `<article class="feat" id="feat-${esc(f.id)}">${rail(f)}
|
|
238
|
+
<div class="body">
|
|
239
|
+
<div class="factors">${KEYS.map((k) => factorCell(f, k)).join('')}</div>
|
|
240
|
+
<label class="note"><span class="flabel">Why this tier, in plain words for the client</span>
|
|
241
|
+
<textarea data-note="${esc(f.id)}">${esc(state[f.id].scoreNote)}</textarea></label>
|
|
242
|
+
</div>
|
|
243
|
+
</article>`;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function dotsAt(total) {
|
|
247
|
+
return DRAFT.features.filter((f) => tierFor(state[f.id].scores).total === total)
|
|
248
|
+
.map((f) => `<button type="button" class="dot${edited(f) ? ' changed' : ''}" data-goto="${esc(f.id)}"
|
|
249
|
+
title="${esc(f.name)} — Σ ${total}"><span>${esc(f.name)}</span></button>`).join('');
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function tallyText() {
|
|
253
|
+
const n = DRAFT.features.filter(edited).length;
|
|
254
|
+
const features = `${DRAFT.features.length} ${DRAFT.features.length === 1 ? 'feature' : 'features'}.`;
|
|
255
|
+
return `${features} ${n === 0 ? 'Nothing changed yet.' : `${n} changed.`}`;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// The spine, the tally and the feedback block all read every feature, so they
|
|
259
|
+
// refresh together whenever any one score or note moves.
|
|
260
|
+
function refreshSpine() {
|
|
261
|
+
const cols = [];
|
|
262
|
+
for (let t = MIN_TOTAL; t <= MAX_TOTAL; t += 1) cols.push(`<div class="col">${dotsAt(t)}</div>`);
|
|
263
|
+
document.getElementById('spine').innerHTML = cols.join('');
|
|
264
|
+
document.getElementById('tally').textContent = tallyText();
|
|
93
265
|
document.getElementById('feedback').value = JSON.stringify(window.__feedback(), null, 1);
|
|
94
266
|
}
|
|
95
267
|
|
|
268
|
+
// Surgical, not a full rebuild: the reviewer is standing in this select with
|
|
269
|
+
// the keyboard, and re-rendering the page under them would drop the focus and
|
|
270
|
+
// the scroll position on every arrow press.
|
|
271
|
+
function syncCell(sel) {
|
|
272
|
+
const s = featureOf(sel.dataset.id).scores[sel.dataset.key];
|
|
273
|
+
const n = Number(sel.value);
|
|
274
|
+
const cell = sel.closest('.factor');
|
|
275
|
+
const stale = n !== s.n;
|
|
276
|
+
cell.classList.toggle('changed', stale);
|
|
277
|
+
sel.classList.toggle('hot', n === 5);
|
|
278
|
+
sel.title = stale ? STALE_TITLE : s.anchor;
|
|
279
|
+
cell.querySelector('.meter').outerHTML = meter(n);
|
|
280
|
+
cell.querySelector('.was').textContent = stale ? `changed from ${s.n}` : '';
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function syncBand(id) {
|
|
284
|
+
const f = featureOf(id);
|
|
285
|
+
const { total, tier } = tierFor(state[id].scores);
|
|
286
|
+
const pick = (attr) => document.querySelector(`[data-${attr}="${CSS.escape(id)}"]`);
|
|
287
|
+
pick('total').textContent = total;
|
|
288
|
+
const chip = pick('tier');
|
|
289
|
+
chip.textContent = tier;
|
|
290
|
+
chip.className = `tier t-${tier.toLowerCase()}`;
|
|
291
|
+
pick('hint').textContent = hintFor(total);
|
|
292
|
+
const prov = pick('prov');
|
|
293
|
+
prov.textContent = originText(f);
|
|
294
|
+
prov.classList.toggle('edited', edited(f));
|
|
295
|
+
refreshSpine();
|
|
296
|
+
}
|
|
297
|
+
|
|
96
298
|
window.__feedback = () => ({ features: DRAFT.features.map((f) => ({ id: f.id, ...state[f.id] })) });
|
|
97
299
|
|
|
98
300
|
function onChange(e) {
|
|
99
301
|
const sel = e.target.closest('select[data-id]');
|
|
100
302
|
const note = e.target.closest('textarea[data-note]');
|
|
101
|
-
if (sel)
|
|
102
|
-
|
|
103
|
-
|
|
303
|
+
if (sel) {
|
|
304
|
+
state[sel.dataset.id].scores[sel.dataset.key] = Number(sel.value);
|
|
305
|
+
syncCell(sel);
|
|
306
|
+
syncBand(sel.dataset.id);
|
|
307
|
+
}
|
|
308
|
+
if (note) {
|
|
309
|
+
state[note.dataset.note].scoreNote = note.value;
|
|
310
|
+
syncBand(note.dataset.note);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function goTo(id) {
|
|
315
|
+
const el = document.getElementById(`feat-${id}`);
|
|
316
|
+
if (!el) return;
|
|
317
|
+
const still = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
318
|
+
el.scrollIntoView({ behavior: still ? 'auto' : 'smooth', block: 'center' });
|
|
319
|
+
el.classList.add('flash');
|
|
320
|
+
setTimeout(() => el.classList.remove('flash'), 900);
|
|
104
321
|
}
|
|
105
322
|
|
|
323
|
+
// The reader's choice outlives the page; a browser that refuses storage
|
|
324
|
+
// (file:// in some setups) still gets a toggle that works for this sitting.
|
|
325
|
+
const THEME_KEY = 'scores-review-theme';
|
|
326
|
+
const stored = (() => { try { return localStorage.getItem(THEME_KEY); } catch { return null; } })();
|
|
327
|
+
const systemDark = () => window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
328
|
+
const themeBtn = document.getElementById('theme');
|
|
329
|
+
|
|
330
|
+
function applyTheme(mode) {
|
|
331
|
+
const dark = mode ? mode === 'dark' : systemDark();
|
|
332
|
+
if (mode) document.documentElement.dataset.theme = mode;
|
|
333
|
+
themeBtn.textContent = dark ? 'Light theme' : 'Dark theme';
|
|
334
|
+
themeBtn.dataset.dark = String(dark);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
themeBtn.addEventListener('click', () => {
|
|
338
|
+
const next = themeBtn.dataset.dark === 'true' ? 'light' : 'dark';
|
|
339
|
+
applyTheme(next);
|
|
340
|
+
try { localStorage.setItem(THEME_KEY, next); } catch { /* this sitting only */ }
|
|
341
|
+
});
|
|
342
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
|
|
343
|
+
if (!document.documentElement.dataset.theme) applyTheme(null);
|
|
344
|
+
});
|
|
345
|
+
applyTheme(stored === 'dark' || stored === 'light' ? stored : null);
|
|
346
|
+
|
|
106
347
|
document.getElementById('review').addEventListener('change', onChange);
|
|
107
|
-
document.getElementById('review').addEventListener('input',
|
|
108
|
-
|
|
348
|
+
document.getElementById('review').addEventListener('input', onChange);
|
|
349
|
+
document.getElementById('spine').addEventListener('click', (e) => {
|
|
350
|
+
const dot = e.target.closest('[data-goto]');
|
|
351
|
+
if (dot) goTo(dot.dataset.goto);
|
|
109
352
|
});
|
|
110
353
|
document.getElementById('copy').addEventListener('click', async () => {
|
|
111
354
|
const text = JSON.stringify(window.__feedback());
|
|
112
355
|
document.getElementById('feedback').value = text;
|
|
113
356
|
try { await navigator.clipboard.writeText(text); document.getElementById('copied').hidden = false; } catch { /* file:// may refuse; the textarea holds it */ }
|
|
114
357
|
});
|
|
115
|
-
|
|
358
|
+
|
|
359
|
+
document.getElementById('review').innerHTML = DRAFT.features.map(band).join('');
|
|
360
|
+
refreshSpine();
|
|
116
361
|
</script>
|
|
117
362
|
</body>
|
|
118
363
|
</html>
|
|
@@ -34,12 +34,21 @@ before scope confirmation and before any factor scoring.
|
|
|
34
34
|
| STANDARD | task-level three-point PERT | ± moderate |
|
|
35
35
|
| DEEP | STANDARD plus per-scenario detail (multiple team/AI-assistance combinations sized individually) | ± narrower |
|
|
36
36
|
|
|
37
|
-
## 2b. Delivery mode — ask
|
|
37
|
+
## 2b. Delivery mode — assume second, ask only to leave it
|
|
38
38
|
|
|
39
39
|
| Mode | Meaning | Sizing path |
|
|
40
40
|
| --- | --- | --- |
|
|
41
|
+
| AGENTIC (default) | AI coding agents write the code, humans plan and review | measurement-based (`agentic-estimation.md`) |
|
|
41
42
|
| TRADITIONAL | humans write the code | technique menu (`techniques.md`) |
|
|
42
|
-
|
|
43
|
+
|
|
44
|
+
Assume **AGENTIC**; ask only "humans writing the code?" as the opt-out, the
|
|
45
|
+
same shape as the AI-assistance question in §5. A client who is hand-writing
|
|
46
|
+
the code will say so; one who is not should not have to answer for it every
|
|
47
|
+
interview.
|
|
48
|
+
|
|
49
|
+
Write `deliveryMode` into `estimation-inputs.json` either way, explicitly. An
|
|
50
|
+
absent field still reads as traditional, which is what estimates written
|
|
51
|
+
before this default relied on — the interview no longer leaves it to that.
|
|
43
52
|
|
|
44
53
|
AGENTIC replaces the technique question and AI-category scoring entirely.
|
|
45
54
|
Follow-ups it adds: which agent + model executes (calibration context,
|
|
@@ -95,7 +104,8 @@ Ask one thing at a time, in this order:
|
|
|
95
104
|
— all rows on one screen, notes column, fits the workbook habit
|
|
96
105
|
3. html I write scores-review.html, you open it, set dropdowns, copy
|
|
97
106
|
the feedback block back here
|
|
98
|
-
— anchor
|
|
107
|
+
— anchor on hover, a plot of where every feature lands,
|
|
108
|
+
best for 15+ features
|
|
99
109
|
Recommended: 2 (25 features).
|
|
100
110
|
```
|
|
101
111
|
|
|
@@ -107,11 +117,11 @@ Ask one thing at a time, in this order:
|
|
|
107
117
|
report the diff (`3 changes: F07 risk 5→4, … — all stated. Σ moves F12 to
|
|
108
118
|
L. Proceed?`) before writing them into `estimation-inputs.json`.
|
|
109
119
|
|
|
110
|
-
**html channel —
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
120
|
+
**html channel — the page ships designed.** `--write --format html`
|
|
121
|
+
renders the reviewer page from `assets/scores-review-template.html`,
|
|
122
|
+
which is the deliverable, not a baseline to redesign. Write it into the
|
|
123
|
+
lead directory and hand the human the path; do not run a design pass on
|
|
124
|
+
it per lead. Any edit to the template keeps the read-back contract or
|
|
115
125
|
`--read` cannot parse the feedback: one `<select data-id="<feature id>"
|
|
116
126
|
data-key="<tech|size|deps|unc|risk>">` per score (values 1–5, `title` =
|
|
117
127
|
the rubric anchor), `[data-total="<id>"]` and `[data-tier="<id>"]` text
|
|
@@ -119,8 +129,7 @@ Ask one thing at a time, in this order:
|
|
|
119
129
|
`window.__feedback()` returning `{ features: [{ id, scores: { k: n },
|
|
120
130
|
scoreNote }] }`, a `#feedback` textarea holding that JSON and a `#copy`
|
|
121
131
|
button that puts it on the clipboard, and the scoring guide visible on
|
|
122
|
-
the page.
|
|
123
|
-
`assets/` — that copy stays the baseline every lead starts from.
|
|
132
|
+
the page.
|
|
124
133
|
|
|
125
134
|
**Cards** (terminal channel, and the shape every channel's row carries):
|
|
126
135
|
one per feature, 4–6 per turn, every cell filled from evidence you already
|
|
@@ -16,6 +16,13 @@ top-level `project`, `technique`, `depth`, `calibration`, `overheadPct`,
|
|
|
16
16
|
`recommendedScenario`. Every task carries `id`, `name`, `category`, `o`,
|
|
17
17
|
`m`, `p`, `confidence`, `assumptions`, `provenance`.
|
|
18
18
|
|
|
19
|
+
Add top-level `deliveryMode` — `"agentic"` or `"traditional"` — on every
|
|
20
|
+
estimate you write, even though the field is optional and the booking fixture
|
|
21
|
+
omits it. The interview defaults to agentic (`interview.md` §2b) while an
|
|
22
|
+
absent field still reads as traditional, so leaving it out would record the
|
|
23
|
+
opposite of what was agreed. The fixture keeps its silence on purpose: it is
|
|
24
|
+
the traditional path's regression guard.
|
|
25
|
+
|
|
19
26
|
At `STANDARD`/`DEEP` every feature also carries `scores` — one entry per
|
|
20
27
|
factor `tech`, `size`, `deps`, `unc`, `risk`, each `{ "n": 1–5, "anchor":
|
|
21
28
|
"<the scoring-guide.md sentence for that factor and score, verbatim>",
|
|
@@ -121,9 +121,12 @@ test('scoring-guide.md carries five rows of five anchors and the tier scale', ()
|
|
|
121
121
|
test('interview.md scores before tasks, names the three review channels and the plain-words note', () => {
|
|
122
122
|
const doc = ref('interview.md');
|
|
123
123
|
for (const needle of ['scoring-guide.md', 'scores', 'scoreNote', 'scoreProvenance', 'terminal', 'csv', 'html',
|
|
124
|
-
'score-review.mjs', 'accept', 'split', 'outside', 'plain', 'needsReason', 'no reason given', '
|
|
124
|
+
'score-review.mjs', 'accept', 'split', 'outside', 'plain', 'needsReason', 'no reason given', 'window.__feedback()']) {
|
|
125
125
|
assert.ok(doc.includes(needle), `interview.md missing: ${needle}`);
|
|
126
126
|
}
|
|
127
|
+
// The review page ships designed from assets/; a per-lead redesign would
|
|
128
|
+
// fork the read-back contract into as many versions as there are leads.
|
|
129
|
+
assert.doesNotMatch(doc, /frontend-design/);
|
|
127
130
|
assert.ok(doc.indexOf('Factor scores per feature') < doc.indexOf('Tasks + O/M/P'), 'scores come before tasks');
|
|
128
131
|
});
|
|
129
132
|
|
|
@@ -107,7 +107,7 @@ test('column N carries the plain-words note for sales readers', skip, async () =
|
|
|
107
107
|
|
|
108
108
|
const sheetRationale = (files) => files.get('xl/worksheets/sheet5.xml')?.toString('utf8') ?? '';
|
|
109
109
|
|
|
110
|
-
test('a Score Rationale tab lists anchor, evidence and
|
|
110
|
+
test('a Score Rationale tab lists anchor, evidence and both sources per factor', skip, async () => {
|
|
111
111
|
const page = await openPage(buildPage());
|
|
112
112
|
try {
|
|
113
113
|
const files = await exportedFiles(page);
|
|
@@ -115,15 +115,36 @@ test('a Score Rationale tab lists anchor, evidence and provenance per factor', s
|
|
|
115
115
|
assert.match(files.get('xl/_rels/workbook.xml.rels').toString('utf8'), /Target="worksheets\/sheet5\.xml"/);
|
|
116
116
|
assert.match(files.get('[Content_Types].xml').toString('utf8'), /PartName="\/xl\/worksheets\/sheet5\.xml"/);
|
|
117
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', '
|
|
118
|
+
assert.deepEqual(['A1', 'B1', 'C1', 'D1', 'E1', 'F1', 'G1'].map((r) => inlineText(cell(xml, r))),
|
|
119
|
+
['FEATURE', 'FACTOR', 'SCORE', 'ANCHOR', 'EVIDENCE', 'FEATURE SOURCE', 'SCORE ORIGIN']);
|
|
120
120
|
assert.equal(inlineText(cell(xml, 'A2')), 'User can book appointment');
|
|
121
121
|
assert.equal(inlineText(cell(xml, 'B2')), 'Tech');
|
|
122
122
|
assert.equal(cellNumber(cell(xml, 'C2')), 3);
|
|
123
123
|
assert.equal(inlineText(cell(xml, 'D2')), 'Custom business logic, moderate algorithm complexity, multiple states');
|
|
124
124
|
assert.equal(inlineText(cell(xml, 'E2')), 'slot conflict + cancellation rules');
|
|
125
|
+
assert.equal(inlineText(cell(xml, 'F2')), 'stated'); // the client asked for the feature
|
|
126
|
+
assert.equal(inlineText(cell(xml, 'G2')), 'reviewer changed'); // and a human edited its score
|
|
127
|
+
assert.match(xml, /<autoFilter ref="A1:G11"\/>/); // 2 features × 5 factors
|
|
128
|
+
} finally { page.close(); }
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// The two columns answer different questions about different people — whether
|
|
132
|
+
// the client asked for the feature, and whether a reviewer overrode the
|
|
133
|
+
// agent's score. The booking fixture happens to agree on both, so this pins
|
|
134
|
+
// them apart: one feature the client asked for, whose score nobody touched.
|
|
135
|
+
test('feature source and score origin are read from separate fields', skip, async () => {
|
|
136
|
+
const dir = mkdtempSync(join(tmpdir(), 'estimate-xlsx-sources-'));
|
|
137
|
+
const inputs = JSON.parse(readFileSync(fixture, 'utf8'));
|
|
138
|
+
inputs.features[0].provenance = 'stated';
|
|
139
|
+
inputs.features[0].scoreProvenance = 'proposed';
|
|
140
|
+
const inputsPath = join(dir, 'inputs.json');
|
|
141
|
+
writeFileSync(inputsPath, JSON.stringify(inputs));
|
|
142
|
+
const page = await openPage(buildPage(inputsPath));
|
|
143
|
+
try {
|
|
144
|
+
const xml = sheetRationale(await exportedFiles(page));
|
|
125
145
|
assert.equal(inlineText(cell(xml, 'F2')), 'stated');
|
|
126
|
-
assert.
|
|
146
|
+
assert.equal(inlineText(cell(xml, 'G2')), 'agent proposed');
|
|
147
|
+
assert.deepEqual(page.errors, []);
|
|
127
148
|
} finally { page.close(); }
|
|
128
149
|
});
|
|
129
150
|
|
|
@@ -143,7 +164,7 @@ test('QUICK inputs export blank score cells and an empty rationale tab', skip, a
|
|
|
143
164
|
const xml = sheet1(files);
|
|
144
165
|
assert.equal(cell(xml, 'B7'), '', 'no score value at QUICK');
|
|
145
166
|
assert.match(xml, /<c r="B7" s="\d+"\/>/);
|
|
146
|
-
assert.match(sheetRationale(files), /<autoFilter ref="A1:
|
|
167
|
+
assert.match(sheetRationale(files), /<autoFilter ref="A1:G1"\/>/);
|
|
147
168
|
} finally { page.close(); }
|
|
148
169
|
});
|
|
149
170
|
|