Ralph Research
System Prompt
⚠️ EXECUTION DIRECTIVE: When the user invokes this command, you MUST:
- IMMEDIATELY execute - no questions, no explanations first
- ALWAYS show full output from script/tool execution
- ALWAYS provide summary after execution completes
DO NOT:
- Say "I don't need to take action" - you ALWAYS execute when invoked
- Ask for confirmation unless
requires_confirmation: truein frontmatter - Skip execution even if it seems redundant - run it anyway
The user invoking the command IS the confirmation.
Usage
/ralph-research
Research ticket: $ARGUMENTS
Arguments
$ARGUMENTS - Ticket Context (optional)
Specify ticket to research:
- Ticket number: "ENG-1234" - Research specific Linear ticket
- Auto-select: No arguments - Selects highest priority SMALL/XS from "research needed"
- With context: "Research ENG-1234 focusing on authentication patterns"
Default Behavior
If no arguments:
- Fetches top 10 priority items from Linear in "research needed" status
- Selects highest priority SMALL or XS issue
- Conducts comprehensive research
- Generates research document
- Updates Linear ticket with findings
PART I - IF A LINEAR TICKET IS MENTIONED
0c. use linear cli to fetch the selected item into thoughts with the ticket number - ./thoughts/shared/tickets/ENG-xxxx.md
0d. read the ticket and all comments to understand what research is needed and any previous attempts
PART I - IF NO TICKET IS MENTIONED
- read .claude/commands/linear.md
0a. fetch the top 10 priority items from linear in status "research needed" using the MCP tools, noting all items in the
linkssection 0b. select the highest priority SMALL or XS issue from the list (if no SMALL or XS issues exist, EXIT IMMEDIATELY and inform the user) 0c. uselinearcli to fetch the selected item into thoughts with the ticket number - ./thoughts/shared/tickets/ENG-xxxx.md 0d. read the ticket and all comments to understand what research is needed and any previous attempts
PART II - NEXT STEPS
think deeply
- move the item to "research in progress" using the MCP tools
1a. read any linked documents in the
linkssection to understand context 1b. if insufficient information to conduct research, add a comment asking for clarification and move back to "research needed"
think deeply about the research needs
- conduct the research:
2a. read .claude/commands/research-codebase.md for guidance on effective codebase research
2b. if the linear comments suggest web research is needed, use WebSearch to research external solutions, APIs, or best practices
2c. search the codebase for relevant implementations and patterns
2d. examine existing similar features or related code
2e. identify technical constraints and opportunities
2f. Be unbiased - don't think too much about an ideal implementation plan, just document all related files and how the systems work today
2g. document findings in a new thoughts document:
thoughts/shared/research/YYYY-MM-DD-ENG-XXXX-description.md- Format:
YYYY-MM-DD-ENG-XXXX-description.mdwhere:- YYYY-MM-DD is today's date
- ENG-XXXX is the ticket number (omit if no ticket)
- description is a brief kebab-case description of the research topic
- Examples:
- With ticket:
2025-01-08-ENG-1478-parent-child-tracking.md - Without ticket:
2025-01-08-error-handling-patterns.md
- With ticket:
- Format:
think deeply about the findings
-
synthesize research into actionable insights: 3a. summarize key findings and technical decisions 3b. identify potential implementation approaches 3c. note any risks or concerns discovered 3d. run
humanlayer thoughts syncto save the research -
update the ticket: 4a. attach the research document to the ticket using the MCP tools with proper link formatting 4b. add a comment summarizing the research outcomes 4c. move the item to "research in review" using the MCP tools
think deeply, use TodoWrite to track your tasks. When fetching from linear, get the top 10 items by priority but only work on ONE item - specifically the highest priority issue.
PART III - When you're done
Print a message for the user (replace placeholders with actual values):
✅ Completed research for ENG-XXXX: [ticket title]
Research topic: [research topic description]
The research has been:
Created at thoughts/shared/research/YYYY-MM-DD-ENG-XXXX-description.md
Synced to thoughts repository
Attached to the Linear ticket
Ticket moved to "research in review" status
Key findings:
- [Major finding 1]
- [Major finding 2]
- [Major finding 3]
View the ticket: https://linear.app/humanlayer/issue/ENG-XXXX/[ticket-slug]
Action Policy
<default_behavior> This command analyzes and recommends without making changes. Provides:
- Detailed analysis of current state
- Specific recommendations with justification
- Prioritized action items
- Risk assessment
User decides which recommendations to implement. </default_behavior>
Success Output
When Ralph research completes:
✅ COMMAND COMPLETE: /ralph-research
Ticket: ENG-XXXX
Status: Research Needed → Research in Review
Research: thoughts/shared/research/YYYY-MM-DD-ENG-XXXX-description.md
Key Findings: N documented
Synced: Yes
Next: Review findings and proceed to planning
Completion Checklist
Before marking complete:
- Ticket fetched from Linear
- Moved to "research in progress"
- Research document created
- Findings synthesized
- Attached to ticket
- Moved to "research in review"
Failure Indicators
This command has FAILED if:
- ❌ No SMALL/XS tickets found
- ❌ Insufficient information for research
- ❌ Research document not created
- ❌ Ticket not updated
When NOT to Use
Do NOT use when:
- Ticket already has sufficient research
- Ticket ready for planning (use
/ralph-plan) - Linear MCP not configured
Anti-Patterns (Avoid)
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Skip existing research | Duplicate work | Check links section first |
| Biased toward implementation | Incomplete analysis | Document all patterns objectively |
| Single source research | Limited findings | Use both codebase and web search |
Principles
This command embodies:
- #9 Based on Facts - Objective research findings
- #6 Research When in Doubt - Thorough investigation
Full Standard: CODITECT-STANDARD-AUTOMATION.md