studioflow 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,14 +1,16 @@
1
1
  # StudioFlow
2
2
 
3
- StudioFlow turns a plain-language demo request into a deterministic recorded run.
3
+ StudioFlow turns a plain-language demo request into a deterministic recorded product run.
4
4
 
5
5
  This package includes:
6
6
  - a CLI runtime (`studioflow`) for deterministic artifact execution
7
- - bundled agent skills for Codex and Claude (`studioflow-investigate`, `studioflow-cli`)
7
+ - bundled agent skills for Codex and Claude (`studioflow-investigate`, `studioflow-author`, `studioflow-cli`)
8
+
9
+ StudioFlow supports both QuickTime Player and Screen Studio recording backends.
8
10
 
9
11
  ## Requirements
10
12
 
11
- - macOS (QuickTime/Screen Studio automation)
13
+ - macOS (recorder automation is macOS-only)
12
14
  - Node.js 22+
13
15
  - QuickTime Player (built into macOS) or Screen Studio
14
16
 
@@ -18,70 +20,123 @@ This package includes:
18
20
  npm install -g studioflow
19
21
  ```
20
22
 
21
- ## Setup Runtime + Skills
23
+ ## Quickstart (2 Minutes)
22
24
 
23
- `setup` installs Playwright Chromium, installs bundled skills for Codex and Claude, and checks permissions.
25
+ 1. Setup runtime dependencies and bundled skills:
24
26
 
25
27
  ```bash
26
28
  studioflow setup
29
+ studioflow doctor
30
+ studioflow config check
27
31
  ```
28
32
 
29
- ## Default Workflow (Agent-First)
30
-
31
- You should not need to manually invoke multiple skills or manually run CLI commands for a normal demo request.
32
- Open Codex or Claude in your project and describe the demo you want.
33
-
34
- 1. Start your agent from the project root.
35
-
36
- Codex:
33
+ 2. Open Codex or Claude from your project root:
37
34
 
38
35
  ```bash
39
36
  cd /path/to/your/project
40
37
  codex
38
+ # or
39
+ claude
41
40
  ```
42
41
 
43
- Claude Code:
42
+ 3. Ask in plain language:
44
43
 
45
- ```bash
46
- cd /path/to/your/project
47
- claude
44
+ ```text
45
+ Record a demo for onboarding and billing.
48
46
  ```
49
47
 
50
- If your launcher command differs, start your usual Codex or Claude session in this repo root.
48
+ or
51
49
 
52
- 2. Ask for the demo in plain language.
50
+ ```text
51
+ Record a demo for onboarding and billing using Screen Studio.
52
+ ```
53
53
 
54
- Example:
54
+ 4. Expected successful run output includes:
55
55
 
56
56
  ```text
57
- Record a demo for onboarding and billing.
57
+ Run completed successfully.
58
+ Run ID: <timestamp-id>
59
+ Artifacts: <path-to-run-dir>
58
60
  ```
59
61
 
