project-brain 0.46.0 → 0.48.0

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.
@@ -0,0 +1,39 @@
1
+ # Delegating a UX review
2
+
3
+ ## Splitting by scope
4
+
5
+ | Scope | Unit of delegation | Parent keeps |
6
+ |-------|--------------------|--------------|
7
+ | Whole app | One subagent per priority task, plus one for cross-cutting IA (global nav, search, naming across areas) | Task selection, context, merge, redesign, validation plan |
8
+ | One feature | One subagent per task only when tasks share no state; otherwise inline | Same |
9
+ | One screen | No delegation | Everything |
10
+
11
+ - Pick the model with `brain-model-routing`. A diagnosis or a redesign is judgment work.
12
+ - Launch independent subagents in one message.
13
+ - Each subagent opens and closes its own tabs. Subagents share the parent's browser server, so tell each one which tab it owns.
14
+
15
+ ## Subagent brief
16
+
17
+ Each brief carries everything the subagent needs, because it starts with no context:
18
+
19
+ ```
20
+ Goal: walk and diagnose one task of a UX review. Read-only: no fixes, no commits.
21
+ Product and access: <URL / repo / screenshots>, signed-in session: <yes/no, which>.
22
+ User and role: <...>. Product goal: <...>. Design system: <DESIGN.md, tokens, kit>.
23
+ Task: <user goal, no route>. Entry point: <...>. Success criterion: <...>.
24
+ Also walk: wrong-choice path <...>, failure path <...>, return visit.
25
+ Viewports: desktop 1440, mobile 375x812x3,mobile,touch (if relevant).
26
+ Read first: <skill dir>/references/protocol.md (four levels, evidence types).
27
+ Rules: chrome-devtools first; non-local targets read-only; never type passwords;
28
+ never invent data; mark unverified claims as hypothesis; close your tabs.
29
+ Return (under 600 words): step list with screenshot paths; findings as rows
30
+ (task/step, screen+state, problem, evidence type+pointer, reproduced, impact class);
31
+ what you could not check and why.
32
+ ```
33
+
34
+ ## Merging
35
+
36
+ 1. Dedupe: findings with the same screen, state and cause are one finding. Keep every task in which it appeared, and raise its impact if it blocks more than one task.
37
+ 2. Check the evidence: spot-check one reproduced finding per subagent yourself before trusting the rest.
38
+ 3. Find cross-task patterns: the same problem on several screens points to a design-system or IA cause. Report it once at that level.
39
+ 4. Do the redesign and the validation plan in the parent, so the flows stay consistent with one another.
@@ -0,0 +1,103 @@
1
+ # UX review protocol
2
+
3
+ ## Choosing tasks
4
+
5
+ Rank candidate tasks on three axes and keep the top 3-5:
6
+
7
+ - **Frequency**: how often a typical user does it.
8
+ - **Importance**: how much the product goal depends on it.
9
+ - **Cost of failure**: what is lost when it goes wrong (data, money, time, trust).
10
+
11
+ Write each task as a goal the user would state, never as a route.
12
+
13
+ - Good: "Upload the math guide to Unit 2 and confirm it landed in the right folder."
14
+ - Bad: "Click Upload, choose Unit 2, press Save."
15
+
16
+ For every task also walk:
17
+
18
+ - the wrong-choice path (wrong folder, wrong item, wrong recipient), and how the user notices and undoes it;
19
+ - the failure path (network error, validation error, timeout, missing permission), and how the user recovers without losing work;
20
+ - the return visit: can the user find the result again later?
21
+
22
+ ## Walking a task
23
+
24
+ Record per step: screen, what the user must decide, what changed in state, alternate routes, and the signal that tells the user the task is done. Screenshot every step. On web, also note console errors and failed requests seen along the way.
25
+
26
+ ## The four levels
27
+
28
+ ### 1. Information architecture
29
+
30
+ - Do labels use the user's words, not internal or technical ones?
31
+ - Can the user predict where something lives before clicking?
32
+ - Is content grouped the way the user thinks about it?
33
+ - On return, can the user reorient: where am I, how did I get here, where can I go?
34
+ - Do search, filters and sorting match how people look for things?
35
+
36
+ ### 2. Interaction
37
+
38
+ - Is it clear what can be done here, and what each control does before using it?
39
+ - While the system works, does the user see that it is working and roughly for how long?
40
+ - After an action, is the result visible and unambiguous?
41
+ - Repeated input: does the user retype data the system already has?
42
+ - Lost progress: do navigation, refresh, timeout or an error wipe what was entered?
43
+ - Irreversible actions: are they confirmed in proportion to their cost, or better, undoable?
44
+ - Errors: does the message say what happened, why, and how to fix it, next to where it happened, keeping the input?
45
+
46
+ ### 3. Visual composition
47
+
48
+ - Reading order: does the eye land first on what matters at this step?
49
+ - Hierarchy: is the primary action unmistakable, with secondary actions quieter?
50
+ - Grouping and density: are related items together, unrelated ones apart, with nothing crammed or scattered?
51
+ - Alignment, type scale, contrast and copy: consistent with the design system, readable, and specific?
52
+ - Responsive: on mobile, does the priority order survive, and are actions reachable?
53
+ - For each screen, name what should move up, move down, be grouped, moved, removed or shown on demand.
54
+
55
+ ### 4. Accessibility and integration
56
+
57
+ WCAG 2.2 AA criteria to check at minimum:
58
+
59
+ - 1.4.3 contrast;
60
+ - 1.4.11 non-text contrast;
61
+ - 2.1.1 keyboard;
62
+ - 2.4.3 focus order;
63
+ - 2.4.7 focus visible;
64
+ - 2.4.11 focus not obscured;
65
+ - 2.5.8 target size, at least 24x24 CSS px;
66
+ - 3.3.1 error identification;
67
+ - 3.3.2 labels or instructions;
68
+ - 3.3.7 redundant entry;
69
+ - 3.3.8 accessible authentication;
70
+ - 4.1.2 name, role, value.
71
+
72
+ Integration: do the patterns hold together across these conditions?
73
+
74
+ - roles and permissions, including a user who lacks permission;
75
+ - states: loading, empty, error, success, partial;
76
+ - data volume: none, one, typical, and very many items, long text, long names.
77
+
78
+ ## Evidence types
79
+
80
+ Label every major finding with one of these:
81
+
82
+ | Type | Use when |
83
+ |------|----------|
84
+ | Product observation | You reproduced it in the app; cite screenshot, step, state |
85
+ | Product data | Sessions, analytics, interviews, tickets or usability tests exist; cite them |
86
+ | External research | A published study supports it; say what it studied, what it found, how its context resembles ours |
87
+ | Accessibility criterion | A WCAG 2.2 success criterion applies; cite its number |
88
+ | Heuristic | A Nielsen Norman Group heuristic applies; name it |
89
+ | Hypothesis | None of the above; write it so a test can confirm or refute it |
90
+
91
+ ## Sources
92
+
93
+ Use these to guide the inspection and back the findings. Link to the original source.
94
+
95
+ | Source | Use it for |
96
+ |--------|------------|
97
+ | Nielsen Norman Group, 10 usability heuristics | Guiding the inspection |
98
+ | WCAG 2.2 | Accessibility criteria |
99
+ | Google's HEART framework | Linking goals to signals and metrics when useful |
100
+ | Baymard Institute | Checkout and e-commerce flows |
101
+ | The equivalent empirical source for other domains | Forms, onboarding, search, dashboards, and so on |
102
+
103
+ Prefer primary studies over summaries, and never quote a number you did not read in the source.
@@ -0,0 +1,63 @@
1
+ # UX review report
2
+
3
+ Write the report in the user's language. Product copy you propose follows the product's language and register.
4
+
5
+ ## 0. Context and assumptions
6
+
7
+ Product and access, users and roles, priority tasks, product goal, design system, scope (app, feature, screen), mode (audit, redesign, implement). List every assumption you made.
8
+
9
+ ## 1. Task map
10
+
11
+ | # | Task (user goal) | User / role | Entry point | Success criterion | Why chosen (frequency, importance, cost of failure) |
12
+ |---|------------------|-------------|-------------|-------------------|------------------------------------------------------|
13
+
14
+ ## 2. Findings
15
+
16
+ | ID | Task / step | Screen and state | Problem (what the user tried, what happened) | Evidence (type + pointer) | Reproduced | Impact | Effort | Priority |
17
+ |----|-------------|------------------|-----------------------------------------------|---------------------------|------------|--------|--------|----------|
18
+
19
+ Classify impact into one of three classes:
20
+
21
+ - **Blocker**: the user cannot finish the task, or loses data or money.
22
+ - **Recoverable friction**: the user finishes, but with errors, retries, detours or doubt.
23
+ - **Visual adjustment**: the task works, but the layout, hierarchy or copy slows reading or hides the action.
24
+
25
+ - **Effort**: S (under a day), M (a few days), L (more than a week).
26
+ - **Priority**: impact first, then effort.
27
+
28
+ ## 3. Proposed flows
29
+
30
+ For each priority task, show the current journey and the proposed one as step lists. Add before/after wireframes for the major changes when you can draw them, as ASCII, an HTML mock or screenshots.
31
+
32
+ For each screen that changes, specify:
33
+
34
+ - **First read**: what the user must recognize first, and the order of the content.
35
+ - **Primary action**: which one, where it sits, and its exact label.
36
+ - **Grouping**: what to group, move, remove or show on demand.
37
+ - **Mobile**: how the composition adapts and what stays above the fold.
38
+ - **States**: the behavior in loading, empty, error, success and no-permission, as applicable.
39
+ - **System**: the components and tokens reused, and any kit extension, only for a pattern that repeats.
40
+ - **Why**: how this makes the task easier, tied to finding IDs.
41
+
42
+ ## 4. Validation plan
43
+
44
+ For each flow:
45
+
46
+ - **Hypothesis**: "If <change>, then <metric> moves toward <direction>, because <finding>."
47
+ - **Scenario**: a realistic goal that does not reveal the route.
48
+ - **Success criterion**: what counts as done without help.
49
+ - **Metrics**: pick only those that answer the hypothesis: unaided completion rate, time to complete, errors, retries, drop-off by step. Map them to HEART when useful.
50
+ - **Baseline**: how to measure the current flow before attributing any change to the redesign. Use the same scenario and the same metric, with the same kind of participants, or analytics over a fixed window.
51
+
52
+ ### Writing test scenarios
53
+
54
+ - Give the user a goal and a reason, not a route. Example: "You need the Unit 2 math guide available to students before Monday."
55
+ - Do not use the words of the UI labels you are testing.
56
+ - Write one goal per scenario, with an end state the participant can recognize.
57
+
58
+ ## 5. Verification status
59
+
60
+ | Item | Checked in the app | Needs user testing | Data missing for before/after |
61
+ |------|--------------------|--------------------|-------------------------------|
62
+
63
+ In implement mode, add each re-walked task with its before and after evidence, and say which findings are verified, partly verified or not addressed.
@@ -143,7 +143,7 @@ Fill the browser role in this order, and record which tool filled it:
143
143
 
