feat(skills): add bundled /review skill for out-of-the-box code review (#2348)

feat(skills): add bundled /review skill for out-of-the-box code review
This commit is contained in:
Shaojin Wen 2026-03-14 15:15:08 +08:00 committed by GitHub
parent f1ee4638b7
commit 1359563f45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 525 additions and 27 deletions

View file

@ -14,6 +14,7 @@ import {
} from '@qwen-code/qwen-code-core';
import { CommandService } from './services/CommandService.js';
import { BuiltinCommandLoader } from './services/BuiltinCommandLoader.js';
import { BundledSkillLoader } from './services/BundledSkillLoader.js';
import { FileCommandLoader } from './services/FileCommandLoader.js';
import {
CommandKind,
@ -197,7 +198,7 @@ function filterCommandsForNonInteractive(
allowedBuiltinCommandNames: Set<string>,
): SlashCommand[] {
return commands.filter((cmd) => {
if (cmd.kind === CommandKind.FILE) {
if (cmd.kind === CommandKind.FILE || cmd.kind === CommandKind.SKILL) {
return true;
}
@ -252,6 +253,7 @@ export const handleSlashCommand = async (
// Load all commands to check if the command exists but is not allowed
const allLoaders = [
new BuiltinCommandLoader(config),
new BundledSkillLoader(config),
new FileCommandLoader(config),
];
@ -366,8 +368,12 @@ export const getAvailableCommands = async (
// Only load BuiltinCommandLoader if there are allowed built-in commands
const loaders =
allowedBuiltinSet.size > 0
? [new BuiltinCommandLoader(config), new FileCommandLoader(config)]
: [new FileCommandLoader(config)];
? [
new BuiltinCommandLoader(config),
new BundledSkillLoader(config),
new FileCommandLoader(config),
]
: [new BundledSkillLoader(config), new FileCommandLoader(config)];
const commandService = await CommandService.create(loaders, abortSignal);
const commands = commandService.getCommands();