mustflow 2.116.4 → 2.117.1

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 (43) hide show
  1. package/package.json +1 -1
  2. package/templates/default/i18n.toml +152 -8
  3. package/templates/default/locales/en/.mustflow/skills/INDEX.md +131 -13
  4. package/templates/default/locales/en/.mustflow/skills/agent-eval-integrity-review/SKILL.md +62 -34
  5. package/templates/default/locales/en/.mustflow/skills/agent-execution-control-review/SKILL.md +102 -31
  6. package/templates/default/locales/en/.mustflow/skills/agent-memory-context-governance-review/SKILL.md +163 -0
  7. package/templates/default/locales/en/.mustflow/skills/agent-planning-recovery-review/SKILL.md +180 -0
  8. package/templates/default/locales/en/.mustflow/skills/agent-release-bundle-rollout-review/SKILL.md +181 -0
  9. package/templates/default/locales/en/.mustflow/skills/agent-runtime-isolation-review/SKILL.md +196 -0
  10. package/templates/default/locales/en/.mustflow/skills/agent-runtime-multi-worker-review/SKILL.md +180 -0
  11. package/templates/default/locales/en/.mustflow/skills/automation-investment-case-review/SKILL.md +173 -0
  12. package/templates/default/locales/en/.mustflow/skills/client-platform-strategy-review/SKILL.md +236 -0
  13. package/templates/default/locales/en/.mustflow/skills/connection-lifecycle-integrity-review/SKILL.md +302 -0
  14. package/templates/default/locales/en/.mustflow/skills/connection-lifecycle-integrity-review/references/connection-fault-injection-resource-lifetime-validation.md +277 -0
  15. package/templates/default/locales/en/.mustflow/skills/connection-lifecycle-integrity-review/references/node-stream-transport-lifecycle-checklist.md +381 -0
  16. package/templates/default/locales/en/.mustflow/skills/credit-ledger-integrity-review/SKILL.md +8 -4
  17. package/templates/default/locales/en/.mustflow/skills/credit-monetization-integrity-review/SKILL.md +283 -0
  18. package/templates/default/locales/en/.mustflow/skills/desktop-commercial-distribution-review/SKILL.md +225 -0
  19. package/templates/default/locales/en/.mustflow/skills/external-prompt-injection-defense/SKILL.md +49 -3
  20. package/templates/default/locales/en/.mustflow/skills/freemium-ad-monetization-review/SKILL.md +196 -0
  21. package/templates/default/locales/en/.mustflow/skills/game-economy-monetization-review/SKILL.md +208 -0
  22. package/templates/default/locales/en/.mustflow/skills/game-liveops-commerce-integrity-review/SKILL.md +237 -0
  23. package/templates/default/locales/en/.mustflow/skills/growth-distribution-integrity-review/SKILL.md +247 -0
  24. package/templates/default/locales/en/.mustflow/skills/idempotency-integrity-review/SKILL.md +20 -2
  25. package/templates/default/locales/en/.mustflow/skills/llm-model-routing-integrity-review/SKILL.md +183 -0
  26. package/templates/default/locales/en/.mustflow/skills/llm-product-monetization-review/SKILL.md +311 -0
  27. package/templates/default/locales/en/.mustflow/skills/llm-token-cost-control-review/SKILL.md +15 -1
  28. package/templates/default/locales/en/.mustflow/skills/localization-market-expansion-review/SKILL.md +224 -0
  29. package/templates/default/locales/en/.mustflow/skills/memory-lifetime-review/SKILL.md +94 -2
  30. package/templates/default/locales/en/.mustflow/skills/memory-lifetime-review/references/cross-runtime-memory-stream-reproduction-harness.md +289 -0
  31. package/templates/default/locales/en/.mustflow/skills/memory-lifetime-review/references/node-memory-resource-backpressure-diagnostics.md +369 -0
  32. package/templates/default/locales/en/.mustflow/skills/multi-agent-work-coordination/SKILL.md +7 -2
  33. package/templates/default/locales/en/.mustflow/skills/pricing-model-integrity-review/SKILL.md +288 -0
  34. package/templates/default/locales/en/.mustflow/skills/product-engagement-retention-review/SKILL.md +234 -0
  35. package/templates/default/locales/en/.mustflow/skills/product-onboarding-activation-review/SKILL.md +269 -0
  36. package/templates/default/locales/en/.mustflow/skills/product-portfolio-integrity-review/SKILL.md +233 -0
  37. package/templates/default/locales/en/.mustflow/skills/prompt-contract-quality-review/SKILL.md +1 -0
  38. package/templates/default/locales/en/.mustflow/skills/referral-incentive-integrity-review/SKILL.md +206 -0
  39. package/templates/default/locales/en/.mustflow/skills/retry-policy-integrity-review/SKILL.md +45 -2
  40. package/templates/default/locales/en/.mustflow/skills/routes.toml +346 -7
  41. package/templates/default/locales/en/.mustflow/skills/service-portfolio-capital-allocation-review/SKILL.md +245 -0
  42. package/templates/default/locales/en/.mustflow/skills/subscription-retention-profit-review/SKILL.md +217 -0
  43. package/templates/default/manifest.toml +97 -1
