draftgo-cli 2.0.1 → 2.0.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/README.md CHANGED
@@ -147,6 +147,18 @@ CLI v1.2.0 在 skill 包里追加了一套**分级开发流程规范**(`rules/
147
147
 
148
148
  ---
149
149
 
150
+ ## v2.0.2 升级要点(统一目标识别信号)
151
+
152
+ CLI v2.0.2 进一步完善 `draftgo update` 的目标识别逻辑,避免只修到单个工具而遗漏其他 AI 工具。
153
+
154
+ **核心变化:**
155
+
156
+ - **平台定义成为单一信号源**:每个 AI 工具的入口文件、skill 目录和项目级探测信号统一维护在 `platforms.js`,`init / update / doctor` 共用同一份识别依据。
157
+ - **update 覆盖所有检测到的工具**:不传 target 时,`draftgo update` 会合并“已安装 skill 的目标”和“项目中检测到的 AI 工具信号”,并刷新全部命中的工具。
158
+ - **全平台测试覆盖**:单测现在会同时模拟 Claude Code、Cursor、Windsurf、Antigravity、Kiro、GitHub Copilot、Codex、Gemini 的项目级信号,防止后续再出现只命中部分工具的问题。
159
+
160
+ ---
161
+
150
162
  ## v2.0.1 升级要点(update 目标识别修复)
151
163
 
152
164
  CLI v2.0.1 修复 `draftgo update` 空参数时只刷新部分工具的问题。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draftgo-cli",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Install and manage the DraftGo skill across AI coding agents (Claude Code, Codex, Cursor, Windsurf, Antigravity, Copilot, Gemini, Kiro).",
5
5
  "bin": {
6
6
  "draftgo": "bin/draftgo.js"
package/src/detect.js CHANGED
@@ -2,19 +2,13 @@
2
2
 
3
3
  const path = require('path');
4
4
  const { exists } = require('./fsx');
5
+ const { platforms } = require('./platforms');
5
6
 
6
7
  // Each target declares one or more signals (files/dirs). If ANY signal matches,
7
8
  // the target is considered "in use" in the current project.
8
- const SIGNALS = {
9
- claudecode: ['.claude', 'CLAUDE.md'],
10
- kiro: ['.kiro'],
11
- cursor: ['.cursor'],
12
- windsurf: ['.windsurf'],
13
- antigravity:['.agent'],
14
- copilot: ['.github/prompts', '.github/copilot-instructions.md'],
15
- codex: ['.codex', 'AGENTS.md'],
16
- gemini: ['.gemini', 'GEMINI.md'],
17
- };
9
+ const SIGNALS = Object.fromEntries(
10
+ platforms.map((p) => [p.name, p.signals || []])
11
+ );
18
12
 
19
13
  function detectTargets(projectDir) {
20
14
  const hits = [];
package/src/platforms.js CHANGED
@@ -10,6 +10,7 @@
10
10
  // skillDir : project-relative path used to substitute {{SKILL_DIR}} in
11
11
  // template files (typically === assetDir written with forward
12
12
  // slashes so it works in markdown)
13
+ // signals : project-level files/dirs that indicate the tool is in use
13
14
  // frontmatter: object → prepended as YAML frontmatter to mainFile; null →
14
15
  // no frontmatter
15
16
  //
@@ -28,6 +29,7 @@ const platforms = [
28
29
  mainFile: '.claude/skills/draftgo/SKILL.md',
29
30
  assetDir: '.claude/skills/draftgo',
30
31
  skillDir: '.claude/skills/draftgo',
32
+ signals: ['.claude', 'CLAUDE.md'],
31
33
  frontmatter: { name: SKILL_NAME, description: DESCRIPTION },
32
34
  },
33
35
  {
@@ -36,6 +38,7 @@ const platforms = [
36
38
  mainFile: '.cursor/commands/draftgo.md',
37
39
  assetDir: '.cursor/commands/draftgo',
38
40
  skillDir: '.cursor/commands/draftgo',
41
+ signals: ['.cursor'],
39
42
  frontmatter: { name: SKILL_NAME, description: DESCRIPTION },
40
43
  },
41
44
  {
@@ -44,6 +47,7 @@ const platforms = [
44
47
  mainFile: '.windsurf/workflows/draftgo.md',
45
48
  assetDir: '.windsurf/workflows/draftgo',
46
49
  skillDir: '.windsurf/workflows/draftgo',
50
+ signals: ['.windsurf'],
47
51
  frontmatter: { name: SKILL_NAME, description: DESCRIPTION },
48
52
  },
49
53
  {
@@ -52,6 +56,7 @@ const platforms = [
52
56
  mainFile: '.agent/workflows/draftgo.md',
53
57
  assetDir: '.agent/workflows/draftgo',
54
58
  skillDir: '.agent/workflows/draftgo',
59
+ signals: ['.agent'],
55
60
  frontmatter: { name: SKILL_NAME, description: DESCRIPTION },
56
61
  },
57
62
  {
@@ -60,6 +65,7 @@ const platforms = [
60
65
  mainFile: '.kiro/steering/draftgo.md',
61
66
  assetDir: '.kiro/steering/draftgo',
62
67
  skillDir: '.kiro/steering/draftgo',
68
+ signals: ['.kiro'],
63
69
  frontmatter: { inclusion: 'manual', name: SKILL_NAME, description: DESCRIPTION },
64
70
  },
65
71
  {
@@ -68,6 +74,7 @@ const platforms = [
68
74
  mainFile: '.github/prompts/draftgo.prompt.md',
69
75
  assetDir: '.github/prompts/draftgo',
70
76
  skillDir: '.github/prompts/draftgo',
77
+ signals: ['.github/prompts', '.github/copilot-instructions.md'],
71
78
  frontmatter: { mode: 'agent', description: DESCRIPTION },
72
79
  },
73
80
  {
@@ -76,6 +83,7 @@ const platforms = [
76
83
  mainFile: '.codex/skills/draftgo/SKILL.md',
77
84
  assetDir: '.codex/skills/draftgo',
78
85
  skillDir: '.codex/skills/draftgo',
86
+ signals: ['.codex', 'AGENTS.md'],
79
87
  frontmatter: { name: SKILL_NAME, description: DESCRIPTION },
80
88
  },
81
89
  {
@@ -84,6 +92,7 @@ const platforms = [
84
92
  mainFile: '.gemini/skills/draftgo/SKILL.md',
85
93
  assetDir: '.gemini/skills/draftgo',
86
94
  skillDir: '.gemini/skills/draftgo',
95
+ signals: ['.gemini', 'GEMINI.md'],
87
96
  frontmatter: { name: SKILL_NAME, description: DESCRIPTION },
88
97
  },
89
98
  ];