Logo Jr Rails New

Jr Rails New

Cộng đồng
julianrubisch
jr-rails-new

Tạo khung ứng dụng Rails mới với stack ưu tiên: PostgreSQL, Minitest, Solid Queue, Pundit và Phlex tùy chọn. Phỏng vấn tương tác, sau đó chạy rails new + cấu hình.

Tổng quan

Nhà phát hànhjulianrubisch
Kho mãskills
Tên kỹ năngjr-rails-new
Sao
30
Bản fork
2
Tệp đi kèm
39
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 39 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được julianrubisch công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Jr Rails New trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/julianrubisch/skills/tree/main/jr-rails-new
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân 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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Jr Rails New trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Jr Rails New ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Jr Rails New với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Jr Rails New làm được gì?

Tạo khung ứng dụng Rails mới với stack ưu tiên: PostgreSQL, Minitest, Solid Queue, Pundit và Phlex tùy chọn. Phỏng vấn tương tác, sau đó chạy rails new + cấu hình.

Vì sao nên dùng Jr Rails New trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Jr Rails New là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Jr Rails New trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/julianrubisch/skills/tree/main/jr-rails-new. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Jr Rails New?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Jr Rails New với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Jr Rails New với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Jr Rails New có miễn phí không?

Có. Kỹ năng này được julianrubisch phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