@@ -0,0 +1,183 @@
1
+ ---
2
+ mustflow_doc: skill.llm-model-routing-integrity-review
3
+ locale: en
4
+ canonical: true
5
+ revision: 2
6
+ lifecycle: mustflow-owned
7
+ authority: procedure
8
+ name: llm-model-routing-integrity-review
9
+ description: Apply this skill when an LLM system selects, cascades, escalates, falls back, or switches models by task, stage, confidence, verifier result, distribution shift, cost, latency, quality, safety, or context handoff and must optimize total cost per accepted outcome without hiding route-specific failures.
10
+ metadata:
11
+ mustflow_schema: "1"
12
+ mustflow_kind: procedure
13
+ pack_id: mustflow.core
14
+ skill_id: mustflow.core.llm-model-routing-integrity-review
15
+ command_intents:
16
+ - changes_status
17
+ - changes_diff_summary
18
+ - lint
19
+ - build
20
+ - test_related
21
+ - test
22
+ - docs_validate_fast
23
+ - test_release
24
+ - mustflow_check
25
+ ---
26
+
27
+ # LLM Model Routing Integrity Review
28
+
29
+ <!-- mustflow-section: purpose -->
30
+ ## Purpose
31
+
32
+ Choose the least expensive model path that still satisfies measured outcome, latency, and safety
33
+ requirements. Prevent a cheap per-call route from becoming expensive after retries and repairs, and
34
+ prevent a strong-model default from becoming an unevaluated permanent tax.
35
+
36
+ <!-- mustflow-section: use-when -->
37
+ ## Use When
38
+
39
+ - A system adds or changes a model router, small-to-large cascade, escalation threshold, fallback,
40
+ provider or region route, stage-specific model, ensemble, speculative path, or confidence gate.
41
+ - Planning, retrieval, coding, validation, summarization, classification, or tool-use stages may use
42
+ different models and context can be lost when the route changes.
43
+ - Routing depends on cost, latency, accepted-outcome probability, external verifier results,
44
+ uncertainty, risk, task value, traffic volume, or distribution shift.
45
+ - A claim says a smaller model is sufficient, a stronger model is worth the premium, or a routing
46
+ system pays for its own fixed evaluation and operating cost.
47
+
48
+ <!-- mustflow-section: do-not-use-when -->
49
+ ## Do Not Use When
50
+
51
+ - The main risk is prompt payload size, cacheability, token budgets, reasoning spend, or retry replay
52
+ rather than route correctness; use `llm-token-cost-control-review`.
53
+ - The main risk is response speed, streaming, speculative cancellation, or time to first useful
54
+ output; use `llm-response-latency-review`.
55
+ - The main risk is agent tool authority, approval, side effects, or autonomy; use
56
+ `agent-execution-control-review`.
57
+ - The main risk is selling standard versus premium outcomes, charging for automatic escalation,
58
+ task-unit price, managed provider cost, or BYOK packaging; use
59
+ `llm-product-monetization-review`. Keep this skill for route correctness and total route cost.
60
+ - The task chooses a provider or technology stack for strategic reasons rather than routing requests
61
+ among already supported models; use `technology-stack-selection`.
62
+
63
+ <!-- mustflow-section: required-inputs -->
64
+ ## Required Inputs
65
+
66
+ - Outcome contract: accepted task result, deterministic and semantic validators, safety floor,
67
+ latency objective, abstain or escalation state, and value or loss of a wrong result.
68
+ - Route ledger: task and stage types, candidate models and versions, route features, baseline route,
69
+ escalation and fallback rules, context handoff, retry owner, route version, and stable assignment.
70
+ - Evidence ledger: per-route accepted-outcome rate, confidence interval or conservative bound,
71
+ false-accept and false-reject rates, route coverage, sample size, task mix, risk mix, and evaluator
72
+ independence.
73
+ - Cost and latency ledger: model, router, verifier, retry, repair, handoff, supervision, and fixed
74
+ evaluation, adapter, monitoring, migration, and maintenance cost.
75
+ - Distribution ledger: training and evaluation distribution, production feature distribution,
76
+ missing-feature behavior, out-of-distribution detector, drift monitor, and safe fallback.
77
+ - Safety ledger: tasks that require a fixed strong route, deterministic path, human decision, or
78
+ hard refusal regardless of expected financial utility.
79
+
80
+ <!-- mustflow-section: preconditions -->
81
+ ## Preconditions
82
+
83
+ - Establish a capable-model baseline and accepted-outcome evaluator before claiming a cheaper route
84
+ preserves quality.
85
+ - Treat model self-confidence, verbal certainty, token probability, and router score as uncalibrated
86
+ until matched to external outcome evidence on the current task distribution.
87
+ - Refresh provider model, price, latency, retention, and endpoint claims before embedding exact
88
+ values. Do not copy benchmark percentages or universal thresholds into reusable policy.
89
+ - Keep command execution under `.mustflow/config/commands.toml`; this skill does not authorize live
90
+ model calls, traffic routing, billing access, or production rollout.
91
+
92
+ <!-- mustflow-section: allowed-edits -->
93
+ ## Allowed Edits
94
+
95
+ - Add or refine route schemas, features, baseline and candidate policies, external verifiers,
96
+ escalation and abstain states, context handoff, OOD fallback, metrics, eval fixtures, shadow
97
+ comparisons, tests, docs, route metadata, and synchronized templates.
98
+ - Move deterministic classification, validation, policy, arithmetic, schema checking, and database
99
+ postconditions out of model routing when code can decide them.
100
+ - Do not weaken quality or safety validators to make a cheaper route appear successful.
101
+ - Do not route high-impact decisions by average utility when a hard safety or authorization gate
102
+ fails.
103
+
104
+ <!-- mustflow-section: procedure -->
105
+ ## Procedure
106
+
107
+ 1. Define the accepted outcome before selecting a model. Include final-state correctness, safety,
108
+ latency, abstention, and repair rules rather than counting a syntactically valid response.
109
+ 2. Establish the baseline with the most capable practical route and current evals. Only then replace
110
+ bounded task classes or stages with smaller models where accepted outcomes remain sufficient.
111
+ 3. Route deterministic work to code first. Do not pay a model or router to decide values that a
112
+ schema, compiler, test, database lookup, permission engine, or exact rule can determine.
113
+ 4. Choose route granularity from real context boundaries. Keep tightly coupled planning and
114
+ execution on one model when switching would lose hidden constraints or require replaying most of
115
+ the context. Split classification, retrieval-query generation, formatting, or verification when
116
+ their inputs and outputs are explicit and independently checkable.
117
+ 5. Measure route quality with external evidence. Calibrate router scores against tests, schema and
118
+ business validation, source agreement, database postconditions, human adjudication, or another
119
+ independent oracle. Preserve false-accept cost separately from ordinary failure.
120
+ 6. Optimize total cost per accepted outcome. Include router, verifier, failed cheap attempts,
121
+ escalation, retries, repair, context transfer, supervision, latency loss, and fixed operating
122
+ cost. A lower model price is not a saving when acceptance falls or repair rises.
123
+ 7. Apply hard constraints before utility. Authorization, privacy, irreversible effects, safety
124
+ invariants, and maximum tolerable loss can force a deterministic, strong-model, human, or refusal
125
+ route even when a cheaper path has positive expected value.
126
+ 8. Build cheap-first cascades only when the acceptance gate can reject bad cheap outputs with known
127
+ false-accept behavior. Without an external verifier, repeated sampling and self-critique do not
128
+ prove which candidate is correct.
129
+ 9. Escalate from observed evidence, not model preference. Use validator failure, missing required
130
+ facts, task complexity, risk class, OOD state, repeated error signature, or explicit uncertainty
131
+ features. Do not escalate privileges when escalating model capability.
132
+ 10. Handle distribution shift explicitly. Compare production features and outcomes with the route's
133
+ evaluation distribution. Send missing, novel, drifted, or low-support cases to the safe baseline
134
+ route, deterministic review, or human owner.
135
+ 11. Account for context handoff loss. Version the handoff schema, preserve verified facts and hard
136
+ constraints, avoid summary-on-summary drift, and measure whether route switches cause omissions
137
+ or contradictory plans.
138
+ 12. Keep route and retry ownership separate. A route change may be a recovery action, but it must
139
+ share the workflow's attempt budget and idempotency state rather than restarting the task as a
140
+ new operation.
141
+ 13. Compare candidates in shadow or replay before promotion. Pin model and route versions, use the
142
+ same representative task mix, preserve delayed outcomes, and route rollout details through
143
+ `agent-release-bundle-rollout-review` when the router is part of an agent bundle.
144
+ 14. Recalculate routing economics when traffic, task distribution, models, prices, verifier quality,
145
+ repair rate, or maintenance burden changes. Route broad investment decisions to
146
+ `automation-investment-case-review`.
147
+
148
+ <!-- mustflow-section: postconditions -->
149
+ ## Postconditions
150
+
151
+ - Every route has an accepted-outcome contract, external evidence, safe fallback, and versioned
152
+ decision reason.
153
+ - Cost comparisons include failed attempts, verification, escalation, repair, context handoff, and
154
+ fixed operating cost.
155
+ - OOD and hard-safety cases cannot silently enter a cheap route.
156
+ - Model self-confidence is not treated as outcome probability without calibration.
157
+
158
+ <!-- mustflow-section: verification -->
159
+ ## Verification
160
+
161
+ Use configured oneshot command intents when available: `changes_status`, `changes_diff_summary`,
162
+ `lint`, `build`, `test_related`, `test`, `docs_validate_fast`, `test_release`, and `mustflow_check`.
163
+ Do not infer raw provider, model, billing, traffic, eval, or rollout commands.
164
+
165
+ <!-- mustflow-section: failure-handling -->
166
+ ## Failure Handling
167
+
168
+ - If no accepted-outcome evaluator exists, keep the baseline route and report the missing gate.
169
+ - If route evidence is sparse or distribution support is missing, abstain from the cheaper route.
170
+ - If false accepts can create high-impact harm, treat the route as unsafe until a hard gate or human
171
+ decision closes the boundary.
172
+ - If route savings depend on stale price or benchmark data, mark the economic claim unverified.
173
+
174
+ <!-- mustflow-section: output-format -->
175
+ ## Output Format
176
+
177
+ - Outcome contract and baseline route
178
+ - Candidate route, features, version, and context boundary
179
+ - External calibration, false-accept, OOD, and drift evidence
180
+ - Total cost-per-accepted-outcome and latency findings
181
+ - Hard safety, escalation, fallback, and abstain decisions
182
+ - Command intents run and skipped checks
183
+ - Remaining model-routing risk
@@ -0,0 +1,311 @@
1
+ ---
2
+ mustflow_doc: skill.llm-product-monetization-review
3
+ locale: en
4
+ canonical: true
5
+ revision: 2
6
+ lifecycle: mustflow-owned
7
+ authority: procedure
8
+ name: llm-product-monetization-review
9
+ description: Apply this skill when an LLM product changes token-based versus task- or outcome-based pricing, bounded document/image/analysis units, standard versus precision service tiers, free versus paid queue priority, first-value queue exemptions, automatic credit restoration or retry rights for failed work, user-facing model disclosure or model pinning, cheap-default and premium-model packaging, internal model escalation, managed provider cost, BYOK or customer-supplied API keys, platform fees, included credits, margin, conversion, or retained contribution and must keep user-visible value understandable while internal provider cost, capacity, failure, transparency, and credential risk remain controlled.
10
+ metadata:
11
+ mustflow_schema: "1"
12
+ mustflow_kind: procedure
13
+ pack_id: mustflow.core
14
+ skill_id: mustflow.core.llm-product-monetization-review
15
+ command_intents:
16
+ - changes_status
17
+ - changes_diff_summary
18
+ - lint
19
+ - build
20
+ - test_related
21
+ - test
22
+ - docs_validate_fast
23
+ - test_release
24
+ - mustflow_check
25
+ ---
26
+
27
+ # LLM Product Monetization Review
28
+
29
+ <!-- mustflow-section: purpose -->
30
+ ## Purpose
31
+
32
+ Sell an understandable unit of user value while metering tokens, tools, models, retries, storage,
33
+ capacity, and provider cost internally. Package quality, queue priority, failure recovery, model
34
+ transparency, and credential funding without manufacturing delay, charging for unusable work,
35
+ exposing unstable vendor implementation as the product contract, surprising users after automatic
36
+ escalation, or turning BYOK into insecure onboarding friction and a margin escape hatch.
37
+
38
+ <!-- mustflow-section: use-when -->
39
+ ## Use When
40
+
41
+ - A consumer, SMB, developer, or enterprise LLM product chooses token, character, page, document,
42
+ image, minute, run, analysis, report, accepted result, credit, seat, or hybrid billing units.
43
+ - A task unit changes its page, byte, duration, source, OCR, search, tool, output, retry, quality,
44
+ latency, concurrency, or variable-cost boundary.
45
+ - A product offers standard, fast, precise, premium, verified, or named-model tiers, or automatically
46
+ escalates from a cheaper model to a stronger model.
47
+ - Free and paid users receive different queue priority, concurrency, start-time objectives, capacity
48
+ shares, first-value treatment, background completion, or paid fast-lane promises.
49
+ - Provider errors, timeouts, empty or malformed output, quality-gate failures, subjective
50
+ dissatisfaction, automatic retries, credit restoration, bound retry rights, or abuse controls
51
+ change.
52
+ - A product chooses outcome-mode labels, provider or model-family disclosure, exact model and
53
+ version receipts, fallback disclosure, model pinning, or internal provider replacement policy.
54
+ - A product chooses managed provider credentials, BYOK, customer cloud accounts, a platform fee,
55
+ included usage, prepaid credits, or enterprise provider routing.
56
+ - Conversion, cost per accepted result, gross margin, failed-work charging, heavy-tail cost, retained
57
+ use, or provider migration economics are created, changed, reviewed, or reported.
58
+
59
+ <!-- mustflow-section: do-not-use-when -->
60
+ ## Do Not Use When
61
+
62
+ - The main risk is prompt payload, token counting, caching, RAG packing, retry replay, output budget,
63
+ or internal cost telemetry; use `llm-token-cost-control-review`.
64
+ - The main risk is whether a router, cascade, escalation, fallback, or context handoff preserves
65
+ accepted outcomes; use `llm-model-routing-integrity-review`.
66
+ - The task only changes a model picker, progress, result, citation, or error interface without price
67
+ or credential economics; use `llm-service-ux-review`.
68
+ - The task only changes scheduler fairness, queue durability, starvation, admission control, or
69
+ latency instrumentation without a free-versus-paid product policy; use
70
+ `queue-processing-integrity-review` and `llm-response-latency-review`.
71
+ - The task only changes generic plan price, annual billing, trial, regional pricing, or non-LLM usage
72
+ pricing; use `pricing-model-integrity-review`.
73
+ - The main risk is credit reserve, balance, capture, release, reversal, expiry, or spend order; use
74
+ `credit-monetization-integrity-review` and `credit-ledger-integrity-review`.
75
+ - The main risk is secret storage, tenant isolation, key brokerage, credential access, exfiltration,
76
+ provider terms, residency, or incident response. Use the security, privacy, secret, and provider
77
+ owners; this skill supplies the product and economics contract.
78
+
79
+ <!-- mustflow-section: required-inputs -->
80
+ ## Required Inputs
81
+
82
+ - Audience ledger: consumer, prosumer, developer, SMB, enterprise, procurement, technical ability,
83
+ expected cadence, willingness evidence, failure cost, and budget predictability.
84
+ - Task-unit ledger: user job, accepted result, input and output bounds, pages, bytes, duration, media,
85
+ OCR, search, tools, sources, iterations, revisions, latency, concurrency, price, credits, and overage.
86
+ - Internal-cost ledger: provider, model, input, cached, output, and reasoning tokens; tool calls;
87
+ images, audio, video, storage, search, OCR, egress, retry, verification, moderation, support,
88
+ payment, fraud, refund, and failed-work cost.
89
+ - Quality-tier ledger: public tier, accepted-outcome contract, latency, evidence, verification,
90
+ included operations, route version, automatic escalation, fallback, user-selected upgrade, and
91
+ price authorization.
92
+ - Credential ledger: managed or customer-funded account, provider, key owner, scope, storage,
93
+ encryption, access, rotation, deletion, logging, quota, residency, audit, failure, and support.
94
+ - Economics ledger: eligible-user conversion, useful completion, paid use, cumulative revenue,
95
+ provider cost, tail cost, contribution, refund, chargeback, support, abuse, churn, and retention.
96
+ - Experiment ledger: pre-price assignment, package parity, audience and task strata, exposure,
97
+ horizon, provider and model versions, guardrails, and promotion rule.
98
+ - Queue-service ledger: first owned value, free and paid eligibility, real capacity state, weight or
99
+ reservation policy, concurrency, aging, starvation bound, enqueue and start time, estimated range,
100
+ background delivery, abandonment, cancellation, capacity cost, and service objective.
101
+ - Failure-recovery ledger: attempt and quote identity, failure classifier, provider and product
102
+ evidence, deterministic quality gate, retry lineage, reservation, capture, release, reversal,
103
+ restored asset, bound retry right, expiry, abuse evidence, appeal, and support state.
104
+ - Transparency ledger: public mode, accepted-outcome contract, provider, model family and version,
105
+ route and fallback version, execution receipt, customer pin, reproducibility need, procurement or
106
+ jurisdiction requirement, AI-origin marking, change notice, and retention policy.
107
+
108
+ <!-- mustflow-section: preconditions -->
109
+ ## Preconditions
110
+
111
+ - Separate the customer-visible billing unit, internal resource meter, service-quality tier, and
112
+ credential-funding model. One does not prove the others.
113
+ - Define an accepted user result and failure policy before pricing a task or capturing credit.
114
+ - Define first owned value before imposing a materially slower free queue, and classify objective
115
+ system failure separately from subjective dissatisfaction before granting a reusable asset.
116
+ - Assign experiments before price, model tier, or BYOK setup becomes visible and keep abandoners in
117
+ the intent-to-treat denominator.
118
+ - Refresh current provider models, prices, meters, tool charges, tokenizers, key rules, retention,
119
+ regional availability, and platform terms before embedding exact claims.
120
+ - Treat copied page limits, credit ratios, percentiles, margin targets, model names, price multiples,
121
+ and another product's BYOK policy as hypotheses, not defaults.
122
+ - This skill does not authorize live price, provider, credential, credit, routing, experiment,
123
+ payment, or production changes.
124
+
125
+ <!-- mustflow-section: allowed-edits -->
126
+ ## Allowed Edits
127
+
128
+ - Add or refine task units, scope limits, quotes, quality tiers, model-independent service contracts,
129
+ real-capacity queue classes, first-value exemptions, failure classifiers, automatic restoration,
130
+ bound retry rights, execution receipts, model disclosure and pinning, BYOK and managed-cost policy,
131
+ platform fees, contribution metrics, experiment events, fixtures, tests, docs, route metadata, and
132
+ synchronized templates.
133
+ - Add explicit handoffs to token-cost, model-routing, credit-ledger, payment, security, privacy,
134
+ provider, accounting, tax, or legal owners.
135
+ - Remove unbounded per-document pricing, post-hoc token bills, surprise escalation charges,
136
+ client-side key storage, hidden provider cost, fake unlimited use, or free BYOK that receives the
137
+ full product platform without covering its cost.
138
+ - Do not change the promised price after internal retry or escalation unless the user explicitly
139
+ authorized a separately defined higher service tier before execution.
140
+
141
+ <!-- mustflow-section: procedure -->
142
+ ## Procedure
143
+
144
+ 1. Split seven decisions: external billing unit, internal resource meter, public service tier,
145
+ managed versus customer-funded credentials, queue priority, failure recovery, and model
146
+ transparency. Do not present one bundle as the only possible design.
147
+ 2. Classify the buyer. End-user products need predictable job and result language; developer APIs can
148
+ expose resource meters where technical buyers control payload and value that transparency;
149
+ enterprise products may need both task budgets and provider-account control.
150
+ 3. Prefer a user-recognizable unit when the product owns an end-to-end job. Name the accepted result
151
+ and scope rather than selling an ambiguous document, image, analysis, or agent run with no bounds.
152
+ 4. Bound every task unit. Define input pages or bytes, media duration and resolution, OCR, search,
153
+ tools, sources, revisions, output length, latency, concurrency, timeout, and overflow behavior.
154
+ Split materially different jobs instead of hiding extreme cost in one average.
155
+ 5. Quote before execution. Show task tier, fixed or bounded credit spend, included work, maximum
156
+ scope, and failure treatment. Route reservation, useful-result capture, release, and reversal
157
+ through the credit skills.
158
+ 6. Treat paid priority as a capacity contract, not synthetic friction. When capacity is available,
159
+ start eligible free and paid work promptly; never add sleep solely to manufacture an upgrade.
160
+ 7. Protect first owned value. Let a new eligible user receive enough successful representative work
161
+ to judge the product before a materially slower free lane where cost, safety, and abuse permit.
162
+ Derive the allowance from result variance and marginal cost rather than copying a universal count.
163
+ 8. Design queue priority from observed load and abandonment. Define work class, weight or reserved
164
+ capacity, concurrency, aging, cancellation, starvation bound, and overload behavior. Preserve a
165
+ bounded free path rather than strict paid-first starvation.
166
+ 9. Show honest wait state. Measure enqueue-to-start separately from generation time, show a range or
167
+ queue state backed by current evidence, preserve work after the user leaves where appropriate, and
168
+ notify or place completed work in an owned result surface. Do not show fake exact countdowns.
169
+ 10. Derive queue objectives from task duration, user attention, first-value state, capacity cost,
170
+ abandonment curves, and paid value. Treat copied seconds, minutes, weights, or capacity shares as
171
+ experiment candidates, not service laws.
172
+ 11. Meter the complete internal cost. Include tokens, cache behavior, reasoning, tools, media,
173
+ retrieval, storage, retries, verification, moderation, support, payment, abuse, and refunds. A
174
+ token-only ledger can understate the cost of the task the customer bought.
175
+ 12. Price tail risk deliberately. Use the observed cost distribution and a declared service objective
176
+ rather than average cost alone; a percentile such as p95 can be a candidate, not a universal law.
177
+ Add scope splits, overage, or a higher tier when bounded honest pricing cannot cover the tail.
178
+ 13. Derive the floor from retained contribution, not a copied markup. Include full variable cost,
179
+ refunds, support, acquisition, provider volatility, and useful-result probability. Validate that
180
+ the customer values the bounded result above that floor.
181
+ 14. Classify failures before settlement. Treat provider errors, timeouts, empty output, corrupt media,
182
+ truncated required output, deterministic schema failure, duplicate execution, and declared
183
+ quality-gate failure as objective candidates when current evidence can reproduce the rule.
184
+ 15. For objective operator-owned failure, retry only when the same logical attempt can do so safely;
185
+ otherwise release or reverse the authorized charge automatically and idempotently. Do not make
186
+ users file a claim for a failure the system already proved.
187
+ 16. Keep subjective dissatisfaction separate. A same-lineage, nontransferable retry right can be a
188
+ candidate when intent fit is uncertain, but do not convert every dislike into general-purpose
189
+ credit. Bound reuse, model escalation, expiry, review, and appeal from observed abuse and cost.
190
+ 17. Evaluate restoration by incremental variable cost and retained contribution, not credit face
191
+ value alone. Include extra execution, support avoided, repurchase, refunds, disputes, abuse, and
192
+ user trust; never use a universal refund or complaint quota as the product contract.
193
+ 18. Route reserve, capture, release, reversal, retry identity, and reconciliation through the credit
194
+ skills. A browser timeout or client cancellation alone does not prove provider failure or permit
195
+ duplicate restoration.
196
+ 19. Keep public tiers model-independent by default. Describe speed, result quality, verification,
197
+ source coverage, revision policy, and latency. Do not promise a vendor model name unless that
198
+ identity is itself a required and maintainable contract.
199
+ 20. Make the standard tier good enough to represent the product. A deliberately poor cheap result is
200
+ an activation failure, not an upgrade funnel. Escalate internally when needed to meet the promised
201
+ standard accepted outcome.
202
+ 21. Do not surprise-charge automatic escalation. Router, verifier, retry, and stronger-model cost
203
+ used to satisfy the selected tier belongs to the operator. Charge more only for a user-selected,
204
+ prepriced tier with materially different scope or outcome.
205
+ 22. Route quality through `llm-model-routing-integrity-review`. Compare total cost per accepted
206
+ outcome, false accepts, retries, repairs, context handoff, OOD fallback, and fixed evaluation
207
+ cost; cheap per-call price alone is not product margin.
208
+ 23. Separate AI transparency from vendor merchandising. Tell users they are using AI and expose
209
+ material limitations, provenance, or generated-content marking required by the product and
210
+ current authority; that does not require turning an unstable model brand into the plan name.
211
+ 24. Keep an auditable execution receipt. Record provider, model family and version, route, fallback,
212
+ tools, and execution time internally, and expose the subset needed for user verification,
213
+ procurement, reproducibility, support, or jurisdiction rules without leaking secrets.
214
+ 25. Offer exact model pinning only when identity or reproducibility is a paid or regulated contract.
215
+ A pinned execution must not silently substitute another model; fail, ask, or use an explicitly
216
+ accepted fallback. Outcome-mode routes may change providers only while preserving their accepted
217
+ result and disclosure contract.
218
+ 26. Refresh transparency and marking duties by product role, geography, content type, publication
219
+ path, and date. Do not infer that a visible watermark alone satisfies machine-readable marking,
220
+ disclosure, accessibility, provenance, or legal obligations.
221
+ 27. Use an expensive-only baseline when the declared failure cost, safety floor, or narrow task value
222
+ justifies it. Do not generalize a high-stakes exception to ordinary extraction, transformation,
223
+ drafting, or classification.
224
+ 28. Compare managed and BYOK from the full activation path. Include external account creation,
225
+ billing setup, key creation, trust, storage, quota, provider support, first-value delay, conversion,
226
+ cost control, and retained platform revenue.
227
+ 29. Keep managed credentials as a strong candidate when immediate end-user activation and integrated
228
+ usage revenue matter. Bound abuse with task limits, concurrency, budgets, idempotency, cost alerts,
229
+ and explicit included usage rather than a secretly throttled unlimited promise.
230
+ 30. Offer BYOK where technical or enterprise buyers need provider ownership, negotiated pricing,
231
+ region, model, quota, or procurement control. Charge a platform fee for workflow, storage,
232
+ collaboration, retrieval, audit, support, and automation value that remains operator-owned.
233
+ 31. Treat customer keys as secrets, never ordinary preferences. Require server-side or approved
234
+ secure handling, least privilege, encryption, access audit, redaction, rotation, deletion,
235
+ tenant isolation, and bounded provider errors; route the implementation to security owners.
236
+ 32. Prevent credential-mode arbitrage and lock-in. Define which features, support, quotas, providers,
237
+ credits, and usage records differ between managed and BYOK modes, and let qualified customers
238
+ migrate without losing owned product data.
239
+ 33. Preserve external price meaning across provider and model changes. Version the task, quality,
240
+ cost, route, and credential contracts so internal optimization can improve margin without
241
+ silently reducing the result the user purchased.
242
+ 34. Evaluate from eligible assignment over meaningful repeat-use and billing horizons. Track first
243
+ value, queue wait and abandonment, useful completion, conversion, task mix, tail cost, gross
244
+ margin, contribution, provider failures, automatic reversals, retry-right use, abuse, support,
245
+ BYOK setup loss, churn, and retained use.
246
+ 35. Promote only a reversible policy that improves eligible-user contribution while preserving
247
+ understandable scope, nonmanufactured queueing, useful-result charging, fair failure recovery,
248
+ acceptable quality, credential security, current transparency duties, provider compliance, and
249
+ explicit latency, model-routing, credit, and security handoffs.
250
+
251
+ <!-- mustflow-section: postconditions -->
252
+ ## Postconditions
253
+
254
+ - External task or resource units and internal provider-cost meters are separate and reconstructable.
255
+ - Each task unit has an accepted result, scope, quote, overflow, failure, and tail-cost policy.
256
+ - Standard and premium tiers describe product outcomes rather than relying on unstable model names.
257
+ - Automatic retry or model escalation cannot create an unapproved price increase.
258
+ - Free and paid queue classes consume real capacity, preserve first value and a bounded free path,
259
+ expose honest wait state, and do not manufacture delay.
260
+ - Objective operator-owned failure can release or reverse charges idempotently, while subjective
261
+ dissatisfaction uses a separately bounded recovery asset when offered.
262
+ - AI-origin, outcome mode, execution receipt, exact model pinning, fallback, and provider replacement
263
+ have explicit transparency and reproducibility boundaries.
264
+ - Managed and BYOK modes have explicit activation, credential, quota, platform-fee, support, revenue,
265
+ migration, and security boundaries.
266
+ - Headline economics use eligible users and total cost per accepted result over retained use.
267
+
268
+ <!-- mustflow-section: verification -->
269
+ ## Verification
270
+
271
+ Use configured oneshot command intents when available: `changes_status`, `changes_diff_summary`,
272
+ `lint`, `build`, `test_related`, `test`, `docs_validate_fast`, `test_release`, and `mustflow_check`.
273
+ Do not infer live provider, model, key, billing, credit, analytics, experiment, deployment, or
274
+ production commands.
275
+
276
+ <!-- mustflow-section: failure-handling -->
277
+ ## Failure Handling
278
+
279
+ - If task scope or accepted result is undefined, do not publish a fixed task price.
280
+ - If complete internal cost is unavailable, label margin as unverified and add bounded limits before
281
+ expanding managed usage.
282
+ - If a cheaper route lacks accepted-outcome evidence, keep the capable baseline and route the gap to
283
+ the model-routing skill.
284
+ - If a paid queue converts only by intentionally slowing idle free capacity, reject it as synthetic
285
+ friction. If the free lane can starve, add bounded capacity or aging before promotion.
286
+ - If failure cannot be classified or the attempt cannot be reconciled, keep the reservation pending
287
+ under a bounded recovery policy; do not both retry and restore reusable value blindly.
288
+ - If current product-role, content, or jurisdiction transparency duties are unresolved, preserve an
289
+ auditable execution receipt and route the launch decision to qualified authority.
290
+ - If customer keys cannot be isolated, redacted, rotated, and deleted securely, do not offer hosted
291
+ BYOK; preserve managed mode or require an approved enterprise integration boundary.
292
+ - If a pricing arm wins conversion but loses accepted results, retained contribution, support, or
293
+ security guardrails, reject or narrow it.
294
+
295
+ <!-- mustflow-section: output-format -->
296
+ ## Output Format
297
+
298
+ - Audience, accepted result, task unit, limits, quote, overflow, and settlement policy
299
+ - Internal token, tool, media, retry, verification, support, and tail-cost ledger
300
+ - Standard and premium outcome contracts, automatic route, escalation, and price authorization
301
+ - Queue eligibility, first-value treatment, capacity, fairness, wait evidence, abandonment, and paid
302
+ priority decision
303
+ - Objective failure, subjective dissatisfaction, retry lineage, restoration asset, abuse, appeal,
304
+ reserve, capture, release, and reversal decision
305
+ - AI-origin disclosure, execution receipt, model family and version, pinning, fallback, provider
306
+ replacement, reproducibility, and authority decision
307
+ - Managed and BYOK activation, credential, quota, platform-fee, migration, and security decision
308
+ - Eligible conversion, accepted results, margin, contribution, retention, and provider evidence
309
+ - Files changed
310
+ - Command intents run and skipped checks
311
+ - Remaining LLM product monetization risk
@@ -2,7 +2,7 @@
2
2
  mustflow_doc: skill.llm-token-cost-control-review
