@iamu-dev/iamu 0.0.0-stage → 0.2.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +103 -2
  3. package/dist/adapters/claude-plugin.d.ts +13 -0
  4. package/dist/adapters/registry.d.ts +6 -0
  5. package/dist/adapters/types.d.ts +19 -0
  6. package/dist/bin.d.ts +2 -0
  7. package/dist/bin.js +22853 -0
  8. package/dist/build-info.d.ts +53 -0
  9. package/dist/cloud-url.d.ts +19 -0
  10. package/dist/commands/auth-http.d.ts +37 -0
  11. package/dist/commands/auth-project-choice.d.ts +74 -0
  12. package/dist/commands/auth-token-input.d.ts +21 -0
  13. package/dist/commands/auth.d.ts +84 -0
  14. package/dist/commands/browse-actions.d.ts +56 -0
  15. package/dist/commands/browse-driver.d.ts +117 -0
  16. package/dist/commands/browse.d.ts +170 -0
  17. package/dist/commands/cloud-push.d.ts +27 -0
  18. package/dist/commands/complete.d.ts +132 -0
  19. package/dist/commands/completion.d.ts +2 -0
  20. package/dist/commands/context.d.ts +58 -0
  21. package/dist/commands/credentials.d.ts +144 -0
  22. package/dist/commands/diff-filter.d.ts +11 -0
  23. package/dist/commands/doctor.d.ts +33 -0
  24. package/dist/commands/evaluate.d.ts +32 -0
  25. package/dist/commands/explore-crawl.d.ts +67 -0
  26. package/dist/commands/explore.d.ts +52 -0
  27. package/dist/commands/findings.d.ts +7 -0
  28. package/dist/commands/init.d.ts +16 -0
  29. package/dist/commands/instructions-walk.d.ts +69 -0
  30. package/dist/commands/list.d.ts +5 -0
  31. package/dist/commands/match.d.ts +13 -0
  32. package/dist/commands/mcp-config.d.ts +10 -0
  33. package/dist/commands/new-entity.d.ts +28 -0
  34. package/dist/commands/new-finding.d.ts +19 -0
  35. package/dist/commands/open.d.ts +8 -0
  36. package/dist/commands/port.d.ts +17 -0
  37. package/dist/commands/prune.d.ts +11 -0
  38. package/dist/commands/pull.d.ts +5 -0
  39. package/dist/commands/register-cloud.d.ts +5 -0
  40. package/dist/commands/register-findings.d.ts +5 -0
  41. package/dist/commands/register-project.d.ts +5 -0
  42. package/dist/commands/register-walkthrough.d.ts +5 -0
  43. package/dist/commands/register.d.ts +10 -0
  44. package/dist/commands/report.d.ts +3 -0
  45. package/dist/commands/serve.d.ts +11 -0
  46. package/dist/commands/skills.d.ts +34 -0
  47. package/dist/commands/start-run.d.ts +54 -0
  48. package/dist/commands/status.d.ts +3 -0
  49. package/dist/commands/step-numbering.d.ts +87 -0
  50. package/dist/commands/step.d.ts +95 -0
  51. package/dist/commands/sync.d.ts +6 -0
  52. package/dist/commands/triage.d.ts +21 -0
  53. package/dist/commands/update.d.ts +4 -0
  54. package/dist/commands/validate.d.ts +8 -0
  55. package/dist/commands/view-results.d.ts +9 -0
  56. package/dist/eval/gemini-eval-cli.d.ts +10 -0
  57. package/dist/eval/gemini-eval-cli.js +976 -0
  58. package/dist/eval/gemini-walker.d.ts +46 -0
  59. package/dist/eval/walkthrough-evaluator.d.ts +61 -0
  60. package/dist/index.d.ts +9 -0
  61. package/dist/index.js +22700 -0
  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/combine.md +69 -0
  66. package/dist/templates/prompts/complete.md +132 -0
  67. package/dist/templates/prompts/evaluate.md +64 -0
  68. package/dist/templates/prompts/outline.md +54 -0
  69. package/dist/templates/prompts/persona.md +40 -0
  70. package/dist/templates/prompts/walk.md +179 -0
  71. package/dist/templates/skills/iamu-findings.md +266 -0
  72. package/dist/templates/skills/iamu-new.md +263 -0
  73. package/dist/templates/skills/iamu-propose.md +157 -0
  74. package/dist/templates/skills/iamu-run.md +520 -0
  75. package/dist/templates/skills/iamu-setup.md +270 -0
  76. package/dist/templates/skills/iamu-status.md +71 -0
  77. package/dist/templates.d.ts +10 -0
  78. package/dist/ui/journey-diff.d.ts +3 -0
  79. package/dist/ui/json.d.ts +6 -0
  80. package/dist/ui/logger.d.ts +5 -0
  81. package/dist/ui/panic.d.ts +11 -0
  82. package/dist/ui/symbols.d.ts +11 -0
  83. package/dist/ui/table.d.ts +20 -0
  84. package/dist/ui/update-check.d.ts +6 -0
  85. package/dist/worktree-state.d.ts +49 -0
  86. package/package.json +72 -3
