@localsummer/incspec 0.0.5 → 0.0.6
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: 分析代码工作流,生成带编号的API调用时序图、依赖关系图和依赖总结
|
|
3
|
-
argument-hint: <
|
|
3
|
+
argument-hint: <source-path> [target-dir]
|
|
4
4
|
allowed-tools: Glob, Grep, Read, Write, Bash
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -9,13 +9,13 @@ allowed-tools: Glob, Grep, Read, Write, Bash
|
|
|
9
9
|
在开始分析前,先用 Bash 执行:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
incspec analyze <
|
|
12
|
+
incspec analyze <source-path> --module=<module> --workflow=analyze-<module>
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
完成报告写入后,再用 Bash 执行:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
incspec analyze <
|
|
18
|
+
incspec analyze <source-path> --module=<module> --workflow=analyze-<module> --complete --output=<output-file>
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
**使用现有基准报告** (跳过分析):
|
|
@@ -35,7 +35,7 @@ incspec analyze --baseline=<baseline-file> [--module=<module>] [--workflow=<work
|
|
|
35
35
|
---
|
|
36
36
|
|
|
37
37
|
说明:
|
|
38
|
-
- `<module>` 默认为
|
|
38
|
+
- `<module>` 默认为 source-path 最后一级目录名,若用户显式指定模块名则使用该值
|
|
39
39
|
- `<output-file>` 必须与最终写入的文件名一致
|
|
40
40
|
- 若 incspec 提示未初始化,请先运行 `incspec init`
|
|
41
41
|
|
|
@@ -45,19 +45,19 @@ incspec analyze --baseline=<baseline-file> [--module=<module>] [--workflow=<work
|
|
|
45
45
|
|
|
46
46
|
你需要完成以下任务:
|
|
47
47
|
|
|
48
|
-
1. **代码分析**:检查
|
|
48
|
+
1. **代码分析**:检查 source-path 目录下的所有组件和Store文件,识别初始化阶段的API调用
|
|
49
49
|
2. **时序图绘制**:构建带编号的API调用时序图,展示调用顺序
|
|
50
50
|
3. **依赖图绘制**:构建带编号的API依赖关系图,展示依赖关系
|
|
51
51
|
4. **依赖总结**:生成带编号的依赖关系文字总结
|
|
52
|
-
5. **Markdown输出**:将分析结果输出到
|
|
52
|
+
5. **Markdown输出**:将分析结果输出到 target-dir 目录
|
|
53
53
|
|
|
54
54
|
**重要提示**:默认情况下,只输出上述核心分析内容。只有在用户明确要求提供"潜在问题与优化建议"时,才在文档末尾添加该部分内容。
|
|
55
55
|
|
|
56
56
|
## 输出配置
|
|
57
57
|
|
|
58
|
-
- **
|
|
58
|
+
- **target-dir**: 报告输出目录,默认 `incspec/baselines`
|
|
59
59
|
- **文件命名**: `{module}-baseline-v{n}.md`
|
|
60
|
-
- `{module}`: 模块名称,从
|
|
60
|
+
- `{module}`: 模块名称,从 source-path 的最后一级目录名推断,或由用户指定
|
|
61
61
|
- `{n}`: 版本号,扫描目标目录中同名前缀的文件,取最大版本号+1,若无则为 1
|
|
62
62
|
- **示例**: 分析 `src/views/resume` 目录,输出 `incspec/baselines/resume-baseline-v1.md`
|
|
63
63
|
|
|
@@ -85,7 +85,7 @@ incspec analyze --baseline=<baseline-file> [--module=<module>] [--workflow=<work
|
|
|
85
85
|
|
|
86
86
|
### 第一步:代码扫描
|
|
87
87
|
|
|
88
|
-
- 使用 Glob 工具扫描
|
|
88
|
+
- 使用 Glob 工具扫描 source-path 目录下的所有文件
|
|
89
89
|
- 关注文件类型:
|
|
90
90
|
- 组件文件(.jsx, .tsx, .js, .ts)
|
|
91
91
|
- Store文件(Zustand, MobX等)
|
|
@@ -132,7 +132,7 @@ incspec analyze --baseline=<baseline-file> [--module=<module>] [--workflow=<work
|
|
|
132
132
|
# [模块名称] API工作流分析
|
|
133
133
|
|
|
134
134
|
**分析时间**: [自动生成的时间戳]
|
|
135
|
-
**分析范围**: [
|
|
135
|
+
**分析范围**: [source-path的相对路径或绝对路径]
|
|
136
136
|
|
|
137
137
|
## 概述
|
|
138
138
|
|
|
@@ -287,8 +287,8 @@ graph TD
|
|
|
287
287
|
|
|
288
288
|
## 工作流程
|
|
289
289
|
|
|
290
|
-
1. **确认路径**:验证
|
|
291
|
-
2. **生成元信息**:记录分析时间(使用当前时间戳)和分析范围(
|
|
290
|
+
1. **确认路径**:验证 source-path 和 target-dir 的有效性
|
|
291
|
+
2. **生成元信息**:记录分析时间(使用当前时间戳)和分析范围(source-path)
|
|
292
292
|
3. **扫描目录**:使用 Glob 工具获取所有相关文件
|
|
293
293
|
4. **分析文件**:使用 Read 工具逐个分析文件中的API调用
|
|
294
294
|
5. **构建模型**:在内存中构建完整的API调用关系模型
|
|
@@ -296,7 +296,7 @@ graph TD
|
|
|
296
296
|
7. **生成图表**:使用Mermaid语法创建带编号的可视化图表
|
|
297
297
|
8. **编写文档**:按照规范格式生成Markdown文档(包含元信息和三个核心部分)
|
|
298
298
|
9. **可选增强**:仅当用户明确要求时,在文档末尾添加"潜在问题与优化建议"部分
|
|
299
|
-
10. **保存输出**:使用 Write 工具保存到
|
|
299
|
+
10. **保存输出**:使用 Write 工具保存到 target-dir
|
|
300
300
|
|
|
301
301
|
## 质量标准
|
|
302
302
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: 基于现状、需求和依赖,生成增量需求的设计蓝图(时序、依赖、文件变更),指导代码生成
|
|
3
|
-
argument-hint: [
|
|
3
|
+
argument-hint: [baseline-snapshot-path] [structured-requirements-path] [ui-dependencies-path] [report-output-dir]
|
|
4
4
|
allowed-tools: Glob, Grep, Read, Write, Bash
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -31,9 +31,9 @@ incspec design --feature=<feature> --complete --output=<output-file>
|
|
|
31
31
|
|
|
32
32
|
接收以下三份材料(由用户提供或从指定文件读取):
|
|
33
33
|
|
|
34
|
-
1.
|
|
35
|
-
2.
|
|
36
|
-
3. **
|
|
34
|
+
1. **baseline-snapshot-path** (来自 `analyze-codeflow`): 包含 S1~Sxx 时序编号、Dxx 依赖节点、Rxx 关系总结
|
|
35
|
+
2. **structured-requirements-path** (来自 `structured-requirements-collection`): 包含新增/修改功能、触发条件、核心状态、数据流向的 5 列表格
|
|
36
|
+
3. **ui-dependencies-path** (来自 `ui-dependency-collection`): 包含依赖类型、来源路径、变更类型的依赖详情表
|
|
37
37
|
|
|
38
38
|
# 执行流程
|
|
39
39
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: 将增量需求报告融合为新的代码流基线快照
|
|
3
|
-
argument-hint: <increment-report-path> [baseline-output-
|
|
3
|
+
argument-hint: <increment-report-path> [baseline-output-dir]
|
|
4
4
|
allowed-tools: Read, Write, Bash
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -38,7 +38,7 @@ incspec merge <increment-report-path> --complete --output=<output-file>
|
|
|
38
38
|
# 输入参数
|
|
39
39
|
|
|
40
40
|
1. **increment-report-path** (必填): 增量需求融合快照报告的完整路径(如 increment-codeflow-v2.md)
|
|
41
|
-
2. **baseline-output-
|
|
41
|
+
2. **baseline-output-dir** (可选): 新基线报告的输出路径,默认为 `<原文件名>-baseline.md`
|
|
42
42
|
|
|
43
43
|
# 执行流程
|
|
44
44
|
|
|
@@ -202,7 +202,7 @@ D3_DEL (删除) -> 已移除
|
|
|
202
202
|
- 新基线总节点: N 个
|
|
203
203
|
|
|
204
204
|
📁 输出文件:
|
|
205
|
-
✓ <baseline-output-
|
|
205
|
+
✓ <baseline-output-dir>
|
|
206
206
|
|
|
207
207
|
🔄 下一步操作:
|
|
208
208
|
1. 检查新基线报告的完整性
|
|
@@ -268,7 +268,7 @@ D3_DEL (删除) -> 已移除
|
|
|
268
268
|
|
|
269
269
|
## 输出目录
|
|
270
270
|
|
|
271
|
-
- **baseline-output-
|
|
271
|
+
- **baseline-output-dir**: 默认为 `incspec/baselines`
|
|
272
272
|
- 如目录不存在,需主动创建
|
|
273
273
|
|
|
274
274
|
## 文件命名
|