@blackbelt-technology/pi-dashboard-cost-estimator 0.7.0
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/.pi/skills/software-cost-estimator/SKILL.md +200 -0
- package/.pi/skills/software-cost-estimator/assets/calibration/reference-classes.md +126 -0
- package/.pi/skills/software-cost-estimator/assets/calibration/wms-reference.yaml +217 -0
- package/.pi/skills/software-cost-estimator/assets/example-quality-hub.yaml +230 -0
- package/.pi/skills/software-cost-estimator/assets/rates.default.yaml +106 -0
- package/.pi/skills/software-cost-estimator/assets/templates/architecture-plan.md +115 -0
- package/.pi/skills/software-cost-estimator/assets/templates/offer-summary.md +99 -0
- package/.pi/skills/software-cost-estimator/references/ai-delivery-modes.md +276 -0
- package/.pi/skills/software-cost-estimator/references/business-case.md +134 -0
- package/.pi/skills/software-cost-estimator/references/nfr-catalog.md +112 -0
- package/.pi/skills/software-cost-estimator/references/rates.md +84 -0
- package/.pi/skills/software-cost-estimator/references/role-model.md +109 -0
- package/.pi/skills/software-cost-estimator/references/sizing-methods.md +147 -0
- package/README.md +113 -0
- package/bin/calibrate-sessions.mjs +12 -0
- package/bin/calibrate.mjs +12 -0
- package/bin/estimate.mjs +12 -0
- package/package.json +96 -0
- package/src/bin/calibrate-sessions.ts +247 -0
- package/src/bin/calibrate.ts +77 -0
- package/src/bin/estimate.ts +129 -0
- package/src/client/index.tsx +300 -0
- package/src/configSchema.json +56 -0
- package/src/engine/businesscase.ts +139 -0
- package/src/engine/defaults.ts +354 -0
- package/src/engine/effort.ts +119 -0
- package/src/engine/estimate.ts +135 -0
- package/src/engine/modes.ts +312 -0
- package/src/engine/report.ts +239 -0
- package/src/engine/roles.ts +82 -0
- package/src/engine/simulate.ts +114 -0
- package/src/engine/sizing.ts +108 -0
- package/src/engine/types.ts +288 -0
- package/src/engine/workbook.ts +143 -0
- package/src/engine/xlsx.ts +228 -0
- package/src/engine/yaml.ts +205 -0
- package/src/server/index.ts +123 -0
- package/src/telemetry/sessions.ts +380 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Role model
|
|
2
|
+
|
|
3
|
+
## The principle
|
|
4
|
+
|
|
5
|
+
The role split is a **distribution of one effort estimate**, never a second independent
|
|
6
|
+
estimate. That is what keeps the numbers reconcilable: change the scope and every role
|
|
7
|
+
line moves together, and the sum always equals the total.
|
|
8
|
+
|
|
9
|
+
Estimating each role separately produces a number that cannot be defended, because
|
|
10
|
+
nobody can say which role absorbed the scope change.
|
|
11
|
+
|
|
12
|
+
## Default distribution
|
|
13
|
+
|
|
14
|
+
| Role | Share | What it covers |
|
|
15
|
+
|---|---:|---|
|
|
16
|
+
| Product Owner / BA | 7% | Requirements elaboration, acceptance criteria, backlog grooming, client Q&A |
|
|
17
|
+
| Architect | 6% | Architecture decisions, ADRs, technical spikes, design review |
|
|
18
|
+
| UX / UI Designer | 7% | Flows, wireframes, visual design, design system, accessibility design |
|
|
19
|
+
| Frontend Developer | 17% | UI implementation, state, client-side validation |
|
|
20
|
+
| Backend Developer | 22% | Domain logic, APIs, persistence, jobs |
|
|
21
|
+
| Data / Integration Engineer | 9% | Third-party integrations, ETL, message queues, data mapping |
|
|
22
|
+
| QA / Test Automation | 16% | Test design, automation, exploratory testing, regression, UAT support |
|
|
23
|
+
| DevOps / SRE | 6% | CI/CD, environments, deployment, observability |
|
|
24
|
+
| Security Engineer | 2% | Threat modelling, review, remediation coordination |
|
|
25
|
+
| Tech Lead | 3% | Code review, technical coordination, unblocking |
|
|
26
|
+
| Project Manager | 5% | Planning, reporting, client comms, risk management |
|
|
27
|
+
|
|
28
|
+
**Grounding.** The dev/non-dev split lands at roughly 60/40, which matches the local
|
|
29
|
+
offer corpus closely: a completed WMS project spent 301 of 479 MD (62.8%) on build
|
|
30
|
+
modules and 178 MD (37.2%) on testing, project management and deployment/training —
|
|
31
|
+
with QA at 15.2% and PM at 10% of the total. A separate SME project ran QA at 17% of
|
|
32
|
+
total. Externally this is consistent with ISBSG role-effort-ratio guidance and
|
|
33
|
+
McConnell's activity breakdown (ch. 21).
|
|
34
|
+
|
|
35
|
+
## Size tilt
|
|
36
|
+
|
|
37
|
+
Above 4,000 hours the engine tilts the split toward coordination: +2% PM, +2% QA,
|
|
38
|
+
+1% Architect, taken proportionally from Frontend and Backend. Bigger projects spend
|
|
39
|
+
proportionally more on communication and verification — this is the same phenomenon the
|
|
40
|
+
COCOMO scale exponent captures on the effort side.
|
|
41
|
+
|
|
42
|
+
Empirical work (Bibi et al.; the large Wang & Zhang dataset) shows phase and role
|
|
43
|
+
distribution moves with project size and domain. **The table is a prior, not a truth.**
|
|
44
|
+
Override it via `team.role_ratios` whenever you know better.
|
|
45
|
+
|
|
46
|
+
## Which roles are "build"
|
|
47
|
+
|
|
48
|
+
The delivery-mode model compresses only build effort. These roles are treated as build:
|
|
49
|
+
|
|
50
|
+
`Frontend Developer`, `Backend Developer`, `Data / Integration Engineer`, `Architect`,
|
|
51
|
+
`DevOps / SRE` — about 60% of total effort.
|
|
52
|
+
|
|
53
|
+
Everything else — Product Owner/BA, UX, QA, Security, Tech Lead, PM — is the ~40% that
|
|
54
|
+
does **not** shrink because a model writes the code. Manual accessibility testing, client
|
|
55
|
+
iteration, compliance evidence, security sign-off and project management are human work
|
|
56
|
+
regardless of how the code gets typed.
|
|
57
|
+
|
|
58
|
+
This single split is why "AI writes code 10× faster" turns into a single-digit project
|
|
59
|
+
saving. If someone disputes your AI-savings number, this table is the argument.
|
|
60
|
+
|
|
61
|
+
## Overriding
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
team:
|
|
65
|
+
role_ratios:
|
|
66
|
+
Backend Developer: 0.30
|
|
67
|
+
Frontend Developer: 0.20
|
|
68
|
+
QA / Test Automation: 0.20
|
|
69
|
+
Project Manager: 0.10
|
|
70
|
+
Architect: 0.10
|
|
71
|
+
DevOps / SRE: 0.10
|
|
72
|
+
seniority_mix:
|
|
73
|
+
senior: 0.5
|
|
74
|
+
mid: 0.3
|
|
75
|
+
junior: 0.2
|
|
76
|
+
hours_per_day: 8
|
|
77
|
+
fte: 4
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Ratios are normalised automatically, so they need not sum to 1. Supplying
|
|
81
|
+
`role_ratios` disables the size tilt — you are asserting you know the split.
|
|
82
|
+
|
|
83
|
+
**Roles you name must exist in the rate card**, or their cost is zero and the engine
|
|
84
|
+
warns. Check the warning list; a silent zero is how a quote loses money.
|
|
85
|
+
|
|
86
|
+
## Seniority mix
|
|
87
|
+
|
|
88
|
+
The mix does two things: it blends the day rate per role, and it modifies the AI
|
|
89
|
+
speedup (juniors gained most in the field experiments). Default is
|
|
90
|
+
40% senior / 40% mid / 20% junior.
|
|
91
|
+
|
|
92
|
+
A mix that is too senior is expensive twice over: higher rates, and a smaller marginal
|
|
93
|
+
AI benefit.
|
|
94
|
+
|
|
95
|
+
## Roles people forget to include
|
|
96
|
+
|
|
97
|
+
- **Security review and remediation** on anything handling personal or financial data
|
|
98
|
+
- **DevOps** for environments — dev/test/staging/prod is four times the setup, not one
|
|
99
|
+
- **Support handover and documentation** before go-live
|
|
100
|
+
- **Hypercare** in the weeks after go-live
|
|
101
|
+
- **Client-side effort** — if the client must test, validate or author content, say so
|
|
102
|
+
explicitly in the assumptions; it is not free, it is just not yours
|
|
103
|
+
|
|
104
|
+
## Sources
|
|
105
|
+
|
|
106
|
+
- ISBSG, *Planning Projects: Role Effort Ratios*
|
|
107
|
+
- McConnell, *Software Estimation: Demystifying the Black Art*, ch. 21
|
|
108
|
+
- Bibi et al., *An investigation of effort distribution among development phases*
|
|
109
|
+
- Local offer corpus: completed WMS project module and role split; SME quality-platform QA share
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Sizing methods
|
|
2
|
+
|
|
3
|
+
## Why UCP is the primary method here
|
|
4
|
+
|
|
5
|
+
The input this skill receives is use cases, actors, requirements and a stack. That is
|
|
6
|
+
exactly UCP's native input. Function Points need logical files and transaction types;
|
|
7
|
+
COSMIC needs data movements per functional process; COCOMO needs a size in FP or SLOC
|
|
8
|
+
that you do not have yet. UCP is the only method that consumes the artefact you are
|
|
9
|
+
actually handed at quoting time.
|
|
10
|
+
|
|
11
|
+
Published comparative reviews put UCP at the best of the classical trio
|
|
12
|
+
(MMRE ≈ 39%, versus ≈ 90% for FPA), with COCOMO in between. Note what MMRE ≈ 39% means:
|
|
13
|
+
**a typical estimate is wrong by about 40%.** That is the state of the art. It is why
|
|
14
|
+
this skill refuses to emit a point number without a range.
|
|
15
|
+
|
|
16
|
+
## The formulas the engine implements
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
UUCW = Σ use-case weights
|
|
20
|
+
≤3 transactions → simple → 5
|
|
21
|
+
4–7 transactions → average → 10
|
|
22
|
+
>7 transactions → complex → 15
|
|
23
|
+
|
|
24
|
+
UAW = Σ actor weights
|
|
25
|
+
API / well-defined programmatic interface → 1
|
|
26
|
+
protocol or database interface (TCP, HTTP, FTP, DB) → 2
|
|
27
|
+
human actor through a GUI → 3
|
|
28
|
+
|
|
29
|
+
TCF = 0.6 + 0.01 × Σ(weightᵢ × ratingᵢ) 13 technical factors, rating 0–5
|
|
30
|
+
ECF = 1.4 − 0.03 × Σ(weightⱼ × ratingⱼ) 8 environmental factors, rating 0–5
|
|
31
|
+
|
|
32
|
+
UCP = (UUCW + UAW) × TCF × ECF
|
|
33
|
+
Effort = UCP × hours-per-UCP
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Karner's original constant is **20 h/UCP**; practice ranges 15–30. Use a reference class.
|
|
37
|
+
|
|
38
|
+
### Technical factors (T1–T13) and their weights
|
|
39
|
+
|
|
40
|
+
| # | Factor | Weight |
|
|
41
|
+
|---|---|---:|
|
|
42
|
+
| T1 | Distributed system | 2.0 |
|
|
43
|
+
| T2 | Response time / throughput objectives | 1.0 |
|
|
44
|
+
| T3 | End-user efficiency | 1.0 |
|
|
45
|
+
| T4 | Complex internal processing | 1.0 |
|
|
46
|
+
| T5 | Reusable code | 1.0 |
|
|
47
|
+
| T6 | Easy to install | 0.5 |
|
|
48
|
+
| T7 | Easy to use | 0.5 |
|
|
49
|
+
| T8 | Portable | 2.0 |
|
|
50
|
+
| T9 | Easy to change | 1.0 |
|
|
51
|
+
| T10 | Concurrent | 1.0 |
|
|
52
|
+
| T11 | Special security objectives | 1.0 |
|
|
53
|
+
| T12 | Direct access for third parties | 1.0 |
|
|
54
|
+
| T13 | Special user training facilities | 1.0 |
|
|
55
|
+
|
|
56
|
+
Rate 0 = irrelevant, 5 = essential. All-3 ratings give TCF ≈ 1.02, i.e. neutral.
|
|
57
|
+
|
|
58
|
+
### Environmental factors (E1–E8) and their weights
|
|
59
|
+
|
|
60
|
+
| # | Factor | Weight |
|
|
61
|
+
|---|---|---:|
|
|
62
|
+
| E1 | Familiarity with the development process | 1.5 |
|
|
63
|
+
| E2 | Application experience | 0.5 |
|
|
64
|
+
| E3 | Object-oriented / paradigm experience | 1.0 |
|
|
65
|
+
| E4 | Lead analyst capability | 0.5 |
|
|
66
|
+
| E5 | Motivation | 1.0 |
|
|
67
|
+
| E6 | Stable requirements | 2.0 |
|
|
68
|
+
| E7 | Part-time staff | −1.0 |
|
|
69
|
+
| E8 | Difficult programming language | −1.0 |
|
|
70
|
+
|
|
71
|
+
Note the sign flip on E7 and E8: for those two, a **high** rating makes the project
|
|
72
|
+
*harder*, so it reduces ECF's subtrahend and raises effort. Rate E7 by how much
|
|
73
|
+
part-time staffing there is, and E8 by how difficult the language is.
|
|
74
|
+
|
|
75
|
+
## Counting transactions — the judgment that matters most
|
|
76
|
+
|
|
77
|
+
A "transaction" is one stimulus/response round trip between an actor and the system: an
|
|
78
|
+
atomic step that either completes or rolls back. Count them across the main success
|
|
79
|
+
scenario **and** the alternate/exception flows.
|
|
80
|
+
|
|
81
|
+
Consistency beats precision. If you count generously on one use case and stingily on
|
|
82
|
+
the next, the relative sizing is wrong and no calibration can fix it. Pick a convention
|
|
83
|
+
and hold it across the whole input file:
|
|
84
|
+
|
|
85
|
+
- A form submission with validation and a persisted result = 1 transaction.
|
|
86
|
+
- A multi-step wizard = 1 transaction per step that hits the server.
|
|
87
|
+
- "System sends a notification" = 1 transaction.
|
|
88
|
+
- A read-only list view with filtering = 1 transaction.
|
|
89
|
+
- An exception path that requires distinct handling logic = 1 transaction.
|
|
90
|
+
|
|
91
|
+
Do **not** count internal method calls, database round trips, or UI state changes that
|
|
92
|
+
never reach the server.
|
|
93
|
+
|
|
94
|
+
## Diseconomy of scale — why UCP alone is optimistic
|
|
95
|
+
|
|
96
|
+
UCP is linear: 2× the use cases gives 2× the effort. Real projects do not behave that
|
|
97
|
+
way. COCOMO II encodes this in an exponent:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
E = B + 0.01 × Σ scale factors B = 0.91
|
|
101
|
+
PM = A × Size^E × Π(effort multipliers) A = 2.94
|
|
102
|
+
TDEV = C × PM^(D + 0.2 × (E − B)) C = 3.67, D = 0.28
|
|
103
|
+
```
|
|
104
|
+
(COCOMO II.2000 Model Definition Manual, USC.)
|
|
105
|
+
|
|
106
|
+
Since E > 1 for essentially every real project, doubling scope more than doubles effort.
|
|
107
|
+
The engine applies this as `(UCP / reference_UCP)^(E − 1)`, so at the reference size the
|
|
108
|
+
adjustment is exactly 1.0 and your calibrated h/UCP keeps its meaning.
|
|
109
|
+
|
|
110
|
+
### The five scale factors
|
|
111
|
+
|
|
112
|
+
| Factor | Meaning | Rate it `high`/`very-high` when… |
|
|
113
|
+
|---|---|---|
|
|
114
|
+
| PREC | Precedentedness | you have built this kind of system before |
|
|
115
|
+
| FLEX | Development flexibility | the client will negotiate on requirements |
|
|
116
|
+
| RESL | Risk resolution | architecture risks are already retired |
|
|
117
|
+
| TEAM | Team cohesion | the team has worked together before |
|
|
118
|
+
| PMAT | Process maturity | the delivery process is established and measured |
|
|
119
|
+
|
|
120
|
+
Each rating from `very-low` to `extra-high` lowers the exponent. A novel domain with an
|
|
121
|
+
unproven process (`PREC: low`, `PMAT: low`) can push E above 1.10 — a 30% penalty on a
|
|
122
|
+
large project relative to a well-precedented one.
|
|
123
|
+
|
|
124
|
+
## Cross-checks worth running
|
|
125
|
+
|
|
126
|
+
**COSMIC (ISO 19761)** — size = count of data movements (Entry, Exit, Read, Write) across
|
|
127
|
+
functional processes. Best when use cases are written as flows, and it scales cleanly to
|
|
128
|
+
APIs and services where UCP's "actor" concept gets strained. Divergence of more than
|
|
129
|
+
~25% between UCP and COSMIC sizing is a signal that the use cases are written at
|
|
130
|
+
inconsistent granularity — fix the input, not the model.
|
|
131
|
+
|
|
132
|
+
**IFPUG FP + SNAP** — SNAP is the only standardized *non-functional* size unit; if you
|
|
133
|
+
already have an FP count, SNAP is a more rigorous alternative to this skill's residual
|
|
134
|
+
NFR multiplier.
|
|
135
|
+
|
|
136
|
+
**Expert judgment / planning poker** — use as a challenge to the model output, never as
|
|
137
|
+
the model input. When the team's bottom-up number and the model diverge by more than
|
|
138
|
+
30%, the disagreement itself is the useful artefact: find which use case they disagree
|
|
139
|
+
about.
|
|
140
|
+
|
|
141
|
+
## Sources
|
|
142
|
+
|
|
143
|
+
- Karner, *Resource Estimation for Objectory Projects* (via the Use Case Points literature)
|
|
144
|
+
- Cohn, *Estimating With Use Case Points*, Mountain Goat Software
|
|
145
|
+
- COCOMO II.2000 Model Definition Manual, USC Center for Systems and Software Engineering
|
|
146
|
+
- ISO/IEC 19761 (COSMIC); ISO/IEC 20926 (IFPUG FP)
|
|
147
|
+
- McConnell, *Software Estimation: Demystifying the Black Art*
|
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# @blackbelt-technology/pi-dashboard-cost-estimator
|
|
2
|
+
|
|
3
|
+
Estimate software cost and effort from use cases, functional and non-functional
|
|
4
|
+
requirements, and a technology stack — then calibrate the model against what actually
|
|
5
|
+
happened, using real pi session telemetry.
|
|
6
|
+
|
|
7
|
+
Ships three things:
|
|
8
|
+
|
|
9
|
+
1. **A skill** (`.pi/skills/software-cost-estimator`) — the workflow, references and rules
|
|
10
|
+
the agent follows when producing an estimate.
|
|
11
|
+
2. **A zero-dependency engine** (`src/engine/`) — the arithmetic, so the numbers are
|
|
12
|
+
reproducible and auditable rather than model-generated.
|
|
13
|
+
3. **A dashboard plugin** (`src/client/`, `src/server/`) — measured steering hours, agent
|
|
14
|
+
cost and subscription leverage per project.
|
|
15
|
+
|
|
16
|
+
## Why the split matters
|
|
17
|
+
|
|
18
|
+
The LLM does **judgment**: decomposing use cases, counting transactions, rating TCF/ECF
|
|
19
|
+
factors, routing NFRs, classifying which work AI is actually good at.
|
|
20
|
+
|
|
21
|
+
The engine does **arithmetic**: UCP → COCOMO II scale → role distribution → four delivery
|
|
22
|
+
modes → Monte Carlo → NPV.
|
|
23
|
+
|
|
24
|
+
That separation is what makes an estimate defensible to a client. Every number has a
|
|
25
|
+
derivation someone can check.
|
|
26
|
+
|
|
27
|
+
## Quick start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# estimate
|
|
31
|
+
node bin/estimate.mjs input.yaml --out ./out
|
|
32
|
+
|
|
33
|
+
# calibrate scope productivity from a delivered project
|
|
34
|
+
node bin/calibrate.mjs input.yaml --actual-days 479 --exclude-contingency
|
|
35
|
+
|
|
36
|
+
# calibrate agent cost + steering time from real session telemetry
|
|
37
|
+
node bin/calibrate-sessions.mjs --plans
|
|
38
|
+
node bin/calibrate-sessions.mjs --plan anthropic-max-20x --seats 2
|
|
39
|
+
node bin/calibrate-sessions.mjs --project my-repo --actual-days 120
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Outputs: `estimate-report.md`, `delivery-mode-comparison.md`, `business-case.md`,
|
|
43
|
+
`estimate.xlsx`.
|
|
44
|
+
|
|
45
|
+
## The four delivery modes
|
|
46
|
+
|
|
47
|
+
| Mode | Who writes the code |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `human_only` | People, no assistance |
|
|
50
|
+
| `human_with_ai` | People with inline assistance |
|
|
51
|
+
| `ai_steered_human_supervised` | Agents, steered and reviewed by a person |
|
|
52
|
+
| `agentic_hitl` | Agents, with human-in-the-loop oversight at an intensity level |
|
|
53
|
+
|
|
54
|
+
AI compresses **build effort only** (~60% of a project). PM, client iteration, compliance,
|
|
55
|
+
manual QA and security sign-off do not shrink because a model writes the code. That single
|
|
56
|
+
constraint is why "AI is 10× faster" collapses into single-digit project savings.
|
|
57
|
+
|
|
58
|
+
## Cost basis: subscription vs metered
|
|
59
|
+
|
|
60
|
+
Session logs record a **metered API-price computation**. Most teams do not pay that — they
|
|
61
|
+
buy flat seat plans. The two bases have different *shapes*:
|
|
62
|
+
|
|
63
|
+
| | Metered | Subscription |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| Cost scales with | work volume | seats × calendar months |
|
|
66
|
+
| Marginal cost of more agent use | linear | zero, until quota |
|
|
67
|
+
| Overrun risk lands on | cost | schedule (throttling) |
|
|
68
|
+
|
|
69
|
+
So under a subscription, **schedule is a cost driver** and quota exhaustion is a schedule
|
|
70
|
+
risk, not a cost overrun. Set `ai.cost_basis: subscription` and list your seat plans.
|
|
71
|
+
|
|
72
|
+
Leverage (meter-equivalent ÷ seat cost) is reported as *leverage* — never as a saving
|
|
73
|
+
passed to a client. It is on-demand value the flat plan captured, not a discount.
|
|
74
|
+
|
|
75
|
+
## Dependency split (load-bearing)
|
|
76
|
+
|
|
77
|
+
| Layer | Dependencies |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `src/engine/` | **none** — hand-rolled YAML parser, Monte Carlo, XLSX writer |
|
|
80
|
+
| `src/telemetry/` | `pi-dashboard-shared`, `pi-dashboard-session-distiller` |
|
|
81
|
+
|
|
82
|
+
The engine must run in any project with no dashboard installed. Only the telemetry adapter
|
|
83
|
+
touches the session store, and it reads through the dashboard's own readers so a
|
|
84
|
+
session-schema change lands in one place. **If engine code imports from `telemetry/`,
|
|
85
|
+
portability is gone.**
|
|
86
|
+
|
|
87
|
+
## Dashboard plugin
|
|
88
|
+
|
|
89
|
+
| Slot | Component | Purpose |
|
|
90
|
+
|---|---|---|
|
|
91
|
+
| `command-route` | `CostView` | `cost` command → steering hours, meter-equivalent, actual subscription cost, leverage, per-project table |
|
|
92
|
+
| `settings-section` | `CostSettings` | Seat plan, seat count, break threshold |
|
|
93
|
+
|
|
94
|
+
Server route: `GET /api/cost-estimator/telemetry` (read-only, 60s cache).
|
|
95
|
+
|
|
96
|
+
No `content-view` claim. `forSession()` keeps every predicate-less claim, so an
|
|
97
|
+
unpredicated `content-view` claim replaces `ChatView` for every session, always,
|
|
98
|
+
with no chrome to dismiss it. `CostView` is a global report — the `cost`
|
|
99
|
+
command-route is its entry point.
|
|
100
|
+
|
|
101
|
+
## Tests
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx vitest run packages/cost-estimator # from the monorepo root
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
43 tests covering the published formulas (Karner's worked example, COCOMO II.2000
|
|
108
|
+
constants, Beta-PERT), the NFR double-counting guard, the correlated-risk shape, the
|
|
109
|
+
subscription cost basis, and the gap-capping rule.
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
MIT
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Thin launcher: run the TypeScript CLI via tsx.
|
|
3
|
+
// The engine uses ".js" specifiers per repo convention, which bare node cannot
|
|
4
|
+
// resolve to ".ts" sources — tsx does.
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
import { dirname, join } from "node:path";
|
|
8
|
+
|
|
9
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const entry = join(here, "..", "src", "bin", "calibrate-sessions.ts");
|
|
11
|
+
const res = spawnSync("npx", ["tsx", entry, ...process.argv.slice(2)], { stdio: "inherit" });
|
|
12
|
+
process.exit(res.status ?? 1);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Thin launcher: run the TypeScript CLI via tsx.
|
|
3
|
+
// The engine uses ".js" specifiers per repo convention, which bare node cannot
|
|
4
|
+
// resolve to ".ts" sources — tsx does.
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
import { dirname, join } from "node:path";
|
|
8
|
+
|
|
9
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const entry = join(here, "..", "src", "bin", "calibrate.ts");
|
|
11
|
+
const res = spawnSync("npx", ["tsx", entry, ...process.argv.slice(2)], { stdio: "inherit" });
|
|
12
|
+
process.exit(res.status ?? 1);
|
package/bin/estimate.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Thin launcher: run the TypeScript CLI via tsx.
|
|
3
|
+
// The engine uses ".js" specifiers per repo convention, which bare node cannot
|
|
4
|
+
// resolve to ".ts" sources — tsx does.
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
import { dirname, join } from "node:path";
|
|
8
|
+
|
|
9
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const entry = join(here, "..", "src", "bin", "estimate.ts");
|
|
11
|
+
const res = spawnSync("npx", ["tsx", entry, ...process.argv.slice(2)], { stdio: "inherit" });
|
|
12
|
+
process.exit(res.status ?? 1);
|
package/package.json
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blackbelt-technology/pi-dashboard-cost-estimator",
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "Software cost & effort estimation from use cases, functional and non-functional requirements and a tech stack. Sizes with Use Case Points + COCOMO II scale, routes NFRs to derived scope or a residual multiplier, distributes effort across 11 roles, compares four delivery modes (human_only, human_with_ai, ai_steered_human_supervised, agentic_hitl), and runs a Beta-PERT Monte Carlo plus an NPV/ROI business case. Calibrates agent cost and steering time from real pi session telemetry.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/BlackBeltTechnology/pi-agent-dashboard",
|
|
10
|
+
"directory": "packages/cost-estimator"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"pi-package",
|
|
17
|
+
"pi-skill",
|
|
18
|
+
"pi-dashboard",
|
|
19
|
+
"cost-estimation",
|
|
20
|
+
"effort-estimation",
|
|
21
|
+
"use-case-points",
|
|
22
|
+
"cocomo",
|
|
23
|
+
"monte-carlo",
|
|
24
|
+
"business-case",
|
|
25
|
+
"agentic-cost",
|
|
26
|
+
"session-telemetry"
|
|
27
|
+
],
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./src/client/index.tsx",
|
|
31
|
+
"default": "./src/client/index.tsx"
|
|
32
|
+
},
|
|
33
|
+
"./engine/*.js": "./src/engine/*.ts",
|
|
34
|
+
"./engine/*": "./src/engine/*",
|
|
35
|
+
"./telemetry/*.js": "./src/telemetry/*.ts",
|
|
36
|
+
"./telemetry/*": "./src/telemetry/*",
|
|
37
|
+
"./client": {
|
|
38
|
+
"types": "./src/client/index.tsx",
|
|
39
|
+
"default": "./src/client/index.tsx"
|
|
40
|
+
},
|
|
41
|
+
"./server": {
|
|
42
|
+
"types": "./src/server/index.ts",
|
|
43
|
+
"default": "./src/server/index.ts"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"bin": {
|
|
47
|
+
"pi-estimate": "bin/estimate.mjs",
|
|
48
|
+
"pi-estimate-calibrate": "bin/calibrate.mjs",
|
|
49
|
+
"pi-estimate-calibrate-sessions": "bin/calibrate-sessions.mjs"
|
|
50
|
+
},
|
|
51
|
+
"pi": {
|
|
52
|
+
"skills": [
|
|
53
|
+
".pi/skills/software-cost-estimator"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"pi-dashboard-plugin": {
|
|
57
|
+
"id": "cost-estimator",
|
|
58
|
+
"displayName": "Cost",
|
|
59
|
+
"priority": 100,
|
|
60
|
+
"requiredApi": "^0.x",
|
|
61
|
+
"client": "./src/client/index.tsx",
|
|
62
|
+
"server": "./src/server/index.ts",
|
|
63
|
+
"configSchema": "./src/configSchema.json",
|
|
64
|
+
"claims": [
|
|
65
|
+
{
|
|
66
|
+
"slot": "command-route",
|
|
67
|
+
"component": "CostView",
|
|
68
|
+
"command": "cost"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"slot": "settings-section",
|
|
72
|
+
"component": "CostSettings",
|
|
73
|
+
"config": {
|
|
74
|
+
"tab": "general"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"files": [
|
|
80
|
+
"src/",
|
|
81
|
+
"bin/",
|
|
82
|
+
"!**/__tests__",
|
|
83
|
+
"!**/*.test.ts",
|
|
84
|
+
"!**/*.test.tsx",
|
|
85
|
+
".pi/skills/",
|
|
86
|
+
"README.md"
|
|
87
|
+
],
|
|
88
|
+
"scripts": {
|
|
89
|
+
"test": "vitest run"
|
|
90
|
+
},
|
|
91
|
+
"dependencies": {
|
|
92
|
+
"@blackbelt-technology/dashboard-plugin-runtime": "^0.7.0",
|
|
93
|
+
"@blackbelt-technology/pi-dashboard-session-distiller": "^0.7.0",
|
|
94
|
+
"@blackbelt-technology/pi-dashboard-shared": "^0.7.0"
|
|
95
|
+
}
|
|
96
|
+
}
|