Ruby Prism Skill – CLI skill for understanding Ruby files
github.com3 pointsby AndrewHampton1 comments
$ prism -o app/models/user.rb
User < ApplicationRecord [1-75]
includes Agreeable
includes Auditable
has_many :polls
has_many :questions, through: :polls
has_many :votes
has_many :reports, dependent: :destroy
#audit_create [41-43]
#allowed_to_participate_in?(poll) [45-66]
#restricted_from_participation_in?(poll) [68-70]
#recently_created? [72-74]
$ prism -m 'recently_created?' app/models/user.rb
=== METHOD: recently_created? ===
Lines 72-74:
def recently_created?
created_at.after?(5.minutes.ago)
end
The idea is to give the agent a token-efficient way to understand what's going on in Ruby code. alias git_main_branch='git rev-parse --abbrev-ref origin/HEAD | cut -d/ -f2'
alias gapa='git add --patch'
alias grbm='git rebase -i --autosquash $(git_main_branch)'
alias gfx='git commit --fixup $(git log $(git_main_branch)..HEAD --oneline| fzf| cut -d" " -f1)'
Another favorite is: alias gmru="git for-each-ref --sort=-committerdate --count=50 refs/heads/ --format='%(HEAD) %(refname:short) | %(committerdate:relative) | %(contents:subject)'| fzf | sed -e 's/^[^[[:alnum:]]]*[[:space:]]*//' | cut -d' ' -f1| xargs -I _ git checkout _"
gmru (git most recently used) will show you the branches you've been working on recently and let you use fzf to select one to check out.