sillyspec 3.7.31 → 3.7.32
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/package.json +1 -1
- package/src/stages/quick.js +10 -43
- package/fix-input.js +0 -15
package/package.json
CHANGED
package/src/stages/quick.js
CHANGED
|
@@ -5,14 +5,14 @@ export const definition = {
|
|
|
5
5
|
auxiliary: true,
|
|
6
6
|
steps: [
|
|
7
7
|
{
|
|
8
|
-
name: '
|
|
8
|
+
name: '理解任务',
|
|
9
9
|
prompt: `解析任务参数,加载项目上下文。
|
|
10
10
|
|
|
11
11
|
### 操作
|
|
12
12
|
1. 检查是否携带 \`--change <变更名>\`,确定记录方式
|
|
13
13
|
2. 理解任务:模糊则问一个问题确认
|
|
14
|
-
3. 加载上下文:\`cat
|
|
15
|
-
4.
|
|
14
|
+
3. 加载上下文:\`cat docs/<project>/scan/CONVENTIONS.md 2>/dev/null\`
|
|
15
|
+
4. 如有需要,查询知识库:\`cat .sillyspec/knowledge/INDEX.md 2>/dev/null\`
|
|
16
16
|
|
|
17
17
|
### 输出
|
|
18
18
|
任务理解 + 上下文摘要`,
|
|
@@ -20,57 +20,24 @@ export const definition = {
|
|
|
20
20
|
optional: false
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
name: '
|
|
24
|
-
prompt:
|
|
25
|
-
|
|
26
|
-
### 操作
|
|
27
|
-
1. \`cat .sillyspec/knowledge/INDEX.md 2>/dev/null\` — 根据关键词匹配
|
|
28
|
-
2. 命中时 \`cat\` 对应知识文件
|
|
29
|
-
3. 如果涉及不熟悉的库/框架/API:通过 Context7 查询官方文档
|
|
30
|
-
4. 将查询结果纳入后续开发考量
|
|
31
|
-
|
|
32
|
-
### 输出
|
|
33
|
-
相关知识条目和文档查询结果`,
|
|
34
|
-
outputHint: '知识查询结果',
|
|
35
|
-
optional: true
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'TDD 实现',
|
|
39
|
-
prompt: `按 TDD 流程实现任务。
|
|
23
|
+
name: '实现并验证',
|
|
24
|
+
prompt: `实现任务。
|
|
40
25
|
|
|
41
26
|
### 操作
|
|
42
27
|
1. 先读后写:调用已有方法前 \`cat\` 源文件确认签名,\`grep\` 确认方法存在
|
|
43
|
-
2.
|
|
44
|
-
3.
|
|
45
|
-
4.
|
|
46
|
-
5. ✅ STAGE → git add 暂存(测试文件必须包含)
|
|
47
|
-
|
|
48
|
-
### 纯配置/数据/文档可跳过 TDD,其他一律走 TDD。
|
|
28
|
+
2. 写代码完成任务
|
|
29
|
+
3. 如涉及逻辑变更,建议写单元测试验证(不强制,纯配置/文档/小改动可跳过)
|
|
30
|
+
4. **不要编译!** 除非用户明确要求或改动量很大
|
|
49
31
|
|
|
50
32
|
### 输出
|
|
51
33
|
实现摘要 + 修改文件列表
|
|
52
34
|
|
|
53
35
|
### 铁律
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
- ❌ 跳过测试因为"任务太简单"`,
|
|
36
|
+
- 不要修改无关文件
|
|
37
|
+
- 不要编造不存在的 CLI 子命令`,
|
|
57
38
|
outputHint: '实现摘要',
|
|
58
39
|
optional: false
|
|
59
40
|
},
|
|
60
|
-
{
|
|
61
|
-
name: '运行测试',
|
|
62
|
-
prompt: `运行测试确认通过。
|
|
63
|
-
|
|
64
|
-
### 操作
|
|
65
|
-
1. 检查 local.yaml 构建命令配置:\`cat .sillyspec/local.yaml 2>/dev/null\`
|
|
66
|
-
2. 有则使用 local.yaml 中的命令,否则使用默认命令
|
|
67
|
-
3. 默认命令:\`mvn test -pl <模块> -Dtest=<测试类>\` 或 \`./gradlew test --tests <测试类>\` 或 \`pnpm test\` 或 \`npm test\` 或 \`pytest <测试文件>\`
|
|
68
|
-
|
|
69
|
-
### 输出
|
|
70
|
-
测试通过/失败结果`,
|
|
71
|
-
outputHint: '测试结果',
|
|
72
|
-
optional: false
|
|
73
|
-
},
|
|
74
41
|
{
|
|
75
42
|
name: '暂存和记录',
|
|
76
43
|
prompt: `Git 暂存并记录任务。
|
package/fix-input.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const p = 'src/run.js';
|
|
3
|
-
let c = fs.readFileSync(p, 'utf8');
|
|
4
|
-
|
|
5
|
-
const old = `- 输出:${outputText}\n\``;
|
|
6
|
-
const rep = `${inputText ? `- 输入:${inputText}\n` : ''}- 输出:${outputText}\n\``;
|
|
7
|
-
|
|
8
|
-
const count = c.split(old).length - 1;
|
|
9
|
-
console.log(`Found ${count} occurrences`);
|
|
10
|
-
|
|
11
|
-
if (count > 0) {
|
|
12
|
-
c = c.replaceAll(old, rep);
|
|
13
|
-
fs.writeFileSync(p, c);
|
|
14
|
-
console.log('Replaced');
|
|
15
|
-
}
|