fix: remove registerBundledSkill for strict review variants
All review commands now exclusively use extract-to-disk + skill scanner, no registerBundledSkill duplication. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
ca5114dfcf
commit
c374cab5ed
|
|
@ -1,62 +0,0 @@
|
||||||
import { registerBundledSkill } from 'src/skills/bundledSkills.js'
|
|
||||||
import { getResolvedLanguage } from 'src/utils/language.js'
|
|
||||||
import { CommandLocale } from 'src/costrict/command/locales/index.js'
|
|
||||||
import {
|
|
||||||
SKILL_FILES,
|
|
||||||
SKILL_METADATA,
|
|
||||||
} from 'src/costrict/review/skill/builtin.js'
|
|
||||||
|
|
||||||
const LOCALE_MAP: Record<string, string> = { zh: 'zh-CN', en: 'en' }
|
|
||||||
|
|
||||||
function getLocale(): string {
|
|
||||||
const lang = getResolvedLanguage()
|
|
||||||
return LOCALE_MAP[lang] ?? 'zh-CN'
|
|
||||||
}
|
|
||||||
|
|
||||||
const ALLOWED_TOOLS = [
|
|
||||||
'Skill',
|
|
||||||
'Glob',
|
|
||||||
'Grep',
|
|
||||||
'Read',
|
|
||||||
'TodoWrite',
|
|
||||||
'Bash',
|
|
||||||
'Agent',
|
|
||||||
]
|
|
||||||
|
|
||||||
function registerStrictReviewSkill(
|
|
||||||
name: string,
|
|
||||||
skillKey: string,
|
|
||||||
files: Record<string, string>,
|
|
||||||
description: string,
|
|
||||||
): void {
|
|
||||||
registerBundledSkill({
|
|
||||||
name,
|
|
||||||
description,
|
|
||||||
whenToUse: description,
|
|
||||||
userInvocable: true,
|
|
||||||
disableModelInvocation: false,
|
|
||||||
allowedTools: ALLOWED_TOOLS,
|
|
||||||
files,
|
|
||||||
async getPromptForCommand(args) {
|
|
||||||
const template = CommandLocale.get(skillKey)
|
|
||||||
const text = template
|
|
||||||
? template.replace('$ARGUMENTS', args.trim())
|
|
||||||
: args.trim() || `Please perform a ${skillKey}.`
|
|
||||||
return [{ type: 'text', text }]
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function registerStrictReviewSkills(): void {
|
|
||||||
const locale = getLocale()
|
|
||||||
const localeFiles = SKILL_FILES[locale]
|
|
||||||
const localeMetadata = SKILL_METADATA[locale]
|
|
||||||
if (!localeFiles || !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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -17,7 +17,6 @@ import { registerUpdateConfigSkill } from './updateConfig.js'
|
||||||
import { registerVerifySkill } from './verify.js'
|
import { registerVerifySkill } from './verify.js'
|
||||||
import { registerStrictPlanSkill } from 'src/costrict/skills/strictPlan.js'
|
import { registerStrictPlanSkill } from 'src/costrict/skills/strictPlan.js'
|
||||||
import { registerStrictSpecSkill } from 'src/costrict/skills/strictSpec.js'
|
import { registerStrictSpecSkill } from 'src/costrict/skills/strictSpec.js'
|
||||||
import { registerStrictReviewSkills } from 'src/costrict/skills/strictReview.js'
|
|
||||||
import { registerProjectWikiSkill } from 'src/costrict/skills/projectWiki.js'
|
import { registerProjectWikiSkill } from 'src/costrict/skills/projectWiki.js'
|
||||||
import { registerTddSkill } from 'src/costrict/skills/tdd.js'
|
import { registerTddSkill } from 'src/costrict/skills/tdd.js'
|
||||||
|
|
||||||
|
|
@ -39,7 +38,6 @@ export function initBundledSkills(): void {
|
||||||
registerTddSkill()
|
registerTddSkill()
|
||||||
registerStrictPlanSkill()
|
registerStrictPlanSkill()
|
||||||
registerStrictSpecSkill()
|
registerStrictSpecSkill()
|
||||||
registerStrictReviewSkills()
|
|
||||||
registerKeybindingsSkill()
|
registerKeybindingsSkill()
|
||||||
registerVerifySkill()
|
registerVerifySkill()
|
||||||
registerDebugSkill()
|
registerDebugSkill()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user