ui-fieldwork 0.1.2 → 0.1.4

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
@@ -85,15 +85,43 @@ Copy the entire [`skills/ui-fieldwork/`](skills/ui-fieldwork/) folder into the s
85
85
  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
86
 
87
87
  ```sh
88
- npm exec --package="/absolute/path/ui-fieldwork-0.1.2.tgz" -- ui-fieldwork
88
+ npm exec --package="/absolute/path/ui-fieldwork-0.1.4.tgz" -- ui-fieldwork
89
89
  ```
90
90
 
91
+ ## Check versions and update
92
+
93
+ Use `@latest` to run the newest published CLI. These commands describe the CLI in this checkout; they become available through npx after it is published.
94
+
95
+ ```sh
96
+ npx ui-fieldwork@latest --version
97
+ npx ui-fieldwork@latest status codex --project
98
+ npx ui-fieldwork@latest check-update codex --project
99
+ npx ui-fieldwork@latest update codex --project
100
+ ```
101
+
102
+ Replace `codex` with any installer target in the agent table, or use `--global` for a user-level install. `--version` reports the CLI version. `status` reports the installed skill version, path and whether its content differs from its install record. `check-update` reads npm’s latest version without changing files. Different versions do not always mean an upgrade: a local checkout may be ahead of npm.
103
+
104
+ `update` installs the skill bundled with the CLI you run. It verifies the copied content, records the version and keeps the previous folder in a hidden backup directory outside the agent’s skills directory. It does not modify your agent configuration or hook entries. A successful update changes the files at the existing install path; no manual removal or reinstall is needed. Open a fresh agent session to load them.
105
+
106
+ | Installation method | Update path |
107
+ | --- | --- |
108
+ | npm/npx copy, project or global | Run `npx ui-fieldwork@latest update <target>` with the original scope. |
109
+ | Local checkout installer | Run `node "/path/to/ui-fieldwork/bin/install.mjs" update <target>` with the original scope, after updating that checkout. |
110
+ | 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
+ | 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. |
113
+ | 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
+
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.
116
+
117
+ 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
+
91
119
  ## Troubleshooting
92
120
 
93
121
  - **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.
94
122
 
95
123
  - **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`.
96
- - **Install reports an existing folder:** The installer preserves that folder. To update, back it up outside the client's skill directories, then rerun the installer. To uninstall, remove the installed `ui-fieldwork` folder. If you enabled the Codex hook, remove its Stop entry as well.
124
+ - **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.
97
125
 
98
126
  ## Optional Codex verification hook
99
127
 
@@ -116,6 +144,8 @@ When the assistant ends its handoff with a plain-text `UI verification: pending
116
144
  3. Implement the flow and its relevant loading, error, empty, and recovery states.
117
145
  4. Inspect the rendered interface, exercise the changed behavior, and report the checks performed.
118
146
 
147
+ 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
+
119
149
  See the [skill instructions](skills/ui-fieldwork/SKILL.md) for the complete workflow.
120
150
 
121
151
  ## Worked example: booking recovery
@@ -132,6 +162,8 @@ Open the [standalone booking demo](docs/examples/booking.html) locally. It simul
132
162
 
133
163
  ## Evaluation
134
164
 
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.
166
+
135
167
  ### English onboarding dashboard
136
168
 
137
169
  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.
@@ -164,14 +196,15 @@ Both runs used the same prompt and installed skill. Codex was asked to end with
164
196
 
165
197
  ## Development
166
198
 
167
- Run `npm test` to validate installer targets and hooks, and `npm pack` to build the distributable. See the [MIT license](LICENSE).
199
+ Run `npm test` to validate installer targets, updates and hooks, and `npm pack` to build the distributable. See the [MIT license](LICENSE).
168
200
 
169
201
  ### Release to npm
170
202
 
171
- CI runs tests and installs the packed skill on pull requests to `develop` or
172
- `main`. The npm workflow publishes when a stable GitHub Release is published.
173
- Its tag must match the version in `package.json` and its commit must be in
174
- `main` history.
203
+ 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
+
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.
206
+
207
+ 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.
175
208
 
176
209
  Before publishing the first release through Actions, configure
