Jr Rails Newのロゴ

Jr Rails New

コミュニティ
julianrubisch
jr-rails-new

推奨スタック(PostgreSQL、Minitest、Solid Queue、Pundit、任意でPhlex)を使って、新しいRailsアプリを作成します。対話形式で要件を確認した後、rails newと設定を行います。

概要

公開者julianrubisch
リポジトリskills
スキル名jr-rails-new
スター
30
フォーク
2
同梱ファイル
39
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 39個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    julianrubischがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Jr Rails New」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/julianrubisch/skills/tree/main/jr-rails-new
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/julianrubisch/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/jr-rails-new .claude/skills/jr-rails-new
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでJr Rails Newを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にJr Rails Newを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Jr Rails Newは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Rails App Scaffolder

Interactive skill that interviews you for preferences, runs rails new with the right flags, and performs post-scaffold configuration.

Workflow

Step 0: Preflight

Quick check that the machine can actually run rails new. Skip the install prompts if everything is present.

bash
command -v ruby   >/dev/null 2>&1 && ruby --version
command -v node   >/dev/null 2>&1 && node --version
command -v bundle >/dev/null 2>&1 && bundle --version
command -v mise   >/dev/null 2>&1 && mise --version

Required:

  • Ruby 4.0 or newer (parse ruby --version; reject 3.x and older).
  • Node 20 or newer.
  • bundle available (ships with Ruby).
  • mise (or rbenv / asdf) so the Ruby/Node we just probed survives a shell restart and matches .tool-versions later.

If anything's missing or out of date, surface the gap and offer to hand off:

This Mac isn't quite ready for `rails new` yet:
  ✗ Ruby is <version> (need 4.0+)
  ✗ Node not found
  ✓ mise installed

I can run /jr-rails-bootstrap to fix that - it installs the missing pieces
in the right order, then comes back here. Or you can install them manually
and re-run me.

Want me to launch /jr-rails-bootstrap?

Use AskUserQuestion with options Yes, run bootstrap, No, I'll install manually, Continue anyway (rails new may fail). If they pick bootstrap, invoke /jr-rails-bootstrap and stop - bootstrap will return them here via Phase E.

If everything passes, print one line per tool with version and continue.

Step 1: Interview

Ask the user each question. Show the default in brackets. Accept the default if the user presses enter or says "default" / "yes" / "y".

#QuestionOptionsDefault
1App namefree text(required)
2Databasepostgresql / mysql2 / sqlite3postgresql
3Frontend bundlingimportmap / esbuild / vite_railsimportmap
4CSStailwind / sass / nonetailwind
5View layererb / phlexerb
6Dev containeryes / noyes
7Authenticationrails (built-in, 8+) / devise / nonerails
8Authorizationpundit / nonepundit
9Background jobssolid_queue / sidekiqsolid_queue
10Git worktree workflowyes / nono

Testing is always Minitest — non-negotiable for jr-rails skills.

Step 2: Generate

Build and run the rails new command:

bash
rails new APP_NAME \
  --database=DATABASE \
  --css=CSS \
  --skip-test=false \
  --devcontainer  # if dev container = yes

Bundling flags:

  • importmap → no extra flag (default)
  • esbuild → --javascript=esbuild
  • vite_rails → no flag; add vite_rails gem post-scaffold

CSS flags:

  • tailwind → --css=tailwind
  • sass → --css=sass
  • none → --skip-css

Step 3: Post-scaffold Configuration

Run these in order, skipping any that don't apply:

3a. Vite (if selected)
bash
cd APP_NAME
bundle add vite_rails
bundle exec vite install

Remove importmap-rails from Gemfile if present.

3b. Phlex (if selected)
bash
bundle add phlex-rails

Then create the base classes from reference/coding-phlex.md:

  • app/components/base.rb — Components::Base < Phlex::HTML
  • app/views/base.rb — Views::Base < Components::Base
  • app/components/layout.rb — Components::Layout with Phlex::Rails::Layout

Set the layout in ApplicationController:

ruby
layout -> { Components::Layout }

Remove the ERB layout file (app/views/layouts/application.html.erb).

Install the custom scaffold generator from reference/coding-phlex.md § Scaffolding so future rails g scaffold produces Phlex views.

3c. Authentication

Rails built-in (8+):

bash
rails g authentication

Devise:

bash
bundle add devise
rails g devise:install
rails g devise User
3d. Pundit (if selected)
bash
bundle add pundit
rails g pundit:install

Add to ApplicationController:

ruby
class ApplicationController < ActionController::Base
  include Pundit::Authorization
  after_action :verify_authorized, except: :index
  after_action :verify_policy_scoped, only: :index
end
3e. Sidekiq (if selected instead of Solid Queue)
bash
bundle add sidekiq

Configure in config/application.rb:

ruby
config.active_job.queue_adapter = :sidekiq
3f. CLAUDE.md