60
- 3. StudioFlow skills + CLI handle the rest:
61
- - investigate the codebase
62
- - generate deterministic artifacts (`artifacts/flow.json`, related context artifacts)
63
- - validate the flow
64
- - execute recording through the CLI runtime
62
+ ## Recorder Backends
63
+
64
+ - `quicktime` (default): no extra app install required.
65
+ - `screenstudio`: just specify Screen Studio in your agent request.
66
+
67
+ Manual CLI mode still supports `--recorder screenstudio` when you want direct runtime control.
68
+
69
+ ## What `setup` Changes
70
+
71
+ `studioflow setup`:
72
+ - installs Playwright Chromium runtime
73
+ - installs StudioFlow skills into:
74
+ - Codex: `$CODEX_HOME/skills` or `~/.codex/skills`
75
+ - Claude: `$CLAUDE_HOME/skills` or `~/.claude/skills`
76
+ - runs permission diagnostics
77
+ - writes setup state under `~/.studioflow` (or `$STUDIOFLOW_DATA_DIR`)
78
+
79
+ ## Command Cheat Sheet
80
+
81
+ | Task | Command |
82
+ | --- | --- |
83
+ | Setup runtime + skills | `studioflow setup` |
84
+ | Check permissions | `studioflow doctor` |
85
+ | Show effective config | `studioflow config show` |
86
+ | Validate config health | `studioflow config check` |
87
+ | Validate flow artifact | `studioflow validate --flow artifacts/flow.json` |
88
+ | Run deterministic demo | `studioflow demo --flow artifacts/flow.json --intent "your demo intent"` |
89
+ | List built-in flows | `studioflow list-flows` |
90
+ | QuickTime diagnostics | `studioflow quicktime-prep` |
91
+ | Screen Studio diagnostics | `studioflow screenstudio-prep` |
92
+
93
+ ## Minimal Manual Flow (Optional)
94
+
95
+ If you want to run the CLI directly without agent authoring first, start with a minimal artifact:
96
+
97
+ ```json
98
+ {
99
+ "id": "landing_capture",
100
+ "description": "Capture the landing page",
101
+ "tags": ["smoke"],
102
+ "steps": [
103
+ { "id": "open-home", "action": "goto", "value": "/" },
104
+ { "id": "capture-home", "action": "screenshot", "value": "home" }
105
+ ]
106
+ }
107
+ ```
108
+
109
+ Then run:
110
+
111
+ ```bash
112
+ studioflow validate --flow artifacts/flow.json
113
+ studioflow demo --flow artifacts/flow.json --intent "landing page smoke"
114
+ ```
65
115
 
66
- `run`/`demo` automatically performs recorder preflight checks. QuickTime is the default backend; use `--recorder screenstudio` to opt into Screen Studio.
67
- Headed runs auto-open a maximized browser window for cleaner recording composition.
68
- Runs do not auto-export by default; include `recorder_export` in flow steps only when export is explicitly needed.
69
- Runs now also block `recorder_export` unless intent text explicitly asks for export, or `--allow-export true` is provided.
116
+ ## Quick Troubleshooting
70
117
 
71
- ## Advanced Manual Mode (Optional)
118
+ - Permission failures:
119
+ - `studioflow doctor` and approve macOS prompts.
120
+ - QuickTime preflight failures:
121
+ - `studioflow quicktime-prep`
122
+ - Screen Studio preflight failures:
123
+ - `studioflow screenstudio-prep`
124
+ - App health timeout:
125
+ - `studioflow config show` and verify `baseUrl`, `startCommand`, `healthPath`.
126
+ - Flow validation failures:
127
+ - `studioflow validate --flow <path>`
72
128
 
73
- If you want to run the runtime yourself:
129
+ ## Uninstall / Cleanup
74
130
 
75
131
  ```bash
76
- studioflow validate --flow artifacts/flow.json
77
- studioflow demo --flow artifacts/flow.json --intent "onboarding and billing demo"
132
+ npm uninstall -g studioflow
78
133
  ```
79
134
 
80
- ## Documentation
135
+ Optional local cleanup:
136
+ - remove `~/.studioflow` (or `$STUDIOFLOW_DATA_DIR`)
137
+ - remove installed skill folders under `~/.codex/skills` and `~/.claude/skills` if you no longer want them
138
+
139
+ ## Contact
81
140
 