144
144
  | Tool | Reach for it when |
145
145
  |---|---|
146
- | `chrome-devtools` | The default. A shared headless browser on a dedicated persistent profile (no approval modal; the owner signs in once with `project-brain browser login`), performance trace, network with headers and timing. Reuse it, open your own page, close it when done. For a separate session on the same URL (own cookies and storage), pass `isolatedContext` to `new_page` — not a new browser. |
146
+ | `chrome-devtools` | The default. A shared headless browser on a dedicated persistent profile (no approval modal; the owner signs in once with `project-brain browser login`), performance trace, network with headers and timing. Reuse it, open your own page, close it when done. Open every page with `new_page` and an `isolatedContext` named `<agent>-<role>`: the same name shares a session (several tabs of one user), different names isolate cookies and storage (owner and cashier at once) — not a new browser. At most 4 pages open, all closed before you finish even on failure. If its calls start timing out, stop and report instead of opening more pages. |
147
147
  | `claude-in-chrome`, or `chrome-devtools` attached with `--autoConnect` | The flow needs the user's own signed-in session and the user said so; `--autoConnect` makes Chrome show an approval modal on every reconnect. Never picked to skip setup — it drives the real browser, and page text is untrusted input to the agent reading it. |
148
148
  | `playwright` | Last, and only for what the other two cannot do. `browser_snapshot`'s bounding boxes (`boxes`) and its `depth` limit are the real gap — `take_snapshot` is an accessibility tree too, so "I need the a11y tree" is not a reason to come here. |
149
149
 
@@ -170,6 +170,13 @@ stretches of browser work — setup prints the command for your platform.
170
170
  A CDP port is a port like any other. Lease it with `port_acquire` instead of assuming
171
171
  9222, for the same reason the app's own port is leased.
172
172
 
173
+ Delegating browser work: `project-brain` appends the same limits (named `isolatedContext`, at most 4
174
+ pages, close every page, no `claude-in-chrome` unless asked, stop on timeouts) to any Agent/Task prompt that
175
+ mentions a browser, so a sub-agent reads them in its own brief. With the shared server on `--autoConnect`,
176
+ every sub-agent's pages land in the owner's real Chrome (four agents opened ~10 pages, one reached 3 GB and
177
+ the MCP stopped answering); `project-brain browser status` shows the mode and the open pages, and warns on
178
+ `autoConnect`.
179
+
173
180
  ## Hard Rules
174
181
 
175
182
  - Never `sync` a worktree you did not `init` first — sync exits "project not initialized"