@lssm/lib.lifecycle 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 ADDED
@@ -0,0 +1,65 @@
1
+ # @lssm/lib.lifecycle
2
+
3
+ Canonical lifecycle vocabulary for ContractSpec. This package exposes stage enums, axis types, signal contracts, milestone/action shapes, and formatting helpers used by the lifecycle modules, bundles, and Studio apps.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @lssm/lib.lifecycle
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import {
15
+ LifecycleStage,
16
+ LIFECYCLE_STAGE_META,
17
+ LifecycleAssessment,
18
+ formatStageSummary,
19
+ } from '@lssm/lib.lifecycle';
20
+
21
+ const assessment: LifecycleAssessment = {
22
+ stage: LifecycleStage.MvpEarlyTraction,
23
+ confidence: 0.72,
24
+ axes: {
25
+ product: 'MVP',
26
+ company: 'TinyTeam',
27
+ capital: 'Seed',
28
+ },
29
+ signals: [],
30
+ gaps: ['Retention', 'Onboarding'],
31
+ };
32
+
33
+ const summary = formatStageSummary(assessment.stage, assessment);
34
+ console.log(summary.title); // "Stage 2 · MVP & Early Traction"
35
+ ```
36
+
37
+ ## Contents
38
+
39
+ - `LifecycleStage` enum and metadata map (`LIFECYCLE_STAGE_META`)
40
+ - 3-axis definitions: `ProductPhase`, `CompanyPhase`, `CapitalPhase`
41
+ - Signal + metric contracts (sources, quality, payloads)
42
+ - Milestone + action data shapes
43
+ - Formatting helpers (`formatStageSummary`, `summarizeAxes`, `rankStageCandidates`)
44
+
45
+ This library intentionally ships no IO logic so it can run in browsers, Node runtimes, and design tools.*** End Patch
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
@@ -0,0 +1,6 @@
1
+ import { LIFECYCLE_STAGE_META, LIFECYCLE_STAGE_ORDER, LifecycleStage, LifecycleStageMetadata, LifecycleStageSlug, getLifecycleStageBySlug } from "./types/stages.js";
2
+ import { CapitalPhase, CompanyPhase, LifecycleAxes, LifecycleAxis, LifecycleAxisSnapshot, ProductPhase } from "./types/axes.js";
3
+ import { LifecycleAssessmentInput, LifecycleMetricSnapshot, LifecycleScore, LifecycleSignal, LifecycleSignalKind, LifecycleSignalSource } from "./types/signals.js";
4
+ import { LifecycleAction, LifecycleAssessment, LifecycleMilestone, LifecycleMilestoneCategory, LifecycleRecommendation } from "./types/milestones.js";
5
+ import { StageSummary, createRecommendationDigest, formatStageSummary, getStageLabel, getStageOrderIndex, rankStageCandidates, summarizeAxes } from "./utils/formatters.js";
6
+ export { CapitalPhase, CompanyPhase, LIFECYCLE_STAGE_META, LIFECYCLE_STAGE_ORDER, LifecycleAction, LifecycleAssessment, LifecycleAssessmentInput, LifecycleAxes, LifecycleAxis, LifecycleAxisSnapshot, LifecycleMetricSnapshot, LifecycleMilestone, LifecycleMilestoneCategory, LifecycleRecommendation, LifecycleScore, LifecycleSignal, LifecycleSignalKind, LifecycleSignalSource, LifecycleStage, LifecycleStageMetadata, LifecycleStageSlug, ProductPhase, StageSummary, createRecommendationDigest, formatStageSummary, getLifecycleStageBySlug, getStageLabel, getStageOrderIndex, rankStageCandidates, summarizeAxes };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{LIFECYCLE_STAGE_META as e,LIFECYCLE_STAGE_ORDER as t,LifecycleStage as n,getLifecycleStageBySlug as r}from"./types/stages.js";import{CapitalPhase as i,CompanyPhase as a,ProductPhase as o}from"./types/axes.js";import"./types/signals.js";import"./types/milestones.js";import{createRecommendationDigest as s,formatStageSummary as c,getStageLabel as l,getStageOrderIndex as u,rankStageCandidates as d,summarizeAxes as f}from"./utils/formatters.js";export{i as CapitalPhase,a as CompanyPhase,e as LIFECYCLE_STAGE_META,t as LIFECYCLE_STAGE_ORDER,n as LifecycleStage,o as ProductPhase,s as createRecommendationDigest,c as formatStageSummary,r as getLifecycleStageBySlug,l as getStageLabel,u as getStageOrderIndex,d as rankStageCandidates,f as summarizeAxes};
@@ -0,0 +1,36 @@
1
+ //#region src/types/axes.d.ts
2
+ declare enum ProductPhase {
3
+ Sketch = "Sketch",
4
+ Prototype = "Prototype",
5
+ Mvp = "MVP",
6
+ V1 = "V1",
7
+ Ecosystem = "Ecosystem",
8
+ }
9
+ declare enum CompanyPhase {
10
+ Solo = "Solo",
11
+ TinyTeam = "TinyTeam",
12
+ FunctionalOrg = "FunctionalOrg",
13
+ MultiTeam = "MultiTeam",
14
+ Bureaucratic = "Bureaucratic",
15
+ }
16
+ declare enum CapitalPhase {
17
+ Bootstrapped = "Bootstrapped",
18
+ PreSeed = "PreSeed",
19
+ Seed = "Seed",
20
+ SeriesAorB = "SeriesAorB",
21
+ LateStage = "LateStage",
22
+ }
23
+ type LifecycleAxis = 'product' | 'company' | 'capital';
24
+ interface LifecycleAxes {
25
+ product: ProductPhase;
26
+ company: CompanyPhase;
27
+ capital: CapitalPhase;
28
+ }
29
+ interface LifecycleAxisSnapshot {
30
+ axis: LifecycleAxis;
31
+ phase: ProductPhase | CompanyPhase | CapitalPhase;
32
+ rationale?: string;
33
+ confidence: number;
34
+ }
35
+ //#endregion
36
+ export { CapitalPhase, CompanyPhase, LifecycleAxes, LifecycleAxis, LifecycleAxisSnapshot, ProductPhase };
@@ -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{n as CapitalPhase,t as CompanyPhase,e as ProductPhase};
@@ -0,0 +1,52 @@
1
+ import { LifecycleStage } from "./stages.js";
2
+ import { LifecycleAxes } from "./axes.js";
3
+ import { LifecycleScore, LifecycleSignal } from "./signals.js";
4
+
5
+ //#region src/types/milestones.d.ts
6
+ type LifecycleMilestoneCategory = 'product' | 'company' | 'capital' | 'operations';
7
+ interface LifecycleMilestone {
8
+ id: string;
9
+ stage: LifecycleStage;
10
+ category: LifecycleMilestoneCategory;
11
+ title: string;
12
+ description: string;
13
+ priority: number;
14
+ detectionCriteria?: Record<string, unknown>;
15
+ guideContent?: string;
16
+ actionItems?: string[];
17
+ }
18
+ interface LifecycleAction {
19
+ id: string;
20
+ stage: LifecycleStage;
21
+ title: string;
22
+ description: string;
23
+ priority: number;
24
+ estimatedImpact: 'low' | 'medium' | 'high';
25
+ effortLevel: 'xs' | 's' | 'm' | 'l';
26
+ category: LifecycleMilestoneCategory | 'growth' | 'ops';
27
+ recommendedLibraries?: string[];
28
+ }
29
+ interface LifecycleAssessment {
30
+ stage: LifecycleStage;
31
+ confidence: number;
32
+ axes: LifecycleAxes;
33
+ signals: LifecycleSignal[];
34
+ metrics?: Record<string, number | undefined>;
35
+ gaps: string[];
36
+ focusAreas: string[];
37
+ scorecard: LifecycleScore[];
38
+ generatedAt: string;
39
+ }
40
+ interface LifecycleRecommendation {
41
+ assessmentId: string;
42
+ stage: LifecycleStage;
43
+ actions: LifecycleAction[];
44
+ upcomingMilestones: LifecycleMilestone[];
45
+ ceremony?: {
46
+ title: string;
47
+ copy: string;
48
+ cues: string[];
49
+ };
50
+ }
51
+ //#endregion
52
+ export { LifecycleAction, LifecycleAssessment, LifecycleMilestone, LifecycleMilestoneCategory, LifecycleRecommendation };
@@ -0,0 +1 @@
1
+ import"./stages.js";
@@ -0,0 +1,43 @@
1
+ import { LifecycleStage } from "./stages.js";
2
+ import { LifecycleAxes, LifecycleAxis } from "./axes.js";
3
+
4
+ //#region src/types/signals.d.ts
5
+ type LifecycleSignalSource = 'analytics' | 'questionnaire' | 'intent' | 'manual' | 'simulation';
6
+ type LifecycleSignalKind = 'metric' | 'qualitative' | 'event' | 'milestone' | 'heuristic';
7
+ interface LifecycleSignal {
8
+ id: string;
9
+ stageHint?: LifecycleStage;
10
+ axis?: LifecycleAxis;
11
+ kind: LifecycleSignalKind;
12
+ source: LifecycleSignalSource;
13
+ name: string;
14
+ value: number | string | boolean;
15
+ weight: number;
16
+ confidence: number;
17
+ details?: Record<string, unknown>;
18
+ capturedAt: string;
19
+ }
20
+ interface LifecycleMetricSnapshot {
21
+ activeUsers?: number;
22
+ weeklyActiveUsers?: number;
23
+ retentionRate?: number;
24
+ monthlyRecurringRevenue?: number;
25
+ customerCount?: number;
26
+ teamSize?: number;
27
+ burnMultiple?: number;
28
+ qualitativeSupport?: string[];
29
+ }
30
+ interface LifecycleScore {
31
+ stage: LifecycleStage;
32
+ score: number;
33
+ confidence: number;
34
+ supportingSignals: string[];
35
+ }
36
+ interface LifecycleAssessmentInput {
37
+ axes?: Partial<LifecycleAxes>;
38
+ metrics?: LifecycleMetricSnapshot;
39
+ signals?: LifecycleSignal[];
40
+ questionnaireAnswers?: Record<string, unknown>;
41
+ }
42
+ //#endregion
43
+ export { LifecycleAssessmentInput, LifecycleMetricSnapshot, LifecycleScore, LifecycleSignal, LifecycleSignalKind, LifecycleSignalSource };
@@ -0,0 +1 @@
1
+ import"./stages.js";
@@ -0,0 +1,26 @@
1
+ //#region src/types/stages.d.ts
2
+ declare enum LifecycleStage {
3
+ Exploration = 0,
4
+ ProblemSolutionFit = 1,
5
+ MvpEarlyTraction = 2,
6
+ ProductMarketFit = 3,
7
+ GrowthScaleUp = 4,
8
+ ExpansionPlatform = 5,
9
+ MaturityRenewal = 6,
10
+ }
11
+ type LifecycleStageSlug = 'exploration' | 'problem-solution-fit' | 'mvp-early-traction' | 'product-market-fit' | 'growth-scale-up' | 'expansion-platform' | 'maturity-renewal';
12
+ interface LifecycleStageMetadata {
13
+ id: LifecycleStage;
14
+ order: number;
15
+ slug: LifecycleStageSlug;
16
+ name: string;
17
+ question: string;
18
+ signals: string[];
19
+ traps: string[];
20
+ focusAreas: string[];
21
+ }
22
+ declare const LIFECYCLE_STAGE_ORDER: LifecycleStage[];
23
+ declare const LIFECYCLE_STAGE_META: Record<LifecycleStage, LifecycleStageMetadata>;
24
+ declare const getLifecycleStageBySlug: (slug: LifecycleStageSlug) => LifecycleStage;
25
+ //#endregion
26
+ export { LIFECYCLE_STAGE_META, LIFECYCLE_STAGE_ORDER, LifecycleStage, LifecycleStageMetadata, LifecycleStageSlug, getLifecycleStageBySlug };
@@ -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}({});const t=[e.Exploration,e.ProblemSolutionFit,e.MvpEarlyTraction,e.ProductMarketFit,e.GrowthScaleUp,e.ExpansionPlatform,e.MaturityRenewal],n={[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`]}},r=e=>{let t=Object.values(n).find(t=>t.slug===e);if(!t)throw Error(`Unknown lifecycle stage slug: ${e}`);return t.id};export{n as LIFECYCLE_STAGE_META,t as LIFECYCLE_STAGE_ORDER,e as LifecycleStage,r as getLifecycleStageBySlug};
@@ -0,0 +1,22 @@
1
+ import { LifecycleStage } from "../types/stages.js";
2
+ import { LifecycleAxes } from "../types/axes.js";
3
+ import { LifecycleScore } from "../types/signals.js";
4
+ import { LifecycleAssessment, LifecycleRecommendation } from "../types/milestones.js";
5
+
6
+ //#region src/utils/formatters.d.ts
7
+ interface StageSummary {
8
+ title: string;
9
+ question: string;
10
+ highlights: string[];
11
+ traps: string[];
12
+ focusAreas: string[];
13
+ axesSummary: string[];
14
+ }
15
+ declare const formatStageSummary: (stage: LifecycleStage, assessment?: Pick<LifecycleAssessment, "axes" | "gaps">) => StageSummary;
16
+ declare const summarizeAxes: (axes: LifecycleAxes) => string[];
17
+ declare const rankStageCandidates: (scores: LifecycleScore[]) => LifecycleScore[];
18
+ declare const createRecommendationDigest: (recommendation: LifecycleRecommendation) => string;
19
+ declare const getStageLabel: (stage: LifecycleStage) => string;
20
+ declare const getStageOrderIndex: (stage: LifecycleStage) => number;
21
+ //#endregion
22
+ export { StageSummary, createRecommendationDigest, formatStageSummary, getStageLabel, getStageOrderIndex, rankStageCandidates, summarizeAxes };
@@ -0,0 +1 @@
1
+ import{LIFECYCLE_STAGE_META as e,LIFECYCLE_STAGE_ORDER as t}from"../types/stages.js";const n=(t,n)=>{let i=e[t],a=`Stage ${i.order} · ${i.name}`,o=n?r(n.axes):[];return{title:a,question:i.question,highlights:i.signals,traps:i.traps,focusAreas:n?.gaps?.length?n.gaps:i.focusAreas,axesSummary:o}},r=e=>[`Product: ${e.product}`,`Company: ${e.company}`,`Capital: ${e.capital}`],i=e=>[...e].sort((e,t)=>t.score===e.score?t.confidence-e.confidence:t.score-e.score),a=t=>{let n=e[t.stage],r=t.actions[0],i=r?`${r.title} (${r.estimatedImpact} impact)`:`Focus on upcoming milestones.`;return`Next up for ${n.name}: ${i}`},o=t=>e[t].name,s=e=>t.indexOf(e);export{a as createRecommendationDigest,n as formatStageSummary,o as getStageLabel,s as getStageOrderIndex,i as rankStageCandidates,r as summarizeAxes};
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@lssm/lib.lifecycle",
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
+ ],
12
+ "scripts": {
13
+ "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
14
+ "build": "bun build:bundle && bun build:types",
15
+ "build:bundle": "tsdown",
16
+ "build:types": "tsc --noEmit",
17
+ "dev": "bun build:bundle --watch",
18
+ "clean": "rimraf dist .turbo",
19
+ "lint": "bun lint:fix",
20
+ "lint:fix": "eslint src --fix",
21
+ "lint:check": "eslint src",
22
+ "test": "bun run"
23
+ },
24
+ "peerDependencies": {},
25
+ "devDependencies": {
26
+ "@lssm/tool.tsdown": "workspace:*",
27
+ "@lssm/tool.typescript": "workspace:*",
28
+ "tsdown": "^0.17.0",
29
+ "typescript": "^5.9.3"
30
+ },
31
+ "exports": {
32
+ ".": "./dist/index.js",
33
+ "./*": "./*"
34
+ },
35
+ "publishConfig": {
36
+ "access": "public"
37
+ }
38
+ }