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

rails-ai-kit-init

Rails AI Kitのスターターキットを基に、新しいRailsプロジェクトをGitHub上に作成し、必要な初期設定を自動で行い、アプリケーションが起動できる状態にするSkill。

📜 元の英語説明(参考)

Initialize a new project from the rails-ai-kit starter kit. Clones the repo, creates a new GitHub repository, remaps git remotes (origin → new project, upstream → rails-ai-kit), runs bin/setup, and verifies the app boots. Use this skill when the user says things like: 'start a new rails-ai-kit project', 'scaffold a new app from rails-ai-kit', 'create a new project from the kit', 'init rails-ai-kit for...', 'new project called...', 'clone rails-ai-kit as...', or wants to bootstrap a new Rails + React + Inertia app from the starter kit.

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

一言でいうと

Rails AI Kitのスターターキットを基に、新しいRailsプロジェクトをGitHub上に作成し、必要な初期設定を自動で行い、アプリケーションが起動できる状態にするSkill。

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

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

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

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

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

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

Rails AI Kit — プロジェクトイニシャライザ

rails-ai-kit スターターキットから新しいプロジェクトの完全なセットアップを自動化します。gitリモート構成、GitHubリポジトリの作成、依存関係のインストール、データベースの準備、および起動検証を処理し、プロジェクトがすぐに機能を構築できる状態にします。

これは単なるクローンではありません。以下のように適切に構成されたプロジェクトを作成します。

  • origin は新しいプロジェクトリポジトリを指します(git push の準備完了)
  • upstreamAAlvAAro/rails-ai-kit を指します(git fetch upstream && git merge upstream/main の準備完了)
  • すべての依存関係がインストールされ、データベースが移行され、開発サーバーが検証されます

ワークフローの概要

入力 (プロジェクト名、オプションの組織)
  → rails-ai-kit をクローン
    → 新しい GitHub リポジトリを作成
      → git リモートを再マップ
        → git の履歴をクリーン (オプション)
          → bin/setup を実行
            → 起動を検証
              → 結果 + 次のステップを表示

ステップ 0: 入力を収集

ユーザーのメッセージからこれらの値を決定するか、不足している場合は尋ねます。

入力 必須ですか?
プロジェクト名 cafeteria-pro はい
GitHub オーナー/組織 AAlvAAro デフォルト: AAlvAAro
リポジトリの可視性 private または public デフォルト: private
新規履歴? yes/no デフォルト: no (rails-ai-kit の履歴を保持)
親ディレクトリ /Users/aalvaaro/Projects デフォルト: 現在の作業ディレクトリ

プロジェクト名のルール:

  • 小文字のケバブケースである必要があります (例: my-saas-appMySaasApp ではない)
  • ディレクトリ名、GitHub リポジトリ名、Kamal サービス名、およびデータベース名として使用されます

ユーザーが「Cafeteria Pro という新しいプロジェクトを開始する」のように言った場合、以下を推測します。

  • プロジェクト名: cafeteria-pro
  • リポジトリ: AAlvAAro/cafeteria-pro
  • 続行する前に確認してください

ステップ 1: rails-ai-kit をクローン

スターターキットを、新しいプロジェクト名でターゲットディレクトリにクローンします。

git clone https://github.com/AAlvAAro/rails-ai-kit.git <parent-dir>/<project-name>
cd <parent-dir>/<project-name>

主要なファイルが存在するかどうかを確認して、クローンが成功したことを確認します。

  • Gemfile が存在する
  • package.json が存在する
  • CLAUDE.md が存在する
  • bin/setup が存在する
  • app/frontend/pages/ ディレクトリが存在する

いずれかが欠落している場合は、中止してエラーを報告します。


ステップ 2: GitHub リポジトリを作成

gh を使用して、GitHub に新しいリポジトリを作成します。

gh repo create <owner>/<project-name> --<visibility> --source=. --remote=new-origin

