dev-playbooks-cn 2.5.1 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.5.2] - 2026-01-23
9
+
10
+ ### Fixed
11
+
12
+ - **init 命令支持 Factory 和 Cursor**:
13
+ - 将 Factory 添加为完整 Skills 支持的工具
14
+ - 将 Cursor 从 Rules 系统升级为完整 Skills 支持
15
+ - 现在运行 `dev-playbooks-cn init` 时可以选择 Factory 和 Cursor
16
+ - Skills 会正确安装到 `.factory/skills/` 和 `.cursor/skills/`
17
+
18
+ - **更通用的 Skills 安装逻辑**:
19
+ - 移除硬编码的工具 ID 检查
20
+ - 支持所有定义了 `skillsDir` 的工具
21
+ - 支持相对路径的 `skillsDir`(如 `.factory/skills`)
22
+
23
+ ---
24
+
8
25
  ## [2.5.1] - 2026-01-23
9
26
 
10
27
  ### Fixed
package/bin/devbooks.js CHANGED
@@ -98,13 +98,26 @@ const AI_TOOLS = [
98
98
  available: true
99
99
  },
100
100
 
101
- // === Rules 类似系统 ===
101
+ // === Factory(原生 Skills 支持)===
102
+ {
103
+ id: 'factory',
104
+ name: 'Factory',
105
+ description: 'Factory Droid',
106
+ skillsSupport: SKILLS_SUPPORT.FULL,
107
+ slashDir: null,
108
+ skillsDir: '.factory/skills', // 项目级
109
+ instructionFile: null,
110
+ available: true
111
+ },
112
+
113
+ // === Cursor(原生 Skills 支持)===
102
114
  {
103
115
  id: 'cursor',
104
116
  name: 'Cursor',
105
117
  description: 'Cursor AI IDE',
106
- skillsSupport: SKILLS_SUPPORT.RULES,
118
+ skillsSupport: SKILLS_SUPPORT.FULL,
107
119
  slashDir: '.cursor/commands/devbooks',
120
+ skillsDir: '.cursor/skills', // 项目级
108
121
  rulesDir: '.cursor/rules',
109
122
  instructionFile: null,
110
123
  available: true
@@ -903,7 +916,11 @@ async function promptInstallScope(projectDir, selectedTools) {
903
916
  function getSkillsDestDir(tool, scope, projectDir) {
904
917
  // 根据安装范围确定目标目录
905
918
  if (scope === INSTALL_SCOPE.PROJECT) {
906
- // 项目级安装:使用项目目录下的相对路径
919
+ // 项目级安装:如果 skillsDir 是相对路径,使用项目目录
920
+ if (tool.skillsDir && !path.isAbsolute(tool.skillsDir)) {
921
+ return path.join(projectDir, tool.skillsDir);
922
+ }
923
+ // 兼容旧的硬编码逻辑
907
924
  if (tool.id === 'claude') {
908
925
  return path.join(projectDir, '.claude', 'skills');
909
926
  } else if (tool.id === 'codex') {
@@ -925,8 +942,8 @@ function installSkills(toolIds, projectDir, scope = INSTALL_SCOPE.GLOBAL, update
925
942
  const tool = AI_TOOLS.find(t => t.id === toolId);
926
943
  if (!tool || tool.skillsSupport !== SKILLS_SUPPORT.FULL) continue;
927
944
 
928
- // Claude Code / Codex CLI / OpenCode / Every Code 支持相同格式的 Skills
929
- if ((toolId === 'claude' || toolId === 'codex' || toolId === 'opencode' || toolId === 'code') && tool.skillsDir) {
945
+ // 所有支持完整 Skills 的工具
946
+ if (tool.skillsDir) {
930
947
  const skillsSrcDir = path.join(__dirname, '..', 'skills');
931
948
  const skillsDestDir = getSkillsDestDir(tool, scope, projectDir);
932
949
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dev-playbooks-cn",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "description": "AI-driven spec-based development workflow",
5
5
  "keywords": [
6
6
  "devbooks",