@iamu-dev/iamu 0.2.0-beta.9 → 0.3.0-beta.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.
Files changed (83) hide show
  1. package/dist/adapters/claude-plugin.d.ts +13 -0
  2. package/dist/adapters/registry.d.ts +6 -0
  3. package/dist/adapters/types.d.ts +19 -0
  4. package/dist/bin.d.ts +2 -0
  5. package/dist/bin.js +5965 -1807
  6. package/dist/build-info.d.ts +53 -0
  7. package/dist/cloud-url.d.ts +19 -0
  8. package/dist/commands/auth-http.d.ts +37 -0
  9. package/dist/commands/auth-project-choice.d.ts +74 -0
  10. package/dist/commands/auth-token-input.d.ts +21 -0
  11. package/dist/commands/auth.d.ts +84 -0
  12. package/dist/commands/browse-actions.d.ts +61 -0
  13. package/dist/commands/browse-driver.d.ts +121 -0
  14. package/dist/commands/browse.d.ts +195 -0
  15. package/dist/commands/cloud-push.d.ts +27 -0
  16. package/dist/commands/complete.d.ts +132 -0
  17. package/dist/commands/completion.d.ts +2 -0
  18. package/dist/commands/context.d.ts +81 -0
  19. package/dist/commands/credentials.d.ts +144 -0
  20. package/dist/commands/diff-filter.d.ts +11 -0
  21. package/dist/commands/doctor.d.ts +33 -0
  22. package/dist/commands/edit-entity.d.ts +8 -0
  23. package/dist/commands/evaluate.d.ts +34 -0
  24. package/dist/commands/explore-crawl.d.ts +67 -0
  25. package/dist/commands/explore.d.ts +53 -0
  26. package/dist/commands/findings.d.ts +7 -0
  27. package/dist/commands/init.d.ts +27 -0
  28. package/dist/commands/instructions-walk.d.ts +69 -0
  29. package/dist/commands/instructions.d.ts +30 -0
  30. package/dist/commands/list.d.ts +5 -0
  31. package/dist/commands/live-run-client.d.ts +127 -0
  32. package/dist/commands/match.d.ts +15 -0
  33. package/dist/commands/mcp-config.d.ts +10 -0
  34. package/dist/commands/new-entity.d.ts +34 -0
  35. package/dist/commands/new-finding.d.ts +25 -0
  36. package/dist/commands/open.d.ts +8 -0
  37. package/dist/commands/port.d.ts +17 -0
  38. package/dist/commands/preflight.d.ts +26 -0
  39. package/dist/commands/prune.d.ts +11 -0
  40. package/dist/commands/pull.d.ts +5 -0
  41. package/dist/commands/register-cloud.d.ts +5 -0
  42. package/dist/commands/register-findings.d.ts +5 -0
  43. package/dist/commands/register-project.d.ts +5 -0
  44. package/dist/commands/register-walkthrough.d.ts +5 -0
  45. package/dist/commands/register.d.ts +10 -0
  46. package/dist/commands/report.d.ts +3 -0
  47. package/dist/commands/serve.d.ts +11 -0
  48. package/dist/commands/set-entity.d.ts +73 -0
  49. package/dist/commands/skills.d.ts +34 -0
  50. package/dist/commands/start-run.d.ts +56 -0
  51. package/dist/commands/status.d.ts +3 -0
  52. package/dist/commands/step-numbering.d.ts +87 -0
  53. package/dist/commands/step.d.ts +96 -0
  54. package/dist/commands/summary.d.ts +20 -0
  55. package/dist/commands/sync.d.ts +6 -0
  56. package/dist/commands/triage.d.ts +21 -0
  57. package/dist/commands/update.d.ts +4 -0
  58. package/dist/commands/validate.d.ts +11 -0
  59. package/dist/commands/view-results.d.ts +9 -0
  60. package/dist/index.d.ts +9 -0
  61. package/dist/index.js +5894 -1782
  62. package/dist/sync-mcp/fatal.d.ts +42 -0
  63. package/dist/sync-mcp/server.d.ts +1 -0
  64. package/dist/sync-mcp/tools.d.ts +12 -0
  65. package/dist/templates/prompts/walk.md +62 -37
  66. package/dist/templates/skills/iamu-findings.md +141 -44
  67. package/dist/templates/skills/iamu-new.md +106 -60
  68. package/dist/templates/skills/iamu-propose.md +36 -25
  69. package/dist/templates/skills/iamu-run.md +303 -124
  70. package/dist/templates/skills/iamu-setup.md +256 -181
  71. package/dist/templates/skills/iamu-stage.md +164 -0
  72. package/dist/templates/skills/iamu-status.md +16 -11
  73. package/dist/templates.d.ts +10 -0
  74. package/dist/ui/journey-diff.d.ts +3 -0
  75. package/dist/ui/json.d.ts +6 -0
  76. package/dist/ui/logger.d.ts +5 -0
  77. package/dist/ui/panic.d.ts +11 -0
  78. package/dist/ui/symbols.d.ts +11 -0
  79. package/dist/ui/table.d.ts +20 -0
  80. package/dist/ui/update-check.d.ts +6 -0
  81. package/dist/worktree-state.d.ts +49 -0
  82. package/package.json +6 -6
  83. package/dist/eval/gemini-eval-cli.js +0 -976
