14 KiB
icon
| icon |
|---|
| lucide/workflow |
Skill Usage Mechanics
Purpose
This page explains practical usage mechanics for the GitHub Copilot extension in VS Code when personal-mcp is configured as an MCP server:
- explicit
/command flows when you want deterministic control - guided skill loading when relevance can be inferred
The goal is to show how Copilot behaves as a client and how to shape that behavior.
Mental Model
In Copilot Chat, there are two distinct mechanisms:
/commands are user-invoked orchestration shortcuts.- MCP resources are server-published knowledge units that can be attached as read-only context, while MCP tools provide an execution path for discovery and retrieval.
In this repository, skill guidance is exposed as MCP resources, not as server-owned prompt execution. Copilot remains the orchestrator.
Prompt guidance is now exposed through both prompt resources and MCP prompt objects. Prompt objects are additive; authored markdown remains the canonical source.
Background Mechanics
What the server publishes
personal-mcp registers resources from the validated docs registry and exposes catalog discovery resources:
resource://catalog/skills_indexresource://catalog/skills_index{?q,tag,capability,cursor,limit}resource://catalog/skills/{skill_id}resource://catalog/prompts_indexresource://catalog/prompts_index{?q,tag,cursor,limit}resource://catalog/prompts/{prompt_id}
Each skill publishes a canonical Markdown document resource:
resource://skills/<skill-id>/documentresource://skills/<skill-id>/references/<ref-id>
Prompts publish a canonical prompt document resource:
resource://prompts/<prompt-id>/document
The document payload is loaded from docs/skills/<skill-id>/SKILL.md and returned with metadata.
What Copilot does as the client
When connected to MCP, Copilot can do the following at runtime:
- interpret the current chat request
- use attached MCP resources that you provide through the chat UI
- invoke MCP tools when the task and tool descriptions make that relevant
- summarize relevant sections into working context
- apply guidance while generating edits or recommendations
This behavior is shaped by the active chat surface, prompt or instruction guidance, and available MCP tools.
For reliable progressive discovery, use one of these sequences:
- explicit resource path: attach a catalog resource first, then attach only selected skill documents
- tool path: call catalog tools first, then load only selected skill documents
What / commands do
/ commands in VS Code are client-side prompt entry points (for example in prompt files). They do not replace MCP resources. In Copilot, they typically:
- enforce a known sequence
- collect missing inputs
- call discovery/read steps in a predictable order
Think of / commands as orchestration shortcuts on top of MCP resources.
What automatic loading means here
In this project, "automatic loading" should be read as a preference you express through instructions and prompts, not as a guaranteed VS Code feature that auto-attaches MCP resources.
In practice, there are two reliable ways to make skill content available in chat:
- explicit resource attachment through
Add Context > MCP ResourcesorMCP: Browse Resources - MCP tool invocation using
list_resources/read_resource(ResourcesAsTools), with thin catalog tools as parity fallback
For prompt content, there is a third option when the client supports MCP prompt APIs:
- prompt-object discovery and invocation through MCP prompt lists and
get_prompt
Instruction quality and metadata quality still matter, because they influence whether Copilot recognizes that the MCP server is relevant and chooses the tool path well.
Invocation Mechanics Deep Dive
This section expands on how invocation works at runtime across chat entry points.
Invocation Surfaces
A user request can arrive through one of these surfaces:
- plain chat request in Ask/Edit/Agent mode
- slash command invocation of a prompt or skill
- chat request with manually attached MCP resources
Each surface changes how much discovery Copilot must do before applying guidance.
Resolution Order
When multiple retrieval paths are possible, use this priority order:
- attached MCP resources already in context
- explicit slash-command workflow steps
- catalog-first discovery via MCP resources
- tool fallback (
list_resourcesthenread_resource, then thin catalog parity tools)
This ordering keeps behavior predictable while minimizing unnecessary context expansion.
Prompt Invocation Pipeline
For prompt-oriented flows, treat invocation as this sequence:
- parse prompt frontmatter and argument hints
- validate required inputs and ask one clarifying question if blocked
- run bounded discovery against prompt or skill catalogs
- fetch only selected document resources
- apply instructions to produce edits, recommendations, or commands
- report what was loaded and why
Prompt objects and prompt document resources are additive mechanisms. The authored Markdown prompt document remains the canonical contract.
Argument Syntax Nuance
Invocation strings such as target_modules=src/personal_mcp/registry/ingest/skill.py, mode=plan-only are a structured authoring convention, not a guaranteed client-level grammar.
In practice:
- Prompt metadata defines expected argument names and intent.
- Prompt body instructions define how those inputs should be interpreted.
- Copilot may receive equivalent intent in freeform phrasing and still resolve it correctly.
Implication for authors:
- Treat key=value examples as clarity aids for users.
- Do not assume strict parser enforcement unless your prompt explicitly validates and rejects malformed input.
- Include accepted invocation examples and one fallback freeform example so behavior is predictable for both humans and the model.
This distinction is important because argument hints improve discoverability, while robust prompt instructions determine actual runtime reliability.
Skill Invocation Pipeline
For guided skill loading, use this sequence:
- start from
resource://catalog/skills_indexor scoped index query - inspect one or two top candidates for intent and capability fit
- fetch
resource://skills/<skill-id>/document - load references only when the task needs deeper detail
- apply only relevant sections and keep context bounded
This avoids the common failure mode where many skill documents are loaded up front.
Determinism vs Flexibility
Use this decision rule:
- choose slash-command invocation when repeatability and step order are critical
- choose guided loading when requests vary and speed matters more than strict orchestration
- escalate from guided loading to slash-command flow when confidence is low or conflicting skills appear
Invocation Trace (What to Log in Results)
For transparent operation, include a concise invocation trace in task outputs:
- entry surface used (plain chat, slash command, or attached resource)
- discovery source used (catalog resource or tool path)
- resources fetched (ids only)
- clarifying questions asked (if any)
- reason for fallback or escalation (if used)
This makes behavior auditable and easier to tune over time.
Operating Pattern
Use both modes intentionally in Copilot Chat.
Mode A: Explicit / command
Use when you need predictable, repeatable behavior across teammates.
Good fits:
- onboarding workflows
- compliance-sensitive tasks
- repetitive scaffolding
Mode B: Guided skill loading
Use when requests are varied and you want lower friction during normal chat.
Good fits:
- ad hoc implementation questions
- mixed-topic debugging
- architecture tradeoff discussions
Mode C: Fallback flow
Start with guided loading in chat; escalate to a / command when:
- confidence is low
- multiple skills conflict
- the user wants strict repeatability
Suggested Resolution Flow
flowchart TD
A[User request in Copilot Chat] --> B{Deterministic workflow needed?}
B -- Yes --> C[/Run slash command/]
C --> D[Copilot fetches known catalog and skill resources]
B -- No --> E[Copilot uses attached resources or catalog tools]
E --> F{Confident skill match?}
F -- Yes --> G[Copilot fetches skill documents]
F -- No --> H[Ask clarifying question or suggest slash command]
D --> I[Apply guidance to task]
G --> I
H --> I
Authoring Requirements
Authoring rules for metadata quality and instruction patterns are maintained in Authoring Guide.
Practical Guidelines
- Keep
/commands minimal and high-value. - Do not duplicate full methodology text inside command files.
- Keep canonical guidance in
docs/skills/*/SKILL.md. - In Copilot instructions, prefer catalog-first discovery before skill fetch.
- Prefer small, relevant context slices over loading every skill.
- Keep slash commands focused on deterministic orchestration, not content duplication.
If you skip the catalog/index step, behavior is less predictable and may either miss relevant skills or pull too much context.
Optional Tool Search Mode
When tool catalogs grow, FastMCP search transforms can reduce tool-list noise for tool-only clients.
Runtime switches:
PERSONAL_MCP_TOOL_SEARCH=none|regex|bm25(defaultnone)PERSONAL_MCP_TOOL_SEARCH_MAX_RESULTS=<positive int>(default5)
Behavior:
regexuses deterministic regex matching for targeted queries.bm25uses ranked natural-language matching.list_resourcesandread_resourcestay visible so resource-backed fallback remains primary.
Failure Modes and Recovery
Common failure modes:
- No relevant skill selected.
- Too many skills selected (context bloat).
- Stale assumptions from old metadata.
- Slash command bypasses normal discovery and forces the wrong skill.
Recovery sequence:
- re-run catalog lookup
- narrow by tags and intent
- fetch only top candidates
- if still ambiguous, ask one clarifying question
- use explicit
/workflow for deterministic fallback
Checklist
Use this checklist when configuring GitHub Copilot in VS Code against personal-mcp:
- confirm server connectivity
- verify catalog resources are readable
- verify at least one
resource://skills/<id>/documentcan be fetched - add one deterministic
/command for fallback - confirm your workspace instruction policy exists (see Authoring Guide)
- verify context size remains bounded
- validate behavior in Ask/Edit/Agent-style workflows with at least one task each
Runtime Discovery Workflow
Use this runtime sequence in chat sessions:
- Start with catalog-first discovery.
- Prefer MCP resources when the chat surface exposes resource attachment.
- Otherwise use tool fallback to load one or two likely skill documents.
- Prefer
list_resources/read_resourcefirst when operating in tool-only clients. - If confidence is low, ask one clarifying question before loading more.
Thin Shim Path Binding Pattern
For repositories that consume this MCP server, thin shims are a usage pattern for binding path scopes to the right MCP resources. The "thin shims" are just lightweight, repo-specific instructions files that tell Copilot to use certain MCP resources when editing files that match a pattern. That helps with ensuring Copilot uses the intended resources without too much specific goading in the prompt.
Use thin shims in Copilot instruction files to bind file-path scopes to:
- the most relevant docs page for human-readable conventions
- the matching MCP resource URI for machine retrieval
Keep each shim short: trigger, primary resource, minimal execution pattern, and one fallback rule.
Recommended binding pattern:
- Put shims in
.github/instructions/*.instructions.md. - Scope each shim with
applyToso it activates only where needed. - Point to one primary
resource://skills/<skill-id>/documentURI. - Link one repository docs page as the human-facing companion.
- Expand to references only when the task needs deeper detail.
Current repository examples:
| applyTo scope | Primary docs page | Primary MCP resource |
|---|---|---|
**/*.md |
docs/authoring.md | resource://skills/zensical-docs/document |
tests/** |
docs/testing.md | resource://skills/pytesting/document |
.vscode/** |
docs/skills/vscode-configuration/SKILL.md | resource://skills/vscode-configuration/document |
Minimal shim shape:
---
name: <short scope name>
description: Route <path scope> edits to the Personal MCP <skill-id> resource.
applyTo: '<glob>'
---
When editing files matching <glob>, use `resource://skills/<skill-id>/document` 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. If confidence is low, ask one clarifying question before editing.
Companion docs page: [docs/<page>.md](./<page>.md)
When to use thin shims:
- Repositories that want thin local policy while keeping canonical guidance in MCP resources.
- Stable, repeated workflows with clear path ownership.
- Cases where teams need predictable retrieval behavior.
When not to use thin shims:
- Broad, ambiguous tasks with unclear ownership boundaries.
- Cases where one shim would need many exceptions.
- Situations better handled by catalog-first discovery at runtime.
Summary
The intended model is:
- skills are canonical MCP resources
/commands are explicit Copilot control shortcuts- guided skill loading should be catalog-driven, bounded, and explicit about whether it is using resources or tools
Using all three together gives predictable control when needed and low-friction assistance by default in VS Code.