Delegates Rails code review (uncommitted diff, branch, or PR) to a locally-installed agentic CLI like claude, codex, opencode, gemini, or aider. Runs a structured Self-Review → External Review → Reconcile → Synthesize loop with severity gating.
Ships in jr-rails-second-opinion. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Delegate review of Rails work (uncommitted diff, branch, or PR) to a locally-installed agentic CLI. Wraps the CLI in a structured Self-Review → External Review → Reconcile → Synthesize loop with H/M/L severity gating, mirroring the consult-outside-expert workflow but without MCP dependence.
Read @references/guide.md and follow it. Do not proceed without it.
/jr-rails-second-opinion (review uncommitted changes; default)/jr-rails-second-opinion <branch> (review <branch> diff vs main)/jr-rails-second-opinion <PR#> (fetch PR with gh, review the diff)/jr-rails-second-opinion --multi (run review through 2+ CLIs in parallel and reconcile)Probe for installed agentic CLIs. Do not trust the inherited $PATH or $SHELL — Claude Code's Bash tool spawns a non-login shell that misses fish/zsh PATH entries and most version-manager shims (asdf, mise, volta, fnm, bun, pnpm). Worse, $SHELL may report /bin/zsh even when the user actually runs fish (macOS user record defaults to zsh; fish is exec'd from .zshrc). Probe every installed user shell, merge their login PATHs, then augment with common install dirs:
# Don't trust $SHELL — on macOS it often reflects the user-record default (zsh)
# even when the user actually runs fish via `exec fish` from .zshrc. Probe
# every installed user shell and merge their login PATHs.
PATHS_TO_TRY=()
for sh in fish zsh bash; do
command -v "$sh" >/dev/null 2>&1 || continue
case "$sh" in
fish) p=$("$sh" -l -c 'string join : -- $PATH' 2>/dev/null) ;;
*) p=$("$sh" -l -c 'printf %s "$PATH"' 2>/dev/null) ;;
esac
[ -n "$p" ] && PATHS_TO_TRY+=("$p")
done
LOGIN_PATH=$(IFS=:; echo "${PATHS_TO_TRY[*]}")
[ -z "$LOGIN_PATH" ] && LOGIN_PATH="$PATH"
EXTRA_DIRS="$HOME/.local/bin:$HOME/.npm-global/bin:$HOME/.bun/bin:$HOME/.cargo/bin:$HOME/.deno/bin:$HOME/.asdf/shims:$HOME/.mise/shims:$HOME/Library/pnpm:/opt/homebrew/bin:/usr/local/bin"
SEARCH_PATH="$LOGIN_PATH:$EXTRA_DIRS"
for cmd in claude codex opencode gemini aider mods cursor-agent llm sgpt goose; do
bin=$(PATH="$SEARCH_PATH" command -v "$cmd" 2>/dev/null) || continue
echo "$cmd -> $bin"
done
Then call AskUserQuestion with the detected CLIs as options:
brew install codex, npm i -g opencode-ai) after they confirm nothing is installed.--multi is passed.Reuse the resolved $SEARCH_PATH (or the absolute path) when invoking the CLI later — the same shell-context issue applies to invocation, not just detection.
Determine review scope:
git diff + untracked summary).git diff <base>...<branch> where base is main (or current upstream).gh pr checkout <num> then branch flow, or fetch the PR diff via gh pr diff.Build the brief passed to the CLI. Force the H/M/L severity rubric and the five Rails-flavored review dimensions: architecture (skinny controllers, rich models, callback design), quality (Ruby idiom, naming, anti-patterns), performance (N+1, indexes, eager loading), testing (coverage, integration/unit balance), security (strong params, mass assignment, Brakeman class issues). Include the project's hard rule: never recommend service objects as a solution, and paste the Brief block from references/standards.md verbatim so the CLI judges by the same conventions the self-review uses.
See references/guide.md for the full brief template.
Invoke the chosen CLI with its review-style command. Per-CLI invocations live in references/cli-invocations.md. Capture stdout to the working log.
Implementer (you) does a parallel self-review, then reconciles with the CLI's findings. Produce a synthesis with Consensus / Disagreements / Actions / Gate Status. Wait for mediator approval before acting.
Address agreed actions. Open a Round 2 if needed (re-run CLI on the updated artifact, capture deltas only). Stop on convergence: no open H, all M either fixed or accepted.
Delete the working log (second-opinion.md) after final attestation. The improved artifact is the deliverable, not the log.
Judge by the pack's standards, not the CLI's taste. references/standards.md lists, per dimension, what a finding is measured against and links the shared reference that explains it (reference/shared/*.md, smells.md, patterns.md, refactorings/). Its Brief block goes into every CLI brief verbatim; in Reconcile, a CLI finding that contradicts a standard is dropped with the standard cited, and a finding a standard supports is kept even when self-review missed it. The first standard is the hard one: never recommend service objects (*Service, *Manager, *Handler, *Processor, *Creator, .call PORO patterns). When extraction is needed, prefer domain models, form objects, query objects, concerns, DCI contexts, or callback extraction.
Never act on a CLI finding without mediator approval. The CLI is a signal generator, not a judge. Decisions stay with the human.
The brief must demand the findings as the final message. Reasoning models will otherwise spend a whole run thinking and return nothing — a clean exit, a full log, an empty output file. The constraint is in references/guide.md's brief template; keep it when adapting the brief, and see references/cli-invocations.md for recovering a run that failed this way rather than paying for it twice.
Do not pipe secrets to the CLI. Brief construction must scrub .env, config/credentials/*, and any file Brakeman flags as containing secrets.
jr-rails-second-opinion/
├── SKILL.md # This file (entry point)
└── references/
├── guide.md # Workflow detail (load when starting a session)
├── cli-invocations.md # Per-CLI invocation patterns + flags (load when picking a CLI)
├── standards.md # What findings are judged against, per dimension, linked into reference/ (load once per session)
└── second-opinion-log-template.md # Working-log skeleton (copy when starting a session)
Load reference files only when you need them. Progressive disclosure keeps the entry point cheap.
reference/agentic-worktrees.md (opens in a new tab)reference/anti-patterns.md (opens in a new tab)reference/coding-classic.md (opens in a new tab)reference/coding-phlex.md (opens in a new tab)reference/coding/api.md (opens in a new tab)reference/devops.md (opens in a new tab)reference/patterns.md (opens in a new tab)reference/reek.yml (opens in a new tab)reference/refactorings/000-template.md (opens in a new tab)reference/refactorings/001-extract-scope-from-controller.md (opens in a new tab)reference/refactorings/002-replace-conditional-with-polymorphism.md (opens in a new tab)reference/refactorings/003-replace-conditional-with-null-object.md (opens in a new tab)reference/refactorings/004-introduce-form-object.md (opens in a new tab)reference/refactorings/005-replace-subclasses-with-strategies.md (opens in a new tab)reference/refactorings/006-replace-mixin-with-composition.md (opens in a new tab)reference/refactorings/007-extract-validator.md (opens in a new tab)reference/refactorings/008-introduce-parameter-object.md (opens in a new tab)reference/refactorings/009-replace-callback-with-method.md (opens in a new tab)reference/refactorings/010-refactor-service-object-into-poro.md (opens in a new tab)reference/refactorings/extraction-signals.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
rails-review, agentic-cli, code-review, pr-review, multi-cli
/jr-rails-second-opinion:jr-rails-second-opinionfrom jr-rails-second-opinion
npx claudepluginhub julianrubisch/skills --plugin jr-rails-second-opinionOther plugins' skills for the same job