mcp-code-execution
Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.
What this skill does
## Table of Contents
- [Quick Start](#quick-start)
- [When to Use](#when-to-use)
- [Core Hub Responsibilities](#core-hub-responsibilities)
- [Required TodoWrite Items](#required-todowrite-items)
- [Step 1 – Assess Workflow](#step-1-assess-workflow-mcp-code-executionassess-workflow)
- [Workflow Classification](#workflow-classification)
- [MECW Risk Assessment](#mecw-risk-assessment)
- [Step 2 – Route to Modules](#step-2-route-to-modules-mcp-code-executionroute-to-modules)
- [Module Orchestration](#module-orchestration)
- [Step 3 – Coordinate MECW](#step-3-coordinate-mecw-mcp-code-executioncoordinate-mecw)
- [Cross-Module MECW Management](#cross-module-mecw-management)
- [Step 4 – Synthesize Results](#step-4-synthesize-results-mcp-code-executionsynthesize-results)
- [Result Integration](#result-integration)
- [Module Integration](#module-integration)
- [With Context Optimization Hub](#with-context-optimization-hub)
- [Performance Skills Integration](#performance-skills-integration)
- [Emergency Protocols](#emergency-protocols)
- [Hub-Level Emergency Response](#hub-level-emergency-response)
- [Success Metrics](#success-metrics)
# MCP Code Execution Hub
## Quick Start
This skill is an orchestration hub, not a CLI. It activates
inside a Claude Code session when one of the trigger keywords
below appears, or when invoked explicitly:
```
Skill(conserve:mcp-code-execution)
```
The hub then routes to the relevant sub-skill modules
(`mcp-subagents`, `mcp-patterns`, `mcp-validation`) based on
the detected workflow shape. There is no separate install
step or CLI entry point.
## When To Use
- **Automatic**: Keywords: `code execution`, `MCP`, `tool chain`, `data pipeline`, `MECW`
- **Tool Chains**: >3 tools chained sequentially
- **Data Processing**: Large datasets (>10k rows) or files (>50KB)
- **Context Pressure**: Current usage >25% of total window (proactive context management)
> **MCP Tool Search (Claude Code 2.1.7+)**: When MCP tool
> descriptions exceed 10% of context, tools are automatically
> deferred and discovered via MCPSearch instead of being loaded
> upfront. This reduces token overhead by ~85% but means tools
> must be discovered on-demand. Haiku models do not support tool
> search. Configure threshold with `ENABLE_TOOL_SEARCH=auto:N`
> where N is the percentage.
> **Subagent MCP Access Fix (Claude Code 2.1.30+)**: SDK-provided
> MCP tools are now properly synced to subagents. Prior to 2.1.30,
> subagents could not access SDK-provided MCP tools: workflows
> delegating MCP tool usage to subagents were silently broken. No
> workarounds needed on 2.1.30+.
> **Claude.ai MCP Connectors (Claude Code 2.1.46+)**: Users logged
> into Claude Code with a claude.ai account may have additional
> MCP tools auto-loaded from claude.ai/settings/connectors. These
> tools contribute to the tool search threshold count. If
> workflows unexpectedly trigger tool search or context inflation,
> check `/mcp` for claude.ai-sourced connectors. Known reliability
> issue: connectors can silently disappear (GitHub #21817).
> **MCP Prompt Cache Fix (Claude Code 2.1.70+)**: MCP servers with
> instructions connecting after the first turn no longer bust the
> prompt cache. Previously, a late-connecting MCP server would
> invalidate cached prompt prefixes, increasing token costs for
> the rest of the session. On 2.1.70+, prompt cache reuse is
> preserved regardless of when MCP servers connect.
> **ToolSearch Reliability Fix (Claude Code 2.1.70+)**: Empty
> model responses after ToolSearch are fixed. The server was
> rendering tool schemas with system-prompt-style tags that could
> confuse models into stopping early. ToolSearch-heavy workflows
> (many deferred MCP tools) are now more reliable.
## When NOT To Use
- Simple tool calls that don't chain
- Context pressure is low and tools are fast
## Core Hub Responsibilities
- Orchestrates MCP code execution workflow
- Routes to appropriate specialized modules
- Coordinates MECW compliance across submodules
- Manages token budget allocation for submodules
## Required TodoWrite Items
1. `mcp-code-execution:assess-workflow`
2. `mcp-code-execution:route-to-modules`
3. `mcp-code-execution:coordinate-mecw`
4. `mcp-code-execution:synthesize-results`
## Step 1 – Assess Workflow (`mcp-code-execution:assess-workflow`)
### Workflow Classification
```python
def classify_workflow_for_mecw(workflow):
"""Determine appropriate MCP modules and MECW strategy"""
if has_tool_chains(workflow) and workflow.complexity == 'high':
return {
'modules': ['mcp-subagents', 'mcp-patterns'],
'mecw_strategy': 'aggressive',
'token_budget': 600
}
elif workflow.data_size > '10k_rows':
return {
'modules': ['mcp-patterns', 'mcp-validation'],
'mecw_strategy': 'moderate',
'token_budget': 400
}
else:
return {
'modules': ['mcp-patterns'],
'mecw_strategy': 'conservative',
'token_budget': 200
}
```
### MECW Risk Assessment
Delegate to mcp-validation module for detailed risk analysis:
```python
def delegate_mecw_assessment(workflow):
return mcp_validation_assess_mecw_risk(
workflow,
hub_allocated_tokens=self.token_budget * 0.5
)
```
## Step 2 – Route to Modules (`mcp-code-execution:route-to-modules`)
### Module Orchestration
```python
class MCPExecutionHub:
def __init__(self):
self.modules = {
'mcp-subagents': MCPSubagentsModule(),
'mcp-patterns': MCPatternsModule(),
'mcp-validation': MCPValidationModule()
}
def execute_workflow(self, workflow, classification):
results = []
# Execute modules in optimal order
for module_name in classification['modules']:
module = self.modules[module_name]
result = module.execute(
workflow,
mecw_budget=classification['token_budget'] //
len(classification['modules'])
)
results.append(result)
return self.synthesize_results(results)
```
## Step 3 – Coordinate MECW (`mcp-code-execution:coordinate-mecw`)
### Cross-Module MECW Management
- Monitor total context usage across all modules
- Enforce 50% context rule globally
- Coordinate external state management
- Implement MECW emergency protocols
## Step 4 – Synthesize Results (`mcp-code-execution:synthesize-results`)
### Result Integration
```python
def synthesize_module_results(module_results):
"""Combine module results into a single status dict."""
return {
'status': 'completed',
'token_savings': calculate_savings(module_results),
'mecw_compliance': verify_mecw_rules(module_results),
'hallucination_risk': assess_hallucination_prevention(module_results),
'results': consolidate_results(module_results)
}
```
## Module Integration
### Available Modules
- See `modules/mcp-coordination.md` for cross-module orchestration
- See `modules/mcp-patterns.md` for common MCP execution patterns
- See `modules/mcp-subagents.md` for subagent delegation strategies
- See `modules/mcp-validation.md` for MECW compliance validation
### With Context Optimization Hub
- Receives high-level MECW strategy from context-optimization
- Returns detailed execution metrics and compliance data
- Coordinates token budget allocation
### Performance Skills Integration
- uses python-performance-optimization through mcp-patterns
- Aligns with cpu-gpu-performance for resource-aware execution
- validates optimizations maintain MECW compliance
## Emergency Protocols
### Hub-Level Emergency Response
When MECW limits exceeded:
1. Delegates immediately to mcp-validation for risk assessment
2. Route to mcp-subagents for further decomposition
3. Apply compression through mcp-patterns
4. Return minimal summary to preserve context
## Success Metrics
- **Workflow Success Rate**: >95% succeRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.