@@ -27,62 +27,39 @@ invokes:
2727## Purpose
2828
2929Deep analysis mode for complex tasks. Invokes workflow skills (default-workflow or investigation-workflow) based on task type, with automatic fallback to markdown workflows if skills are not yet available.
30+ You MUST use one of the workflow skills - either default-workflow or investigation-workflow or both or its possible the user could pass in additional workflow skills like cascade or debate.
3031
3132## EXECUTION INSTRUCTIONS FOR CLAUDE
3233
3334When this command is invoked, you MUST:
35+ Execute this exact sequence for the task: ` {TASK_DESCRIPTION} `
3436
35371 . ** First, detect task type** - Check if task is investigation or development
3638 - ** Investigation keywords** : investigate, explain, understand, how does, why does, analyze, research, explore, examine, study
3739 - ** Development keywords** : implement, build, create, add feature, fix, refactor, deploy
3840 - ** If both types detected** : Use hybrid workflow (investigation first, then development)
39- - If only investigation keywords found: Use INVESTIGATION_WORKFLOW.md
40- - If only development keywords found: Use DEFAULT_WORKFLOW.md
41- 2 . ** Invoke the appropriate workflow skill** using the Skill tool:
42- - Investigation: ` Skill(skill="investigation-workflow") `
41+ - If only investigation keywords found: Use @.claude/workflow/ INVESTIGATION_WORKFLOW.md
42+ - If only development keywords found: Use @.claude/workflow/ DEFAULT_WORKFLOW.md
43+ 2 . Mandatory - not doing this wil require rework ** Invoke the appropriate workflow skill** using the Skill tool:
44+ - Investigation: Skill(skill="investigation-workflow")`
4345 - Development: ` Skill(skill="default-workflow") `
4446 - ** FALLBACK** : If skill invocation fails (skill not found), fall back to reading markdown workflows:
45- - Investigation: ` .claude/workflow/INVESTIGATION_WORKFLOW.md `
46- - Development: ` .claude/workflow/DEFAULT_WORKFLOW.md `
47- 3 . ** Create a comprehensive todo list** using TodoWrite that includes all workflow steps/phases
48- 4 . ** Execute each step systematically** , marking todos as in_progress and completed
49- 5 . ** Use the specified agents** for each step (marked with "** Use** " or "** Always use** ")
50- 6 . ** MANDATORY: Enforce Steps 11-12** (Code Review) for all development workflows:
51- - After Step 10, MUST invoke reviewer agent
52- - After Step 11, MUST implement feedback (Step 12)
53- - Do NOT mark workflow complete without Steps 11-12
54- 7 . ** Track decisions** by creating ` .claude/runtime/logs/<session_timestamp>/DECISIONS.md `
55- 8 . ** End with cleanup agent** (development) or knowledge capture (investigation)
56-
57- ## PROMPT-BASED WORKFLOW EXECUTION
58-
59- Execute this exact sequence for the task: ` {TASK_DESCRIPTION} `
60-
61- ### Step-by-Step Execution:
62-
63- 1 . ** Initialize** :
64- - Detect task type (investigation vs. development)
65- - Select appropriate workflow:
66- - Investigation: investigation-workflow skill
67- - Development: default-workflow skill
68- - Inform user which workflow is being used
69- - Try to invoke the selected workflow skill using Skill tool
70- - ** FALLBACK** : If skill not found, read the markdown workflow file using Read tool:
71- - Investigation: ` .claude/workflow/INVESTIGATION_WORKFLOW.md `
72- - Development: ` .claude/workflow/DEFAULT_WORKFLOW.md `
73- - Create TodoWrite list with all workflow steps/phases
74- - Create session directory for decision logging
75-
76- 2 . ** For Each Workflow Step** :
47+ - Investigation: @.claude/workflow/INVESTIGATION_WORKFLOW.md
48+ - Development: @.claude/workflow/DEFAULT_WORKFLOW.md
49+ 3 . ALWAYS ** Create a comprehensive todo list** using TodoWrite tool that includes all workflow steps/phases
50+ 4 . ALWAYS ** Execute each step systematically** , marking todos as in_progress and completed
51+
52+ THERE IS NO VALUE in SKIPPING STEPS - DO NOT TAKE SHORTCUTS.
53+
54+ - ** For Each Workflow Step** :
7755 - Mark step as in_progress in TodoWrite
56+ - Break down the step into smaller tasks if needed
7857 - Read the step requirements from workflow
7958 - Invoke specified agents via Task tool
8059 - Log decisions made
8160 - Mark step as completed
82- - ** MANDATORY ENFORCEMENT** : After Step 10 completion, MUST proceed to Steps 11-12 (Code Review)
83- - ** Steps 11-12 are NOT optional** - No workflow can be marked complete without code review
84-
85- 3 . ** Agent Invocation Pattern** :
61+ - No steps are optional - all steps must be followed in sequence.
62+ - ** Agent Invocation Pattern** :
8663
8764 ```
8865 For step requiring "**Use** architect agent":
@@ -91,50 +68,34 @@ Execute this exact sequence for the task: `{TASK_DESCRIPTION}`
9168 For step requiring multiple agents:
9269 → Invoke multiple Task calls in parallel
9370 ```
71+ ### Agent Orchestration
9472
95- 4 . ** Decision Logging** :
96- After each major decision, append to DECISIONS.md:
97- - What was decided
98- - Why this approach
99- - Alternatives considered
100-
101- 5 . ** Mandatory Cleanup** :
102- Always end with Task(subagent_type="cleanup")
103-
104- ## ACTUAL IMPLEMENTATION PROMPT
105-
106- When ` /ultrathink ` is called, execute this:
107-
108- ## Agent Orchestration
109-
110- ### When to Use Sequential
73+ #### When to Use Sequential
11174
11275- Architecture → Implementation → Review
11376- Each step depends on previous
11477- Building progressive context
11578
116- ### When to Use Parallel
79+ #### When to Use Parallel
11780
11881- Multiple independent analyses
11982- Different perspectives needed
12083- Gathering diverse solutions
12184
122- ## When to Use UltraThink
123-
124- ### Use UltraThink When:
125-
126- - Task complexity requires deep multi-agent analysis
127- - Architecture decisions need careful decomposition
128- - Requirements are vague and need exploration
129- - Multiple solution paths need evaluation
130- - Cross-cutting concerns need coordination
85+ - ** Decision Logging** :
13186
132- ### Follow Workflow Directly When:
87+ After each major decision, append to DECISIONS.md:
88+ - What was decided
89+ - Why this approach
90+ - Alternatives considered
13391
134- - Requirements are clear and straightforward
135- - Solution approach is well-defined
136- - Standard implementation patterns apply
137- - Single agent can handle the task
92+ - ** Mandatory Cleanup** :
93+ Always end with Task(subagent_type="cleanup")
94+
95+ 5 . ** Use the specified agents** for each step (marked with "** Use** " or "** Always use** ")
96+ 6 . ** MANDATORY: Enforce all steps.
97+ 7 . ** Track decisions** by creating and writing important decisions to ` .claude/runtime/logs/<session_timestamp>/DECISIONS.md `
98+ 8 . ** End with cleanup agent** (development) or knowledge capture (investigation)
13899
139100## Task Management
140101
@@ -215,63 +176,9 @@ Some development tasks require investigation first (Step 4 of DEFAULT_WORKFLOW.m
215176
216177In these cases, pause development workflow at Step 4, run full INVESTIGATION_WORKFLOW.md, then resume development with the knowledge gained.
217178
218- ## Mandatory Code Review (Steps 11-12)
219-
220- ** CRITICAL** : Every development workflow MUST include code review before completion.
221-
222- ** MANDATORY ENFORCEMENT** :
223-
224- - ** After Step 10** : MUST invoke reviewer agent for code review
225- - ** After Step 11** : MUST implement review feedback (Step 12)
226- - ** Do NOT mark workflow complete** until Steps 11-12 are done
227- - ** No PR should be merged without code review**
228-
229- The reviewer agent (Step 11):
230-
231- - Reviews code for philosophy compliance (ruthless simplicity)
232- - Checks module boundaries and contracts
233- - Identifies code smells and anti-patterns
234- - Validates test coverage and quality
235- - Provides actionable feedback for improvements
236-
237- Feedback Implementation (Step 12):
238-
239- - Address ALL review feedback before proceeding
240- - Make required changes to meet quality standards
241- - Re-run tests after implementing feedback
242- - Update documentation if needed
243- - Verify philosophy compliance is achieved
244-
245- ** Review Trigger** : Automatically invoke reviewer agent when:
246-
247- - Step 10 (implementation) is completed
248- - Code changes are ready for review
249- - Before creating pull request
250- - NEVER skip - Steps 11-12 are mandatory workflow steps
251-
252- ** Reminder** : Steps 11-12 are NOT optional. Code quality and philosophy compliance require systematic review.
253-
254- ## Mandatory Cleanup Phase
255-
256- ** CRITICAL** : Every ultrathink task MUST end with cleanup agent invocation.
257-
258- ** IMPORTANT** : Cleanup happens AFTER mandatory code review (Steps 11-12). Order: Step 10 → Step 11 (Review) → Step 12 (Implement Feedback) → Cleanup.
259-
260- The cleanup agent:
261-
262- - Reviews git status and file changes
263- - Removes temporary artifacts and planning documents
264- - Ensures philosophy compliance (ruthless simplicity)
265- - Provides final report on codebase state
266- - Guards against technical debt accumulation
267-
268- ** Cleanup Trigger** : Automatically invoke cleanup agent when:
269-
270- - All todo items are completed (including Steps 11-12)
271- - Code review feedback has been implemented
272- - Main task objectives are achieved
273- - Before reporting task completion to user
179+ # ALWAYS PICK A WORKFLOW OR FOLLOW THE ONE THE USER TOLD YOU TO USE
274180
181+ YOU MAY NOT SKIP STEPS in the workflow.
275182UltraThink enhances the workflow with deep multi-agent analysis while respecting user customizations.
276183
277184Remember: Ultra-thinking means thorough analysis before action, followed by ruthless cleanup.
0 commit comments