@@ -0,0 +1,270 @@
1
+ ---
2
+ name: iamu-setup
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
+ generatedBy: __IAMU_VERSION__
5
+ ---
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 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
+
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
+
11
+ What this skill does, end to end:
12
+
13
+ - **Scaffold** — `iamu/` tree on disk via `iamu init`. No login, no cloud.
14
+ - **Understand** — read the repo to identify domain, primary user archetypes, reachable routes, and testability.
15
+ - **Propose & Scaffold Baseline** — present a single unified briefing: domain narrative, primary persona, and inaugural scenario. On confirmation ("yes"), scaffold `context.yml`, `testability.md`, persona, outline, and scenario to disk.
16
+ - **Next Action** — point directly to `iamu-run <scenario>` with copy-pasteable execution command.
17
+ - **Cloud (optional)** — offer to link to Iamu cloud for sharing / teams / managed runs via `iamu auth login`. User can accept, skip, or defer.
18
+
19
+ $ARGUMENTS
20
+
21
+ ## Steps
22
+
23
+ ### 1. Scaffold the iamu/ tree
24
+
25
+ Check whether `iamu/config.json` already exists:
26
+
27
+ - **If already scaffolded (`iamu/config.json` exists):** Do not re-run `iamu init`. Introduce the step concisely and proceed directly to Step 2:
28
+ > Analyzing your codebase now to map the domain, primary persona, and first test scenario.
29
+ - **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`.
30
+ Introduce iamu first:
31
+ > **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 map the domain and prepare your first test scenario.
32
+ - **Error containing "legacy `.iamu/` layout"** → tell the user to remove the legacy directory, then re-run.
33
+
34
+ ### 2. Understand the project
35
+
36
+ Explore the codebase automatically — do NOT ask the user what files to read. Extract domain and environment facts strictly from code:
37
+
38
+ 1. **Framework & Dev Server Port Detection:**
39
+ - Inspect package manifests: `package.json`, `Cargo.toml`, `pyproject.toml`, `go.mod`.
40
+ - Read framework configs to reliably extract default dev ports:
41
+ - `vite.config.*` / `svelte.config.*` → default port 5173
42
+ - `astro.config.*` → default port 4321
43
+ - `next.config.*` / Rails / Remix → default port 3000
44
+ - `wrangler.toml` / `wrangler.json` (Cloudflare Workers/Pages)
45
+ - `docker-compose.yml`
46
+ - Read `.env`, `.env.development`, `.env.local` for `PORT`, `VITE_PORT`, `NEXT_PUBLIC_APP_URL`.
47
+ - If unsure, check port reachability on common ports (3000, 5173, 8080, 4321).
48
+ 2. **Reachable Entry Route:**
49
+ - Scan page directories: `app/**/page.tsx`, `pages/**/*.tsx`, `src/routes/**/*.svelte`, React Router `routes.ts`/`App.tsx`.
50
+ - Pick a concrete static route (e.g. `/incidents/new`, `/cart`, `/checkout`), NOT an unresolved parameterized path (`/projects/:id`) unless seed fixture IDs are known.
51
+ 3. **Auth & Persona Access:**
52
+ - Inspect auth route guards (`middleware.ts`, ProtectedRoute, session hooks).
53
+ - Identify dev bypass (`MOCK_AUTH`), test accounts/fixtures, persona switcher, or public access.
54
+ 4. **Domain Narrative & Cast:**
55
+ - Read `README.md`, `CLAUDE.md`, docs, OpenAPI / JSON schemas, user models.
56
+ - Extract 1 primary protagonist and 2 secondary actors from real user roles.
57
+ - **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.
58
+ 5. **Primary Persona Rigor:**
59
+ - Follow `iamu/.prompts/persona.md`: no generic marketing adjectives ("tech-savvy", "coffee lover"). Ground in working physical reality, time pressure, and concrete diagnostic friction / bounce conditions. True whether the product exists or not.
60
+
61
+ Synthesize the project into a cohesive, substantive narrative (1–2 paragraphs):
62
+ - What the product fundamentally is, its primary domain, and who uses it.
63
+ - Key user journeys and operational characteristics (e.g. mobile floor use, audit deadlines).
64
+ - Market and geography (only if evident).
65
+
66
+ Audit testability and target environment:
67
+ 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`.
68
+
69
+ **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:
70
+ > No local codebase detected. To seed context, provide one of:
71
+ > - A target URL (staging, production, or docs — e.g., `https://app.example.com`)
72
+ > - A one-sentence description of what this product does
73
+ > - Or type `"sandbox"` to seed a pre-configured B2B SaaS demo
74
+
75
+ **Autonomous Enrichment:**
76
+ - **URL provided:** Fetch or search public marketing/docs for that site. Automatically extract the substantive narrative, core user journeys, and key actors.
77
+ - **One-sentence summary provided:** Immediately expand into a full substantive narrative using domain knowledge.
78
+ - **"sandbox" provided:** Seed a standard B2B SaaS narrative with Admin and End-User roles.
79
+
80
+ ### 3. Present Unified Baseline Proposal (Single Confirmation Gate)
81
+
82
+ Present the discovered domain context, 1 primary persona, and 1 inaugural scenario in a single scannable briefing.
83
+
84
+ Do NOT wrap the briefing in a markdown code fence (` ``` `). Output normal markdown so the user's terminal formats bolding and layout cleanly.
85
+ Do NOT split this into multiple sequential permission questions. Present the complete baseline package at once:
86
+
87
+ Discovered Project Context:
88
+ Domain: <domain name, e.g. workplace safety management>
89
+ Scope: <Jurisdiction or "Standard Web App / Unregulated">
90
+ Cast: <Primary Protagonist> (protagonist), <Secondary Actor 1>, <Secondary Actor 2>
91
+ Target: <target_url, e.g. http://localhost:5173> (Dev Command: `<dev_command, e.g. pnpm dev>`)
92
+ Auth Access: <How walker assumes role, e.g. "Dev persona switcher" or "Public">
93
+
94
+ <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.>
95
+
96
+ Baseline Test Proposal (WYSIWGW Spec-Sheet):
97
+ Persona: <Name> (<Role / Title>)
98
+ • Reality: <Working context, physical habits, tenure>
99
+ • Friction: <Diagnostic friction, skepticism, bounce trigger>
100
+ Situation: <Outline Title>
101
+ • Tension: <Core problem-space tension in X vs Y format — no UI button names>
102
+ • Evaluation Checkpoint: <Concrete binary yes/partial/no question for evaluator>
103
+ Walk Surface: Entry: `<entry_path>` | Target: `<target_url>`
104
+ 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.>"
105
+
106
+ ---
107
+
108
+ **Interactive Decision:**
109
+ Prompt the user to confirm or adjust the baseline:
110
+ - If your environment provides an interactive user-prompt tool (e.g. `ask_question`, `ask_followup_question`), invoke it:
111
+ - Question: "Scaffold this iamu test baseline?"
112
+ - Options:
113
+ 1. "[Recommended] Scaffold baseline and prepare first walkthrough"
114
+ 2. "Switch perspective: Walk as <Secondary Actor 1 Name> (<Role>)"
115
+ 3. "Adjust domain context, target URL, or persona details"
116
+ - Otherwise (in CLI or text-only environments), present them as an enumerated list:
117
+
118
+ Scaffold this iamu test baseline?
119
+ 1. [Recommended] Scaffold baseline and prepare first walkthrough
120
+ 2. Switch perspective: Walk as <Secondary Actor 1 Name> (<Role>)
121
+ 3. Adjust domain, target URL, or persona details
122
+
123
+ Press Enter to accept [1], select 2, or tell me what to adjust:
124
+ (Treat empty Enter or return as Option 1)
125
+
126
+ ### 4. Scaffold the Test Suite Atomically
127
+
128
+ When the user selects Option 1 (or confirms):
129
+
130
+ 1. **Write `iamu/context.yml`**:
131
+ 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 `---`:
132
+
133
+ ```yaml
134
+ ---
135
+ schema_version: 1
136
+ domain: workplace safety management
137
+ # jurisdiction: Sweden / EU # optional
138
+ # governed_by: # strictly optional - omit if not regulated
139
+ # - name: AFS 2023:2
140
+ # authority_level: regulation
141
+ actors:
142
+ - name: Store Admin
143
+ role: Manages catalog, inventory, and order fulfillment
144
+ - name: First-Time Buyer
145
+ role: Explores products, adds to cart, and checks out
146
+ - name: Customer Support Agent
147
+ role: Handles order discrepancies, refunds, and customer inquiries
148
+ access: >-
149
+ No login in dev. In the page, set localStorage "dev_persona" to the
150
+ persona's access value and reload.
151
+ ---
152
+
153
+ <The substantive 1–2 paragraph project description and core user journeys>
154
+ ```
155
+
156
+ Rules:
157
+ - `domain` — one line. Mandatory.
158
+ - Body markdown (below `---`) — substantive description and user journeys. Downstream skills read this as extended grounding.
159
+ - `jurisdiction` — optional. Only if evident or relevant.
160
+ - `governed_by[]` — strictly optional. Order by authority. Omit entirely if no regulations apply.
161
+ - `actors[]` — all identified roles and their responsibilities. Keep secondary roles here so context has cast depth.
162
+ - `access` — optional. Only what the docs actually say; leave it out rather than guess.
163
+ - Do NOT add `industry` or `architecture` — these don't affect walkthroughs.
164
+
165
+ 2. **Write `iamu/testability.md`**:
166
+ Scaffold the target environment, dev command, auth strategy, reachable surfaces, mock harnesses, and untestable boundaries discovered from the code:
167
+
168
+ ```markdown
169
+ ---
170
+ target_url: http://localhost:3000
171
+ dev_command: <detected dev script, e.g. pnpm dev or pnpm dev:mock>
172
+ auth_strategy: <dev_switcher | interactive | test_accounts | public>
173
+ harnesses:
174
+ - <detected harnesses, e.g. msw, seed>
175
+ ---
176
+
177
+ # Project Testability & Environment
178
+
179
+ ## Target & Run Instructions
180
+ - Command: <dev command>
181
+ - Base URL: <target_url>
182
+
183
+ ## Auth & Access Boundary
184
+ - <How a walker becomes this persona in dev or test mode>
185
+
186
+ ## Reachable Surfaces
187
+ - <List discovered routes/entry points, e.g. /login, /dashboard, /incidents>
188
+
189
+ ## Mocks & Data Fixtures
190
+ - <List existing MSW mock files, DB seed scripts, or fixture directories>
191
+
192
+ ## Untestable Boundaries (Do Not Walk)
193
+ - <List un-mocked external dependencies, e.g. live Stripe charges, SMS 2FA, external SSO>
194
+ ```
195
+
196
+ 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).
197
+
198
+ 3. **Scaffold Primary Persona**:
199
+ Scaffold 1 primary protagonist into `iamu/personas/<persona-slug>.md` using the CLI:
200
+ ```bash
201
+ 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
202
+ ```
203
+
204
+ 4. **Scaffold Situation Outline**:
205
+ Scaffold the inaugural outline into `iamu/outlines/<outline-slug>.md` using the CLI:
206
+ ```bash
207
+ 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
208
+ ```
209
+
210
+ 5. **Scaffold Bound Scenario**:
211
+ Bind the persona and outline into `iamu/scenarios/<persona-slug>--<outline-slug>.md` using the CLI:
212
+ ```bash
213
+ 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
214
+ ```
215
+
216
+ 6. **Validate all entities**:
217
+ ```bash
218
+ iamu validate --all
219
+ ```
220
+
221
+ 7. **Present Completion & Immediate Next Action**:
222
+ Render the visual scaffolding tree and provide the direct command to run the walkthrough:
223
+
224
+ ```text
225
+ ✓ Scaffolding complete:
226
+
227
+ iamu/
228
+ ├── context.yml [domain: <domain>]
229
+ ├── testability.md [target: <target_url>]
230
+ ├── personas/
231
+ │ └── <persona-slug>.md
232
+ ├── outlines/
233
+ │ └── <outline-slug>.md
234
+ └── scenarios/
235
+ └── <persona-slug>--<outline-slug>.md
236
+
237
+ Next step:
238
+ Ensure your dev server is running on <target_url>, then run:
239
+
240
+ $ iamu-run <persona-slug>--<outline-slug>
241
+
242
+ Other commands when you're ready:
243
+ • iamu-new Draft a scenario for a different product flow
244
+ • iamu-propose Brainstorm high-risk workflows and blind spots
245
+ • iamu doctor Diagnose test environment and target health
246
+ • iamu auth login Link to Iamu Cloud to share run reports with your team (optional)
247
+ ```
248
+
249
+ ### 5. Cloud link (optional)
250
+
251
+ Cloud linking is optional and non-blocking. It is recommended after executing your first walkthrough so you have run reports and findings to share.
252
+
253
+ If the user explicitly asks to link during setup:
254
+ 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.
255
+ 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.
256
+ 3. On success the output ends with `Dashboard: <url>` and registered MCP server.
257
+
258
+ If login times out or fails:
259
+ - "Your local project setup is 100% complete and fully functional. Personas, scenarios, outlines, and walkthroughs run locally without cloud."
260
+ - Point to: `iamu-run <persona-slug>--<outline-slug>`.
261
+
262
+ ## Guidelines
263
+
264
+ - **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.
265
+ - **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.
266
+ - **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.
267
+ - **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.
268
+ - **Context on disk is load-bearing.** Once step 4 writes `iamu/context.yml`, every downstream skill (`iamu-new`, `iamu-run`) auto-loads it.
269
+ - **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.
270
+ - **Handle errors gracefully.** Unreachable file → note it, move on. Unreachable cloud → report and let the user retry or defer.
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: iamu-status
3
+ description: Check project testing status, list installed personas, scenarios, outlines, capabilities, or review walkthrough coverage and findings. Use when asked "what personas do we have?", "what scenarios exist?", "what is the test status?", "list personas", "what should we test next?", or to inspect iamu assets.
4
+ generatedBy: __IAMU_VERSION__
5
+ ---
6
+
7
+ You are the project's scenario-testing librarian. Your job is to give concise, structured overviews of iamu assets and testing status without dumping raw file bodies.
8
+
9
+ $ARGUMENTS
10
+
11
+ ## Instructions
12
+
13
+ ### 1. Always use CLI commands for inspection
14
+
15
+ - **List personas:** `iamu list personas` (or `--json`)
16
+ - **List scenarios:** `iamu list scenarios` (or `--json`)
17
+ - **List capabilities:** `iamu list capabilities`
18
+ - **List outlines:** `iamu list outlines`
19
+ - **List findings:** `iamu findings`
20
+ - **Project state & run status:** `iamu status`
21
+
22
+ Do NOT use `find`, `grep`, or `cat` to dump raw `.md` files in `iamu/`. The CLI outputs clean, validated data.
23
+
24
+ ### 2. Format entity responses with an executive tally and clickable links
25
+
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
+ ```
31
+
32
+ **Personas:**
33
+ | Slug | Name | Role | Status |
34
+ |---|---|---|---|
35
+ | [`elin-dahl`](iamu/personas/elin-dahl.md) | Elin Dahl | Architect & first-time house owner in Falun | active |
36
+
37
+ **Scenarios:**
38
+ | Slug | Persona | Outline | Status / Target |
39
+ |---|---|---|---|
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 |
41
+
42
+ **Findings:**
43
+ | # | Severity | Type | Finding | File |
44
+ |---|---|---|---|---|
45
+ | 1 | CRITICAL | hinders | Submit fails opaquely on empty field | [`view`](iamu/findings/<slug>.md) |
46
+
47
+ ### 3. Ignore internal templates
48
+
49
+ The directory `iamu/.prompts/` contains internal prompt templates (`persona.md`, `outline.md`, etc.). These are NOT project entities. Never list them or explain them to the user.
50
+
51
+ ### 4. Cloud line
52
+
53
+ For a project-status question, add one line on the cloud from `iamu status --json` (`mode`, `sync`, `requests`) and `iamu auth status --json` (`authenticated`):
54
+
55
+ - **Linked** → `Cloud: linked — <url from iamu open --print>`, then only what needs action: unpushed changes (`sync.pending_new` + `sync.pending_updates` + `walkthroughs.pending`, and `sync.local_deletions.count`) → `iamu sync`; `requests.open` above zero → `<N> team requests — iamu-findings`.
56
+ - **Linked, no credentials** → `Cloud: linked, but this machine has no credentials — iamu auth login.`
57
+ - **Local-only** → `Cloud: local-only.` Nothing more; no upgrade pitch.
58
+
59
+ ### 5. Provide copy-pasteable next actions
60
+
61
+ Conclude with exact copy-pasteable commands:
62
+
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
+ ```
71
+
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Resolves the root directory containing `templates/`.
3
+ * In development (source/vitest): import.meta.url is in `src/` or `src/commands/`,
4
+ * so templates are located at `src/templates`.
5
+ * In production bundle (tsup): import.meta.url is in `dist/`,
6
+ * and copy-assets.mjs copies templates to `dist/templates`.
7
+ */
8
+ export declare function getTemplatesRoot(): string;
9
+ export declare function getTemplateDir(subdir: "skills" | "prompts"): string;
10
+ export declare function getTemplateFile(subdir: "skills" | "prompts", filename: string): string;
@@ -0,0 +1,3 @@
1
+ import type { JourneyDiff } from "@iamu-dev/local-store";
2
+ export declare function formatJourneyDiffTerminal(diff: JourneyDiff): string;
3
+ export declare function printJourneyDiff(diff: JourneyDiff): void;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Pick specified keys from an array of records or a single record.
3
+ * Supports comma-separated field list: e.g. "slug,name,role".
4
+ * If fields is boolean true or undefined/empty, returns target as-is.
5
+ */
6
+ export declare function filterJsonFields<T extends Record<string, unknown>>(target: T[] | T, fields?: string | boolean): unknown;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Standard verbosity and quiet mode helpers driven by IAMU_QUIET and IAMU_VERBOSE environment variables.
3
+ */
4
+ export declare function isQuiet(): boolean;
5
+ export declare function isVerbose(): boolean;
@@ -0,0 +1,11 @@
1
+ type SigintCleanup = () => Promise<void> | void;
2
+ /**
3
+ * Registers an asynchronous cleanup handler to execute on SIGINT (e.g. closing an HTTP server).
4
+ * Returns an unregister function.
5
+ */
6
+ export declare function registerSigintCleanup(handler: SigintCleanup): () => void;
7
+ /**
8
+ * Registers global process handlers for graceful shutdown and top-level error boundaries.
9
+ */
10
+ export declare function setupProcessHandlers(): void;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ export declare const symbols: {
2
+ success: string;
3
+ error: string;
4
+ pending: string;
5
+ warning: string;
6
+ modified: string;
7
+ add: string;
8
+ info: string;
9
+ dot: string;
10
+ question: string;
11
+ };
@@ -0,0 +1,20 @@
1
+ export declare function stripAnsi(str: string): string;
2
+ export declare function visualLength(str: string): number;
3
+ export declare function padRight(str: string, targetWidth: number): string;
4
+ export declare function truncate(str: string, maxWidth: number): string;
5
+ export interface TableColumn<T> {
6
+ header: string;
7
+ value: (item: T) => string;
8
+ minWidth?: number;
9
+ maxWidth?: number;
10
+ }
11
+ export interface FormatTableOptions {
12
+ tty?: boolean;
13
+ }
14
+ /**
15
+ * Formats data into a cleanly aligned table with dynamically calculated column widths.
16
+ * Automatically accounts for ANSI color sequences in length calculations.
17
+ * When output is piped (!process.stdout.isTTY), automatically emits machine-readable
18
+ * Tab-Separated Values (TSV) without ANSI escapes, borders, or text truncation.
19
+ */
20
+ export declare function formatTable<T>(items: T[], columns: TableColumn<T>[], options?: FormatTableOptions): string[];
@@ -0,0 +1,6 @@
1
+ export declare function isSemverGreater(latest: string, current: string): boolean;
2
+ /**
3
+ * Non-blocking, cached check against npm registry for CLI updates.
4
+ */
5
+ export declare function checkForUpdate(currentVersion: string): Promise<string | null>;
6
+ export declare function printUpdateNotice(currentVersion: string, latestVersion: string): void;
@@ -0,0 +1,49 @@
1
+ /** The build block's view of the working tree. */
2
+ export interface WorktreeState {
3
+ git_dirty: boolean;
4
+ /** Only when dirty: 12 lowercase hex characters. */
5
+ worktree_hash?: string;
6
+ }
7
+ /** Answers the working-tree question for a project root. */
8
+ export type WorktreeDetector = (projectRoot: string) => WorktreeState | undefined;
9
+ /** Untracked files hashed at most; past this the count still counts. */
10
+ export declare const MAX_UNTRACKED_HASHED = 2000;
11
+ /**
12
+ * Whether the working tree has changes outside `iamu/`, and their
13
+ * fingerprint.
14
+ *
15
+ * Hash recipe (sha256, first 12 hex characters):
16
+ * 1. the bytes of `git diff HEAD --binary -- . ':(exclude)<iamu>'`, run
17
+ * from the repository root with diff settings pinned;
18
+ * 2. then, for each untracked non-ignored file outside `iamu/` sorted by
19
+ * path (bytewise, at most {@link MAX_UNTRACKED_HASHED}):
20
+ * `<path>\0<sha256 of content>\n`, and past the cap `+<count>\n`.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * detectWorktreeState("/work/shop");
25
+ * // { git_dirty: true, worktree_hash: "3fa9c1d2e4b5" }
26
+ * ```
27
+ */
28
+ export declare function detectWorktreeState(projectRoot: string, iamuDirName?: string): WorktreeState | undefined;
29
+ /**
30
+ * Whether the product's code changed between `start-run` and `complete`.
31
+ * The build block's fingerprint is taken at start; an edit (or commit) made
32
+ * while the walker was out means the run's findings may mix two versions,
33
+ * and the build it lands in describes only the first.
34
+ *
35
+ * @param start - The run's recorded build block (`walkthrough.json`).
36
+ * @param now - The working tree as it is now.
37
+ * @returns A one-line warning, or null when nothing changed or either side
38
+ * is unknown.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * codeChangedWarning({ git_dirty: false }, { git_dirty: true, worktree_hash: "a1b2c3d4e5f6" });
43
+ * // "the product's code changed during the walk …"
44
+ * ```
45
+ */
46
+ export declare function codeChangedWarning(start: {
47
+ git_dirty?: boolean;
48
+ worktree_hash?: string;
49
+ } | undefined, now: WorktreeState | undefined): string | null;
package/package.json CHANGED
@@ -1,6 +1,75 @@
1
1
  {
2
2
  "name": "@iamu-dev/iamu",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0-beta.10",
4
+ "type": "module",
5
+ "description": "Test your product as realistic personas — scenario-driven development CLI",
6
+ "license": "UNLICENSED",
7
+ "author": "Iamu <hello@iamu.dev>",
8
+ "homepage": "https://iamu.dev",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/iamu-dev/iamu.git",
12
+ "directory": "apps/cli"
13
+ },
14
+ "bugs": "https://github.com/iamu-dev/iamu/issues",
15
+ "keywords": [
16
+ "iamu",
17
+ "scenario-testing",
18
+ "persona-testing",
19
+ "walkthrough",
20
+ "ux-testing",
21
+ "devex",
22
+ "claude-code"
23
+ ],
24
+ "bin": {
25
+ "iamu": "./dist/bin.js"
26
+ },
27
+ "sideEffects": true,
28
+ "files": [
29
+ "dist",
30
+ "README.md",
31
+ "LICENSE"
32
+ ],
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "import": "./dist/index.js"
37
+ }
38
+ },
39
+ "publishConfig": {
40
+ "access": "public",
41
+ "tag": "beta"
42
+ },
43
+ "engines": {
44
+ "node": ">=22"
45
+ },
46
+ "dependencies": {
47
+ "@clack/prompts": "^1.8.1",
48
+ "@modelcontextprotocol/sdk": "^1.26.0",
49
+ "chalk": "^5.6.2",
50
+ "commander": "^14.0.3",
51
+ "playwright-core": "^1.58.2",
52
+ "zod": "^3.25.0"
53
+ },
54
+ "devDependencies": {
55
+ "@types/node": "^22.0.0",
56
+ "@vitest/coverage-v8": "^4.1.11",
57
+ "google-auth-library": "^11.1.0",
58
+ "tsup": "^8.5.1",
59
+ "typescript": "^5.8.0",
60
+ "vitest": "^4.1.11",
61
+ "@iamu-dev/local-store": "0.1.0",
62
+ "@iamu-dev/protocol": "0.1.0",
63
+ "@iamu/tsconfig": "0.1.0"
64
+ },
65
+ "scripts": {
66
+ "build": "tsup && tsc -b --force tsconfig.build.json --emitDeclarationOnly && node scripts/copy-assets.mjs",
67
+ "clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true }); fs.rmSync('tsconfig.tsbuildinfo', { force: true }); fs.rmSync('tsconfig.build.tsbuildinfo', { force: true })\"",
68
+ "typecheck": "tsc --noEmit",
69
+ "test": "vitest run",
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",
73
+ "pack:dry-run": "npm pack --dry-run"
74
+ }
6
75
  }