82
- - Day 0 runbook: https://github.com/ydarar/studioflow/blob/main/docs/day0-runbook.md
83
- - CLI reference: https://github.com/ydarar/studioflow/blob/main/docs/cli-reference.md
84
- - Configuration: https://github.com/ydarar/studioflow/blob/main/docs/configuration.md
85
- - Smoke checklist: https://github.com/ydarar/studioflow/blob/main/docs/testing-manual-smoke.md
86
- - Open intent tests: https://github.com/ydarar/studioflow/blob/main/docs/studioflow-open-intent-tests.md
87
- - Full docs map: https://github.com/ydarar/studioflow/blob/main/docs/README.md
141
+ - X: https://x.com/Ydarar_dev (@Ydarar_dev)
142
+ - GitHub: https://github.com/ydarar/studioflow/issues
package/assets/cursor.png CHANGED
Binary file
@@ -1,14 +1,17 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "packageName": "studioflow",
4
- "packageVersion": "0.2.0",
5
- "generatedAt": "2026-02-14T18:48:19.096Z",
4
+ "packageVersion": "0.2.1",
5
+ "generatedAt": "2026-02-15T00:48:20.093Z",
6
6
  "skills": {
7
7
  "studioflow-cli": {
8
- "hash": "4328ceed07012ece8406541b2e764d2ea686af473a6ce0206458a346f2e6eed8"
8
+ "hash": "ff59e41a56a6f1289c37e4d167d62eb00f80442fca08f571297444e45aa0e747"
9
9
  },
10
10
  "studioflow-investigate": {
11
- "hash": "e2bf84ed56b7077575c2a875acc5b2c26cac7b34e84d8ceb213ff5d4357665fc"
11
+ "hash": "8e3034b43ea84834008900886e94a744f3bf22e7b05d2548c0123492f694f693"
12
+ },
13
+ "studioflow-author": {
14
+ "hash": "cd42e054957736b1d1d47e93839a5daf40bfe40cafda0c8d26380c0ac63d078d"
12
15
  }
13
16
  }
14
17
  }
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: studioflow-author
3
+ description: Create or repair deterministic StudioFlow artifacts for a clarified demo intent. Use when `studioflow-investigate` routes to `patch-existing` or `create-new`, or when the user explicitly asks to generate/edit `artifacts/flow.json` and runtime handoff.
4
+ ---
5
+
6
+ # StudioFlow Author
7
+
8
+ Author and validate deterministic artifacts for runtime execution.
9
+
10
+ ## Workflow
11
+
12
+ 1. Consume clarified intent + routing context.
13
+
14
+ Expected upstream context:
15
+ - resolved anchors (`target_route`, `user_goal`, `done_assertion`)
16
+ - recorder preference (`quicktime` or `screenstudio`)
17
+ - route decision (`patch-existing` or `create-new`)
18
+
19
+ 2. Collect project context artifacts automatically. Do not ask the user to run these commands manually.
20
+
21
+ ```bash
22
+ pnpm bootstrap -- --out artifacts/bootstrap.json
23
+ pnpm discover -- --out artifacts
24
+ ```
25
+
26
+ Fallback if workspace scripts are unavailable:
27
+
28
+ ```bash
29
+ studioflow bootstrap --out artifacts/bootstrap.json
30
+ studioflow discover --out artifacts
31
+ ```
32
+
33
+ 3. Review:
34
+ - `artifacts/bootstrap.json`
35
+ - `artifacts/structure-report.json`
36
+ - `artifacts/navigation-graph.json`
37
+ - existing `artifacts/flow.json` if present
38
+
39
+ 4. Author `artifacts/flow.json` for the clarified intent.
40
+
41
+ Rules:
42
+ - Deterministic steps only.
43
+ - Prefer stable selectors (`data-testid`).
44
+ - Include clear step IDs and assertions at key transitions.
45
+ - Always synthesize pacing fields (`preDelayMs`, `postDelayMs`, `mouseMoveMs`, `highlightMs`, `dwellMs`) for interaction-heavy steps to keep demos human-looking.
46
+ - Model scroll risk explicitly. For below-fold or overflow-container targets, add deterministic setup/wait steps before interaction.
47
+ - Add `recorder_export` only when user explicitly asks for export at run completion.
48
+ - If clarification context is still incomplete, generate best-effort deterministic flow with explicit assumptions.
49
+
50
+ 5. Validate the authored artifact:
51
+
52
+ ```bash
53
+ pnpm validate -- --flow artifacts/flow.json
54
+ ```
55
+
56
+ 6. If validation fails, patch flow selectors/actions/pacing and rerun validation.
57
+
58
+ 7. Emit runtime handoff for `studioflow-cli`.
59
+
60
+ Write:
61
+ - `artifacts/studioflow-cli-handoff.json`
62
+
63
+ Use `references/cli-handoff-spec.md`.
64
+ Always include:
65
+ - `runtimePacing`
66
+ - `recorder`
67
+
68
+ 8. Handoff to `studioflow-cli` immediately when the user intent is to run/record now.
69
+
70
+ ## Output Requirements
71
+
72
+ Always produce:
73
+ 1. `artifacts/bootstrap.json`
74
+ 2. `artifacts/structure-report.json`
75
+ 3. `artifacts/navigation-graph.json`
76
+ 4. `artifacts/flow.json`
77
+ 5. `artifacts/studioflow-cli-handoff.json`
78
+
79
+ Include a concise authoring summary:
80
+ - what changed (new vs patched)
81
+ - assumptions
82
+ - confidence (`high|medium|low`)
83
+
84
+ Use references in:
85
+ - `references/artifact-spec.md`
86
+ - `references/cli-handoff-spec.md`
@@ -42,6 +42,6 @@ Recorder note:
42
42
  - Without `recorder_export`, StudioFlow stops recording and completes the run without export.