177
210
  [npm Trusted Publishing](https://docs.npmjs.com/trusted-publishers/) for
package/bin/install.mjs CHANGED
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { lstatSync } from 'node:fs';
3
- import { cp, mkdir, mkdtemp, rename, rm } from 'node:fs/promises';
2
+ import { readFile } from 'node:fs/promises';
3
+ import { install, inspect, version } from './installation.mjs';
4
4
  import { homedir } from 'node:os';
5
- import { dirname, isAbsolute, join, resolve } from 'node:path';
6
- import { fileURLToPath } from 'node:url';
5
+ import { isAbsolute, join, resolve } from 'node:path';
7
6
  import { select, tone } from './menu.mjs';
8
7
 
9
8
  const agents = {
@@ -22,11 +21,17 @@ const agents = {
22
21
 
23
22
  const usage = [
24
23
  'Usage: ui-fieldwork',
25
- ` ui-fieldwork install <${Object.keys(agents).join('|')}> [--project|--global]`,
24
+ ` ui-fieldwork <install|status|check-update|update> <${Object.keys(agents).join('|')}> [--project|--global]`,
25
+ ' ui-fieldwork update <target> [--project|--global] [--replace-local]',
26
+ ' ui-fieldwork --version',
26
27
  ].join('\n');
27
28
 
28
29
  async function main(args) {
29
30
  let client;
31
+ let command = 'install';
32
+ const replaceLocal = args.includes('--replace-local');
33
+ args = args.filter(arg => arg !== '--replace-local');
34
+ if (args.length === 1 && args[0] === '--version') { console.log(version); return; }
30
35
  let global = false;
31
36
  const interactive = args.length === 0 && process.stdin.isTTY && process.stdout.isTTY;
32
37
  if (interactive) {
@@ -42,9 +47,11 @@ async function main(args) {
42
47
  console.log(usage);
43
48
  return;
44
49
  } else {
45
- const [command, target, scope] = args;
50
+ const [action, target, scope] = args;
51
+ command = action;
46
52
  if (
47
- command !== 'install' || !Object.hasOwn(agents, target) ||
53
+ !['install', 'status', 'check-update', 'update'].includes(command) || !Object.hasOwn(agents, target) ||
54
+ (replaceLocal && command !== 'update') ||
48
55
  args.length > 3 || (scope !== undefined && !['--project', '--global'].includes(scope))
49
56
  ) {
50
57
  console.error(usage);
@@ -66,29 +73,41 @@ async function main(args) {
66
73
  if (await select('Confirm installation', [['install', 'Install skill'], ['cancel', 'Cancel']]) !== 'install') return;
67
74
  }
68
75
 
69
- let staging;
70
76
  try {
71
- const skills = dirname(target);
72
- await mkdir(skills, { recursive: true });
73
- if (lstatSync(target, { throwIfNoEntry: false })) {
74
- throw new Error(`Target already exists: ${target}`);
77
+ // Skills CLI owns its lock and source information. Do not bypass its updater.
78
+ const locks = global
79
+ ? [join(homedir(), '.agents/.skill-lock.json'), ...(process.env.XDG_STATE_HOME ? [join(process.env.XDG_STATE_HOME, 'skills/.skill-lock.json')] : [])]
80
+ : [resolve('skills-lock.json')];
81
+ let external = false;
82
+ for (const lock of command === 'install' ? [] : locks) {
83
+ try {
84
+ const data = JSON.parse(await readFile(lock, 'utf8'));
85
+ external ||= Object.hasOwn(data.skills ?? {}, 'ui-fieldwork');
86
+ } catch (error) { if (error.code !== 'ENOENT') throw error; }
75
87
  }
76
- // shortcut: a forced stop can leave a hidden staging folder, add cleanup if it becomes recurring.
77
- staging = await mkdtemp(join(skills, '.ui-fieldwork-install-'));
78
- const source = fileURLToPath(new URL('../skills/ui-fieldwork/', import.meta.url));
79
- await cp(source, staging, { recursive: true });
80
- if (lstatSync(target, { throwIfNoEntry: false })) {
81
- throw new Error(`Target already exists: ${target}`);
88
+ const installed = await inspect(target);
89
+ if (command === 'status' || command === 'check-update') {
90
+ console.log(`CLI: ${version}\nPath: ${target}\nSkill: ${installed.version ?? 'unknown'} (${installed.state})`);
91
+ if (installed.source) console.log(`Linked source: ${installed.source}`);
92
+ if (external) console.log(`Managed by Skills CLI. Use npx skills check or npx skills update ui-fieldwork ${global ? '-g' : '-p'}.`);
93
+ if (command === 'check-update' && !external && installed.state !== 'linked') {
94
+ const response = await fetch('https://registry.npmjs.org/ui-fieldwork/latest', { signal: AbortSignal.timeout(10000) });
95
+ if (!response.ok) throw new Error(`npm registry returned ${response.status}`);
96
+ const latest = await response.json();
97
+ if (typeof latest.version !== 'string') throw new Error('npm registry returned no version.');
98
+ console.log(`npm latest: ${latest.version}`);
99
+ console.log(installed.version === latest.version ? 'Installed version matches npm latest.' : 'Versions differ or the installed version is unknown. Review before updating.');
100
+ }
101
+ return;
82
102
  }
83
- await rename(staging, target);
84
- staging = undefined;
85
- console.log(`${tone('32', 'Installed UI Fieldwork')} in ${target}`);
86
- if (interactive) console.log('Open a fresh agent session and ask it to use ui-fieldwork.');
103
+ if (external && command === 'update') throw new Error(`Managed by Skills CLI. Run npx skills update ui-fieldwork ${global ? '-g' : '-p'} to preserve its lockfile.`);
104
+ const result = await install(target, { update: command === 'update', replaceLocal });
105
+ console.log(`${tone('32', result.unchanged ? 'Already matches this CLI' : command === 'update' ? 'Updated UI Fieldwork' : 'Installed UI Fieldwork')} ${version} in ${target}`);
106
+ if (result.backup) console.log(`Previous skill saved at ${result.backup}`);
107
+ console.log('Open a fresh agent session to load the installed skill.');
87
108
  } catch (error) {
88
- console.error(`UI Fieldwork installation failed: ${error.message}`);
109
+ console.error(`UI Fieldwork ${command} failed: ${error.message}`);
89
110
  process.exitCode = 1;
90
- } finally {
91
- if (staging) await rm(staging, { recursive: true, force: true });
92
111
  }
93
112
  }
94
113
 
@@ -0,0 +1,93 @@
1
+ import { compareVersions, validVersion } from './version.mjs';
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';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const metadataName = '.ui-fieldwork-install.json';
8
+ export const source = fileURLToPath(new URL('../skills/ui-fieldwork/', import.meta.url));
9
+ export const version = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8')).version;
10
+
11
+ async function fingerprint(path) {
12
+ const hash = createHash('sha256');
13
+ async function visit(directory, prefix = '') {
14
+ for (const entry of (await readdir(directory, { withFileTypes: true })).sort((a, b) => a.name.localeCompare(b.name, 'en'))) {
15
+ const name = prefix + entry.name;
16
+ if (name === metadataName) continue;
17
+ if (entry.isSymbolicLink()) throw new Error(`Symlink inside skill: ${name}`);
18
+ if (entry.isDirectory()) await visit(join(directory, entry.name), name + '/');
19
+ else if (entry.isFile()) {
20
+ hash.update(JSON.stringify(name));
21
+ const data = await readFile(join(directory, entry.name));
22
+ hash.update(String(data.length) + ':');
23
+ hash.update(data);
24
+ } else throw new Error(`Unsupported file: ${name}`);
25
+ }
26
+ }
27
+ await visit(path);
28
+ return hash.digest('hex');
29
+ }
30
+
31
+ export async function inspect(target) {
32
+ let info;
33
+ try { info = await lstat(target); } catch (error) {
34
+ if (error.code === 'ENOENT') return { state: 'missing' };
35
+ throw error;
36
+ }
37
+ if (info.isSymbolicLink()) return { state: 'linked', source: await realpath(target) };
38
+ let metadata;
39
+ try { metadata = JSON.parse(await readFile(join(target, metadataName), 'utf8')); } catch (error) {
40
+ if (error.code !== 'ENOENT') throw new Error(`Invalid install metadata: ${error.message}`);
41
+ }
42
+ if (metadata && (typeof metadata.version !== 'string' || !validVersion.test(metadata.version) || !/^[a-f0-9]{64}$/.test(metadata.hash))) throw new Error('Invalid install metadata. Review the installation before replacing it.');
43
+ const hash = await fingerprint(target);
44
+ return { state: metadata ? (metadata.hash === hash ? 'managed' : 'modified') : 'untracked', version: metadata?.version, hash };
45
+ }
46
+
47
+ export async function install(target, { update = false, replaceLocal = false } = {}) {
48
+ const before = await inspect(target);
49
+ if (!update && before.state !== 'missing') throw new Error(`Target already exists: ${target}`);
50
+ 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.`);
52
+ if (update && before.version && compareVersions(version, before.version) < 0) {
53
+ throw new Error(`Refusing to replace ${before.version} with older CLI ${version}. Run npx ui-fieldwork@latest instead.`);
54
+ }
55
+ const expected = await fingerprint(source);
56
+ if (update && before.state === 'managed' && before.hash === expected && before.version === version) return { unchanged: true };
57
+ if (update && before.state !== 'managed' && before.hash !== expected && !replaceLocal) {
58
+ throw new Error(`Skill is ${before.state}. Review local files, then use --replace-local to update with a backup.`);
59
+ }
60
+ const parent = dirname(target);
61
+ await mkdir(parent, { recursive: true });
62
+ // A shared directory may be used by several agent targets. Serialize writers there.
63
+ const lock = join(parent, '.ui-fieldwork-update.lock');
64
+ let locked = false;
65
+ let staging;
66
+ let backup;
67
+ try {
68
+ staging = await mkdtemp(join(parent, '.ui-fieldwork-install-'));
69
+ await cp(source, staging, { recursive: true });
70
+ if (await fingerprint(staging) !== expected) throw new Error('Copied content does not match the source.');
71
+ await writeFile(join(staging, metadataName), JSON.stringify({ version, hash: expected }, null, 2) + '\n');
72
+ await mkdir(lock).catch(error => {
73
+ if (error.code === 'EEXIST') throw new Error(`Update lock exists at ${lock}. Check for a running updater or an interrupted update before removing it.`);
74
+ throw error;
75
+ });
76
+ locked = true;
77
+ const current = await inspect(target);
78
+ if (JSON.stringify(current) !== JSON.stringify(before)) throw new Error('Installation changed during the operation; retry.');
79
+ if (update) {
80
+ backup = await mkdtemp(join(dirname(parent), '.ui-fieldwork-backup-'));
81
+ await rename(target, join(backup, 'ui-fieldwork'));
82
+ }
83
+ try { await rename(staging, target); } catch (error) {
84
+ if (backup) await rename(join(backup, 'ui-fieldwork'), target);
85
+ throw error;
86
+ }
87
+ staging = undefined;
88
+ return { backup: backup && join(backup, 'ui-fieldwork') };
89
+ } finally {
90
+ if (staging) await rm(staging, { recursive: true, force: true });
91
+ if (locked) await rm(lock, { recursive: true, force: true });
92
+ }
93
+ }
@@ -0,0 +1,24 @@
1
+ export const validVersion = /^(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
2
+
3
+ export function compareVersions(left, right) {
4
+ function parts(version) {
5
+ const [, core, preview] = /^(\d+\.\d+\.\d+)(?:-([^+]+))?/.exec(version);
6
+ return [core.split('.').map(BigInt), preview?.split('.')];
7
+ }
8
+ const [a, preA] = parts(left);
9
+ const [b, preB] = parts(right);
10
+ for (let i = 0; i < 3; i++) {
11
+ if (a[i] !== b[i]) return a[i] < b[i] ? -1 : 1;
12
+ }
13
+ if (!preA || !preB) return Number(!preA) - Number(!preB);
14
+ for (let i = 0; i < Math.min(preA.length, preB.length); i++) {
15
+ const x = preA[i], y = preB[i];
16
+ if (x === y) continue;
17
+ const numericX = /^\d+$/.test(x), numericY = /^\d+$/.test(y);
18
+ if (numericX && numericY) {
19
+ if (BigInt(x) !== BigInt(y)) return BigInt(x) < BigInt(y) ? -1 : 1;
20
+ } else if (numericX !== numericY) return numericX ? -1 : 1;
21
+ else return x < y ? -1 : 1;
22
+ }
23
+ return preA.length - preB.length;
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-fieldwork",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "A standalone design, build, and verification skill for coding agents",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -6,18 +6,18 @@ license: MIT
6
6
 
7
7
  # UI Fieldwork
8
8
 
9
- Honor the user's scope, platform and stack. Start with the project's design system, tooling and assets. Apply the guidance relevant to the changed task.
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.
10
10
 
11
11
  ## Understand the job
12
12
 
13
- - Inspect relevant screens, components, tokens, copy and data. For each affected task, identify the audience, entry state, main action or decision, expected result, and relevant failure or recovery path. Use that scenario to define acceptance checks.
14
- - In brainstorm mode, present proposals and tradeoffs. In an audit, tie findings to evidence and rank by impact on the task. For targeted fixes, preserve the existing direction. For an open-ended redesign, compare approaches that differ in structure, interaction or storytelling.
15
- - For a design decision that benefits from research, compare references that solve the same task. Record the pattern, why it fits, and where it breaks. Use galleries for visual exploration, shipped flows for precedents, and research or platform guidance for claims about usability and interaction.
16
- - For desktop and data-heavy workflows, keep frequent actions visible, retain relevant drafts, filters and selection, and preserve familiar shortcuts. Keep comparison data together when adapting to mobile. Check that data and actions inside panels and tables remain reachable with the relevant input methods.
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.
17
17
 
18
18
  ## Adapt to the environment
19
19
 
20
- Identify the supported devices, window sizes, input methods and relevant system settings. Use these examples to select checks for the affected task.
20
+ Select checks for the supported devices, window sizes, inputs and system settings.
21
21
 
22
22
  | Environment | Design and verification |
23
23
  | --- | --- |
@@ -31,18 +31,24 @@ Identify the supported devices, window sizes, input methods and relevant system
31
31
  ## Design and build
32
32
 
33
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
- - Make the next action and relevant information easy to find. For marketing or editorial work, choose a visual anchor grounded in the actual content and use specific copy. Use typography, spacing, alignment and tokens to create hierarchy. Give imagery and motion a clear job.
35
- - Keep controls needed mid-task easy to reach from where the user works. When changing language, view or preferences, carry over the meaningful section, selection or draft. Choose placement for the flow. If a control or header stays fixed, check that it leaves focused items and jump targets visible.
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
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
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
- - Review the render for generic copy, interchangeable sections, repeated badges, redundant cards, or decoration competing with the task. Explain what a change would improve on this screen. Treat these signals as critique prompts and allow them where they serve a clear purpose.
39
- - Respect the user’s component and framework choices. Reuse suitable project components. Browse catalogs for ideas when helpful and let the project requirements drive implementation. Use native controls for simple interactions and check the platform’s keyboard and focus conventions for complex widgets. For a web modal, test initial focus, Tab containment, Escape and focus restoration. Preserve readable contrast and reduced-motion behavior.
40
- - Design task-relevant loading, empty, success and failure states. Acknowledge input promptly and keep routine feedback near the action. Keep form labels visible, preserve valid input and offer a concrete recovery step. Report save or sync success after confirmation. For longer tasks, show honest progress and offer cancellation or background continuation when supported. Check avoidable sequential requests and costly UI dependencies on the changed path.
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.
41
46
 
42
47
  ## Verify and hand off
43
48
 
44
- - For implementation, inspect the running interface on representative widths where supported. Try realistic content, the main action and the state most likely to fail. Check that the action is discoverable and usable, including when content wraps or a panel scrolls. Reuse project checks and tools.
45
- - Exercise relevant keyboard navigation through success, failure and return. For a control used mid-task, start in context, tab to it, activate it and continue. Check context when focus reaches the control and again after activation. If the focused control disappears or becomes unavailable, move focus to a logical next target when needed. Run applicable project checks. Ground screenshot observations, interaction results and source findings in what was inspected.
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.
46
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
53
 
48
54
  ```text