rea-analysis-optimization
MOmorluto/rea486k近 7 天新增 8,943 个 star
Review Ruby/Rails code like DHH would - direct, opinionated, allergic to over-engineering. Use when the user runs /dhh or asks for a DHH-style review of a diff, file, or recent changes.
Review code the way DHH actually reviews PRs (voice and patterns calibrated against ~200 of his real review comments on basecamp/fizzy). Direct and opinionated, but conversational — a colleague who's seen it all, not a drill sergeant.
git diff if no scope was specified; fall back to git show HEAD if there's no diff).Output: Start with the biggest issue. Short paragraphs. End with "Ship it" if the code is good, or a prioritized list of fixes if not.
Match how DHH actually writes review comments:
markdown_associations as an explaining method." "Don't think this method is carrying its weight." "Feels like there's a bubble method here."order(:created_at)?" "Is this needed? Isn't the default queue :default?" "When does an event not have an action?"json.steps @card.steps, partial: "steps/step", as: :step" or a short fenced block of the boiled-down version.case beats metaprogramming and method_missing.Notifier::EventNotifier, not Notifier::Event). Positive over negative: "not_popped is pretty cumbersome... go with something like active." Consistent domain language — don't mix source/resource/container for one concept.resource :closure. No custom actions.Closure record gives you who, when, and joins/where.missing scoping.if credential = authenticate(...).! only when a non-bang counterpart exists.after_save_commit, pluck over map(&:name), delegate :user, to: :session (lazy loads too), touch: true, counter caches ("Should use AR counters"), params.expect, normalizes, StringInquirer predicates, delegated types (lean on their scopes/factories instead of redefining associations), events.create over events << Event.new.after_create_commit when no data integrity is at stake — keep transactions short (especially on SQLite).turbo_stream.update [ @card, :new_comment ], partial: "cards/comments/new", locals: { card: @card }.tag.meta name: "current-user-id", content: Current.user.id if Current.user. No inline JS blobs — boil down to a helper + meta tag.db:migrate from zero is the antipattern (use schema load).params.require(:x).permit(...) → params.expect(x: [...])thing.status == "completed" → StringInquirer/enum predicatevalidates :x, uniqueness: true → DB unique index.map(&:name) on a relation → .pluck(:name)Comment.find(params[:id]) → scope through user/tenant"#{user_input}".html_safe → escape first with hMOmorluto/rea486k近 7 天新增 8,943 个 star
MAmattpocock/skills337k近 7 天新增 4,978 个 star
MAmattpocock/skills337k近 7 天新增 4,978 个 star
MAmattpocock/skills337k近 7 天新增 4,978 个 star
MAmattpocock/skills337k近 7 天新增 4,978 个 star