@lssm/module.lifecycle-core 0.0.0-canary-20251206160926
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 +63 -0
- package/dist/adapters/analytics-adapter.d.ts +13 -0
- package/dist/adapters/intent-adapter.d.ts +11 -0
- package/dist/adapters/questionnaire-adapter.d.ts +13 -0
- package/dist/collectors/signal-collector.d.ts +24 -0
- package/dist/collectors/signal-collector.js +1 -0
- package/dist/data/milestones-catalog.js +1 -0
- package/dist/data/stage-weights.js +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1 -0
- package/dist/libs/lifecycle/dist/index.js +1 -0
- package/dist/libs/lifecycle/dist/types/axes.js +1 -0
- package/dist/libs/lifecycle/dist/types/milestones.js +1 -0
- package/dist/libs/lifecycle/dist/types/signals.js +1 -0
- package/dist/libs/lifecycle/dist/types/stages.js +1 -0
- package/dist/libs/lifecycle/dist/utils/formatters.js +1 -0
- package/dist/orchestrator/lifecycle-orchestrator.d.ts +21 -0
- package/dist/orchestrator/lifecycle-orchestrator.js +1 -0
- package/dist/planning/milestone-planner.d.ts +10 -0
- package/dist/planning/milestone-planner.js +1 -0
- package/dist/scoring/stage-scorer.d.ts +26 -0
- package/dist/scoring/stage-scorer.js +1 -0
- package/package.json +41 -0
- package/src/data/milestones-catalog.json +87 -0
- package/src/data/stage-weights.json +109 -0
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @lssm/module.lifecycle-core
|
|
2
|
+
|
|
3
|
+
Signal collection + scoring module for ContractSpec lifecycle assessments. It wraps analytics/questionnaire adapters, applies weighting logic, and produces normalized `LifecycleAssessment` objects.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Adapter-driven signal collector (analytics, questionnaires, intent logs)
|
|
8
|
+
- Configurable stage scoring weights
|
|
9
|
+
- Milestone planner backed by JSON catalog
|
|
10
|
+
- Lifecycle orchestrator that returns assessments + scorecards
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import {
|
|
16
|
+
LifecycleOrchestrator,
|
|
17
|
+
StageSignalCollector,
|
|
18
|
+
StageScorer,
|
|
19
|
+
LifecycleMilestonePlanner,
|
|
20
|
+
} from '@lssm/module.lifecycle-core';
|
|
21
|
+
|
|
22
|
+
const collector = new StageSignalCollector({
|
|
23
|
+
analyticsAdapter,
|
|
24
|
+
questionnaireAdapter,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const scorer = new StageScorer();
|
|
28
|
+
const planner = new LifecycleMilestonePlanner();
|
|
29
|
+
|
|
30
|
+
const orchestrator = new LifecycleOrchestrator({
|
|
31
|
+
collector,
|
|
32
|
+
scorer,
|
|
33
|
+
planner,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const assessment = await orchestrator.run({
|
|
37
|
+
questionnaireAnswers: answers,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
console.log(assessment.stage, assessment.confidence);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Adapters are interfaces—you can implement them inside bundles, Studio services, or examples without touching this module.*** End Patch
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LifecycleAxes, LifecycleMetricSnapshot, LifecycleSignal } from "@lssm/lib.lifecycle";
|
|
2
|
+
|
|
3
|
+
//#region src/adapters/analytics-adapter.d.ts
|
|
4
|
+
interface AnalyticsAdapterResult {
|
|
5
|
+
metrics?: LifecycleMetricSnapshot;
|
|
6
|
+
signals?: LifecycleSignal[];
|
|
7
|
+
axes?: Partial<LifecycleAxes>;
|
|
8
|
+
}
|
|
9
|
+
interface AnalyticsAdapter {
|
|
10
|
+
fetch(): Promise<AnalyticsAdapterResult>;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { AnalyticsAdapter, AnalyticsAdapterResult };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LifecycleSignal } from "@lssm/lib.lifecycle";
|
|
2
|
+
|
|
3
|
+
//#region src/adapters/intent-adapter.d.ts
|
|
4
|
+
interface IntentAdapterResult {
|
|
5
|
+
signals?: LifecycleSignal[];
|
|
6
|
+
}
|
|
7
|
+
interface IntentAdapter {
|
|
8
|
+
fetch(): Promise<IntentAdapterResult>;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { IntentAdapter, IntentAdapterResult };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LifecycleAxes, LifecycleSignal } from "@lssm/lib.lifecycle";
|
|
2
|
+
|
|
3
|
+
//#region src/adapters/questionnaire-adapter.d.ts
|
|
4
|
+
interface QuestionnaireAdapterResult {
|
|
5
|
+
axes?: Partial<LifecycleAxes>;
|
|
6
|
+
signals?: LifecycleSignal[];
|
|
7
|
+
answers?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
interface QuestionnaireAdapter {
|
|
10
|
+
fetch(): Promise<QuestionnaireAdapterResult>;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { QuestionnaireAdapter, QuestionnaireAdapterResult };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AnalyticsAdapter } from "../adapters/analytics-adapter.js";
|
|
2
|
+
import { QuestionnaireAdapter } from "../adapters/questionnaire-adapter.js";
|
|
3
|
+
import { IntentAdapter } from "../adapters/intent-adapter.js";
|
|
4
|
+
import { LifecycleAssessmentInput, LifecycleAxes, LifecycleMetricSnapshot, LifecycleSignal } from "@lssm/lib.lifecycle";
|
|
5
|
+
|
|
6
|
+
//#region src/collectors/signal-collector.d.ts
|
|
7
|
+
interface StageSignalCollectorOptions {
|
|
8
|
+
analyticsAdapter?: AnalyticsAdapter;
|
|
9
|
+
questionnaireAdapter?: QuestionnaireAdapter;
|
|
10
|
+
intentAdapter?: IntentAdapter;
|
|
11
|
+
}
|
|
12
|
+
interface StageSignalCollectorResult {
|
|
13
|
+
axes: LifecycleAxes;
|
|
14
|
+
metrics: LifecycleMetricSnapshot;
|
|
15
|
+
signals: LifecycleSignal[];
|
|
16
|
+
questionnaireAnswers?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
declare class StageSignalCollector {
|
|
19
|
+
private readonly options;
|
|
20
|
+
constructor(options: StageSignalCollectorOptions);
|
|
21
|
+
collect(input?: LifecycleAssessmentInput): Promise<StageSignalCollectorResult>;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { StageSignalCollector, StageSignalCollectorOptions, StageSignalCollectorResult };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e,n as t,t as n}from"../libs/lifecycle/dist/types/axes.js";import"../libs/lifecycle/dist/index.js";const r={product:e.Sketch,company:n.Solo,capital:t.Bootstrapped};var i=class{options;constructor(e){this.options=e}async collect(e={}){let t={...r,...e.axes??{}},n=[],i=[...e.signals??[]],s={...e.questionnaireAnswers??{}};if(e.metrics&&n.push(e.metrics),this.options.analyticsAdapter){let e=await this.options.analyticsAdapter.fetch();e.axes&&Object.assign(t,e.axes),e.metrics&&n.push(e.metrics),e.signals&&i.push(...e.signals)}if(this.options.questionnaireAdapter){let e=await this.options.questionnaireAdapter.fetch();e.axes&&Object.assign(t,e.axes),e.signals&&i.push(...e.signals),Object.assign(s,e.answers)}if(this.options.intentAdapter){let e=await this.options.intentAdapter.fetch();e.signals&&i.push(...e.signals)}return{axes:t,metrics:a(n),signals:o(i),questionnaireAnswers:Object.keys(s).length?s:void 0}}};const a=e=>e.reduce((e,t)=>(Object.entries(t??{}).forEach(([t,n])=>{n!=null&&(e[t]=n)}),e),{}),o=e=>{let t=new Set;return e.filter(e=>e.id?t.has(e.id)?!1:(t.add(e.id),!0):!0)};export{i as StageSignalCollector};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=[{id:`stage0-problem-statement`,stage:0,category:`product`,title:`Write the pain statement`,description:`Capture the clearest description of the top problem in the customer’s own words.`,priority:1,actionItems:[`Interview at least 5 ideal customers`,`Synthesize quotes into a one-page brief`]},{id:`stage1-prototype-loop`,stage:1,category:`product`,title:`Prototype feedback loop`,description:`Ship a clickable prototype and gather 3 rounds of feedback.`,priority:2,actionItems:[`Create a low-fidelity prototype`,`Schedule standing feedback calls`]},{id:`stage2-activation`,stage:2,category:`operations`,title:`Activation checklist`,description:`Define the minimum steps required for a new user to succeed.`,priority:1,actionItems:[`Document onboarding flow`,`Instrument activation analytics`]},{id:`stage3-retention-narrative`,stage:3,category:`product`,title:`Retention narrative`,description:`Create the before/after story that proves why users stay.`,priority:2,actionItems:[`Interview 3 retained users`,`Publish a one-pager with concrete metrics`]},{id:`stage4-growth-loop`,stage:4,category:`growth`,title:`Install a growth loop`,description:`Stand up a repeatable acquisition → activation → referral motion.`,priority:1,actionItems:[`Define loop metrics`,`Assign owners for each stage`,`Review weekly`]},{id:`stage5-platform-blueprint`,stage:5,category:`product`,title:`Platform blueprint`,description:`Align on APIs, integrations, and governance for partners.`,priority:2,actionItems:[`Create integration scoring rubric`,`Publish partner onboarding checklist`]},{id:`stage6-renewal-ops`,stage:6,category:`operations`,title:`Renewal operating rhythm`,description:`Decide whether to optimize, reinvest, or sunset each major surface.`,priority:1,actionItems:[`Hold quarterly renewal review`,`Document reinvestment bets`]}];export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={Exploration:{base:.35,metrics:{activeUsers:{weight:-.3,direction:`lte`,threshold:5},customerCount:{weight:-.2,direction:`lte`,threshold:3},teamSize:{weight:-.1,direction:`lte`,threshold:3}},signalKinds:{qualitative:.4,metric:.1}},ProblemSolutionFit:{base:.4,metrics:{activeUsers:{weight:.2,direction:`gte`,threshold:5},customerCount:{weight:.2,direction:`gte`,threshold:3}},signalKinds:{qualitative:.3,event:.1}},MvpEarlyTraction:{base:.45,metrics:{activeUsers:{weight:.25,direction:`gte`,threshold:25},weeklyActiveUsers:{weight:.25,direction:`gte`,threshold:20},retentionRate:{weight:.2,direction:`gte`,threshold:.25}},signalKinds:{metric:.15,event:.1}},ProductMarketFit:{base:.5,metrics:{retentionRate:{weight:.35,direction:`gte`,threshold:.45},monthlyRecurringRevenue:{weight:.25,direction:`gte`,threshold:1e4},customerCount:{weight:.2,direction:`gte`,threshold:30}},signalKinds:{metric:.15,event:.1}},GrowthScaleUp:{base:.55,metrics:{retentionRate:{weight:.2,direction:`gte`,threshold:.55},monthlyRecurringRevenue:{weight:.3,direction:`gte`,threshold:5e4},teamSize:{weight:.15,direction:`gte`,threshold:15}},signalKinds:{event:.2,metric:.15}},ExpansionPlatform:{base:.6,metrics:{monthlyRecurringRevenue:{weight:.35,direction:`gte`,threshold:15e4},customerCount:{weight:.2,direction:`gte`,threshold:100},teamSize:{weight:.15,direction:`gte`,threshold:40}},signalKinds:{event:.2,milestone:.1}},MaturityRenewal:{base:.6,metrics:{monthlyRecurringRevenue:{weight:.25,direction:`gte`,threshold:25e4},teamSize:{weight:.15,direction:`gte`,threshold:80},burnMultiple:{weight:.2,direction:`lte`,threshold:1.5}},signalKinds:{event:.2,milestone:.15}}};export{e as default};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AnalyticsAdapter, AnalyticsAdapterResult } from "./adapters/analytics-adapter.js";
|
|
2
|
+
import { QuestionnaireAdapter, QuestionnaireAdapterResult } from "./adapters/questionnaire-adapter.js";
|
|
3
|
+
import { IntentAdapter, IntentAdapterResult } from "./adapters/intent-adapter.js";
|
|
4
|
+
import { StageSignalCollector, StageSignalCollectorOptions, StageSignalCollectorResult } from "./collectors/signal-collector.js";
|
|
5
|
+
import { StageScoreInput, StageScorer } from "./scoring/stage-scorer.js";
|
|
6
|
+
import { LifecycleMilestonePlanner } from "./planning/milestone-planner.js";
|
|
7
|
+
import { LifecycleOrchestrator, LifecycleOrchestratorOptions } from "./orchestrator/lifecycle-orchestrator.js";
|
|
8
|
+
export { AnalyticsAdapter, AnalyticsAdapterResult, IntentAdapter, IntentAdapterResult, LifecycleMilestonePlanner, LifecycleOrchestrator, LifecycleOrchestratorOptions, QuestionnaireAdapter, QuestionnaireAdapterResult, StageScoreInput, StageScorer, StageSignalCollector, StageSignalCollectorOptions, StageSignalCollectorResult };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{StageSignalCollector as e}from"./collectors/signal-collector.js";import{StageScorer as t}from"./scoring/stage-scorer.js";import{LifecycleMilestonePlanner as n}from"./planning/milestone-planner.js";import{LifecycleOrchestrator as r}from"./orchestrator/lifecycle-orchestrator.js";export{n as LifecycleMilestonePlanner,r as LifecycleOrchestrator,t as StageScorer,e as StageSignalCollector};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e,n as t}from"./types/stages.js";import{e as n,n as r,t as i}from"./types/axes.js";import"./types/signals.js";import"./types/milestones.js";import"./utils/formatters.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=function(e){return e.Sketch=`Sketch`,e.Prototype=`Prototype`,e.Mvp=`MVP`,e.V1=`V1`,e.Ecosystem=`Ecosystem`,e}({}),t=function(e){return e.Solo=`Solo`,e.TinyTeam=`TinyTeam`,e.FunctionalOrg=`FunctionalOrg`,e.MultiTeam=`MultiTeam`,e.Bureaucratic=`Bureaucratic`,e}({}),n=function(e){return e.Bootstrapped=`Bootstrapped`,e.PreSeed=`PreSeed`,e.Seed=`Seed`,e.SeriesAorB=`SeriesAorB`,e.LateStage=`LateStage`,e}({});export{e,n,t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./stages.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./stages.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=function(e){return e[e.Exploration=0]=`Exploration`,e[e.ProblemSolutionFit=1]=`ProblemSolutionFit`,e[e.MvpEarlyTraction=2]=`MvpEarlyTraction`,e[e.ProductMarketFit=3]=`ProductMarketFit`,e[e.GrowthScaleUp=4]=`GrowthScaleUp`,e[e.ExpansionPlatform=5]=`ExpansionPlatform`,e[e.MaturityRenewal=6]=`MaturityRenewal`,e}({});e.Exploration,e.ProblemSolutionFit,e.MvpEarlyTraction,e.ProductMarketFit,e.GrowthScaleUp,e.ExpansionPlatform,e.MaturityRenewal;const t={[e.Exploration]:{id:e.Exploration,order:0,slug:`exploration`,name:`Exploration / Ideation`,question:`Is there a problem worth my time?`,signals:[`20+ discovery interviews`,`Clear problem statement`,`Named ICP`],traps:[`Branding before discovery`,`Premature tooling decisions`],focusAreas:[`Customer discovery`,`Problem definition`,`Segment clarity`]},[e.ProblemSolutionFit]:{id:e.ProblemSolutionFit,order:1,slug:`problem-solution-fit`,name:`Problem–Solution Fit`,question:`Do people care enough about this solution?`,signals:[`Prototype reuse`,`Referral energy`,`Pre-pay interest`],traps:[`“Market is huge” without users`,`Skipping qualitative loops`],focusAreas:[`Solution hypothesis`,`Value messaging`,`Feedback capture`]},[e.MvpEarlyTraction]:{id:e.MvpEarlyTraction,order:2,slug:`mvp-early-traction`,name:`MVP & Early Traction`,question:`Can we get real usage and learn fast?`,signals:[`20–50 named active users`,`Weekly releases`,`Noisy feedback`],traps:[`Overbuilt infra for 10 users`,`Undefined retention metric`],focusAreas:[`Activation`,`Cohort tracking`,`Feedback rituals`]},[e.ProductMarketFit]:{id:e.ProductMarketFit,order:3,slug:`product-market-fit`,name:`Product–Market Fit`,question:`Is this pulling us forward?`,signals:[`Retention without heroics`,`Organic word-of-mouth`,`Value stories`],traps:[`Hero growth that does not scale`,`Ignoring churn signals`],focusAreas:[`Retention`,`Reliability`,`ICP clarity`]},[e.GrowthScaleUp]:{id:e.GrowthScaleUp,order:4,slug:`growth-scale-up`,name:`Growth / Scale-up`,question:`Can we grow this repeatably?`,signals:[`Predictable channels`,`Specialized hires`,`Unit economics on track`],traps:[`Paid spend masking retention gaps`,`Infra debt blocking launches`],focusAreas:[`Ops systems`,`Growth loops`,`Reliability engineering`]},[e.ExpansionPlatform]:{id:e.ExpansionPlatform,order:5,slug:`expansion-platform`,name:`Expansion / Platform`,question:`What is the next growth curve?`,signals:[`Stable core metrics`,`Partner/API demand`,`Ecosystem pull`],traps:[`Platform theater before wedge is solid`],focusAreas:[`Partnerships`,`APIs`,`New market validation`]},[e.MaturityRenewal]:{id:e.MaturityRenewal,order:6,slug:`maturity-renewal`,name:`Maturity / Renewal`,question:`Optimize, reinvent, or sunset?`,signals:[`Margin focus`,`Portfolio bets`,`Narrative refresh`],traps:[`Assuming past success is enough`],focusAreas:[`Cost optimization`,`Reinvention bets`,`Sunset planning`]}};export{e,t as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../types/stages.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StageSignalCollector } from "../collectors/signal-collector.js";
|
|
2
|
+
import { StageScorer } from "../scoring/stage-scorer.js";
|
|
3
|
+
import { LifecycleMilestonePlanner } from "../planning/milestone-planner.js";
|
|
4
|
+
import { LifecycleAssessment, LifecycleAssessmentInput, LifecycleMilestone, LifecycleStage } from "@lssm/lib.lifecycle";
|
|
5
|
+
|
|
6
|
+
//#region src/orchestrator/lifecycle-orchestrator.d.ts
|
|
7
|
+
interface LifecycleOrchestratorOptions {
|
|
8
|
+
collector: StageSignalCollector;
|
|
9
|
+
scorer: StageScorer;
|
|
10
|
+
milestonePlanner?: LifecycleMilestonePlanner;
|
|
11
|
+
}
|
|
12
|
+
declare class LifecycleOrchestrator {
|
|
13
|
+
private readonly collector;
|
|
14
|
+
private readonly scorer;
|
|
15
|
+
private readonly planner?;
|
|
16
|
+
constructor(options: LifecycleOrchestratorOptions);
|
|
17
|
+
run(input?: LifecycleAssessmentInput): Promise<LifecycleAssessment>;
|
|
18
|
+
getUpcomingMilestones(stage: LifecycleStage, completedMilestoneIds?: string[], limit?: number): LifecycleMilestone[];
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { LifecycleOrchestrator, LifecycleOrchestratorOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e,n as t}from"../libs/lifecycle/dist/types/stages.js";import"../libs/lifecycle/dist/index.js";import"../collectors/signal-collector.js";import"../scoring/stage-scorer.js";var n=class{collector;scorer;planner;constructor(e){this.collector=e.collector,this.scorer=e.scorer,this.planner=e.milestonePlanner}async run(e){let n=await this.collector.collect(e),a=this.scorer.score({metrics:n.metrics,signals:n.signals}),o=a[0]??r(),s=t[o.stage];return{stage:o.stage,confidence:o.confidence,axes:n.axes,signals:n.signals,metrics:i(n.metrics),gaps:s.focusAreas.slice(0,3),focusAreas:s.focusAreas,scorecard:a,generatedAt:new Date().toISOString()}}getUpcomingMilestones(e,t=[],n=5){return this.planner?this.planner.getUpcoming(e,t,n):[]}};const r=()=>({stage:e.Exploration,score:.3,confidence:.3,supportingSignals:[]}),i=e=>Object.entries(e??{}).reduce((e,[t,n])=>(typeof n==`number`&&(e[t]=n),e),{});export{n as LifecycleOrchestrator};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LifecycleMilestone, LifecycleStage } from "@lssm/lib.lifecycle";
|
|
2
|
+
|
|
3
|
+
//#region src/planning/milestone-planner.d.ts
|
|
4
|
+
declare class LifecycleMilestonePlanner {
|
|
5
|
+
private readonly milestones;
|
|
6
|
+
constructor(customCatalog?: LifecycleMilestone[]);
|
|
7
|
+
getUpcoming(stage: LifecycleStage, completedIds?: string[], limit?: number): LifecycleMilestone[];
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { LifecycleMilestonePlanner };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../data/milestones-catalog.js";var t=class{milestones;constructor(t){this.milestones=t??e}getUpcoming(e,t=[],n=5){let r=new Set(t);return this.milestones.filter(t=>t.stage===e&&!r.has(t.id)).sort((e,t)=>e.priority-t.priority).slice(0,n)}};export{t as LifecycleMilestonePlanner};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LifecycleMetricSnapshot, LifecycleScore, LifecycleSignal } from "@lssm/lib.lifecycle";
|
|
2
|
+
|
|
3
|
+
//#region src/scoring/stage-scorer.d.ts
|
|
4
|
+
type NumericMetricKey = Extract<{ [Key in keyof LifecycleMetricSnapshot]: LifecycleMetricSnapshot[Key] extends number | undefined ? Key : never }[keyof LifecycleMetricSnapshot], string>;
|
|
5
|
+
interface MetricWeightConfig {
|
|
6
|
+
weight: number;
|
|
7
|
+
threshold: number;
|
|
8
|
+
direction?: 'gte' | 'lte';
|
|
9
|
+
}
|
|
10
|
+
interface StageWeightConfig {
|
|
11
|
+
base: number;
|
|
12
|
+
metrics?: Partial<Record<NumericMetricKey, MetricWeightConfig>>;
|
|
13
|
+
signalKinds?: Partial<Record<string, number>>;
|
|
14
|
+
}
|
|
15
|
+
type StageWeights = Record<string, StageWeightConfig>;
|
|
16
|
+
interface StageScoreInput {
|
|
17
|
+
metrics: LifecycleMetricSnapshot;
|
|
18
|
+
signals: LifecycleSignal[];
|
|
19
|
+
}
|
|
20
|
+
declare class StageScorer {
|
|
21
|
+
private readonly weights;
|
|
22
|
+
constructor(weights?: StageWeights);
|
|
23
|
+
score(input: StageScoreInput): LifecycleScore[];
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { StageScoreInput, StageScorer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e,n as t}from"../libs/lifecycle/dist/types/stages.js";import"../libs/lifecycle/dist/index.js";import n from"../data/stage-weights.js";const r=n;var i=class{weights;constructor(e=r){this.weights=e}score(t){let n=s(t.signals);return Object.values(e).filter(c).map(r=>{let i=e[r],s=this.weights[i]??{base:.5},c=s.base??.5,l=0,u=Object.keys(s.metrics??{}).length+Object.keys(s.signalKinds??{}).length||1,d=[];s.metrics&&Object.entries(s.metrics).forEach(([e,n])=>{let r=t.metrics[e];r!=null&&(a(r,n)?(c+=n.weight,l+=1,d.push(`metric:${e}`)):c+=n.weight*.25)}),s.signalKinds&&Object.entries(s.signalKinds).forEach(([e,t])=>{(n[e]??0)>0&&typeof t==`number`&&(c+=t,l+=1,d.push(`signal:${e}`))}),c=o(c,0,1.25);let f=o(l/u,.1,1);return{stage:r,score:c,confidence:f,supportingSignals:d}}).sort((e,t)=>t.score===e.score?t.confidence-e.confidence:t.score-e.score)}};const a=(e,t)=>(t.direction??`gte`)===`gte`?e>=t.threshold:e<=t.threshold,o=(e,t,n)=>Math.min(Math.max(e,t),n),s=e=>e.reduce((e,t)=>{let n=t.kind??`unknown`;return e[n]=(e[n]??0)+(t.weight??1),e},{}),c=e=>typeof e==`number`&&e in t;export{i as StageScorer};
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lssm/module.lifecycle-core",
|
|
3
|
+
"version": "0.0.0-canary-20251206160926",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md",
|
|
11
|
+
"src/data"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
15
|
+
"build": "bun build:bundle && bun build:types",
|
|
16
|
+
"build:bundle": "tsdown",
|
|
17
|
+
"build:types": "tsc --noEmit",
|
|
18
|
+
"dev": "bun build:bundle --watch",
|
|
19
|
+
"clean": "rimraf dist .turbo",
|
|
20
|
+
"lint": "bun lint:fix",
|
|
21
|
+
"lint:fix": "eslint src --fix",
|
|
22
|
+
"lint:check": "eslint src",
|
|
23
|
+
"test": "bun run"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@lssm/lib.lifecycle": "workspace:*"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@lssm/tool.tsdown": "workspace:*",
|
|
30
|
+
"@lssm/tool.typescript": "workspace:*",
|
|
31
|
+
"tsdown": "^0.17.0",
|
|
32
|
+
"typescript": "^5.9.3"
|
|
33
|
+
},
|
|
34
|
+
"exports": {
|
|
35
|
+
".": "./dist/index.js",
|
|
36
|
+
"./*": "./*"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "stage0-problem-statement",
|
|
4
|
+
"stage": 0,
|
|
5
|
+
"category": "product",
|
|
6
|
+
"title": "Write the pain statement",
|
|
7
|
+
"description": "Capture the clearest description of the top problem in the customer’s own words.",
|
|
8
|
+
"priority": 1,
|
|
9
|
+
"actionItems": [
|
|
10
|
+
"Interview at least 5 ideal customers",
|
|
11
|
+
"Synthesize quotes into a one-page brief"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "stage1-prototype-loop",
|
|
16
|
+
"stage": 1,
|
|
17
|
+
"category": "product",
|
|
18
|
+
"title": "Prototype feedback loop",
|
|
19
|
+
"description": "Ship a clickable prototype and gather 3 rounds of feedback.",
|
|
20
|
+
"priority": 2,
|
|
21
|
+
"actionItems": [
|
|
22
|
+
"Create a low-fidelity prototype",
|
|
23
|
+
"Schedule standing feedback calls"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "stage2-activation",
|
|
28
|
+
"stage": 2,
|
|
29
|
+
"category": "operations",
|
|
30
|
+
"title": "Activation checklist",
|
|
31
|
+
"description": "Define the minimum steps required for a new user to succeed.",
|
|
32
|
+
"priority": 1,
|
|
33
|
+
"actionItems": [
|
|
34
|
+
"Document onboarding flow",
|
|
35
|
+
"Instrument activation analytics"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "stage3-retention-narrative",
|
|
40
|
+
"stage": 3,
|
|
41
|
+
"category": "product",
|
|
42
|
+
"title": "Retention narrative",
|
|
43
|
+
"description": "Create the before/after story that proves why users stay.",
|
|
44
|
+
"priority": 2,
|
|
45
|
+
"actionItems": [
|
|
46
|
+
"Interview 3 retained users",
|
|
47
|
+
"Publish a one-pager with concrete metrics"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "stage4-growth-loop",
|
|
52
|
+
"stage": 4,
|
|
53
|
+
"category": "growth",
|
|
54
|
+
"title": "Install a growth loop",
|
|
55
|
+
"description": "Stand up a repeatable acquisition → activation → referral motion.",
|
|
56
|
+
"priority": 1,
|
|
57
|
+
"actionItems": [
|
|
58
|
+
"Define loop metrics",
|
|
59
|
+
"Assign owners for each stage",
|
|
60
|
+
"Review weekly"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "stage5-platform-blueprint",
|
|
65
|
+
"stage": 5,
|
|
66
|
+
"category": "product",
|
|
67
|
+
"title": "Platform blueprint",
|
|
68
|
+
"description": "Align on APIs, integrations, and governance for partners.",
|
|
69
|
+
"priority": 2,
|
|
70
|
+
"actionItems": [
|
|
71
|
+
"Create integration scoring rubric",
|
|
72
|
+
"Publish partner onboarding checklist"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "stage6-renewal-ops",
|
|
77
|
+
"stage": 6,
|
|
78
|
+
"category": "operations",
|
|
79
|
+
"title": "Renewal operating rhythm",
|
|
80
|
+
"description": "Decide whether to optimize, reinvest, or sunset each major surface.",
|
|
81
|
+
"priority": 1,
|
|
82
|
+
"actionItems": [
|
|
83
|
+
"Hold quarterly renewal review",
|
|
84
|
+
"Document reinvestment bets"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
]
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Exploration": {
|
|
3
|
+
"base": 0.35,
|
|
4
|
+
"metrics": {
|
|
5
|
+
"activeUsers": { "weight": -0.3, "direction": "lte", "threshold": 5 },
|
|
6
|
+
"customerCount": { "weight": -0.2, "direction": "lte", "threshold": 3 },
|
|
7
|
+
"teamSize": { "weight": -0.1, "direction": "lte", "threshold": 3 }
|
|
8
|
+
},
|
|
9
|
+
"signalKinds": {
|
|
10
|
+
"qualitative": 0.4,
|
|
11
|
+
"metric": 0.1
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"ProblemSolutionFit": {
|
|
15
|
+
"base": 0.4,
|
|
16
|
+
"metrics": {
|
|
17
|
+
"activeUsers": { "weight": 0.2, "direction": "gte", "threshold": 5 },
|
|
18
|
+
"customerCount": { "weight": 0.2, "direction": "gte", "threshold": 3 }
|
|
19
|
+
},
|
|
20
|
+
"signalKinds": {
|
|
21
|
+
"qualitative": 0.3,
|
|
22
|
+
"event": 0.1
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"MvpEarlyTraction": {
|
|
26
|
+
"base": 0.45,
|
|
27
|
+
"metrics": {
|
|
28
|
+
"activeUsers": { "weight": 0.25, "direction": "gte", "threshold": 25 },
|
|
29
|
+
"weeklyActiveUsers": {
|
|
30
|
+
"weight": 0.25,
|
|
31
|
+
"direction": "gte",
|
|
32
|
+
"threshold": 20
|
|
33
|
+
},
|
|
34
|
+
"retentionRate": { "weight": 0.2, "direction": "gte", "threshold": 0.25 }
|
|
35
|
+
},
|
|
36
|
+
"signalKinds": {
|
|
37
|
+
"metric": 0.15,
|
|
38
|
+
"event": 0.1
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"ProductMarketFit": {
|
|
42
|
+
"base": 0.5,
|
|
43
|
+
"metrics": {
|
|
44
|
+
"retentionRate": {
|
|
45
|
+
"weight": 0.35,
|
|
46
|
+
"direction": "gte",
|
|
47
|
+
"threshold": 0.45
|
|
48
|
+
},
|
|
49
|
+
"monthlyRecurringRevenue": {
|
|
50
|
+
"weight": 0.25,
|
|
51
|
+
"direction": "gte",
|
|
52
|
+
"threshold": 10000
|
|
53
|
+
},
|
|
54
|
+
"customerCount": { "weight": 0.2, "direction": "gte", "threshold": 30 }
|
|
55
|
+
},
|
|
56
|
+
"signalKinds": {
|
|
57
|
+
"metric": 0.15,
|
|
58
|
+
"event": 0.1
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"GrowthScaleUp": {
|
|
62
|
+
"base": 0.55,
|
|
63
|
+
"metrics": {
|
|
64
|
+
"retentionRate": { "weight": 0.2, "direction": "gte", "threshold": 0.55 },
|
|
65
|
+
"monthlyRecurringRevenue": {
|
|
66
|
+
"weight": 0.3,
|
|
67
|
+
"direction": "gte",
|
|
68
|
+
"threshold": 50000
|
|
69
|
+
},
|
|
70
|
+
"teamSize": { "weight": 0.15, "direction": "gte", "threshold": 15 }
|
|
71
|
+
},
|
|
72
|
+
"signalKinds": {
|
|
73
|
+
"event": 0.2,
|
|
74
|
+
"metric": 0.15
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"ExpansionPlatform": {
|
|
78
|
+
"base": 0.6,
|
|
79
|
+
"metrics": {
|
|
80
|
+
"monthlyRecurringRevenue": {
|
|
81
|
+
"weight": 0.35,
|
|
82
|
+
"direction": "gte",
|
|
83
|
+
"threshold": 150000
|
|
84
|
+
},
|
|
85
|
+
"customerCount": { "weight": 0.2, "direction": "gte", "threshold": 100 },
|
|
86
|
+
"teamSize": { "weight": 0.15, "direction": "gte", "threshold": 40 }
|
|
87
|
+
},
|
|
88
|
+
"signalKinds": {
|
|
89
|
+
"event": 0.2,
|
|
90
|
+
"milestone": 0.1
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"MaturityRenewal": {
|
|
94
|
+
"base": 0.6,
|
|
95
|
+
"metrics": {
|
|
96
|
+
"monthlyRecurringRevenue": {
|
|
97
|
+
"weight": 0.25,
|
|
98
|
+
"direction": "gte",
|
|
99
|
+
"threshold": 250000
|
|
100
|
+
},
|
|
101
|
+
"teamSize": { "weight": 0.15, "direction": "gte", "threshold": 80 },
|
|
102
|
+
"burnMultiple": { "weight": 0.2, "direction": "lte", "threshold": 1.5 }
|
|
103
|
+
},
|
|
104
|
+
"signalKinds": {
|
|
105
|
+
"event": 0.2,
|
|
106
|
+
"milestone": 0.15
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|