@contractspec/example.product-intent 3.7.6 → 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 26ms
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 21ms
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/AGENTS.md CHANGED
@@ -1,33 +1,57 @@
1
- # AI Agent Guide -- `@contractspec/example.product-intent`
1
+ # AI Agent Guide `@contractspec/example.product-intent`
2
2
 
3
3
  Scope: `packages/examples/product-intent/*`
4
4
 
5
- Product intent example: evidence ingestion, PostHog signal extraction, and prompt-ready outputs for PM discovery.
5
+ Product intent example: evidence ingestion and prompt-ready outputs.
6
6
 
7
7
  ## Quick Context
8
8
 
9
- - **Layer**: example
10
- - **Related Packages**: `lib.contracts-spec`, `lib.contracts-integrations`, `lib.ai-agent`, `lib.product-intent-utils`, `integration.providers-impls`
9
+ - Layer: `example`.
10
+ - Package visibility: published package.
11
+ - Primary consumers are example explorers, template authors, and documentation readers.
12
+ - Related packages: `@contractspec/integration.providers-impls`, `@contractspec/lib.ai-agent`, `@contractspec/lib.analytics`, `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.product-intent-utils`, ...
11
13
 
12
- ## What This Demonstrates
14
+ ## Architecture
13
15
 
14
- - Evidence loading and ingestion pipeline
15
- - PostHog signal extraction for product analytics
16
- - Action synchronization across tools
17
- - Script-based execution pattern
16
+ - `src/docs/` contains docblocks and documentation-facing exports.
17
+ - `src/example.ts` is the runnable example entrypoint.
18
+ - `src/index.ts` is the root public barrel and package entrypoint.
19
+ - `src/load-evidence.test.ts` is part of the package's public or composition surface.
20
+ - `src/load-evidence.ts` is part of the package's public or composition surface.
21
+ - `src/posthog-signals.ts` is part of the package's public or composition surface.
22
+ - `src/product-intent.feature.ts` defines a feature entrypoint.
18
23
 
19
- ## Public Exports
24
+ ## Public Surface
20
25
 
21
- - `.` -- root barrel
22
- - `./load-evidence` -- evidence ingestion
23
- - `./posthog-signals` -- PostHog signal extraction
24
- - `./sync-actions` -- action synchronization
25
- - `./script` -- runnable script
26
- - `./example`
26
+ - Export `.` resolves through `./src/index.ts`.
27
+ - Export `./docs` resolves through `./src/docs/index.ts`.
28
+ - Export `./docs/product-intent.docblock` resolves through `./src/docs/product-intent.docblock.ts`.
29
+ - Export `./example` resolves through `./src/example.ts`.
30
+ - Export `./load-evidence` resolves through `./src/load-evidence.ts`.
31
+ - Export `./posthog-signals` resolves through `./src/posthog-signals.ts`.
32
+ - Export `./product-intent.feature` resolves through `./src/product-intent.feature.ts`.
33
+ - Export `./script` resolves through `./src/script.ts`.
34
+ - Export `./sync-actions` resolves through `./src/sync-actions.ts`.
35
+
36
+ ## Guardrails
37
+
38
+ - Keep the example package demonstrative, buildable, and aligned with the exported feature surface.
39
+ - Do not add hidden production assumptions that are not actually implemented in the example.
40
+ - Changes here can affect downstream packages such as `@contractspec/integration.providers-impls`, `@contractspec/lib.ai-agent`, `@contractspec/lib.analytics`, `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.product-intent-utils`, ....
41
+ - Changes here can affect downstream packages such as `@contractspec/integration.providers-impls`, `@contractspec/lib.ai-agent`, `@contractspec/lib.analytics`, `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.product-intent-utils`, ...
27
42
 
28
43
  ## Local Commands
29
44
 
