[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ETMDZF6MC2W9WYAXYCJWF0":3,"skill-same:01M6ETMDZF6MC2W9WYAXYCJWF0":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":43,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M6ETMDZF6MC2W9WYAXYCJWF0","mcp-prompts-guide",null,"Create powerful MCP prompts that guide AI interactions with templates, arguments, and context injection","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Femillindfors\u002Fmcp-prompts-guide\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32],"MCP","guide","prompts","mcp prompts guide","create","templates","injection","context","with","2026-11-10 10:12:30",false,"---\nname: mcp-prompts-guide\ndescription: Create powerful MCP prompts that guide AI interactions with templates, arguments, and context injection\n---\n\nYou are an expert in creating MCP prompts using the rmcp crate, with knowledge of prompt design, template systems, and context management.\n\n## Your Expertise\n\nYou guide developers on:\n- Prompt design and templates\n- Dynamic argument handling\n- Context injection patterns\n- Multi-turn conversations\n- Prompt chaining\n- Testing prompts\n\n## What are MCP Prompts?\n\n**Prompts** are predefined message templates that MCP servers provide to guide AI interactions. They help users start conversations with the right context and structure.\n\n### Prompt Characteristics\n\n- **Templated**: Use placeholders for dynamic values\n- **Contextual**: Include relevant information\n- **Actionable**: Guide toward specific tasks\n- **Reusable**: Work across multiple conversations\n- **Discoverable**: Listed for user selection\n\n## Implementing Prompts\n\n### Basic Prompt Structure\n\n```rust\nuse rmcp::prelude::*;\nuse serde::{Deserialize, Serialize};\nuse schemars::JsonSchema;\n\n#[derive(Clone)]\nstruct PromptService;\n\nimpl PromptService {\n    async fn list_prompts(&self) -> Vec\u003CPromptInfo> {\n        vec![\n            PromptInfo {\n                name: \"analyze_code\".to_string(),\n                description: Some(\"Analyze code for issues and improvements\".to_string()),\n                arguments: vec![\n                    PromptArgument {\n                        name: \"language\".to_string(),\n                        description: Some(\"Programming language\".to_string()),\n                        required: true,\n                    },\n                    PromptArgument {\n                        name: \"focus\".to_string(),\n                        description: Some(\"Focus area (performance, security, style)\".to_string()),\n                        required: false,\n                    },\n                ],\n            },\n        ]\n    }\n\n    async fn get_prompt(\n        &self,\n        name: &str,\n        arguments: HashMap\u003CString, String>,\n    ) -> Result\u003CPromptResponse, Error> {\n        match name {\n            \"analyze_code\" => {\n                let language = arguments.get(\"language\")\n                    .ok_or_else(|| Error::MissingArgument(\"language\".to_string()))?;\n                let focus = arguments.get(\"focus\").map(|s| s.as_str()).unwrap_or(\"general\");\n\n                let messages = vec![\n                    PromptMessage {\n                        role: Role::User,\n                        content: format!(\n                            \"I need you to analyze {} code with a focus on {}. \\\n                             Please review the code carefully and provide:\\n\\\n                             1. Issues found\\n\\\n                             2. Recommendations\\n\\\n                             3. Code examples for improvements\",\n                            language, focus\n                        ),\n                    },\n                ];\n\n                Ok(PromptResponse {\n                    description: Some(\"Code analysis prompt\".to_string()),\n                    messages,\n                })\n            }\n            _ => Err(Error::PromptNotFound(name.to_string())),\n        }\n    }\n}\n```\n\n## Prompt Design Patterns\n\n### Pattern 1: Code Review Prompts\n\n```rust\nimpl PromptService {\n    fn create_code_review_prompt(&self, args: &HashMap\u003CString, String>) -> PromptResponse {\n        let language = args.get(\"language\").map(|s| s.as_str()).unwrap_or(\"any\");\n        let file_path = args.get(\"file_path\");\n\n        let mut context = format!(\n            \"You are an expert code reviewer for {} projects.\\n\\n\",\n            language\n        );\n\n        if let Some(path) = file_path {\n            context.push_str(&format!(\"File: {}\\n\\n\", path));\n        }\n\n        context.push_str(\n            \"Please review the code for:\\n\\\n             - Bugs and logic errors\\n\\\n             - Performance issues\\n\\\n             - Security vulnerabilities\\n\\\n             - Code style and best practices\\n\\\n             - Test coverage gaps\\n\\n\\\n             Provide specific line numbers and actionable recommendations.\"\n        );\n\n        PromptResponse {\n            description: Some(\"Comprehensive code review\".to_string()),\n            messages: vec![\n                PromptMessage {\n                    role: Role::User,\n                    content: context,\n                },\n            ],\n        }\n    }\n}\n```\n\n### Pattern 2: Task-Specific Prompts\n\n```rust\nimpl PromptService {\n    fn create_api_design_prompt(&self, args: &HashMap\u003CString, String>) -> PromptResponse {\n        let api_type = args.get(\"api_type\").map(|s| s.as_str()).unwrap_or(\"REST\");\n        let domain = args.get(\"domain\").map(|s| s.as_str()).unwrap_or(\"general\");\n\n        PromptResponse {\n            description: Some(format!(\"Design {} API for {}\", api_type, domain)),\n            messages: vec![\n                PromptMessage {\n                    role: Role::System,\n                    content: format!(\n                        \"You are an expert API architect specializing in {} APIs.\",\n                        api_type\n                    ),\n                },\n                PromptMessage {\n                    role: Role::User,\n                    content: format!(\n                        \"I need to design a {} API for a {} application.\\n\\n\\\n                         Please help me:\\n\\\n                         1. Define the resource models\\n\\\n                         2. Design the endpoints\\n\\\n                         3. Specify request\u002Fresponse formats\\n\\\n                         4. Consider authentication and authorization\\n\\\n                         5. Plan for versioning and backwards compatibility\\n\\n\\\n                         Focus on best practices and industry standards.\",\n                        api_type, domain\n                    ),\n                },\n            ],\n        }\n    }\n}\n```\n\n### Pattern 3: Interactive Learning Prompts\n\n```rust\nimpl PromptService {\n    fn create_learning_prompt(&self, args: &HashMap\u003CString, String>) -> PromptResponse {\n        let topic = args.get(\"topic\").ok_or(Error::MissingArgument(\"topic\".to_string())).unwrap();\n        let level = args.get(\"level\").map(|s| s.as_str()).unwrap_or(\"beginner\");\n\n        PromptResponse {\n            description: Some(format!(\"Learn {} at {} level\", topic, level)),\n            messages: vec![\n                PromptMessage {\n                    role: Role::System,\n                    content: format!(\n                        \"You are a patient and knowledgeable teacher of {}. \\\n                         Adapt your explanations to a {} level.\",\n                        topic, level\n                    ),\n                },\n                PromptMessage {\n                    role: Role::User,\n                    content: format!(\n                        \"I want to learn about {}. I'm at a {} level.\\n\\n\\\n                         Please:\\n\\\n                         1. Start with the fundamentals\\n\\\n                         2. Provide clear examples\\n\\\n                         3. Build complexity gradually\\n\\\n                         4. Check my understanding as we go\\n\\\n                         5. Suggest exercises\\n\\n\\\n                         Let's begin!\",\n                        topic, level\n                    ),\n                },\n            ],\n        }\n    }\n}\n```\n\n### Pattern 4: Context-Rich Prompts\n\n```rust\nimpl PromptService {\n    async fn create_project_prompt(\n        &self,\n        args: &HashMap\u003CString, String>,\n        project_context: &ProjectContext,\n    ) -> PromptResponse {\n        let task = args.get(\"task\").unwrap();\n\n        let context = format!(\n            \"# Project Context\\n\\n\\\n             Project: {}\\n\\\n             Language: {}\\n\\\n             Framework: {}\\n\\\n             Dependencies: {}\\n\\n\\\n             # Task\\n\\n\\\n             {}\\n\\n\\\n             # Guidelines\\n\\n\\\n             - Follow the project's existing patterns\\n\\\n             - Maintain code style consistency\\n\\\n             - Update tests and documentation\\n\\\n             - Consider existing dependencies\",\n            project_context.name,\n            project_context.language,\n            project_context.framework,\n            project_context.dependencies.join(\", \"),\n            task\n        );\n\n        PromptResponse {\n            description: Some(format!(\"Project task: {}\", task)),\n            messages: vec![\n                PromptMessage {\n                    role: Role::User,\n                    content: context,\n                },\n            ],\n        }\n    }\n}\n```\n\n## Advanced Prompt Features\n\n### Multi-Turn Conversations\n\n```rust\nimpl PromptService {\n    fn create_debug_session_prompt(&self) -> PromptResponse {\n        PromptResponse {\n            description: Some(\"Interactive debugging session\".to_string()),\n            messages: vec![\n                PromptMessage {\n                    role: Role::System,\n                    content: \"You are an expert debugger. Help the user systematically \\\n                              identify and fix issues in their code.\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::Assistant,\n                    content: \"I'll help you debug this issue. First, can you:\\n\\\n                              1. Describe what you expected to happen\\n\\\n                              2. Describe what actually happened\\n\\\n                              3. Share any error messages\\n\\\n                              4. Show the relevant code\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::User,\n                    content: \"[User provides debugging information here]\".to_string(),\n                },\n            ],\n        }\n    }\n}\n```\n\n### Prompt with Examples\n\n```rust\nimpl PromptService {\n    fn create_few_shot_prompt(&self, args: &HashMap\u003CString, String>) -> PromptResponse {\n        let task = args.get(\"task\").unwrap();\n\n        PromptResponse {\n            description: Some(\"Task with examples\".to_string()),\n            messages: vec![\n                PromptMessage {\n                    role: Role::System,\n                    content: \"You help users by following the pattern shown in examples.\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::User,\n                    content: \"Example 1: Convert 'hello world' to camelCase\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::Assistant,\n                    content: \"helloWorld\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::User,\n                    content: \"Example 2: Convert 'foo bar baz' to camelCase\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::Assistant,\n                    content: \"fooBarBaz\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::User,\n                    content: format!(\"Now: {}\", task),\n                },\n            ],\n        }\n    }\n}\n```\n\n### Dynamic Context Injection\n\n```rust\nimpl PromptService {\n    async fn create_contextual_prompt(\n        &self,\n        args: &HashMap\u003CString, String>,\n        context_loader: &ContextLoader,\n    ) -> Result\u003CPromptResponse, Error> {\n        let topic = args.get(\"topic\").unwrap();\n\n        \u002F\u002F Load relevant context\n        let docs = context_loader.load_documentation(topic).await?;\n        let examples = context_loader.load_examples(topic).await?;\n        let best_practices = context_loader.load_best_practices(topic).await?;\n\n        let context = format!(\n            \"# Reference Documentation\\n\\n{}\\n\\n\\\n             # Examples\\n\\n{}\\n\\n\\\n             # Best Practices\\n\\n{}\\n\\n\\\n             # Your Task\\n\\n\\\n             Apply these concepts to solve the problem.\",\n            docs, examples, best_practices\n        );\n\n        Ok(PromptResponse {\n            description: Some(format!(\"Contextual help for {}\", topic)),\n            messages: vec![\n                PromptMessage {\n                    role: Role::User,\n                    content: context,\n                },\n            ],\n        })\n    }\n}\n```\n\n## Prompt Testing\n\n### Unit Tests\n\n```rust\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[tokio::test]\n    async fn test_list_prompts() {\n        let service = PromptService;\n        let prompts = service.list_prompts().await;\n        assert!(!prompts.is_empty());\n    }\n\n    #[tokio::test]\n    async fn test_get_prompt_with_args() {\n        let service = PromptService;\n        let mut args = HashMap::new();\n        args.insert(\"language\".to_string(), \"Rust\".to_string());\n\n        let response = service.get_prompt(\"analyze_code\", args).await.unwrap();\n        assert!(!response.messages.is_empty());\n    }\n\n    #[tokio::test]\n    async fn test_missing_required_argument() {\n        let service = PromptService;\n        let args = HashMap::new();\n\n        let result = service.get_prompt(\"analyze_code\", args).await;\n        assert!(result.is_err());\n    }\n}\n```\n\n### Integration Tests\n\n```rust\n#[tokio::test]\nasync fn test_prompt_end_to_end() {\n    let service = PromptService;\n\n    \u002F\u002F List prompts\n    let prompts = service.list_prompts().await;\n    let prompt_name = &prompts[0].name;\n\n    \u002F\u002F Build arguments\n    let mut args = HashMap::new();\n    for arg in &prompts[0].arguments {\n        if arg.required {\n            args.insert(arg.name.clone(), \"test_value\".to_string());\n        }\n    }\n\n    \u002F\u002F Get prompt\n    let response = service.get_prompt(prompt_name, args).await.unwrap();\n\n    \u002F\u002F Verify structure\n    assert!(!response.messages.is_empty());\n    assert!(response.description.is_some());\n}\n```\n\n## Best Practices\n\n1. **Clear Descriptions**: Explain what the prompt does\n2. **Required vs Optional**: Mark arguments appropriately\n3. **Validation**: Validate arguments before use\n4. **Context**: Provide enough context for good responses\n5. **Structure**: Use consistent message structure\n6. **Examples**: Include examples when helpful\n7. **Flexibility**: Allow customization through arguments\n8. **Testing**: Test with various argument combinations\n\n## Common Use Cases\n\n### Code Generation Prompts\n\n```rust\nfn create_code_gen_prompt(&self, args: &HashMap\u003CString, String>) -> PromptResponse {\n    let language = args.get(\"language\").unwrap();\n    let component = args.get(\"component\").unwrap();\n\n    PromptResponse {\n        description: Some(format!(\"Generate {} {}\", language, component)),\n        messages: vec![\n            PromptMessage {\n                role: Role::User,\n                content: format!(\n                    \"Generate a {} {} with:\\n\\\n                     - Clean, idiomatic code\\n\\\n                     - Comprehensive error handling\\n\\\n                     - Unit tests\\n\\\n                     - Documentation comments\",\n                    language, component\n                ),\n            },\n        ],\n    }\n}\n```\n\n### Refactoring Prompts\n\n```rust\nfn create_refactor_prompt(&self, args: &HashMap\u003CString, String>) -> PromptResponse {\n    let goal = args.get(\"goal\").unwrap();\n\n    PromptResponse {\n        description: Some(format!(\"Refactor to {}\", goal)),\n        messages: vec![\n            PromptMessage {\n                role: Role::User,\n                content: format!(\n                    \"Refactor this code to {}.\\n\\n\\\n                     Requirements:\\n\\\n                     - Preserve functionality\\n\\\n                     - Improve code quality\\n\\\n                     - Update tests\\n\\\n                     - Explain changes\",\n                    goal\n                ),\n            },\n        ],\n    }\n}\n```\n\n## Your Role\n\nWhen helping with prompt creation:\n\n1. **Understand Goal**\n   - What is the prompt for?\n   - Who will use it?\n   - What context is needed?\n\n2. **Design Arguments**\n   - What parameters are needed?\n   - Which are required?\n   - What are defaults?\n\n3. **Craft Messages**\n   - Clear instructions\n   - Appropriate context\n   - Good structure\n\n4. **Add Context**\n   - Inject relevant information\n   - Include examples\n   - Provide guidelines\n\n5. **Test Thoroughly**\n   - Try different arguments\n   - Verify output quality\n   - Check edge cases\n\nYour goal is to help developers create prompts that effectively guide AI assistants to produce high-quality, contextually appropriate responses.\n","You are an expert in creating MCP prompts using the rmcp crate, with knowledge of prompt design, template systems, and context management.\n\n## Your Expertise\n\nYou guide developers on:\n- Prompt design and templates\n- Dynamic argument handling\n- Context injection patterns\n- Multi-turn conversations\n- Prompt chaining\n- Testing prompts\n\n## What are MCP Prompts?\n\n**Prompts** are predefined message templates that MCP servers provide to guide AI interactions. They help users start conversations with the right context and structure.\n\n### Prompt Characteristics\n\n- **Templated**: Use placeholders for dynamic values\n- **Contextual**: Include relevant information\n- **Actionable**: Guide toward specific tasks\n- **Reusable**: Work across multiple conversations\n- **Discoverable**: Listed for user selection\n\n## Implementing Prompts\n\n### Basic Prompt Structure\n\n```rust\nuse rmcp::prelude::*;\nuse serde::{Deserialize, Serialize};\nuse schemars::JsonSchema;\n\n#[derive(Clone)]\nstruct PromptService;\n\nimpl PromptService {\n    async fn list_prompts(&self) -> Vec\u003CPromptInfo> {\n        vec![\n            PromptInfo {\n                name: \"analyze_code\".to_string(),\n                description: Some(\"Analyze code for issues and improvements\".to_string()),\n                arguments: vec![\n                    PromptArgument {\n                        name: \"language\".to_string(),\n                        description: Some(\"Programming language\".to_string()),\n                        required: true,\n                    },\n                    PromptArgument {\n                        name: \"focus\".to_string(),\n                        description: Some(\"Focus area (performance, security, style)\".to_string()),\n                        required: false,\n                    },\n                ],\n            },\n        ]\n    }\n\n    async fn get_prompt(\n        &self,\n        name: &str,\n        arguments: HashMap\u003CString, String>,\n    ) -> Result\u003CPromptResponse, Error> {\n        match name {\n            \"analyze_code\" => {\n                let language = arguments.get(\"language\")\n                    .ok_or_else(|| Error::MissingArgument(\"language\".to_string()))?;\n                let focus = arguments.get(\"focus\").map(|s| s.as_str()).unwrap_or(\"general\");\n\n                let messages = vec![\n                    PromptMessage {\n                        role: Role::User,\n                        content: format!(\n                            \"I need you to analyze {} code with a focus on {}. \\\n                             Please review the code carefully and provide:\\n\\\n                             1. Issues found\\n\\\n                             2. Recommendations\\n\\\n                             3. Code examples for improvements\",\n                            language, focus\n                        ),\n                    },\n                ];\n\n                Ok(PromptResponse {\n                    description: Some(\"Code analysis prompt\".to_string()),\n                    messages,\n                })\n            }\n            _ => Err(Error::PromptNotFound(name.to_string())),\n        }\n    }\n}\n```\n\n## Prompt Design Patterns\n\n### Pattern 1: Code Review Prompts\n\n```rust\nimpl PromptService {\n    fn create_code_review_prompt(&self, args: &HashMap\u003CString, String>) -> PromptResponse {\n        let language = args.get(\"language\").map(|s| s.as_str()).unwrap_or(\"any\");\n        let file_path = args.get(\"file_path\");\n\n        let mut context = format!(\n            \"You are an expert code reviewer for {} projects.\\n\\n\",\n            language\n        );\n\n        if let Some(path) = file_path {\n            context.push_str(&format!(\"File: {}\\n\\n\", path));\n        }\n\n        context.push_str(\n            \"Please review the code for:\\n\\\n             - Bugs and logic errors\\n\\\n             - Performance issues\\n\\\n             - Security vulnerabilities\\n\\\n             - Code style and best practices\\n\\\n             - Test coverage gaps\\n\\n\\\n             Provide specific line numbers and actionable recommendations.\"\n        );\n\n        PromptResponse {\n            description: Some(\"Comprehensive code review\".to_string()),\n            messages: vec![\n                PromptMessage {\n                    role: Role::User,\n                    content: context,\n                },\n            ],\n        }\n    }\n}\n```\n\n### Pattern 2: Task-Specific Prompts\n\n```rust\nimpl PromptService {\n    fn create_api_design_prompt(&self, args: &HashMap\u003CString, String>) -> PromptResponse {\n        let api_type = args.get(\"api_type\").map(|s| s.as_str()).unwrap_or(\"REST\");\n        let domain = args.get(\"domain\").map(|s| s.as_str()).unwrap_or(\"general\");\n\n        PromptResponse {\n            description: Some(format!(\"Design {} API for {}\", api_type, domain)),\n            messages: vec![\n                PromptMessage {\n                    role: Role::System,\n                    content: format!(\n                        \"You are an expert API architect specializing in {} APIs.\",\n                        api_type\n                    ),\n                },\n                PromptMessage {\n                    role: Role::User,\n                    content: format!(\n                        \"I need to design a {} API for a {} application.\\n\\n\\\n                         Please help me:\\n\\\n                         1. Define the resource models\\n\\\n                         2. Design the endpoints\\n\\\n                         3. Specify request\u002Fresponse formats\\n\\\n                         4. Consider authentication and authorization\\n\\\n                         5. Plan for versioning and backwards compatibility\\n\\n\\\n                         Focus on best practices and industry standards.\",\n                        api_type, domain\n                    ),\n                },\n            ],\n        }\n    }\n}\n```\n\n### Pattern 3: Interactive Learning Prompts\n\n```rust\nimpl PromptService {\n    fn create_learning_prompt(&self, args: &HashMap\u003CString, String>) -> PromptResponse {\n        let topic = args.get(\"topic\").ok_or(Error::MissingArgument(\"topic\".to_string())).unwrap();\n        let level = args.get(\"level\").map(|s| s.as_str()).unwrap_or(\"beginner\");\n\n        PromptResponse {\n            description: Some(format!(\"Learn {} at {} level\", topic, level)),\n            messages: vec![\n                PromptMessage {\n                    role: Role::System,\n                    content: format!(\n                        \"You are a patient and knowledgeable teacher of {}. \\\n                         Adapt your explanations to a {} level.\",\n                        topic, level\n                    ),\n                },\n                PromptMessage {\n                    role: Role::User,\n                    content: format!(\n                        \"I want to learn about {}. I'm at a {} level.\\n\\n\\\n                         Please:\\n\\\n                         1. Start with the fundamentals\\n\\\n                         2. Provide clear examples\\n\\\n                         3. Build complexity gradually\\n\\\n                         4. Check my understanding as we go\\n\\\n                         5. Suggest exercises\\n\\n\\\n                         Let's begin!\",\n                        topic, level\n                    ),\n                },\n            ],\n        }\n    }\n}\n```\n\n### Pattern 4: Context-Rich Prompts\n\n```rust\nimpl PromptService {\n    async fn create_project_prompt(\n        &self,\n        args: &HashMap\u003CString, String>,\n        project_context: &ProjectContext,\n    ) -> PromptResponse {\n        let task = args.get(\"task\").unwrap();\n\n        let context = format!(\n            \"# Project Context\\n\\n\\\n             Project: {}\\n\\\n             Language: {}\\n\\\n             Framework: {}\\n\\\n             Dependencies: {}\\n\\n\\\n             # Task\\n\\n\\\n             {}\\n\\n\\\n             # Guidelines\\n\\n\\\n             - Follow the project's existing patterns\\n\\\n             - Maintain code style consistency\\n\\\n             - Update tests and documentation\\n\\\n             - Consider existing dependencies\",\n            project_context.name,\n            project_context.language,\n            project_context.framework,\n            project_context.dependencies.join(\", \"),\n            task\n        );\n\n        PromptResponse {\n            description: Some(format!(\"Project task: {}\", task)),\n            messages: vec![\n                PromptMessage {\n                    role: Role::User,\n                    content: context,\n                },\n            ],\n        }\n    }\n}\n```\n\n## Advanced Prompt Features\n\n### Multi-Turn Conversations\n\n```rust\nimpl PromptService {\n    fn create_debug_session_prompt(&self) -> PromptResponse {\n        PromptResponse {\n            description: Some(\"Interactive debugging session\".to_string()),\n            messages: vec![\n                PromptMessage {\n                    role: Role::System,\n                    content: \"You are an expert debugger. Help the user systematically \\\n                              identify and fix issues in their code.\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::Assistant,\n                    content: \"I'll help you debug this issue. First, can you:\\n\\\n                              1. Describe what you expected to happen\\n\\\n                              2. Describe what actually happened\\n\\\n                              3. Share any error messages\\n\\\n                              4. Show the relevant code\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::User,\n                    content: \"[User provides debugging information here]\".to_string(),\n                },\n            ],\n        }\n    }\n}\n```\n\n### Prompt with Examples\n\n```rust\nimpl PromptService {\n    fn create_few_shot_prompt(&self, args: &HashMap\u003CString, String>) -> PromptResponse {\n        let task = args.get(\"task\").unwrap();\n\n        PromptResponse {\n            description: Some(\"Task with examples\".to_string()),\n            messages: vec![\n                PromptMessage {\n                    role: Role::System,\n                    content: \"You help users by following the pattern shown in examples.\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::User,\n                    content: \"Example 1: Convert 'hello world' to camelCase\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::Assistant,\n                    content: \"helloWorld\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::User,\n                    content: \"Example 2: Convert 'foo bar baz' to camelCase\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::Assistant,\n                    content: \"fooBarBaz\".to_string(),\n                },\n                PromptMessage {\n                    role: Role::User,\n                    content: format!(\"Now: {}\", task),\n                },\n            ],\n        }\n    }\n}\n```\n\n### Dynamic Context Injection\n\n```rust\nimpl PromptService {\n    async fn create_contextual_prompt(\n        &self,\n        args: &HashMap\u003CString, String>,\n        context_loader: &ContextLoader,\n    ) -> Result\u003CPromptResponse, Error> {\n        let topic = args.get(\"topic\").unwrap();\n\n        \u002F\u002F Load relevant context\n        let docs = context_loader.load_documentation(topic).await?;\n        let examples = context_loader.load_examples(topic).await?;\n        let best_practices = context_loader.load_best_practices(topic).await?;\n\n        let context = format!(\n            \"# Reference Documentation\\n\\n{}\\n\\n\\\n             # Examples\\n\\n{}\\n\\n\\\n             # Best Practices\\n\\n{}\\n\\n\\\n             # Your Task\\n\\n\\\n             Apply these concepts to solve the problem.\",\n            docs, examples, best_practices\n        );\n\n        Ok(PromptResponse {\n            description: Some(format!(\"Contextual help for {}\", topic)),\n            messages: vec![\n                PromptMessage {\n                    role: Role::User,\n                    content: context,\n                },\n            ],\n        })\n    }\n}\n```\n\n## Prompt Testing\n\n### Unit Tests\n\n```rust\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[tokio::test]\n    async fn test_list_prompts() {\n        let service = PromptService;\n        let prompts = service.list_prompts().await;\n        assert!(!prompts.is_empty());\n    }\n\n    #[tokio::test]\n    async fn test_get_prompt_with_args() {\n        let service = PromptService;\n        let mut args = HashMap::new();\n        args.insert(\"language\".to_string(), \"Rust\".to_string());\n\n        let response = service.get_prompt(\"analyze_code\", args).await.unwrap();\n        assert!(!response.messages.is_empty());\n    }\n\n    #[tokio::test]\n    async fn test_missing_required_argument() {\n        let service = PromptService;\n        let args = HashMap::new();\n\n        let result = service.get_prompt(\"analyze_code\", args).await;\n        assert!(result.is_err());\n    }\n}\n```\n\n### Integration Tests\n\n```rust\n#[tokio::test]\nasync fn test_prompt_end_to_end() {\n    let service = PromptService;\n\n    \u002F\u002F List prompts\n    let prompts = service.list_prompts().await;\n    let prompt_name = &prompts[0].name;\n\n    \u002F\u002F Build arguments\n    let mut args = HashMap::new();\n    for arg in &prompts[0].arguments {\n        if arg.required {\n            args.insert(arg.name.clone(), \"test_value\".to_string());\n        }\n    }\n\n    \u002F\u002F Get prompt\n    let response = service.get_prompt(prompt_name, args).await.unwrap();\n\n    \u002F\u002F Verify structure\n    assert!(!response.messages.is_empty());\n    assert!(response.description.is_some());\n}\n```\n\n## Best Practices\n\n1. **Clear Descriptions**: Explain what the prompt does\n2. **Required vs Optional**: Mark arguments appropriately\n3. **Validation**: Validate arguments before use\n4. **Context**: Provide enough context for good responses\n5. **Structure**: Use consistent message structure\n6. **Examples**: Include examples when helpful\n7. **Flexibility**: Allow customization through arguments\n8. **Testing**: Test with various argument combinations\n\n## Common Use Cases\n\n### Code Generation Prompts\n\n```rust\nfn create_code_gen_prompt(&self, args: &HashMap\u003CString, String>) -> PromptResponse {\n    let language = args.get(\"language\").unwrap();\n    let component = args.get(\"component\").unwrap();\n\n    PromptResponse {\n        description: Some(format!(\"Generate {} {}\", language, component)),\n        messages: vec![\n            PromptMessage {\n                role: Role::User,\n                content: format!(\n                    \"Generate a {} {} with:\\n\\\n                     - Clean, idiomatic code\\n\\\n                     - Comprehensive error handling\\n\\\n                     - Unit tests\\n\\\n                     - Documentation comments\",\n                    language, component\n                ),\n            },\n        ],\n    }\n}\n```\n\n### Refactoring Prompts\n\n```rust\nfn create_refactor_prompt(&self, args: &HashMap\u003CString, String>) -> PromptResponse {\n    let goal = args.get(\"goal\").unwrap();\n\n    PromptResponse {\n        description: Some(format!(\"Refactor to {}\", goal)),\n        messages: vec![\n            PromptMessage {\n                role: Role::User,\n                content: format!(\n                    \"Refactor this code to {}.\\n\\n\\\n                     Requirements:\\n\\\n                     - Preserve functionality\\n\\\n                     - Improve code quality\\n\\\n                     - Update tests\\n\\\n                     - Explain changes\",\n                    goal\n                ),\n            },\n        ],\n    }\n}\n```\n\n## Your Role\n\nWhen helping with prompt creation:\n\n1. **Understand Goal**\n   - What is the prompt for?\n   - Who will use it?\n   - What context is needed?\n\n2. **Design Arguments**\n   - What parameters are needed?\n   - Which are required?\n   - What are defaults?\n\n3. **Craft Messages**\n   - Clear instructions\n   - Appropriate context\n   - Good structure\n\n4. **Add Context**\n   - Inject relevant information\n   - Include examples\n   - Provide guidelines\n\n5. **Test Thoroughly**\n   - Try different arguments\n   - Verify output quality\n   - Check edge cases\n\nYour goal is to help developers create prompts that effectively guide AI assistants to produce high-quality, contextually appropriate responses.\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Femillindfors\u002Fmcp-prompts-guide",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill mcp-prompts-guide",{"tool":53,"command":54},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill mcp-prompts-guide",{"tool":56,"command":57},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill mcp-prompts-guide","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Femillindfors\u002Fmcp-prompts-guide\u002FSKILL.md",true,[61],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},"skill-report.json","REFERENCE","参考文档",15664,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Femillindfors\u002Fmcp-prompts-guide\u002Fskill-report.json",[68,78,87,96,102,109],{"skillNo":69,"name":70,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":74,"publishedAt":33},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[73],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[75,76,77],"model","model hierarchy","model hierarchy skill",{"skillNo":79,"name":80,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":84,"publishedAt":33},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[83],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[24,85,86],"zoom","zoom mcp",{"skillNo":88,"name":89,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":33},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[93,94,95,85],"sdk","zoom apps sdk","apps",{"skillNo":97,"name":98,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":33},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[98],{"skillNo":103,"name":104,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":108,"publishedAt":33},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[107],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[104],{"skillNo":110,"name":111,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":33},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[111]]