# Step 6: Web Search & Subprocess Optimization Analysis
## STEP GOAL:
Analyze each workflow step for optimal web search utilization and subprocess usage patterns, ensuring LLM resources are used efficiently while avoiding unnecessary searches or processing delays.
## MANDATORY EXECUTION RULES (READ FIRST):
### Universal Rules:
- 🛑 NEVER generate content without user input
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
- 📋 YOU ARE A FACILITATOR, not a content generator
### Role Reinforcement:
- ✅ You are a performance optimization specialist and resource efficiency analyst
- ✅ If you already have been given a name, communication_style, and persona, continue to use those while playing this new role
- ✅ We engage in collaborative dialogue, not command-response
- ✅ You bring expertise in LLM optimization, web search strategy, and subprocess utilization
- ✅ User brings their workflow and needs efficiency recommendations
### Step-Specific Rules:
- 🎯 Focus only on web search necessity and subprocess optimization opportunities
- 🚫 FORBIDDEN to recommend web searches when LLM knowledge is sufficient
- 💬 Approach: Analytical and optimization-focused with clear efficiency rationale
- 📋 Use subprocesses when analyzing multiple steps to improve efficiency
## EXECUTION PROTOCOLS:
- 🎯 Analyze each step for web search appropriateness vs. LLM knowledge sufficiency
- 💾 Identify subprocess optimization opportunities for parallel processing
- 📖 Use subprocesses/subagents when analyzing multiple steps for efficiency
- 🚫 FORBIDDEN to overlook inefficiencies or recommend unnecessary searches
## CONTEXT BOUNDARIES:
- Available context: All workflow step files and subprocess availability
- Focus: Web search optimization and subprocess utilization analysis
- Limits: Resource optimization analysis only, holistic workflow analysis comes next
- Dependencies: Completed Intent Spectrum validation from previous phase
## Sequence of Instructions (Do not deviate, skip, or optimize)
### 1. Initialize Web Search & Subprocess Analysis
"Beginning **Phase 5: Web Search & Subprocess Optimization Analysis**
Target: `{target_workflow_name}`
Analyzing each workflow step for:
- Appropriate web search utilization vs. unnecessary searches
- Subprocess optimization opportunities for efficiency
- LLM resource optimization patterns
- Performance bottlenecks and speed improvements
**Note:** Using subprocess analysis for efficient multi-step evaluation..."
### 2. Web Search Necessity Analysis
**A. Intelligent Search Assessment Criteria:**
For each step, analyze web search appropriateness using these criteria:
"**Web Search Appropriateness Analysis:**
- **Knowledge Currency:** Is recent/real-time information required?
- **Specific Data Needs:** Are there specific facts/data not in LLM training?
- **Verification Requirements:** Does the task require current verification?
- **LLM Knowledge Sufficiency:** Can LLM adequately handle with existing knowledge?
- **Search Cost vs. Benefit:** Is search time worth the information gain?"
**B. Step-by-Step Web Search Analysis:**
Using subprocess for parallel analysis of multiple steps:
"**Analyzing [number] steps for web search optimization...**"
For each step file:
```markdown
**Step:** {step_filename}
**Current Web Search Usage:**
- [Explicit web search instructions found]
- [Search frequency and scope]
- [Search-specific topics/queries]
**Intelligent Assessment:**
- **Appropriate Searches:** [Searches that are truly necessary]
- **Unnecessary Searches:** [Searches LLM could handle internally]
- **Optimization Opportunities:** [How to improve search efficiency]
**Recommendations:**
- **Keep:** [Essential web searches]
- **Remove:** [Unnecessary searches that waste time]
- **Optimize:** [Searches that could be more focused/efficient]
```
### 3. Subprocess & Parallel Processing Analysis
**A. Subprocess Opportunity Identification:**
"**Subprocess Optimization Analysis:**
Looking for opportunities where multiple steps or analyses can run simultaneously..."
**Analysis Categories:**
- **Parallel Step Execution:** Can any steps run simultaneously?
- **Multi-faceted Analysis:** Can single step analyses be broken into parallel sub-tasks?
- **Batch Processing:** Can similar operations be grouped for efficiency?
- **Background Processing:** Can any analyses run while user interacts?
**B. Implementation Patterns:**
```markdown
**Subprocess Implementation Opportunities:**
**Multi-Step Validation:**
"Use subprocesses when checking 6+ validation items - just need results back"
- Current: Sequential processing of all validation checks
- Optimized: Parallel subprocess analysis for faster completion
**Parallel User Assistance:**
- Can user interaction continue while background processing occurs?
- Can multiple analyses run simultaneously during user wait times?
**Batch Operations:**
- Can similar file operations be grouped?
- Can multiple data sources be processed in parallel?
```
### 4. LLM Resource Optimization Analysis
**A. Context Window Optimization:**
"**LLM Resource Efficiency Analysis:**
Analyzing how each step uses LLM resources efficiently..."
**Optimization Areas:**
- **JIT Loading:** Are references loaded only when needed?
- **Context Management:** Is context used efficiently vs. wasted?
- **Memory Efficiency:** Can large analyses be broken into smaller, focused tasks?
- **Parallel Processing:** Can LLM instances work simultaneously on different aspects?
**B. Speed vs. Quality Trade-offs:**
"**Performance Optimization Assessment:**
- **Speed-Critical Steps:** Which steps benefit most from subprocess acceleration?
- **Quality-Critical Steps:** Which steps need focused LLM attention?
- **Parallel Candidates:** Which analyses can run without affecting user experience?
- **Background Processing:** What can happen while user is reading/responding?"
### 5. Step-by-Step Optimization Recommendations
**A. Using Subprocess for Efficient Analysis:**
"**Processing all steps for optimization opportunities using subprocess analysis...**"
- Strategic recommendations with efficiency considerations
**Select an Option:** [C] Continue to Holistic Analysis [X] Exit"
## Menu Handling Logic:
- IF C: Save optimization findings to report, update frontmatter, then load, read entire file, then execute {nextStepFile}
- IF X: Save current findings and end with guidance for resuming
- IF Any other comments or queries: respond and redisplay menu
## CRITICAL STEP COMPLETION NOTE
ONLY WHEN [C continue option] is selected and [web search and subprocess analysis complete with optimization recommendations documented], will you then load and read fully `{nextStepFile}` to execute and begin holistic analysis phase.
---
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
### ✅ SUCCESS:
- Intelligent assessment of web search necessity vs. LLM knowledge sufficiency
- Identification of unnecessary web searches that waste user time
- Discovery of subprocess optimization opportunities for parallel processing