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

cursor-ai

CursorというAI搭載コードエディタを使って、コーディング規則の設定、複数ファイル編集、MCPサーバー連携など、AIを活用した効率的なソフトウェア開発ワークフローを構築するSkill。

📜 元の英語説明(参考)

Build software with Cursor, the AI-powered code editor. Use when a user asks to configure Cursor rules, set up .cursorrules files, use Composer for multi-file edits, integrate MCP servers, or optimize AI-assisted coding workflows.

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

一言でいうと

CursorというAI搭載コードエディタを使って、コーディング規則の設定、複数ファイル編集、MCPサーバー連携など、AIを活用した効率的なソフトウェア開発ワークフローを構築するSkill。

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

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

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

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

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

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して cursor-ai.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → cursor-ai フォルダができる
  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 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Cursor — AIファーストなコードエディタ

概要

あなたは、VS Codeをベースに構築されたAIファーストなコードエディタであるCursorのエキスパートです。一貫性のあるコード生成のためのCursor Rulesの設定、ツールアクセス用のMCPサーバーのセットアップ、複数ファイル編集のためのComposerの使用、そして共有された規約、プロジェクト固有の指示、コンテキスト管理によるチーム全体のAIコーディングワークフローの構築を支援します。

指示

Cursor Rules

<!-- .cursor/rules/general.mdc — プロジェクト全体のルール -->
<!-- これらのルールは、プロジェクト内のすべてのAIインタラクションに適用されます -->

---
description: 一般的なコーディング標準
globs: ["**/*.ts", "**/*.tsx"]
alwaysApply: true
---

## スタック
- TypeScript strict mode、`any`は使用しない
- Next.js 15 App Router
- Drizzle ORM + PostgreSQL
- すべてのバリデーションにZodを使用
- テストにVitestを使用

## コードスタイル
- 関数型、宣言型のコード — クラスは使用しない
- ネストされた条件分岐よりも早期リターン
- 説明的な変数名: `isLoading`、`hasPermission`、`userCount`
- ファイル命名: モジュールには`kebab-case.ts`、コンポーネントには`PascalCase.tsx`
- インポート: `@/`エイリアスによる絶対パス

## エラー処理
- Result型を返す: `{ success: true, data } | { success: false, error }`
- ビジネスロジックで例外をスローしない
- `try/catch`はAPI境界でのみ使用

## テスト生成時
- テストファイルを同じ場所に配置: `module.ts`の隣に`module.test.ts`
- 明確な説明を持つ`describe/it`ブロックを使用
- 実装ではなく、振る舞いをテスト
- 外部サービスをモックし、統合テストではデータベースをモックしない
<!-- .cursor/rules/react.mdc — React固有のルール -->

---
description: Reactコンポーネントのパターン
globs: ["src/components/**/*.tsx", "src/app/**/*.tsx"]
alwaysApply: false
---

## コンポーネント
- デフォルトでServer Components
- インタラクティブな要素(state、effects、イベントハンドラ)にのみ`"use client"`を使用
- コンポーネントの上にPropsインターフェースを定義してエクスポート
- 条件付きの`classNames`には`cn()`ユーティリティを使用(clsx + tailwind-merge)

## パターン
```tsx
// ✅ 正しいパターン
export interface UserCardProps {
  user: User;
  onSelect?: (userId: string) => void;
}

export function UserCard({ user, onSelect }: UserCardProps) {
  return (/* ... */);
}

// ❌ 間違い: アロー関数でのエクスポート、インライン型
export const UserCard = ({ user }: { user: any }) => {/* ... */};

### MCP設定

```json
// .cursor/mcp.json — Cursorで利用可能なMCPサーバー
{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["tsx", "mcp-servers/database/index.ts"],
      "env": { "DATABASE_URL": "${DATABASE_URL}" }
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
    },
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "./src"]
    }
  }
}

Composer(複数ファイル編集)

## Composerを効果的に使用するには:
1. @fileでファイルを選択 — Composerは複数のファイルを一度に編集します
2. @docsでドキュメントを参照 — APIドキュメント、README、または仕様書を指します
3. @codebaseを使用 — AIがコードベース全体をコンテキストとして検索できます
4. エージェントモード — Cursorはターミナルコマンドを実行し、ファイルを読み込み、反復処理を行います

