@iamu-dev/iamu 0.2.0-beta.1 → 0.2.0-beta.11

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.
@@ -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: Set up a project for iamu — scaffold the iamu/ tree, capture domain context, seed primary persona, and draft inaugural scenario. Ready to run immediately via iamu-run.
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: Domain Reality & Role Pool** — verify domain context and candidate roles (`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
 
@@ -23,170 +24,313 @@ $ARGUMENTS
23
24
 
24
25
  ### 1. Scaffold the iamu/ tree
25
26
 
26
- Run `iamu init` in the terminal. Pass a project name when the user names one explicitly; otherwise the tool derives it from the directory basename.
27
+ Check whether `iamu/config.json` already exists:
28
+
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 real stakes, and candidate roles.
33
+ > 3. **First Journey (`personas/` + `scenarios/`)**: Design a realistic human friction test and verify how your persona logs in.
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`.
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 operational reality, and key user roles.
39
+ > 3. **First Journey (`personas/` + `scenarios/`)**: Design a realistic human friction test and verify how your persona logs in.
40
+ - **Error containing "legacy `.iamu/` layout"** → tell the user to remove the legacy directory, then re-run.
41
+
42
+ ### 2. Understand the project
43
+
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. **Domain Narrative & Candidate Roles:**
63
+ - Read `README.md`, `CLAUDE.md`, docs, OpenAPI / JSON schemas, user models.
64
+ - Extract candidate roles from real user models in code.
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).
69
+
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:
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
75
+
76
+ ---
77
+
78
+ ### 3. Step 1/3: Establish the Safety Fence (`iamu/testability.md`)
79
+
80
+ Present the detected environment and safety fence. Explain clearly *why* this boundary is required before any autonomous agent runs:
27
81
 
82
+ ```markdown
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.
85
+
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>
28
91
  ```
29
- iamu init [project-name]
92
+
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
+ Press Enter to accept [1], select 2, or tell me what to adjust:
30
110
  ```
31
111
 
32
- The command scaffolds `iamu/config.json`, entity subdirs, `.runs/`, `.cache/`, `.gitignore`.
112
+ **Action on confirmation (Option 1):**
113
+ Write `iamu/testability.md`:
114
+ ```markdown
115
+ ---
116
+ target_url: <target_url>
117
+ dev_command: <dev_command>
118
+ auth_strategy: <dev_switcher | interactive | test_accounts | public>
119
+ harnesses:
120
+ - <detected harnesses>
121
+ ---
33
122
 
34
- - If `iamu/` was already present, existing files are not overwritten. Treat as success and continue.
35
- - Error containing "legacy `.iamu/` layout" → tell the user to remove the legacy directory, then re-run.
123
+ # Project Testability & Environment
36
124
 
37
- On fresh scaffold, introduce iamu first:
125
+ ## Target & Run Instructions
126
+ - Command: <dev command>
127
+ - Base URL: <target_url>
38
128
 
39
- > **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.
129
+ ## Auth & Access Boundary
130
+ - <How a walker becomes this persona in dev or test mode>
40
131
 
41
- On re-run (already scaffolded), skip the intro — the user knows what iamu is.
132
+ ## Reachable Surfaces
133
+ - <List discovered routes/entry points>
42
134
 
43
- ### 2. Understand the project
135
+ ## Mocks & Data Fixtures
136
+ - <List existing MSW mock files, DB seed scripts, or fixture directories>
44
137
 
45
- Explore the codebase automatically — do NOT ask the user what files to read. Build a **project-context summary** (3–6 sentences) the downstream skills will use as grounding. Read the following files when present:
138
+ ## Untestable Boundaries (Do Not Walk)
139
+ - <List un-mocked external dependencies and external submission portals>
140
+ ```
46
141
 
47
- - `README.md`, `CLAUDE.md`, `agents.md`
48
- - Package manifests — `package.json`, `Cargo.toml`, `pyproject.toml`, `go.mod`
49
- - Routes, API schemas, navigation, components, auth/user models
50
- - `docs/`, OpenAPI / JSON / GraphQL schemas, `src/`-style source directories
51
- - `.env.example`
142
+ ---
52
143
 
53
- Extract these key dimensions:
144
+ ### 4. Step 2/3: Ground Domain Reality & Role Candidates (`iamu/context.yml`)
54
145
 
55
- 1. **Domain** — what does this product do, in one phrase (mandatory).
56
- 2. **Jurisdiction** — country / region (optional — only include if evident from codebase/locale/terms or if legal frameworks apply).
57
- 3. **Regulations (`governed_by`)** — specific compliance frameworks (AFS 2023:2, GDPR, HIPAA, ISO 27001, etc.). **Strictly optional:** only extract if the repo explicitly references legal or compliance standards. Most software is not in a regulated domain; do NOT invent or guess regulations for standard SaaS/apps.
58
- 4. **Primary Personas** — determine the 1–2 most important user archetypes that stress-test this product (e.g. End User / Consumer vs. Admin / Operator, or First-Timer vs. Power User). Propose:
59
- - Name and Role
60
- - Disposition / perspective (patience level, tech literacy, primary friction triggers)
146
+ Explain the purpose of domain grounding: traditional tests only assert button clicks; Iamu evaluates user confusion, workflow friction, and whether a real person can succeed under operational pressure.
61
147
 
62
- Also collect silently (write to `context.yml` but do NOT present for confirmation):
63
- - **Actors** — all identified roles and their responsibilities.
64
- - **Glossary** — domain-specific terms (helps persona language fidelity).
65
- - **Access** — if the project documents how to switch user or role in a dev or test environment (a persona switcher, seeded accounts, a storage key), record that mechanism as `access`. It is what lets a walkthrough run as the persona instead of as whoever happens to be signed in. Never record passwords or tokens — name where they live.
148
+ Present the discovered domain reality and candidate roles:
66
149
 
67
- Do NOT collect architecture (agent reads the codebase directly — tech stack doesn't affect walkthroughs).
150
+ ```markdown
151
+ Step 2/3: Product Domain & Candidate Roles
152
+ Why this matters: Grounds the AI evaluator in your domain's real operational stakes, vocabulary, and regulations so it can spot human confusion rather than just syntax errors.
68
153
 
69
- **If there is no code (greenfield, design phase):** ask the user: what does this project do, who are the users, what domain, and are there any specific regulations?
154
+ Discovered Domain Context:
155
+ Domain: <domain name, e.g. Workplace safety management (EHS / SAM)>
156
+ Regulatory Scope: <Jurisdiction or "Standard Web App / Unregulated">
157
+ Candidate Roles: <Role 1>, <Role 2>, <Role 3>
158
+ *(Open casting panel — your team can create unlimited personas anytime via /iamu:new)*
70
159
 
71
- **Present a short proposal for confirmation:**
160
+ <1 cohesive paragraph: what the product fundamentally is, who actually uses it, and its core operational reality. No marketing fluff, no hedging, and no tech stack trivia.>
161
+ ```
72
162
 
163
+ **Interactive Decision Gate:**
164
+ Prompt the user to verify the domain grounding:
165
+ - If interactive user-prompt tools exist (`ask_question`, `ask_followup_question`), invoke it:
166
+ - Question: "Confirm domain grounding and role pool?"
167
+ - Options:
168
+ 1. "[Recommended] Domain grounding is accurate — proceed to design first test"
169
+ 2. "Save domain context only (skip scenario creation for now)"
170
+ 3. "Adjust domain narrative or role pool"
171
+ - Otherwise (text-only/CLI):
172
+
173
+ ```text
174
+ Confirm domain grounding and role pool?
175
+ 1. [Recommended] Domain grounding is accurate — proceed to design first test
176
+ 2. Save domain context only (skip scenario creation for now)
177
+ 3. Adjust domain narrative or role pool
178
+
179
+ Press Enter to accept [1], select 2, or tell me what to adjust:
73
180
  ```
74
- Your project: <domain> (<jurisdiction if known>)
75
- [Regulations: <reg1>, <reg2>] <-- omit line entirely if none
76
181
 
77
- Proposed primary personas:
78
- 1. <Name> (<Role>) — <Key disposition & perspective>
79
- 2. <Name> (<Role>) — <Key disposition & perspective>
182
+ **Action on confirmation (Option 1):**
183
+ Write `iamu/context.yml`. Put structured fields in frontmatter and the substantive narrative in the markdown body below the `---`:
184
+ ```yaml
185
+ ---
186
+ schema_version: 1
187
+ domain: <domain>
188
+ # jurisdiction: <jurisdiction> # optional
189
+ # governed_by: # strictly optional - omit if not regulated
190
+ # - name: <statutory regulation>
191
+ # authority_level: regulation
192
+ actors:
193
+ - name: <Role 1>
194
+ role: <Responsibilities>
195
+ - name: <Role 2>
196
+ role: <Responsibilities>
197
+ ---
80
198
 