3
3
  locale: en
4
4
  canonical: true
5
- revision: 5
5
+ revision: 7
6
6
  lifecycle: mustflow-owned
7
7
  authority: procedure
8
8
  name: llm-token-cost-control-review
@@ -47,6 +47,12 @@ Review LLM cost as a product and systems contract, not as prompt brevity. A cost
47
47
  - The main risk is unsupported factual output, fabricated citations, source coverage, answerability, abstain behavior, retrieval thresholds, or hallucination metrics; use `llm-hallucination-control-review`.
48
48
  - The main risk is time to first token, first useful output, streaming, LLM round trips, tool wait, prompt-cache latency, model routing speed, priority tier, realtime continuation, or user-perceived response speed; use `llm-response-latency-review`.
49
49
  - The main risk is autonomous agent execution control, tool-call approval, side-effect replay safety, durable resume behavior, handoffs, guardrails, loop budgets, retry classification, or trace outcome evaluation; use `agent-execution-control-review`.
50
+ - The main risk is whether a model router, cascade, escalation, fallback, or stage switch preserves
51
+ accepted outcomes under quality, safety, latency, context-handoff, and distribution-shift risk;
52
+ use `llm-model-routing-integrity-review`. Keep this skill for token and request-cost mechanics.
53
+ - The main risk is customer-visible token versus task pricing, bounded outcome units, standard versus
54
+ premium packaging, managed provider cost, BYOK, platform fees, or failed-work charging; use
55
+ `llm-product-monetization-review`. Keep this skill for internal resource and cost mechanics.
50
56
  - The main risk is cloud account, infrastructure, SaaS, quota, budget, tag, retention, or provider-account spend guardrails outside the model-call payload; use `cloud-cost-guardrail-review`.