gh が認証されていない場合は、ユーザーに ! gh auth login を実行して再試行するように指示します。

リポジトリが既に存在する場合は、ユーザーに次のいずれかを選択するように求めます。

  • 既存のリポジトリを使用する (作成をスキップ)
  • 別の名前を選択する
  • 中止する

ステップ 3: Git リモートを再マップ

origin が新しいプロジェクトになり、upstream が rails-ai-kit を追跡するようにリモートを構成します。

# 元の origin を upstream に名前変更
git remote rename origin upstream

# gh によって作成されたリモートを origin に名前変更
git remote rename new-origin origin

リモートの設定を確認します。

git remote -v

期待される出力:

origin    git@github.com:<owner>/<project-name>.git (fetch)
origin    git@github.com:<owner>/<project-name>.git (push)
upstream  https://github.com/AAlvAAro/rails-ai-kit.git (fetch)
upstream  https://github.com/AAlvAAro/rails-ai-kit.git (push)

リモートが一致しない場合は、続行する前に修正してください。


ステップ 4: Git の履歴を初期化

ユーザーが新規履歴を選択した場合:

# 既存の git 履歴を削除
rm -rf .git
git init
git add -A
git commit -m "Initial commit from rails-ai-kit

Scaffolded from https://github.com/AAlvAAro/rails-ai-kit

Co-Authored-By: Claude <noreply@anthropic.com>"

# リモートを再度追加
git remote add origin git@github.com:<owner>/<project-name>.git
git remote add upstream https://github.com/AAlvAAro/rails-ai-kit.git

注: 新規履歴は、今後のアップデートで git merge upstream/main が機能しないことを意味します — このトレードオフについてユーザーに警告してください。

履歴を保持する場合 (デフォルト):

フォークポイントをマークするために、初期プロジェクトコミットを作成します。

git commit --allow-empty -m "Initialize <project-name> from rails-ai-kit

Forked from https://github.com/AAlvAAro/rails-ai-kit
upstream remote tracks the starter kit for future updates.

Co-Authored-By: Claude <noreply@anthropic.com>"

ステップ 5: Origin にプッシュ

初期状態を新しいリポジトリにプッシュします。

git push -u origin main

以下で確認します。

gh repo view <owner>/<project-name> --json url --jq '.url'

ステップ 6: bin/setup を実行

すべての依存関係をインストールし、データベースを準備します。

bin/setup --skip-server

これは以下を実行します。

  1. bundle install — Ruby gem
  2. npm install — Node パッケージ
  3. bin/rails db:prepare — データベースの作成と移行

bin/setup が失敗した場合、エラーを診断します。

エラー 修正
pg gem のインストールが失敗する PostgreSQL がインストールされているか確認: brew install postgresql@17 または brew install postgresql
node が見つからない Node.js がインストールされているか確認: node --version
データベース接続が拒否された PostgreSQL が実行されているか確認: brew services start postgresql
ruby のバージョンが一致しない .ruby-version を確認し、rbenv または asdf を介して必要なバージョンをインストールします
vite が見つからない npm install を手動で実行してから、再試行します

エラーが表にない場合は、完全なエラー出力を読んで修正を試みてください。修正にシステムレベルの変更 (Homebrew パッケージのインストール、システム構成の変更) が必要な場合にのみ、ユーザーに尋ねてください。


ステップ 7: 起動を検証

開発サーバーを起動し、応答することを確認します。

# バックグラウンドで起動
bin/dev &
DEV_PID=$!

# サーバーが起動するまで待機
sleep 8

# 応答するかどうかを確認
curl -s -o /dev/null -w "%{http_code}" http://localhost:3000

# バックグラウンドサーバーを強制終了
kill $DEV_PID 2>/dev/null

成功: HTTP 200 (またはログインページへの 302 リダイレクト)。

起動に失敗した場合:

  1. log/development.log でエラーを確認します
  2. Vite が実行されているか確認します (ポート 5173)
  3. Rails が実行されているか確認します (ポート 3000)
  4. 特定のエラーをユーザーに報告します