@@ -1,21 +1,22 @@
1
1
  ---
2
2
  name: iamu-setup
3
- description: Set up a project for iamu — scaffold the iamu/ tree, capture domain context, and seed primary personas. Stops after context and initial personas; use iamu-new to draft scenarios next.
3
+ description: Use when initializing or onboarding a project to Iamu, scaffolding the iamu/ directory, configuring testability boundaries, or seeding initial personas and inaugural scenarios.
4
4
  generatedBy: __IAMU_VERSION__
5
5
  ---
6
6
 
7
- Set up a project for scenario-driven walkthroughs — all local, no cloud required. Scaffolds an `iamu/` tree under your project root, analyzes the repo to compose a project-context summary, persists that context to `iamu/context.yml`, seeds 1–2 baseline personas to the casting panel, and optionally links to Iamu cloud. Stops there. Scenario creation belongs to `iamu-new`.
7
+ Set up a project for scenario-driven walkthroughs — all local, no cloud required. Scaffolds an `iamu/` tree under your project root, analyzes the repo to compose a project-context summary, persists context to `iamu/context.yml`, seeds 1 primary persona into `iamu/personas/`, and drafts 1 inaugural scenario into `iamu/scenarios/`. Ready to run immediately with `iamu-run`.
8
8
 
9
9
  Model reminder (internal — users never type these): `capability → scenario → run → finding`. A scenario is the runnable thing — a situation narrative bound to a persona. Capabilities are optional labels that group scenarios. `iamu-new` creates scenarios; `iamu-run` executes them; `iamu-findings` reviews results.
10
10
 
11
11
  What this skill does, end to end:
12
12
 
13
13
  - **Scaffold** — `iamu/` tree on disk via `iamu init`. No login, no cloud.
14
- - **Understand** — read the repo to identify domain, primary user archetypes, and any applicable regulations (if present).
15
- - **Capture & Seed** — persist to `iamu/context.yml` and scaffold 1–2 primary personas into `iamu/personas/` (or defer if user prefers).
16
- - **Cloud (optional)** — offer to link to Iamu cloud for sharing / teams / managed runs via `iamu auth login`. User can accept, skip, or defer.
17
-
18
- This skill does NOT create capabilities, situation outlines, or scenarios. That is what `iamu-new` is for. Setup = context + casting panel seeding.
14
+ - **Understand** — read the repo automatically to detect dev server, mock fixtures, external boundaries, domain stakes, and user roles.
15
+ - **Step 1: Safety & Testability Fence** — agree on the sandbox boundaries (`iamu/testability.md`) so the autonomous browser agent never leaks data or hits real external services.
16
+ - **Step 2: Project Domain & Description** — verify domain context and project description (`iamu/context.yml`) to ground UX evaluations.
17
+ - **Step 3: Co-Design First Journey** — co-create a high-friction scenario, verify auth preconditions (`personas/`, `outlines/`, `scenarios/`), and validate.
18
+ - **Next Action** — copy-pasteable command to launch your first walkthrough.
19
+ - **Cloud (optional)** — link to Iamu Cloud if you want to share findings with your team.
19
20
 
20
21
  $ARGUMENTS
21
22
 
@@ -25,230 +26,304 @@ $ARGUMENTS
25
26
 
26
27
  Check whether `iamu/config.json` already exists:
27
28
 
28
- - **If already scaffolded (`iamu/config.json` exists):** Do not re-run `iamu init`. Introduce the step concisely and proceed directly to Step 2:
29
- > Analyzing your codebase now to understand the domain and propose primary personas.
29
+ - **If already scaffolded (`iamu/config.json` exists):** Do not re-run `iamu init`. Introduce the workflow roadmap concisely and proceed directly to Step 2:
30
+ > **Setting up Iamu.** We'll build your testing foundation together in three clear steps:
31
+ > 1. **Safety Boundary (`testability.md`)**: Ensure the autonomous browser agent is fenced to local dev and cannot trigger real-world external side effects.
32
+ > 2. **Domain Grounding (`context.yml`)**: Teach Iamu what the application does, its primary workflows, and real-world stakes.
33
+ > 3. **First Journey (`personas/` + `scenarios/`)**: Design a realistic human friction test and verify how your persona logs in.
30
34
  - **If not yet scaffolded:** Run `iamu init [project-name]` in the terminal (pass a project name if the user named one explicitly; otherwise omit). The command scaffolds `iamu/config.json`, entity subdirs, `.runs/`, `.cache/`, `.gitignore`.
31
- Introduce iamu first:
32
- > **iamu** tests your product as realistic personas and reports what works, what doesn't, and how to fix it. I'll analyze your codebase now to understand the domain and propose primary personas.
35
+ Introduce the workflow roadmap:
36
+ > **iamu** tests your product as realistic personas and reports what works, what doesn't, and how to fix it. We'll build your testing foundation together in three collaborative steps:
37
+ > 1. **Safety Boundary (`testability.md`)**: Define where the browser agent is allowed to go, and what external services must never be touched.
38
+ > 2. **Domain Grounding (`context.yml`)**: Ground Iamu in what your product actually is, its primary workflows, and key constraints.
39
+ > 3. **First Journey (`personas/` + `scenarios/`)**: Design a realistic human friction test and verify how your persona logs in.
33
40
  - **Error containing "legacy `.iamu/` layout"** → tell the user to remove the legacy directory, then re-run.
