/arkive:design-loopfrom arkive
Enforces a visual design validation loop: implement UI from Figma, regenerate showcase, compare snapshot vs design truth by eye, and fix mismatches. For projects using Arkive and Gradle.
Ships in arkive. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Validate UI against its design using Arkive's showcase output plus a multimodal visual
comparison — view the rendered snapshot and the design truth in the same turn and judge
whether they match. Read references/arkive-cheatsheet.md for
paths, filename conventions, and the showcase JSON shape.
This loop compares against the freshly generated showcase, never against goldens.
There is no reference image to record, delete, or go stale — every generateShowcase run
re-renders everything. snapshotRetention is irrelevant here (NONE is fine). Golden
verification is a different concern: /arkive:snapshot-testing.
Two non-negotiable rules:
Tier 1 — Figma via annotations (preferred). Read the module's
arkive-showcase.json. If it has a designFileKey and the component has a
designNodeId, the Figma target is already known — fetch its screenshot with the
connected Figma MCP server's screenshot tool. No URLs needed from the user.
Tier 2 — Figma via pasted URL. Figma MCP connected but the component has no
designNodeId: ask the user for the frame URL
(figma.com/design/<fileKey>/<name>?node-id=X-Y — convert X-Y to X:Y for the MCP
tool). After a successful match, offer to backfill designNodeId on the
@ArkiveComposable/@ArkiveView annotation (and designFileKey in the arkive {}
block) so every future run resolves automatically — turn the one-off URL into a permanent
code artifact.
Tier 3 — no Figma: intent and specs. Compare against whatever design truth exists: a spec document, ticket acceptance criteria, or the user's stated intent in this conversation. The same discipline applies — load the snapshot and enumerate concrete observations against each stated requirement. If there is no articulable intent either, ask what the screen should look like before judging; never invent the requirement.
_<category>_<value>
suffix, e.g. _fontscale_large). Variants are robustness checks with no design
counterpart.New screen or component? Run the reuse check first — this is a gate, not a
suggestion. Follow /arkive:find (search the catalogue + source, visually triage
suspects) before writing any code; it returns use-it / extend-it / build-new.
Implementing a "new" component without it is a red flag.
Implement / update the view using existing shared components (design tokens, typography, the project's building blocks). If nothing fits, STOP and ask before inventing a custom piece.
Regenerate: ./gradlew :<module>:generateShowcase<Variant> (fastest debug
variant). Recording is module-wide and takes minutes — iterate within one module, and
batch fixes across a screen before regenerating rather than re-running per tweak.
Locate the snapshot in <module>/build/generated/arkive/showcase/images/ by its
component id (see the cheatsheet's filename convention). If it's missing, the preview
crashed — the build log has an Arkive: no snapshot recorded for component warning
(re-run with --info for the crash message); fix that first.
Its UI tree is uitree/<componentId>.json next to images/ (the item's uiTreePath) —
hierarchy, dp bounds, text style; schema in the cheatsheet.
Fetch the design truth for the tier you're on.
Compare in a single turn: Read the snapshot PNG (renders visually), fetch/hold the design truth, and enumerate every observable difference — colors, spacing, alignment, font weight, corner radii, shadows, icons, missing or extra elements, text content. Saying "matches" or "looks close" without listed concrete observations is a rule violation: either list the diffs, or state specifically that none are visible. Never declare a match from reading your own code.
Measured pass (when the tree exists and the design truth has numbers — e.g. the
Figma MCP server's design context): after the visual comparison, diff the tree against
the design's values — text style per text node (size, weight, line height, color),
element sizes, and sibling gaps computed from bounds
(next.x − (prev.x + prev.w), same for y). List every mismatch with both values:
Text "Pay": 14sp vs Figma 16sp. The measured pass adds findings; it never replaces
viewing the image.
Decide (tolerance table below).
| Situation | Action |
|---|---|
| No visible diff | Done — go to the handoff |
| Visible diff, fixable with existing components | Fix, go to step 3 |
| Fix needs breaking / duplicating / customizing a shared component | STOP. Ask. |
| Diff is ambiguous (unclear which side is correct) | STOP. Ask. |
| Repeated attempts aren't converging | STOP. Ask. |
| Snapshot shows unstable data (current date, random values) | Fix the preview's data first — the loop needs deterministic renders |
grep -l '"overflow": true' <module>/build/generated/arkive/showcase/uitree/<componentId>_*.json —
and report hits as robustness findings, not design diffs (the base-only comparison
rule still holds).snapshotRetention BASE/ALL): the UI just changed
intentionally, so the goldens are now stale — re-record (generateShowcase<Variant>)
and commit the updated goldens, or CI's verifyShowcase will fail on this change./arkive:snapshot-testing to lock in the
now-approved rendering./arkive:find reuse check.// TODO: doesn't quite match design comment.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
5 skills in this plugin
/annotateUse when adding, editing, or reviewing Arkive annotations — @ArkiveComposable, @ArkiveView, or curating what @Preview components show in the catalogue: names, groups, tags, skip, Figma designNodeId. Triggers every time a component or screen is added to the Arkive showcase or its catalogue metadata changes. Enforces the shared naming/grouping conventions so the sidebar tree stays consistent./findUse BEFORE implementing any new screen or component from a Figma design or spec in a project that uses Arkive, and whenever asked "do we already have X?". Searches the Arkive catalogue (names, groups, tags, Figma node ids) plus the source code for existing implementations, visually triages the suspects in a subagent to keep images out of the main context, and returns one of: use it, extend it, or build new. Exists to prevent duplicating shared components./npx claudepluginhub infinum/arkive --plugin arkiveOther plugins' skills for the same job