Replace registerBundledSkill() with runtime extract-to-disk + standard skill scanner discovery, aligning with upstream opencode PR #360 approach. - Add extractBundledSkill() to generate script output - Create extension.ts for runtime skill extraction to ~/.claude/skills/ - Remove reviewSkills.ts (registerBundledSkill registration) - Update bundled/index.ts to call Extension.initializeBuiltinSkills() - Add build:builtin-review script to package.json Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
84 lines
3.3 KiB
TypeScript
84 lines
3.3 KiB
TypeScript
import { feature } from 'bun:bundle'
|
|
import { shouldAutoEnableClaudeInChrome } from 'src/utils/claudeInChrome/setup.js'
|
|
import { Extension as ReviewExtension } from 'src/costrict/review/index.js'
|
|
import { registerBatchSkill } from './batch.js'
|
|
import { registerClaudeInChromeSkill } from './claudeInChrome.js'
|
|
import { registerDebugSkill } from './debug.js'
|
|
import { registerKeybindingsSkill } from './keybindings.js'
|
|
import { registerLoremIpsumSkill } from './loremIpsum.js'
|
|
import { registerRememberSkill } from './remember.js'
|
|
import { registerSimplifySkill } from './simplify.js'
|
|
import { registerSkillifySkill } from './skillify.js'
|
|
import { registerStuckSkill } from './stuck.js'
|
|
import { registerCronDeleteSkill, registerCronListSkill } from './cronManage.js'
|
|
import { registerLoopSkill } from './loop.js'
|
|
import { registerDreamSkill } from './dream.js'
|
|
import { registerUpdateConfigSkill } from './updateConfig.js'
|
|
import { registerVerifySkill } from './verify.js'
|
|
import { registerStrictPlanSkill } from 'src/costrict/skills/strictPlan.js'
|
|
import { registerStrictSpecSkill } from 'src/costrict/skills/strictSpec.js'
|
|
import { registerProjectWikiSkill } from 'src/costrict/skills/projectWiki.js'
|
|
import { registerTddSkill } from 'src/costrict/skills/tdd.js'
|
|
|
|
/**
|
|
* Initialize all bundled skills.
|
|
* Called at startup to register skills that ship with the CLI.
|
|
*
|
|
* To add a new bundled skill:
|
|
* 1. Create a new file in src/skills/bundled/ (e.g., myskill.ts)
|
|
* 2. Export a register function that calls registerBundledSkill()
|
|
* 3. Import and call that function here
|
|
*/
|
|
export function initBundledSkills(): void {
|
|
// Extract review skills to disk for standard scanner discovery
|
|
ReviewExtension.initializeBuiltinSkills().catch(() => {})
|
|
|
|
registerUpdateConfigSkill()
|
|
registerProjectWikiSkill()
|
|
registerTddSkill()
|
|
registerStrictPlanSkill()
|
|
registerStrictSpecSkill()
|
|
registerKeybindingsSkill()
|
|
registerVerifySkill()
|
|
registerDebugSkill()
|
|
registerLoremIpsumSkill()
|
|
registerSkillifySkill()
|
|
registerRememberSkill()
|
|
registerSimplifySkill()
|
|
registerBatchSkill()
|
|
registerStuckSkill()
|
|
registerLoopSkill()
|
|
registerCronListSkill()
|
|
registerCronDeleteSkill()
|
|
registerDreamSkill()
|
|
if (feature('REVIEW_ARTIFACT')) {
|
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
const { registerHunterSkill } = require('./hunter.js')
|
|
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
registerHunterSkill()
|
|
}
|
|
if (feature('AGENT_TRIGGERS_REMOTE')) {
|
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
const {
|
|
registerScheduleRemoteAgentsSkill,
|
|
} = require('./scheduleRemoteAgents.js')
|
|
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
registerScheduleRemoteAgentsSkill()
|
|
}
|
|
if (feature('BUILDING_CLAUDE_APPS')) {
|
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
const { registerClaudeApiSkill } = require('./claudeApi.js')
|
|
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
registerClaudeApiSkill()
|
|
}
|
|
if (shouldAutoEnableClaudeInChrome()) {
|
|
registerClaudeInChromeSkill()
|
|
}
|
|
if (feature('RUN_SKILL_GENERATOR')) {
|
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
const { registerRunSkillGeneratorSkill } = require('./runSkillGenerator.js')
|
|
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
registerRunSkillGeneratorSkill()
|
|
}
|
|
}
|