Skip to content

feat(ux-design): add /import phase for externally built prototypes - #167

Closed
jeperry wants to merge 2 commits into
flightctl:mainfrom
jeperry:ux-design-import
Closed

jeperry wants to merge 2 commits into
flightctl:mainfrom
jeperry:ux-design-import

Conversation

@jeperry

@jeperry jeperry commented Nov 17, 2026 •

Copy link
Copy Markdown

Summary

Adds an /import phase to ux-design so a team can bring a prototype built outside the workflow, with any tool, and continue through /evaluate → /handoff without running /prototype. The evaluation and handoff gates stay intact, and teams stay isolated from the ux-design → ui-design handoff format.

/import is tool-agnostic. It takes a snapshot of files, fingerprints them, and records how to view them. Downstream phases use only the snapshot and fingerprint; they don't know or care which tool produced it.

Today /evaluate hard-requires 03-prototype/prototype-notes.md, which only /prototype writes, so there is no supported way in for an existing prototype.

Accepted input (skills/import.md § Accepted Input)

Required

  1. Prototype files: a local directory (Git or not), a Git URL with a ref, or an archive (.zip, .tar, .tar.gz, .tgz)
  2. A way to view it in a browser: an entry file, a start command, or a hosted URL proven to serve the same snapshot
  3. Feature scope: the routes, pages, or screens for this feature

Optional: provenance (Git ref/commit recorded automatically), a baseline snapshot of the existing product UI, and a notes file (design decisions, prototype limits such as mock data or stubbed auth).

