Ultrathink Mode
Workflow definition
Ultrathink Mode
Ultrathink Mode
Trigger: When user message contains "ultrathink" (case-insensitive)
Enhanced reasoning mode for complex, multi-step tasks requiring deeper analysis and multi-agent coordination.
Activation
Ultrathink activates when "ultrathink" keyword appears in any command:
# Examples
/plan ultrathink: design microservices architecture
/cook ultrathink: refactor authentication module
/ask ultrathink: analyze performance bottlenecks
/code ultrathink: implement complex algorithm
# Mid-sentence also works
/plan I need ultrathink for this architecture designInjected Behavior
When ultrathink is detected, follow this enhanced workflow:
Phase 1: Deep Analysis
STOP before any action and:
-
Gather Context Exhaustively
- Read all relevant files (not just the obvious ones)
- Check related modules and dependencies
- Review existing patterns in the codebase
- Identify constraints and requirements
-
Map the Problem Space
- List all affected components
- Identify hidden complexity
- Note potential edge cases
- Document assumptions
-
Quantify Scope
- Files to modify
- Tests to update
- Dependencies impacted
- Breaking change potential
Phase 2: Strategy Generation
Generate 3+ distinct approaches:
-
Conservative Approach
- Minimal changes
- Lowest risk
- Quickest implementation
-
Balanced Approach
- Moderate refactoring
- Good trade-offs
- Sustainable solution
-
Comprehensive Approach
- Best long-term solution
- May require more effort
- Sets up future improvements
For each approach, evaluate:
- Implementation complexity
- Risk level
- Performance impact
- Maintainability
- Testing requirements
Select with explicit justification - document why the chosen approach is best.
Phase 3: Multi-Agent Execution
Spawn specialized agents in parallel:
// Example agent coordination
Task("researcher", "Gather all context for: {task}", "researcher")
Task("architect", "Design approach for: {task}", "system-architect")
Task("coder", "Implement core logic for: {task}", "coder")
Task("tester", "Create test cases for: {task}", "tester")Coordination rules:
- Agents work in parallel where possible
- Sequential dependencies are explicit
- Results are synthesized coherently
- Conflicts are resolved systematically
Phase 4: Validation
Before delivering:
-
Self-Critique
- Review all outputs critically
- Question assumptions
- Look for gaps
-
Edge Case Check
- Empty inputs
- Null/undefined values
- Boundary conditions
- Concurrent access
- Error scenarios
-
Refinement
- Address identified issues
- Polish implementation
- Ensure consistency
-
Confidence Assessment
- Rate confidence: High/Medium/Low
- Note uncertainties
- Suggest follow-up if needed
Modifiers
Optional modifiers after ultrathink keyword:
| Modifier | Effect |
|---|---|
deep | Extra context gathering, 5+ approaches |
fast | Reduced validation, 2 approaches |
safe | Extra validation passes, conservative bias |
/plan ultrathink deep: enterprise migration strategy
/cook ultrathink fast: quick bug fix with validation
/code ultrathink safe: production hotfixOutput Format
Ultrathink responses should include:
## Ultrathink Analysis
### Context Gathered
- [Files reviewed]
- [Patterns identified]
- [Constraints found]
### Approaches Considered
1. **Conservative**: [description] - Risk: Low, Effort: Low
2. **Balanced**: [description] - Risk: Medium, Effort: Medium
3. **Comprehensive**: [description] - Risk: Medium, Effort: High
### Selected Approach
[Approach name] - [Justification]
### Implementation
[Detailed implementation]
### Validation Results
- [x] Self-critique completed
- [x] Edge cases checked
- [x] Tests passing
### Confidence: [High/Medium/Low]
[Any notes or uncertainties]Best Practices
- Don't rush - Ultrathink is for quality, not speed
- Document reasoning - Show your work
- Challenge assumptions - Question everything
- Consider alternatives - Multiple perspectives
- Validate thoroughly - No shortcuts on quality