VS Code extension: ship portable, built-in custom agents (codeql-query-developer, codeql-workshop-author)#281
Draft
Copilot wants to merge 4 commits into
Draft
VS Code extension: ship portable, built-in custom agents (codeql-query-developer, codeql-workshop-author)#281Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
10 tasks
…le packaging - Add codeql-query-developer and codeql-workshop-author .agent.md files - Add bundle-customizations.js script with overlay support - Add AgentRegistrar class managing chat.agentFilesLocations registration - Add bundle:customizations npm script; update vscode:prepublish and clean - Add codeql-mcp.agents.enabled and additionalAgentDirs settings - Add codeql-mcp.showAgentsStatus command - Add contributes.chatAgents, chatPromptFiles, chatSkills static declarations - Add Vitest unit tests for bundler and AgentRegistrar - Add Mocha integration test suite for agents - Add team-customizations example overlay - Update README.md with Built-in Custom Agents section - Update CHANGELOG.md [Unreleased] with new VS Code Extension features Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
…ills/, manifest) Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
…n tests Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add portable, built-in custom agents to VS Code extension
VS Code extension: ship portable, built-in custom agents (codeql-query-developer, codeql-workshop-author)
May 18, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bundles two query-author-facing custom agents —
codeql-query-developerandcodeql-workshop-author— directly inside theextensions/vscode/VSIX, alongside curated prompts and skills. End users get a turnkey, named-agent experience on install (no.github/agents/*.mdcheckout required), with build-time (--customizations-dir) and runtime (codeql-mcp.additionalAgentDirs) extensibility hooks. The five repo-local.github/agents/*.mdfiles are untouched.📝 Primitive Information
Primitive Details
codeql-query-developer,codeql-workshop-author(custom agents)Scope is limited to VS Code extension files + a CHANGELOG entry. No
server/src/changes; the five.github/agents/*.mdfiles are unchanged.✅ FILES TOUCHED:
extensions/vscode/customizations/**— new tracked source dir for shipped.agent.mdfiles and the bundler whitelistextensions/vscode/scripts/bundle-customizations.js— bundler with overlay support and manifestextensions/vscode/src/customizations/agent-registrar.ts— runtime registrarextensions/vscode/src/extension.ts— wires the registrar +showAgentsStatuscommandextensions/vscode/package.json—chatAgents/chatPromptFiles/chatSkillscontributes, new settings + command,bundle:customizationsscriptextensions/vscode/test/customizations/*.test.ts— Vitest unit testsextensions/vscode/test/suite/agents.integration.test.ts—@vscode/test-electronintegration suiteextensions/vscode/examples/team-customizations/**— sample overlayextensions/vscode/.vscodeignore,.gitignore,esbuild.config.js,eslint.config.mjs,README.mdCHANGELOG.md— Unreleased entry🚫 NOT TOUCHED: any
.github/agents/*.md,server/src/prompts/*.prompt.md, or.github/skills/*/SKILL.mdsource files (read-only copy sources).🛑 MANDATORY PR VALIDATION CHECKLIST
CHANGELOG.mdentry)agents/,prompts/,skills/,dist-customizations-manifest.jsonare gitignoredPrimitive Metadata
codeql-mcp.agents.enabled: boolean (default true),codeql-mcp.additionalAgentDirs: string[] (default [])dist-customizations-manifest.json(build artifact);codeql-mcp.showAgentsStatusprints{ enabled, bundledDir, additionalDirs, effectiveLocations }🎯 Functionality Description
What This Primitive Does
.agent.mdfiles into the VSIX so they appear as extension-contributed custom agents the moment the extension activates.agents/directory (and any user-suppliedadditionalAgentDirs) tochat.agentFilesLocations, with idempotent dedupe and clean removal on deactivation.contributes.chatPromptFiles/contributes.chatSkills; speculatively contributeschatAgents(kept —vsceaccepted it).--customizations-dir=<path>orCODEQL_MCP_CUSTOMIZATIONS_DIR) that lets teams replace/extend the defaults before packaging..agent.mdsets amodel:key — user-controlled model selection is a non-negotiable design point.Use Cases
@codeql-query-developer(TDD query authoring) and@codeql-workshop-author(workshop generation, one-way handoff to the developer agent) in any VS Code workspace with the extension installed.npm run package -- --customizations-dir=./examples/team-customizations.codeql-mcp.additionalAgentDirssetting without rebuilding the VSIX.Example Usage
# Build-time overlay npm run package --workspace=extensions/vscode -- \ --customizations-dir=./examples/team-customizationsExample Input/Output
🧪 Implementation Details
Files Added/Modified
extensions/vscode/customizations/agents/{codeql-query-developer,codeql-workshop-author}.agent.mdextensions/vscode/scripts/bundle-customizations.js,extensions/vscode/customizations/bundle-customizations.config.jsextensions/vscode/src/customizations/agent-registrar.tsextensions/vscode/src/extension.ts,extensions/vscode/package.json(scripts, settings, command, contributes)extensions/vscode/.vscodeignore(excludescustomizations/,examples/),extensions/vscode/.gitignore(excludes generated outputs)extensions/vscode/test/customizations/{bundle-customizations,agent-registrar}.test.ts,extensions/vscode/test/suite/agents.integration.test.tsextensions/vscode/examples/team-customizations/**extensions/vscode/README.mdnew "Built-in Custom Agents" section,CHANGELOG.mdUnreleased entryArchitecture Integration
disposables[];showAgentsStatuscommand registered alongside existing commandsLoggercontributes.configuration.propertiesDesign Patterns
scripts/bundle-server.js; registrar mirrorsMcpProviderdisposable pattern📋 Testing Coverage
Unit Tests
WorkspacevsGlobal), normalized dedupe@vscode/test-electronsuite asserts bundledagents/exists, both.agent.mdfiles load, toggle removes/restores entries,additionalAgentDirsappends,showAgentsStatuscommand runsTest Scenarios
create-codeql-query-tdd-genericnot yet on disk) warn-and-skip; registrar never throws past activationskills/foo/SKILL.md, notskills/SKILL.md); registrar dedupes across normalized pathsTest Files
extensions/vscode/test/customizations/bundle-customizations.test.tsextensions/vscode/test/customizations/agent-registrar.test.tsextensions/vscode/test/suite/agents.integration.test.ts🔗 References
Related Implementation
extensions/vscode/scripts/bundle-server.js— sibling bundler pattern.github/agents/mcp-enabled-ql-query-developer.md,.github/agents/mcp-enabled-ql-workshop-developer.md— source agents the shipped versions are slimmed from (left unchanged)External References
chatPromptFiles,chatSkillsdocumented;chatAgentsspeculative (kept — accepted byvsce)codeql-development-mcp-server#2(--prompts-diruser extensibility for the MCP server)Validation Materials
🚀 Server Integration
Registration Details
Compatibility
extensions/vscode/tsconfig.jsonPerformance Considerations
dispose()removes only this instance's entries; idempotent🔍 Quality Assurance
Code Quality
npm run lint --workspace=extensions/vscodecleanValidation Testing
examples/team-customizations/@vscode/test-electronsuite added (driven by repo CI)Security Considerations
eval/dynamic require👥 Review Guidelines
For Reviewers
server/src/or.github/agents/editsdisposables[]Testing Instructions
Manual Validation Steps
Chat: Open Customizations— both agents appear as extension-contributed.codeql-mcp.showAgentsStatus— bundled + extra paths printed.codeql-mcp.agents.enabled = false— agents disappear; re-enable to restore.codeql-mcp.additionalAgentDirsto a temp dir with an.agent.mdand confirm surface.📊 Impact Analysis
Server Impact
AI Assistant Benefits
codeql-workshop-author → codeql-query-developerMonitoring & Reporting Integration
codeql-query-developeragent encodes TDD as the default flowMaintenance Considerations
chatAgentsremovable if a futurevscerejects it🔄 Deployment Considerations
Rollout Strategy
codeql-mcp.agents.enabledacts as a kill-switchCodeQL MCPoutput channelMigration Notes
None. Existing repo-local
.github/agents/*.mdfiles are unchanged and continue to serve maintainers of this repo.Implementation Methodology: This change follows best practices:
contributes.*) + programmatic (chat.agentFilesLocations) registrationmodel:key shipped, no coercion in code