diff --git a/docs/prompts/mcp-consumer-repo-shim/PROMPT.md b/docs/prompts/mcp-consumer-repo-shim/PROMPT.md new file mode 100644 index 0000000..0c84923 --- /dev/null +++ b/docs/prompts/mcp-consumer-repo-shim/PROMPT.md @@ -0,0 +1,111 @@ +--- +name: mcp-consumer-repo-shim +description: Create one repository-specific thin shim instruction file that binds a file scope to a user-selected Personal MCP skill resource and enforces resource-first Copilot retrieval behavior. +x-personal-mcp: + id: mcp-consumer-repo-shim + version: 1.0.0 + tags: + - copilot + - mcp + - instructions + - shims + - prompts + capabilities: + - resource://prompts/mcp-consumer-repo-shim/document + arguments: + apply_to_glob: + description: File glob scope for the shim applyTo field, such as tests/** or **/*.md. + required: true + primary_skill_resource: + description: Primary skill resource URI, usually resource://skills//document. + required: true + shim_title: + description: Human-readable name for the instruction shim frontmatter. + required: false + companion_docs_page: + description: Optional relative docs link for human-facing companion guidance. + required: false +--- + +# MCP Consumer Repository Shim + +Use this prompt to generate exactly one repository-scoped Copilot instruction shim for an MCP consumer repository. + +## Inputs + +- Required: + - apply_to_glob + - primary_skill_resource +- Optional: + - shim_title + - companion_docs_page + +## Required References + +Load only sections relevant to the requested shim: + +1. Thin shim pattern and scope guidance: [Skill Usage Mechanics](../../usage.md) +2. VS Code Copilot MCP behavior and fallback mechanics: [Copilot MCP Mechanics](../../copilot.md) +3. Authoring workflow and validation checklist: [Authoring Guide](../../authoring.md) +4. Instruction metadata expectations and examples: [Copilot customization skill](../../skills/copilot-customization/SKILL.md) + +## Workflow + +1. Validate that apply_to_glob and primary_skill_resource are present. +2. If either value is missing or ambiguous, ask exactly one clarifying question before generating output. +3. Generate one .instructions.md file content block only. +4. Keep the shim concise and deterministic: + - include YAML frontmatter with name, description, and applyTo + - include a primary rule that uses the selected primary_skill_resource first + - include a bounded execution pattern (load primary doc, apply only relevant sections, keep edits minimal) +5. Include VS Code/Copilot integration mechanics in the shim body: + - prefer MCP resource attachment when available + - if attachment is unavailable, use tool fallback order: + 1. list_resources + 2. read_resource + 3. search_patterns + 4. get_pattern_by_id + 5. get_skill_document_by_id + - ask one clarifying question when confidence is low +6. If companion_docs_page is provided, include it as a companion docs link line. +7. Do not generate additional files, code changes, or batch shim packs. + +## Output Format + +Return exactly: + +1. Suggested file path line under .github/instructions/. +2. One fenced markdown block containing the full .instructions.md content. +3. A brief note (max 3 lines) describing what the shim routes and why. + +## Output Template + +````md +Path: .github/instructions/.instructions.md + +```md +--- +name: +description: Route edits to the Personal MCP resource. +applyTo: '' +--- + +When editing files matching , use as the primary guidance source. + +Execution pattern: + +1. Load the primary skill document first. +2. Apply only sections relevant to the file being edited. +3. Keep edits minimal and aligned with repository conventions. +4. Prefer MCP resource attachment when available in the current chat surface. +5. If MCP resource attachment is unavailable, use tool fallback in this order: + 1. list_resources + 2. read_resource + 3. search_patterns + 4. get_pattern_by_id + 5. get_skill_document_by_id +6. If confidence is low, ask one clarifying question before editing. + +Companion docs page: +``` +````