Agent skill · Audited from source
Vite Patterns
skill · affaan-m/ECCMIT licenceAudited 22 Sep 2026 · source fb3fb10d9622
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit fb3fb10d9622 and found no filesystem, network or shell access and no hard-coded secrets. What it does: Vite build tool patterns including config, plugins, HMR, env variables, proxy setup, SSR, library mode, dependency pre-bundling, and build optimization. Activate when working with vite.config.ts, Vite plugins, or…
Cite
Cite this page
ModelsAtlas. “Vite Patterns (affaan-m/ECC)”. Retrieved 22 Sep 2026. https://modelsatlas.com/skills/affaan-m/vite-patterns
Trust audit
Audit 0.4.1 · source read 22 Sep 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (0)
No findings at any severity. We re-audit when the source changes.
Audit 0.4.1 · source sha fb3fb10d9622 · 22 Sep 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisheraffaan-m GitHub userOwner of the repository this skill is read from
- Source folderaffaan-m/ECC/docs/ja-JP/skills/vite-patternsThe exact folder we audited
- LicenceMITAs the repository states it
- Commit pinned for this verdictfb3fb10d9622A new audit runs when the source changes
- Repository statusNot archivedPushed today
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Vite build tool patterns including config, plugins, HMR, env variables, proxy setup, SSR, library mode, dependency pre-bundling, and build optimization. Activate when working with vite.config.ts, Vite plugins, or…
---
name: vite-patterns
description: Vite build tool patterns including config, plugins, HMR, env variables, proxy setup, SSR, library mode, dependency pre-bundling, and build optimization. Activate when working with vite.config.ts, Vite plugins, or Vite-based projects.
origin: ECC
---
# Vite パターン
Vite 8+ プロジェクトのビルドツールおよびデベロップメントサーバーのパターン。設定、環境変数、プロキシ設定、ライブラリモード、依存関係の事前バンドル、一般的な本番環境の落とし穴をカバー。
## 使用するタイミング
- `vite.config.ts` または `vite.config.js` を設定するとき
- 環境変数または `.env` ファイルを設定するとき
- APIバックエンド用のデベロップメントサーバープロキシを設定するとき
- ビルド出力(チャンク、ミニファイ、アセット)を最適化するとき
- `build.lib` でライブラリを公開するとき
- 依存関係の事前バンドルまたはCJS/ESM相互運用のトラブルシューティングをするとき
- HMR、デベロップメントサーバー、またはビルドエラーをデバッグするとき
- Viteプラグインの選択または順序付けをするとき
## 動作の仕組み
- **デベロップメントモード**はソースファイルをネイティブESMとして提供します(バンドルなし)。変換はモジュールリクエストごとにオンデマンドで行われるため、コールドスタートが速くHMRが精確です。
- **ビルドモード**はRolldown(v7+)またはRollup(v5〜v6)を使用して、ツリーシェイキング、コード分割、Oxcベースのミニファイでアプリを本番用にバンドルします。
- **依存関係の事前バンドル**はesbuildを通じてCJS/UMD依存関係をESMに一度変換し、結果を `node_modules/.vite` にキャッシュします。これにより後続の起動では処理をスキップできます。
- **プラグイン**はデベロップメントとビルドにわたって統一されたインターフェースを共有します。同じプラグインオブジェクトが、デベロップメントサーバーのオンデマンド変換と本番パイプラインの両方で機能します。
- **環境変数**はビルド時に静的にインライン化されます。`VITE_` プレフィックス付きの変数はバンドル内のパブリック定数になり、プレフィックスなしのものはクライアントコードから見えません。
## 例
### 設定の構造
#### 基本設定
```typescript
// vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
resolve: {
alias: { '@': new URL('./src', import.meta.url).pathname },
},
})
```
#### 条件付き設定
```typescript
// vite.config.ts
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig(({ command, mode }) => {
const env = loadEnv(mode, process.cwd()) // VITE_ プレフィックスのみ(安全)
return {
plugins: [react()],
server: command === 'serve' ? { port: 3000 } : undefined,
define: {
__API_URL__: JSON.stringify(env.VITE_API_URL),
},
}
})
```
#### 主要な設定オプション
| キー | デフォルト | 説明 |
|-----|---------|-------------|
| `root` | `'.'` | プロジェクトルート(`index.html` の場所) |
| `base` | `'/'` | デプロイされたアセットのパブリックベースパス |
| `envPrefix` | `'VITE_'` | クライアントに公開する環境変数のプレフィックス |
| `build.outDir` | `'dist'` | 出力ディレクトリ |
| `build.minify` | `'oxc'` | ミニファイアー(`'oxc'`、`'terser'`、または `false`) |
| `build.sourcemap` | `false` | `true`、`'inline'`、または `'hidden'` |
### プラグイン
#### 必須プラグイン
ほとんどのプラグインのニーズは、少数のよく管理されたパッケージでカバーできます。独自のプラグインを作成する前にこれらを検討してください。
| プラグイン | 目的 | 使用タイミング |
|--------|---------|-------------|
| `@vitejs/plugin-react-swc` | SWC経由のReact HMR + Fast Refresh | Reactアプリのデフォルト(Babelバリアントより高速) |
| `@vitejs/plugin-react` | Babel経由のReact HMR + Fast Refresh | Babelプラグインが必要な場合のみ(emotion、MobXデコレーター) |
| `@vitejs/plugin-vue` | Vue 3 SFCサポート | Vueアプリ |
| `vite-plugin-checker` | ワーカースレッドでHMRオーバーレイ付きの `tsc` + ESLintを実行 | **TypeScriptアプリ全般** — Viteは `vite build` 中に型チェックを行いません |
| `vite-tsconfig-paths` | `tsconfig.json` の `paths` エイリアスを尊重 | `tsconfig.json` にエイリアスが既にある場合 |
| `vite-plugin-dts` | ライブラリモードで `.d.ts` ファイルを出力 | TypeScriptライブラリを公開するとき |
| `vite-plugin-svgr` | SVGをReactコンポーネントとしてインポート | SVGをコンポーネントとして使用するReactアプリ |
| `rollup-plugin-visualizer` | バンドルのツリーマップ/サンバーストレポート | 定期的なバンドルサイズの監査(`enforce: 'post'` を使用) |
| `vite-plugin-pwa` | ゼロ設定のPWA + Workbox | オフライン対応アプリ |
**重要な注意:** `vite build` はトランスパイルしますが、型チェックは行いません。`vite-plugin-checker` を追加するか、CIで `tsc --noEmit` を実行しない限り、型エラーは本番環境にサイレントに出荷されます。
#### カスタムプラグインの作成
カスタムプラグインの作成は稀です。ほとんどのニーズは既存のプラグインでカバーできます。必要な場合は `vite.config.ts` にインラインで書き始め、再利用する場合にのみ抽出してください。
```typescript
// vite.config.ts — 最小限のインラインプラグイン
function myPlugin(): Plugin {
return {
name: 'my-plugin', // 必須、一意でなければならない
enforce: 'pre', // 'pre' | 'post'(オプション)
apply: 'build', // 'build' | 'serve'(オプション)
transform(code, id) {
if (!id.endsWith('.custom')) return
return { code: transformCustom(code), map: null }
},
}
}
```
**主要フック:** `transform`(ソースの変更)、`resolveId` + `load`(仮想モジュール)、`transformIndexHtml`(HTMLへの注入)、`configureServer`(デベロップメントミドルウェアの追加)、`hotUpdate`(カスタムHMR — v7+で非推奨の `handleHotUpdate` の代替)。
**仮想モジュール**は `\0` プレフィックス規約を使用します — `resolveId` は `'\0virtual:my-id'` を返すことで他のプラグインがスキップします。ユーザーコードは `'virtual:my-id'` をインポートします。
完全なプラグインAPIは [vite.dev/guide/api-plugin](https://vite.dev/guide/api-plugin) を参照してください。開発中の変換パイプラインのデバッグには `vite-plugin-inspect` を使用してください。
### HMR API
フレームワークプラグイン(`@vitejs/plugin-react`、`@vitejs/plugin-vue` など)はHMRを自動的に処理します。カスタム状態ストア、デベロップメントツール、または更新を跨いで状態を保持する必要があるフレームワーク非依存のユーティリティをビルドする場合のみ、`import.meta.hot` を直接使用してください。
```typescript
// src/store.ts — バニラモジュールの手動HMR
if (import.meta.hot) {
// 更新を跨いで状態を保持する(.dataを再代入せず、必ず変更すること)
import.meta.hot.data.count = import.meta.hot.data.count ?? 0
// モジュールが置き換えられる前にサイドエフェクトをクリーンアップ
import.meta.hot.dispose((data) => clearInterval(data.intervalId))
// このモジュール自身の更新を受け入れる
import.meta.hot.accept()
}
```
すべての `import.meta.hot` コードは本番ビルドからツリーシェイクされます — ガードを削除する必要はありません。
### 環境変数
Viteは `.env`、`.env.local`、`.env.[mode]`、`.env.[mode].local` をその順序で読み込みます(後のものが前のものを上書き)。`*.local` ファイルはgitignoreされており、ローカルのシークレット用です。
#### クライアントサイドアクセス
`VITE_` プレフィックス付きの変数のみがクライアントコードに公開されます:
```typescript
import.meta.env.VITE_API_URL // string
import.meta.env.MODE // 'development' | 'production' | カスタム
import.meta.env.BASE_URL // base設定値
import.meta.env.DEV // boolean
import.meta.env.PROD // boolean
import.meta.env.SSR // boolean
```
#### 設定での環境変数使用
```typescript
// vite.config.ts
import { defineConfig, loadEnv } from 'vite'
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd()) // VITE_ プレフィックスのみ(安全)
return {
define: {
__API_URL__: JSON.stringify(env.VITE_API_URL),
},
}
})
```
### セキュリティ
#### `VITE_` プレフィックスはセキュリティ境界ではない
`VITE_` でプレフィックスされた変数は**ビルド時にクライアントバンドルに静的にインライン化されます**。ミニファイ、base64エンコード、ソースマップの無効化では隠せません。悪意のある攻撃者は出荷されたJavaScriptから任意のExcerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit fb3fb10
git clone https://github.com/affaan-m/ECC git -C ECC checkout fb3fb10d9622
The author documents no install command, so this uses the repository directly. Our verdict covers commit fb3fb10d9622 only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
fb3fb10d9622
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/affaan-m/vite-patterns/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
affaan-m/everything-claude-code
Eval-driven development (EDD) framework for AI coding sessions — define capability and regression evals before coding, grade with code-based, model-based, rule, or human graders, and track pass@k and pass^k reliability.…
affaan-m/everything-claude-code
Map a described workflow to the right ECC command group with run-order and stop condition, or browse all command-group recipe families read live from the commands directory. Advisory only — never executes. Use when…
affaan-m/everything-claude-code
Design task-local harnesses, eval gates, and reusable skill extraction for Claude dynamic workflow mode and other adaptive agent harnesses. Use when building a task-local harness, adding eval gates, or extracting a…
affaan-m/everything-claude-code
Run the full Django verification loop — environment check, mypy/ruff/black linting, migration safety, pytest with coverage targets, pip-audit and bandit security scans, settings and logging review, and diff review —…
affaan-m/everything-claude-code
Django architecture patterns, REST API design with DRF, ORM best practices, caching, signals, middleware, and production-grade Django apps. Use when building or reviewing Django apps, DRF APIs, ORM queries, or caching.
affaan-m/everything-claude-code
Django security best practices, authentication, authorization, CSRF protection, SQL injection prevention, XSS prevention, and secure deployment configurations. Use when reviewing Django authentication, authorization,…
Add this badge to your README
[](https://modelsatlas.com/skills/affaan-m/vite-patterns/)
<a href="https://modelsatlas.com/skills/affaan-m/vite-patterns/"><img src="https://modelsatlas.com/skills/affaan-m/vite-patterns/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Vite Patterns
What does the Vite Patterns skill do?
Is Vite Patterns safe to install?
What can Vite Patterns access on my machine?
How current is this page?
Sources
- github.com/affaan-m/ECC/tree/main/docs/ja-JP/skills/vite-pattern — the audited source at commit fb3fb10d9622 and every finding aboveObserved · 22 Sep 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Vite Patterns skill do?
- Is Vite Patterns safe to install?
- What can Vite Patterns access on my machine?