Commit bcf33a2
committed
feat: Add code-first prompt templates for agent code execution
This commit adds optimized prompt templates that guide agents to write
code instead of making direct tool calls, enabling the Code Execution
with MCP approach for massive token reduction.
New features:
- Code execution prompts module in terraphim_multi_agent
- TypeScript system prompt with complete MCP tool documentation
- Python system prompt with type-annotated tool usage
- Task analysis for automatic execution mode selection
- Anti-patterns guidance to avoid token waste
- Examples showing in-environment data processing
Key capabilities:
- Agents can now be configured for code-first behavior
- Prompts emphasize processing data in-environment
- Return only minimal results (not raw data)
- Parallel execution patterns for efficiency
- Error handling and robustness guidelines
This completes the foundation for Code Execution with MCP:
1. ✅ MCP code generation (TypeScript/Python wrappers)
2. ✅ Runtime bridge for VM environments
3. ✅ Code-first prompts for agents
4. 🔲 VM integration (next phase)
5. 🔲 End-to-end testing (next phase)
Expected token reduction: 98% for complex workflows1 parent 9dcddee commit bcf33a2
3 files changed
Lines changed: 481 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
0 commit comments