Skip to content

feat(preview,design): add rig-preview, rig-design, and rig-ui-ux-designer - #77

Open
0xj0hnny wants to merge 1 commit into
agent-rig:mainfrom
0xj0hnny:feat/rig-preview-and-rig-design
Open

0xj0hnny wants to merge 1 commit into
agent-rig:mainfrom
0xj0hnny:feat/rig-preview-and-rig-design

Conversation

@0xj0hnny

Copy link
Copy Markdown

Summary

Adds rig-preview and rig-design, plus the rig-ui-ux-designer persona, as
a new pillar alongside tracker/review/style — a manual-QA environment booter
and a Figma-to-ticket bridge. Both were built and validated against a real
project before landing here, not designed in the abstract.

Also included: a stray install.sh fix already sitting in this checkout.
macOS ships bash 3.2, which has no mapfile (added in bash 4). install.sh
failed on a stock Mac before this fix.

rig-preview

Boots a running, seeded environment per worktree for manual QA — db/backend/
frontend as configured, then an iOS Simulator or Browser preview depending on
app type. Runs as Step 6.5 of rig-task, after the review-bot loop,
non-blocking.

Two real bugs shaped its design, not hypotheticals.

Native builds are mandatory, every time, on purpose. A deep-link reconnect
to an already-installed binary was tried first. Zero requests reached the
target bundler. The app kept rendering the previous binary's bundle with no
error. A full dev.mobileBuildCommand build is the safe default until
reconnect-without-rebuild is proven reliable.

Port and device allocation are exclusive per worktree, checked before use.
Two worktrees sharing a bundler port, or installing the same bundle
identifier onto the same simulator, silently clobber each other.
preview-env.sh refuses both. It even refuses to kill a port-holder it
can't identify as belonging to a live worktree, rather than guessing. This
is how the stale-8081 bug that motivated this whole feature got found and
fixed.

Tested live, and confirmed, not assumed. Two concurrent worktrees got distinct
ports and distinct simulator devices with no manual coordination. A restart
on the same worktree correctly self-identified and replaced its own prior
run. Process-group kill correctly took down a grandchild process a plain
PID-based kill would have missed. Teardown via rig-worktree rm correctly
read .rig-preview.json and killed the right processes before removing the
worktree.

Known gap, not fixed here. Always rebuilding is the safe choice, not the
fast one. A real project's own worktree tooling already solves the general
version of this problem: detect whether native inputs (deps, app.config.js,
plugins) changed vs. the base branch. If not, cold-relaunch an
already-installed binary in ~15s instead of rebuilding. Porting that
detection into rig-preview's own Step 5 is the natural next PR.

rig-design + rig-ui-ux-designer

Turns a ready Figma frame into a filed ticket. rig-ui-ux-designer extracts
layout, spacing, colors, typography, and states from the Figma node tree,
rather than a screenshot alone.

It cross-references the project's existing tokens instead of inventing new
ones. rig-architect decomposes and files the result exactly as it would a
written spec. Config-gated behind design.provider, so it's a dormant no-op
until a Figma MCP is connected.

Validated against a real Figma community file, not a synthetic example.
The extraction correctly flagged missing interaction states, an undesigned
empty state, and ambiguous copy as open questions. It invented defaults for
none of them.

Config surface

New dev and design blocks in rig.schema.json / rig.config.example.json,
agents.designer, and both documented in docs/config.md. install.sh's
default skill set now includes both. Like rig-epic/rig-sprint, they
degrade to a clear "not configured" message without their own config — no
cost to installing them by default.

Test plan

  • All JSON validated (rig.schema.json, rig.config.example.json).
  • bash -n on every modified/added shell script.
  • rig-preview's port-safety, device-allocation, and teardown behavior
    exercised live against real worktrees and a real iOS Simulator, per the
    bullet list above — not read through and assumed correct.
  • rig-design's extraction exercised against a real, public Figma file.
  • No automated tests added for either skill. Both are markdown procedures
    interpreted by an agent, same as every other skill in this kit. There's no
    existing test harness for skill behavior to extend.

…gner

rig-preview boots a running, seeded environment per worktree for manual QA
(Step 6.5 of rig-task, non-blocking) -- db/backend/frontend as configured,
then an iOS Simulator or Browser preview depending on app type.
preview-env.sh enforces exclusive port and simulator-device allocation per
worktree, refusing to guess at an unowned process rather than killing it
blind. Native builds are mandatory on every preview by design: a deep-link
reconnect to an already-installed binary was tried first and found
unreliable (zero requests reached the target bundler).

rig-design + rig-ui-ux-designer turn a ready Figma frame into a filed
ticket -- extraction reads the Figma node tree and cross-references the
project's existing design tokens instead of inventing new ones.
Config-gated behind design.provider, dormant until a Figma MCP is
connected.

Also: fix install.sh's use of `mapfile`, unavailable in the bash 3.2 macOS
ships by default -- install.sh failed on a stock Mac before this.

New dev/design config blocks in rig.schema.json, rig.config.example.json,
and docs/config.md; agents.designer; both skills added to install.sh's
default set (degrade to a clear "not configured" message without their
own config, like rig-epic/rig-sprint already do).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant