@@ -77,6 +77,7 @@ const TARGETS = [
7777 { name : 'Hermes Agent' , dir : '.hermes/skills' , detect : [ '.hermes' , 'HERMES.md' , '.hermes.md' ] } ,
7878 { name : 'Claw Code' , dir : '.claw/skills' , detect : [ '.claw' , 'CLAW.md' ] } ,
7979 { name : 'Qoder' , dir : '.qoder/skills' , detect : '.qoder' , global : { dir : '.qoder/skills' , detect : '.qoder' } } ,
80+ { name : 'CodeBuddy' , dir : '.codebuddy/skills' , detect : [ '.codebuddy' , 'CODEBUDDY.md' ] } ,
8081] ;
8182
8283function countDirs ( dir ) {
@@ -426,6 +427,49 @@ ${skillList}
426427 }
427428}
428429
430+ // CodeBuddy(腾讯 AI IDE)—— 加载机制类似 Claude Code:项目根 CODEBUDDY.md 作 bootstrap,
431+ // skills 放 .codebuddy/skills/。仅项目级(其用户级 skills 加载路径未证实,暂不做全局)。
432+ function generateCodeBuddyBootstrap ( baseDir ) {
433+ const skillEntries = scanSkillEntries ( SKILLS_SRC ) ;
434+ const skillList = skillEntries . map ( s => `- **${ s . name } **: ${ s . desc } ` ) . join ( '\n' ) ;
435+
436+ const content = `# Superpowers-ZH 中文增强版
437+
438+ 本项目已安装 superpowers-zh 技能框架(${ skillEntries . length } 个 skills)。
439+
440+ ## 核心规则
441+
442+ 1. **收到任务时,先检查是否有匹配的 skill** — 哪怕只有 1% 的可能性也要检查
443+ 2. **设计先于编码** — 收到功能需求时,先用 brainstorming skill 做需求分析
444+ 3. **测试先于实现** — 写代码前先写测试(TDD)
445+ 4. **验证先于完成** — 声称完成前必须运行验证命令
446+
447+ ## 可用 Skills
448+
449+ Skills 位于 \`.codebuddy/skills/\` 目录,每个 skill 有独立的 \`SKILL.md\` 文件。
450+
451+ ${ skillList }
452+
453+ ## 如何使用
454+
455+ 当任务匹配某个 skill 时,读取对应的 \`.codebuddy/skills/<skill-name>/SKILL.md\` 并严格遵循其流程。
456+ ` ;
457+
458+ const mdPath = resolve ( baseDir , 'CODEBUDDY.md' ) ;
459+ if ( existsSync ( mdPath ) ) {
460+ const existing = readFileSync ( mdPath , 'utf8' ) ;
461+ if ( ! existing . includes ( 'superpowers-zh' ) ) {
462+ writeFileSync ( mdPath , existing . replace ( / \s + $ / , '' ) + '\n\n' + wrapWithSentinel ( content ) , 'utf8' ) ;
463+ console . log ( ` ✅ CodeBuddy: 追加 skills 引用 -> ${ mdPath } ` ) ;
464+ } else {
465+ console . log ( ` ✅ CodeBuddy: CODEBUDDY.md 已包含 superpowers-zh 引用` ) ;
466+ }
467+ } else {
468+ writeFileSync ( mdPath , wrapWithSentinel ( content ) , 'utf8' ) ;
469+ console . log ( ` ✅ CodeBuddy: bootstrap -> ${ mdPath } ` ) ;
470+ }
471+ }
472+
429473// 工具名称别名映射(用户输入 -> TARGETS.name)
430474const TOOL_ALIASES = {
431475 'claude' : 'Claude Code' ,
@@ -455,6 +499,10 @@ const TOOL_ALIASES = {
455499 'claw-code' : 'Claw Code' ,
456500 'clawcode' : 'Claw Code' ,
457501 'qoder' : 'Qoder' ,
502+ 'codebuddy' : 'CodeBuddy' ,
503+ 'codebuddy-code' : 'CodeBuddy' ,
504+ 'codebuddycode' : 'CodeBuddy' ,
505+ 'codebuddy-cn' : 'CodeBuddy' ,
458506} ;
459507
460508function showHelp ( ) {
@@ -537,6 +585,10 @@ function installForTarget(target, baseDir, isGlobal) {
537585 if ( target . name === 'Claude Code' ) {
538586 generateClaudeCodeBootstrap ( baseDir , isGlobal ) ;
539587 }
588+
589+ if ( target . name === 'CodeBuddy' ) {
590+ generateCodeBuddyBootstrap ( baseDir ) ;
591+ }
540592}
541593
542594function isHomeDir ( p ) {
@@ -558,6 +610,7 @@ const BOOTSTRAP_CLEAN_SECTION = [
558610 'GEMINI.md' ,
559611 'HERMES.md' ,
560612 'CONVENTIONS.md' ,
613+ 'CODEBUDDY.md' ,
561614] ;
562615const BOOTSTRAP_SECTION_MARKERS = [
563616 '# Superpowers-ZH 中文增强版' ,
0 commit comments