-
Notifications
You must be signed in to change notification settings - Fork 2
[UPDATE PRIMITIVE] Rewrite static MCP resources as actionable LLM-oriented guides #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
91a5a4a
Initial plan
Copilot 5e19d95
Rewrite static MCP resources with actionable LLM-oriented content, reβ¦
Copilot 0d3f529
Fix tool name inconsistency: use codeql_generate_log-summary (with hyβ¦
Copilot 1d75bfb
Address latest PR review comments
data-douser 3efcd64
Update docs to fix/remove tool counts
data-douser 32166dc
Remove qlt refs, broken cli links, fix deprecated API names, fix impoβ¦
Copilot 113def9
Cleanup language-specific security query guides
data-douser f9bee7f
Migrate .github/skills/** as MCP server resources (#116)
data-douser df4ce5e
Address latest PR review comments
data-douser 7392972
Merge branch 'main' into copilot/rewrite-mcp-resources-guides
data-douser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
.github/instructions/server_src_resources_md.instructions.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| --- | ||
| applyTo: 'server/src/resources/**/*.md' | ||
| description: 'Instructions for MCP server resource markdown files served to LLMs.' | ||
| --- | ||
|
|
||
| # Copilot Instructions for `server/src/resources/**/*.md` resource files | ||
|
|
||
| ## PURPOSE | ||
|
|
||
| This file contains instructions for working with markdown resource files in the `server/src/resources/` directory. These files are imported at build time (via esbuild's `.md: 'text'` loader) and served to LLMs through MCP resource endpoints (e.g., `codeql://server/overview`, `codeql://languages/go/ast`). Because LLMs consume these files as authoritative reference material, correctness and consistency are critical. | ||
|
|
||
| ## REQUIREMENTS | ||
|
|
||
| - ALWAYS name resource files to match their MCP endpoint path. For example, a resource served at `codeql://server/overview` must be named `server-overview.md`, and a resource at `codeql://languages/go/ast` must be `languages/go_ast.md`. | ||
| - ALWAYS start each resource file with a `#`-level (H1) heading that identifies the resource topic and scope. | ||
| - ALWAYS use the v2 module-based DataFlow/TaintTracking API (`module MyConfig implements DataFlow::ConfigSig` with `TaintTracking::Global<MyConfig>`) in all CodeQL code examples. NEVER use the deprecated v1 class-based API (`class MyConfig extends TaintTracking::Configuration` with `override predicate`). | ||
| - ALWAYS use `codeql-pack.yml` (not `qlpack.yml`) as the pack configuration filename in all code examples and references. | ||
| - ALWAYS ensure any new resource file has a corresponding import and registration in `server/src/types/language-types.ts` (for language-specific resources) or `server/src/lib/resources.ts` (for general resources), and that the test expectations in `server/test/src/resources/` are updated accordingly. | ||
| - ALWAYS verify ASCII art diagrams have consistent box corners and formatting. | ||
| - ALWAYS ensure code examples are syntactically correct β class names, constructor names, and predicate names must all match (e.g., a class named `FooAsSink` must have a constructor named `FooAsSink()`). | ||
| - **ALWAYS run `npm run build-and-test` from the repo root directory and ensure it passes completely before committing any changes.** | ||
|
|
||
| ## PREFERENCES | ||
|
|
||
| - PREFER actionable, tool-oriented content that tells an LLM exactly which MCP tools and prompts to invoke and in what order, over abstract descriptions. | ||
| - PREFER concrete code examples over prose explanations for CodeQL patterns and idioms. | ||
| - PREFER a single authoritative location for each piece of documentation β if content exists in a resource file, repo-level docs should reference it rather than restate it. | ||
|
|
||
| ## DOCUMENTATION RELATIONSHIP: `server/src/resources/` β `docs/ql-mcp/` | ||
|
|
||
| The `server/src/resources/server-*.md` files are the **authoritative source** for MCP server tools, prompts, and queries documentation. The `docs/ql-mcp/*.md` files are **thin wrappers** that link to these authoritative sources. | ||
|
|
||
| ### When to update which file | ||
|
|
||
| | Change type | Update `server/src/resources/server-*.md` | Update `docs/ql-mcp/*.md` | | ||
| | -------------------------------------------- | ----------------------------------------- | -------------------------------------- | | ||
| | Add, remove, or modify an MCP tool | YES β `server-tools.md` | Only if monitoring tools table changes | | ||
| | Add, remove, or modify an MCP prompt | YES β `server-prompts.md` | NO β wrapper links to resource file | | ||
| | Add or remove a language resource | YES β registration in source code | YES β update language table | | ||
| | Add or remove a static resource | YES β resource file + registration | YES β update static resources table | | ||
| | Change a resource URI or endpoint path | YES β rename file to match new path | YES β update URI references | | ||
| | Fix a typo or improve wording in tool/prompt | YES β resource file only | NO β wrapper inherits the fix | | ||
|
|
||
| ### Rules | ||
|
|
||
| - ALWAYS update the authoritative `server/src/resources/server-*.md` file first, then verify the `docs/ql-mcp/*.md` wrapper still links correctly. | ||
| - ALWAYS keep `docs/ql-mcp/*.md` as thin wrappers β they should contain only a brief overview, a link to the authoritative resource file, and any content that is NOT served via MCP (e.g., the optional monitoring tools table in `docs/ql-mcp/tools.md`). | ||
| - NEVER duplicate detailed tool, prompt, or resource descriptions in both `server/src/resources/` and `docs/ql-mcp/`. The `docs/ql-mcp/` file must defer to the resource file for all MCP-served content. | ||
|
|
||
| ## CONSTRAINTS | ||
|
|
||
| - NEVER leave any trailing whitespace on any line. | ||
| - NEVER include placeholder or TODO content in resource files β if a resource is not ready, exclude it from registration until the content is complete. | ||
| - NEVER reference deprecated or removed MCP tools in resource files. When a tool is deprecated, remove all mentions from resource files. | ||
| - NEVER mix deprecated and current API patterns in code examples within the same file or across files in this directory. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.