ステップ 8: プロジェクト固有の Co

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

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

Rails AI Kit — Project Initializer

Automates the full setup of a new project from the rails-ai-kit starter kit. Handles git remote configuration, GitHub repo creation, dependency installation, database preparation, and boot verification — so the project is ready to build features immediately.

This is NOT just a clone. It produces a properly configured project with:

  • origin pointing to the new project repo (ready for git push)
  • upstream pointing to AAlvAAro/rails-ai-kit (ready for git fetch upstream && git merge upstream/main)
  • All dependencies installed, database migrated, and dev server verified

Workflow Overview

Input (project name, optional org)
  → Clone rails-ai-kit
    → Create new GitHub repo
      → Remap git remotes
        → Clean git history (optional)
          → Run bin/setup
            → Verify boot
              → Present result + next steps

Step 0: Gather Inputs

Determine these values from the user's message or ask if missing:

Input Example Required?
Project name cafeteria-pro Yes
GitHub owner/org AAlvAAro Default: AAlvAAro
Repo visibility private or public Default: private
Fresh history? yes/no Default: no (keep rails-ai-kit history)
Parent directory /Users/aalvaaro/Projects Default: current working directory

Project name rules:

  • Must be lowercase kebab-case (e.g., my-saas-app, not MySaasApp)
  • Will be used as: directory name, GitHub repo name, Kamal service name, and database name

If the user says something like "start a new project called Cafeteria Pro", infer:

  • Project name: cafeteria-pro
  • Repo: AAlvAAro/cafeteria-pro
  • Confirm before proceeding

Step 1: Clone rails-ai-kit

Clone the starter kit into the target directory with the new project name:

git clone https://github.com/AAlvAAro/rails-ai-kit.git <parent-dir>/<project-name>
cd <parent-dir>/<project-name>

Verify the clone succeeded by checking for key files:

  • Gemfile exists
  • package.json exists
  • CLAUDE.md exists
  • bin/setup exists
  • app/frontend/pages/ directory exists

If any are missing, abort and report the error.


Step 2: Create GitHub Repository

Create the new repo on GitHub using gh:

gh repo create <owner>/<project-name> --<visibility> --source=. --remote=new-origin

If gh is not authenticated, instruct the user to run ! gh auth login and retry.

If the repo already exists, ask the user whether to:

  • Use the existing repo (skip creation)
  • Choose a different name
  • Abort

Step 3: Remap Git Remotes

Configure remotes so origin is the new project and upstream tracks rails-ai-kit:

# Rename the original origin to upstream
git remote rename origin upstream

# Rename the remote created by gh to origin
git remote rename new-origin origin

Verify the remote setup:

git remote -v

Expected output:

origin    git@github.com:<owner>/<project-name>.git (fetch)
origin    git@github.com:<owner>/<project-name>.git (push)
upstream  https://github.com/AAlvAAro/rails-ai-kit.git (fetch)
upstream  https://github.com/AAlvAAro/rails-ai-kit.git (push)

If remotes don't match, fix them before proceeding.


Step 4: Initialize Git History

If the user chose fresh history:

# Remove existing git history
rm -rf .git
git init
git add -A
git commit -m "Initial commit from rails-ai-kit

Scaffolded from https://github.com/AAlvAAro/rails-ai-kit

Co-Authored-By: Claude <noreply@anthropic.com>"

# Re-add remotes
git remote add origin git@github.com:<owner>/<project-name>.git
git remote add upstream https://github.com/AAlvAAro/rails-ai-kit.git

Note: Fresh history means git merge upstream/main won't work for future updates — warn the user about this tradeoff.

If keeping history (default):

Create an initial project commit to mark the fork point:

git commit --allow-empty -m "Initialize <project-name> from rails-ai-kit

Forked from https://github.com/AAlvAAro/rails-ai-kit
upstream remote tracks the starter kit for future updates.

Co-Authored-By: Claude <noreply@anthropic.com>"

Step 5: Push to Origin

Push the initial state to the new repo:

git push -u origin main

Verify with:

gh repo view <owner>/<project-name> --json url --jq '.url'

Step 6: Run bin/setup

Install all dependencies and prepare the database:

bin/setup --skip-server

This runs:

  1. bundle install — Ruby gems
  2. npm install — Node packages
  3. bin/rails db:prepare — Database creation and migration

If bin/setup fails, diagnose the error:

Error Fix
pg gem install fails Check PostgreSQL is installed: brew install postgresql@17 or brew install postgresql
node not found Check Node.js is installed: node --version
Database connection refused Check PostgreSQL is running: brew services start postgresql
ruby version mismatch Check .ruby-version and install the required version via rbenv or asdf
vite not found Run npm install manually, then retry

If the error is not in the table, read the full error output and attempt to fix it. Ask the user only if the fix requires system-level changes (installing Homebrew packages, changing system config).


Step 7: Verify Boot

Start the dev server and verify it responds:

# Start in background
bin/dev &
DEV_PID=$!

# Wait for server to boot
sleep 8

# Check if it responds
curl -s -o /dev/null -w "%{http_code}" http://localhost:3000

# Kill the background server
kill $DEV_PID 2>/dev/null

Success: HTTP 200 (or 302 redirect to login page).

If boot fails:

  1. Check log/development.log for errors
  2. Check Vite is running (port 5173)
  3. Check Rails is running (port 3000)
  4. Report the specific error to the user

Step 8: Project-Specific Configuration

After successful boot, apply these customizations:

8A: Update Application Name

Search and replace the default app name in key files:

# Find references to the default app name in configuration
grep -r "rails-ai-kit\|RailsAiKit\|rails_ai_kit" --include="*.rb" --include="*.yml" --include="*.json" --include="*.ts" --include="*.tsx" -l

Update these files with the new project name:

  • config/application.rb — module name
  • package.jsonname field
  • app/frontend/components/app-logo.tsx — displayed app name

Do NOT rename the CLAUDE.md references to rails-ai-kit — those are documentation about the kit's conventions and should stay as-is.

8B: Generate deploy.yml (if not already configured)

If the user mentions a deployment domain, update config/deploy.yml:

service: <project-name>
image: ghcr.io/<owner>/<project-name>

proxy:
  ssl: true
  host: <project-name>.alvarodelgado.dev

Step 9: Present Result

Display a summary:

✅ Project <project-name> is ready!

📁 Location: <parent-dir>/<project-name>
🔗 GitHub:   https://github.com/<owner>/<project-name>
🔀 Remotes:
   origin   → <owner>/<project-name> (your project)
   upstream → AAlvAAro/rails-ai-kit (starter kit)

🛠️ Status:
   Dependencies: ✅ installed
   Database:     ✅ migrated
   Dev server:   ✅ boots successfully

📋 Next steps:
   1. cd <parent-dir>/<project-name>
   2. bin/dev                          # Start development
   3. Open http://localhost:3000
   4. Use /feature-planner to spec your first feature

🔄 To pull starter kit updates later:
   git fetch upstream
   git merge upstream/main

Behavior Notes

  • Never push to rails-ai-kit. The entire point of this skill is to prevent that. Always verify remotes before any push.
  • Keep it fast. The user wants to start building, not wait through a long setup. Skip unnecessary confirmations — confirm once at Step 0, then execute.
  • Diagnose, don't bail. If bin/setup fails, read the error and attempt a fix before asking the user. Common issues (missing Postgres, wrong Ruby version) have known solutions.
  • Default to keeping history. Fresh history is a destructive choice that breaks upstream merging. Only do it if explicitly requested.
  • The --skip-server flag matters. bin/setup without it will start the dev server and block the script. Always use --skip-server for automated setup, then verify boot separately.