research — команда для Claude Code: глубокий разбор кода
Проводит многошаговое исследование темы по кодовой базе: читает реальные пути выполнения и требует источник для каждого утверждения.
.claude/commands/research.mdЧто делает research
Команда запускает пять последовательных итераций исследования. Первая — план и обзор структуры: какие компоненты и точки входа относятся к теме. Итерации со второй по четвёртую берут разные ракурсы: поток данных и состояние, зависимости и контракты API, затем паттерны, антипаттерны и технический долг. Пятая собирает всё в одну картину и отдельно проговаривает, что эта картина скрывает.
Внутри — жёсткие правила. Каждое утверждение подкрепляется путём к файлу и именем функции или класса, а факт отличается от догадки. Если что-то не прослежено, так и пишется. В каждой итерации ожидается минимум одна диаграмма Mermaid и одна таблица, плюс карта знаний со статусами «изучено», «частично», «не изучено».
Перед началом команда выясняет контекст репозитория: проверяет git remote get-url origin, спрашивает про ссылку на источник и определяет текущую ветку через git rev-parse --abbrev-ref HEAD. Пока это не разрешено, работа не идёт. Тема передаётся аргументом в $ARGUMENTS, так что без неё команда бессмысленна.
Какие задачи решает
- разобраться, как устроен незнакомый модуль, не читая его целиком вручную
- проследить цепочку вызовов от входа до хранилища
- найти скрытые зависимости между компонентами
- собрать список технического долга с привязкой к файлам
- отличить проверенный факт о коде от догадки по именам файлов
Примеры запросов агенту
- /research как обрабатываются вебхуки и где они сохраняются
- /research проследи путь данных от API-роута до базы
- /research какие паттерны используются в слое кеширования
Как установить research
Вручную: положить файлы
.claude/commands/research.mdВызов — /research. Для всех проектов — ~/.claude/commands/
Вручную: положить файлы
~/.codex/prompts/research.mdВызов — /prompts:research. В Codex этот формат помечен устаревшим, замена — скиллы
Вручную: положить файлы
.github/prompts/research.prompt.mdВручную: положить файлы
.gemini/commands/research.tomlGemini хранит команды в TOML: текст запроса — в поле prompt
Из того же набора64
Весь набор →Похожие
Рядом в теме «Настройка агента: память, контекст, субагенты»
Все слэш-команды по теме «Настройка агента: память, контекст, субагенты» →Вопросы о research
Как установить research в Claude?
Положите файл команды по пути .claude/commands/research.md в проекте.
Что делает research?
Проводит пять итераций исследования по заданной теме: обзор структуры, поток данных, зависимости, паттерны и итоговый синтез. Каждое утверждение подкрепляется ссылкой на файл и строку.
Нужна ли ссылка на удалённый репозиторий?
Команда сначала проверяет git remote get-url origin и спрашивает, локальный это репозиторий или есть URL источника. От ответа зависит формат ссылок: с URL они ведут на blob, без него остаётся (file_path:line_number).
Исходный текст
research.md · MIT
--- description: Conduct multi-turn deep research on a specific topic — traces actual code paths with zero tolerance for shallow analysis --- # Deep Wiki: Deep Research Conduct a comprehensive, multi-turn investigation of a specific topic within this codebase. You are a **researcher and analyst** — your outputs are understanding, maps, explanations, and actionable insights. ## Source Repository Resolution (MUST DO FIRST) Before any research, resolve the source repository context: 1. **Check for git remote**: Run `git remote get-url origin` 2. **Ask the user**: _"Is this a local-only repository, or do you have a source repository URL?"_ - Remote URL → store as `REPO_URL`, use linked citations: `[file:line](REPO_URL/blob/BRANCH/file#Lline)` - Local → use `(file_path:line_number)` 3. **Determine default branch**: Run `git rev-parse --abbrev-ref HEAD` 4. **Do NOT proceed** until resolved ## Research Topic $ARGUMENTS ## Core Invariants (NON-NEGOTIABLE) 1. **TRACE ACTUAL CODE PATHS** — Do not guess from file names. Read the implementation. If A calls B calls C, follow it all the way. 2. **EVERY CLAIM NEEDS A SOURCE** — File path + function/class name. No exceptions. 3. **DISTINGUISH FACT FROM INFERENCE** — "I read this code" vs "I'm inferring from structure." 4. **NO HAND-WAVING** — Don't say "this likely handles..." Read the code and state what it ACTUALLY does. 5. **FLAG UNKNOWNS** — If you haven't traced something, say "I haven't traced this yet" instead of guessing. ## Process: 5-Iteration Research Cycle You will perform 5 progressive research iterations. Each builds on all previous ones. NEVER repeat prior findings. ALWAYS provide substantive analysis. ### Iteration 1: Research Plan & Structural Survey - State the specific topic under investigation - Map the landscape: components, boundaries, entry points - Identify relevant files and components to examine - Provide initial findings with file citations - Rate confidence: HIGH/MEDIUM/LOW for each finding - End with "Next Steps" for iteration 2 ### Iterations 2–4: Progressive Deep Dives Each iteration takes a different analytical lens: - **Iteration 2**: Data flow and state management — trace inputs → transformations → outputs → storage. Include `sequenceDiagram` and/or `stateDiagram-v2`. - **Iteration 3**: Integration, dependency, and API contract perspective — external connections, coupling. Include dependency graph and integration table. - **Iteration 4**: Pattern analysis — design patterns, anti-patterns, trade-offs, risks, technical debt. Use tables to catalogue patterns and rank risks. For each: - Build upon ALL previous iterations - Focus on one specific unexplored aspect - Provide new insights with linked citations - **Include at least 1 Mermaid diagram per iteration** (dark-mode colors) — use the diagram type that best fits the analytical lens - **Include at least 1 structured table per iteration** — organize findings so they're scannable at a glance - Rate confidence for every finding - End with remaining areas to investigate ### Iteration 5: Final Synthesis - Synthesize ALL findings from iterations 1–4 - Provide a clear mental model: "Here's how to think about this" (2-3 sentences) - Then: "Here's what that mental model hides" (nuances, edge cases, gotchas) - Highlight surprising or unusual findings - Provide actionable insights and recommendations - List key findings as numbered items with citations and confidence ratings ### Running Knowledge Map Maintain this throughout all iterations: ``` ## Explored ✅ - [component/area]: [1-line summary] — confidence: HIGH/MED/LOW ## Partially Explored 🔶 - [component/area]: [what we know, what's still unknown] ## Unexplored ❓ - [component/area]: [why it might matter] ## Key Findings 🔍 - [finding]: [1-line summary] — [risk/importance] ## Open Questions ❔ - [question]: [what we'd need to trace to answer it] ``` ## Rules - NEVER respond with just "Continue the research" — always provide substantive findings - ALWAYS cite specific files using the resolved citation format: `[file_path:line_number](REPO_URL/blob/BRANCH/file_path#Lline_number)` (remote) or `(file_path:line_number)` (local) - ALWAYS build on previous iterations — do not repeat - Stay focused on the specific topic — do not drift - Call out the weird stuff — surprising patterns are the most valuable findings - Include Mermaid diagrams (dark-mode colors) with `<!-- Sources: ... -->` comment blocks after each
© microsoft · MIT · microsoft/skills