@localsummer/incspec 0.1.0 → 0.1.1
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/commands/init.mjs +1 -1
- package/commands/sync.mjs +4 -4
- package/lib/cursor.mjs +2 -2
- package/package.json +1 -1
- package/templates/AGENTS.md +7 -2
- package/templates/inc-spec-skill/SKILL.md +15 -9
- /package/templates/{cursor-commands → commands}/analyze-codeflow.md +0 -0
- /package/templates/{cursor-commands → commands}/analyze-increment-codeflow.md +0 -0
- /package/templates/{cursor-commands → commands}/apply-increment-code.md +0 -0
- /package/templates/{cursor-commands → commands}/inc-archive.md +0 -0
- /package/templates/{cursor-commands → commands}/merge-to-baseline.md +0 -0
- /package/templates/{cursor-commands → commands}/structured-requirements-collection.md +0 -0
- /package/templates/{cursor-commands → commands}/ui-dependency-collection.md +0 -0
package/commands/init.mjs
CHANGED
|
@@ -121,7 +121,7 @@ export async function initCommand(ctx) {
|
|
|
121
121
|
print('');
|
|
122
122
|
print(colorize('下一步:', colors.bold));
|
|
123
123
|
print(colorize(` 1. 运行 'incspec status' 查看工作流状态`, colors.dim));
|
|
124
|
-
print(colorize(` 2. 运行 'incspec
|
|
124
|
+
print(colorize(` 2. 运行 'incspec sync' 同步 Cursor 命令`, colors.dim));
|
|
125
125
|
print(colorize(` 3. 使用 /incspec/inc-analyze 开始第一个工作流`, colors.dim));
|
|
126
126
|
print('');
|
|
127
127
|
}
|
package/commands/sync.mjs
CHANGED
|
@@ -114,12 +114,12 @@ async function syncCursor(ctx) {
|
|
|
114
114
|
{
|
|
115
115
|
name: `当前目录 (${cwd}/.cursor/commands/incspec/)`,
|
|
116
116
|
value: 'project',
|
|
117
|
-
description: '仅对当前目录生效',
|
|
117
|
+
description: colorize('仅对当前目录生效', colors.blue),
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
name: '全局目录 (~/.cursor/commands/incspec/)',
|
|
121
121
|
value: 'global',
|
|
122
|
-
description: '对所有项目生效',
|
|
122
|
+
description: colorize('对所有项目生效', colors.blue),
|
|
123
123
|
},
|
|
124
124
|
];
|
|
125
125
|
|
|
@@ -182,12 +182,12 @@ async function syncClaude(ctx) {
|
|
|
182
182
|
{
|
|
183
183
|
name: `当前目录 (${cwd}/.claude/skills/inc-spec-skill/)`,
|
|
184
184
|
value: 'project',
|
|
185
|
-
description: '仅对当前目录生效',
|
|
185
|
+
description: colorize('仅对当前目录生效', colors.blue),
|
|
186
186
|
},
|
|
187
187
|
{
|
|
188
188
|
name: '全局目录 (~/.claude/skills/inc-spec-skill/)',
|
|
189
189
|
value: 'global',
|
|
190
|
-
description: '对所有项目生效(推荐)',
|
|
190
|
+
description: colorize('对所有项目生效(推荐)', colors.blue),
|
|
191
191
|
},
|
|
192
192
|
];
|
|
193
193
|
|
package/lib/cursor.mjs
CHANGED
|
@@ -19,8 +19,8 @@ const GLOBAL_CURSOR_DIR = path.join(os.homedir(), '.cursor', 'commands', 'incspe
|
|
|
19
19
|
/** Claude commands source directory (user local) */
|
|
20
20
|
const CLAUDE_COMMANDS_DIR = path.join(os.homedir(), '.claude', 'commands', 'ai-increment');
|
|
21
21
|
|
|
22
|
-
/** Built-in templates directory
|
|
23
|
-
const TEMPLATES_DIR = fileURLToPath(new URL('../templates/
|
|
22
|
+
/** Built-in templates directory */
|
|
23
|
+
const TEMPLATES_DIR = fileURLToPath(new URL('../templates/commands', import.meta.url));
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Command mapping from Claude to Cursor
|
package/package.json
CHANGED
package/templates/AGENTS.md
CHANGED
|
@@ -141,7 +141,8 @@ incspec archive [--yes] [--keep] # 步骤7
|
|
|
141
141
|
# 验证与同步
|
|
142
142
|
incspec validate / v [--strict] # 验证完整性
|
|
143
143
|
incspec sync [--cursor|--claude|--all] [--global|--project] # IDE集成
|
|
144
|
-
incspec reset
|
|
144
|
+
incspec reset # 完全重置工作流(归档所有产出)
|
|
145
|
+
incspec reset --to=<step> # 部分回退到指定步骤(保留1-N,重置N+1至7)
|
|
145
146
|
```
|
|
146
147
|
|
|
147
148
|
## 文件格式示例
|
|
@@ -210,6 +211,10 @@ baseline: home-baseline-v1
|
|
|
210
211
|
| No baseline found | 先完成步骤 1 (analyze) |
|
|
211
212
|
| Previous step not completed | 运行 `incspec status` 检查进度 |
|
|
212
213
|
| Validation failed | 检查文件格式和编号序列 |
|
|
213
|
-
|
|
|
214
|
+
| 工作流卡住或状态异常 | `incspec reset` 完全重置,或 `incspec reset --to=N` 回退到步骤N |
|
|
215
|
+
|
|
216
|
+
**工作流重置**:
|
|
217
|
+
- 完全重置: `incspec reset` - 归档所有产出,回到初始状态
|
|
218
|
+
- 部分回退: `incspec reset --to=N` - 保留步骤1-N,重置N+1至7(示例:`--to=3` 保留1-3,重置4-7)
|
|
214
219
|
|
|
215
220
|
记住: **基线是真相,增量是提案**。通过工作流周期保持它们同步。
|
|
@@ -101,7 +101,8 @@ description: 设计优先的前端功能增量编码工作流。适用于实现
|
|
|
101
101
|
- `incspec status` - 查看工作流状态
|
|
102
102
|
- `incspec list` - 列出规范文件
|
|
103
103
|
- `incspec validate` - 验证项目健康状态
|
|
104
|
-
- `incspec reset
|
|
104
|
+
- `incspec reset` - 重置工作流到初始状态
|
|
105
|
+
- `incspec reset --to=N` - 回退到步骤N,保留1-N,重置N+1至7(示例:`--to=3` 保留1-3,重置4-7)
|
|
105
106
|
|
|
106
107
|
## 步骤详情
|
|
107
108
|
|
|
@@ -224,6 +225,10 @@ incspec archive <file> --keep # 复制而非移动
|
|
|
224
225
|
- 步骤5后: 验证所有文件已正确创建/修改
|
|
225
226
|
- 步骤7后: 确认工作区已清理
|
|
226
227
|
|
|
228
|
+
**工作流重置:**
|
|
229
|
+
- 完全重置: `incspec reset` - 归档所有产出,回到初始状态
|
|
230
|
+
- 部分回退: `incspec reset --to=N` - 保留步骤1-N,重置步骤N+1至7。示例:步骤5发现设计有误 → `--to=3` → 重做步骤4-7
|
|
231
|
+
|
|
227
232
|
**人工确认点:**
|
|
228
233
|
|
|
229
234
|
| 步骤 | 确认级别 | 快速模式 | 说明 |
|
|
@@ -241,14 +246,15 @@ incspec archive <file> --keep # 复制而非移动
|
|
|
241
246
|
|
|
242
247
|
## 常见陷阱
|
|
243
248
|
|
|
244
|
-
| 陷阱 | 后果 |
|
|
245
|
-
|
|
246
|
-
| 跳过代码流程分析 | 集成问题,返工 |
|
|
247
|
-
| 接受模糊需求 | 编码时发现歧义 |
|
|
248
|
-
| 遗漏依赖 | 导入错误,运行时失败 |
|
|
249
|
-
| 编码先于设计 | 在不符合架构的实现上浪费精力 |
|
|
250
|
-
| 跳过基线合并 | 对当前系统状态产生混淆 |
|
|
251
|
-
| 忽略归档 | 工作区杂乱,历史丢失 |
|
|
249
|
+
| 陷阱 | 后果 | 解决方案 |
|
|
250
|
+
|------|------|----------|
|
|
251
|
+
| 跳过代码流程分析 | 集成问题,返工 | 始终从步骤1开始,建立准确基线 |
|
|
252
|
+
| 接受模糊需求 | 编码时发现歧义 | 步骤2必须确认,消除所有模糊术语 |
|
|
253
|
+
| 遗漏依赖 | 导入错误,运行时失败 | 完整模式严格执行步骤3 |
|
|
254
|
+
| 编码先于设计 | 在不符合架构的实现上浪费精力 | 完整模式严格执行步骤4,步骤4设计获批后才执行步骤5 |
|
|
255
|
+
| 跳过基线合并 | 对当前系统状态产生混淆 | 每次增量后必须执行步骤6 |
|
|
256
|
+
| 忽略归档 | 工作区杂乱,历史丢失 | 工作流完成后立即执行步骤7 |
|
|
257
|
+
| 工作流状态不一致 | CLI命令执行失败 | 使用 `incspec status` 检查状态,必要时使用 `incspec reset` 修复 |
|
|
252
258
|
|
|
253
259
|
## 参考资源
|
|
254
260
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|