81
- Confirm context & scaffold these personas? (yes / edit / suggest-others / skip-personas)
199
+ <The substantive 1–2 paragraph project description and core user journeys>
82
200
  ```
83
201
 
84
- Wait for the user to confirm or correct before writing. The user only needs to verify domain and choose whether to accept, edit, suggest alternative personas, or defer persona creation.
85
-
86
- ### 3. Capture domain context and scaffold personas
87
-
88
- Persist the step-2 summary as structured fields so every scenario draft and walkthrough loads the same grounding. Downstream skills auto-read this file.
89
-
90
- 1. Check existing state by reading `iamu/context.yml` directly.
91
-
92
- 2. **Branch on what you find:**
93
-
94
- - **Empty / not present** → synthesize structured fields from step 2 and write `iamu/context.yml` with your file-editing tool (not a shell heredoc — it avoids permission prompts).
95
- - **Present but thin** (missing domain) → show what's missing and offer to fill it. User picks **refine** or **replace**.
96
- - **Present and complete** (domain set) → show summary and ask "Use as-is, refine, or replace?" Default is **skip**.
97
-
98
- 3. **Write `iamu/context.yml`**:
99
-
100
- ```yaml
101
- ---
102
- schema_version: 1
103
- domain: e-commerce storefront
104
- # jurisdiction: EU / US # optional
105
- # governed_by: # strictly optional - omit if not regulated
106
- # - name: GDPR
107
- # authority_level: regulation
108
- actors:
109
- - name: Store Admin
110
- role: Manages catalog, inventory, and order fulfillment
111
- - name: First-Time Buyer
112
- role: Explores products, adds to cart, and checks out
113
- glossary:
114
- - term: SKU
115
- definition: Stock Keeping Unit
116
- access: >-
117
- No login in dev. In the page, set localStorage "dev_persona" to the
118
- persona's access value and reload.
119
- ---
120
- ```
121
-
122
- Rules:
123
- - `domain` — one line. Mandatory.
124
- - `jurisdiction` — optional. Only if evident or relevant.
125
- - `governed_by[]` — strictly optional. Order by authority (legislation > regulation > standard > company_policy > guideline > informational). Specific names, not categories. Omit entirely if no regulations apply.
126
- - `actors[]` — all identified roles and their responsibilities.
127
- - `glossary[]` — domain terms only. Thin is better than padded with generic terms.
128
- - `access` — optional. Only what the docs actually say; leave it out rather than guess. `iamu-run` fills it in on the first walk if it is missing.
129
- - Do NOT add `industry` or `architecture` — these don't affect walkthroughs.
202
+ *If user chooses Option 2 (Save context only):* write `context.yml` and exit cleanly:
203
+ > ✓ Project context initialized. When you're ready to create your first test journey, run `/iamu:new`.
130
204
 
131
- 4. **Scaffold confirmed personas (unless `skip-personas` selected):**
205
+ ---
132
206
 
133
- Always use the CLI to scaffold valid persona entities with schema-compliant UUIDs, slugs, and timestamps:
134
- ```bash
135
- iamu new persona --name "<Name>" --role "<Role>" --disposition "<Disposition>" --json
136
- ```
207
+ ### 5. Step 3/3: Co-Design Your First Test Journey (`personas/`, `outlines/`, `scenarios/`)
137
208
 
138
- Then open the created file (`iamu/personas/<slug>.md`) and write 2–4 sentences of background narrative into the markdown body below the frontmatter, detailing their technical habits, patience level, and specific friction triggers.
209
+ 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).
139
210
 
140
- If `iamu/context.yml` has an `access` mechanism, set the persona's `access` field in frontmatter to match an existing product account/role.
211
+ Present the proposed test journey, including explicit **Auth Precondition Verification**:
141
212
 
142
- Run `iamu validate --all`.
213
+ ```markdown
214
+ Step 3/3: Co-Design Your First Test Journey
215
+ Why this matters: Validates whether a real human with specific operational pressures can complete a critical task without getting blocked or frustrated.
143
216
 