34
41
 
35
42
  ### 2. Understand the project
36
43
 
37
- Explore the codebase automatically — do NOT ask the user what files to read. Build a **substantive project description** that serves as the foundation for all downstream analysis (personas, scenarios, and walkthroughs). Read the following files when present:
38
-
39
- - `README.md`, `CLAUDE.md`, `agents.md`
40
- - Package manifests — `package.json`, `Cargo.toml`, `pyproject.toml`, `go.mod`
41
- - Routes, API schemas, navigation, components, auth/user models
42
- - `docs/`, OpenAPI / JSON / GraphQL schemas, `src/`-style source directories
43
- - `.env.example`
44
-
45
- **Quality Standard for Project Context (Knowledgeable Observer):**
46
- Write as an objective domain expert describing the business and its users, NOT marketing jargon, cookie notices, or tech stack. Do NOT hedge with "appears to be" or "seems to".
47
-
48
- The description MUST capture four substantive dimensions:
49
- 1. **What the product fundamentally IS** — core workflow, product type, and problem space.
50
- 2. **Who actually uses it and what they come here to do** — enumerate the real user journeys (e.g. reporting incidents, triaging risks, delegating actions, auditing).
51
- 3. **What makes THIS product specific** — geography, jurisdiction, regulatory mandates, or business model.
52
- 4. **Operational characteristics** — how users physically and organizationally encounter the software (e.g. deskless frontline mobile workers in high-hazard environments, strict statutory completion deadlines, immutable audit trails).
53
-
54
- *Example of target substance:*
55
- > "IA-systemet is Sweden's national work environment and safety incident management platform, utilized by thousands of Swedish enterprises to comply with statutory systematic work environment requirements (AML / AFS). It enables frontline employees to quickly log near-misses (tillbud), workplace accidents (olycksfall), and risk observations from desktop or mobile devices in the field. Core user journeys include real-time hazard reporting, line manager root-cause investigations, safety committee review, and action plan delegation with statutory compliance tracking."
56
-
57
- Synthesize the project into a cohesive, substantive narrative (1–2 paragraphs):
58
- - What the product fundamentally is, its primary domain, and who uses it.
59
- - Key user journeys and operational characteristics (e.g. mobile floor use, audit deadlines).
60
- - Market, geography, and specific compliance frameworks (only if evident).
61
-
62
- Audit testability without cluttering the domain context:
63
- Inspect `package.json` dev scripts, existing mock harnesses (MSW, seed scripts), auth route guards (`middleware.ts`, ProtectedRoute, session hooks), and page/route directories (`app/`, `src/routes/`). Use these findings to populate `iamu/testability.md`.
44
+ Explore the codebase automatically — do NOT ask the user what files to read. Extract domain and environment facts strictly from code:
45
+
46
+ 1. **Framework & Dev Server Port Detection:**
47
+ - Inspect package manifests: `package.json`, `Cargo.toml`, `pyproject.toml`, `go.mod`.
48
+ - Read framework configs to reliably extract default dev ports:
49
+ - `vite.config.*` / `svelte.config.*` → default port 5173
50
+ - `astro.config.*` → default port 4321
51
+ - `next.config.*` / Rails / Remix → default port 3000
52
+ - `wrangler.toml` / `wrangler.json` (Cloudflare Workers/Pages)
53
+ - `docker-compose.yml`
54
+ - Read `.env`, `.env.development`, `.env.local` for `PORT`, `VITE_PORT`, `NEXT_PUBLIC_APP_URL`.
55
+ - If unsure, check port reachability on common ports (3000, 5173, 8080, 4321).
56
+ 2. **Reachable Entry Route:**
57
+ - Scan page directories: `app/**/page.tsx`, `pages/**/*.tsx`, `src/routes/**/*.svelte`, React Router `routes.ts`/`App.tsx`.
58
+ - Pick a concrete static route (e.g. `/incidents/new`, `/cart`, `/checkout`), NOT an unresolved parameterized path (`/projects/:id`) unless seed fixture IDs are known.
59
+ 3. **Auth & Persona Access:**
60
+ - Inspect auth route guards (`middleware.ts`, ProtectedRoute, session hooks).
61
+ - Identify dev bypass (`MOCK_AUTH`), test accounts/fixtures, persona switcher, or public access.
62
+ 4. **Project Description & Domain:**
63
+ - Read `README.md`, `CLAUDE.md`, docs, OpenAPI / JSON schemas, route structures.
64
+ - Formulate a clear, concise description of what the software does, its primary workflows, and who uses it.
65
+ - **STRICT REGULATION RULE:** Never infer regulations from industry keywords. Only include `governed_by` if the codebase explicitly references specific legislation or statutory standards. Non-regulated software is the default — omit `governed_by` entirely if absent.
66
+ 5. **Safety & Untestable Boundaries:**
67
+ - Scan for external API calls, third-party integrations (Stripe, Twilio, external government submission portals, live OAuth/Keycloak SSO).
68
+ - Identify local mock fixtures (`msw`, seed SQL scripts, mock services).
64
69
 
65
70
  **If there is no code (greenfield, design phase, or test sandbox):** do NOT interrogate the user with a multi-part survey or ask for dev auth plumbing. Ask for a single entry point:
66
- > No local codebase detected. To seed context, provide one of:
67
- > - A target URL (staging, production, or docs — e.g., `https://app.example.com`)
68
- > - A one-sentence description of what this product does
69
- > - Or type `"sandbox"` to seed a pre-configured B2B SaaS demo
71
+ No local codebase detected. To seed context, provide one of:
72
+ • A target URL (staging, production, or docs — e.g., `https://app.example.com`)
73
+ • A one-sentence description of what this product does
74
+ • Or type `"sandbox"` to seed a pre-configured B2B SaaS demo
70
75
 
71
- **Autonomous Enrichment:**
72
- - **URL provided:** Fetch or search public marketing/docs for that site. Automatically extract the substantive narrative, core user journeys, and key actors. If industry regulations are obvious (e.g., healthcare/HIPAA, Swedish workplace safety/AML), include them in the narrative.
73
- - **One-sentence summary provided:** Immediately expand into a full substantive narrative using domain knowledge.
74
- - **"sandbox" provided:** Seed a standard B2B SaaS narrative with Admin and End-User roles.
76
+ ---
75
77
 
76
- **Present ONLY the narrative description for user confirmation (Do NOT include metadata bullets or personas):**
78
+ ### 3. Step 1/3: Establish the Safety Fence (`iamu/testability.md`)
77
79
 
78
- ```markdown
79
- ### 📋 Discovered Project Context
80
+ Present the detected environment and safety fence. Explain clearly *why* this boundary is required before any autonomous agent runs. Do NOT wrap in markdown code fences (` ``` `) when presenting to the user:
80
81
 
81
- <1–2 cohesive paragraphs written as a knowledgeable observer: what the product fundamentally is, who actually uses it, key user journeys, operational reality (e.g. mobile floor use, audit deadlines), and regulatory/market context. No marketing fluff, no hedging, no tech stack descriptions, and no bullet points.>
82
+ ```text
83
+ Step 1/3: Safety Fence & Environment Boundary
84
+ Why this matters: Iamu drives a real headless browser with full agency. This boundary guarantees the agent stays confined to your local environment and never touches external services or triggers real-world side effects.
82
85
 
83
- ---
84
-
85
- **Next step:**
86
- Reply **"yes"** to save this context to `iamu/context.yml`, or tell me what to adjust.
86
+ Detected Environment:
87
+ Target URL: <target_url, e.g. http://localhost:5173>
88
+ Dev Command: <dev_command, e.g. ./dev or pnpm dev>
89
+ Safe Fixtures: <detected seed scripts or mock handlers, e.g. organization_realistic_seed.sql, MSW>
90
+ DO NOT WALK: <detected external services, e.g. Arbetsmiljöverket external submission portal (anmalarbetsskada.se), Real SMS/Email gateways, Real OIDC Keycloak>
87
91
  ```
88
92
 
89
- Wait for the user to confirm or correct before writing. The user only needs to verify the narrative description and choose whether to accept or edit.
90
-
91
- ### 3. Capture domain context and seed personas (Two-Phase Confirmation)
92
-
93
- #### Phase A: Persist Context
94
- Once the user confirms the narrative description:
95
- 1. Derive the structured frontmatter fields (`domain`, `actors`, `jurisdiction`, `governed_by`) from the confirmed text, and write `iamu/context.yml` with your file-editing tool. Put structured fields in frontmatter and the substantive narrative in the markdown body below the `---`:
96
-
97
- ```yaml
98
- ---
99
- schema_version: 1
100
- domain: workplace safety management
101
- # jurisdiction: Sweden / EU # optional
102
- # governed_by: # strictly optional - omit if not regulated
103
- # - name: AFS 2023:2
104
- # authority_level: regulation
105
- actors:
106
- - name: Store Admin
107
- role: Manages catalog, inventory, and order fulfillment
108
- - name: First-Time Buyer
109
- role: Explores products, adds to cart, and checks out
110
- access: >-
111
- No login in dev. In the page, set localStorage "dev_persona" to the
112
- persona's access value and reload.
113
- ---
114
-
115
- <The substantive 1–2 paragraph project description and core user journeys>
116
- ```
93
+ **Interactive Decision Gate:**
94
+ Prompt the user to verify the safety boundary:
95
+ - If interactive user-prompt tools exist (`ask_question`, `ask_followup_question`), invoke it:
96
+ - Question: "Confirm safety fence and dev environment?"
97
+ - Options:
98
+ 1. "[Recommended] Safety boundaries look safe — save fence and proceed"
99
+ 2. "Adjust boundaries (add forbidden external URLs, change dev command or port)"
100
+ 3. "Skip safety fence for now"
101
+ - Otherwise (text-only/CLI):
102
+
103
+ ```text
104
+ Confirm safety fence and dev environment?
105
+ 1. [Recommended] Safety boundaries look safe — save fence and proceed
106
+ 2. Adjust boundaries (add forbidden external URLs, change dev command or port)
107
+ 3. Skip safety fence for now
108
+
109
+ Reply '1' to accept [default], select 2-3, or tell me what to adjust:
110
+ ```
117
111
 