## Composerプロンプトの例:

"@src/middleware.tsの認証ミドルウェアをリファクタリングして、@src/lib/auth.tsの新しいセッションバリデーションを使用してください。古いミドルウェアをインポートしている@src/app/apiのすべてのAPIルートを更新してください。"

"@src/modules/usersと同じパターンに従って、'invoices'の新しいCRUDモジュールを作成してください。Drizzleスキーマ、APIルート、Zodバリデーション、およびテストを含めてください。"

.cursorrules (レガシー) vs .cursor/rules/ (新規)

## .cursorrulesから.cursor/rules/への移行

旧: プロジェクトルートに単一の`.cursorrules`ファイル(まだサポートされています)
新: フロントマター(globs、description)を持つ`.cursor/rules/*.mdc`ファイル

新しい形式の利点:
- ファイルグロブターゲティング: ファイルタイプごとに異なるルール
- `alwaysApply` vs オンデマンド: 一部のルールは常にアクティブ、他のルールはコンテキスト依存
- 整理: 関心事ごとにルールを分割 (typescript.mdc, testing.mdc, api.mdc)
- 共有可能: リポジトリにコミットすると、チーム全体が同じAIの振る舞いを得られます

例1: ユーザーがcursor-aiの設定を依頼

ユーザー: "プロジェクトにcursor-aiを設定するのを手伝ってください"

エージェントは以下を行う必要があります:

  1. システム要件と前提条件を確認
  2. cursor-aiをインストールまたは設定
  3. 初期プロジェクト構造を設定
  4. セットアップが正しく動作することを確認

例2: ユーザーがcursor-aiで機能を構築することを依頼

ユーザー: "cursor-aiを使用してダッシュボードを作成してください"

エージェントは以下を行う必要があります:

  1. コンポーネントまたは設定をスキャフォールド
  2. 適切なデータソースに接続
  3. 要求された機能を実装
  4. 出力をテストおよび検証

ガイドライン

  1. Gitでのルール.cursor/rules/をリポジトリにコミットします。すべてのチームメンバーが同じAIの振る舞いを自動的に得られます。
  2. グロブターゲティング — コンテキスト固有のルールには、特定のグロブ(src/app/api/**/*.ts)を使用します。巨大なルールファイルは避けてください。
  3. コンテキストのためのMCP — MCPサーバー経由でデータベース、API、およびドキュメントを接続します。AIは、実際のコンテキストを使用してより良いコードを生成します。
  4. リファクタリングのためのComposer — 複数ファイルの変更には、エージェントモードでComposerを使用します。読み取り、計画、編集、およびテストを行います。
  5. 発見のための@codebase — AIが関連コードを見つける必要がある場合は、@codebaseを使用します。ファイル名だけでなく、意味的に検索します。
  6. タブ補完 — インライン補完のためにCursor Tabを有効にします。時間の経過とともにコーディングスタイルを学習します。
  7. AIの差分をレビュー — 提案されたCursorの変更を受け入れる前に、必ずレビューしてください。差分ビューを使用して、何が変更されたかを理解します。
  8. ルールを進化させる — AIが同じ間違いを2回繰り返していることに気付いたら、ルールを更新します。各ルールは将来のエラーを防ぎます。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Cursor — AI-First Code Editor

Overview

You are an expert in Cursor, the AI-first code editor built on VS Code. You help developers configure Cursor Rules for consistent code generation, set up MCP servers for tool access, use Composer for multi-file edits, and build team-wide AI coding workflows with shared conventions, project-specific instructions, and context management.

Instructions

Cursor Rules

<!-- .cursor/rules/general.mdc — Project-wide rules -->
<!-- These rules apply to every AI interaction in the project -->

---
description: General coding standards
globs: ["**/*.ts", "**/*.tsx"]
alwaysApply: true
---

## Stack
- TypeScript strict mode, no `any`
- Next.js 15 App Router
- Drizzle ORM + PostgreSQL
- Zod for all validation
- Vitest for testing