51
57
  - The main risk is rate-limit fairness, throttling, quota counters, concurrency limits, 429 response behavior, or protected-resource definition; use `rate-limit-integrity-review`.
52
58
  - The task only edits user-visible copy and does not affect LLM payload, model choice, retry behavior, or cost telemetry.
@@ -69,6 +75,9 @@ Review LLM cost as a product and systems contract, not as prompt brevity. A cost
69
75
  prompt-packing rule, and current input-token measurement.
70
76
  - Output ledger: output schema size, repeated key length, patch versus full-output policy, `max_output_tokens`, reasoning budget, retry repair inputs, validator errors, and incomplete-response handling.
71
77
  - Routing ledger: deterministic prefilters, small-model router, expensive-model escalation rule, batch or flex eligibility, predicted-output eligibility, image or file preprocessing, and fallback behavior.
78
+ - For route-quality decisions, include the accepted-outcome evaluator, false-accept behavior,
79
+ distribution support, context-switch loss, and fixed router or verifier cost through
80
+ `llm-model-routing-integrity-review` instead of treating token price as sufficient evidence.
72
81
  - Observability ledger: input tokens, cached tokens when exposed by the provider, output tokens, reasoning tokens when exposed or billable, retry count, validation failure count, cache hit rate, cost per successful task, model, endpoint, prompt version, tool version, schema version, and budget breach events.