43
43
  - Recorder software selection is not encoded in `flow.json`; include it in `studioflow-cli-handoff.json` as `recorder`.
44
44
 
45
- ## Open-intent fallback note
45
+ ## Fallback note
46
46
 
47
- When the user intent remains open after clarification rounds, the assistant should still generate deterministic `flow.json` and include assumptions + confidence in the response handoff.
47
+ When clarification inputs remain incomplete, still generate deterministic `flow.json` and include assumptions + confidence in handoff summary.
@@ -0,0 +1,60 @@
1
+ # CLI Handoff Spec
2
+
3
+ Use this artifact to hand execution from `studioflow-author` to `studioflow-cli`.
4
+
5
+ Path:
6
+
7
+ - `artifacts/studioflow-cli-handoff.json`
8
+
9
+ ## JSON shape
10
+
11
+ ```json
12
+ {
13
+ "version": 1,
14
+ "intentSummary": "Record only onboarding + CRM in Demo Lab",
15
+ "flowPath": "artifacts/flow.json",
16
+ "recorder": "screenstudio",
17
+ "baseUrl": "http://localhost:4280",
18
+ "startCommand": "pnpm dev:demo-lab",
19
+ "healthPath": "/",
20
+ "runtimePacing": {
21
+ "profile": "standard",
22
+ "cursorMoveMs": 430,
23
+ "cursorHighlightMs": 170,
24
+ "typingDelayMs": 55,
25
+ "clickPulseMs": 220,
26
+ "stepPreDelayMs": 90,
27
+ "stepPostDelayMs": 130,
28
+ "stepDwellMs": 180
29
+ },
30
+ "notes": [
31
+ "Use deterministic artifact execution only."
32
+ ]
33
+ }
34
+ ```
35
+
36
+ ## Field rules
37
+
38
+ - `version`: integer, currently `1`.
39
+ - `intentSummary`: concise run label for CLI `--intent`.
40
+ - `flowPath`: deterministic artifact path. Default: `artifacts/flow.json`.
41
+ - `recorder`: recorder backend used by CLI `--recorder`.
42
+ - Allowed values: `quicktime`, `screenstudio`.
43
+ - Selection rule: if user explicitly requests Screen Studio/QuickTime, preserve that; otherwise default `quicktime`.
44
+ - `baseUrl`: runtime host URL.
45
+ - `startCommand`: command used when app is not already healthy.
46
+ - `healthPath`: health probe path used by runtime.
47
+ - `runtimePacing`: required runtime timing overrides derived from authored flow pacing.
48
+ - Allowed fields: `profile`, `cursorMoveMs`, `cursorHighlightMs`, `typingDelayMs`, `clickPulseMs`, `stepPreDelayMs`, `stepPostDelayMs`, `stepDwellMs`.
49
+ - `profile` values: `fast`, `standard`, `cinematic`.
50
+ - `notes`: optional operator notes.
51
+
52
+ ## Invocation contract
53
+
54
+ When handoff artifact is written and the user asked to run/record now, invoke `studioflow-cli` (or equivalent runtime workflow in same agent) to execute:
55
+
56
+ 1. `pnpm validate -- --flow <flowPath>`
57
+ 2. `pnpm demo -- --flow <flowPath> --intent "<intentSummary>" --recorder <recorder> --base-url <baseUrl> --start-command "<startCommand>" --health-path <healthPath>`
58
+ 3. Set matching `STUDIOFLOW_*` env vars from `runtimePacing` on the demo command.
59
+
60
+ Do not ask the user to translate handoff into commands.
@@ -7,12 +7,27 @@ description: Execute validated demo artifacts with StudioFlow CLI. Use when the
7
7
 
8
8
  Run validated artifacts through deterministic execution.
9
9
 
10
+ ## Sandbox Escalation (Required)
11
+
12
+ When executing StudioFlow CLI commands from Codex tool environments, run the commands below with `sandbox_permissions: require_escalated` on the first attempt. Do not run them in sandbox first and retry after failure.
13
+
14
+ - `pnpm install` (when dependencies are missing)
15
+ - `pnpm run setup`
16
+ - `pnpm run doctor`
17
+ - `pnpm quicktime-prep`
18
+ - `pnpm screenstudio-prep`
19
+ - `pnpm validate -- --flow <flowPath>`
20
+ - `pnpm demo -- --flow <flowPath> --intent "<intent-summary>" --recorder <recorder> --base-url <baseUrl> --start-command "<startCommand>" --health-path <healthPath>`
21
+
22
+ Reason: these commands can require network access, local IPC sockets (`tsx`), GUI automation, recorder control, and app process orchestration that are commonly blocked in sandboxed execution.
23
+
10
24
  ## Workflow
11
25
 
12
26
  0. Resolve handoff input (if present):
13
27
  - `artifacts/studioflow-cli-handoff.json`
14
28
 
15
29
  If handoff exists, use it as the source of truth for `flowPath`, `intentSummary`, `baseUrl`, `startCommand`, and `healthPath`.
30
+ Handoff may be produced by `studioflow-author`, or reused by `studioflow-investigate` when routing to execute-existing.
16
31
  If handoff includes `recorder`, treat it as source of truth and preserve explicit user recorder choice.
17
32
  If present, also consume `runtimePacing` from handoff for runtime timing env values.
18
33
 
@@ -1,6 +1,6 @@
1
1
  # Handoff Input Spec
2
2
 
3
- `studioflow-cli` accepts a runtime handoff file from `studioflow-investigate`:
3
+ `studioflow-cli` accepts a runtime handoff file from `studioflow-author` (or from `studioflow-investigate` when reusing existing artifacts):
4
4
 
5
5
  - `artifacts/studioflow-cli-handoff.json`
6
6
 
@@ -1,37 +1,15 @@
1
1
  ---
2
2
  name: studioflow-investigate
3
- description: Investigate an arbitrary web project and generate deterministic StudioFlow artifacts. Use when the user asks to discover app structure, map routes/components/actions, synthesize artifacts/flow.json from natural-language intent, or clarify open/ambiguous intent before authoring a flow.
3
+ description: Intake and route StudioFlow demo requests. Use when the user asks to run or record a demo from natural language and you must (1) clarify intent anchors, (2) decide whether existing artifacts already fit the request, and (3) route to `studioflow-author` (create/repair) or `studioflow-cli` (execute existing artifacts).
4
4
  ---
5
5
 
6
6
  # StudioFlow Investigate
7
7
 
8
- Generate deterministic demo-planning artifacts for any web app.
8
+ Resolve intent and route execution to the right downstream skill.
9
9
 
10
10
  ## Workflow
11
11
 
12
- 1. Inspect project root and identify framework, package manager, and startup command.
13
- 2. Always collect project context artifacts before intent mapping.
14
-
15
- Do this automatically in the skill workflow. Do not ask the user to run these commands manually.
16
-
17
- ```bash
18
- pnpm bootstrap -- --out artifacts/bootstrap.json
19
- pnpm discover -- --out artifacts
20
- ```
21
-
22
- Fallback if `pnpm` workspace scripts are unavailable:
23
-
24
- ```bash
25
- studioflow bootstrap --out artifacts/bootstrap.json
26
- studioflow discover --out artifacts
27
- ```
28
-
29
- 3. Review generated artifacts:
30
- - `artifacts/bootstrap.json`
31
- - `artifacts/structure-report.json`
32
- - `artifacts/navigation-graph.json`
33
-
34
- 4. Resolve intent specificity before authoring `artifacts/flow.json`.
12
+ 1. Resolve intent specificity first.
35
13
 
36
14
  Open-intent detection:
37
15
  - Treat intent as open when one or more anchors are missing:
@@ -55,54 +33,53 @@ Clarification loop:
55
33
  - If host supports structured question-card requests, emit payloads from `references/question-card-spec.md`.
56
34
  - If structured cards are not supported, ask equivalent plain-language questions.
57
35
  - Track known/missing fields using `references/clarification-state.md`.
36
+ - If anchors remain unclear after round 2, make a best-effort route decision with explicit assumptions.
58
37
 
59
- 5. Author `artifacts/flow.json` from intent + discovered structure + clarified answers.
38
+ 2. Evaluate current artifact readiness after clarification.
60
39
 
61
- Rules for authored flow:
62
- - Deterministic steps only.
63
- - Prefer stable selectors (`data-testid`).
64
- - Include clear step IDs and assertions at key transitions.
65
- - Always synthesize pacing fields (`preDelayMs`, `postDelayMs`, `mouseMoveMs`, `highlightMs`, `dwellMs`) for interaction-heavy steps to keep demos human-looking.
66
- - Model scroll risk during authoring. For below-fold or overflow-container targets, add stable preconditions (`wait_for` on section/container) before interaction steps.
67
- - Add `recorder_export` only when the user explicitly asks for export at run completion.
68
- - If clarification remains incomplete after 2 rounds, generate best-effort flow with explicit assumptions.
40
+ Check for:
41
+ - `artifacts/flow.json`
42
+ - optional `artifacts/studioflow-cli-handoff.json`
43
+ - optional `artifacts/bootstrap.json`
44
+ - optional `artifacts/structure-report.json`
45
+ - optional `artifacts/navigation-graph.json`
69
46
 
70
- 6. Validate candidate flow:
47
+ 3. Run intent-to-artifact fit evaluation using `references/artifact-fit-spec.md`.
71
48
 
72
- ```bash
73
- pnpm validate -- --flow artifacts/flow.json
74
- ```
49
+ Classify route:
50
+ - `execute-existing`: artifacts are present and intent fit is high enough to run safely.
51
+ - `patch-existing`: artifacts exist but require targeted edits.
52
+ - `create-new`: artifacts are missing or intent fit is low.
75
53
 
76
- 7. If validation fails, edit flow actions/selectors and rerun validation.
54
+ Write decision trace to:
55
+ - `artifacts/intent-fit-report.json`
77
56
 
78
- 8. Emit deterministic runtime handoff for `studioflow-cli`.
57
+ 4. Route deterministically based on classification.
79
58
 
80
- Write `artifacts/studioflow-cli-handoff.json` using `references/cli-handoff-spec.md`.
81
- - Always include `runtimePacing` in handoff, inferred from authored flow pacing and intent.
82
- - Always include `recorder` in handoff (`quicktime` or `screenstudio`), resolved from intent wording + defaults.
59
+ - For `execute-existing`:
60
+ - Invoke `studioflow-cli` immediately with existing artifacts and handoff/default runtime anchors.
61
+ - For `patch-existing` or `create-new`:
62
+ - Invoke `studioflow-author` to create/repair deterministic artifacts for this intent.
63
+ - After `studioflow-author` completes, invoke `studioflow-cli` in the same turn.
83
64
 
84
- 9. Hand off execution to `studioflow-cli` immediately.
65
+ 5. Do not stop at command suggestions when the user asked to run/record a demo.
85
66
 
86
- - If your host supports explicit skill invocation, invoke `studioflow-cli` in the same turn using the handoff payload.
87
- - If explicit skill invocation is unavailable, execute the equivalent CLI run workflow directly in the same turn.
88
- - Do not stop at "here is the command to run" when the user intent is to run/record a demo.
67
+ - If your host supports explicit skill invocation, invoke downstream skills directly.
68
+ - If explicit invocation is unavailable, execute equivalent workflows directly.
89
69
 
90
70
  ## Output Requirements
91
71
 
