Coverage for mcp_bridge/tools/templates.py: 0%
10 statements
« prev ^ index » next coverage.py v7.10.1, created at 2026-01-10 00:20 -0500
« prev ^ index » next coverage.py v7.10.1, created at 2026-01-10 00:20 -0500
1"""
2Templates for stravinsky repository initialization.
3"""
5CLAUDE_MD_TEMPLATE = """## stravinsky MCP (Multi-Model Orchestration)
7Stravinsky provides multi-model AI orchestration with parallel agent execution.
9### Architecture
10- **Native Subagent**: Stravinsky orchestrator (.claude/agents/stravinsky.md) auto-delegates complex tasks
11- **MCP Tools**: agent_spawn, invoke_gemini, invoke_openai, LSP tools, code search
12- **Specialist Agents**: explore, dewey, frontend, delphi, multimodal, document_writer
14### Agent Tools (via MCP)
15- `agent_spawn(prompt, agent_type, description)` - Spawn background agent with full tool access
16- `agent_output(task_id, block)` - Get results (block=True to wait)
17- `agent_progress(task_id)` - Check real-time progress
18- `agent_list()` - Overview of all running agents
19- `agent_cancel(task_id)` - Stop a running agent
21### Agent Types
22- `explore` - Codebase search, structural analysis (Gemini 3 Flash)
23- `dewey` - Documentation research, web search (Gemini 3 Flash + Web)
24- `frontend` - UI/UX implementation (Gemini 3 Pro High)
25- `delphi` - Strategic advice, architecture review (GPT-5.2 Medium)
26- `multimodal` - Visual analysis, screenshots (Gemini 3 Flash Vision)
27- `document_writer` - Technical documentation (Gemini 3 Flash)
29### Parallel Execution (MANDATORY)
30For ANY task with 2+ independent steps:
311. **Immediately use agent_spawn** for each independent component
322. Fire all agents simultaneously in ONE response, don't wait
333. Monitor with agent_progress, collect with agent_output
35### Trigger Commands
36- **IRONSTAR** / **IRS**: Maximum parallel execution - spawn agents aggressively for every subtask
37- **ULTRATHINK**: Engage exhaustive deep reasoning, multi-dimensional analysis
38- **SEARCH**: Maximize search effort across codebase and external resources
39- **ANALYZE**: Deep analysis mode with delphi consultation for complex issues
41### Native Subagent Benefits
42- ✅ Auto-delegation (no manual /stravinsky invocation)
43- ✅ Context isolation (orchestrator runs as subagent)
44- ✅ Full MCP tool access (agent_spawn, invoke_gemini/openai, LSP, etc.)
45- ✅ Multi-model routing (Gemini for UI/research, GPT for strategy)
46"""
48COMMAND_STRAVINSKY = """---
49description: stravinsky Orchestrator - Parallel agent execution for complex workflows.
50---
52## CRITICAL: USE STRAVINSKY MCP TOOLS
54You MUST use the Stravinsky MCP server tools for ALL file reading, searching, and parallel work.
56### MANDATORY TOOL USAGE:
58**For ANY file reading or searching:**
59```
60stravinsky:agent_spawn(
61 prompt="Read and analyze [file path]. Return: [what you need]",
62 agent_type="explore",
63 description="Read [file]"
64)
65```
67**For documentation/library research:**
68```
69stravinsky:agent_spawn(
70 prompt="Find documentation for [topic]",
71 agent_type="dewey",
72 description="Research [topic]"
73)
74```
76**For 2+ independent tasks (ALWAYS parallel):**
77```
78// Fire ALL at once in ONE response - NEVER sequential
79stravinsky:agent_spawn(prompt="Task 1...", agent_type="explore", description="Task 1")
80stravinsky:agent_spawn(prompt="Task 2...", agent_type="explore", description="Task 2")
81stravinsky:agent_spawn(prompt="Task 3...", agent_type="dewey", description="Task 3")
82// Then immediately continue - don't wait
83```
85**To get results:**
86```
87stravinsky:agent_output(task_id="[id]", block=true)
88```
90### Recommended Tool Usage:
91- For file operations within agents: Use standard Read/Edit tools
92- For parallel agent spawning: Use stravinsky:agent_spawn (supports nesting, unlike native Task tool)
93- For collecting results: Use stravinsky:agent_output
94- For monitoring agents: Use stravinsky:agent_list
96### Native Subagent Integration:
97- Stravinsky orchestrator configured as native Claude Code subagent (.claude/agents/stravinsky.md)
98- Native subagents CAN call Stravinsky MCP tools (agent_spawn, invoke_gemini, etc.)
99- This enables auto-delegation without manual /stravinsky invocation
101### Execution Modes:
102- `ironstar` / `irs` - Maximum parallel execution (10+ agents)
103- `ultrathink` - Deep reasoning with delphi consultation
104- `search` - Exhaustive multi-agent search
106**Your FIRST action must be spawning agents, not using Read/Search tools.**
107"""
109COMMAND_PARALLEL = """---
110description: Execute a task with multiple parallel agents for speed.
111---
113Use the stravinsky MCP tools to execute this task with PARALLEL AGENTS.
115**MANDATORY:** For the following task items, spawn a SEPARATE `agent_spawn` call for EACH independent item. Do not work on them sequentially - fire all agents simultaneously:
117$ARGUMENTS
119After spawning all agents:
1201. Use `agent_list` to show running agents
1212. Use `agent_progress(task_id)` to monitor each
1223. Collect results with `agent_output(task_id, block=True)` when ready
123"""
125COMMAND_CONTEXT = """---
126description: Refresh project situational awareness (Git, Rules, Top Todos).
127---
129Call the `get_project_context` tool to retrieve the current Git branch, modified files, local project rules from `.claude/rules/`, and any pending `[ ]` todos in the current scope.
130"""
132COMMAND_HEALTH = """---
133description: Perform a comprehensive system health and dependency check.
134---
136Call the `get_system_health` tool to verify that all CLI dependencies (rg, fd, sg, tsc, etc.) are installed and that authentication for Gemini and OpenAI is active.
137"""
139COMMAND_DELPHI = """---
140description: Consult the delphi Strategic Advisor for architecture and hard debugging.
141---
143Use the `delphi` prompt to analyze the current problem. This triggers a GPT-based consulting phase focused on strategic reasoning, architectural trade-offs, and root-cause analysis for difficult bugs.
145**When to use delphi:**
146- Complex architecture design decisions
147- After 2+ failed fix attempts
148- Multi-system tradeoffs
149- Security/performance concerns
150- Unfamiliar code patterns
151"""
153COMMAND_LIST = """---
154description: List all active and recent background agent tasks.
155---
157Call the `agent_list` tool to see an overview of all currently running and completed background agents, including their Task IDs and statuses.
158"""
160COMMAND_DEWEY = """---
161description: Trigger dewey for documentation research and implementation examples.
162---
164Use the `dewey` prompt to find evidence and documentation for the topic at hand. dewey specializes in multi-repository search and official documentation retrieval.
166**When to use dewey:**
167- Unfamiliar npm/pip/cargo packages
168- "How do I use [library]?"
169- "What's the best practice for [framework feature]?"
170- Finding OSS implementation examples
171"""
173COMMAND_VERSION = """---
174description: Returns the current version and diagnostic info for stravinsky.
175---
177Display the stravinsky MCP version, registered hooks, available agents, and system health status.
178"""
180SLASH_COMMANDS = {
181 "stravinsky.md": COMMAND_STRAVINSKY,
182 "parallel.md": COMMAND_PARALLEL,
183 "list.md": COMMAND_LIST,
184 "context.md": COMMAND_CONTEXT,
185 "health.md": COMMAND_HEALTH,
186 "delphi.md": COMMAND_DELPHI,
187 "dewey.md": COMMAND_DEWEY,
188 "version.md": COMMAND_VERSION,
189}