Skip to content

Feat kql expert#137

Merged
simongdavies merged 4 commits into
hyperlight-dev:mainfrom
simongdavies:feat-kql-expert
May 14, 2026
Merged

Feat kql expert#137
simongdavies merged 4 commits into
hyperlight-dev:mainfrom
simongdavies:feat-kql-expert

Conversation

@simongdavies
Copy link
Copy Markdown
Member

This pull request introduces support for skills that require connection to external MCP (Modular Control Plane) servers, such as Fabric RTI for Kusto/KQL queries. It updates the skill documentation and metadata formats to declare MCP server dependencies, extends the approach resolver to collect and report MCP server requirements and statuses, and enhances CLI tooling for MCP server setup. The changes also expand and clarify the available skills and their triggers across documentation and skill files.

Skill system enhancements:

  • Added requires-mcp field to skill metadata (in .md and SKILL.md files) to declare MCP server dependencies for skills. This allows the agent to check and report required external server connections for a skill to function.
  • Updated skill documentation (docs/SKILLS.md, README.md, and skill files) to explain MCP server dependencies, enumerate new and existing skills, and clarify their descriptions and triggers.

Approach resolver and runtime guidance:

  • Extended the MaterialisedGuidance interface and approach resolver logic to collect required MCP servers (requiredMcp) and their runtime statuses (mcpStatus). This enables the agent to inform the LLM and user about MCP connection requirements and current connection state.
  • Improved the guidance formatting to display MCP server connection status, including setup instructions, connection state, tool count, and error reporting.

CLI tooling:

  • Added a new CLI command --mcp-setup-fabric-rti for configuring the Fabric RTI (Kusto/KQL) MCP server, supporting easier setup for skills that require this backend.

Skill trigger and pattern improvements:

  • Refined and expanded triggers and patterns for several skills (api-explorer, data-processor, pdf-expert, report-builder, research-synthesiser, web-scraper, mcp-services) to improve skill matching and clarify their capabilities.

…hlighting

- Add kql-expert skill (SKILL.md) with 35 triggers, requires-mcp: fabric-rti-mcp
- Add requires-mcp frontmatter support in skill-loader + approach-resolver
- Add MCP enrichment wiring in agent index.ts
- Add --mcp setup-fabric-rti CLI command
- Clean generic triggers across 7 skills to prevent false matches
- Add hljs-kql.ts grammar (derived from @kusto/monaco-kusto MIT)
- Register KQL/Kusto syntax highlighting in markdown-renderer via createRequire
- Add intent-matcher regression tests (27 tests: 22 positive + 5 guards)
- Add skill-loader tests (8 tests) and approach-resolver MCP tests (8 tests)

All 2396 tests pass. Typecheck clean. Fmt clean.

Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
- Rust: gate [hyperlight-analysis] eprintln! behind HYPERAGENT_VERBOSE/DEBUG env vars
- MCP: gate [mcp] Connected/Auth success messages behind isVerbose()
- MCP: pipe subprocess stderr when not verbose to suppress Python INFO logs
- KQL skill: remove azuremcpserver reference, add anti-pattern to use fabric-rti-mcp only

Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
- Add all 9 skills to tables in docs/SKILLS.md, README.md, skills/CLAUDE.md,
  and .github/instructions/skills.instructions.md (was missing kql-expert,
  xlsx-expert, mcp-services in various files)
- Document requires-mcp frontmatter field in docs/SKILLS.md
- Add requires-mcp to YAML examples in instruction files
- Alphabetise skill tables for consistency

Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 14, 2026 19:46
@simongdavies simongdavies added the enhancement New feature or request label May 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds MCP-aware skill support, centered on a new KQL/Kusto expert skill that uses a Fabric RTI MCP server, and updates guidance, CLI setup, rendering, and tests around that workflow.

Changes:

  • Adds requires-mcp skill metadata and propagates MCP requirements into approach guidance.
  • Adds Fabric RTI setup plumbing and KQL syntax highlighting.
  • Expands/refines skill definitions, documentation, and intent/loader/resolver tests.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/agent/skill-loader.ts Parses requires-mcp metadata into loaded skills.
