@contractspec/example.product-intent 3.7.7 → 3.7.10

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.
@@ -2,30 +2,32 @@ $ contractspec-bun-build prebuild
2
2
  $ bun run prebuild && bun run build:bundle && bun run build:types
3
3
  $ contractspec-bun-build prebuild
4
4
  $ contractspec-bun-build transpile
5
- [contractspec-bun-build] transpile target=bun root=src entries=9 noBundle=false
6
- Bundled 9 modules in 33ms
5
+ [contractspec-bun-build] transpile target=bun root=src entries=10 noBundle=false
6
+ Bundled 10 modules in 46ms
7
7
 
8
8
  docs/index.js 1.41 KB (entry point)
9
+ ./script.js 16.50 KB (entry point)
9
10
  ./sync-actions.js 15.97 KB (entry point)
10
11
  docs/product-intent.docblock.js 1.41 KB (entry point)
11
- ./index.js 11.44 KB (entry point)
12
+ ./index.js 14.46 KB (entry point)
12
13
  ./example.js 0.95 KB (entry point)
13
- ./product-intent.feature.js 0.60 KB (entry point)
14
- ./script.js 16.50 KB (entry point)
15
14
  ./load-evidence.js 9.86 KB (entry point)
16
15
  ./posthog-signals.js 7.59 KB (entry point)
16
+ ./product-intent.discovery.js 3.0 KB (entry point)
17
+ ./product-intent.feature.js 0.60 KB (entry point)
17
18
 
18
- [contractspec-bun-build] transpile target=node root=src entries=9 noBundle=false
19
- Bundled 9 modules in 27ms
19
+ [contractspec-bun-build] transpile target=node root=src entries=10 noBundle=false
20
+ Bundled 10 modules in 46ms
20
21
 
21
22
  docs/index.js 1.40 KB (entry point)
23
+ ./script.js 16.51 KB (entry point)
22
24
  ./sync-actions.js 15.97 KB (entry point)
23
25
  docs/product-intent.docblock.js 1.40 KB (entry point)
24
- ./index.js 11.44 KB (entry point)
26
+ ./index.js 14.46 KB (entry point)
25
27
  ./example.js 0.94 KB (entry point)
26
- ./product-intent.feature.js 0.59 KB (entry point)
27
- ./script.js 16.51 KB (entry point)
28
28
  ./load-evidence.js 9.86 KB (entry point)
29
29
  ./posthog-signals.js 7.58 KB (entry point)
30
+ ./product-intent.discovery.js 3.0 KB (entry point)
31
+ ./product-intent.feature.js 0.59 KB (entry point)
30
32
 
31
33
  $ contractspec-bun-build types
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @contractspec/example.product-intent
2
2
 
3
+ ## 3.7.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 1a44cb6: feat: improve examples to increase coverage of Contracts type
8
+ - Updated dependencies [1a44cb6]
9
+ - @contractspec/integration.providers-impls@3.8.2
10
+ - @contractspec/lib.contracts-integrations@3.8.2
11
+ - @contractspec/lib.product-intent-utils@3.7.10
12
+ - @contractspec/lib.contracts-spec@4.1.2
13
+ - @contractspec/lib.analytics@3.7.10
14
+ - @contractspec/lib.ai-agent@7.0.10
15
+
16
+ ## 3.7.9
17
+
18
+ ### Patch Changes
19
+
20
+ - fix: release
21
+ - Updated dependencies
22
+ - @contractspec/integration.providers-impls@3.8.1
23
+ - @contractspec/lib.contracts-integrations@3.8.1
24
+ - @contractspec/lib.product-intent-utils@3.7.9
25
+ - @contractspec/lib.contracts-spec@4.1.1
26
+ - @contractspec/lib.analytics@3.7.9
27
+ - @contractspec/lib.ai-agent@7.0.9
28
+
3
29
  ## 3.7.6
4
30
 
5
31
  ### Patch Changes
package/README.md CHANGED
@@ -6,12 +6,12 @@ Website: https://contractspec.io
6
6
 
7
7
  ## What This Demonstrates
8
8
 
9
+ - Canonical `product-intent` export via `ProductIntentDiscoverySpec`.
9
10
  - Evidence loading and ingestion pipeline.
10
11
  - PostHog signal extraction for product analytics.
