dot_claude/skills/second-opinion/SKILL.md
Runs external LLM code reviews (OpenAI Codex or Google Gemini CLI) on uncommitted changes, branch diffs, or specific commits. Use when the user asks for a second opinion, external review, codex review, gemini review, or mentions /second-opinion.
npx skillsauth add lv416e/dotfiles second-opinionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Shell out to external LLM CLIs for an independent code review powered by a separate model. Supports OpenAI Codex CLI and Google Gemini CLI.
Gemini CLI is invoked with --yolo, which auto-approves all
tool calls without confirmation. This is required for headless
(non-interactive) operation but means Gemini will execute any
tool actions its extensions request without prompting.
# Codex (headless exec with plain text output)
codex exec --model gpt-5.3-codex \
-c model_reasoning_effort='"xhigh"' \
--sandbox read-only --ephemeral \
-o "$output_file" - < "$prompt_file"
# Gemini (code review extension)
gemini -p "/code-review" --yolo -e code-review
# Gemini (headless with diff — see references/ for full pattern)
git diff HEAD > /tmp/review-diff.txt
{ printf '%s\n\n' 'Review this diff for issues.'; cat /tmp/review-diff.txt; } \
| gemini -p - --yolo -m gemini-3-pro-preview
Use AskUserQuestion to collect review parameters in one shot.
Adapt the questions based on what the user already provided
in their invocation (skip questions they already answered).
Combine all applicable questions into a single AskUserQuestion
call (max 4 questions).
Question 1 — Tool (skip if user already specified):
header: "Review tool"
question: "Which tool should run the review?"
options:
- "Both Codex and Gemini (Recommended)" → run both in parallel
- "Codex only" → codex exec
- "Gemini only" → gemini CLI
Question 2 — Scope (skip if user already specified):
header: "Review scope"
question: "What should be reviewed?"
options:
- "Uncommitted changes" → git diff HEAD + untracked files
- "Branch diff vs main" → git diff <branch>...HEAD (auto-detect default branch)
- "Specific commit" → git diff <sha>~1..<sha> (follow up for SHA)
Question 3 — Project context (skip if neither CLAUDE.md nor AGENTS.md exists):
Check for CLAUDE.md first, then AGENTS.md in the repo root. Only show this question if at least one exists.
header: "Project context"
question: "Include project conventions file so the review
checks against your standards?"
options:
- "Yes, include it"
- "No, standard review"
Question 4 — Review focus (always ask):
header: "Review focus"
question: "Any specific focus areas for the review?"
options:
- "General review" → no custom prompt
- "Security & auth" → security-focused prompt
- "Performance" → performance-focused prompt
- "Error handling" → error handling-focused prompt
Do not pre-check tool availability. Run the selected tool immediately. If the command fails with "command not found" or an extension is missing, report the install command from the Error Handling table below and skip that tool (if "Both" was selected, run only the available one).
After collecting answers, show the diff stats:
# For uncommitted (tracked + untracked):
git diff --stat HEAD
git ls-files --others --exclude-standard
# For branch diff:
git diff --stat <branch>...HEAD
# For specific commit:
git diff --stat <sha>~1..<sha>
If the diff is empty, stop and tell the user.
If the diff is very large (>2000 lines changed), warn the user and ask whether to proceed or narrow the scope.
After determining the diff scope, skip checks that don't apply to the files actually changed.
Only run /security:scan-deps when the diff touches dependency
manifest files. Check with:
git diff --name-only <scope> \
| grep -qiE '(package\.json|package-lock|yarn\.lock|pnpm-lock|Gemfile|\.gemspec|requirements\.txt|setup\.py|setup\.cfg|pyproject\.toml|poetry\.lock|uv\.lock|Cargo\.toml|Cargo\.lock|go\.mod|go\.sum|composer\.json|composer\.lock|Pipfile)'
If no dependency files are in the diff, skip the scan even when security focus is selected. The scan analyzes the entire project's dependency tree regardless of diff scope, so it adds significant time for zero value when dependencies weren't touched.
For branch diff scope, detect the default branch name:
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null \
| sed 's@^refs/remotes/origin/@@' || echo main
See references/codex-invocation.md for full details on command syntax, prompt assembly, and the structured output schema.
Summary:
codex exec (not codex review) for headless operationgpt-5.3-codex via --model, reasoning via -c model_reasoning_effort='"xhigh"'--reasoning is NOT a valid codex exec flag — use -c config override instead--output-schema — broken due to Codex CLI schema wrapping bug-o captures only the final message as plain text (no thinking/exec noise)gpt-5.2-codex on auth errorstimeout: 600000 on the Bash callSee references/gemini-invocation.md for full details on flags, scope mapping, and extension usage.
Summary:
gemini-3-pro-preview, flags: --yolo, -e, -mgemini -p "/code-review" --yolo -e code-reviewgit diff into gemini -pgemini-cli-security (not security)/security:analyze is interactive-only — use -p with a
security prompt instead/security:scan-deps only when security focus is selected
AND the diff touches dependency manifest files (see Diff-Aware
Optimizations)timeout: 600000 on the Bash callScope mapping for git diff (Gemini has no built-in scope flags):
| Scope | Diff command |
|-------|-------------|
| Uncommitted | git diff HEAD + untracked (see codex-invocation.md) |
| Branch diff | git diff <branch>...HEAD |
| Specific commit | git diff <sha>~1..<sha> |
When the user picks "Both" (the default):
## Codex Review (gpt-5.3-codex)
<codex output>
## Gemini Review (gemini-3-pro-preview)
<gemini output>
Summarize where the two reviews agree and differ.
| Error | Action |
|-------|--------|
| codex: command not found | Tell user: npm i -g @openai/codex |
| gemini: command not found | Tell user: npm i -g @google/gemini-cli |
| Gemini code-review extension missing | Tell user: gemini extensions install https://github.com/gemini-cli-extensions/code-review |
| Gemini gemini-cli-security extension missing | Tell user: gemini extensions install https://github.com/gemini-cli-extensions/security |
| Model auth error (Codex) | Retry with gpt-5.2-codex |
| unexpected argument '--reasoning' (Codex) | Use -c model_reasoning_effort='"xhigh"' instead of --reasoning |
| additionalProperties is required (Codex) | Do NOT use --output-schema — Codex CLI schema wrapping is broken. Use plain -o instead |
| Empty diff | Tell user there are no changes to review |
| Timeout | Inform user and suggest narrowing the diff scope |
| Tool partially unavailable | Run only the available tool, note the skip |
Both tools (default):
User: /second-opinion
Claude: [asks 4 questions: tool, scope, context, focus]
User: picks "Both", "Branch diff", "Yes include CLAUDE.md", "Security"
Claude: [detects default branch = main]
Claude: [shows diff --stat: 6 files, +103 -15]
Claude: [assembles prompt with review instructions + CLAUDE.md + security focus + diff]
Claude: [runs codex exec and gemini in parallel]
Claude: [reads codex output file, parses structured findings]
Claude: [presents both reviews, highlights agreements/differences]
Codex only with inline args:
User: /second-opinion check uncommitted changes for bugs
Claude: [scope known: uncommitted, focus known: custom]
Claude: [asks 2 questions: tool, project context]
User: picks "Codex only", "No context"
Claude: [shows diff --stat: 3 files, +45 -10]
Claude: [writes prompt file with review instructions + diff]
Claude: [runs codex exec, reads structured JSON output]
Claude: [presents findings by priority with file:line refs]
Gemini only:
User: /second-opinion
Claude: [asks 4 questions]
User: picks "Gemini only", "Uncommitted", "No", "General"
Claude: [shows diff --stat: 2 files, +20 -5]
Claude: [runs gemini -p "/code-review" --yolo -e code-review]
Claude: [presents review]
Large diff warning:
User: /second-opinion
Claude: [asks questions] → user picks "Both", "Uncommitted", "General"
Claude: [shows diff --stat: 45 files, +3200 -890]
Claude: "Large diff (3200+ lines). Proceed, or narrow the scope?"
User: "proceed"
Claude: [runs both reviews]
development
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment - applies TDD to process documentation by testing with subagents before writing, iterating until bulletproof against rationalization | 新しいスキルの作成、既存スキルの編集、またはデプロイ前にスキルが機能するか検証する際に使用 - プロセスドキュメントにTDDを適用し、記述前にサブエージェントでテストし、合理化に対して堅牢になるまで反復
development
Use when design is complete and you need detailed implementation tasks for engineers with zero codebase context - creates comprehensive implementation plans with exact file paths, complete code examples, and verification steps assuming engineer has minimal domain knowledge | 設計が完了し、コードベースの知識がゼロのエンジニア向けに詳細な実装タスクが必要な場合に使用 - 正確なファイルパス、完全なコード例、検証ステップを含む包括的な実装計画を作成。エンジニアの領域知識が最小限であることを前提
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.