| applyTo | server/src/prompts/*.prompt.md |
|---|---|
| description | Instructions for MCP-server-hosted workflow prompt files. |
This file contains instructions for working with workflow prompt files in the server/src/prompts/ directory. These prompts are registered by the MCP server (via workflow-prompts.ts) and exposed as slash commands in VS Code Copilot Chat.
-
ALWAYS start each prompt file with the following YAML frontmatter block:
--- agent: agent ---
Note: VS Code has deprecated
mode: agentin favor ofagent: agent. -
ALWAYS ensure each prompt has a corresponding registration in
server/src/prompts/workflow-prompts.ts, including a Zod parameter schema and aserver.prompt()call. -
ALWAYS ensure the prompt name in
WORKFLOW_PROMPT_NAMESmatches the registration. -
ALWAYS write prompts that work in any environment where
codeqland the MCP server tools are available, including terminal-only environments without an IDE. -
ALWAYS use explicit, numeric tool parameters (e.g.,
file_path,line,character) instead of IDE-centric language like "position the cursor" or "click on". -
ALWAYS document when MCP tools use 0-based positions (all
codeql_lsp_*tools) versus 1-based positions (find_predicate_position,find_class_position,read_file). -
ALWAYS note the
workspace_urirequirement for LSP tools: it must be a plain directory path to the pack root containingcodeql-pack.yml, not afile://URI. -
ALWAYS run
npm run tidyfrom the repo root directory to apply (markdown) linting for all prompt files.
- PREFER referencing other prompts by their registered MCP name (e.g.,
codeql://prompts/ql_lsp_iterative_development) to enable cross-prompt navigation. - PREFER including a "Worked Example" section showing concrete tool invocations with realistic parameter values.
- PREFER a validation tools comparison table when multiple tools can validate queries at different fidelity levels (e.g.,
validate_codeql_queryvscodeql_lsp_diagnosticsvscodeql_query_compile). - PREFER documenting tool limitations discovered through actual usage (e.g.,
codeql_lsp_diagnosticscannot resolve imports;find_class_positionfindsclassonly, notmodule).
- NEVER leave any trailing whitespace on any line.
- NEVER use four backticks to nest one code block inside another.
- NEVER assume the calling LLM has access to an IDE, cursor, or editor UI.
- NEVER reference
file://URIs for theworkspace_uriparameter — use plain directory paths.