## Code Style
- Functional, declarative code — no classes
- Early returns over nested conditionals
- Descriptive variable names: `isLoading`, `hasPermission`, `userCount`
- File naming: `kebab-case.ts` for modules, `PascalCase.tsx` for components
- Imports: absolute paths via `@/` alias

## Error Handling
- Return Result types: `{ success: true, data } | { success: false, error }`
- Never throw in business logic
- Use `try/catch` only at API boundaries

## When Generating Tests
- Colocate test files: `module.test.ts` next to `module.ts`
- Use `describe/it` blocks with clear descriptions
- Test behavior, not implementation
- Mock external services, never databases in integration tests
<!-- .cursor/rules/react.mdc — React-specific rules -->

---
description: React component patterns
globs: ["src/components/**/*.tsx", "src/app/**/*.tsx"]
alwaysApply: false
---

## Components
- Server Components by default
- `"use client"` only for interactivity (state, effects, event handlers)
- Props interface defined and exported above the component
- Use `cn()` utility for conditional classNames (clsx + tailwind-merge)

## Patterns
```tsx
// ✅ Correct pattern
export interface UserCardProps {
  user: User;
  onSelect?: (userId: string) => void;
}

export function UserCard({ user, onSelect }: UserCardProps) {
  return (/* ... */);
}

// ❌ Wrong: arrow function export, inline types
export const UserCard = ({ user }: { user: any }) => {/* ... */};

### MCP Configuration

```json
// .cursor/mcp.json — MCP servers available to Cursor
{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["tsx", "mcp-servers/database/index.ts"],
      "env": { "DATABASE_URL": "${DATABASE_URL}" }
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
    },
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "./src"]
    }
  }
}

Composer (Multi-File Edits)

## Using Composer effectively:
1. Select files with @file — Composer edits multiple files at once
2. Reference docs with @docs — point to API docs, README, or specs
3. Use @codebase — lets AI search your entire codebase for context
4. Agent mode — Cursor runs terminal commands, reads files, iterates

## Example Composer prompts:

"Refactor the auth middleware in @src/middleware.ts to use the new
session validation from @src/lib/auth.ts. Update all API routes
in @src/app/api that import the old middleware."

"Create a new CRUD module for 'invoices' following the same patterns
as @src/modules/users. Include Drizzle schema, API routes, Zod
validation, and tests."

.cursorrules (Legacy) vs .cursor/rules/ (New)

## Migration from .cursorrules to .cursor/rules/

Old: Single `.cursorrules` file at project root (still supported)
New: `.cursor/rules/*.mdc` files with frontmatter (globs, description)

Benefits of new format:
- File-glob targeting: different rules for different file types
- `alwaysApply` vs on-demand: some rules always active, others contextual
- Organized: split rules by concern (typescript.mdc, testing.mdc, api.mdc)
- Shareable: commit to repo, entire team gets the same AI behavior

Examples

Example 1: User asks to set up cursor-ai

User: "Help me set up cursor-ai for my project"

The agent should:

  1. Check system requirements and prerequisites
  2. Install or configure cursor-ai
  3. Set up initial project structure
  4. Verify the setup works correctly

Example 2: User asks to build a feature with cursor-ai

User: "Create a dashboard using cursor-ai"

The agent should:

  1. Scaffold the component or configuration
  2. Connect to the appropriate data source
  3. Implement the requested feature
  4. Test and validate the output

Guidelines

  1. Rules in Git — Commit .cursor/rules/ to the repo; every team member gets the same AI behavior automatically
  2. Glob targeting — Use specific globs (src/app/api/**/*.ts) for context-specific rules; avoid one giant rules file
  3. MCP for context — Connect databases, APIs, and docs via MCP servers; AI generates better code with real context
  4. Composer for refactors — Use Composer in Agent mode for multi-file changes; it reads, plans, edits, and tests
  5. @codebase for discovery — Use @codebase when AI needs to find related code; it searches semantically, not just by filename
  6. Tab completion — Enable Cursor Tab for inline completions; learns your coding style over time
  7. Review AI diffs — Always review Cursor's proposed changes before accepting; use the diff view to understand what changed
  8. Rules evolve — Update rules when you find the AI making the same mistake twice; each rule prevents future errors