mcp-prompts-guide
Create powerful MCP prompts that guide AI interactions with templates, arguments, and context injection
What this skill does
You are an expert in creating MCP prompts using the rmcp crate, with knowledge of prompt design, template systems, and context management.
## Your Expertise
You guide developers on:
- Prompt design and templates
- Dynamic argument handling
- Context injection patterns
- Multi-turn conversations
- Prompt chaining
- Testing prompts
## What are MCP Prompts?
**Prompts** are predefined message templates that MCP servers provide to guide AI interactions. They help users start conversations with the right context and structure.
### Prompt Characteristics
- **Templated**: Use placeholders for dynamic values
- **Contextual**: Include relevant information
- **Actionable**: Guide toward specific tasks
- **Reusable**: Work across multiple conversations
- **Discoverable**: Listed for user selection
## Implementing Prompts
### Basic Prompt Structure
```rust
use rmcp::prelude::*;
use serde::{Deserialize, Serialize};
use schemars::JsonSchema;
#[derive(Clone)]
struct PromptService;
impl PromptService {
async fn list_prompts(&self) -> Vec<PromptInfo> {
vec![
PromptInfo {
name: "analyze_code".to_string(),
description: Some("Analyze code for issues and improvements".to_string()),
arguments: vec![
PromptArgument {
name: "language".to_string(),
description: Some("Programming language".to_string()),
required: true,
},
PromptArgument {
name: "focus".to_string(),
description: Some("Focus area (performance, security, style)".to_string()),
required: false,
},
],
},
]
}
async fn get_prompt(
&self,
name: &str,
arguments: HashMap<String, String>,
) -> Result<PromptResponse, Error> {
match name {
"analyze_code" => {
let language = arguments.get("language")
.ok_or_else(|| Error::MissingArgument("language".to_string()))?;
let focus = arguments.get("focus").map(|s| s.as_str()).unwrap_or("general");
let messages = vec![
PromptMessage {
role: Role::User,
content: format!(
"I need you to analyze {} code with a focus on {}. \
Please review the code carefully and provide:\n\
1. Issues found\n\
2. Recommendations\n\
3. Code examples for improvements",
language, focus
),
},
];
Ok(PromptResponse {
description: Some("Code analysis prompt".to_string()),
messages,
})
}
_ => Err(Error::PromptNotFound(name.to_string())),
}
}
}
```
## Prompt Design Patterns
### Pattern 1: Code Review Prompts
```rust
impl PromptService {
fn create_code_review_prompt(&self, args: &HashMap<String, String>) -> PromptResponse {
let language = args.get("language").map(|s| s.as_str()).unwrap_or("any");
let file_path = args.get("file_path");
let mut context = format!(
"You are an expert code reviewer for {} projects.\n\n",
language
);
if let Some(path) = file_path {
context.push_str(&format!("File: {}\n\n", path));
}
context.push_str(
"Please review the code for:\n\
- Bugs and logic errors\n\
- Performance issues\n\
- Security vulnerabilities\n\
- Code style and best practices\n\
- Test coverage gaps\n\n\
Provide specific line numbers and actionable recommendations."
);
PromptResponse {
description: Some("Comprehensive code review".to_string()),
messages: vec![
PromptMessage {
role: Role::User,
content: context,
},
],
}
}
}
```
### Pattern 2: Task-Specific Prompts
```rust
impl PromptService {
fn create_api_design_prompt(&self, args: &HashMap<String, String>) -> PromptResponse {
let api_type = args.get("api_type").map(|s| s.as_str()).unwrap_or("REST");
let domain = args.get("domain").map(|s| s.as_str()).unwrap_or("general");
PromptResponse {
description: Some(format!("Design {} API for {}", api_type, domain)),
messages: vec![
PromptMessage {
role: Role::System,
content: format!(
"You are an expert API architect specializing in {} APIs.",
api_type
),
},
PromptMessage {
role: Role::User,
content: format!(
"I need to design a {} API for a {} application.\n\n\
Please help me:\n\
1. Define the resource models\n\
2. Design the endpoints\n\
3. Specify request/response formats\n\
4. Consider authentication and authorization\n\
5. Plan for versioning and backwards compatibility\n\n\
Focus on best practices and industry standards.",
api_type, domain
),
},
],
}
}
}
```
### Pattern 3: Interactive Learning Prompts
```rust
impl PromptService {
fn create_learning_prompt(&self, args: &HashMap<String, String>) -> PromptResponse {
let topic = args.get("topic").ok_or(Error::MissingArgument("topic".to_string())).unwrap();
let level = args.get("level").map(|s| s.as_str()).unwrap_or("beginner");
PromptResponse {
description: Some(format!("Learn {} at {} level", topic, level)),
messages: vec![
PromptMessage {
role: Role::System,
content: format!(
"You are a patient and knowledgeable teacher of {}. \
Adapt your explanations to a {} level.",
topic, level
),
},
PromptMessage {
role: Role::User,
content: format!(
"I want to learn about {}. I'm at a {} level.\n\n\
Please:\n\
1. Start with the fundamentals\n\
2. Provide clear examples\n\
3. Build complexity gradually\n\
4. Check my understanding as we go\n\
5. Suggest exercises\n\n\
Let's begin!",
topic, level
),
},
],
}
}
}
```
### Pattern 4: Context-Rich Prompts
```rust
impl PromptService {
async fn create_project_prompt(
&self,
args: &HashMap<String, String>,
project_context: &ProjectContext,
) -> PromptResponse {
let task = args.get("task").unwrap();
let context = format!(
"# Project Context\n\n\
Project: {}\n\
Language: {}\n\
Framework: {}\n\
Dependencies: {}\n\n\
# Task\n\n\
{}\n\n\
# Guidelines\n\n\
- Follow the project's existing patterns\n\
- Maintain code style consistency\n\
- Update tests and documentation\n\
- Consider existing Related 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.