73
82
  - Boundary ledger: token estimates and caps owned here; accepted-work reservation persistence owned by `command-pattern`; prepaid or money-equivalent reserve, capture, and release owned by `credit-ledger-integrity-review`; allow, block, downgrade, and obligation provenance owned by `policy-decision-integrity-review`.
74
83
 
@@ -134,6 +143,9 @@ Review LLM cost as a product and systems contract, not as prompt brevity. A cost
134
143
  17. Pack by references before raw text. Prefer stable document ids, chunk ids, section anchors, source maps, block refs, and token counts when choosing context. Expand only the needed source spans instead of replaying a whole corpus or full document list.
135
144
  18. Keep tool and schema payloads boring. Tool descriptions and JSON schemas should be long enough for correct routing and validation but not narrative prose. If permissions differ by user, keep schema stable and enforce permission at tool execution.
136
145
  19. Route before calling the expensive model. Use deterministic code, regexes, database lookups, small models, or cheap classifiers for tasks that do not need a large reasoning model; escalate only ambiguous, high-value, or failed cases.
146
+ Judge candidate models by total cost per accepted outcome, including verifier, escalation,
147
+ retry, repair, and handoff cost. Route calibration, OOD fallback, false-accept risk, and hard
148
+ safety constraints through `llm-model-routing-integrity-review`.
137
149
  20. Budget reasoning and output together. Set reasoning effort and output limits according to task value; leave enough room for visible output, and handle incomplete responses instead of silently retrying the full expensive request.
138
150
  21. Prefer patches over full regeneration when the product already owns most of the output. Use unified diff, JSON Patch, line-range replacement, IDs, labels, scores, or reason codes when downstream code can merge the result.
139
151
  22. Repair failures without full replay. For parse failures, enum mismatches, missing fields, or validator errors, retry with previous output, validator error, and schema summary when safe instead of resending the entire original context.
@@ -155,6 +167,8 @@ Review LLM cost as a product and systems contract, not as prompt brevity. A cost
155
167
  - Compression quality is evaluated against answer, citation, numeric, constraint, and refusal behavior rather than judged by shorter text alone.
156
168
  - Deterministic work is handled outside the model unless language judgment is required.
157
169
  - Metrics can explain cost per successful task, cache-prefix drift, retry cost, validation failures, and model routing decisions without leaking sensitive prompt or user data.
170
+ - Cheaper-model claims are separated from route-integrity evidence and do not rely on per-call price
171
+ alone.
158
172
  - Final reports distinguish proven cost-control evidence from assumed provider behavior, anecdotal token savings, and latency-only optimizations.
159
173
 
160
174
  <!-- mustflow-section: verification -->