From 08ad8a55daa916dbc62392bcecb0b566eb9bf284 Mon Sep 17 00:00:00 2001 From: kingboung Date: Tue, 12 May 2026 17:38:56 +0800 Subject: [PATCH] refactor: strict review variants load skill via Skill tool Remove embedded files, use Skill tool to load review/security-review skill instead, matching the same mechanism as /review. Co-Authored-By: Claude Opus 4.7 --- src/costrict/skills/strictReview.ts | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/costrict/skills/strictReview.ts b/src/costrict/skills/strictReview.ts index 9957c6ef2..90a2c32e3 100644 --- a/src/costrict/skills/strictReview.ts +++ b/src/costrict/skills/strictReview.ts @@ -1,9 +1,8 @@ import { registerBundledSkill } from 'src/skills/bundledSkills.js' -import { getResolvedLanguage } from 'src/utils/language.js' import { - SKILL_FILES, SKILL_METADATA, } from 'src/costrict/review/skill/builtin.js' +import { getResolvedLanguage } from 'src/utils/language.js' const LOCALE_MAP: Record = { zh: 'zh-CN', en: 'en' } @@ -25,7 +24,6 @@ const ALLOWED_TOOLS = [ function registerStrictReviewSkill( name: string, skillKey: string, - files: Record, description: string, ): void { registerBundledSkill({ @@ -35,23 +33,18 @@ function registerStrictReviewSkill( userInvocable: true, disableModelInvocation: false, allowedTools: ALLOWED_TOOLS, - files, async getPromptForCommand(args) { - return [{ type: 'text', text: args.trim() || `Please perform a ${skillKey}.` }] + return [{ type: 'text', text: `Please use the Skill tool to load the \`${skillKey}\` skill.\n\n${args.trim()}` }] }, }) } export function registerStrictReviewSkills(): void { const locale = getLocale() - const localeFiles = SKILL_FILES[locale] const localeMetadata = SKILL_METADATA[locale] - if (!localeFiles || !localeMetadata) return + if (!localeMetadata) return - for (const [skillKey, files] of Object.entries(localeFiles)) { - const meta = localeMetadata[skillKey] - if (!meta || !files) continue - - registerStrictReviewSkill(`strict:${skillKey}`, skillKey, files, meta.description) + for (const [skillKey, meta] of Object.entries(localeMetadata)) { + registerStrictReviewSkill(`strict:${skillKey}`, skillKey, meta.description) } }