11
12
  - Action synchronization across tools.
12
13
  - Script-based execution pattern.
13
14
  - `src/docs/` contains docblocks and documentation-facing exports.
14
- - `src/docs/` contains docblocks and documentation-facing exports.
15
15
 
16
16
  ## Running Locally
17
17
 
@@ -33,6 +33,7 @@ Use `@contractspec/example.product-intent` as a reference implementation, or imp
33
33
  - `src/load-evidence.test.ts` is part of the package's public or composition surface.
34
34
  - `src/load-evidence.ts` is part of the package's public or composition surface.
35
35
  - `src/posthog-signals.ts` is part of the package's public or composition surface.
36
+ - `src/product-intent.discovery.ts` defines the exported product-intent spec.
36
37
  - `src/product-intent.feature.ts` defines a feature entrypoint.
37
38
 
38
39
  ## Public Entry Points
@@ -43,9 +44,11 @@ Use `@contractspec/example.product-intent` as a reference implementation, or imp
43
44
  - Export `./example` resolves through `./src/example.ts`.
44
45
  - Export `./load-evidence` resolves through `./src/load-evidence.ts`.
45
46
  - Export `./posthog-signals` resolves through `./src/posthog-signals.ts`.
47
+ - Export `./product-intent.discovery` resolves through `./src/product-intent.discovery.ts`.
46
48
  - Export `./product-intent.feature` resolves through `./src/product-intent.feature.ts`.
47
49
  - Export `./script` resolves through `./src/script.ts`.
48
50
  - Export `./sync-actions` resolves through `./src/sync-actions.ts`.
51
+ - The package publishes 9 total export subpaths; keep docs aligned with `package.json`.
49
52
 
50
53
  ## Local Commands
51
54
 
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export type { EvidenceLoadOptions, EvidenceLoadWithSignalsOptions, } from './loa
3
3
  export { DEFAULT_CHUNK_SIZE, DEFAULT_EVIDENCE_ROOT, DEFAULT_TRANSCRIPT_DIRS, loadEvidenceChunks, loadEvidenceChunksWithSignals, } from './load-evidence';
4
4
  export type { PosthogEvidenceOptions } from './posthog-signals';
5
5
  export { loadPosthogEvidenceChunks, resolvePosthogEvidenceOptionsFromEnv, } from './posthog-signals';
6
+ export * from './product-intent.discovery';
6
7
  export * from './product-intent.feature';
package/dist/index.js CHANGED
@@ -337,6 +337,79 @@ async function loadEvidenceChunksWithSignals(options = {}) {
337
337
  return [...baseChunks, ...posthogChunks];
338
338
  }
339
339
 