Create CLAUDE.md in the app root with project conventions. The How to start section is load-bearing: /jr-rails-bootstrap and future agents read it to know how to launch the dev server. Derive its command from the actual stack choices (Q#3 bundling, Q#6 devcontainer, Q#10 worktree).

markdown
# Project Conventions

## Stack
- Ruby on Rails [version]
- [Database]
- [CSS framework]
- [View layer]
- Minitest with fixtures

## How to start

[Pick ONE block based on the stack choices made in the interview:]

### Default (no devcontainer, no worktree)
\`\`\`bash
bin/dev
\`\`\`
App: http://localhost:3000

### Vite (Q#3 = vite_rails) without devcontainer
\`\`\`bash
bin/dev   # foreman runs Rails + Vite together via Procfile.dev
\`\`\`
App: http://localhost:3000
Vite dev server: http://localhost:5173

### Devcontainer (Q#6 = yes)
\`\`\`bash
devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . bin/dev
\`\`\`
App: http://localhost:3000

### Worktree workflow (Q#10 = yes)
Use the wt-managed binstub - port and database are derived per branch.
\`\`\`bash
wt start             # equivalent to: bin/agent-server
\`\`\`
App URL: see \`wt list\` for the branch's port (e.g. http://localhost:30421).

## Testing
- Run tests: `bin/rails test`
- Run system tests: `bin/rails test:system`

## Style
- Follow 37signals/classic Rails conventions
- Rich domain models, CRUD controllers, concerns
- No service objects - use domain models in app/models/
- Minitest with fixtures (no RSpec, no factory_bot)
- Database constraints over model validations for hard guarantees

## Skills
- `/jr-rails-classic` - coding style guide
[- `/jr-rails-phlex` - Phlex components (if Phlex selected)]
- `/jr-rails-review` - code review

Pick exactly one "How to start" block based on the interview answers and write that block (not the multi-choice template) into the project CLAUDE.md. The skill should resolve the right command at scaffold time, not punt the choice to a future reader.

3g. Worktree config (if selected)

Set up the agentic worktree workflow using worktrunk. The exact binstubs and database.yml depend on the database choice (Q#2) and whether dev containers are enabled (Q#6).

1. Create .config/wt.toml (same for all strategies):

toml
[list]
url = "http://localhost:{{ branch | hash_port }}"

[post-create]
setup = "AGENT_WORKSPACE={{ branch | sanitize }} AGENT_ROOT_PATH={{ primary_worktree_path }} bin/agent-setup"

[pre-remove]
cleanup = "AGENT_WORKSPACE={{ branch | sanitize }} bin/agent-cleanup"

[post-remove]
kill-server = "lsof -ti :{{ branch | hash_port }} -sTCP:LISTEN | xargs kill 2>/dev/null || true"

[post-start]
server = "PORT={{ branch | hash_port }} VITE_RUBY_PORT={{ (branch ~ '-vite') | hash_port }} bin/agent-server"

2. Create the binstubs from reference/agentic-worktrees.md, choosing the variant that matches the stack:

DatabaseDev containerStrategyReference section
sqlite3anySQLite§ Binstubs — SQLite
postgresql / mysql2noPort-based§ Binstubs — PostgreSQL (port-based)
postgresql / mysql2yes (per-worktree)Per-worktree devcontainer§ Binstubs — PostgreSQL + Docker Compose (Per-Worktree Devcontainer)
postgresql / mysql2yes (shared PG)Shared PG§ Binstubs — PostgreSQL + Docker Compose (Shared PG)

The per-worktree devcontainer strategy uses devcontainer up / devcontainer exec (not raw docker compose) so that features, containerEnv, and postCreateCommand from devcontainer.json are applied. The postCreateCommand should be bin/setup --skip-server.

The shared PG strategy is simpler: one PostgreSQL container shared across all worktrees, Rails runs on the host. Prefer this when the host already has Ruby (via mise/rbenv/asdf) and you want worktrees to run tests independently.

3. Modify config/database.yml to use workspace-aware names:

  • SQLite: prefix each database path with AGENT_WORKSPACE (defaults to development). See reference § config/database.yml (SQLite).
  • PostgreSQL: suffix database name with AGENT_WORKSPACE. See reference § config/database.yml (PostgreSQL).

4. If dev container = yes, create .devcontainer/agent.json extending the main devcontainer with AGENT_* env vars forwarded into the container.

5. Update CLAUDE.md with worktree workflow docs (see reference § CLAUDE.md).

6. Update README.md with the workflow (see reference § Project README).

7. Create .claude/settings.json:

json
{
  "permissions": {
    "allow": [
      "Bash(git worktree *)",
      "Bash(git branch *)",
      "Bash(wt *)",
      "Bash(bin/agent-*)",
      "Bash(docker compose *)",
      "Bash(devcontainer *)"
    ]
  }
}

See reference/agentic-worktrees.md for full templates, port allocation scheme, and configuration details.

3h. Verify & Commit
bash
bin/setup
bin/rails test  # should pass with zero tests

Create initial commit:

bash
git add -A
git commit -m "Initial Rails app with [stack summary]"

Step 4: Summary

Print a summary of what was configured. Derive the "Next steps" command from the same logic as the CLAUDE.md "How to start" block - they must match.

✅ Rails app created: APP_NAME
   Database:       postgresql
   CSS:            tailwind
   View layer:     erb
   Authentication: rails (built-in)
   Authorization:  pundit
   Background:     solid_queue
   Dev container:  yes
   Worktree:       no
   Testing:        minitest (always)

Next steps:
  cd APP_NAME
  <START_COMMAND>

Where <START_COMMAND> matches the chosen stack:

StackCommand
Defaultbin/dev
Vite (no devcontainer)bin/dev (foreman runs Rails + Vite)
Devcontainerdevcontainer up --workspace-folder . && devcontainer exec --workspace-folder . bin/dev
Worktree workflowwt start (per-branch port; see wt list)

Then add the app URL on the next line:

App:  http://localhost:3000   # or the worktree-specific port

Reference

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Jr Rails New」では何ができますか?

推奨スタック(PostgreSQL、Minitest、Solid Queue、Pundit、任意でPhlex)を使って、新しいRailsアプリを作成します。対話形式で要件を確認した後、rails newと設定を行います。

TypingMindでJr Rails Newを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Jr Rails Newはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにJr Rails Newをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/julianrubisch/skills/tree/main/jr-rails-newを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Jr Rails Newを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Jr Rails Newで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもJr Rails Newを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Jr Rails New」は無料ですか?

はい。julianrubischがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