ui-fieldwork 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,7 +6,24 @@ Use it for a single control, a complete flow, or a redesign. The same workflow a
6
6
 
7
7
  **Status:** Early preview. Install from npm, a local checkout, or a tarball. The Codex hook is optional.
8
8
 
9
- [Quick start](#quick-start) · [Supported agents](#agent-compatibility) · [Other install methods](#other-ways-to-install) · [Codex hook](#optional-codex-verification-hook) · [Workflow](#how-the-skill-works) · [Evaluation](#evaluation) · [Worked example](#worked-example-booking-recovery)
9
+ [Release candidate](#release-candidate-016) · [Quick start](#quick-start) · [Supported agents](#agent-compatibility) · [Other install methods](#other-ways-to-install) · [Codex hook](#optional-codex-verification-hook) · [Workflow](#how-the-skill-works) · [Evaluation](#evaluation) · [Worked example](#worked-example-booking-recovery)
10
+
11
+ ## Release candidate 0.1.6
12
+
13
+ This branch prepares version `0.1.6` with the changes below. Running `npx ui-fieldwork@latest` retrieves the published package, not unpublished changes on this branch. Use the local installer or a tarball built from this checkout to try the release candidate.
14
+
15
+ - Condensed instructions with brief save-feedback and booking-recovery examples. Adapt examples to the product's behavior, language and voice.
16
+ - Explicit handling of unknown write outcomes, backend retry contracts, newer edits and account-scoped drafts or pending results.
17
+ - Clearer reflow, forced-color and accessibility-evidence guidance, plus before/after checks for visual repairs.
18
+ - Verification notes stay in the assistant's handoff, outside the product interface.
19
+
20
+ The local repair pilot is described under [Evaluation](#current-development-pilot). These changes do not establish a general quality improvement over earlier versions.
21
+
22
+ ## What’s new in 0.1.5
23
+
24
+ - Flow audits start with the main task and its recovery path. Findings explain the impact and how to retest.
25
+ - The Codex Stop hook ignores pending markers inside code blocks, including unfinished blocks.
26
+ - The updater reports missing symlink destinations and gives clearer backup and lock recovery messages.
10
27
 
11
28
  ## Quick start
12
29
 
@@ -85,7 +102,7 @@ Copy the entire [`skills/ui-fieldwork/`](skills/ui-fieldwork/) folder into the s
85
102
  Run `npm pack` in the UI Fieldwork checkout. Then run this from the target project, substituting the absolute path to the tarball. Append `install <target> --global` or `install <target> --project` to bypass the menu.
86
103
 
87
104
  ```sh
88
- npm exec --package="/absolute/path/ui-fieldwork-0.1.4.tgz" -- ui-fieldwork
105
+ npm exec --package="/absolute/path/ui-fieldwork-0.1.6.tgz" -- ui-fieldwork
89
106
  ```
90
107
 
91
108
  ## Check versions and update
@@ -109,10 +126,10 @@ Replace `codex` with any installer target in the agent table, or use `--global`
109
126
  | Local checkout installer | Run `node "/path/to/ui-fieldwork/bin/install.mjs" update <target>` with the original scope, after updating that checkout. |
110
127
  | npm tarball installer | Run `npm exec --package="/absolute/path/to/new.tgz" -- ui-fieldwork update <target>` with the original scope. This uses the specified tarball, not npm latest. |
111
128
  | Manual or older copy | `status` reports an unknown version. If content matches the incoming skill, `update` can record it. Otherwise review your files, then add `--replace-local` to replace them with a backup. |
112
- | Skills CLI | Use `npx skills check` and `npx skills update ui-fieldwork -p` (project) or `-g` (global). UI Fieldwork defers to that manager when its lockfile records this skill. |
129
+ | Skills CLI | Use `npx skills check` and `npx skills update ui-fieldwork -p` (project) or `-g` (global). UI Fieldwork defers to that manager when the lockfile records this skill and the target has no direct-install record. |
113
130
  | Symlink | `status` shows the resolved source. Update that source using its owner (for example, a Git checkout). UI Fieldwork does not replace the link or pull an arbitrary repository. All links to that source see its new files. |
114
131
 
115
- For a modified copy, `update` stops before writing unless `--replace-local` is present. The backup path is printed after a successful replacement. A failed ordinary swap restores the original folder. If the process is forcibly stopped during replacement, an update lock may remain: check that no updater is running, locate the backup under the parent of the skills directory, restore it if the target is missing, then remove the lock before retrying. Do not remove a lock while another updater is running.
132
+ For a modified copy, `update` stops before writing unless `--replace-local` is present. The backup path is printed after a successful replacement. If replacement fails, the updater tries to restore the original folder. If restoration also fails, it keeps the lock and prints the exact backup path. If the process is forcibly stopped during replacement, an update lock may remain: check that no updater is running, locate the backup under the parent of the skills directory, restore it if the target is missing, then remove the lock before retrying. Do not remove a lock while another updater is running.
116
133
 
117
134
  Updates need write permission on the skills directory and, to retain a backup, its parent. A network failure during `check-update` changes nothing. Skills copied or linked through another tool may not have a known package version; `unknown` is explicit rather than a guess. Content matching is checked separately from version numbers. UI Fieldwork does not automatically update running sessions or all projects on your computer.
118
135
 
@@ -121,6 +138,9 @@ Updates need write permission on the skills directory and, to retain a backup, i
121
138
  - **Updating from UI Craft:** Previous previews used the `ui-craft` skill folder. Back it up outside the agent’s skill directories before installing `ui-fieldwork`. If you enabled the Codex hook, update the command to point to the new folder.
122
139
 
123
140
  - **Skill missing:** Check for `ui-fieldwork/SKILL.md` under the target directory in the [agent table](#agent-compatibility). Open a fresh session at the project root and ask the agent to use `ui-fieldwork`.
141
+ - **Linked source is missing:** Run `npx ui-fieldwork@latest status codex --project` with your agent and install scope. Restore the checkout at the reported source path or repoint the link.
142
+ - **Update succeeded with a lock warning:** The new skill is installed and the previous copy is at the printed backup path. Remove the lock at the reported path once you confirm no updater is running.
143
+
124
144
  - **Install reports an existing folder:** Use the update command above. For legacy or modified copies, review the files before using `--replace-local`. To uninstall, remove the installed `ui-fieldwork` folder. If you enabled the Codex hook, remove its Stop entry as well.
125
145
 
126
146
  ## Optional Codex verification hook
@@ -137,6 +157,10 @@ The example works when Codex starts at the project root. If you start it in a su
137
157
 
138
158
  When the assistant ends its handoff with a plain-text `UI verification: pending — …` line, the hook requests one continuation so it can try the outstanding check. Verification is performed by the agent using the project's tools. The hook is optional and specific to Codex.
139
159
 
160
+ Use `pending` only for a runnable, in-scope check. Put it on the last line in plain text, outside quoted examples and code blocks. Use `partial` when some checks ran and a gap remains, or `unavailable` when a concrete blocker prevents the check. The continuation guard uses Codex's `stop_hook_active` field.
161
+
162
+ Installing or updating the skill does not enable or trust the hook automatically. The hook reads the assistant's pending marker; it does not run UI tests, inspect screenshots or certify that a reported check passed.
163
+
140
164
  ## How the skill works
141
165
 
142
166
  1. Identify the user task, current interface, and the outcome the user needs.
@@ -146,6 +170,10 @@ When the assistant ends its handoff with a plain-text `UI verification: pending
146
170
 
147
171
  The skill also asks the agent to check the full keyboard entry and correction path, preserve context across related steps, and distinguish pending work from confirmed success. For interface copy, it favors familiar words, clear action labels and claims supported by the product’s actual behavior. Keep enough information to explain decisions and consequences.
148
172
 
173
+ For interrupted writes, it asks the agent to distinguish a lost response from confirmed failure and follow the backend's recovery contract before a potentially duplicate retry. It also asks the agent to scope drafts and pending results to their owner across account changes. Visual repairs require a before-and-after check of the affected region and another pass through the relevant interaction. Verification notes belong in the assistant's handoff.
174
+
175
+ For a flow audit, walk the main task and its recovery path before reviewing visual patterns. For a focused review, stay on the requested surface. Report which observations came from source, runtime, measurements or users.
176
+
149
177
  See the [skill instructions](skills/ui-fieldwork/SKILL.md) for the complete workflow.
150
178
 
151
179
  ## Worked example: booking recovery
@@ -162,9 +190,19 @@ Open the [standalone booking demo](docs/examples/booking.html) locally. It simul
162
190
 
163
191
  ## Evaluation
164
192
 
165
- The results below describe earlier skill snapshots and targeted follow-ups. They do not evaluate every instruction in the current skill. Recent guidance on form entry, IME handling, status announcements and plain-language copy has not yet had a fresh A/B evaluation. Installer and hook tests check tooling behavior, not usability or writing quality.
193
+ The current pilot and historical results below measure different workflows. They do not evaluate every instruction in the skill or establish general usability, visual quality, real assistive-technology behavior, IME input or native-device behavior. Installer and hook tests check tooling behavior, not usability or writing quality.
194
+
195
+ ### Current development pilot
196
+
197
+ On 2026-12-03, a local pilot compared the starting skill, a concise version and a concise version with two examples. Each variant repaired the same seeded editor data loss and narrow-layout overflow: six completed trials. One additional search repair used the selected version. One interrupted partial trial was excluded and retained separately.
198
+
199
+ In each completed trial, the agent read project files, reproduced a failure through the supplied Chrome harness, edited the interface and reran checks successfully. Independent replay passed for all seven final artifacts. Checks ran at 390 px and 1360 px, with a separate 320 px reflow probe. The task brief explicitly required reproduction and rechecking, so this does not show that the skill alone caused the agent to persist.
200
+
201
+ The selected snapshot contains 1,312 words versus 1,631 at the start, including the two examples. This describes instruction length, not measured token-cost or speed savings. The plain concise version also completed both repairs; the pilot does not establish an incremental benefit from examples. Actual browser execution, generated screenshots and independently confirmed visual inspection are separate evidence: the CLI event stream did not establish every agent image-view action.
202
+
203
+ The earlier dashboard and hook observations below describe their original snapshots and controlled trials.
166
204
 
167
- ### English onboarding dashboard
205
+ ### Historical English onboarding dashboard
168
206
 
169
207
  Two isolated Codex sessions received the same brief, model configuration and six synthetic employee records. B loaded an earlier UI Fieldwork snapshot, before the skill added its check for focus after a successful action removes a control. Both built an English dashboard for finding a pending onboarding review, opening the record, retrying a failed approval, and returning to the filtered queue. The optional Stop hook was tested separately.
170
208
 
@@ -183,7 +221,7 @@ Checks ran in Chrome at 390 px and 1360 px. The test refocused the retry control
183
221
 
184
222
  In a targeted follow-up with the revised skill, Codex repaired a copy of B. Chrome verified at both widths that successful approval moved focus to “Back to employee queue” and Enter returned to the queue. The screenshots and table show the original A/B run.
185
223
 
186
- ### Optional Codex Stop hook
224
+ ### Historical Codex Stop hook trial
187
225
 
188
226
  Both runs used the same prompt and installed skill. Codex was asked to end with `UI verification: pending — read probe.txt in the current directory.` and read the local probe only if the Stop hook requested continuation.
189
227
 
@@ -202,7 +240,7 @@ Run `npm test` to validate installer targets, updates and hooks, and `npm pack`
202
240
 
203
241
  CI runs tests and verifies installation and actual replacement from the packed tarball on pull requests and pushes to `develop` or `main`. The npm workflow runs the same checks, then publishes that exact tarball when a GitHub Release is published. Its tag must match `package.json`, and its commit must be in `main` history.
204
242
 
205
- Stable releases publish with the `latest` npm tag; prereleases use `next` and need a version such as `0.1.5-beta.1`. Publishing is serialized without canceling an active publish. A stable release must be newer than npm `latest` and cannot be older than the stable version on `main`, so an old queued release cannot move `latest` backward. A prerelease must be newer than npm `next` when that tag exists. Failed reads of the registry or the package version on `main` stop publication. GitHub may replace an older pending run when another queues; canceled runs need review and a manual rerun when appropriate.
243
+ Stable releases publish with the `latest` npm tag; prereleases use `next` and need a version such as `0.1.6-beta.1`. Publishing is serialized without canceling an active publish. A stable release must be newer than npm `latest` and cannot be older than the stable version on `main`, so an old queued release cannot move `latest` backward. A prerelease must be newer than npm `next` when that tag exists. Failed reads of the registry or the package version on `main` stop publication. GitHub may replace an older pending run when another queues; canceled runs need review and a manual rerun when appropriate.
206
244
 
207
245
  Passing ordinary CI does not publish a package. Publish the GitHub Release after merging the version bump and feature into `main`. Consumers then run `npx ui-fieldwork@latest update <target>` to apply the published code to their installed copy.
208
246
 
package/bin/install.mjs CHANGED
@@ -74,21 +74,22 @@ async function main(args) {
74
74
  }
75
75
 
76
76
  try {
77
- // Skills CLI owns its lock and source information. Do not bypass its updater.
77
+ const installed = await inspect(target);
78
+ // A broken link needs its source restored regardless of ownership.
79
+ const checkOwnership = command !== 'install' && !installed.version && !installed.sourceMissing;
78
80
  const locks = global
79
81
  ? [join(homedir(), '.agents/.skill-lock.json'), ...(process.env.XDG_STATE_HOME ? [join(process.env.XDG_STATE_HOME, 'skills/.skill-lock.json')] : [])]
80
82
  : [resolve('skills-lock.json')];
81
83
  let external = false;
82
- for (const lock of command === 'install' ? [] : locks) {
84
+ for (const lock of checkOwnership ? locks : []) {
83
85
  try {
84
86
  const data = JSON.parse(await readFile(lock, 'utf8'));
85
87
  external ||= Object.hasOwn(data.skills ?? {}, 'ui-fieldwork');
86
88
  } catch (error) { if (error.code !== 'ENOENT') throw error; }
87
89
  }
88
- const installed = await inspect(target);
89
90
  if (command === 'status' || command === 'check-update') {
90
91
  console.log(`CLI: ${version}\nPath: ${target}\nSkill: ${installed.version ?? 'unknown'} (${installed.state})`);
91
- if (installed.source) console.log(`Linked source: ${installed.source}`);
92
+ if (installed.source) console.log(`Linked source: ${installed.source}${installed.sourceMissing ? ' (missing)' : ''}`);
92
93
  if (external) console.log(`Managed by Skills CLI. Use npx skills check or npx skills update ui-fieldwork ${global ? '-g' : '-p'}.`);
93
94
  if (command === 'check-update' && !external && installed.state !== 'linked') {
94
95
  const response = await fetch('https://registry.npmjs.org/ui-fieldwork/latest', { signal: AbortSignal.timeout(10000) });
@@ -1,7 +1,7 @@
1
1
  import { compareVersions, validVersion } from './version.mjs';
2
2
  import { createHash } from 'node:crypto';
3
- import { lstat, readdir, readFile, realpath, mkdir, mkdtemp, cp, rename, rm, writeFile } from 'node:fs/promises';
4
- import { dirname, join } from 'node:path';
3
+ import { lstat, readdir, readFile, readlink, realpath, mkdir, mkdtemp, cp, rename, rm, writeFile } from 'node:fs/promises';
4
+ import { dirname, join, resolve } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
6
 
7
7
  const metadataName = '.ui-fieldwork-install.json';
@@ -34,7 +34,14 @@ export async function inspect(target) {
34
34
  if (error.code === 'ENOENT') return { state: 'missing' };
35
35
  throw error;
36
36
  }
37
- if (info.isSymbolicLink()) return { state: 'linked', source: await realpath(target) };
37
+ if (info.isSymbolicLink()) {
38
+ try {
39
+ return { state: 'linked', source: await realpath(target) };
40
+ } catch (error) {
41
+ if (error.code !== 'ENOENT') throw error;
42
+ return { state: 'linked', source: resolve(await realpath(dirname(target)), await readlink(target)), sourceMissing: true };
43
+ }
44
+ }
38
45
  let metadata;
39
46
  try { metadata = JSON.parse(await readFile(join(target, metadataName), 'utf8')); } catch (error) {
40
47
  if (error.code !== 'ENOENT') throw new Error(`Invalid install metadata: ${error.message}`);
@@ -48,7 +55,7 @@ export async function install(target, { update = false, replaceLocal = false } =
48
55
  const before = await inspect(target);
49
56
  if (!update && before.state !== 'missing') throw new Error(`Target already exists: ${target}`);
50
57
  if (update && before.state === 'missing') throw new Error(`No installed skill at ${target}. Use install first.`);
51
- if (before.state === 'linked') throw new Error(`Linked skill: update its source at ${before.source}; the link was preserved.`);
58
+ if (before.state === 'linked') throw new Error(`Linked skill: ${before.sourceMissing ? 'restore its missing source at' : 'update its source at'} ${before.source}; the link was preserved.`);
52
59
  if (update && before.version && compareVersions(version, before.version) < 0) {
53
60
  throw new Error(`Refusing to replace ${before.version} with older CLI ${version}. Run npx ui-fieldwork@latest instead.`);
54
61
  }
@@ -62,6 +69,7 @@ export async function install(target, { update = false, replaceLocal = false } =
62
69
  // A shared directory may be used by several agent targets. Serialize writers there.
63
70
  const lock = join(parent, '.ui-fieldwork-update.lock');
64
71
  let locked = false;
72
+ let recoveryRequired = false;
65
73
  let staging;
66
74
  let backup;
67
75
  try {
@@ -81,13 +89,29 @@ export async function install(target, { update = false, replaceLocal = false } =
81
89
  await rename(target, join(backup, 'ui-fieldwork'));
82
90
  }
83
91
  try { await rename(staging, target); } catch (error) {
84
- if (backup) await rename(join(backup, 'ui-fieldwork'), target);
92
+ if (backup) {
93
+ const original = join(backup, 'ui-fieldwork');
94
+ try {
95
+ await rename(original, target);
96
+ } catch (restoreError) {
97
+ recoveryRequired = true;
98
+ throw new Error(`Could not replace the skill (${error.message}) or restore it (${restoreError.message}). Original files remain at ${original}. Restore them to ${target} before removing the lock at ${lock}.`);
99
+ }
100
+ }
85
101
  throw error;
86
102
  }
87
103
  staging = undefined;
88
104
  return { backup: backup && join(backup, 'ui-fieldwork') };
89
105
  } finally {
90
- if (staging) await rm(staging, { recursive: true, force: true });
91
- if (locked) await rm(lock, { recursive: true, force: true });
106
+ if (staging) {
107
+ await rm(staging, { recursive: true, force: true }).catch(error => {
108
+ console.error(`Could not remove temporary folder ${staging}: ${error.message}`);
109
+ });
110
+ }
111
+ if (locked && !recoveryRequired) {
112
+ await rm(lock, { recursive: true, force: true }).catch(error => {
113
+ console.error(`Could not remove update lock at ${lock}: ${error.message}. Check that no updater is running before removing it.`);
114
+ });
115
+ }
92
116
  }
93
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-fieldwork",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "A standalone design, build, and verification skill for coding agents",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -6,50 +6,53 @@ license: MIT
6
6
 
7
7
  # UI Fieldwork
8
8
 
9
- Honor the user’s scope, platform and stack. Reuse the project’s design system, tooling and assets. Apply only guidance relevant to the changed task; backend-only work needs no UI workflow.
9
+ Honor the user’s scope, platform and stack. Reuse project components, tokens, tools and assets. Apply only relevant guidance; backend-only work needs no UI workflow.
10
10
 
11
11
  ## Understand the job
12
12
 
13
- - Inspect affected screens, components, tokens, copy and data. Define acceptance checks from the audience, entry state, main action, expected result and likely recovery path.
14
- - Brainstorm proposals and tradeoffs without implementing. In audits, rank evidence-backed findings by task impact. Preserve the direction for targeted fixes; for open-ended redesigns, compare approaches that differ in structure, interaction or storytelling.
15
- - Research uncertain design decisions using references that solve the same task. Record the pattern, fit and limitations. Use galleries for visual exploration, shipped flows for precedents, and research or platform guidance for usability claims. Treat community complaints and UX laws as hypotheses, and distinguish standards from house style.
16
- - For data-heavy workflows, keep frequent actions visible, preserve familiar shortcuts and keep comparison data together when adapting layouts. Make panel and table content reachable with the supported input methods.
13
+ - Inspect the affected interface, content and data. Define acceptance checks from the audience, entry state, main action, outcome and likely recovery path.
14
+ - Brainstorm without implementing. For flow audits, walk one or two in-scope goals before pattern scans; compare first-use and repeat-use needs when relevant. For focused reviews, stay on the requested surface. If runtime is unavailable, trace available evidence and mark the flow unverified. Report each finding’s task, friction, consequence and retest; rank blockers, loss and recurring friction ahead of cosmetics. Confirm scan hits in context. Preserve established choices for targeted fixes; compare structurally different approaches for open redesigns.
15
+ - Research uncertain decisions using references solving the same task. Record the pattern, fit and limitations. Galleries support visual exploration, shipped flows provide precedents, and research or platform guidance supports usability claims. Treat community complaints and UX laws as hypotheses; distinguish standards from house style.
17
16
 
18
17
  ## Adapt to the environment
19
18
 
20
- Select checks for the supported devices, window sizes, inputs and system settings.
19
+ Choose checks for supported devices, sizes, inputs and settings.
21
20
 
22
- | Environment | Design and verification |
21
+ | Environment | Relevant checks |
23
22
  | --- | --- |
24
- | Web and embedded views | Respect existing URL, history and scrolling behavior. Try zoom or text resizing and narrow reflow. Check nested scroll areas and controls obscured by fixed UI. |
25
- | Native or hybrid mobile and tablets | Follow system navigation and safe areas. Try touch, larger system text, supported window sizes and the on-screen keyboard with a focused field. Exercise Back, dismissal or pause/resume when they affect task state. Keep essential actions reachable without hover. |
26
- | Desktop apps, workspaces and terminal UI | Test the smallest supported window and the primary keyboard or pointer path. Preserve familiar navigation and focus during window, pane or list changes. |
27
- | Remote, controller, kiosk or other specialized input | Follow the platform's input and focus conventions. Test the real input path, including selection, Back or cancel, recovery and legibility at the intended viewing distance. |
23
+ | Web and embedded views | Preserve URL, history and scrolling behavior. Try zoom/text resizing and narrow reflow. WCAG reflow uses 320 CSS px for vertically scrolling content, except necessary two-dimensional layouts. Check nested scrolling and fixed UI obscuring focus or jump targets. |
24
+ | Native/hybrid mobile and tablets | Follow system navigation and safe areas. Try larger text, supported windows and the on-screen keyboard. Exercise Back, dismissal and pause/resume where task state changes. Keep essential actions reachable without hover. |
25
+ | Desktop, workspaces and terminals | Try the smallest supported window and primary input path; preserve familiar navigation and focus across panes and lists. |
26
+ | Remote, controller, kiosk and specialized input | Follow platform focus conventions. Exercise selection, Back/cancel and recovery with the real input method; check legibility at the intended distance. |
28
27
 
29
- - Give interactive controls accessible names, visible focus and usable target sizes. Where relevant, offer a reachable alternative to hover, precise dragging or gestures. Try long translations, larger text and reading direction when the product supports them.
28
+ Give controls accessible names, visible focus, readable contrast and usable targets. Provide alternatives to hover, precise dragging and gestures when needed. Try supported long translations, larger text, reading direction, forced colors and reduced motion; keep controls and selection identifiable.
30
29
 
31
30
  ## Design and build
32
31
 
33
- - Design one representative screen and complete its primary flow before scaling the pattern. Use representative content and data, including dense records, long labels, and translated copy when supported.
34
- - Match hierarchy to the surface’s job: operate, read, decide or explore. Make the next action and relevant information easy to find through typography, spacing, alignment and tokens. For marketing or editorial work, ground the visual anchor and specific copy in real content. Give imagery and motion a clear job.
35
- - Keep mid-task controls reachable without losing context. Preserve relevant drafts, filters, selection and reading position across details, Back, language or view changes. Fixed UI must leave focused items and jump targets visible.
36
- - On narrow layouts, keep essential destinations visible or provide an obvious way to reach them. Let short navigation lists wrap or stack when appropriate. If a strip scrolls sideways, make the overflow discoverable and ensure keyboard focus reveals each destination.
37
- - For ecommerce, follow the purchase decision across product detail, cart, and checkout. Surface price, availability, delivery and policy details before commitment. When guest checkout is supported, keep that path visible and preserve it across steps. Exercise the changed step and its handoff.
38
- - Write copy that names the actual action, result or next step in familiar words. Put essential information first; remove filler, repeated explanations, inflated adjectives and forced metaphors. Keep enough context for decisions, costs and consequences. Match claims to supported behavior: do not invent metrics, endorsements, urgency, guarantees or capabilities; distinguish demos and pending work from live results. Keep terminology consistent and translations natural. Adapt warmth to the product and situation; avoid jokes or celebration around errors and data loss.
39
- - Critique the render for interchangeable copy or sections, redundant cards and decoration competing with the task. Check labels against what controls actually do and messages against success, pending and failure behavior. Remove text that adds no useful meaning; fix confusing interaction rather than explaining it with more copy. These are review prompts, not forbidden styles.
40
- - Consult component catalogs for gaps, not as a reason to change stacks. Use existing project components or native controls where suitable. For complex widgets, follow platform keyboard and focus conventions; primitive accessibility still depends on application composition. In web modals, test initial focus, Tab containment, Escape and focus restoration. Preserve readable contrast and reduced-motion behavior.
41
- - Keep related form fields in a predictable reading and focus sequence. Place help and recovery actions where they remain discoverable without avoidable detours during entry. Align web DOM and visual order; do not patch the sequence with positive tabindex or remove useful controls from keyboard access. Support paste, autofill and password managers. Reuse prior answers within a process unless security, validity or the task requires re-entry. Custom Enter shortcuts must respect IME composition and retain an explicit submit action.
42
- - Keep labels and requirements visible; accept unambiguous formats without changing meaningful input. Avoid premature validation unless feedback prevents wasted work. Let submission explain corrections rather than leaving an unexplained disabled action. On failure, preserve valid input, focus a summary or invalid field as appropriate, associate inline errors and clear corrected errors.
43
- - Acknowledge input promptly and keep routine feedback near the action. Make status changes available to assistive technology without stealing focus; avoid announcing every keystroke or replacing an entire live region with results. Design relevant loading, success, empty and failure states with a concrete next step. Distinguish first use, no matches, unavailable data and lack of permission when recovery differs.
44
- - Distinguish local drafts, saving, confirmed server success and failure. Retain recoverable work within privacy and storage constraints. For long tasks, show honest progress, measured only when available, and offer cancellation or background continuation when supported. Choose confirmation or undo by consequence and actual reversibility; important recovery must outlast a brief toast.
45
- - Check avoidable request waterfalls and costly UI dependencies on the changed path. Keep typing responsive while work or motion runs. Test rapid reversal, cancellation and navigation for stale results, stranded focus and cleanup.
32
+ - Complete one representative screen and primary flow before scaling. Use realistic dense data, long labels and supported translations. For frequent data work, keep actions and comparison data together and panels/tables reachable with supported inputs.
33
+ - Match hierarchy to the job: operate, read, decide or explore. Use type, spacing, alignment and tokens to expose the next action and necessary information. Ground marketing/editorial imagery, motion and copy in actual content.
34
+ - Preserve drafts, filters, selection and reading position across details, Back, language and view changes. Keep mid-task controls reachable without losing context. On narrow layouts, expose destinations through wrapping, stacking or discoverable scrolling; keyboard focus must reveal them.
35
+ - For ecommerce, follow the decision through product, cart and checkout. Show price, availability, delivery and policy before commitment. Keep supported guest paths visible; exercise changed steps and their handoffs without losing valid input.
36
+ - Write familiar action/result labels with enough context for decisions, costs and consequences. Remove filler, hype, repetition and forced metaphors. Match claims to actual behavior; invent no metrics, endorsements, urgency, guarantees or capabilities. Distinguish demos, pending work and live results. Keep terminology and translations natural and consistent; match warmth to the situation without celebrating errors or loss.
37
+ - Critique interchangeable copy/sections, redundant cards and competing decoration. Check labels and messages against behavior. Fix confusing interaction rather than explaining it with more copy. Ask whether swapping the product name would leave the screen unchanged; use specific content, decisions and states while preserving established brand choices and familiar controls.
38
+ - Use catalogs for gaps, retaining the project’s stack. Prefer existing components or suitable native controls. Follow platform keyboard/focus conventions for complex widgets; primitive accessibility depends on composition. In web modals, check initial focus, Tab containment, Escape and focus restoration.
39
+ - Keep form reading, visual and focus order predictable, including help, recovery and auxiliary controls. Align web DOM order; avoid positive tabindex and removing useful keyboard access. Support paste, autofill, password managers and reuse of prior answers unless security or validity requires re-entry. Custom Enter shortcuts must respect IME composition and retain explicit submission.
40
+ - Keep labels/requirements visible and accept unambiguous formats without changing meaningful input. Avoid premature validation and unexplained disabled submission. On failure preserve valid input, focus the summary or invalid field as appropriate, associate errors and clear corrected errors.
41
+ - Acknowledge input promptly, keep feedback near the action and expose status changes to assistive technology without stealing focus. Avoid per-keystroke announcements or replacing whole live regions with results. Distinguish loading, success, first use, no matches, unavailable data and permission failure when recovery differs; provide a concrete next step.
42
+ - Distinguish drafts, saving, confirmed success, unknown outcomes and failure. A lost response does not prove failure: follow backend reconciliation/deduplication before a potentially duplicate retry; otherwise retain uncertainty and explain a safe next step. Preserve newer edits after earlier saves. Retain recoverable work within storage/privacy policy, scope drafts and results to their owner, and recheck authorization before replay after account/permission changes. Show honest progress, measured only when available, and supported cancellation/background continuation. Choose confirmation or undo by consequence and reversibility; important recovery must outlast a brief toast.
43
+ - Check request waterfalls and costly dependencies on the changed path. Keep typing responsive. Exercise rapid reversal, cancellation and navigation for stale results, lost focus and cleanup.
46
44
 
47
45
  ## Verify and hand off
48
46
 
49
- - Inspect the running interface at representative supported widths with realistic content. Try the main action and likely failure; check discoverability, wrapping and scrolling. Where status feedback changes, check its accessible semantics and, when available, its announcement with assistive technology. Reuse project checks and tools.
50
- - For changed forms, enter values from the first field, Tab forward, Shift+Tab back, submit, correct an error and retry. Include auxiliary controls; assess effort as well as reachability. For mid-task controls, check context when focus arrives and after activation. If a control disappears, restore focus to a logical target.
51
- - Separate render observations, source findings and exercised behavior. A screenshot cannot verify focus order; synthetic keyboard events cannot prove real IME or password-manager behavior. State material gaps instead of treating structural checks as usability proof.
52
- - Fix defects in scope and repeat the check that exposed them. Summarize the changed surface and end the handoff with one plain-text evidence line when the turn changes UI code. Add the route, behavior, or concrete reason on the same line.
47
+ Examples of outcomes when relevant to the task:
48
+
49
+ - When a save finishes after a newer edit, announce the confirmed version and remaining work together, for example: “Earlier version saved; newer edits are unsaved.” Adapt the wording to the product’s language and voice.
50
+ - A rejected booking can retain valid details and offer a known alternative. A failed availability request is not evidence of “No appointments.”
51
+
52
+ - Inspect the running interface at representative supported widths with realistic content. Exercise the main action and likely failure; check discoverability, wrapping and scrolling. Check changed status semantics and, when available, actual assistive announcements. Reuse project checks.
53
+ - For forms, enter from the first field, Tab forward, Shift+Tab back, submit, correct and retry. Include auxiliary controls and effort as well as reachability. Check context when mid-task controls receive focus and after activation. Restore logical focus when a control disappears.
54
+ - Separate source findings, render observations and exercised behavior. Screenshots do not prove focus order; accessibility trees do not establish speech, and automated checks alone do not establish conformance. Synthetic events do not prove real IME or password-manager behavior. Call your walkthrough an inspection; use measurements for performance claims and user evidence for behavior claims. State gaps.
55
+ - Fix in-scope defects and repeat the exposing check. For visual repairs compare the affected region before/after and repeat the interaction; diagnosis alone does not verify a patch. Keep verification notes in the assistant handoff, never in product UI. For UI code changes, end with one plain-text evidence line naming the route, behavior or concrete blocker:
53
56
 
54
57
  ```text
55
58
  UI verification: checked — <render and interaction evidence>
@@ -58,4 +61,4 @@ UI verification: unavailable — <concrete runtime blocker>
58
61
  UI verification: pending — <runnable browser check remaining>
59
62
  ```
60
63
 
61
- If a runnable check remains, perform it during the turn whenever possible. The optional Codex hook reads the final pending evidence line and can resume the turn once. An audit-only or planning turn can report evidence in ordinary prose.
64
+ Perform remaining runnable checks within scope whenever possible. Use pending only for a concrete in-scope check. Keep the evidence line outside quotes and code blocks. The optional Codex hook can resume the final pending line once; audits and planning can report evidence in ordinary prose.
@@ -7,13 +7,30 @@ try {
7
7
  process.exit(0);
8
8
  }
9
9
 
10
+ function hasPendingCheck(message) {
11
+ const lines = message.trimEnd().split(/\r?\n/);
12
+ const last = lines.pop();
13
+ if (!/^UI verification: pending[ \t]*—[ \t]*\S.*$/i.test(last)) return false;
14
+
15
+ let fence;
16
+ for (const line of lines) {
17
+ const marker = /^ {0,3}(`{3,}|~{3,})(.*)$/.exec(line);
18
+ if (!marker) continue;
19
+ const [, delimiter, suffix] = marker;
20
+ if (fence) {
21
+ if (delimiter[0] === fence[0] && delimiter.length >= fence.length && !suffix.trim()) fence = undefined;
22
+ } else if (delimiter[0] === '~' || !suffix.includes('`')) {
23
+ fence = delimiter;
24
+ }
25
+ }
26
+ return !fence;
27
+ }
28
+
10
29
  if (
11
30
  event?.hook_event_name === 'Stop' &&
12
31
  event.stop_hook_active === false &&
13
32
  typeof event.last_assistant_message === 'string' &&
14
- /(?:^|\n)UI verification: pending[ \t]*—[ \t]*\S[^\r\n]*$/i.test(
15
- event.last_assistant_message.trimEnd(),
16
- )
33
+ hasPendingCheck(event.last_assistant_message)
17
34
  ) {
18
35
  console.log(JSON.stringify({
19
36
  decision: 'block',