Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/agents/ql-tdd-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ My `ql-tdd-agent`:
- Utilizes the `.github/prompts/*.prompt.md` prompt files as the primary guides for getting started with a given `ql` development task.
- Utilizes the environment provided by the `.github/workflows/copilot-setup-steps.yml` actions workflow, which sets up the appropriate `codeql` CLI version for this project.
- Utilizes the `.github/PULL_REQUEST_TEMPLATE/*.md` templates when creating Pull Requests for development changes.
- Prefers the `ql-mcp` MCP server tools (when connected) to inspect CodeQL's representation of code, compile queries, and run tests, and falls back to the `codeql` CLI for any operation the MCP tools do not expose.
- For false-negative (FN) and false-positive (FP) fixes, FIRST adds a regression test that reproduces the missed (or spurious) result, THEN fixes the query or library model, and explains the root cause in the Pull Request. NEVER simply accepts a missing detection as the new expected baseline.
- Absolutely loves using the `codeql test extract` CLI command as a means of creating a test database (without running tests) against which the language-specific `PrintAST` query may be run.
- Absolutely loves printing AST graph representations of test code as the primary means of understanding how CodeQL sees the syntax of some test code file.
- Knows that the `codeql` CLI is pre-installed and ALWAYS uses the verbose help (i.e. `codeql <subcommand> -h -vv`) for any `codeql <subcommand>` that the agent needs to run.
- Keeps the `PROMPTS.md` documentation up-to-date -- especially its `mermaid` diagram -- as instructions, prompts, and (issue & PR) templates are added, deleted, or otherwise updated.
- ALWAYS uses the `codeql` CLI to perform and validate work related to `ql` code, test code, expected results, query logs, generated databases, etc.
- ALWAYS uses the `codeql` CLI (directly or through the `ql-mcp` MCP tools, which wrap it) to perform and validate work related to `ql` code, test code, expected results, query logs, generated databases, etc.
- NEVER makes anything up. When in doubt, seeks to prove itself wrong with the `codeql` CLI.
18 changes: 18 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,21 @@ jobs:
- name: Copilot Setup - Install CodeQL workspace packs
shell: bash
run: ./scripts/install-codeql-packs.sh

# The MCP server requires Node.js ^24.15.0 || >=26.0.0 (and npm >=11.6.2).
- name: Copilot Setup - Setup Node.js for CodeQL MCP server
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: "26"

- name: Copilot Setup - Install CodeQL MCP server and tool-pack dependencies
shell: bash
run: |
npm install --global codeql-development-mcp-server@2.27.1
codeql-development-mcp-server-setup-packs

- name: Copilot Setup - Verify CodeQL MCP server is available
shell: bash
run: |
codeql version
command -v codeql-development-mcp-server
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,29 @@ This uses `codeql pack ls` to discover all packs in the workspace and runs `code

> **Note:** The generated `codeql-pack.lock.yml` files should be committed to your repository to ensure reproducible dependency resolution across your team.

### Step 2a (Optional): Enable the CodeQL MCP Server for Copilot Coding Agent

The 'copilot-setup-steps' workflow also installs the [CodeQL Development MCP Server](https://github.com/advanced-security/codeql-development-mcp-server) (`codeql-development-mcp-server`) into the agent environment. Installing it does not connect it: a repository administrator must register it once under **Settings → Copilot → Coding agent → MCP configuration**, preserving any existing entries:

```json
{
"mcpServers": {
"ql-mcp": {
"type": "local",
"command": "codeql-development-mcp-server",
"args": [],
"tools": ["*"]
}
}
}
```

See [GitHub's documentation on extending Copilot coding agent with MCP](https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/configure-mcp-servers) for details. Notes:

- The setup workflow must be merged to the **default branch** before Copilot uses it.
- Copilot Coding Agent supports MCP **tools** only (not MCP prompts or resources), so the prompts in this repository remain the primary guidance.
- Check the agent session logs to confirm `ql-mcp` connected and its tools were called. The `ql-tdd-agent` falls back to the `codeql` CLI if it is not connected.

### Step 3: Create an Issue for the CodeQL query or data extension you want to develop

1. **Navigate to Issues** in your new repository
Expand Down
6 changes: 3 additions & 3 deletions qlt.conf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"CodeQLCLI": "2.25.2",
"CodeQLStandardLibrary": "codeql-cli/v2.25.2",
"CodeQLCLIBundle": "codeql-bundle-v2.25.2"
"CodeQLCLI": "2.27.2",
"CodeQLStandardLibrary": "codeql-cli/v2.27.2",
"CodeQLCLIBundle": "codeql-bundle-v2.27.2"
}
Loading