オプション

ui-to-vue

affaan-m/ECC affaan-m/ECC

Vant、Element Plus、またはAnt Design Vueを使用して、UIデザインのスクリーンショットをVue 3のComposition APIコンポーネントに一括変換します。

...すべて拡張します
0
更新された時間 2026年10月1日

UIから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領域は、1回以上出現する場合、共有コンポーネントとして抽出する。

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
--ui UIライブラリ: vant, element-plus、または antd-vue vant
--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-vue ` npx [email protected] フォームを使用するか、パッケージをグローバルにインストールしてください。
切り抜かれた画像は無視されます アセットディレクトリ名がサポートされており、対応するページまたはモジュールの直下に配置されていることを確認してください。
コンポーネントは、要求された UI ライブラリを無視します 明示的な --ui 値を指定して再実行し、生成されたインポートを確認してください。
生成されたレイアウトの寸法が間違っているように見える スクリーンショットのエクスポート幅が、ターゲットライブラリのベースラインと一致していることを確認してください。

参照

  • npm パッケージ: ui-to-vue-converter
GitHubで見る
---
name: ui-to-vue
description: Batch-convert UI design screenshots into Vue 3 Composition API components using Vant, Element Plus, or Ant Design Vue.
---

# UI To Vue

Batch-convert UI design screenshots into Vue 3 Composition API component code.

## When to Use

- The user provides a directory of design screenshots or design-export images.
- The target application is Vue 3.
- The user wants a first pass of page components, shared components, and router wiring.
- The user specifies Vant, Element Plus, or Ant Design Vue as the component library.

## When Not to Use

- The user has only one screenshot and wants a bespoke component.
- The target project is not Vue.
- The design requires detailed interaction logic, data flow, or accessibility review.
- The screenshots contain private customer data that cannot be sent to an external model API.

## Inputs

Use an input directory that groups screenshots by module and page state:

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

Supported cut-image directory names include `assets`, `icons`, `sprites`, `cut`, `images`, and `cut-images`.

## Conversion Model

- Page grouping: combine related screenshots into one page component when they represent list, detail, form, loading, or empty states.
- UI library mapping: map native visual elements to Vant, Element Plus, or Ant Design Vue components where practical.
- Cut-image priority: prefer page-level assets, then module-level assets, then global shared assets.
- Component extraction: extract repeated UI regions into shared components when they appear more than once.

## CLI Usage

Run the converter with `npx` so the documented command works without relying on a global binary:

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

For desktop UI libraries:

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

If the package is installed globally, the `ui-to-vue` binary can be used directly:

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

## Options

| Option | Description | Default |
| --- | --- | --- |
| `--input` | Design image directory | `./screenshots` |
| `--ui` | UI library: `vant`, `element-plus`, or `antd-vue` | `vant` |
| `--output` | Output directory | `./src` |
| `--config` | Config file path | `./.ui-to-vue.config.json` |

## API Key Handling

The converter can read DashScope credentials from a config file or from the environment. Prefer an environment variable in repositories:

```bash
export DASHSCOPE_API_KEY=your_key
```

If a local config file is required, keep it out of version control:

```json
{
  "apiKey": "your_dashscope_key",
  "input": "./designs",
  "ui": "vant",
  "output": "./src"
}
```

```gitignore
.ui-to-vue.config.json
```

## Security and Privacy

- Treat design screenshots as source material that may be sent to an external model API.
- Do not run this flow on private customer designs without permission.
- Pin the converter version in repeatable workflows instead of using `@latest`.
- Review generated Vue code before committing it.
- Do not commit `.ui-to-vue.config.json`, API keys, generated secrets, or customer screenshots.

## Output Review Checklist

- [ ] Page components were generated under `views/` or the chosen output directory.
- [ ] Repeated UI regions were extracted into `components/` only when reuse is clear.
- [ ] Router output is compatible with the target project's router style.
- [ ] Generated components use the requested UI library consistently.
- [ ] Generated CSS units match the design baseline.
- [ ] The code passes the project's formatter, linter, type checker, and build.
- [ ] Placeholder copy, mock data, and generated assets were reviewed before commit.

## Troubleshooting

| Issue | Check |
| --- | --- |
| `401` or authentication error | Confirm `DASHSCOPE_API_KEY` is set in the shell running the command. |
| `command not found: ui-to-vue` | Use the `npx [email protected]` form or install the package globally. |
| Cut images are ignored | Confirm the asset directory name is supported and nested under the matching page or module. |
| Components ignore the requested UI library | Re-run with an explicit `--ui` value and inspect the generated imports. |
| Generated layout dimensions look wrong | Confirm the screenshot export width matches the target library baseline. |

## References

- npm package: `ui-to-vue-converter`

すべてのファイル

1件のファイル

ui-to-vueをインストール

スキルファイルをダウンロードし、.claude/skills/ ディレクトリに解凍してください。

ZIPをダウンロード

リポジトリをクローンし、スキルファイルをプロジェクトにコピーしてください。

git clone https://github.com/affaan-m/ECC/tree/main/skills/ui-to-vue # Copy SKILL.md to your .claude/skills/ directory

コピー コピー
クイックセットアップ: スキルフォルダを .claude/skills/ にコピーしてください。 Claude が自動的にそのスキルを検出して使用します。
リポジトリ affaan-m/ECC

関連スキル

github-code-search
更新された時間 2026年6月29日
drizzle-orm
更新された時間 2026年6月29日
prisma-client-api
更新された時間 2026年6月29日
clickhouse-io
更新された時間 2026年6月29日
OR