144
- 5. Confirm: "Context saved and personas seeded in iamu/personas/. Run `iamu-new` to draft your first scenario." (or "Context saved. Run `iamu-new` to draft your first scenario." if personas were skipped).
217
+ Baseline Test Proposal (WYSIWGW Spec-Sheet):
218
+ Persona: <Name> (<Role / Title>)
219
+ • Reality: <Working context, physical habits, tenure, pressures>
220
+ • Friction: <Diagnostic friction, skepticism, bounce trigger>
221
+ Situation: <Outline Title>
222
+ • Tension: <Core problem-space tension in X vs Y format — no UI button names>
223
+ • Evaluation: <Concrete binary yes/partial/no question for evaluator>
224
+ Walk Surface: Entry: `<entry_path>` | Target: `<target_url>`
225
+ Auth Precondition: <Detected auth mechanism, e.g. "Dev persona switcher (localStorage.sf_dev_persona = 'anna')" or "Public">
226
+ 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.>"
227
+ ```
145
228
 
146
- ### 4. Offer cloud link (optional)
229
+ **Interactive Decision Gate:**
230
+ Prompt the user to verify the scenario and its auth precondition:
231
+ - If interactive user-prompt tools exist (`ask_question`, `ask_followup_question`), invoke it:
232
+ - Question: "Scaffold this baseline journey?"
233
+ - Options:
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 (write-in)"
237
+ 4. "Skip scenario for now"
238
+ - Otherwise (text-only/CLI):
239
+
240
+ ```text
241
+ Scaffold this baseline journey?
242
+ 1. [Recommended] Scaffold journey with <detected auth mechanism>
243
+ 2. Use interactive human login handshake (pause browser for live login)
244
+ 3. Switch role / design a different scenario
245
+ 4. Skip scenario for now
246
+
247
+ Press Enter to accept [1], select 2, or tell me what to adjust:
248
+ ```
147
249
 
148
- Check the current state first:
250
+ **Action on confirmation (Option 1 or Option 2):**
251
+ 1. **Scaffold Persona**:
252
+ ```bash
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
254
+ ```
255
+ 2. **Scaffold Situation Outline**:
256
+ ```bash
257
+ iamu new outline --name "<Outline Title>" --tension "<Core Tension>" --human-test "<Concrete yes/partial/no evaluation question>" --narrative "<2-3 sentence problem-space narrative without UI terms>" --json
258
+ ```
259
+ 3. **Scaffold Bound Scenario**:
260
+ ```bash
261
+ 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
262
+ ```
263
+ 4. **Validate all entities**:
264
+ ```bash
265
+ iamu validate --all
266
+ ```
149
267
 
150
- ```bash
151
- iamu auth status --json
152
- ```
268
+ ---
153
269
 
154
- - **`cloud_linked: true`, `authenticated: true`** → already linked. Say so in one line with the dashboard link from `iamu open --print` and skip the offer.
155
- - **`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.
156
- - **`cloud_linked: false`** → ask once:
270
+ ### 6. Completion & First Walkthrough Handoff
157
271
 
158
- > 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.
272
+ Present the completion handoff cleanly.
159
273
 
160
- Three outcomes:
274
+ **Formatting & Output Rules:**
275
+ - Do NOT output markdown header hashes (`#`, `##`, `###`) in the terminal handoff. Use bold (`**Next Step:**`) or plain text.
276
+ - Do NOT output a redundant bullet list of "Generated entities:" after the file tree. The visual tree already displays the files.
277
+ - Check `iamu/config.json`:
278
+ - **If `cloud_linked: true`:** Output `• iamu sync Sync completed runs and findings to Iamu Cloud`. Do NOT recommend `iamu auth login`.
279
+ - **If `cloud_linked: false`:** Output `• iamu auth login Connect to Iamu Cloud to share run reports with your team (optional)`.
161
280
 
162
- - **Yes** → link it (below).
163
- - **Skip** → local-only project stays local-only. User can connect later by re-running `iamu-setup` or running `iamu auth login` directly.
164
- - **Later** → same as skip. No state change.
281
+ Render the output:
165
282
 
