Intelligent Do
Purpose
Comprehensive intelligent task execution that automatically handles all scenarios: new projects, existing codebases, simple tasks, complex requirements, first-time work, and returning workflows - all with Serena MCP as the persistent context backend.
Core Innovation: One command that adapts to any scenario without configuration, learns from every execution, and gets faster on return visits.
Workflow
Step 1: Context Detection Using Serena
Check if project exists in Serena memory:
Determine project ID from current working directory:
- Get current path: Use Bash tool to run
pwd
- Extract project name: Last component of path
- Sanitize for memory key: Replace special characters with underscores
Check Serena for existing project memory:
- Use Serena tool:
list_memories()
- Search for key:
"shannon_project_{project_id}"
- If key found → RETURNING_WORKFLOW
- If key not found → FIRST_TIME_WORKFLOW
Duration: < 1 second
Step 2a: FIRST_TIME_WORKFLOW
For projects not yet in Serena:
Sub-Step 1: Determine Project Type
Count files in current directory to determine if new or existing project:
# Use Bash tool
find . -type f \( -name "*.py" -o -name "*.js" -o -name "*.tsx" -o -name "*.java" -o -name "*.go" \) | wc -l
- If count < 3: NEW_PROJECT (greenfield)
- If count >= 3: EXISTING_PROJECT (has codebase)
Sub-Step 2: NEW_PROJECT Path
For greenfield projects (empty or minimal files):
Assess Task Complexity:
- Count words in task description
- Count requirements (lines starting with -)
- If task has 20+ words OR 3+ requirements → Complex task
- If task mentions "system", "platform", "integrate" → Complex task
For Complex Tasks - Run Spec Analysis:
Invoke sub-skill:
@skill spec-analysis
Specification: {task_description}
- This will analyze complexity (8D score)
- Create phase plan
- Save results to Serena automatically
- Use those results for wave execution
For Simple Tasks - Skip Spec:
- Proceed directly to wave execution
- No need for formal analysis
Execute Task:
Invoke sub-skill:
@skill wave-orchestration
Task: {task_description}
Spec: {spec_analysis_results if complex}
Save Project to Serena:
Use Serena tool:
write_memory("shannon_project_{project_id}", {
project_path: "{full_path}",
created: "{ISO_timestamp}",
type: "NEW_PROJECT",
initial_task: "{task_description}",
complexity: "{simple|complex}",
spec_id: "{spec_analysis_id if complex}"
})
Save Execution Results:
Use Serena tool:
write_memory("shannon_execution_{timestamp}", {
project_id: "{project_id}",
task: "{task_description}",
files_created: [list of files from wave results],
duration_seconds: {duration},
success: true,
timestamp: "{ISO_timestamp}"
})
Sub-Step 3: EXISTING_PROJECT Path
For projects with existing codebase:
Explore Project Structure:
- Use Read tool to read: README.md, package.json, pyproject.toml, requirements.txt
- Use Bash tool to find:
find . -name "*.py" | head -20 (sample files)
- Use Grep tool to search: Look for main entry points, app initialization
Detect Tech Stack:
From files found:
- If package.json exists → Node.js/JavaScript
- If pyproject.toml or requirements.txt → Python
- If pom.xml → Java
- If go.mod → Go
- If Podfile → iOS/Swift
Extract specific frameworks from file contents:
- package.json dependencies → React, Express, Next.js, etc.
- requirements.txt → Flask, Django, FastAPI, etc.
Detect Validation Gates:
From package.json:
- Look for "scripts" section
- Extract "test", "build", "lint" commands
From pyproject.toml:
- Look for [tool.pytest], [tool.ruff] sections
- Default gates: pytest, ruff check
Research Decision:
Check if task mentions libraries NOT in current dependencies:
- Parse task for library names (common libraries list)
- Compare against detected dependencies
- If new library found → Need research
If Research Needed:
For each new library:
- Use Tavily tool: Search "{library_name} best practices guide"
- Use Context7 tool: Get library documentation if available
- Save research to Serena:
write_memory("shannon_research_{library}_{timestamp}", {
library: "{library_name}",
project_id: "{project_id}",
best_practices: "{tavily_results}",
documentation: "{context7_results}",
timestamp: "{ISO_timestamp}"
})
Complexity Assessment:
- Simple task (< 12 words, starts with "create" or "add") → Skip spec
- Complex task (multiple requirements, "system", "integrate") → Run spec
Execute with Context:
Invoke sub-skill:
@skill wave-orchestration
Task: {task_description}
Project Context:
- Tech Stack: {detected_tech_stack}
- Entry Points: {main_files}
- Validation Gates: {detected_gates}
Research: {research_results if any}
Spec: {spec_analysis if complex}
Save Project Context to Serena:
Use Serena tool:
write_memory("shannon_project_{project_id}", {
project_path: "{full_path}",
explored: "{ISO_timestamp}",
type: "EXISTING_PROJECT",
tech_stack: [list of detected technologies],
file_count: {file_count},
entry_points: [list of main files],
validation_gates: {
test: "{test_command}",
build: "{build_command}",
lint: "{lint_command}"
}
})
Save Execution:
Use Serena tool:
write_memory("shannon_execution_{timestamp}", {
project_id: "{project_id}",
task: "{task_description}",
files_created: [list from wave results],
research_performed: {true|false},
spec_analysis_ran: {true|false},
duration_seconds: {duration},
success: true,
timestamp: "{ISO_timestamp}"
})
Step 2b: RETURNING_WORKFLOW
For projects with Serena context:
Load Project Context from Serena:
Use Serena tool:
const projectContext = read_memory("shannon_project_{project_id}")
Extract:
- tech_stack: List of technologies
- file_count: Previous file count
- entry_points: Main files
- validation_gates: Test/build/lint commands
- explored: Last exploration timestamp
Check Context Currency:
- Parse explored timestamp
- Calculate age in hours: (now - explored) / 3600
- If age > 24 hours → Context may be stale
Detect Changes:
# Use Bash tool
current_file_count=$(find . -name "*.py" -o -name "*.js" -o -name "*.tsx" | wc -l)
- Calculate change percentage: abs(current - cached) / cached * 100
- If change > 5% → Codebase changed
Update Context if Changed:
If changes detected OR context stale:
- Re-read key files (README, package.json)
- Re-count files
- Update Serena memory:
Use Serena tool:
write_memory("shannon_project_{project_id}", {
...existing_context,
file_count: {current_count},
updated: "{ISO_timestamp}"
})
- Display: "Codebase changed - updated context"
Load Context if Fresh:
If no changes:
- Use cached context as-is
- Display: "Using cached context (< 1s)"
Research Decision (same as first-time):
- Check if task mentions new libraries
- Compare against context.tech_stack
- Research if new libraries found
Complexity Decision:
- Simple task → Direct wave execution
- Complex task → Run spec-analysis first
Execute with Cached Context:
Invoke sub-skill:
@skill wave-orchestration
Task: {task_description}
Cached Context:
- Tech Stack: {context.tech_stack}
- Validation Gates: {context.validation_gates}
Research: {if performed}
Spec: {if complex}
Save Execution to Serena:
Use Serena tool:
write_memory("shannon_execution_{timestamp}", {
project_id: "{project_id}",
task: "{task_description}",
used_cache: true,
context_age_hours: {age},
files_created: [list],
timestamp: "{ISO_timestamp}"
})
Anti-Rationalization
Rationalization 1: "Simple task, skip Serena check"
COUNTER:
- ❌ NEVER skip Serena check
- ✅ Check takes <100ms via list_memories()
- ✅ Loading cached context saves 2-5 minutes on return
- ✅ Even "simple" tasks benefit from validation gates knowledge
Rule: Always check Serena first. Every time.
Rationalization 2: "Project looks new, skip file exploration"
COUNTER:
- ❌ NEVER assume without checking
- ✅ File count check takes 1 second
- ✅ Wrong assumption = wrong execution context
- ✅ Exploration takes 10-30s, prevents hours of misaligned work
Rule: Check file count. Explore if files exist.
Rationalization 3: "User knows libraries, skip research"
COUNTER:
- ❌ NEVER skip research when detecting new external libraries
- ✅ Research takes 30-60s, provides best practices
- ✅ User knowledge + framework patterns = better quality
- ✅ Prevents hours of debugging wrong implementation patterns
Rule: If external library detected in task but not in project dependencies, research it.
Serena Memory Key Patterns
Project Context:
- Key:
"shannon_project_{project_id}"
- Data:
{project_path, tech_stack, file_count, validation_gates, explored, type}
Execution History:
- Key:
"shannon_execution_{timestamp}"
- Data:
{project_id, task, files_created, duration, success, timestamp}
Research Results:
- Key:
"shannon_research_{library}_{timestamp}"
- Data:
{library, best_practices, documentation, timestamp}
Spec Analysis (when complex):
- Key:
"spec_analysis_{timestamp}"
- Data:
{complexity_score, domain_percentages, phase_plan, ...} (from spec-analysis skill)
Examples
Example 1: New Empty Project
User: /shannon:do "create authentication system using Auth0"
Working Directory: /tmp/new-auth-app/
Execution:
1. list_memories() → No "shannon_project_new-auth-app"
2. File count: 0 → NEW_PROJECT
3. Task assessment: "authentication system" (complex) → Run spec-analysis
4. Research: "Auth0" detected → Research Auth0 integration patterns
5. Execute: wave-orchestration with spec + research
6. Save: write_memory("shannon_project_new-auth-app", {...})
7. Save: write_memory("shannon_execution_{timestamp}", {...})
Result: Authentication system created, context saved for next time
Time: 5-8 minutes
Example 2: Existing Project - First Time
User: /shannon:do "add password reset endpoint"
Working Directory: /projects/my-flask-api/
Execution:
1. list_memories() → No "shannon_project_my-flask-api"
2. File count: 45 → EXISTING_PROJECT
3. Explore: Read app.py, requirements.txt → Detect Python/Flask
4. Validation gates: Found pytest in pyproject.toml
5. Task: Simple ("add endpoint") → Skip spec
6. Research: None (internal feature)
7. Execute: wave-orchestration with Flask context
8. Save project: write_memory("shannon_project_my-flask-api", {tech_stack: ["Python/Flask"], ...})
9. Save execution: write_memory("shannon_execution_{timestamp}", {...})
Result: Endpoint added, project context cached
Time: 3-5 minutes
Example 3: Returning - Cached Context
User: /shannon:do "add email verification"
Working Directory: /projects/my-flask-api/
Execution:
1. list_memories() → Found "shannon_project_my-flask-api" ✓
2. read_memory("shannon_project_my-flask-api") → Load tech_stack, validation_gates
3. Check age: 2 hours old → Fresh
4. File count: 45 files (same) → No changes
5. Display: "Using cached context (< 1s)"
6. Task: Simple → Skip spec
7. Research: None needed
8. Execute: wave-orchestration with loaded context
9. Save execution: write_memory("shannon_execution_{timestamp}", {...})
Result: Feature added using cached context
Time: 2-3 minutes (vs 5 first time)
Speedup: 2x faster
Integration with Shannon CLI
Shannon CLI invokes this skill via Agent SDK:
# In Shannon CLI unified_orchestrator.py
async for msg in self.sdk_client.invoke_skill(
skill_name='intelligent-do',
prompt_content=f"Task: {task}"
):
# Skill handles all intelligence via Serena
# CLI wraps with V3 features (cost optimization, analytics, dashboard)
Division of Responsibilities:
intelligent-do Skill Provides (Shannon Framework):
- Context detection and loading (Serena MCP)
- Research integration (Tavily, Context7)
- Spec analysis decision (when to run)
- Validation gate detection
- Wave execution coordination
Shannon CLI Provides (Platform Features):
- Cost optimization (model selection)
- Analytics tracking (session history)
- Dashboard streaming (WebSocket events)
- Local CLI interface
Together: Complete intelligent execution platform
Testing Requirements
Use functional-testing Skill Patterns:
- Test with sub-agents using Task tool
- Validate Serena memory operations:
- Context saved correctly
- Context loaded correctly
- Keys follow naming convention
- Test scenarios:
- New empty project
- Existing project first time
- Returning to project
- Research integration
- Complex task with spec
Evidence Required:
- Serena memories created (list_memories() output)
- Files created in correct locations
- Timing comparison (first vs return)
- Research results when libraries detected
Status: Skill template ready for proper implementation following Shannon patterns
1---2name: intelligent-do3description: Context-aware task execution with Serena MCP backend. First time: Explores project, saves to Serena, runs spec if complex, executes waves. Returning: Loads from Serena (<1s), detects changes, executes with cached context. Intelligently decides when to research, when to spec, when to prime. One catch-all intelligent execution command. Use when: User wants task executed in any project (new or existing).4---5
6# Intelligent Do
7
8## Purpose
9
10Comprehensive intelligent task execution that automatically handles all scenarios: new projects, existing codebases, simple tasks, complex requirements, first-time work, and returning workflows - all with Serena MCP as the persistent context backend.
11
12**Core Innovation**: One command that adapts to any scenario without configuration, learns from every execution, and gets faster on return visits.
13
14---
15
16## Workflow
17
18### Step 1: Context Detection Using Serena
19
20**Check if project exists in Serena memory**:
21
221. Determine project ID from current working directory:
23 - Get current path: Use Bash tool to run `pwd`
24 - Extract project name: Last component of path
25 - Sanitize for memory key: Replace special characters with underscores
26
272. Check Serena for existing project memory:
28 - Use Serena tool: `list_memories()`
29 - Search for key: `"shannon_project_{project_id}"`
30 - If key found → RETURNING_WORKFLOW
31 - If key not found → FIRST_TIME_WORKFLOW
32
33**Duration**: < 1 second
34
35---
36
37### Step 2a: FIRST_TIME_WORKFLOW
38
39**For projects not yet in Serena**:
40
41#### Sub-Step 1: Determine Project Type
42
43Count files in current directory to determine if new or existing project:
44
45```bash
46# Use Bash tool
47find . -type f \( -name "*.py" -o -name "*.js" -o -name "*.tsx" -o -name "*.java" -o -name "*.go" \) | wc -l
48```
49
50- If count < 3: NEW_PROJECT (greenfield)
51- If count >= 3: EXISTING_PROJECT (has codebase)
52
53#### Sub-Step 2: NEW_PROJECT Path
54
55For greenfield projects (empty or minimal files):
56
571. **Assess Task Complexity**:
58 - Count words in task description
59 - Count requirements (lines starting with -)
60 - If task has 20+ words OR 3+ requirements → Complex task
61 - If task mentions "system", "platform", "integrate" → Complex task
62
632. **For Complex Tasks - Run Spec Analysis**:
64 ```
65 Invoke sub-skill:
66 @skill spec-analysis
67 Specification: {task_description}
68 ```
69 - This will analyze complexity (8D score)
70 - Create phase plan
71 - Save results to Serena automatically
72 - Use those results for wave execution
73
743. **For Simple Tasks - Skip Spec**:
75 - Proceed directly to wave execution
76 - No need for formal analysis
77
784. **Execute Task**:
79 ```
80 Invoke sub-skill:
81 @skill wave-orchestration
82 Task: {task_description}
83 Spec: {spec_analysis_results if complex}
84 ```
85
865. **Save Project to Serena**:
87 ```
88 Use Serena tool:
89 write_memory("shannon_project_{project_id}", {
90 project_path: "{full_path}",
91 created: "{ISO_timestamp}",
92 type: "NEW_PROJECT",
93 initial_task: "{task_description}",
94 complexity: "{simple|complex}",
95 spec_id: "{spec_analysis_id if complex}"
96 })
97 ```
98
996. **Save Execution Results**:
100 ```
101 Use Serena tool:
102 write_memory("shannon_execution_{timestamp}", {
103 project_id: "{project_id}",
104 task: "{task_description}",
105 files_created: [list of files from wave results],
106 duration_seconds: {duration},
107 success: true,
108 timestamp: "{ISO_timestamp}"
109 })
110 ```
111
112#### Sub-Step 3: EXISTING_PROJECT Path
113
114For projects with existing codebase:
115
1161. **Explore Project Structure**:
117 - Use Read tool to read: README.md, package.json, pyproject.toml, requirements.txt
118 - Use Bash tool to find: `find . -name "*.py" | head -20` (sample files)
119 - Use Grep tool to search: Look for main entry points, app initialization
120
1212. **Detect Tech Stack**:
122 From files found:
123 - If package.json exists → Node.js/JavaScript
124 - If pyproject.toml or requirements.txt → Python
125 - If pom.xml → Java
126 - If go.mod → Go
127 - If Podfile → iOS/Swift
128
129 Extract specific frameworks from file contents:
130 - package.json dependencies → React, Express, Next.js, etc.
131 - requirements.txt → Flask, Django, FastAPI, etc.
132
1333. **Detect Validation Gates**:
134 From package.json:
135 - Look for "scripts" section
136 - Extract "test", "build", "lint" commands
137
138 From pyproject.toml:
139 - Look for [tool.pytest], [tool.ruff] sections
140 - Default gates: pytest, ruff check
141
1424. **Research Decision**:
143 Check if task mentions libraries NOT in current dependencies:
144 - Parse task for library names (common libraries list)
145 - Compare against detected dependencies
146 - If new library found → Need research
147
1485. **If Research Needed**:
149 ```
150 For each new library:
151 - Use Tavily tool: Search "{library_name} best practices guide"
152 - Use Context7 tool: Get library documentation if available
153 - Save research to Serena:
154 write_memory("shannon_research_{library}_{timestamp}", {
155 library: "{library_name}",
156 project_id: "{project_id}",
157 best_practices: "{tavily_results}",
158 documentation: "{context7_results}",
159 timestamp: "{ISO_timestamp}"
160 })
161 ```
162
1636. **Complexity Assessment**:
164 - Simple task (< 12 words, starts with "create" or "add") → Skip spec
165 - Complex task (multiple requirements, "system", "integrate") → Run spec
166
1677. **Execute with Context**:
168 ```
169 Invoke sub-skill:
170 @skill wave-orchestration
171 Task: {task_description}
172 Project Context:
173 - Tech Stack: {detected_tech_stack}
174 - Entry Points: {main_files}
175 - Validation Gates: {detected_gates}
176 Research: {research_results if any}
177 Spec: {spec_analysis if complex}
178 ```
179
1808. **Save Project Context to Serena**:
181 ```
182 Use Serena tool:
183 write_memory("shannon_project_{project_id}", {
184 project_path: "{full_path}",
185 explored: "{ISO_timestamp}",
186 type: "EXISTING_PROJECT",
187 tech_stack: [list of detected technologies],
188 file_count: {file_count},
189 entry_points: [list of main files],
190 validation_gates: {
191 test: "{test_command}",
192 build: "{build_command}",
193 lint: "{lint_command}"
194 }
195 })
196 ```
197
1989. **Save Execution**:
199 ```
200 Use Serena tool:
201 write_memory("shannon_execution_{timestamp}", {
202 project_id: "{project_id}",
203 task: "{task_description}",
204 files_created: [list from wave results],
205 research_performed: {true|false},
206 spec_analysis_ran: {true|false},
207 duration_seconds: {duration},
208 success: true,
209 timestamp: "{ISO_timestamp}"
210 })
211 ```
212
213---
214
215### Step 2b: RETURNING_WORKFLOW
216
217**For projects with Serena context**:
218
2191. **Load Project Context from Serena**:
220 ```
221 Use Serena tool:
222 const projectContext = read_memory("shannon_project_{project_id}")
223 ```
224
225 Extract:
226 - tech_stack: List of technologies
227 - file_count: Previous file count
228 - entry_points: Main files
229 - validation_gates: Test/build/lint commands
230 - explored: Last exploration timestamp
231
2322. **Check Context Currency**:
233 - Parse explored timestamp
234 - Calculate age in hours: (now - explored) / 3600
235 - If age > 24 hours → Context may be stale
236
2373. **Detect Changes**:
238 ```bash
239 # Use Bash tool
240 current_file_count=$(find . -name "*.py" -o -name "*.js" -o -name "*.tsx" | wc -l)
241 ```
242
243 - Calculate change percentage: abs(current - cached) / cached * 100
244 - If change > 5% → Codebase changed
245
2464. **Update Context if Changed**:
247 If changes detected OR context stale:
248 - Re-read key files (README, package.json)
249 - Re-count files
250 - Update Serena memory:
251 ```
252 Use Serena tool:
253 write_memory("shannon_project_{project_id}", {
254 ...existing_context,
255 file_count: {current_count},
256 updated: "{ISO_timestamp}"
257 })
258 ```
259 - Display: "Codebase changed - updated context"
260
2615. **Load Context if Fresh**:
262 If no changes:
263 - Use cached context as-is
264 - Display: "Using cached context (< 1s)"
265
2666. **Research Decision** (same as first-time):
267 - Check if task mentions new libraries
268 - Compare against context.tech_stack
269 - Research if new libraries found
270
2717. **Complexity Decision**:
272 - Simple task → Direct wave execution
273 - Complex task → Run spec-analysis first
274
2758. **Execute with Cached Context**:
276 ```
277 Invoke sub-skill:
278 @skill wave-orchestration
279 Task: {task_description}
280 Cached Context:
281 - Tech Stack: {context.tech_stack}
282 - Validation Gates: {context.validation_gates}
283 Research: {if performed}
284 Spec: {if complex}
285 ```
286
2879. **Save Execution to Serena**:
288 ```
289 Use Serena tool:
290 write_memory("shannon_execution_{timestamp}", {
291 project_id: "{project_id}",
292 task: "{task_description}",
293 used_cache: true,
294 context_age_hours: {age},
295 files_created: [list],
296 timestamp: "{ISO_timestamp}"
297 })
298 ```
299
300---
301
302## Anti-Rationalization
303
304### Rationalization 1: "Simple task, skip Serena check"
305
306**COUNTER**:
307- ❌ NEVER skip Serena check
308- ✅ Check takes <100ms via list_memories()
309- ✅ Loading cached context saves 2-5 minutes on return
310- ✅ Even "simple" tasks benefit from validation gates knowledge
311
312**Rule**: Always check Serena first. Every time.
313
314### Rationalization 2: "Project looks new, skip file exploration"
315
316**COUNTER**:
317- ❌ NEVER assume without checking
318- ✅ File count check takes 1 second
319- ✅ Wrong assumption = wrong execution context
320- ✅ Exploration takes 10-30s, prevents hours of misaligned work
321
322**Rule**: Check file count. Explore if files exist.
323
324### Rationalization 3: "User knows libraries, skip research"
325
326**COUNTER**:
327- ❌ NEVER skip research when detecting new external libraries
328- ✅ Research takes 30-60s, provides best practices
329- ✅ User knowledge + framework patterns = better quality
330- ✅ Prevents hours of debugging wrong implementation patterns
331
332**Rule**: If external library detected in task but not in project dependencies, research it.
333
334---
335
336## Serena Memory Key Patterns
337
338**Project Context**:
339- Key: `"shannon_project_{project_id}"`
340- Data: `{project_path, tech_stack, file_count, validation_gates, explored, type}`
341
342**Execution History**:
343- Key: `"shannon_execution_{timestamp}"`
344- Data: `{project_id, task, files_created, duration, success, timestamp}`
345
346**Research Results**:
347- Key: `"shannon_research_{library}_{timestamp}"`
348- Data: `{library, best_practices, documentation, timestamp}`
349
350**Spec Analysis** (when complex):
351- Key: `"spec_analysis_{timestamp}"`
352- Data: `{complexity_score, domain_percentages, phase_plan, ...}` (from spec-analysis skill)
353
354---
355
356## Examples
357
358### Example 1: New Empty Project
359
360```
361User: /shannon:do "create authentication system using Auth0"
362Working Directory: /tmp/new-auth-app/
363
364Execution:
3651. list_memories() → No "shannon_project_new-auth-app"
3662. File count: 0 → NEW_PROJECT
3673. Task assessment: "authentication system" (complex) → Run spec-analysis
3684. Research: "Auth0" detected → Research Auth0 integration patterns
3695. Execute: wave-orchestration with spec + research
3706. Save: write_memory("shannon_project_new-auth-app", {...})
3717. Save: write_memory("shannon_execution_{timestamp}", {...})
372
373Result: Authentication system created, context saved for next time
374Time: 5-8 minutes
375```
376
377### Example 2: Existing Project - First Time
378
379```
380User: /shannon:do "add password reset endpoint"
381Working Directory: /projects/my-flask-api/
382
383Execution:
3841. list_memories() → No "shannon_project_my-flask-api"
3852. File count: 45 → EXISTING_PROJECT
3863. Explore: Read app.py, requirements.txt → Detect Python/Flask
3874. Validation gates: Found pytest in pyproject.toml
3885. Task: Simple ("add endpoint") → Skip spec
3896. Research: None (internal feature)
3907. Execute: wave-orchestration with Flask context
3918. Save project: write_memory("shannon_project_my-flask-api", {tech_stack: ["Python/Flask"], ...})
3929. Save execution: write_memory("shannon_execution_{timestamp}", {...})
393
394Result: Endpoint added, project context cached
395Time: 3-5 minutes
396```
397
398### Example 3: Returning - Cached Context
399
400```
401User: /shannon:do "add email verification"
402Working Directory: /projects/my-flask-api/
403
404Execution:
4051. list_memories() → Found "shannon_project_my-flask-api" ✓
4062. read_memory("shannon_project_my-flask-api") → Load tech_stack, validation_gates
4073. Check age: 2 hours old → Fresh
4084. File count: 45 files (same) → No changes
4095. Display: "Using cached context (< 1s)"
4106. Task: Simple → Skip spec
4117. Research: None needed
4128. Execute: wave-orchestration with loaded context
4139. Save execution: write_memory("shannon_execution_{timestamp}", {...})
414
415Result: Feature added using cached context
416Time: 2-3 minutes (vs 5 first time)
417Speedup: 2x faster
418```
419
420---
421
422## Integration with Shannon CLI
423
424Shannon CLI invokes this skill via Agent SDK:
425
426```python
427# In Shannon CLI unified_orchestrator.py
428async for msg in self.sdk_client.invoke_skill(
429 skill_name='intelligent-do',
430 prompt_content=f"Task: {task}"
431):
432 # Skill handles all intelligence via Serena
433 # CLI wraps with V3 features (cost optimization, analytics, dashboard)
434```
435
436**Division of Responsibilities**:
437
438**intelligent-do Skill Provides** (Shannon Framework):
439- Context detection and loading (Serena MCP)
440- Research integration (Tavily, Context7)
441- Spec analysis decision (when to run)
442- Validation gate detection
443- Wave execution coordination
444
445**Shannon CLI Provides** (Platform Features):
446- Cost optimization (model selection)
447- Analytics tracking (session history)
448- Dashboard streaming (WebSocket events)
449- Local CLI interface
450
451**Together**: Complete intelligent execution platform
452
453---
454
455## Testing Requirements
456
457**Use functional-testing Skill Patterns**:
458
4591. Test with sub-agents using Task tool
4602. Validate Serena memory operations:
461 - Context saved correctly
462 - Context loaded correctly
463 - Keys follow naming convention
4643. Test scenarios:
465 - New empty project
466 - Existing project first time
467 - Returning to project
468 - Research integration
469 - Complex task with spec
470
471**Evidence Required**:
472- Serena memories created (list_memories() output)
473- Files created in correct locations
474- Timing comparison (first vs return)
475- Research results when libraries detected
476
477---
478
479**Status**: Skill template ready for proper implementation following Shannon patterns