Not accepted: design files or images alone (Figma link, PNG, PDF), or a hosted URL alone (can't be fingerprinted).

What /import does

  • Copies the source into 03-prototype/code/ and records a deterministic SHA-256 content fingerprint (Git SHA kept as secondary provenance when available). Archive extraction rejects absolute paths, .., and escaping links.
  • Runs or serves it only after the researcher confirms the commands (source treated as untrusted).
  • Captures screenshots of the scoped screens.
  • Optionally compares against a supplied baseline and records unchanged / changed / mocked sections in changeset.md. An older baseline is a warning, not a gate.
  • Fills the existing User Stories Covered table against PRD FR/NFRs and the [UX] story's acceptance criteria. Deferral requires researcher approval.
  • Writes rfe-snapshot.md from the ingested story so Full evaluation works.
  • History: omits code/ only when a clean commit is retrievable from a recorded remote; copies it otherwise.

It never edits the prototype's source. Fixes from /evaluate are made at the source, then /import runs again.

Flow

/ingest <UX story>
/import --source <dir|git url|archive> --scope /a,/b (--entry index.html | --start "<cmd>") [--ref <ref>] [--url <hosted>] [--baseline <source>] [--notes <file>]
/evaluate
/handoff

The handoff gate is unchanged: /handoff still requires an enriched context and a confirmed evaluation bound to the current prototype iteration and context revision.

Changes

  • New: commands/import.md, skills/import.md
  • controller.md: Import numbered as phase 4; "bring your own prototype" flow, recommendations, and phase-entry row. Evaluation fix loops route to "fix at source → /import" for imported prototypes.
  • evaluate.md: verifies the snapshot fingerprint before evaluating; uses the recorded viewing method and scope; passes prototype limits to evaluators; uses the import's rfe-snapshot.md; skips refinement-input normalization for imports; records Prototype fingerprint (and Git commit when present) in the report header.
  • prototype.md: does not refine or overwrite an imported prototype unless the researcher explicitly asks to replace it.
  • handoff.md: verifies the fingerprint matches the evaluated snapshot; treats mock data as evidence of need, not backend proof; records the import in Research Context.
  • README.md, SKILL.md, AGENTS.md: documented; ux-design 0.5.0 → 0.6.0.

Validation

  • skill-reviewer/scripts/pre-review-checks.py --all: ux-design 15/15 pass
  • markdownlint-cli2: 0 issues
  • Fingerprint snippet tested: stable across runs, ignores excluded directories, changes when content changes
  • validate-structure.sh / validate-versions.sh not run locally (need GNU tooling); relying on CI

Assisted-by: OpenCode (Claude Opus 5.5)

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Passed 7

Check name Status Explanation
Ai-Attribution Passed The PR description and both PR commits use Assisted-by: OpenCode (Claude Opus 5.5). Neither commit uses Co-Authored-By for an AI tool.
No-Absolute-Paths-In-Skills Passed The check forbids hardcoded literal absolute filesystem paths in workflow markdown files. I compared PR #167 (head 2c092bb) against main and inspected every added line in the changed markdown files (u…
Skill-Md-Under-30-Lines Passed The only changed SKILL.md, ux-design/SKILL.md, has 28 lines, including frontmatter. It directs readers to command wrappers, the controller, and guidelines.
Command-Colon-Notation Passed The check applies to every top-level /commands/.md workflow file. I read the YAML frontmatter name field of every command file in the checkout, including the PR's new file `ux-design/commands/impo…
No-Orphaned-References Passed The changed workflow references resolve to existing files. SKILL.md references every command, and skills/controller.md references every phase skill. Artifact paths refer to runtime outputs, not re…
No-Content-Duplication Passed The check applies. PR #167 changes ux-design/SKILL.md and ux-design/skills/controller.md. Both are architectural files under this check. The PR does not change guidelines.md. The other architect…
Step-Sequencing Passed The changed skill files have sequential main steps, with no duplicates, gaps, or lettered sub-steps. Each has fewer than 10 main steps. The provider comparison confirms the inspected base and changed …
Full details: No-Absolute-Paths-In-Skills

Explanation

The check forbids hardcoded literal absolute filesystem paths in workflow markdown files. I compared PR #167 (head 2c092bb) against main and inspected every added line in the changed markdown files (ux-design/README.md, SKILL.md, commands/import.md, skills/controller.md, evaluate.md, handoff.md, import.md, prototype.md, and AGENTS.md). - A scan for literal system-path prefixes (/home, /Users, /tmp, /var, /opt, /etc, /usr, /root, /private, /srv, /mnt, /Volumes, ~/, file://) found no matches in added lines. - A scan for multi-segment absolute-looking tokens found none. - Path references in the added text are relative (for example .artifacts/ux-design/{issue-key}/03-prototype/code/) or are slash commands (/import, /evaluate). Neither is a filesystem path. - Variable-based references such as $ARGUMENTS are dynamic and exempt. - The fingerprint snippet in skills/import.md uses a relative path argument. The only absolute-path literals found in the repository (/home/user/src/... in ux-design/skills/ingest.md, lines 210–212) are pre-existing. ingest.md is not changed by this PR, so they cannot be attributed to it. They are also placeholder-style example paths. No PR-introduced violation exists.

Full details: Command-Colon-Notation

Explanation

The check applies to every top-level /commands/.md workflow file. I read the YAML frontmatter name field of every command file in the checkout, including the PR's new file ux-design/commands/import.md, which declares name: ux-design:import. All other command files also use {workflow}:{phase} notation, and each prefix matches its parent directory. The ux-design files include evaluate, handoff, ingest, prototype, publish, research, respond, and revise. No command file has a missing name, a missing colon, or a mismatched prefix. The checked-out head is commit 2c092bb, which contains the new import command. The check passes.

Full details: No-Orphaned-References

Explanation

The changed workflow references resolve to existing files. SKILL.md references every command, and skills/controller.md references every phase skill. Artifact paths refer to runtime outputs, not repository files.

Full details: No-Content-Duplication

Explanation

The check applies. PR #167 changes ux-design/SKILL.md and ux-design/skills/controller.md. Both are architectural files under this check. The PR does not change guidelines.md. The other architectural files in this workflow are guidelines.md and skills/controller.md. ux-design has no dispatch.md or completion.md. Findings from the PR diff against origin/main: - SKILL.md adds the /import command link, the version bump, and the activation list. These are cross-references. The Quick Start still points to guidelines.md for principles and does not repeat them. - controller.md adds a phase entry (item 4), a "Bring your own prototype" flow, phase-entry and recommendation bullets, and workspace table rows. None of this text matches guidelines.md (unchanged). The phase list and one-line descriptions are expected cross-references under the check. Near-duplicate routing text exists outside the architectural set. The rule "fix at the prototype's source, then run /import again; do not run /prototype on an imported prototype" appears in controller.md (lines 149–157), prototype.md (56–61), evaluate.md (350–354), import.md (19–21, 338–339), and README.md (153–162). These are paraphrases, not identical blocks, and they sit in phase files that the check does not compare. They are not a violation of this check. A later edit could drift them apart. That is a maintenance risk to note, not a failure condition. Evidence gap: the local main branch has no merge base with the PR head, so I used origin/main for the diff. The file set is consistent with the provider-reported PR.

Full details: Step-Sequencing

Explanation

The changed skill files have sequential main steps, with no duplicates, gaps, or lettered sub-steps. Each has fewer than 10 main steps. The provider comparison confirms the inspected base and changed files.

@adalton adalton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall: This is a well-motivated PR that solves a real gap — teams that prototype outside the workflow currently have no way to bring that work into /evaluate and /handoff. The integration pattern is solid: /import writes the same 03-prototype/ artifacts that downstream phases already consume, iteration and history management are handled correctly, and the security posture (untrusted repo, researcher-confirmed commands) is right.

Three things need attention before this can merge:

1. Decouple from Git. The phase currently hard-requires Git — --repo must be a Git URL or Git repository path, Step 1 resolves a commit SHA, and all downstream verification checks (evaluate, handoff) are SHA-based. This couples the phase to one team's toolchain. A team that prototypes in Figma and exports static HTML, or has a directory of files that isn't version-controlled, can't use /import at all.

The core thing downstream phases need is a snapshot of the prototype files in 03-prototype/code/ and a way to know whether they changed since import. That can be a content hash of the directory — it pins the evaluated artifact without requiring Git.

Proposed approach: the base operation is copy the files into 03-prototype/code/ and record a content hash. --source replaces --repo and accepts a local directory, a Git URL, or an archive/export. When the source is a Git repo, record the SHA as bonus provenance alongside the content hash. Commit verification in evaluate/handoff becomes hash verification ("do the files in 03-prototype/code/ still match the recorded hash?"), which works for any source type. The Git-specific enrichment (ref tracking, upstream diff, changeset.md) becomes an optional layer on top. The if/else stays minimal — it's just "how do we acquire the files," which is one step, not a fork through the whole skill.

2. History preservation for non-Git sources. Step 8 says "Do not copy code/ into history. The recorded repository and SHA identify that iteration's code." That works for Git sources where the SHA is a permanent external reference. After decoupling, a non-Git source (Figma export, plain directory) that was copied into 03-prototype/code/ has no external reference — the content hash proves identity but doesn't provide retrieval. For non-Git sources, code/ needs to be copied into the history snapshot so prior iterations remain recoverable. For Git sources, the SHA is still sufficient and the clone can still be omitted.

3. AGENTS.md not updated. Line 25 of AGENTS.md lists ux-design's phases as (ingest, research, prototype, evaluate, handoff, revise, publish, respond). /import needs to be added there — AGENTS.md is the architecture reference that all AI agents read first.

Comment thread ux-design/skills/import.md Outdated
## Dependencies

This phase uses no UXD marketplace skill. It requires Git and a live browser.
Running the prototype locally also requires the prototype's own toolchain

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the Git hard-requirement is established. After decoupling (see top-level comment), this should read something like "It requires a live browser. When the source is a Git repository, it also requires Git." The browser is the real dependency; Git is conditional on the source type.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. A live browser is the only hard dependency. Git is required only for Git sources.

Comment thread ux-design/skills/import.md Outdated
| Input | Required | Purpose |
|-------|----------|---------|
| `--repo` | Yes | Git URL or local path of the prototype repository |
| `--ref` | For a Git URL | Branch, tag, or commit to import. For a local path, the current `HEAD` is used |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the decoupling, replace --repo with --source that accepts a local directory (Git or not), a Git URL, or a path to an exported archive. --ref stays but becomes conditional on the source being a Git URL — same as now, just explicitly scoped.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. --source accepts a directory, Git URL, or archive. --ref is required only for a Git URL.

Comment thread ux-design/skills/import.md Outdated
## Process

### Step 1: Resolve the Commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole step is framed around Git commit resolution. After decoupling, the step becomes "Acquire and fingerprint the prototype":

  • Git URL: clone at --ref, record SHA + content hash.
  • Local Git repo: record HEAD SHA + content hash, warn on dirty tree.
  • Local directory (no Git): copy into 03-prototype/code/, record content hash. No SHA to record.
  • Archive/export: extract into 03-prototype/code/, record content hash.

The content hash is the universal identity; the SHA is bonus provenance when available.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. This is now Step 1 (Acquire) and Step 2 (Fingerprint), with the four source cases as you outlined them. A dirty Git tree is recorded as dirty and still fingerprinted. The fingerprint is computed before any install or build runs, and the procedure is a short deterministic script with recorded exclusions so later phases can recompute it.

evaluate and hand off that SHA, even if the branch has since moved.

### Step 2: Identify the Upstream Base

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step is fine as optional enrichment. After decoupling, just make it explicit that this step runs only when the source is a Git repo with a known fork relationship. When it's not, record Upstream base: N/A — source is not a Git fork and move on.

On your open question about upstream drift: a warning is appropriate, not a gate. Blocking evaluation because the upstream moved would punish teams for iterating at their own pace.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made it optional, but as a generic --baseline instead of Git-fork-only (see top-level comment). Older baseline = warning, not a gate, as you suggested.

Comment thread ux-design/skills/import.md Outdated
`.artifacts/ux-design/{issue-key}/history/prototype-iteration-{N}/`, unless
that exact tree is already in the current context-revision snapshot. Do not
copy `code/` into history. The recorded repository and SHA identify that
iteration's code. Remove the prior clone after the snapshot is written.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works when the source is a Git repo — the SHA is a permanent external reference. But after decoupling, a non-Git source (Figma export, plain directory) has no external reference to retrieve from later. The content hash proves identity but not retrieval. For non-Git sources, code/ needs to be preserved in the history snapshot. For Git sources, the current approach (omit the clone, rely on the SHA) is still correct.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. code/ is left out of history only when the prior import was a clean Git commit reachable from a recorded remote. In every other case it's copied, including local-only commits and dirty imports.

Comment thread ux-design/skills/controller.md Outdated
Iterative — loops with `/evaluate`.

**Import** (`/import`) — [import.md](import.md)
Alternative to `/prototype`. Register a prototype the team built in its own

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is inserted between numbered items 3 and 4 without its own number. The rest of the list (1–8) is numbered. Either give Import a number and renumber Evaluate through Respond, or format it as an explicit sub-item of Prototype (e.g., "3b" or an indented alternative) to make the relationship clear.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Import is phase 4, and Evaluate through Respond are renumbered 5–9.

Comment thread ux-design/skills/evaluate.md Outdated
`/prototype` first, or `/import` when the team already built the prototype.

When `Prototype mode` is `imported`, confirm the prototype being evaluated is
the recorded `Prototype commit`. For a Git URL import, the clone under

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After decoupling, this verification should be hash-based: "confirm the content hash of 03-prototype/code/ matches the hash recorded at import time." When a Git SHA is also recorded, verify it too as a secondary check. This makes the verification work for non-Git imports without special-casing.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. /evaluate recomputes the fingerprint with the recorded exclusions and stops on a mismatch. The Git SHA is checked as a secondary record when present. /handoff does the same check against both the import and the evaluation.

**Evaluation revision:** {revision number}
**Prototype iteration:** {N}
**Prototype commit:** {recorded SHA for an imported prototype, or "N/A"}
**Discovery revision:** {revision evaluated}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After decoupling, this becomes something like **Prototype fingerprint:** {content hash} with the SHA recorded as a separate optional field when available. The commit alone can't identify non-Git imports.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. **Prototype fingerprint:** plus an optional **Prototype Git commit:**.

Replace the Git-only --repo input with --source (directory, Git URL, or archive), identify imports by a content fingerprint with Git SHA as optional provenance, document accepted input, make baseline comparison optional and generic, preserve code/ in history for non-retrievable sources, number Import in the controller, and list import in AGENTS.md. Addresses review on flightctl#167.

Assisted-by: OpenCode (Claude Opus 5.5)
@jeperry

jeperry commented Nov 18, 2026

Copy link
Copy Markdown
Author

Thanks for the thorough review, Andy. Pushed 2c092bb to address it. /import is now tool-agnostic: --source accepts a local directory, a Git URL with a ref, or an archive. The content fingerprint is the prototype's identity, and the Git SHA is kept as extra provenance. There's a new Accepted Input section in import.md covering required, optional, and rejected inputs. It also removes the flightctl/RHEM-specific logic.

Two changes beyond what you asked for:

  • --routes is now --scope, since not every prototype has routes.
  • The upstream comparison is a generic optional --baseline in any source form, not "Git fork only". That way a static export can still be compared against the product UI.

Keeping this as a draft until Amir has had a chance to weigh in on the overall direction.

@amir-yogev-gh

Copy link
Copy Markdown
Collaborator

My primary concern is architectural ownership, not just whether an import succeeds. The native prototype path already exists. Teams choosing external tools should own the adapter to the existing prototype-artifact contract, including runtime requirements, upgrades, migrations, and re-validation as the workflow evolves.

I would keep that adaptation in the external integration rather than introduce a core /import phase with additional imported-mode handling in shared phases. Making import a first-class capability should require an explicit architectural decision to expand the core workflow’s scope and maintenance obligations.

The external integration must demonstrate bounded, tested compatibility. From conversion/import through /import → /evaluate → /handoff → /publish → /ui-design:ingest, including passing and failure cases. Passing those tests does not, by itself, make ongoing external-tool compatibility a core responsibility.
These tools must also provide regression evidence that native and imported paths preserve the existing published UX-to-UI handoff contract.

@jeperry

jeperry commented Nov 23, 2026

Copy link
Copy Markdown
Author

Thanks, Amir, understood. We won't pursue a core /import phase. We'll work with Andy Braren on supporting existing prototypes in the ai-helpers prototype skill, so ux-design doesn't need changes. Closing this.

@jeperry jeperry closed this Nov 23, 2026
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.

3 participants