create-codeql-query-unit-test-swift

Creates Swift CodeQL unit tests with directory structure and expected results.

30|3|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/advanced-security/codeql-development-mcp-server --skill create-codeql-query-unit-test-swift
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-codeql-query-unit-test-swift
Source: https://github.com/advanced-security/codeql-development-mcp-server/tree/main/.github/skills/create-codeql-query-unit-test-swift
Command: npx skills add https://github.com/advanced-security/codeql-development-mcp-server --skill create-codeql-query-unit-test-swift

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides teams in creating comprehensive unit tests for CodeQL queries that analyze Swift code, reducing setup time and ensuring consistent test coverage across projects.

Core Features & Use Cases

  • Structure: provides a tested directory layout including a query reference file, Example1.swift, Example1.swift.expected, and an auto-generated .testproj database.
  • Step-by-step workflow: teaches creating, validating, and expanding Swift test coverage for CodeQL queries across multiple test cases and Swift patterns.
  • Tooling integration: aligns with MCP workflow tools for extracting, running, and validating tests.

Quick Start

Create a Swift test suite for a CodeQL query by following the steps outlined in this guide.

Frequently Asked Questions about create-codeql-query-unit-test-swift

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create unit tests for Swift CodeQL queries?

CodeQL query unit tests for Swift require a structured directory layout containing the query reference file, Example1.swift, Example1.swift.expected, and an auto-generated .testproj database. This setup provides a repeatable workflow for validating query logic against Swift code samples.

What is the required file structure for a CodeQL Swift test suite?

The required file structure for a CodeQL Swift test suite includes a query reference file, a Swift example file like Example1.swift, its corresponding Example1.swift.expected results file, and an auto-generated .testproj database for extraction.

Do I need macOS to run CodeQL database extraction for Swift projects?

Yes, macOS is required for Swift extraction compatibility when building CodeQL databases. The testing workflow satisfies specific requirements for Swift extraction compatibility on macOS to ensure accurate query analysis.

How does test-driven development work with CodeQL queries for Swift?

Test-driven development with CodeQL queries for Swift involves creating expected results files alongside Swift example code, then running automated database extraction and validation. This step-by-step workflow teaches creating, validating, and expanding test coverage across multiple Swift patterns.

Can I use MCP tools to automate CodeQL query testing workflows?

Yes, MCP tools can orchestrate CodeQL query testing workflows by aligning with MCP workflow tools for extracting, running, and validating tests. This integration streamlines the end-to-end process of building robust Swift CodeQL unit tests.

What's the best way to expand test coverage for multiple Swift CodeQL patterns?

The best way to expand test coverage for multiple Swift CodeQL patterns is following the step-by-step workflow that teaches creating, validating, and expanding Swift test coverage. This process applies to query development across multiple test cases and diverse Swift patterns.