MCP HubMCP Hub
スキル一覧に戻る

Setting up Next.js Project

camoneart
更新日 Yesterday
94 閲覧
2
2
GitHubで表示
その他general

について

このClaudeスキルは、ESLintとPrettierを推奨設定でセットアップし、Next.jsプロジェクトの設定を自動化します。パッケージのインストール、設定ファイルの作成、ツール間の競合解決を処理します。新しいNext.jsプロジェクトの初期化時や、既存プロジェクトにリンター/フォーマッターを追加する際にご利用ください。

クイックインストール

Claude Code

推奨
プラグインコマンド推奨
/plugin add https://github.com/camoneart/claude-code
Git クローン代替
git clone https://github.com/camoneart/claude-code.git ~/.claude/skills/Setting up Next.js Project

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Setting up Next.js Project

Next.jsプロジェクトのセットアップ時に必要な設定を自動化するスキル。

いつ使うか

  • Next.jsプロジェクトを新規作成する時
  • 既存Next.jsプロジェクトにESLint/Prettierを追加する時
  • コードフォーマット設定が必要な時
  • ユーザーが「Next.jsセットアップ」について言及した時

セットアップ手順

1. ESLint + Prettier の必須インストール

Next.jsはESLintを自動インストールするが、Prettierも必ず追加

pnpm add -D prettier eslint-config-prettier prettier-plugin-tailwindcss

パッケージの役割:

  • prettier: コードフォーマッター
  • eslint-config-prettier: ESLintとPrettierの競合を防ぐ
  • prettier-plugin-tailwindcss: Tailwind CSSのクラス順序を整理(Tailwind使用時)

2. 設定ファイルの作成

.prettierrc.json

プロジェクトルートに作成:

{
  "semi": true,
  "singleQuote": true,
  "trailingComma": "es5",
  "tabWidth": 2,
  "useTabs": false,
  "printWidth": 100,
  "bracketSpacing": true,
  "arrowParens": "always"
}

.eslintrc.json の更新

既存の設定に eslint-config-prettier を追加:

{
  "extends": ["next/core-web-vitals", "prettier"]
}

3. package.json スクリプトの追加

{
  "scripts": {
    "format": "prettier --write .",
    "format:check": "prettier --check ."
  }
}

使い方:

  • pnpm run format: 全ファイルをフォーマット
  • pnpm run format:check: フォーマットチェック(CI用)

4. VS Code 設定の推奨

.vscode/settings.json を作成(任意):

{
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
}

完全なセットアップフロー

新規プロジェクト

# 1. Next.jsプロジェクト作成
pnpm dlx create-next-app@latest my-app

# 2. ディレクトリ移動
cd my-app

# 3. Prettier追加
pnpm add -D prettier eslint-config-prettier prettier-plugin-tailwindcss

# 4. 設定ファイル作成
# (このスキルが自動で作成)

# 5. フォーマット実行
pnpm run format

既存プロジェクト

# 1. Prettier追加
pnpm add -D prettier eslint-config-prettier prettier-plugin-tailwindcss

# 2. 設定ファイル追加
# (このスキルが自動で作成)

# 3. ESLint設定更新
# (このスキルが自動で更新)

# 4. フォーマット実行
pnpm run format

設定ファイルテンプレート

詳細なテンプレートは templates/ を参照。

チェックリスト

セットアップ完了前に確認:

  • Prettierがインストールされているか
  • .prettierrc.json が作成されているか
  • .eslintrc.jsonprettier が追加されているか
  • package.json に format スクリプトが追加されているか
  • pnpm run format が正常に動作するか
  • .vscode/settings.json の作成を検討したか

トラブルシューティング

フォーマットが効かない

  1. Prettier拡張がインストールされているか確認
  2. .prettierrc.json の構文エラーを確認
  3. ESLintとの競合を確認(eslint-config-prettier が必要)

Tailwind CSSのクラス順序が整わない

  1. prettier-plugin-tailwindcss がインストールされているか確認
  2. .prettierrc.json にプラグイン設定を追加

参考リンク

GitHub リポジトリ

camoneart/claude-code
パス: skills/setting-up-nextjs-project

関連スキル

algorithmic-art

メタ

This Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.

スキルを見る

subagent-driven-development

開発

This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.

スキルを見る

executing-plans

デザイン

Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.

スキルを見る

cost-optimization

その他

This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.

スキルを見る