Use this workflow to build or review native iOS UI from Figma and iterate until
the live app matches the design. Prefer real runtime state, but local UI
verification may use a Local Direct Harness. Use Figma as the visual reference,
not as a reason to add fake production app paths.
Collect only what is needed:
error.
Local Direct Harness.
If a repository has an AGENTS.md or local Figma-to-code SOP, read it first and
let it override generic details.
Choose the path before editing:
create a missing page/component/cell, or go from design to UIKit code.
asks to compare, polish, audit, or improve Figma fidelity.
Both paths end with the same visual review loop.
states, colors, typography, icons, assets, and important frames.
style, data stores, and harness commands.
execution plan under the repo's planning location.
Use this for from-zero implementation:
controls, assets, states, and interactions.
controller, child view, table/collection cell, route, or asset catalog entry.
color helpers, and asset naming patterns.
Direct Harness only for local UI verification.
accessibilityIdentifier values only for controls that Maestroflows tap or assert.
normal app navigation. Use a Local Direct Harness for local-only visual
review when durable routing is unnecessary.
user interaction path.
Use this for fidelity review or polish:
behavior, missing assets, and dynamic text pressure.
the visual review loop.
Use this for focused local visual verification when real navigation or Maestro
would add noise:
rootViewController to the view controllerunder review.
production paths.
rootViewController overrides after review unless the harness is a committed
reusable test entry.
final handoff.
Repeat this loop until the changed areas pass the comparison checklist:
```sh
scripts/verify.sh
```
launch.png for launch-visible screens..harness/tmp/ for local Lookin review.Assert the target root or key control before the final hold sentinel.
If Lookin MCP is unavailable in the current environment, use simulator
screenshots plus code inspection, and record the missing hierarchy evidence
as residual risk.
the hierarchy is shallow, or Lookin only returns non-actionable layer data,
use:
```sh
xcrun simctl io "$VERIFY_SIMULATOR_ID" screenshot .harness/tmp/
```
assets, colors, typography, icon orientation, spacing, and dynamic sizing.
for changed visual areas.
Use Maestro as the click driver and durable black-box gate. Use Lookin as the
native UIKit inspection bridge for hierarchy, attributes, and screenshots.
For focused visual review, a Local Direct Harness may replace Maestro
navigation. Prefer committed Maestro flows when validating durable end-to-end
navigation, taps, or assertions.
For iOS system permissions, prefer Maestro launchApp.permissions or
setPermissions so normal visual-review and smoke flows do not depend on
system alert copy. Keep ATT/usertracking alert taps optional when the local
Maestro/Xcode/iOS Simulator stack still shows the prompt after
usertracking: allow. Only make system permission alerts the target of a flow
when the flow is explicitly testing permission behavior.
Run Maestro flows serially when they target the same simulator. A single iOS
simulator can only be driven reliably by one Maestro process at a time, so do
not launch multiple flow commands in parallel just to save time. If a repo
provides a wrapper such as scripts/verify-flow.sh, prefer that wrapper when it
serializes committed flows and passes the selected simulator UDID.
Before starting a second local flow, make sure a previous maestro or
verify-flow process is not still holding the same simulator.
Committed flow example:
FLOW_FILE=.harness/flows/<flow-name>.yaml scripts/verify-flow.sh
Temporary hold flow example:
appId: <bundle-id>
---
- launchApp:
permissions:
photos: allow
usertracking: allow
- tapOn:
text: "Allow"
optional: true
- tapOn:
id: "<entry.accessibilityIdentifier>"
- assertVisible:
id: "<target.accessibilityIdentifier>"
- extendedWaitUntil:
visible:
id: "__hold_for_lookin__"
timeout: 120000
The hold flow's final timeout is expected. Treat the useful result as the
successful navigation/assertions before the sentinel, not the final process exit
code. Do not commit hold flows or report their timeout as the verification
result.
Check these before calling the review done:
scroll insets, and bottom safe area.
dynamic text pressure.
content.
Consider the visual review complete only when:
an accepted navigation method, and wired to real runtime state or documented
mock/fixture verification state.
launch-visible state, real app navigation, committed Maestro flow, local hold
flow, or Local Direct Harness.
fallback.
native/runtime-data differences.
with the exact command and artifact path.
Handle common failures this way:
rather than guessing design measurements.
under .harness/tmp/ or use a Local Direct Harness for inspection. Propose a
committed flow only if the interaction should become a durable gate.
foreground, and record the blocker if Lookin still cannot connect.
any useful evidence and use the simulator screenshot fallback for visual
comparison.
fallback and record that fallback.
route and config condition that produced the reviewed state.
compare layout resilience instead of hard-coding Figma content.
skipped command, reason, and residual risk.
clean up temporary entries after review.
visual data is needed.
accessibilityIdentifier values only for controls that flows tapor assert.
artifacts, local hold flows, screenshots, or Lookin dumps.
record the decision.
Run the relevant local gates, commonly:
git diff --check
scripts/verify-docs.sh
scripts/verify.sh
scripts/verify-flow.sh
Run flow gates serially. If you need multiple specific flows, invoke them one
after another or use the repo's wrapper that serializes the flow list; parallel
Maestro runs can fight over the only available simulator and produce false
failures.
In the final summary or execution plan, record:
dependencies, root view controller, and cleanup status when relevant.
共 2 个版本