118
- Rules:
119
- - `domain` — one line. Mandatory.
120
- - Body markdown (below `---`) — substantive description and user journeys. Downstream skills read this as extended grounding.
121
- - `jurisdiction` — optional. Only if evident or relevant.
122
- - `governed_by[]` — strictly optional. Order by authority. Omit entirely if no regulations apply.
123
- - `actors[]` — all identified roles and their responsibilities.
124
- - `access` — optional. Only what the docs actually say; leave it out rather than guess.
125
- - Do NOT add `industry` or `architecture` — these don't affect walkthroughs.
112
+ **Action on confirmation (Option 1):**
113
+ Persist the safety fence using `iamu set testability` (never invoke host file creation or edit tools):
114
+ ```bash
115
+ iamu set testability \
116
+ --target "<target_url>" \
117
+ --dev-command "<dev_command>" \
118
+ --auth-strategy "<dev_switcher | interactive | test_accounts | public>" \
119
+ [--access "<access mechanism>"] \
120
+ [--harnesses "<detected harness 1>, <detected harness 2>"] \
121
+ [--untestable-boundaries "<external dependency 1>, <external dependency 2>"] \
122
+ --body "# Project Testability & Environment
123
+
124
+ ## Target & Run Instructions
125
+ - Command: <dev command>
126
+ - Base URL: <target_url>
127
+
128
+ ## Auth & Access Boundary
129
+ - <How a walker becomes this persona in dev or test mode>
130
+
131
+ ## Reachable Surfaces
132
+ - <List discovered routes/entry points>
133
+
134
+ ## Mocks & Data Fixtures
135
+ - <List existing MSW mock files, DB seed scripts, or fixture directories>
136
+
137
+ ## Untestable Boundaries (Do Not Walk)
138
+ - <List un-mocked external dependencies and external submission portals>" \
139
+ --json
140
+ ```
126
141
 
127
- 2. Persist the technical testability and execution contract to `iamu/testability.md`:
128
- Scaffold the target environment, auth mechanisms, discovered surfaces, mock harnesses, and untestable boundaries discovered from the code:
142
+ ---
129
143
 
130
- ```markdown
131
- ---
132
- target_url: http://localhost:3000
133
- dev_command: <detected dev script, e.g. pnpm dev or pnpm dev:mock>
134
- auth_strategy: <dev_switcher | interactive | test_accounts | public>
135
- harnesses:
136
- - <detected harnesses, e.g. msw, seed>
137
- ---
144
+ ### 4. Step 2/3: Ground Domain Context & Project Description (`iamu/context.yml`)
138
145
 
139
- # Project Testability & Environment
146
+ Explain the purpose of project context: traditional tests only assert button clicks; Iamu evaluates user confusion, workflow friction, and whether a real person can succeed under real-world constraints.
140
147
 
141
- ## Target & Run Instructions
142
- - Command: <dev command>
143
- - Base URL: <target_url>
148
+ Present the discovered domain and project description. Do NOT introduce or ask the user to approve personas or roles at this stage — personas are cast later when designing specific test journeys. Do NOT wrap in markdown code fences (` ``` `) when presenting to the user:
144
149
 
145
- ## Auth & Access Boundary
146
- - <How a walker becomes this persona in dev or test mode>
150
+ ```text
151
+ Step 2/3: Project Domain & Description
152
+ Why this matters: Grounds the AI evaluator in your domain's real stakes and vocabulary so it can spot human confusion rather than just syntax errors.
147
153
 
148
- ## Reachable Surfaces
149
- - <List discovered routes/entry points, e.g. /login, /dashboard, /incidents>
154
+ Discovered Domain:
155
+ Domain: <domain name, e.g. Workplace safety management (EHS)>
156
+ Industry: <industry, e.g. Manufacturing / Industrial>
157
+ Jurisdiction: <jurisdiction or omit if standard web app>
158
+ Governed By: <statutory regulations or standards, or omit if unregulated>
150
159
 
151
- ## Mocks & Data Fixtures
152
- - <List existing MSW mock files, DB seed scripts, or fixture directories>
160
+ Project Description:
161
+ <1 cohesive paragraph: what the software fundamentally does, its primary user workflows, and the real-world conditions under which it is used. No marketing buzzwords, no hedging, and no tech stack trivia.>
162
+ ```
153
163
 
154
- ## Untestable Boundaries (Do Not Walk)
155
- - <List un-mocked external dependencies, e.g. live Stripe charges, SMS 2FA, external SSO>
156
- ```
164
+ **Interactive Decision Gate:**
165
+ Prompt the user to verify the project description:
166
+ - If interactive user-prompt tools exist (`ask_question`, `ask_followup_question`), invoke it:
167
+ - Question: "Confirm project domain & description?"
168
+ - Options:
169
+ 1. "[Recommended] Project description is accurate — proceed to design first test"
170
+ 2. "Save project description only (skip scenario creation for now)"
171
+ 3. "Adjust domain or description"
172
+ - Otherwise (text-only/CLI):
173
+
174
+ ```text
175
+ Confirm project domain & description?
176
+ 1. [Recommended] Project description is accurate — proceed to design first test
177
+ 2. Save project description only (skip scenario creation for now)
178
+ 3. Adjust domain or description
179
+
180
+ Reply '1' to accept [default], select 2-3, or tell me what to adjust:
181
+ ```
157
182
 
158
- Keep `context.yml` strictly about domain reality (which the Walker subagent reads), and `testability.md` strictly about developer testability and execution boundaries (which orchestrator skills read).
183
+ **Action on confirmation (Option 1):**
184
+ Persist the domain context using `iamu set context` (never invoke host file creation or edit tools). Put structured fields in frontmatter and the project description in the markdown body below the `---` via `--body`:
185
+ ```bash
186
+ iamu set context \
187
+ --domain "<domain>" \
188
+ [--industry "<industry>"] \
189
+ --body "<The substantive 1–2 paragraph project description and core user workflows>" \
190
+ --json
191
+ ```
159
192
 
160
- #### Phase B: Persona Casting (Opt-In & Separate Confirmation)
161
- Immediately after saving `iamu/context.yml`, ask the user if they want to seed baseline personas:
193
+ *If user chooses Option 2 (Save context only):* run `iamu set context ...` as above, and exit cleanly:
194
+ "✓ Project context initialized. When you're ready to create your first test journey, run `/iamu:new`."
162
195
 
163
- > Context saved to `iamu/context.yml`.
164
- >
165
- > Would you like to seed 1–2 baseline personas to your casting panel now?
166
- > Reply **"yes"** to propose personas, or **"skip"** to create scenarios directly via `iamu-new`.
196
+ ---
167
197
 
168
- **If the user chooses "yes":**
169
- Propose 1–2 primary personas grounded in the confirmed actors and operational characteristics:
198
+ ### 5. Step 3/3: Co-Design Your First Test Journey (`personas/`, `outlines/`, `scenarios/`)
170
199
 
171
- ```markdown
172
- ### 🎭 Proposed Primary Personas
200
+ Explain the journey model: an Iamu test binds a **Persona** (with habits, pressures, and impatience) to a **Situation** (a realistic high-stakes problem) with an **Evaluation Checkpoint** (a concrete binary question for the AI judge).
173
201
 