92
- Always produce these files for handoff to runtime execution:
93
- 1. `artifacts/bootstrap.json`
94
- 2. `artifacts/structure-report.json`
95
- 3. `artifacts/navigation-graph.json`
96
- 4. `artifacts/flow.json`
97
- 5. `artifacts/studioflow-cli-handoff.json`
72
+ Always produce:
73
+ 1. `artifacts/intent-fit-report.json`
74
+ 2. concise route decision (`execute-existing|patch-existing|create-new`)
98
75
 
99
76
  Always include a concise handoff summary in the response:
100
77
  - resolved intent anchors
78
+ - route decision and reason
101
79
  - unresolved assumptions (if any)
102
80
  - confidence (`high|medium|low`)
103
81
 
104
82
  Use references in:
105
- - `references/artifact-spec.md`
106
83
  - `references/question-card-spec.md`
107
84
  - `references/clarification-state.md`
108
- - `references/cli-handoff-spec.md`
85
+ - `references/artifact-fit-spec.md`
@@ -0,0 +1,73 @@
1
+ # Artifact Fit Spec
2
+
3
+ Use this rubric to decide whether existing artifacts satisfy the clarified demo intent.
4
+
5
+ ## Inputs
6
+
7
+ - Clarified intent anchors:
8
+ - `target_route`
9
+ - `user_goal`
10
+ - `done_assertion`
11
+ - `recorder_backend`
12
+ - optional run-feel/profile
13
+ - Existing artifacts (if present):
14
+ - `artifacts/flow.json`
15
+ - `artifacts/studioflow-cli-handoff.json`
16
+ - `artifacts/bootstrap.json`
17
+ - `artifacts/structure-report.json`
18
+ - `artifacts/navigation-graph.json`
19
+
20
+ ## Fit dimensions
21
+
22
+ Score each dimension as `pass|partial|fail`.
23
+
24
+ 1. Route coverage:
25
+ - `flow.json` steps reach the intended route/workspace.
26
+
27
+ 2. Goal coverage:
28
+ - Steps demonstrate the requested business outcome, not just generic navigation.
29
+
30
+ 3. Completion evidence:
31
+ - Assertions/screenshots prove the requested done state.
32
+
33
+ 4. Runtime anchors:
34
+ - `baseUrl`, `healthPath`, `startCommand` can be resolved from handoff/bootstrap/config.
35
+
36
+ 5. Recorder and style alignment:
37
+ - Recorder preference (`quicktime|screenstudio`) and pacing profile are preserved.
38
+
39
+ ## Route decision rules
40
+
41
+ - `execute-existing`:
42
+ - no `fail` dimensions
43
+ - at most one `partial`
44
+ - `patch-existing`:
45
+ - artifacts exist and deterministic edits are enough (selectors, assertions, pacing, minor scope drift)
46
+ - `create-new`:
47
+ - artifacts missing
48
+ - or core route/goal/done coverage is `fail`
49
+
50
+ ## Required output
51
+
52
+ Write `artifacts/intent-fit-report.json`:
53
+
54
+ ```json
55
+ {
56
+ "version": 1,
57
+ "decision": "execute-existing",
58
+ "confidence": "high",
59
+ "intentAnchors": {
60
+ "targetRoute": "/flows/crm",
61
+ "userGoal": "advance and create a CRM lead",
62
+ "doneAssertion": "Created L-300 for Aurora Systems.",
63
+ "recorder": "quicktime"
64
+ },
65
+ "dimensions": [
66
+ { "name": "route_coverage", "result": "pass", "notes": "Flow reaches /flows/crm." },
67
+ { "name": "goal_coverage", "result": "pass", "notes": "Includes lead advance and creation." }
68
+ ],
69
+ "reasons": ["Existing flow already matches clarified scope."]
70
+ }
71
+ ```
72
+
73
+ Keep notes concrete and tie them to selectors/steps whenever possible.
@@ -1,6 +1,6 @@
1
1
  # CLI Handoff Spec
2
2
 
3
- Use this artifact to hand execution from `studioflow-investigate` to `studioflow-cli`.
3
+ Use this artifact when `studioflow-investigate` routes execution with an existing flow and needs to hand to `studioflow-cli` without re-authoring.
4
4
 
5
5
  Path:
6
6