166
- **Linking:**
283
+ ```text
284
+ ✓ Scaffolding complete:
167
285
 
168
- 1. Run `iamu auth login` (add `--url <api-url>` only if the user names a self-hosted cloud). It opens the sign-in page in the user's browser and waits up to two minutes — tell the user to approve it there. Allow the command at least 150 seconds before your shell tool times out. 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.
169
- 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. Linking pushes every local persona, scenario and finding into the chosen project; a wrong guess leaks them into someone else's.
170
- 3. On success the output ends with `Dashboard: <url>` and, when an agent host was detected, `iamu-sync MCP server registered`. Relay both in two lines: the dashboard link, and that restarting the agent session loads the team tools (work requests, teammate-change alerts).
286
+ iamu/
287
+ ├── testability.md [safety fence active: <target_url>]
288
+ ├── context.yml [domain: <domain>]
289
+ ├── personas/
290
+ │ └── <persona-slug>.md
291
+ ├── outlines/
292
+ │ └── <outline-slug>.md
293
+ └── scenarios/
294
+ └── <persona-slug>--<outline-slug>.md
171
295
 
172
- If login fails (cloud unreachable, sign-in timed out), report the error in one line and continue — setup is complete without the cloud.
296
+ Next step:
297
+ Ensure your dev server is running on <target_url>, then trigger the walkthrough in your agent:
173
298
 
174
- All three outcomes leave a usable local setup. Cloud is strictly additive.
299
+ iamu-run <persona-slug>--<outline-slug>
175
300
 
176
- ### 5. How to use iamu from here
301
+ Or run directly from your shell:
177
302
 
178
- Close with one line pointing at the next step:
303
+ $ iamu start-run <persona-slug>--<outline-slug> --target <target_url>
179
304
 
305
+ Other commands when you're ready:
306
+ • iamu-new Draft a scenario for a different product flow
307
+ • iamu-propose Brainstorm high-risk workflows and blind spots
308
+ • iamu doctor Diagnose test environment and target health
309
+ <If cloud_linked: true>
310
+ • iamu sync Sync completed runs and findings to Iamu Cloud
311
+ <If cloud_linked: false>
312
+ • iamu auth login Connect to Iamu Cloud to share run reports with your team (optional)
180
313
  ```
181
- Setup complete. Next: run iamu-new to draft your first scenario.
182
- ```
314
+
315
+ ### 7. Cloud link (optional)
316
+
317
+ Cloud linking is optional and non-blocking. It is recommended after executing your first walkthrough so you have run reports and findings to share.
318
+
319
+ If the project is not yet linked and the user explicitly asks to link during setup:
320
+ 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.
321
+ 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.
322
+ 3. On success the output ends with `Dashboard: <url>` and registered MCP server.
323
+
324
+ If login times out or fails:
325
+ - "Your local project setup is 100% complete and fully functional. Personas, scenarios, outlines, and walkthroughs run locally without cloud."
326
+ - Point to: `iamu-run <persona-slug>--<outline-slug>`.
183
327
 
184
328
  ## Guidelines
185
329
 
186
- - **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`.
330
+ - **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.
331
+ - **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.
187
332
  - **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.
188
333
  - **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.
189
- - **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.
190
- - **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.
191
- - **Code-referenced vs inferred.** When drafting context in step 2, be explicit about which claims you read in the codebase vs which you inferred.
192
- - **Handle errors gracefully.** Unreachable file → note it, move on. Unreachable cloud (step 4) → report and let the user retry or defer.
334
+ - **Context on disk is load-bearing.** Once step 4 writes `iamu/context.yml`, every downstream skill (`iamu-new`, `iamu-run`) auto-loads it.
335
+ - **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.
336
+ - **Handle errors gracefully.** Unreachable file → note it, move on. Unreachable cloud → report and let the user retry or defer.
@@ -21,24 +21,28 @@ $ARGUMENTS
21
21
 
22
22
  Do NOT use `find`, `grep`, or `cat` to dump raw `.md` files in `iamu/`. The CLI outputs clean, validated data.
23
23
 
24
- ### 2. Format entity responses as compact tables
24
+ ### 2. Format entity responses with an executive tally and clickable links
25
25
 
26
- When the user asks for personas, scenarios, or findings, respond with a scannable Markdown table. Never dump full psychological profiles, vocabulary lists, or raw frontmatter unless the user explicitly asks for deep detail on one entity.
26
+ When the user asks for project status, lead with an executive tally banner, followed by scannable tables with clickable markdown file links:
27
+
28
+ ```
29
+ Project Status: <P> Personas · <S> Scenarios (<R> Tested, <U> Untested) · <F> Open Findings · <C> Capabilities
30
+ ```
27
31
 
28
32
  **Personas:**
29
33
  | Slug | Name | Role | Status |
30
34
  |---|---|---|---|