340
+ // src/product-intent.discovery.ts
341
+ import {
342
+ OwnersEnum,
343
+ StabilityEnum
344
+ } from "@contractspec/lib.contracts-spec/ownership";
345
+ import { defineProductIntentSpec } from "@contractspec/lib.contracts-spec/product-intent/spec";
346
+ var ProductIntentDiscoverySpec = defineProductIntentSpec({
347
+ id: "product-intent.discovery.activation",
348
+ meta: {
349
+ key: "product-intent.discovery.activation",
350
+ version: "1.0.0",
351
+ title: "Product Intent Discovery",
352
+ description: "Discovery contract for activation friction using transcripts, analytics signals, and generated tasks.",
353
+ domain: "product",
354
+ owners: [OwnersEnum.PlatformCore],
355
+ tags: ["product-intent", "discovery", "activation", "analytics"],
356
+ stability: StabilityEnum.Experimental,
357
+ goal: "Prioritize the next activation improvement with grounded evidence.",
358
+ context: "Evidence is collected from interview transcripts, support tickets, and PostHog funnels before turning into task-ready outputs."
359
+ },
360
+ question: "Which activation and onboarding friction should we prioritize next?",
361
+ runtimeContext: {
362
+ evidenceRoot: "packages/examples/product-intent/evidence",
363
+ analyticsProvider: "posthog"
364
+ },
365
+ tickets: {
366
+ tickets: [
367
+ {
368
+ ticketId: "PI-101",
369
+ title: "Add a guided onboarding checklist",
370
+ summary: "Give new users an explicit checklist after signup so they can see the next activation milestone.",
371
+ evidenceIds: ["INT-002", "INT-014", "PH-dropoff-checkout"],
372
+ acceptanceCriteria: [
373
+ "Users see a checklist within the first session.",
374
+ "Checklist completion is tracked in analytics."
375
+ ],
376
+ priority: "high",
377
+ tags: ["activation", "onboarding"]
378
+ }
379
+ ]
380
+ },
381
+ tasks: {
382
+ packId: "product-intent.discovery.activation.tasks",
383
+ patchId: "product-intent.discovery.activation.patch",
384
+ overview: "Introduce a checklist-driven onboarding path and instrument it for activation measurement.",
385
+ tasks: [
386
+ {
387
+ id: "task-ui-checklist",
388
+ title: "Model the onboarding checklist surface",
389
+ surface: ["ui", "docs"],
390
+ why: "The product intent needs a visible activation guide and matching contract docs.",
391
+ acceptance: [
392
+ "A checklist surface is defined in contracts.",
393
+ "Documentation explains the activation milestone mapping."
394
+ ],
395
+ agentPrompt: "Add the onboarding checklist contract surface and document the milestone states."
396
+ },
397
+ {
398
+ id: "task-analytics-checklist",
399
+ title: "Track checklist completion events",
400
+ surface: ["api", "tests"],
401
+ why: "Success must be measurable after rollout.",
402
+ acceptance: [
403
+ "Checklist completion emits analytics events.",
404
+ "Tests cover the event contract and payload shape."
405
+ ],
406
+ agentPrompt: "Emit activation checklist events and add test coverage for the telemetry payloads.",
407
+ dependsOn: ["task-ui-checklist"]
408
+ }
409
+ ]
410
+ }
411
+ });
412
+
340
413
  // src/product-intent.feature.ts
341
414
  import { defineFeature } from "@contractspec/lib.contracts-spec";