src/agent/approach-resolver.ts Adds required MCP/status fields and MCP guidance formatting.
src/agent/index.ts Enriches auto-generated guidance with runtime MCP server status.
src/agent/cli-parser.ts Adds --mcp-setup-fabric-rti CLI parsing.
src/agent/mcp/setup-commands.ts Adds Fabric RTI MCP setup command.
src/agent/mcp/client-manager.ts Adjusts MCP logging/stderr verbosity handling.
src/agent/markdown-renderer.ts Registers KQL highlighting for terminal markdown.
src/agent/hljs-kql.ts Adds highlight.js grammar for KQL/Kusto.
src/code-validator/guest/host/src/runtime.rs Gates runtime lifecycle logs behind verbose/debug env vars.
skills/kql-expert/SKILL.md Adds new KQL expert skill requiring Fabric RTI MCP.
skills/api-explorer/SKILL.md Refines API triggers.
skills/data-processor/SKILL.md Refines data-processing triggers.
skills/mcp-services/SKILL.md Refines MCP service triggers.
skills/pdf-expert/SKILL.md Refines PDF triggers.
skills/report-builder/SKILL.md Refines report triggers.
skills/research-synthesiser/SKILL.md Refines research triggers.
skills/web-scraper/SKILL.md Refines scraping triggers.
skills/CLAUDE.md Updates skill documentation and metadata template.
.github/instructions/skills.instructions.md Updates skill instruction template/list.
docs/SKILLS.md Documents MCP dependencies and updated skills.
README.md Adds KQL expert to the skills overview.
tests/skill-loader.test.ts Adds skill loader coverage, including requires-mcp.
tests/approach-resolver.test.ts Adds MCP requirement/status formatting tests.
tests/intent-matcher.test.ts Adds real skill intent matching regression tests.
Comments suppressed due to low confidence (1)

src/agent/hljs-kql.ts:350

  • Because the shorter alternatives (create, alter, set, etc.) appear before their hyphenated forms and \b matches before -, commands such as .create-or-alter and .set-or-append will be highlighted only as .create/.set. Put longer hyphenated commands first or use a boundary that does not split on hyphens.
  const COMMAND: Mode = {
    className: "meta",
    begin:
      /\.(show|create|alter|drop|set|append|delete|rename|move|replace|ingest|export|create-or-alter|alter-merge|create-merge|set-or-append|set-or-replace|drop-pretend)\b/,
  };

Comment thread src/agent/hljs-kql.ts
Comment thread src/agent/approach-resolver.ts
Comment thread src/agent/index.ts Outdated
Comment thread tests/approach-resolver.test.ts Outdated
Comment thread src/agent/markdown-renderer.ts
Comment thread src/agent/mcp/setup-commands.ts
Comment on lines +694 to +699
* Returns true when HYPERAGENT_VERBOSE=1 or HYPERAGENT_DEBUG=1.
*/
function isVerbose(): boolean {
return (
process.env.HYPERAGENT_VERBOSE === "1" ||
process.env.HYPERAGENT_DEBUG === "1"
Comment thread docs/SKILLS.md Outdated
Comment thread src/agent/mcp/client-manager.ts Outdated
Comment on lines +470 to +473
// When not in verbose/debug mode, pipe subprocess stderr so MCP server
// log output (e.g. Python INFO lines) doesn't leak to the terminal.
// In verbose mode, inherit so the user sees everything.
const stderr = isVerbose() ? "inherit" : "pipe";
Comment thread src/agent/cli-parser.ts
- Fix hyperlight-dev#2: Use MCP_SETUP_COMMANDS lookup for correct CLI setup hints
  (was generating 'setup-rti-mcp' instead of '--mcp-setup-fabric-rti')
- Fix hyperlight-dev#3: Show unconfigured status when mcpManager is null
- Fix hyperlight-dev#4: Update test assertion to match corrected setup command
- Fix hyperlight-dev#5: Add highlight.js ^10.7.3 as explicit dependency (was transitive)
- Fix hyperlight-dev#6: Validate Fabric RTI options — reject missing values & unknown flags
- Fix hyperlight-dev#7: Set HYPERAGENT_VERBOSE=1 from cli.verbose flag
- Fix hyperlight-dev#8: Update skill count from 9 to 10 in docs/SKILLS.md
- Fix hyperlight-dev#9: Use stderr 'ignore' instead of 'pipe' to avoid back-pressure
- Fix hyperlight-dev#10: Add CLI parser test for --mcp-setup-fabric-rti flag

Comment hyperlight-dev#1 (hljs types) is invalid — typecheck passes with /// <reference>.

Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
@simongdavies simongdavies merged commit b646352 into hyperlight-dev:main May 14, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants