Communitygithub.com

ui-to-vue

ユーザーがUIスクリーンショットやデザイン書き出しデータを、Vant、Element Plus、Ant Design VueなどのVue 3コンポーネントに一括変換する必要がある場合に使用します。

ui-to-vue とは?

このスキルは、UIデザインのスクリーンショットをVue 3 Composition APIのコンポーネントコードに一括変換するためのツールです。主に、デザイン画面のディレクトリを入力として、Vue 3プロジェクト向けにページコンポーネント、共有コンポーネント、ルーター設定を自動生成します。Vant、Element Plus、Ant Design Vueなどの主要なUIライブラリに対応しており、CLIコマンド一つで実行可能です。開発の初期段階でデザインからコードへの変換を効率化し、繰り返し出現するUI領域を自動的に共有コンポーネントとして抽出する機能も備えています。セキュリティとプライバシーに配慮し、APIキーは環境変数で管理し、生成されたコードはコミット前にレビューする必要があります。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/ui-to-vue

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

UI To Vue

UIデザインのスクリーンショットをVue 3 Composition APIのコンポーネントコードに一括変換します。

使用するタイミング

  • ユーザーがデザインのスクリーンショットやデザイン書き出し画像のディレクトリを提供した場合
  • 対象アプリケーションがVue 3の場合
  • ユーザーがページコンポーネント、共有コンポーネント、ルーターの配線の最初のパスを希望する場合
  • ユーザーがVant、Element Plus、またはAnt Design Vueをコンポーネントライブラリとして指定した場合

使用しないタイミング

  • ユーザーがスクリーンショット1枚のみで、特注のコンポーネントを希望する場合
  • 対象プロジェクトがVueではない場合
  • デザインに詳細なインタラクションロジック、データフロー、アクセシビリティレビューが必要な場合
  • スクリーンショットに外部モデルAPIに送信できない顧客データが含まれている場合

入力

スクリーンショットをモジュールとページ状態ごとにグループ化した入力ディレクトリを使用します。

screenshots/
|-- HomePage/
|   |-- List/
|   |   |-- [email protected]
|   |   `-- cut-images/
|   |-- cut-images/
|   `-- [email protected]
`-- cut-images/

サポートされているカット画像ディレクトリ名には、assets、icons、sprites、cut、images、cut-images などがあります。

変換モデル

  • ページグループ化:関連するスクリーンショットを、リスト、詳細、フォーム、ローディング、空状態などを表す場合に1つのページコンポーネントにまとめます。
  • UIライブラリマッピング:ネイティブなビジュアル要素を、Vant、Element Plus、またはAnt Design Vueのコンポーネントに可能な限りマッピングします。
  • カット画像の優先順位:ページレベルのアセットを優先し、次にモジュールレベルのアセット、最後にグローバルな共有アセットを優先します。
  • コンポーネント抽出:複数回出現するUI領域を共有コンポーネントとして抽出します。

CLIの使用方法

npx を使用してコンバーターを実行します。これにより、グローバルなバイナリに依存せずにドキュメント化されたコマンドが機能します。

export DASHSCOPE_API_KEY=your_key
npx [email protected] --input ./screenshots --ui vant --output ./src

デスクトップUIライブラリの場合:

npx [email protected] --input ./designs --ui element-plus --output ./src
npx [email protected] --input ./designs --ui antd-vue --output ./src

パッケージがグローバルにインストールされている場合は、ui-to-vue バイナリを直接使用できます。

npm install -g [email protected]
ui-to-vue --input ./screenshots --ui vant --output ./src

オプション

オプション説明デフォルト値
--inputデザイン画像ディレクトリ./screenshots
--uiUIライブラリ:vant、element-plus、またはantd-vuevant
--output出力ディレクトリ./src
--config設定ファイルのパス./.ui-to-vue.config.json

APIキーの取り扱い

コンバーターは、設定ファイルまたは環境からDashScopeの認証情報を読み取ることができます。リポジトリでは環境変数を推奨します。

export DASHSCOPE_API_KEY=your_key

ローカル設定ファイルが必要な場合は、バージョン管理から除外してください。

{
  "apiKey": "your_dashscope_key",
  "input": "./designs",
  "ui": "vant",
  "output": "./src"
}
.ui-to-vue.config.json

セキュリティとプライバシー

  • デザインのスクリーンショットは、外部モデルAPIに送信される可能性のあるソースマテリアルとして扱ってください。
  • 許可なく顧客のプライベートデザインに対してこのフローを実行しないでください。
  • 繰り返し可能なワークフローでは、@latest を使用する代わりにコンバーターのバージョンを固定してください。
  • 生成されたVueコードはコミット前にレビューしてください。
  • .ui-to-vue.config.json、APIキー、生成されたシークレット、顧客のスクリーンショットはコミットしないでください。

出力レビューチェックリスト

  • ページコンポーネントが views/ または選択した出力ディレクトリの下に生成されましたか?
  • 繰り返し出現するUI領域が、再利用が明確な場合のみ components/ に抽出されましたか?
  • ルーターの出力は、ターゲットプロジェクトのルータースタイルと互換性がありますか?
  • 生成されたコンポーネントは、リクエストされたUIライブラリを一貫して使用していますか?
  • 生成されたCSS単位は、デザインベースラインと一致していますか?
  • コードはプロジェクトのフォーマッター、リンター、型チェッカー、ビルドを通過しますか?
  • プレースホルダーのコピー、モックデータ、生成されたアセットはコミット前にレビューされましたか?

トラブルシューティング

問題確認事項
401 または認証エラーコマンドを実行するシェルで DASHSCOPE_API_KEY が設定されていることを確認してください。
command not found: ui-to-vuenpx [email protected] 形式を使用するか、パッケージをグローバルにインストールしてください。
カット画像が無視されるアセットディレクトリ名がサポートされており、対応するページまたはモジュールの下にネストされていることを確認してください。
コンポーネントがリクエストされたUIライブラリを無視する明示的な --ui 値を指定して再実行し、生成されたインポートを確認してください。
生成されたレイアウトの寸法が正しくないスクリーンショットのエクスポート幅がターゲットライブラリのベースラインと一致していることを確認してください。

参考資料

  • npmパッケージ:ui-to-vue-converter

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

関連スキル