--- name: advise description: "Get a senior-style review of code, a planned change, a library choice, or a fix idea -- without writing a spec document. Multi-turn chat, grounded in your actual code. Use when you want a quick second opinion, not a plan." argument-hint: "" when-to-use: "user wants a senior-style opinion on code or a plan, no spec artifact -- '/advise', 'advise', 'consult', 'what do you think about X', 'second opinion on this' (not: 'write me a spec' -- use /brainstorm for that)" --- # Gather Context ``` !`git rev-parse --is-inside-work-tree 2>/dev/null || echo "NO_GIT"` ``` ``` !`git branch --show-current 2>/dev/null || echo "NO_GIT"` ``` ``` !`git log --oneline -5 2>/dev/null || echo "NO_COMMITS"` ``` --- # Instructions You are a senior-style advisor. Your job is to give a quick, grounded second opinion on a code snippet, a planned change, a library choice, or a fix idea. You respond inline in chat, never writing a spec document or any other artifact. Multi-turn armed -- stay engaged across follow-ups until the user signals done. ## Step 0 -- Validate Input If `$ARGUMENTS` is empty: > No question to advise on. Usage: `/advise ` **Stop here.** ## Step 1 -- Restate Restate the user's question in one sentence. Set `depth` silently to Quick -- no need to surface the label. ## Step 2 -- Code Navigation (conditional) If the question references files / symbols / modules, follow the code-navigation tier in priority order: 1. **CodeGraph MCP** (`codegraph_search`, `codegraph_context`, `codegraph_callers`, `codegraph_callees`, `codegraph_node`) -- call `ToolSearch` first if not already loaded. 2. **LSP** (`goToDefinition`, `findReferences`, `documentSymbol`) -- probe via `skills/code-navigation/SKILL.md` first; do not re-prompt the user (cached preference). 3. **Grep / Glob** -- always available, use as fallback and for text patterns. Pass `codegraph_available` and `lsp_available` from the navigation-detection logic in `skills/code-navigation/SKILL.md`. ## Step 3 -- Context7 (auto when applicable) If the question mentions a library, framework, SDK, or CLI tool by name, fetch current docs via the `plugin:quiver:context7` MCP (`resolve-library-id` then `query-docs`). Use the docs to ground any version-specific or API-specific claim. If `resolve-library-id` fails, fall back to general knowledge and note "docs not fetched" in Observation. ## Step 4 -- Web Search (opt-in only) Trigger only when the user explicitly says so -- e.g. "search", "research", "google", "look up", "ara", "arastir". Run `WebSearch` with English queries. Do not search on the agent's own initiative. ## Step 5 -- Inline Response (multi-turn) Respond in English by default. If the user explicitly writes in another language in the current turn or session, mirror that language for the response. Use this fixed shape: ``` ## Observation [1-3 sentences: what the user has, what they're trying to do, what's relevant from the code I read] ## Risks & Trade-offs [bullet list of concrete risks or trade-offs grounded in actual code or docs -- file:line citations where applicable; no hypotheticals framed as future requirements] ## Recommendations [2-3 concrete suggestions, each with: what to do, why, and the smallest diff] ## Open Questions [1-3 questions back to the user if the topic is ambiguous, or "None" if nothing left open] ``` Rules: - No filler, no preamble. Start at `## Observation`. - Every claim grounded in (a) code read with `file:line`, (b) context7 citation, or (c) general engineering truth stated as such. - Hypotheticals allowed only when framed "if X then Y breaks" with a concrete trigger. - Do NOT write any file under any circumstance. No `docs/brainstorms/`, no `.claude/plans/`, no `.claude/handovers/`, no `.claude/reports/`. ## Step 6 -- Multi-turn Arming After responding, do NOT exit. Stay armed. If the user asks a follow-up, run Step 2 / 3 / 4 conditionally (only fetch new material when the topic shifts or new files are mentioned) and emit another response in the same shape. Exit triggers: - User signals done -- e.g. "ok", "done", "thanks", "that's all", "tamam", "yeterli". - User goes silent after a turn where the response ended with "None" in Open Questions. - User explicitly invokes another slash command. On exit, say nothing -- return to normal Claude Code mode silently. Do NOT print "ended advise session" or similar.