342
415
  var ProductIntentFeature = defineFeature({
@@ -360,6 +433,7 @@ export {
360
433
  loadEvidenceChunks,
361
434
  example_default as example,
362
435
  ProductIntentFeature,
436
+ ProductIntentDiscoverySpec,
363
437
  DEFAULT_TRANSCRIPT_DIRS,
364
438
  DEFAULT_EVIDENCE_ROOT,
365
439
  DEFAULT_CHUNK_SIZE
@@ -336,6 +336,79 @@ async function loadEvidenceChunksWithSignals(options = {}) {
336
336
  return [...baseChunks, ...posthogChunks];
337
337
  }
338
338
 
339
+ // src/product-intent.discovery.ts
340
+ import {
341
+ OwnersEnum,
342
+ StabilityEnum
343
+ } from "@contractspec/lib.contracts-spec/ownership";
344
+ import { defineProductIntentSpec } from "@contractspec/lib.contracts-spec/product-intent/spec";
345
+ var ProductIntentDiscoverySpec = defineProductIntentSpec({
346
+ id: "product-intent.discovery.activation",
347
+ meta: {
348
+ key: "product-intent.discovery.activation",
349
+ version: "1.0.0",
350
+ title: "Product Intent Discovery",
351
+ description: "Discovery contract for activation friction using transcripts, analytics signals, and generated tasks.",
352
+ domain: "product",
353
+ owners: [OwnersEnum.PlatformCore],
354
+ tags: ["product-intent", "discovery", "activation", "analytics"],
355
+ stability: StabilityEnum.Experimental,
356
+ goal: "Prioritize the next activation improvement with grounded evidence.",
357
+ context: "Evidence is collected from interview transcripts, support tickets, and PostHog funnels before turning into task-ready outputs."
358
+ },
359
+ question: "Which activation and onboarding friction should we prioritize next?",
360
+ runtimeContext: {
361
+ evidenceRoot: "packages/examples/product-intent/evidence",
362
+ analyticsProvider: "posthog"
363
+ },
364
+ tickets: {
365
+ tickets: [
366
+ {
367
+ ticketId: "PI-101",
368
+ title: "Add a guided onboarding checklist",
369
+ summary: "Give new users an explicit checklist after signup so they can see the next activation milestone.",
370
+ evidenceIds: ["INT-002", "INT-014", "PH-dropoff-checkout"],
371
+ acceptanceCriteria: [
372
+ "Users see a checklist within the first session.",
373
+ "Checklist completion is tracked in analytics."
374
+ ],
375
+ priority: "high",
376
+ tags: ["activation", "onboarding"]
377
+ }
378
+ ]
379
+ },
380
+ tasks: {
381
+ packId: "product-intent.discovery.activation.tasks",
382
+ patchId: "product-intent.discovery.activation.patch",
383
+ overview: "Introduce a checklist-driven onboarding path and instrument it for activation measurement.",
384
+ tasks: [
385
+ {
386
+ id: "task-ui-checklist",
387
+ title: "Model the onboarding checklist surface",
388
+ surface: ["ui", "docs"],
389
+ why: "The product intent needs a visible activation guide and matching contract docs.",
390
+ acceptance: [
391
+ "A checklist surface is defined in contracts.",
392
+ "Documentation explains the activation milestone mapping."
393
+ ],
394
+ agentPrompt: "Add the onboarding checklist contract surface and document the milestone states."
395
+ },
396
+ {
397
+ id: "task-analytics-checklist",
398
+ title: "Track checklist completion events",
399
+ surface: ["api", "tests"],
400
+ why: "Success must be measurable after rollout.",
401
+ acceptance: [
402
+ "Checklist completion emits analytics events.",
403
+ "Tests cover the event contract and payload shape."
404
+ ],
405
+ agentPrompt: "Emit activation checklist events and add test coverage for the telemetry payloads.",
406
+ dependsOn: ["task-ui-checklist"]
407
+ }
408
+ ]
409
+ }
410
+ });
411
+
339
412
  // src/product-intent.feature.ts
340
413
  import { defineFeature } from "@contractspec/lib.contracts-spec";
341
414
  var ProductIntentFeature = defineFeature({
@@ -359,6 +432,7 @@ export {
359
432
  loadEvidenceChunks,
360
433
  example_default as example,
361
434
  ProductIntentFeature,
435
+ ProductIntentDiscoverySpec,
362
436
  DEFAULT_TRANSCRIPT_DIRS,
363
437
  DEFAULT_EVIDENCE_ROOT,
364
438
  DEFAULT_CHUNK_SIZE
@@ -0,0 +1,75 @@
1
+ // src/product-intent.discovery.ts
2
+ import {
3
+ OwnersEnum,
4
+ StabilityEnum
5
+ } from "@contractspec/lib.contracts-spec/ownership";
6
+ import { defineProductIntentSpec } from "@contractspec/lib.contracts-spec/product-intent/spec";
7
+ var ProductIntentDiscoverySpec = defineProductIntentSpec({
8
+ id: "product-intent.discovery.activation",
9
+ meta: {
10
+ key: "product-intent.discovery.activation",
11
+ version: "1.0.0",
12
+ title: "Product Intent Discovery",
13
+ description: "Discovery contract for activation friction using transcripts, analytics signals, and generated tasks.",
14
+ domain: "product",
15
+ owners: [OwnersEnum.PlatformCore],
16
+ tags: ["product-intent", "discovery", "activation", "analytics"],
17
+ stability: StabilityEnum.Experimental,
18
+ goal: "Prioritize the next activation improvement with grounded evidence.",
19
+ context: "Evidence is collected from interview transcripts, support tickets, and PostHog funnels before turning into task-ready outputs."
20
+ },
21
+ question: "Which activation and onboarding friction should we prioritize next?",
22
+ runtimeContext: {
23
+ evidenceRoot: "packages/examples/product-intent/evidence",
24
+ analyticsProvider: "posthog"
25
+ },
26
+ tickets: {
27
+ tickets: [
28
+ {
29
+ ticketId: "PI-101",
30
+ title: "Add a guided onboarding checklist",
31
+ summary: "Give new users an explicit checklist after signup so they can see the next activation milestone.",
32
+ evidenceIds: ["INT-002", "INT-014", "PH-dropoff-checkout"],
33
+ acceptanceCriteria: [
34
+ "Users see a checklist within the first session.",
35
+ "Checklist completion is tracked in analytics."
36
+ ],
37
+ priority: "high",
38
+ tags: ["activation", "onboarding"]
39
+ }
40
+ ]
41
+ },
42
+ tasks: {
43
+ packId: "product-intent.discovery.activation.tasks",
44
+ patchId: "product-intent.discovery.activation.patch",
45
+ overview: "Introduce a checklist-driven onboarding path and instrument it for activation measurement.",
46
+ tasks: [
47
+ {
48
+ id: "task-ui-checklist",
49
+ title: "Model the onboarding checklist surface",
50
+ surface: ["ui", "docs"],
51
+ why: "The product intent needs a visible activation guide and matching contract docs.",
52
+ acceptance: [
53
+ "A checklist surface is defined in contracts.",
54
+ "Documentation explains the activation milestone mapping."
55
+ ],
56
+ agentPrompt: "Add the onboarding checklist contract surface and document the milestone states."
57
+ },
58
+ {
59
+ id: "task-analytics-checklist",
60
+ title: "Track checklist completion events",
61
+ surface: ["api", "tests"],
62
+ why: "Success must be measurable after rollout.",
63
+ acceptance: [
64
+ "Checklist completion emits analytics events.",
65
+ "Tests cover the event contract and payload shape."
66
+ ],
67
+ agentPrompt: "Emit activation checklist events and add test coverage for the telemetry payloads.",
68
+ dependsOn: ["task-ui-checklist"]
69
+ }
70
+ ]
71
+ }
72
+ });
73
+ export {
74
+ ProductIntentDiscoverySpec
75
+ };
@@ -0,0 +1,4 @@
1
+ export declare const ProductIntentDiscoverySpec: import("@contractspec/lib.contracts-spec/product-intent/spec").ProductIntentSpec<{
2
+ evidenceRoot: string;
3
+ analyticsProvider: string;
4
+ }>;
@@ -0,0 +1,76 @@
1
+ // @bun
2
+ // src/product-intent.discovery.ts
3
+ import {
4
+ OwnersEnum,
5
+ StabilityEnum
6
+ } from "@contractspec/lib.contracts-spec/ownership";
7
+ import { defineProductIntentSpec } from "@contractspec/lib.contracts-spec/product-intent/spec";
8
+ var ProductIntentDiscoverySpec = defineProductIntentSpec({
9
+ id: "product-intent.discovery.activation",
10
+ meta: {
11
+ key: "product-intent.discovery.activation",
12
+ version: "1.0.0",
13
+ title: "Product Intent Discovery",
14
+ description: "Discovery contract for activation friction using transcripts, analytics signals, and generated tasks.",
15
+ domain: "product",
16
+ owners: [OwnersEnum.PlatformCore],
17
+ tags: ["product-intent", "discovery", "activation", "analytics"],
18
+ stability: StabilityEnum.Experimental,
19
+ goal: "Prioritize the next activation improvement with grounded evidence.",
20
+ context: "Evidence is collected from interview transcripts, support tickets, and PostHog funnels before turning into task-ready outputs."
21
+ },
22
+ question: "Which activation and onboarding friction should we prioritize next?",
23
+ runtimeContext: {
24
+ evidenceRoot: "packages/examples/product-intent/evidence",
25
+ analyticsProvider: "posthog"
26
+ },
27
+ tickets: {
28
+ tickets: [
29
+ {
30
+ ticketId: "PI-101",
31
+ title: "Add a guided onboarding checklist",
32
+ summary: "Give new users an explicit checklist after signup so they can see the next activation milestone.",
33
+ evidenceIds: ["INT-002", "INT-014", "PH-dropoff-checkout"],
34
+ acceptanceCriteria: [
35
+ "Users see a checklist within the first session.",
36
+ "Checklist completion is tracked in analytics."
37
+ ],
38
+ priority: "high",
39
+ tags: ["activation", "onboarding"]
40
+ }
41
+ ]
42
+ },
43
+ tasks: {
44
+ packId: "product-intent.discovery.activation.tasks",
45
+ patchId: "product-intent.discovery.activation.patch",
46
+ overview: "Introduce a checklist-driven onboarding path and instrument it for activation measurement.",
47
+ tasks: [
48
+ {
49
+ id: "task-ui-checklist",
50
+ title: "Model the onboarding checklist surface",
51
+ surface: ["ui", "docs"],
52
+ why: "The product intent needs a visible activation guide and matching contract docs.",
53
+ acceptance: [
54
+ "A checklist surface is defined in contracts.",
55
+ "Documentation explains the activation milestone mapping."
56
+ ],
57
+ agentPrompt: "Add the onboarding checklist contract surface and document the milestone states."
58
+ },
59
+ {
60
+ id: "task-analytics-checklist",
61
+ title: "Track checklist completion events",
62
+ surface: ["api", "tests"],
63
+ why: "Success must be measurable after rollout.",
64
+ acceptance: [
65
+ "Checklist completion emits analytics events.",
66
+ "Tests cover the event contract and payload shape."
67
+ ],
68
+ agentPrompt: "Emit activation checklist events and add test coverage for the telemetry payloads.",
69
+ dependsOn: ["task-ui-checklist"]
70
+ }
71
+ ]
72
+ }
73
+ });
74
+ export {
75
+ ProductIntentDiscoverySpec
76
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.product-intent",
3
- "version": "3.7.7",
3
+ "version": "3.7.10",
4
4
  "description": "Product intent example: evidence ingestion and prompt-ready outputs.",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -48,6 +48,12 @@
48
48
  "node": "./dist/node/posthog-signals.js",
49
49
  "default": "./dist/posthog-signals.js"
50
50
  },
51
+ "./product-intent.discovery": {
52
+ "types": "./dist/product-intent.discovery.d.ts",
53
+ "bun": "./dist/product-intent.discovery.js",
54
+ "node": "./dist/node/product-intent.discovery.js",
55
+ "default": "./dist/product-intent.discovery.js"
56
+ },
51
57
  "./product-intent.feature": {
52
58
  "types": "./dist/product-intent.feature.d.ts",
53
59
  "bun": "./dist/product-intent.feature.js",
@@ -83,17 +89,17 @@
83
89
  "typecheck": "tsc --noEmit"
84
90
  },
85
91
  "dependencies": {
86
- "@contractspec/lib.analytics": "3.7.7",
87
- "@contractspec/lib.contracts-spec": "4.0.0",
88
- "@contractspec/lib.contracts-integrations": "3.7.7",
89
- "@contractspec/lib.ai-agent": "7.0.7",
90
- "@contractspec/lib.product-intent-utils": "3.7.7",
91
- "@contractspec/integration.providers-impls": "3.7.7"
92
+ "@contractspec/lib.analytics": "3.7.10",
93
+ "@contractspec/lib.contracts-spec": "4.1.2",
94
+ "@contractspec/lib.contracts-integrations": "3.8.2",
95
+ "@contractspec/lib.ai-agent": "7.0.10",
96
+ "@contractspec/lib.product-intent-utils": "3.7.10",
97
+ "@contractspec/integration.providers-impls": "3.8.2"
92
98
  },
93
99
  "devDependencies": {
94
- "@contractspec/tool.typescript": "3.7.6",
100
+ "@contractspec/tool.typescript": "3.7.8",
95
101
  "typescript": "^5.9.3",
96
- "@contractspec/tool.bun": "3.7.6"
102
+ "@contractspec/tool.bun": "3.7.8"
97
103
  },
98
104
  "publishConfig": {
99
105
  "access": "public",
@@ -134,6 +140,12 @@
134
140
  "node": "./dist/node/posthog-signals.js",
135
141
  "default": "./dist/posthog-signals.js"
136
142
  },
143
+ "./product-intent.discovery": {
144
+ "types": "./dist/product-intent.discovery.d.ts",
145
+ "bun": "./dist/product-intent.discovery.js",
146
+ "node": "./dist/node/product-intent.discovery.js",
147
+ "default": "./dist/product-intent.discovery.js"
148
+ },
137
149
  "./product-intent.feature": {
138
150
  "types": "./dist/product-intent.feature.d.ts",
139
151
  "bun": "./dist/product-intent.feature.js",
@@ -0,0 +1,14 @@
1
+ import { describe, expect, test } from 'bun:test';
2
+ import { ProductIntentDiscoverySpec, ProductIntentFeature } from './index';
3
+
4
+ describe('@contractspec/example.product-intent', () => {
5
+ test('exports the canonical product intent spec', () => {
6
+ expect(ProductIntentDiscoverySpec.meta.key).toBe(
7
+ 'product-intent.discovery.activation'
8
+ );
9
+ expect(ProductIntentDiscoverySpec.question).toContain('activation');
10
+ expect(ProductIntentDiscoverySpec.tickets?.tickets).toHaveLength(1);
11
+ expect(ProductIntentDiscoverySpec.tasks?.tasks).toHaveLength(2);
12
+ expect(ProductIntentFeature.meta.key).toBe('product-intent');
13
+ });
14
+ });
package/src/index.ts CHANGED
@@ -15,4 +15,5 @@ export {
15
15
  loadPosthogEvidenceChunks,
16
16
  resolvePosthogEvidenceOptionsFromEnv,
17
17
  } from './posthog-signals';
18
+ export * from './product-intent.discovery';
18
19
  export * from './product-intent.feature';
@@ -0,0 +1,79 @@
1
+ import {
2
+ OwnersEnum,
3
+ StabilityEnum,
4
+ } from '@contractspec/lib.contracts-spec/ownership';
5
+ import { defineProductIntentSpec } from '@contractspec/lib.contracts-spec/product-intent/spec';
6
+
7
+ export const ProductIntentDiscoverySpec = defineProductIntentSpec({
8
+ id: 'product-intent.discovery.activation',
9
+ meta: {
10
+ key: 'product-intent.discovery.activation',
11
+ version: '1.0.0',
12
+ title: 'Product Intent Discovery',
13
+ description:
14
+ 'Discovery contract for activation friction using transcripts, analytics signals, and generated tasks.',
15
+ domain: 'product',
16
+ owners: [OwnersEnum.PlatformCore],
17
+ tags: ['product-intent', 'discovery', 'activation', 'analytics'],
18
+ stability: StabilityEnum.Experimental,
19
+ goal: 'Prioritize the next activation improvement with grounded evidence.',
20
+ context:
21
+ 'Evidence is collected from interview transcripts, support tickets, and PostHog funnels before turning into task-ready outputs.',
22
+ },
23
+ question:
24
+ 'Which activation and onboarding friction should we prioritize next?',
25
+ runtimeContext: {
26
+ evidenceRoot: 'packages/examples/product-intent/evidence',
27
+ analyticsProvider: 'posthog',
28
+ },
29
+ tickets: {
30
+ tickets: [
31
+ {
32
+ ticketId: 'PI-101',
33
+ title: 'Add a guided onboarding checklist',
34
+ summary:
35
+ 'Give new users an explicit checklist after signup so they can see the next activation milestone.',
36
+ evidenceIds: ['INT-002', 'INT-014', 'PH-dropoff-checkout'],
37
+ acceptanceCriteria: [
38
+ 'Users see a checklist within the first session.',
39
+ 'Checklist completion is tracked in analytics.',
40
+ ],
41
+ priority: 'high',
42
+ tags: ['activation', 'onboarding'],
43
+ },
44
+ ],
45
+ },
46
+ tasks: {
47
+ packId: 'product-intent.discovery.activation.tasks',
48
+ patchId: 'product-intent.discovery.activation.patch',
49
+ overview:
50
+ 'Introduce a checklist-driven onboarding path and instrument it for activation measurement.',
51
+ tasks: [
52
+ {
53
+ id: 'task-ui-checklist',
54
+ title: 'Model the onboarding checklist surface',
55
+ surface: ['ui', 'docs'],
56
+ why: 'The product intent needs a visible activation guide and matching contract docs.',
57
+ acceptance: [
58
+ 'A checklist surface is defined in contracts.',
59
+ 'Documentation explains the activation milestone mapping.',
60
+ ],
61
+ agentPrompt:
62
+ 'Add the onboarding checklist contract surface and document the milestone states.',
63
+ },
64
+ {
65
+ id: 'task-analytics-checklist',
66
+ title: 'Track checklist completion events',
67
+ surface: ['api', 'tests'],
68
+ why: 'Success must be measurable after rollout.',
69
+ acceptance: [
70
+ 'Checklist completion emits analytics events.',
71
+ 'Tests cover the event contract and payload shape.',
72
+ ],
73
+ agentPrompt:
74
+ 'Emit activation checklist events and add test coverage for the telemetry payloads.',
75
+ dependsOn: ['task-ui-checklist'],
76
+ },
77
+ ],
78
+ },
79
+ });