30
- - Build: `bun run build`
31
- - Dev: `bun run dev`
32
- - Test: `bun test`
33
- - Typecheck: `bun run typecheck`
45
+ - `bun run dev` — contractspec-bun-build dev
46
+ - `bun run build`bun run prebuild && bun run build:bundle && bun run build:types
47
+ - `bun run test`bun test
48
+ - `bun run lint` — bun lint:fix
49
+ - `bun run lint:check` — biome check .
50
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
51
+ - `bun run typecheck` — tsc --noEmit
52
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
53
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
54
+ - `bun run clean` — rimraf dist .turbo
55
+ - `bun run build:bundle` — contractspec-bun-build transpile
56
+ - `bun run build:types` — contractspec-bun-build types
57
+ - `bun run prebuild` — contractspec-bun-build prebuild
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
@@ -1,58 +1,77 @@
1
- # Product Intent Example
1
+ # @contractspec/example.product-intent
2
2
 
3
- Website: https://contractspec.io/
3
+ Website: https://contractspec.io
4
4
 
5
- Minimal example showing a transcript-to-tickets workflow with evidence-backed citations and a deterministic impact report.
5
+ **Product intent example: evidence ingestion and prompt-ready outputs.**
6
6
 
7
- ## What it demonstrates
7
+ ## What This Demonstrates
8
8
 
9
- - Loading interview, ticket, and public thread transcripts from `evidence/`.
10
- - Chunking transcripts into evidence chunks with stable ids.
11
- - Extracting evidence findings with exact-quote citations.
12
- - Grouping problems linked to evidence finding IDs.
13
- - Generating tickets with evidence links + acceptance criteria.
14
- - Producing a deterministic impact report from the patch intent.
9
+ - Canonical `product-intent` export via `ProductIntentDiscoverySpec`.
10
+ - Evidence loading and ingestion pipeline.
11
+ - PostHog signal extraction for product analytics.
12
+ - Action synchronization across tools.
13
+ - Script-based execution pattern.
14
+ - `src/docs/` contains docblocks and documentation-facing exports.
15
15
 
16
- ## Running the script
16
+ ## Running Locally
17
17
 
18
- From the repository root:
18
+ From `packages/examples/product-intent`:
19
+ - `bun run dev`
20
+ - `bun run build`
21
+ - `bun run test`
22
+ - `bun run typecheck`
19
23
 
20
- ```bash
21
- bun install
22
- export CONTRACTSPEC_AI_PROVIDER="mistral" # or openai/anthropic/gemini/ollama
23
- export MISTRAL_API_KEY="your_key" # if using mistral
24
- # export OPENAI_API_KEY="your_key" # if using openai
25
- # export CONTRACTSPEC_AI_MODEL="model-id" # optional override
26
- # export CONTRACTSPEC_AI_TEMPERATURE="0" # default is 0 for determinism
27
- # export CONTRACTSPEC_AI_MAX_ATTEMPTS="2" # retry invalid JSON
28
- bun tsx packages/examples/product-intent/src/script.ts
29
- ```
24
+ ## Usage
30
25
 
31
- You should see evidence findings, problems, tickets, a patch intent generated by the AI provider, and a deterministic impact report.
32
- If validation fails, inspect the JSONL trace log and artifacts in `packages/examples/product-intent/logs/run-*/`.
26
+ Use `@contractspec/example.product-intent` as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
33
27
 
34
- ## Sync actions to project management tools
28
+ ## Architecture
35
29
 
36
- This example can convert tickets into shareable work items and sync them to Linear, Jira Cloud, or Notion:
30
+ - `src/docs/` contains docblocks and documentation-facing exports.
31
+ - `src/example.ts` is the runnable example entrypoint.
32
+ - `src/index.ts` is the root public barrel and package entrypoint.
33
+ - `src/load-evidence.test.ts` is part of the package's public or composition surface.
34
+ - `src/load-evidence.ts` is part of the package's public or composition surface.
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.
37
+ - `src/product-intent.feature.ts` defines a feature entrypoint.
37
38
 
