research
When and how to research the codebase via the librarian agent
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Research - Codebase Discovery via Librarian
This skill covers when and how to use the librarian agent for codebase research and discovery.
When to Research
Research the codebase when you need to:
- Understand existing patterns before proposing new ones
- Find integration points for new functionality
- Locate relevant files for a change
- Understand how something works before modifying it
- Verify assumptions about codebase structure
- Find similar implementations to follow established patterns
The Librarian
The librarian agent is the universal research agent. It:
- Clarifies what you're looking for
- Performs fast reconnaissance and deep codebase analysis exhaustively
- Returns structured, comprehensive findings
- Determines when research is complete
When doing SDD work, prefer using the librarian agent for codebase research so you follow existing patterns and avoid missed context.
How to Consult Librarian
Consult the librarian agent with a clear research prompt (the runtime will route this appropriately):
<your research question>
Good Research Prompts
Be specific about what you need:
# Finding files/locations
"Where are the authentication handlers in this codebase?"
# Understanding patterns
"How does this codebase handle error responses? Show me the pattern."
# Finding integration points
"I need to add a new API endpoint for user preferences. Where should it go and what patterns should it follow?"
# Understanding flows
"Trace how a request flows from the API route to the database for user creation."
# Finding similar implementations
"Find examples of form validation in this codebase so I can follow the same pattern."
What Librarian Returns
Librarian provides:
- Summary - Direct answer to your question
- Key Sources - Important file paths with annotations
- Explanation - How pieces connect
-
Evidence - Specific citations (
path/file:line) - Next Steps - What to investigate further (if needed)
Research Patterns by Phase
During Proposal
Research to understand:
- Does similar functionality exist?
- What would this change interact with?
- Are there patterns to follow or constraints to respect?
During Specs
Research to understand:
- Where do existing specs live?
- What's the current spec taxonomy?
- Are there related capabilities already specified?
During Discovery
Research to understand:
- How does the proposed change fit existing architecture?
- What code will be affected?
- Are there conflicts with existing patterns?
During Planning
Research to understand:
- Exact file paths for changes
- Current implementation details
- Test patterns to follow
- Integration points
During Implementation
Research when you encounter:
- Unexpected code structure
- Need to understand a dependency
- Unclear how to integrate with existing code
Iterating with Librarian
If librarian's first response doesn't fully answer your question:
- Ask a follow-up - Be more specific about what's missing
- Narrow the scope - Focus on one aspect at a time
- Provide context - Share what you learned so far
Example iteration:
# First query
"How does authentication work in this codebase?"
# Librarian returns high-level overview
# Follow-up query
"Thanks. Now specifically, how are JWT tokens validated? I need to add a new claim check."
When NOT to Research
Skip librarian when:
- You already know the file paths and patterns
- The change is isolated and well-understood
- You're following an existing plan that already did the research
- The task is purely about SDD artifacts (state.md, proposal.md, etc.)
Research First, Then Act
For any non-trivial codebase change:
- Research first - Understand before modifying
- Document findings - Capture relevant paths and patterns in your plan
- Then implement - With confidence about where and how
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-30
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!