jpskill.com
🛠️ 開発・MCP コミュニティ

vibe-coding

AIコーディングエージェントを活用し、自然言語でソフトウェアを開発するためのパターンやワークフローを構築し、AI主導の開発体制を整えたり、プロンプト駆動開発を最適化したりするSkill。

📜 元の英語説明(参考)

Patterns and workflows for AI-assisted development (vibe coding) — building software primarily through natural language with AI coding agents. Use when: setting up an AI-first development workflow, structuring projects for AI coding, using prompt-driven development best practices, or maximizing output from Claude Code, Cursor, Windsurf, or Aider.

🇯🇵 日本人クリエイター向け解説

一言でいうと

AIコーディングエージェントを活用し、自然言語でソフトウェアを開発するためのパターンやワークフローを構築し、AI主導の開発体制を整えたり、プロンプト駆動開発を最適化したりするSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o vibe-coding.zip https://jpskill.com/download/15537.zip && unzip -o vibe-coding.zip && rm vibe-coding.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15537.zip -OutFile "$d\vibe-coding.zip"; Expand-Archive "$d\vibe-coding.zip" -DestinationPath $d -Force; ri "$d\vibe-coding.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して vibe-coding.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → vibe-coding フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Vibe Coding

概要

Vibe coding とは、主に自然言語プロンプトを通じて AI コーディングエージェントにソフトウェアを構築させることです。うまく行えば、開発を劇的に加速させることができます。AI がボイラープレートを記述し、機能を実装し、バグを修正し、ルーチンタスクを処理する一方で、あなたは意思決定、アーキテクチャ、品質に集中できます。うまくいかないと、推論が難しい半端なコードの塊が生み出されます。

生産的な vibe coding と混沌の違いは、構造コンテキスト、そして反復にかかっています。

指示

コアとなるループ

Spec → Generate → Review → Test → Iterate
  1. Spec: 何をしたいのかを明確に記述します
  2. Generate: AI にコードを生成させます
  3. Review: 生成されたものを読み、理解します
  4. Test: 実行して、動作することを確認します
  5. Iterate: フォローアッププロンプトで洗練します

レビューを絶対にスキップしないでください。コードの所有者はあなたです。AI はキーボードであり、あなたは脳です。

ステップ 1: AI 向けにプロジェクトを構造化する

AI エージェントは、プロジェクトを一目で理解できる場合に最も効果を発揮します。重要なファイル:

CLAUDE.md / AGENTS.md — AI エージェント向けのプロジェクトコンテキスト:

# プロジェクト: MyApp

## これは何か
フリーランサーが請求書とクライアントを追跡するための SaaS アプリです。

## スタック
- Next.js 15, TypeScript, Tailwind CSS, shadcn/ui
- Prisma + PostgreSQL (Supabase)
- Auth.js with GitHub OAuth
- Stripe for billing

## アーキテクチャ
- `app/` — Next.js App Router のページ
- `components/` — 再利用可能な UI コンポーネント
- `lib/` — ビジネスロジックと DB クエリ
- `lib/db/` — すべての Prisma クエリ (コンポーネントから DB をクエリしないでください)

## 主要な規約
- すべての場所で名前付きエクスポート
- すべての API 入力に対する Zod バリデーション
- クライアントサイドのデータ取得のための React Query
- エラー処理: lib/ でスローし、API ルートで適切な HTTP レスポンスをキャッチして返します

## コマンド
- `npm run dev` — 開発サーバーを起動します
- `npm run test` — Vitest テストを実行します
- `npm run db:migrate` — Prisma マイグレーションを実行します
- `npm run typecheck` — ビルドせずに TypeScript チェックを行います

これが重要な理由: CLAUDE.md がないと、AI はあなたのスタックと規約を推測します。これがあれば、すべてのプロンプトがあなたのコンテキストを継承します。毎回「strict mode で TypeScript を使用しています」と繰り返す必要はありません。

ステップ 2: 効果的なプロンプトを作成する

優れたプロンプトの構造:

[コンテキスト] + [何をしたいか] + [制約] + [必要に応じて例]

弱いプロンプト:

ユーザー設定ページを追加する

強いプロンプト:

app/settings/page.tsx にユーザー設定ページを作成します。
ユーザーが更新できるようにする必要があります: 表示名、メールアドレス、アバター URL。
app/profile/page.tsx の既存の UserForm パターンを使用します。
getServerSession で現在のユーザーを取得し、PATCH /api/user 経由で更新します。
更新ペイロード用の Zod スキーマを追加します。
lib/toast.ts の sonner セットアップを使用して、成功時にトーストを表示します。

違い: 強いプロンプトは、AI が推測することなく、プロジェクトに適合するコードを生成するのに十分な情報を提供します。

ステップ 3: コンテキスト管理

AI コーディングツールにはコンテキストウィンドウがあります。賢く使いましょう:

ファイルを小さく、焦点を絞る — 1 つのことを行う 50 行のファイルは、500 行のファイルよりも優れています。AI は全体を読み、理解し、正しく変更できます。

物事を説明的に命名するgetUserInvoicesWithLineItems.tsqueries.ts よりも多くのことを AI に伝えます。

バレルファイルを使用する — すべてを再エクスポートする lib/db/index.ts により、AI は検索せずにインポートできます:

// lib/db/index.ts
export * from "./users";
export * from "./invoices";
export * from "./clients";

プロンプトで特定のファイルを参照する:

lib/db/users.ts を見て、クライアントに対して同様のパターンを追加します。
同じエラー処理と Zod バリデーションのアプローチを使用します。

ステップ 4: スペックファーストのワークフロー

数行よりも大きな機能については、コーディング前に仕様を記述します:

## 機能: 請求書 PDF エクスポート

### 何
ユーザーが請求書の「PDF をエクスポート」をクリック → フォーマットされた PDF のダウンロードを受信

### 方法
1. フロントエンド: InvoiceDetail コンポーネントに「PDF をエクスポート」ボタンを追加
2. API: POST /api/invoices/:id/export → PDF blob を返す
3. 生成: @react-pdf/renderer を使用して PDF テンプレートを構築
4. PDF には、会社のロゴ、請求書項目、合計、支払い指示を含める必要があります

### エッジケース
- 下書きの請求書をエクスポートできます (下書きの透かしを表示)
- 長い項目の説明は、オーバーフローせずに折り返す必要があります
- 会社のロゴ URL が壊れている場合は、プレースホルダーを表示します

### テンプレート
components/InvoicePreview.tsx の既存の請求書プレビューのレイアウトを反映します

この仕様を AI に渡します: 「この機能を実装してください。最初に API ルートから始め、次に PDF テンプレート、そしてフロントエンドボタンです。」

ステップ 5: 反復的な洗練

一度にすべてではなく、チャンク単位で生成します:

反復 1: 「請求書のデータベーススキーマと Prisma モデルを作成する」
反復 2: 「作成したスキーマを使用して、請求書の CRUD API ルートを追加する」
反復 3: 「API からフェッチする請求書リストページを構築する」
反復 4: 「編集機能付きの請求書詳細ページを追加する」
反復 5: 「API ルートのテストを作成する」

各反復はレビュー可能、テスト可能、コミット可能です。これは、「完全な請求書システムを構築してください」という、一度にレビューする必要がある 2000 行のコードを生成するよりも優れています。

ステップ 6: レビューパターン

AI がコードを生成したら、以下を確認します:

  1. コンパイルされるか? すぐに tsc --noEmit を実行します
  2. パターンに従っているか? 既存の類似コードと比較します
  3. 明らかなセキュリティ上の問題はないか? 入力検証、認証チェック
  4. エラーを処理しているか? データベースがダウンした場合はどうなりますか?
  5. 要求したことを実行しているか? AI は、わずかに異なる問題を解決することがあります

何か問題がある場合は、AI に具体的に伝えます:

getUserById 関数は、ユーザーが存在しない場合を処理していません。
スローするのではなく、null を返す必要があります。修正してください。

ステップ 7: 手動でコーディングするタイミング

Vibe coding は常に適切なツールではありません:

AI を使用する:

  • ボイラープレート (CRUD ルート、フォーム、マイグレーションファイル)
  • よく理解されているパターンの実装
  • リファクタリングと名前の変更
  • 既存のロジックのテストの作成
  • エラーメッセージによるデバッグ

(原文はここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Vibe Coding

Overview

Vibe coding is building software primarily through natural language prompts to AI coding agents. Done well, it dramatically accelerates development — the AI writes boilerplate, implements features, fixes bugs, and handles routine tasks while you focus on decisions, architecture, and quality. Done poorly, it produces a mess of half-working code that's hard to reason about.

The difference between productive vibe coding and chaos comes down to structure, context, and iteration.

Instructions

The core loop

Spec → Generate → Review → Test → Iterate
  1. Spec: Write a clear description of what you want
  2. Generate: Let the AI produce the code
  3. Review: Read and understand what was generated
  4. Test: Run it and verify it works
  5. Iterate: Refine with follow-up prompts

Never skip Review. You own the code. The AI is the keyboard, you're the brain.

Step 1: Structure your project for AI

AI agents work best when they can understand your project at a glance. Key files:

CLAUDE.md / AGENTS.md — Project context for the AI agent:

# Project: MyApp

## What this is
A SaaS app for freelancers to track invoices and clients.

## Stack
- Next.js 15, TypeScript, Tailwind CSS, shadcn/ui
- Prisma + PostgreSQL (Supabase)
- Auth.js with GitHub OAuth
- Stripe for billing

## Architecture
- `app/` — Next.js App Router pages
- `components/` — Reusable UI components
- `lib/` — Business logic and DB queries
- `lib/db/` — All Prisma queries (never query DB from components)

## Key conventions
- Named exports everywhere
- Zod validation on all API inputs
- React Query for client-side data fetching
- Error handling: throw in lib/, catch and return proper HTTP responses in API routes

## Commands
- `npm run dev` — Start development server
- `npm run test` — Run Vitest tests
- `npm run db:migrate` — Run Prisma migrations
- `npm run typecheck` — TypeScript check without building

Why this matters: Without CLAUDE.md, the AI guesses your stack and conventions. With it, every prompt inherits your context — no need to repeat "we use TypeScript with strict mode" every time.

Step 2: Write effective prompts

The anatomy of a good prompt:

[Context] + [What you want] + [Constraints] + [Examples if needed]

Weak prompt:

Add a user settings page

Strong prompt:

Create a user settings page at app/settings/page.tsx.
It should let users update: display name, email, avatar URL.
Use the existing UserForm pattern from app/profile/page.tsx.
Fetch current user with getServerSession, update via PATCH /api/user.
Add a Zod schema for the update payload.
Show a toast on success using the sonner setup in lib/toast.ts.

The difference: the strong prompt gives the AI enough to produce code that fits your project without guessing.

Step 3: Context management

AI coding tools have context windows. Use them wisely:

Keep files small and focused — A 50-line file that does one thing beats a 500-line file. The AI can read the whole thing, understand it, and modify it correctly.

Name things descriptivelygetUserInvoicesWithLineItems.ts tells the AI more than queries.ts.

Use barrel fileslib/db/index.ts that re-exports everything lets the AI import without hunting:

// lib/db/index.ts
export * from "./users";
export * from "./invoices";
export * from "./clients";

Reference specific files in prompts:

Looking at lib/db/users.ts, add a similar pattern for clients.
Use the same error handling and Zod validation approach.

Step 4: The spec-first workflow

For features bigger than a few lines, write a spec before coding:

## Feature: Invoice PDF Export

### What
User clicks "Export PDF" on an invoice → receives a download of a formatted PDF

### How
1. Frontend: Add "Export PDF" button to InvoiceDetail component
2. API: POST /api/invoices/:id/export → returns a PDF blob
3. Generation: Use @react-pdf/renderer to build the PDF template
4. The PDF should include: company logo, invoice items, totals, payment instructions

### Edge cases
- Draft invoices can be exported (show DRAFT watermark)
- Long item descriptions should wrap, not overflow
- If company logo URL is broken, show placeholder

### Template
Mirror the layout of the existing invoice preview at components/InvoicePreview.tsx

Hand this spec to the AI: "Implement this feature. Start with the API route, then the PDF template, then the frontend button."

Step 5: Iterative refinement

Generate in chunks, not all at once:

Iteration 1: "Create the database schema and Prisma model for invoices"
Iteration 2: "Add the CRUD API routes for invoices using the schema we just created"
Iteration 3: "Build the invoice list page that fetches from the API"
Iteration 4: "Add the invoice detail page with edit functionality"
Iteration 5: "Write tests for the API routes"

Each iteration is reviewable, testable, and committable. This beats "build me a full invoice system" which produces 2000 lines you need to review all at once.

Step 6: Review patterns

When the AI produces code, check:

  1. Does it compile? Run tsc --noEmit immediately
  2. Does it follow your patterns? Compare to existing similar code
  3. Are there obvious security issues? Input validation, auth checks
  4. Does it handle errors? What happens when the database is down?
  5. Does it do what you asked? AI sometimes solves a slightly different problem

If something looks wrong, tell the AI specifically:

The getUserById function doesn't handle the case where the user doesn't exist.
It should return null, not throw. Fix that.

Step 7: When to code manually

Vibe coding isn't always the right tool:

Use AI for:

  • Boilerplate (CRUD routes, forms, migration files)
  • Implementing well-understood patterns
  • Refactoring and renaming
  • Writing tests for existing logic
  • Debugging with error messages

Write manually when:

  • The algorithm requires careful thought (complex business logic, performance-critical code)
  • Security is critical (auth flows, cryptography)
  • You're prototyping and exploring the problem space
  • The AI keeps getting it wrong (you understand it better than it does)

Step 8: Git hygiene with AI coding

Commit small, commit often. When the AI generates a bunch of code:

# Review changes before committing
git diff

# Commit in logical chunks
git add lib/db/invoices.ts
git commit -m "feat: add invoice DB queries"

git add app/api/invoices/route.ts
git commit -m "feat: add invoice CRUD API"

This keeps your history readable and makes it easy to revert if the AI went off track.

Examples

Example 1: Starting a new project with Claude Code

# 1. Create project
npx create-next-app@latest myapp --typescript --tailwind --app

# 2. Write CLAUDE.md
cat > CLAUDE.md << 'EOF'
# MyApp
Next.js 15 + TypeScript + Prisma + Supabase + Auth.js + Stripe
[... stack and conventions ...]
EOF

# 3. Start Claude Code
claude

# 4. Prompt:
"Read CLAUDE.md. Set up the project:
1. Install Prisma and configure with Supabase connection string from .env
2. Create the initial User and Account models for Auth.js
3. Add the Auth.js configuration with GitHub OAuth
4. Create a basic layout with header and sidebar using shadcn/ui"

Example 2: Debugging with context

I'm getting this error:
PrismaClientKnownRequestError: Foreign key constraint failed on field: invoice_id

It happens when I call deleteClient() in lib/db/clients.ts.
The client has existing invoices. I need to either:
a) Block deletion if invoices exist (return an error)
b) Cascade delete the invoices too

Looking at the business rules in CLAUDE.md, what approach makes sense,
and how should I implement it?

Example 3: Refactoring session

The components/forms/ directory has grown to 15 files and they're all doing
their own validation and submission logic differently.

Please:
1. Identify the common patterns across these form components
2. Extract a useFormSubmit hook that handles: loading state, error handling, success toast
3. Refactor UserForm.tsx and InvoiceForm.tsx to use it as a demonstration
4. I'll refactor the remaining forms myself following that pattern

Guidelines

  • Read what the AI writes — you're responsible for the code, not the AI
  • Commit before major changes — easy to revert if the AI goes sideways
  • One thing at a time — smaller tasks produce better results than "build the whole feature"
  • Invest in CLAUDE.md/AGENTS.md — 30 minutes writing context saves hours of prompt repetition
  • Small files beat large files — better AI comprehension, easier diffs, more modular
  • Test after every generation — catch problems early before they compound
  • Tell the AI your constraints — token budgets, existing patterns, what NOT to change
  • When stuck, be more specific — vague prompts produce vague code