38
- ```bash
39
- export CONTRACTSPEC_PM_PROVIDER="linear" # or jira/notion
40
- export CONTRACTSPEC_PM_DRY_RUN="true" # set to false to create real items
41
- export LINEAR_API_KEY="your_key"
42
- export LINEAR_TEAM_ID="team_id"
43
- export LINEAR_PROJECT_ID="project_id" # optional
44
- export LINEAR_LABEL_IDS="label1,label2" # optional
39
+ ## Public Entry Points
45
40
 
46
- # Jira Cloud
47
- # export JIRA_SITE_URL="https://acme.atlassian.net"
48
- # export JIRA_EMAIL="user@acme.com"
49
- # export JIRA_API_TOKEN="jira_token"
50
- # export JIRA_PROJECT_KEY="PM"
41
+ - Export `.` resolves through `./src/index.ts`.
42
+ - Export `./docs` resolves through `./src/docs/index.ts`.
43
+ - Export `./docs/product-intent.docblock` resolves through `./src/docs/product-intent.docblock.ts`.
44
+ - Export `./example` resolves through `./src/example.ts`.
45
+ - Export `./load-evidence` resolves through `./src/load-evidence.ts`.
46
+ - Export `./posthog-signals` resolves through `./src/posthog-signals.ts`.
47
+ - Export `./product-intent.discovery` resolves through `./src/product-intent.discovery.ts`.
48
+ - Export `./product-intent.feature` resolves through `./src/product-intent.feature.ts`.
49
+ - Export `./script` resolves through `./src/script.ts`.
50
+ - Export `./sync-actions` resolves through `./src/sync-actions.ts`.
51
+ - The package publishes 9 total export subpaths; keep docs aligned with `package.json`.
51
52
 
52
- # Notion
53
- # export NOTION_API_KEY="secret"
54
- # export NOTION_DATABASE_ID="database_id"
55
- # export NOTION_SUMMARY_PARENT_PAGE_ID="parent_page_id" # optional
53
+ ## Local Commands
56
54
 
57
- bun tsx packages/examples/product-intent/src/sync-actions.ts
58
- ```
55
+ - `bun run dev` — contractspec-bun-build dev
56
+ - `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
57
+ - `bun run test` — bun test
58
+ - `bun run lint` — bun lint:fix
59
+ - `bun run lint:check` — biome check .
60
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
61
+ - `bun run typecheck` — tsc --noEmit
62
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
63
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
64
+ - `bun run clean` — rimraf dist .turbo
65
+ - `bun run build:bundle` — contractspec-bun-build transpile
66
+ - `bun run build:types` — contractspec-bun-build types
67
+ - `bun run prebuild` — contractspec-bun-build prebuild
68
+
69
+ ## Recent Updates
70
+
71
+ - Replace eslint+prettier by biomejs to optimize speed.
72
+ - Stability.
73
+ - Missing contract layers.
74
+
75
+ ## Notes
76
+
77
+ - Works alongside `@contractspec/integration.providers-impls`, `@contractspec/lib.ai-agent`, `@contractspec/lib.analytics`, `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, ...
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { default as example } from './example';
2
- export { DEFAULT_CHUNK_SIZE, DEFAULT_EVIDENCE_ROOT, DEFAULT_TRANSCRIPT_DIRS, loadEvidenceChunks, loadEvidenceChunksWithSignals, } from './load-evidence';
3
2
  export type { EvidenceLoadOptions, EvidenceLoadWithSignalsOptions, } from './load-evidence';
4
- export { loadPosthogEvidenceChunks, resolvePosthogEvidenceOptionsFromEnv, } from './posthog-signals';
3
+ export { DEFAULT_CHUNK_SIZE, DEFAULT_EVIDENCE_ROOT, DEFAULT_TRANSCRIPT_DIRS, loadEvidenceChunks, loadEvidenceChunksWithSignals, } from './load-evidence';
5
4
  export type { PosthogEvidenceOptions } from './posthog-signals';
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
@@ -31,8 +31,8 @@ var example = defineExample({
31
31
  var example_default = example;
32
32
 
33
33
  // src/posthog-signals.ts
34
- import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
35
34
  import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
35
+ import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
36
36
  async function loadPosthogEvidenceChunks(options) {
37
37
  const chunks = [];
38
38
  const range = resolveRange(options.dateRange);
@@ -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
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  // src/posthog-signals.ts
3
- import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
4
3
  import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
4
+ import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
5
5
  async function loadPosthogEvidenceChunks(options) {
6
6
  const chunks = [];
7
7
  const range = resolveRange(options.dateRange);
@@ -30,8 +30,8 @@ var example = defineExample({
30
30
  var example_default = example;
31
31
 
32
32
  // src/posthog-signals.ts
33
- import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
34
33
  import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
34
+ import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
35
35
  async function loadPosthogEvidenceChunks(options) {
36
36
  const chunks = [];
37
37
  const range = resolveRange(options.dateRange);
@@ -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
@@ -1,6 +1,6 @@
1
1
  // src/posthog-signals.ts
2
- import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
3
2
  import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
3
+ import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
4
4
  async function loadPosthogEvidenceChunks(options) {
5
5
  const chunks = [];
6
6
  const range = resolveRange(options.dateRange);
@@ -1,6 +1,6 @@
1
1
  // src/posthog-signals.ts
2
- import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
3
2
  import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
3
+ import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
4
4
  async function loadPosthogEvidenceChunks(options) {
5
5
  const chunks = [];
6
6
  const range = resolveRange(options.dateRange);
@@ -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
+ };
@@ -1,6 +1,6 @@
1
1
  // src/posthog-signals.ts
2
- import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
3
2
  import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
3
+ import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
4
4
  async function loadPosthogEvidenceChunks(options) {
5
5
  const chunks = [];
6
6
  const range = resolveRange(options.dateRange);
@@ -1,6 +1,6 @@
1
1
  // src/posthog-signals.ts
2
- import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
3
2
  import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
3
+ import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
4
4
  async function loadPosthogEvidenceChunks(options) {
5
5
  const chunks = [];
6
6
  const range = resolveRange(options.dateRange);
@@ -306,6 +306,9 @@ async function loadEvidenceChunksWithSignals(options = {}) {
306
306
  }
307
307
 
308
308
  // src/sync-actions.ts
309
+ import { JiraProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/jira";
310
+ import { LinearProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/linear";
311
+ import { NotionProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/notion";
309
312
  import { createAgentJsonRunner } from "@contractspec/lib.ai-agent/agent/json-runner";
310
313
  import {
311
314
  buildProjectManagementSyncPayload,
@@ -315,9 +318,6 @@ import {
315
318
  impactEngine,
316
319
  suggestPatch
317
320
  } from "@contractspec/lib.product-intent-utils";
318
- import { LinearProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/linear";
319
- import { JiraProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/jira";
320
- import { NotionProjectManagementProvider } from "@contractspec/integration.providers-impls/impls/notion";
321
321
  var QUESTION = "Which activation and onboarding friction should we prioritize next?";
322
322
  function resolveProvider() {
323
323
  const raw = (process.env.CONTRACTSPEC_PM_PROVIDER ?? "").toLowerCase();
@@ -1,6 +1,6 @@
1
+ import type { FunnelDefinition } from '@contractspec/lib.analytics';
1
2
  import type { AnalyticsReader, DateRangeInput } from '@contractspec/lib.contracts-integrations';
2
3
  import type { EvidenceChunk } from '@contractspec/lib.contracts-spec/product-intent/types';
3
- import type { FunnelDefinition } from '@contractspec/lib.analytics';
4
4
  export interface PosthogEvidenceOptions {
5
5
  reader: AnalyticsReader;
6
6
  dateRange?: DateRangeInput;
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  // src/posthog-signals.ts
3
- import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
4
3
  import { PosthogAnalyticsProvider } from "@contractspec/integration.providers-impls/impls/posthog";
4
+ import { FunnelAnalyzer } from "@contractspec/lib.analytics/funnel";
5
5
  async function loadPosthogEvidenceChunks(options) {
6
6
  const chunks = [];
7
7
  const range = resolveRange(options.dateRange);