174
- #### 1. <Name> — *<Role / Title>*
175
- - **Context & Usage:** <Where and how they use the app (e.g. mobile on the floor vs. desktop in office)>
176
- - **Disposition:** <Patience level, technical confidence, key motivations>
177
- - **Friction Triggers:** <Specific interactions that cause friction, drop-off, or failure>
202
+ Present the proposed test journey, including explicit **Auth Precondition Verification**. Do NOT wrap in markdown code fences (` ``` `) when presenting to the user:
178
203
 
179
- #### 2. <Name> — *<Role / Title>*
180
- - **Context & Usage:** <Where and how they use the app>
181
- - **Disposition:** <Patience level, technical confidence, key motivations>
182
- - **Friction Triggers:** <Specific interactions that cause friction, drop-off, or failure>
204
+ ```text
205
+ Step 3/3: Co-Design Your First Test Journey
206
+ Why this matters: Validates whether a real human with specific operational pressures can complete a critical task without getting blocked or frustrated.
183
207
 
184
- ---
208
+ Baseline Test Proposal (WYSIWGW Spec-Sheet):
209
+ Capability: <Capability Name> (<What staff can do in this area>)
210
+ Persona: <Name> (<Role / Title>)
211
+ • Reality: <Working context, physical habits, tenure, pressures>
212
+ • Friction: <Diagnostic friction, skepticism, bounce trigger>
213
+ Situation: <Outline Title>
214
+ • Tension: <Core problem-space tension in X vs Y format — no UI button names>
215
+ • Evaluation: <Concrete binary yes/partial/no question for evaluator>
216
+ Walk Surface: Entry: `<entry_path>` | Target: `<target_url>`
217
+ Auth Precondition: <Detected auth mechanism, e.g. "Dev persona switcher (localStorage.sf_dev_persona = 'anna')" or "Public">
218
+ Walker Brief: "<2–3 sentence first-person test brief that will be written verbatim to disk. States immediate intent and constraints before opening tool. Zero UI terminology.>"
219
+ ```
185
220
 
186
- **Next step:**
187
- Reply **"yes"** to scaffold these personas into `iamu/personas/`, or tell me what to adjust.
221
+ **Interactive Decision Gate:**
222
+ Prompt the user to verify the scenario and its auth precondition:
223
+ - If interactive user-prompt tools exist (`ask_question`, `ask_followup_question`), invoke it:
224
+ - Question: "Scaffold this baseline journey?"
225
+ - Options:
226
+ 1. "[Recommended] Scaffold journey with <detected auth mechanism>"
227
+ 2. "Use interactive human login handshake (pause browser for live login)"
228
+ 3. "Switch role / design a different scenario (write-in)"
229
+ 4. "Skip scenario for now"
230
+ - Otherwise (text-only/CLI):
231
+
232
+ ```text
233
+ Scaffold this baseline journey?
234
+ 1. [Recommended] Scaffold journey with <detected auth mechanism>
235
+ 2. Use interactive human login handshake (pause browser for live login)
236
+ 3. Switch role / design a different scenario
237
+ 4. Skip scenario for now
238
+
239
+ Reply '1' to accept [default], select 2-4, or tell me what to adjust:
188
240
  ```
189
241
 
190
- Wait for the user to confirm or adjust. Once confirmed:
191
- 1. Scaffold personas using the CLI:
242
+ **Action on confirmation (Option 1 or Option 2):**
243
+ 1. **Scaffold Primary Capability** (if not already existing):
244
+ ```bash
245
+ iamu new capability --name "<Capability Name>" --description "<What staff can do in this area>" --json
246
+ ```
247
+ 2. **Scaffold Situation Outline**:
248
+ ```bash
249
+ iamu new outline --name "<Outline Title>" --capability "<capability-slug>" --tension "<Core Tension>" --human-test "<Concrete yes/partial/no evaluation question>" --narrative "<2-3 sentence problem-space narrative without UI terms>" --json
250
+ ```
251
+ 3. **Scaffold Persona**:
192
252
  ```bash
193
253
  iamu new persona --name "<Name>" --role "<Role>" --disposition "<Disposition>" --body "<2-4 sentence narrative detailing technical habits, patience level, and specific friction triggers>" [--access "<account-or-role>"] --json
194
254
  ```
195
- 2. Validate once:
255
+ 4. **Scaffold Bound Scenario**:
256
+ ```bash
257
+ iamu new scenario --name "<persona-slug>--<outline-slug>" --outline "<outline-slug>" --persona "<persona-slug>" --entry "<entry_path>" --body "<Persona's first-person test brief describing what they intend to achieve>" --json
258
+ ```
259
+ 5. **Validate all entities**:
196
260
  ```bash
197
261
  iamu validate --all
198
262
  ```
199
- 3. Confirm: "Context saved and personas seeded in iamu/personas/. Run `iamu-new` to draft your first scenario."
200
-
201
- **If the user chooses "skip":**
202
- Confirm: "Context saved. Run `iamu-new` to draft your first scenario."
203
263
 
204
- ### 4. Offer cloud link (optional)
205
-
206
- Check the current state first:
264
+ ---
207
265
 
208
- ```bash
209
- iamu auth status --json
266
+ ### 6. Completion & First Walkthrough Handoff
267
+
268
+ Present the completion handoff cleanly.
269
+
270
+ **Formatting & Output Rules:**
271
+ - Do NOT output markdown header hashes (`#`, `##`, `###`) in the terminal handoff. Use bold (`**Next Step:**`) or plain text.
272
+ - Do NOT output a redundant bullet list of "Generated entities:" after the file tree. The visual tree already displays the files.
273
+ - Check `iamu/config.json`:
274
+ - **If `cloud_linked: true`:** Output `• iamu sync Sync completed runs and findings to Iamu Cloud`. Do NOT recommend `iamu auth login`.
275
+ - **If `cloud_linked: false`:** Output `• iamu auth login Connect to Iamu Cloud to share run reports with your team (optional)`.
276
+
277
+ Render the output:
278
+
279
+ ```text
280
+ ✓ Scaffolding complete:
281
+
282
+ iamu/
283
+ ├── testability.md [safety fence active: <target_url>]
284
+ ├── context.yml [domain: <domain>]
285
+ ├── personas/
286
+ │ └── <persona-slug>.md
287
+ ├── outlines/
288
+ │ └── <outline-slug>.md
289
+ └── scenarios/
290
+ └── <persona-slug>--<outline-slug>.md
291
+
292
+ Next step:
293
+ Ensure your dev server is running on <target_url>, then trigger the walkthrough in your agent:
294
+
295
+ iamu-run <persona-slug>--<outline-slug>
296
+
297
+ Other commands when you're ready:
298
+ • iamu-new Draft a scenario for a different product flow
299
+ • iamu-propose Brainstorm high-risk workflows and blind spots
300
+ • iamu doctor Diagnose test environment and target health
301
+ <If cloud_linked: true>
302
+ • iamu sync Sync completed runs and findings to Iamu Cloud
303
+ <If cloud_linked: false>
304
+ • iamu auth login Connect to Iamu Cloud to share run reports with your team (optional)
210
305
  ```
211
306
 
212
- - **`cloud_linked: true`, `authenticated: true`** → already linked. Say so in one line with the dashboard link from `iamu open --print` and skip the offer.
213
- - **`cloud_linked: true`, `authenticated: false`** → the project is linked but this machine has no credentials, so nothing will push. Offer `iamu auth login`; it restores credentials for the same project without asking which one.
214
- - **`cloud_linked: false`** → ask once:
215
-
216
- > Want to link this project to Iamu Cloud? Every walkthrough then gets a shareable report link (screenshots and step replay), your team can triage findings together, and teammates can queue requests for you. Everything keeps working locally; `iamu auth disconnect` unlinks.
217
-
218
- Three outcomes:
307
+ ### 7. Cloud link (optional)
219
308
 
220
- - **Yes** → link it (below).
221
- - **Skip** → local-only project stays local-only. User can connect later by re-running `iamu-setup` or running `iamu auth login` directly.
222
- - **Later** → same as skip. No state change.
223
-
224
- **Linking:**
309
+ Cloud linking is optional and non-blocking. It is recommended after executing your first walkthrough so you have run reports and findings to share.
225
310
 
311
+ If the project is not yet linked and the user explicitly asks to link during setup:
226
312
  1. Tell the user: "Opening browser for Iamu Cloud login..." then run `iamu auth login`. Allow the command at least 150 seconds for the user to complete sign-in in their browser. If your shell cannot wait that long, or runs where no browser can open (remote or container session), ask the user to run `iamu auth login` in their own terminal and tell you when it is done.
227
- 2. **Never pick the cloud project for the user.** In a non-interactive shell with existing cloud projects, login stops after sign-in and lists them as `iamu auth login --project <id>` lines plus `--project new`. Show that list, ask which project this repository belongs to, then re-run with their choice — the stored sign-in is reused, no second browser trip.
228
- 3. On success the output ends with `Dashboard: <url>` and, when an agent host was detected, `iamu-sync MCP server registered`. Relay both: the dashboard link, and that restarting the agent session loads the team tools (work requests, teammate-change alerts).
229
-
230
- If login times out or fails (cloud unreachable, sign-in timed out, or network error):
231
- - Explain clearly what happened: "Cloud linking could not be completed (<echo specific reason from command output>)."
232
- - Reassure the user: "Your local project setup is 100% complete and fully functional. Personas, scenarios, outlines, and walkthroughs run locally without cloud."
233
- - Provide the next step for linking: "You can link to Iamu Cloud anytime later by running `iamu auth login` in your terminal."
234
- - Point to the next creative action: "Next: run `iamu-new` to draft your first scenario."
313
+ 2. In a non-interactive shell with existing cloud projects, login stops after sign-in and lists them as `iamu auth login --project <id>` lines plus `--project new`. Show that list, ask which project this repository belongs to, then re-run with their choice.
314
+ 3. On success the output ends with `Dashboard: <url>` and registered MCP server.
235
315
 
236
- All three outcomes leave a usable local setup. Cloud is strictly additive.
237
-
238
- ### 5. How to use iamu from here
239
-
240
- Close with one line pointing at the next step:
241
-
242
- ```
243
- Setup complete. Next: run iamu-new to draft your first scenario.
244
- ```
316
+ If login times out or fails:
317
+ - "Your local project setup is 100% complete and fully functional. Personas, scenarios, outlines, and walkthroughs run locally without cloud."
318
+ - Point to: `iamu-run <persona-slug>--<outline-slug>`.
245
319
 
246
320
  ## Guidelines
247
321
 
248
- - **Plumbing and casting panel seeding.** This skill scaffolds configuration and seeds 1–2 baseline personas. It does not draft situation outlines or scenarios — that belongs to `iamu-new`.
322
+ - **Baseline is runnable immediately.** Setup scaffolds configuration, 1 primary persona, 1 outline, and 1 bound scenario. The project graduates from setup in a 100% runnable state.
323
+ - **Clean terminal formatting.** Do not wrap agent briefings in markdown code fences (` ``` `). Use fixed column alignment for attributes and clean tree diagrams for generated files.
249
324
  - **Non-regulated software is the default.** Do not invent or force regulations (`governed_by`) on apps, developer tools, or consumer software. If the codebase has no compliance documentation, omit `governed_by` entirely.
250
325
  - **Explore automatically.** Read the codebase before asking the user anything. The user should only need to confirm or correct, not describe their own project from scratch.
251
- - **Context on disk is load-bearing.** Once step 3 writes `iamu/context.yml`, every downstream skill (`iamu-new`, `iamu-run`) auto-loads it. No need to pass `project_context` by hand.
252
- - **Handle re-runs gracefully.** An already-scaffolded project is a no-op on scaffold, a refresh on context/personas (if the user opts in), and a re-prompt on cloud link.
253
- - **Code-referenced vs inferred.** When drafting context in step 2, be explicit about which claims you read in the codebase vs which you inferred.
254
- - **Handle errors gracefully.** Unreachable file → note it, move on. Unreachable cloud (step 4) → report and let the user retry or defer.
326
+ - **Context on disk is load-bearing.** Once `iamu set context` writes `iamu/context.yml`, every downstream skill (`iamu-new`, `iamu-run`) auto-loads it.
327
+ - **Never invoke host Edit or Write tools.** Always scaffold or modify configuration and entities via `iamu set` and `iamu new` shell commands. Host tool edits trigger modal confirmation tripwires for the user.
328
+ - **Handle re-runs gracefully.** An already-scaffolded project is a no-op on scaffold, a refresh on context/personas/scenarios (if the user opts in), and a re-prompt on cloud link.
329
+ - **Handle errors gracefully.** Unreachable file → note it, move on. Unreachable cloud → report and let the user retry or defer.