Conduct comprehensive codebase research to document how systems work by spawning parallel agents and synthesizing findings. Creates structured research documents for use in planning and implementation.
!bash "${CLAUDE_PLUGIN_ROOT}/scripts/load-config.sh"
You are tasked with conducting comprehensive research across the codebase to answer user questions by spawning parallel agents and synthesizing their findings.
If the project name is not provided, use the AskUserQuestion tool to prompt the user for the project name.
When this command is invoked:
{artifactsDir}/<project>/spec.mdI'm ready to research the codebase. Please provide your research question or area of interest, and I'll analyze it thoroughly by exploring relevant components and connections.
If spec.md exists: Add: "I found spec.md from the Interview phase. I'll use it to focus my research on the requirements for [brief summary of what spec is about]."
Then wait for the user's research query.
Read the context:
{artifactsDir}/<project>/spec.md exists from the Interview phaseAnalyze and decompose the research question:
Spawn parallel agents for comprehensive research:
For finding where things are:
For understanding how things work:
For finding existing patterns:
IMPORTANT: All agents are documentarians, not critics. They will describe what exists without suggesting improvements or identifying issues.
For public web research (only if the user explicitly asks):
last_updated, git_commit)The key is to use these agents intelligently:
Wait for all agents to complete and synthesize findings:
Gather metadata for the research document:
{artifactsDir}/<project>/research.mdgit rev-parse HEAD)git branch --show-current)Generate research document:
Use the metadata gathered in step 5
Structure the document with YAML frontmatter followed by content:
---
date: [Current date and time with timezone in ISO format]
git_commit: [Current commit hash]
branch: [Current branch name]
repository: [Repository name]
topic: "[User's Question/Topic]"
tags: [research, codebase, relevant-component-names]
status: complete
last_updated: [Current date in YYYY-MM-DD format]
last_updated_by: [Claude model used]
---
# Research: [User's Question/Topic]
**Date**: [Current date and time with timezone from step 5]
**Git Commit**: [Current commit hash from step 5]
**Branch**: [Current branch name from step 5]
**Repository**: [Repository name]
## Research Question
[Original user query]
## Summary
[High-level documentation of what was found, answering the user's question by describing what exists]
## Detailed Findings
### [Component/Area 1]
- Description of what exists ([file.ext:line](link))
- How it connects to other components
- Current implementation details (without evaluation)
### [Component/Area 2]
...
## Code References
- [path/to/file.py#L123](path/to/file.py#L123) - Description of what's there
- [another/file.ts#L45-L67](another/file.ts#L45-L67) - Description of the code block
## Architecture Documentation
[Current patterns, conventions, and design implementations found in the codebase]
## Related Research
[Links to other research/plan documents in {artifactsDir} directory, if any exist]
## Open Questions
[Any areas that need further investigation]
Handle follow-up questions:
last_updated and last_updated_by to reflect the updatelast_updated_note: "Added follow-up research for [brief description]" to frontmatter## Follow-up Research [timestamp]