31
- | `elin-dahl` | Elin Dahl | Architect & first-time house owner in Falun | active |
35
+ | [`elin-dahl`](iamu/personas/elin-dahl.md) | Elin Dahl | Architect & first-time house owner in Falun | active |
32
36
 
33
37
  **Scenarios:**
34
38
  | Slug | Persona | Outline | Status / Target |
35
39
  |---|---|---|---|
36
- | `replacing-windows` | `elin-dahl` | `measure-and-order` | ready |
40
+ | [`replacing-windows`](iamu/scenarios/replacing-windows.md) | [`elin-dahl`](iamu/personas/elin-dahl.md) | [`measure-and-order`](iamu/outlines/measure-and-order.md) | ready |
37
41
 
38
42
  **Findings:**
39
- | # | Severity | Type | Finding | Status |
43
+ | # | Severity | Type | Finding | File |
40
44
  |---|---|---|---|---|
41
- | 1 | CRITICAL | hinders | Submit fails opaquely on empty field | open |
45
+ | 1 | CRITICAL | hinders | Submit fails opaquely on empty field | [`view`](iamu/findings/<slug>.md) |
42
46
 
43
47
  ### 3. Ignore internal templates
44
48
 
@@ -52,13 +56,16 @@ For a project-status question, add one line on the cloud from `iamu status --jso
52
56
  - **Linked, no credentials** → `Cloud: linked, but this machine has no credentials — iamu auth login.`
53
57
  - **Local-only** → `Cloud: local-only.` Nothing more; no upgrade pitch.
54
58
 
55
- ### 5. Provide clear next steps
59
+ ### 5. Provide copy-pasteable next actions
60
+
61
+ Conclude with exact copy-pasteable commands:
56
62
 
57
- Conclude with one concise action prompt:
58
- - To run a scenario: `iamu-run <scenario-slug>`
59
- - To propose new personas or scenarios: `iamu-propose`
60
- - To draft a persona or scenario directly: `iamu-new`
61
- - To review open findings or team requests: `iamu-findings`
62
- - To inspect reports: `iamu report`, or `iamu open` for the cloud dashboard (linked projects)
63
- - To share unpushed work with the team: `iamu sync` (linked projects)
63
+ ```
64
+ Next actions:
65
+ iamu-run <scenario-slug> # Run a walkthrough for this scenario
66
+ iamu-propose # Propose missing personas or scenarios
67
+ iamu-new # Draft a new scenario or persona
68
+ iamu-findings # Triage open findings
69
+ iamu open # Open project in cloud dashboard
70
+ ```
64
71
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iamu-dev/iamu",
3
- "version": "0.2.0-beta.1",
3
+ "version": "0.2.0-beta.11",
4
4
  "type": "module",
5
5
  "description": "Test your product as realistic personas — scenario-driven development CLI",
6
6
  "license": "UNLICENSED",
@@ -54,19 +54,22 @@
54
54
  "devDependencies": {
55
55
  "@types/node": "^22.0.0",
56
56
  "@vitest/coverage-v8": "^4.1.11",
57
+ "google-auth-library": "^11.1.0",
57
58
  "tsup": "^8.5.1",
58
59
  "typescript": "^5.8.0",
59
60
  "vitest": "^4.1.11",
60
- "@iamu-dev/protocol": "0.1.0",
61
61
  "@iamu-dev/local-store": "0.1.0",
62
- "@iamu/tsconfig": "0.1.0"
62
+ "@iamu/tsconfig": "0.1.0",
63
+ "@iamu-dev/protocol": "0.1.0"
63
64
  },
64
65
  "scripts": {
65
- "build": "tsup && tsc -b tsconfig.build.json --emitDeclarationOnly && node scripts/copy-assets.mjs",
66
+ "build": "tsup && tsc -b --force tsconfig.build.json --emitDeclarationOnly && node scripts/copy-assets.mjs",
66
67
  "clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true }); fs.rmSync('tsconfig.tsbuildinfo', { force: true }); fs.rmSync('tsconfig.build.tsbuildinfo', { force: true })\"",
67
68
  "typecheck": "tsc --noEmit",
68
69
  "test": "vitest run",
69
70
  "test:coverage": "vitest run --coverage",
71
+ "eval:walkthroughs": "vitest run --config vitest.benchmark.config.ts",
72
+ "eval:gemini": "node dist/eval/gemini-eval-cli.js",
70
73
  "pack:dry-run": "npm pack --dry-run"
71
74
  }
72
75
  }