← Back to list

mihai-rails-style
by mihaibb
⭐ 0🍴 0📅 Jan 24, 2026
SKILL.md
name: mihai-rails-style description: This skill should be used when writing Ruby and Rails code in Mihai's distinctive style, which emphasizes the principles of simplicity and Rails conventions while embracing a practical, no-nonsense approach to modern tooling.
<essential_principles>
Core Philosophy
"Write code that a junior developer can understand. Every line should be obvious."
Practical Rails:
- Rich domain models over service objects
- CRUD controllers with standard actions
- Multi-tenant scoping via
Current.organization - Hotwire (Turbo + Stimulus) for interactivity
- esbuild + Tailwind CLI for assets
- Minitest with fixtures
What to avoid:
- Service objects for everything (use namespaced builders when needed)
- Dependency injection patterns
- Over-engineered abstractions
- Complex JS frameworks (React/Vue/Svelte)
- TypeScript in Rails apps </essential_principles>
- Controllers - Thin controllers, scoping, before_action setup
- Models - Validations, scopes, enums, method organization
- Views - Hotwire, partials, I18n, explicit variables
- Stimulus - Small controllers, data attributes, clickable rows
- Testing - Minitest, fixtures, I18n assertions
- Anti-Patterns - What to avoid and better alternatives
- Code Review - Review code against Mihai style
- General Guidance - Philosophy and conventions
Specify a number or describe your task.
After reading relevant references, apply patterns to the user's code.
<quick_reference>
Key Conventions
Multi-tenant scoping:
Current.organization.clients.find(params[:id])
Current.organization.contacts.alphabetically
Model organization order:
- associations
- validations
- scopes
- class methods (
class << self) - public instance methods
- private methods
Enums:
enum :status, { draft: "draft", published: "published" }, prefix: true
Scopes:
scope :active, -> { where(active: true) }
scope :alphabetically, -> { order(:name) }
scope :recent, -> { order(created_at: :desc) }
Date queries - use ranges:
where(created_at: Time.current.beginning_of_day..)
where(created_at: 1.week.ago..)
</quick_reference>
<reference_index>
Domain Knowledge
All detailed patterns in references/:
| File | Topics |
|---|---|
| controllers.md | Thin controllers, scoping, before_action, activity tracking |
| models.md | Validations, scopes, enums, normalizes, method organization |
| views.md | Hotwire, Turbo Frames/Streams, partials, I18n |
| stimulus.md | Small controllers, data attributes, clickable table rows |
| testing.md | Minitest, fixtures, I18n assertions |
| anti-patterns.md | Service objects, dependency injection, over-engineering |
| </reference_index> |
<success_criteria> Code follows Mihai style when:
- Controllers are thin, models are fat
- All queries scoped through
Current.organization - Models use
class << selffor class methods - Enums have explicit values and
prefix: true - Views use partials with explicit variable passing
- I18n for all user-facing text
- Stimulus controllers are small and focused
- Tests use Minitest with fixtures and I18n assertions
- No unnecessary service objects or abstractions </success_criteria>
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon