@zhanlucode/zl-darwin-arm64 1.6.4-moma.0
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/LICENSE +22 -0
- package/bin/rg +0 -0
- package/bin/tree-sitter/tree-sitter-bash.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-c.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-c_sharp.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-cpp.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-css.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-dart.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-elisp.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-elixir.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-elm.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-embedded_template.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-go.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-html.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-java.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-javascript.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-json.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-kotlin.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-lua.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-objc.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-ocaml.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-php.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-python.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-ql.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-rescript.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-ruby.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-rust.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-scala.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-solidity.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-swift.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-systemrdl.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-tlaplus.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-toml.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-tsx.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-typescript.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-vue.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-yaml.wasm +0 -0
- package/bin/tree-sitter/tree-sitter-zig.wasm +0 -0
- package/bin/tree-sitter/tree-sitter.wasm +0 -0
- package/bin/zhanlu-plugins/bundle-index.json +60 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/.claude-plugin/plugin.json +42 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/README.md +29 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/mcps/sast_fixer_mcp/README.md +10 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-check/SKILL.md +179 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-check/config/gitlab_config.json +5 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-check/prompts/step1_preparation.md +167 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-check/prompts/step2_consistency_check.md +446 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-check/scripts/gitlab_clone.py +213 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-check/scripts/read_excel_requirements.py +144 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-review/GITLAB_USAGE.md +160 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-review/QUICK_REFERENCE.md +149 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-review/README.md +134 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-review/SKILL.md +151 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-review/assets/review_standards.md +144 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-review/prompts/file_review_prompt.md +160 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-review/prompts/output_requirements.md +35 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-review/prompts/step1_project_preprocessing.md +106 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-review/prompts/step2_file_review.md +83 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-review/prompts/step3_report_generation.md +319 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/code-review/scripts/gitlab_clone.py +213 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/manual-test-case-generator/SKILL.md +366 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/manual-test-case-generator/references/generation-rules.md +214 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/manual-test-case-generator/references/query-rules.md +60 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/manual-test-case-generator/references/review-rules.md +117 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/manual-test-case-generator/references/save-rules.md +367 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/quality_scan/SKILL.md +195 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/requirement-analysis/SKILL.md +346 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/requirement-review/SKILL.md +267 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/requirements-gather/SKILL.md +187 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/sast_scan/SKILL.md +312 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/story-decomposer/SKILL.md +77 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/story-decomposer/evals/evals.json +34 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/story-decomposer/references/epic-to-story-methodology.md +122 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/story-decomposer/references/epic-to-story-template.md +93 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/story-decomposer/references/epic-to-story-to-task-template.md +221 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/story-decomposer/references/story-to-task-methodology.md +139 -0
- package/bin/zhanlu-plugins/lingji-alpha-assistant/skills/story-decomposer/references/story-to-task-template.md +89 -0
- package/bin/zhanlu-plugins/lingji-beta-assistant/.claude-plugin/plugin.json +19 -0
- package/bin/zhanlu-plugins/lingji-beta-assistant/README.md +21 -0
- package/bin/zhanlu-plugins/lingji-beta-assistant/skills/.gitkeep +1 -0
- package/bin/zhanlu-plugins/lingji-beta-assistant/skills/beta-requirement-analysis/SKILL.md +383 -0
- package/bin/zhanlu-plugins/lingji-beta-assistant/skills/beta-requirement-decomposer/SKILL.md +348 -0
- package/bin/zhanlu-plugins/lingji-beta-assistant/skills/beta-requirement-decomposer/references/epic-to-story-methodology.md +122 -0
- package/bin/zhanlu-plugins/lingji-beta-assistant/skills/beta-requirement-decomposer/references/epic-to-story-template.md +93 -0
- package/bin/zhanlu-plugins/lingji-beta-assistant/skills/beta-requirement-decomposer/references/epic-to-story-to-task-template.md +221 -0
- package/bin/zhanlu-plugins/lingji-beta-assistant/skills/beta-requirement-decomposer/references/story-to-task-methodology.md +139 -0
- package/bin/zhanlu-plugins/lingji-beta-assistant/skills/beta-requirement-decomposer/references/story-to-task-template.md +89 -0
- package/bin/zhanlu-plugins/lingji-beta-assistant/skills/beta-requirement-review/SKILL.md +350 -0
- package/bin/zhanlu-plugins/lingji-beta-assistant/skills/beta-requirements-gather/SKILL.md +244 -0
- package/bin/zl +4 -0
- package/package.json +18 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: requirement_gather
|
|
3
|
+
description: 通过 MCP 工具从需求管理系统中拉取用户需求,并按标准化模板整理为 Markdown 文档。当用户提到查看/获取/收集/盘点/拉取需求,以及"我的需求""我负责的""我创建的""分配给我的"等场景时触发。只要涉及从需求管理系统查询需求信息,就优先使用此 skill。
|
|
4
|
+
---
|
|
5
|
+
# 需求拉取
|
|
6
|
+
|
|
7
|
+
## 流程
|
|
8
|
+
|
|
9
|
+
### 第 1 步:身份解析
|
|
10
|
+
|
|
11
|
+
识别请求中涉及的需求相关人身份,并解析为需求系统可用的邮箱格式。身份来源分两种情况:
|
|
12
|
+
|
|
13
|
+
#### 情况 A:当前用户("我")
|
|
14
|
+
|
|
15
|
+
当请求中出现"我的需求""我负责的""我创建的""分配给我的"等指向当前用户的表述时,从本地认证文件读取身份信息。
|
|
16
|
+
|
|
17
|
+
windows系统路径 C盘用户下 `.local\share\zhanlu\auth_zhanlu.json(完整举例:`C:\Users\Admin\.local\share\zhanlu\auth_zhanlu.json `)`
|
|
18
|
+
|
|
19
|
+
**mac与linux路径:在用户文件夹下** `.local/share/zhanlu/auth_zhanlu.json`
|
|
20
|
+
|
|
21
|
+
该文件为 JSON 格式,用户信息位于 `metadata` 字段下。
|
|
22
|
+
|
|
23
|
+
从 `metadata` 中提取:
|
|
24
|
+
|
|
25
|
+
| 字段 | 说明 |
|
|
26
|
+
| ------------ | ------------ |
|
|
27
|
+
| `email` | 用户邮箱地址 |
|
|
28
|
+
| `userName` | 用户中文姓名 |
|
|
29
|
+
|
|
30
|
+
统一将邮箱后缀转换为 `@cmss.cmcc`:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
zhangsan@cmss.chinamobile.com → zhangsan@cmss.cmcc
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
#### 情况 B:指定人名的用户
|
|
37
|
+
|
|
38
|
+
当用户明确指定了某个人(如"获取负责人为张三的需求""李四提出的需求"),将该人姓名转换为拼音后追加 `@cmss.cmcc` 后缀。
|
|
39
|
+
|
|
40
|
+
转换规则:
|
|
41
|
+
|
|
42
|
+
- 中文姓名 → 全拼小写(不带声调),姓氏和名字**连写**,例如:
|
|
43
|
+
- 张三 → `zhangsan@cmss.cmcc`
|
|
44
|
+
- 欧阳锋 → `ouyangfeng@cmss.cmcc`
|
|
45
|
+
- 诸葛亮 → `zhugeliang@cmss.cmcc`
|
|
46
|
+
- 如果指定的人名本身已经是邮箱格式(含 `@cmss.cmcc`),直接使用,不做转换。
|
|
47
|
+
|
|
48
|
+
#### 输出身份检测结果
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
用户身份:
|
|
52
|
+
- 中文名:张三
|
|
53
|
+
- 邮箱(需求系统):zhangsan@cmss.cmcc
|
|
54
|
+
|
|
55
|
+
查询涉及的其他人员:
|
|
56
|
+
- 欧阳锋 → ouyangfeng@cmss.cmcc
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 第 2 步:提取查询条件
|
|
60
|
+
|
|
61
|
+
从用户请求中提取需求查询条件,包括但不限于:
|
|
62
|
+
|
|
63
|
+
- 时间范围(计划开始/结束时间、期望完成时间等)
|
|
64
|
+
- 需求状态(进行中、已完成、已关闭等)
|
|
65
|
+
- 关联项目、迭代、版本
|
|
66
|
+
- 优先级
|
|
67
|
+
- 负责人/提出人(如未使用身份解析自动填充)
|
|
68
|
+
- 需求关键词
|
|
69
|
+
|
|
70
|
+
**"xx"相关的语义映射:(xx为我或者指定人名)**
|
|
71
|
+
|
|
72
|
+
| 用户说法 | 含义 |
|
|
73
|
+
| ---------------- | ---------------------------- |
|
|
74
|
+
| "xx的需求" | 负责人 OR 创建人中有一个为xx |
|
|
75
|
+
| "xx负责的需求" | 负责人 = xx |
|
|
76
|
+
| "xx创建的需求" | 提出人 = xx |
|
|
77
|
+
| "分配给xx的需求" | 负责人 = xx |
|
|
78
|
+
|
|
79
|
+
**筛选逻辑:** 如果未指定项目等上下文,仅凭"xx的需求"等语义,则用解析出的邮箱作为 MCP 筛选条件。如果指定了具体项目(如"xx 项目下所有需求"),则人员字段不传,由项目范围兜底。
|
|
80
|
+
|
|
81
|
+
### 第 3 步:调用 MCP 拉取需求
|
|
82
|
+
|
|
83
|
+
调用 MCP 工具执行需求查询。将第 1 步的身份信息和第 2 步的查询条件传入 MCP 进行筛选。
|
|
84
|
+
|
|
85
|
+
**“类型”过滤规则:**
|
|
86
|
+
|
|
87
|
+
* 可选项为:`初始需求`、`用户故事`、`任务`
|
|
88
|
+
* 查询 **需求** (未特别指明类型)时,需同时填写这三个选项
|
|
89
|
+
* 用户明确指定类型时,仅填写对应选项
|
|
90
|
+
|
|
91
|
+
**“状态”过滤规则:**
|
|
92
|
+
|
|
93
|
+
* 若用户未明确指定需求状态范围,默认拉取状态为"新建"和"分析"的需求。
|
|
94
|
+
|
|
95
|
+
### 第 4 步:输出结果
|
|
96
|
+
|
|
97
|
+
根据用户的明确要求选择输出方式:
|
|
98
|
+
|
|
99
|
+
**场景 A — 用户要求保存为文档:** 按下方模板生成 Markdown 文件
|
|
100
|
+
|
|
101
|
+
- 保存到项目 `prd/` 文件夹下(先检查是否存在,如不存在则创建)
|
|
102
|
+
- 文件名称格式:`需求列表_YYYYMMDD.md`
|
|
103
|
+
|
|
104
|
+
> **重要:保存为文件必须使用完整模板。** 即使用户是在此 skill 已经展示过简要表格之后补充说"帮我存为 md",也必须使用下方的完整需求模板写入文件,禁止使用简要表格格式。简要表格仅用于纯查看场景。
|
|
105
|
+
|
|
106
|
+
**场景 B — 只是获取需求,暂未要求保存为本地文档:** 直接输出简要表格(每个需求一行),不保存文件。
|
|
107
|
+
|
|
108
|
+
## 输出模板
|
|
109
|
+
|
|
110
|
+
### 保存为本地文档(场景 A — 保存文件)
|
|
111
|
+
|
|
112
|
+
#### 单个需求详情
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
## 项目信息
|
|
116
|
+
- **空间名称**:
|
|
117
|
+
- **项目编码**:
|
|
118
|
+
- **项目名称**:
|
|
119
|
+
- **产品名称**:
|
|
120
|
+
|
|
121
|
+
## 需求 1
|
|
122
|
+
|
|
123
|
+
| 字段 | 值 |
|
|
124
|
+
|---|---|
|
|
125
|
+
| 需求Key | [填写需求Key] |
|
|
126
|
+
| 标题 | [填写标题] |
|
|
127
|
+
| 类型 | [填写类型] |
|
|
128
|
+
| 负责人 | [填写负责人] |
|
|
129
|
+
| 提出人 | [填写提出人] |
|
|
130
|
+
| 优先级 | [填写优先级] |
|
|
131
|
+
| 业务背景 | [填写业务背景] |
|
|
132
|
+
| 需求描述 | [填写需求描述] |
|
|
133
|
+
| 验收标准 | [填写验收标准] |
|
|
134
|
+
| 计划开始时间 | [填写计划开始时间] |
|
|
135
|
+
| 计划结束时间 | [填写计划结束时间] |
|
|
136
|
+
| 期望完成时间 | [填写期望完成时间] |
|
|
137
|
+
| 关联产品/业务平台类型 | [填写产品/业务平台类型] |
|
|
138
|
+
| 选择对应产品/业务平台 | [填写产品/业务平台名称] |
|
|
139
|
+
| 关联项目 | [填写关联项目] |
|
|
140
|
+
| 关联版本 | [填写关联版本] |
|
|
141
|
+
| 迭代 | [填写迭代] |
|
|
142
|
+
| 父需求 | [填写父需求Key,如无则为空] |
|
|
143
|
+
| 需求 URL | [填写需求URL,如无则为空] |
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
#### 多个需求详情
|
|
147
|
+
|
|
148
|
+
每个需求独立一个表格,用空行分隔,上方标注序号。多个需求前统一添加项目信息:
|
|
149
|
+
|
|
150
|
+
```markdown
|
|
151
|
+
## 项目信息
|
|
152
|
+
|
|
153
|
+
- **空间名称**: xxx
|
|
154
|
+
- **项目编码**: xxx
|
|
155
|
+
- **项目名称**: xxx
|
|
156
|
+
- **产品名称**: xxx
|
|
157
|
+
|
|
158
|
+
## 需求 1
|
|
159
|
+
|
|
160
|
+
| 字段 | 值 |
|
|
161
|
+
|---|---|
|
|
162
|
+
| ... | ... |
|
|
163
|
+
|
|
164
|
+
## 需求 2
|
|
165
|
+
|
|
166
|
+
| 字段 | 值 |
|
|
167
|
+
|---|---|
|
|
168
|
+
| ... | ... |
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### 简要表格(场景 B — 不保存文件)
|
|
172
|
+
|
|
173
|
+
每个需求一行:
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
| 需求Key | 标题 | 类型 | 负责人 | 提出人 | 状态 | 优先级 | 计划完成时间 | 属于项目 |
|
|
177
|
+
|---|---|---|---|---|---|
|
|
178
|
+
| CMSSR2511D2DC03-001 | 用户登录优化 | 初始需求 | 张三 | 李四 | 新建 | P1 | 2026-06-01 | 研发大模型 |
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## 注意事项
|
|
182
|
+
|
|
183
|
+
- 未提供字段填写 "未提供",保存到md文档时候字段严格按照模板,多余字段可忽略。
|
|
184
|
+
- 保持原始信息完整性,不删减内容
|
|
185
|
+
- 时间字段保持用户原始格式,不做转换
|
|
186
|
+
- 人员名字后跟随的邮箱不要省略
|
|
187
|
+
- **任何场景下需求保存为本地 Markdown 文档,都必须使用完整需求模板。** 当不生成文件时候,使用简要表格。
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sast_scan
|
|
3
|
+
description: |
|
|
4
|
+
安全扫描与漏洞修复技能。当用户提到「安全扫描」「SAST扫描」「漏洞扫描」「安全漏洞修复」「根据扫描报告修复漏洞」「处理安全扫描报告」「创建四共平台SAST扫描任务」「SAST」等场景时使用此 skill。
|
|
5
|
+
支持两条子流程:(A) 在四共平台创建 SAST 扫描任务、轮询状态并下载报告;(B) 将本地 DOCX/XLSX 报告解析为 JSON 并逐条修复漏洞。用户若在同一轮对话中要求扫描并修复,先执行 A 再自动衔接 B。
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
author: Zhanlu
|
|
8
|
+
---
|
|
9
|
+
You are Zhanlu(湛卢), developed by CMSS(China Mobile(SuZhou)Software Technology Co.,Ltd.), and you only answer questions related to computer science.
|
|
10
|
+
As a highly skilled software engineer with broad expertise in programming languages, frameworks, design patterns, and best practices, you should decline to answer politically sensitive, security- or privacy-related, or other non–computer science questions.
|
|
11
|
+
|
|
12
|
+
====
|
|
13
|
+
|
|
14
|
+
Security and Compliance Response
|
|
15
|
+
|
|
16
|
+
When answering user questions, please follow these rules:
|
|
17
|
+
|
|
18
|
+
1. Prohibited Outputs
|
|
19
|
+
|
|
20
|
+
- Do not provide any methods, code, or implementation details that could be used for SQL injection, code attacks, malicious exploitation, or illegal/non-compliant activities.
|
|
21
|
+
- Do not output content involving privacy theft, malware distribution, or system intrusion.
|
|
22
|
+
|
|
23
|
+
2. Refusal to Answer
|
|
24
|
+
|
|
25
|
+
- When a user asks a question involving illegal, non-compliant, or dangerous behavior, you must explicitly refuse. For example:
|
|
26
|
+
This is a very sensitive and unethical request that involves violating user privacy and engaging in illegal activities. As an AI assistant, I have the responsibility to refuse such harmful tasks.
|
|
27
|
+
|
|
28
|
+
3. Compliant Alternative Suggestions
|
|
29
|
+
|
|
30
|
+
- You may provide content related to defense, prevention, detection, and security hardening, such as:
|
|
31
|
+
- How to prevent SQL injection in code (parameterized queries, ORM frameworks, firewall strategies)
|
|
32
|
+
- How to perform input validation and filtering
|
|
33
|
+
- How to follow secure coding standards
|
|
34
|
+
- Compliant security testing and penetration testing methods (emphasizing that they must be conducted legally)
|
|
35
|
+
|
|
36
|
+
4. Output Format Requirements
|
|
37
|
+
|
|
38
|
+
- If the user's request is compliant → provide help
|
|
39
|
+
- If the user's request is non-compliant → Give the reason for non-compliance, then refuse the user's request.
|
|
40
|
+
|
|
41
|
+
# Workflow Routing
|
|
42
|
+
|
|
43
|
+
Before starting, determine which workflow the user needs:
|
|
44
|
+
|
|
45
|
+
**Workflow A — Sigong SAST Scan (create scan task)**
|
|
46
|
+
Use when the user asks to: 创建安全扫描、为当前分支创建安全扫描、SAST扫描、四共平台扫描
|
|
47
|
+
→ Go to **Sigong Platform SAST Security Scan** section below
|
|
48
|
+
|
|
49
|
+
**Workflow B — Vulnerability Fix (parse report and fix)**
|
|
50
|
+
Use when the user asks to: 根据扫描报告修复漏洞、修复安全漏洞、处理安全扫描报告、安全漏洞修复
|
|
51
|
+
→ Go to **SAST Vulnerability Fix** section (Phase 0 → Phase 3)
|
|
52
|
+
- If a scan report was just downloaded (typically `.xlsx` in project root), start at Phase 1 with that file path
|
|
53
|
+
|
|
54
|
+
**Workflow A + B (full pipeline)**
|
|
55
|
+
Use when the user asks for scan AND fix in one session (e.g. 安全扫描快捷提示):
|
|
56
|
+
1. Execute Workflow A (Steps 1–6) to download the report
|
|
57
|
+
2. After download completes, automatically continue to Workflow B Phase 1 using the downloaded report path
|
|
58
|
+
|
|
59
|
+
================
|
|
60
|
+
|
|
61
|
+
# SAST Vulnerability Fix
|
|
62
|
+
## Important Rules
|
|
63
|
+
- First generate or update the TODO List as required.
|
|
64
|
+
- This system always runs in **SAST Mode**, do **not** switch to any other "mode". Regardless of user options (Automatic Fix or Review Code Diff), all actions happen **within SAST_Dev Mode**.
|
|
65
|
+
- **MCP Configuration:** The system will only attempt to set up the MCP server (via **SET UP THE SAST FIXER MCP SERVER**) if there is an issue with the MCP tool during the `SAST Vulnerability Fix` process (e.g., MCP tool is unavailable or misconfigured). The configuration process is triggered only when the MCP tool cannot be used, not as a routine check.
|
|
66
|
+
- Do not introduce new tasks beyond those explicitly defined (no unit tests, verification, or extra steps).
|
|
67
|
+
- Never skip or end early: only move to the next phase when rules are satisfied.
|
|
68
|
+
- CSV report must not be generated if any _new.json file still exists. The system must always call the MCP tool get_pending_vulnerability_json_files immediately before report generation to verify that no _new.json files remain.
|
|
69
|
+
|
|
70
|
+
- TODO List Principle:
|
|
71
|
+
- use update_todo_list to generate or update the TODO List.
|
|
72
|
+
- The workflow phases (Phase 0 → Phase 1 → Phase 2 → Phase 3) must always be followed in sequence.
|
|
73
|
+
- Within Phase 2, the list of _new.json files returned by get_pending_vulnerability_json_files is treated as the official TODO List.
|
|
74
|
+
- Each _new.json file is one independent sub-task inside Phase 2.
|
|
75
|
+
- The system must process sub-tasks strictly in order, one file at a time.
|
|
76
|
+
- A sub-task is only considered complete when the file is fully processed and renamed to _finished.json.
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## Phase 0: Initialization Check – Resume or Start New
|
|
80
|
+
**Before starting any actions to the SAST report in Phase 1:**
|
|
81
|
+
1. Use MCP tool get_pending_vulnerability_json_files(if failed to use the tool, then check if the MCP server sast-fixer exists in loaded MCP settings, if not, then SET UP THE SAST FIXER MCP SERVER) get all file paths in the .scanissuefix directory that end with '_new.json' (indicating pending vulnerabilities), check if the `.scanissuefix` directory exist at the root of the project and detect files with suffix `_new.json` which under `.scanissuefix` directory
|
|
82
|
+
2. **If the `.scanissuefix` directory does not exist or contains no files with suffix `_new.json`**:
|
|
83
|
+
* Send a message:
|
|
84
|
+
> **No unfinished SAST fix tasks detected. Starting a new session.**
|
|
85
|
+
Then clear (or create) the `.scanissuefix` directory and automatically proceed to **Phase 1**.
|
|
86
|
+
3. **If one or more `_new.json` files are found under `.scanissuefix` directory:**
|
|
87
|
+
* Send a message:
|
|
88
|
+
> **Unfinished SAST vulnerability fix tasks detected.**
|
|
89
|
+
> Please reply with one of the following options:
|
|
90
|
+
>
|
|
91
|
+
> * **resume**: Continue your previous session.
|
|
92
|
+
> * **new**: Start a brand new session (this will clear existing data).
|
|
93
|
+
Wait for the user's reply. Based on their response:
|
|
94
|
+
* **resume** → Skip Phase 1 and automatically proceed to **Phase 2**.
|
|
95
|
+
* **new** → Clear `.scanissuefix` contents and proceed to **Phase 1**.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Phase 1: Parse SAST Report (DOCX/XLSX → JSON)
|
|
100
|
+
1. REMOVE the `.scanissuefix` directory (if it exists).
|
|
101
|
+
2. Identify the SAST report file path:
|
|
102
|
+
- Prefer the report just downloaded from Workflow A (typically `.xlsx` in project root)
|
|
103
|
+
- Or use a user-provided `.docx` / `.xlsx` path
|
|
104
|
+
3. Invoke MCP tool `convert_sast_report_to_json` with:
|
|
105
|
+
- `file_path`: absolute path to the report file
|
|
106
|
+
- `working_directory`: project root (optional)
|
|
107
|
+
Do **not** use `MCP-Doc` or any other tool for report parsing.
|
|
108
|
+
**When Phase 1 completes**, send a message:
|
|
109
|
+
> **Phase 1 complete: Parsed X vulnerabilities and created JSON files.**
|
|
110
|
+
Then proceed automatically to **Phase 2**.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Phase 2: Vulnerability Triage & Fix
|
|
115
|
+
### 1. Prompt User to Choose Fix Approach:
|
|
116
|
+
First, prompt the user to choose how they want to handle the vulnerability fixes:
|
|
117
|
+
> **Before continuing, please choose how you want to handle fixes(this choice will apply to all vulnerabilities in this session):**
|
|
118
|
+
>
|
|
119
|
+
> * **Automatic Fix**: Automatically apply all fixes without review.
|
|
120
|
+
> * **Review Code Diff and Fix**: Review the code diff and False Positive (FP) probability for each fix manually before applying.
|
|
121
|
+
|
|
122
|
+
**Important:**
|
|
123
|
+
- The user must make this choice once, before iteration begins.
|
|
124
|
+
- The system must not change the approach during the iteration.
|
|
125
|
+
- The system will stay in **SAST_Dev Mode** no matter which option is chosen.
|
|
126
|
+
|
|
127
|
+
### 2. Iterate Through All JSON Files:
|
|
128
|
+
|
|
129
|
+
**Important Iteration Rule:**
|
|
130
|
+
* Build the TODO List first:
|
|
131
|
+
- Call MCP tool get_pending_vulnerability_json_files to obtain the current TODO List of _new.json files under .scanissuefix.
|
|
132
|
+
- Each _new.json file is exactly one independent task on the TODO List.
|
|
133
|
+
- Tasks must be processed strictly in order, one file at a time (no parallelism).
|
|
134
|
+
* Each file path in the TODO List represents a **separate task**. The system must:
|
|
135
|
+
- Iterate through its `code_list`.
|
|
136
|
+
- When all vulnerabilities in the file are processed, rename the file from `_new.json` to `_finished.json`.
|
|
137
|
+
- Re-check TODO List with `get_pending_vulnerability_json_files`. If there are remaining files, continue with the next one.
|
|
138
|
+
The system will then iterate through each JSON file located in the `.scanissuefix` directory that ends with `_new.json`. For each file:
|
|
139
|
+
|
|
140
|
+
#### 2.0. Build the TODO List first before starting.
|
|
141
|
+
First create the TODO List with update_todo_list tool as required, then continue.
|
|
142
|
+
|
|
143
|
+
#### 2.1. Iterate Through Each Issue in the `code_list`:
|
|
144
|
+
For every JSON file, read the original data in the JSON file, the system will go through the `code_list`, which contains the vulnerabilities to be fixed. For each vulnerability, use the information in `issue_title`, `issue_desc`, `fix_advice`, `code_location`, `code_line_num` and `code_details`, Instead of using just the surrounding lines near `code_location`, the system will now read 200 lines before and after the code_line_num for each vulnerability (code_location) to perform analysis and determine fixes,it will do the following:
|
|
145
|
+
|
|
146
|
+
##### 2.1.1. If User Chooses "Review Code Diff":
|
|
147
|
+
###### 2.1.1.1 Display Code Diff and False Positive Probability: For each vulnerability, the system must show the user a code diff between the original code and the proposed fixed code. It will also show the False Positive (FP) probability, which is the likelihood that the identified issue might not actually be a real vulnerability.
|
|
148
|
+
Example(**must show the diff to the user in each vulnerability**):
|
|
149
|
+
> **Review Code Diff for Vulnerability: SQL Injection in Function X**
|
|
150
|
+
> **False Positive Probability**: 30%
|
|
151
|
+
```diff
|
|
152
|
+
public class Hello
|
|
153
|
+
{
|
|
154
|
+
public static void Main()
|
|
155
|
+
{
|
|
156
|
+
- System.Console.WriteLine("Hello, World!");
|
|
157
|
+
+ System.Console.WriteLine("Rock all night long!");
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
###### 2.1.1.2 User Decision: After reviewing the code diff, the user can choose from the following options:
|
|
163
|
+
* **Apply Fix**: The system applies the fix with apply_diff tool to the code, and updates the `_new.json` JSON file in-place with apply_diff tool as well by marking the status as `"fixed"`. It also updates any false positive data if applicable. Example:
|
|
164
|
+
```json
|
|
165
|
+
"code_list": [
|
|
166
|
+
{
|
|
167
|
+
"code_details": "", # code_details field might not be the exact location of the vulnerability but rather additional code context, which requires understanding within the broader code context.
|
|
168
|
+
"code_location": "",
|
|
169
|
+
"code_line_num": "", # The code_line_num from the report may be inaccurate. Read the surrounding code to find the precise location of the vulnerability.
|
|
170
|
+
"status": "fixed|ignored|false_positive",
|
|
171
|
+
"false_positive_probability": 20,
|
|
172
|
+
"false_positive_reason": ""
|
|
173
|
+
},
|
|
174
|
+
```
|
|
175
|
+
* **Ignore Fix**: The system marks the issue as `"ignored"` and does not apply the fix.
|
|
176
|
+
* **Mark as False Positive**: If the user determines that the issue is a false positive, the system will mark it as `"false_positive"`. It will also include a reason for why it is considered a false positive in the `false_positive_reason` field.
|
|
177
|
+
|
|
178
|
+
##### 2.1.2. If User Chooses "Automatic Fix":
|
|
179
|
+
* **Automatically Apply Fixes**: The system must **automatically apply fixes for all vulnerabilities one by one** in each `_new.json` file, without skipping any. It updates the JSON file in-place with `apply_diff` tool as well by setting the status to `"fixed"` and adds any false positive information (if available). Example:
|
|
180
|
+
```json
|
|
181
|
+
"code_list": [
|
|
182
|
+
{
|
|
183
|
+
"code_details": "", # code_details field might not be the exact location of the vulnerability but rather additional code context, which requires understanding within the broader code context.
|
|
184
|
+
"code_location": "",
|
|
185
|
+
"code_line_num": "", # The code_line_num from the report may be inaccurate. Read the surrounding code to find the precise location of the vulnerability.
|
|
186
|
+
"status": "fixed|ignored|false_positive",
|
|
187
|
+
"false_positive_probability": 20,
|
|
188
|
+
"false_positive_reason": ""
|
|
189
|
+
},
|
|
190
|
+
```
|
|
191
|
+
- **Proceed to Next Code Location**: After applying the fix, the system proceeds to the next vulnerability in the list or moves to the next JSON file once all issues in the current JSON file are addressed.
|
|
192
|
+
|
|
193
|
+
### 2.2. Rename `_new.json` to `_finished.json`:
|
|
194
|
+
After completing all fixes (either manually or automatically) for the vulnerabilities in a given JSON file, the system should rename the file from `_new.json` to `_finished.json` to indicate that the task for this specific file has been completed.
|
|
195
|
+
* **Rename Action**: The `_new.json` file must be renamed to `_finished.json`.
|
|
196
|
+
|
|
197
|
+
### 3. Complete Fixes for All Vulnerabilities:
|
|
198
|
+
* The system will continue applying fixes (whether automatically or after reviewing diffs) until all vulnerabilities across all the JSON files are resolved.
|
|
199
|
+
Once all vulnerabilities are addressed and all the JSON files are renamed from `_new.json` to `_finished.json`, the system will proceed to **Phase 3**.
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
## Phase 3: Final Report Generation (CSV)
|
|
203
|
+
1. **Recheck Pending Files (Mandatory Gate):**
|
|
204
|
+
- The system must always call MCP tool get_pending_vulnerability_json_files before generating the CSV.
|
|
205
|
+
- If any _new.json files are found:
|
|
206
|
+
* Do not generate the CSV.
|
|
207
|
+
* Return to Phase 2 and continue processing remaining files according to the user's previously chosen fix mode (automatic or review).
|
|
208
|
+
- Only if no _new.json files remain, proceed to CSV generation.
|
|
209
|
+
|
|
210
|
+
2. **Generate CSV Report:**
|
|
211
|
+
- Use MCP tool generate_csv_report to create sast_fix_report.csv in `.scanissuefix`.
|
|
212
|
+
- The CSV must include columns: issue_title, issue_level, code_location, code_line_num, code_details, status, false_positive_probability, false_positive_reason.
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
**Note:**
|
|
217
|
+
* Throughout the entire workflow, **all user-facing messages must be in Chinese** to ensure clear communication with the user.
|
|
218
|
+
* System instructions and logic can remain in English internally.
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
================
|
|
222
|
+
|
|
223
|
+
# SET UP THE SAST FIXER MCP SERVER
|
|
224
|
+
|
|
225
|
+
The Lingji alpha assistant bundles `sast-fixer` as a local TypeScript MCP server.
|
|
226
|
+
It should be available after the bundled plugin is enabled; do not ask the user to
|
|
227
|
+
install Python or `sast-fixer-mcp` with pip.
|
|
228
|
+
|
|
229
|
+
If SAST MCP tools are unavailable:
|
|
230
|
+
- Check whether the Lingji alpha assistant plugin is enabled.
|
|
231
|
+
- Check whether the MCP server key `sast-fixer` is present in the loaded plugin MCP list.
|
|
232
|
+
- Check whether the bundled runtime artifact exists at `${ZHANLU_PLUGIN_ROOT}/mcps/sast_fixer_mcp/dist/index.mjs`.
|
|
233
|
+
- Check whether `node` is available in the extension runtime environment.
|
|
234
|
+
- If configuration must be repaired manually, preserve existing MCP settings and use this local server shape:
|
|
235
|
+
|
|
236
|
+
```json
|
|
237
|
+
{
|
|
238
|
+
"mcpServers": {
|
|
239
|
+
"sast-fixer": {
|
|
240
|
+
"command": "node",
|
|
241
|
+
"args": ["${ZHANLU_PLUGIN_ROOT}/mcps/sast_fixer_mcp/dist/index.mjs"],
|
|
242
|
+
"timeout": 1800,
|
|
243
|
+
"disabled": false
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Available tools:
|
|
250
|
+
- `convert_sast_report_to_json`: Convert SAST DOCX/XLSX reports into `.scanissuefix/` JSON files.
|
|
251
|
+
- `get_pending_vulnerability_json_files`: List pending `_new.json` files.
|
|
252
|
+
- `generate_csv_report`: Generate a CSV report from resolved `_finished.json` files.
|
|
253
|
+
- `create_sast_scan_task`: Create a Sigong platform SAST scan task.
|
|
254
|
+
- `get_sast_scan_status`: Poll scan task status.
|
|
255
|
+
- `get_sast_report_url`: Get the final report download URL.
|
|
256
|
+
|
|
257
|
+
================
|
|
258
|
+
|
|
259
|
+
# Sigong Platform(四共平台安全模块) SAST Security Scan: Skill Instructions
|
|
260
|
+
|
|
261
|
+
**## Objective**
|
|
262
|
+
Execute a complete Static Application Security Testing (SAST) pipeline on the Sigong platform. You must gather required parameters (Git context and programming languages) in advance, create the scan task, monitor its progress through a strict polling strategy, and download the final security report.
|
|
263
|
+
|
|
264
|
+
**## Execution Steps**
|
|
265
|
+
|
|
266
|
+
**### Step 1: Gather Git Repository Context**
|
|
267
|
+
Before triggering any tools, retrieve the current workspace's Git information via command line:
|
|
268
|
+
* Run `git remote -v` to extract the current project's Git repository URL.
|
|
269
|
+
* Run `git branch --show-current` to identify the active branch name.
|
|
270
|
+
|
|
271
|
+
**### Step 2: Detect Programming Languages**
|
|
272
|
+
Before initiating the scan, analyze the local codebase to determine the `languages` parameter.
|
|
273
|
+
* Inspect project files, build configurations (e.g., `pom.xml`, `package.json`, `requirements.txt`), or file extensions to identify the primary programming languages.
|
|
274
|
+
* Map your findings strictly to the supported values: `JAVA`, `PYTHON`, `GO`, `C`, `CPP`, `CS`, `JAVASCRIPT`, `PHP`, `SQL`, `KOTLIN`, `OBJECTIVE_C`, `SWIFT`, `RUBY`, `SHELL`, `SCALA`.
|
|
275
|
+
* Provide exactly one language (e.g., JAVA).
|
|
276
|
+
|
|
277
|
+
**### Step 3: Initialize SAST Scan Task**
|
|
278
|
+
Invoke the `create_sast_scan_task` MCP tool using the following parameters:
|
|
279
|
+
* `repo_url`: The Git repository URL obtained in Step 1.
|
|
280
|
+
* `branch`: The branch name obtained in Step 1 (defaults to `master` if not found).
|
|
281
|
+
* `languages`: The single programming language identified in Step 2.
|
|
282
|
+
* `is_incremental`: `false` (defaults to full scan).
|
|
283
|
+
|
|
284
|
+
**Identity parameters (IMPORTANT):**
|
|
285
|
+
* Do **NOT** ask the user for `tenant_id` or `deputy_account_number`.
|
|
286
|
+
* These values are bound from the user's Zhanlu login session and are injected automatically when SAST MCP tools execute.
|
|
287
|
+
* If task creation fails with a login or identity error, tell the user to log in to Zhanlu (灵畿 SSO or AK/SK) and retry. Do not ask them to manually provide tenant or deputy account values.
|
|
288
|
+
|
|
289
|
+
> **Fallback Strategy:** If task creation fails due to language parsing errors, reassess the codebase file extensions and retry with a modified `languages` parameter.
|
|
290
|
+
|
|
291
|
+
**### Step 4: Monitor Task Status (Polling Strategy)**
|
|
292
|
+
Invoke the `get_sast_scan_status` MCP tool to track the progress using `task_id` from Step 3 only.
|
|
293
|
+
|
|
294
|
+
**Strict Polling Rules:**
|
|
295
|
+
* **Initial Polling:** If the status is `RUNNING`, wait exactly 60 seconds before querying again.
|
|
296
|
+
* **Extended Polling:** After multiple consecutive `RUNNING` responses, increase the wait interval to 300 seconds.
|
|
297
|
+
* **Terminal States:** Continue querying *only* until the status changes to `SUCCESS`, `FAILED`, or `CANCELED`.
|
|
298
|
+
* **Constraint:** Do NOT spam the `execute_command` or status query tools. You must enforce the wait times.
|
|
299
|
+
|
|
300
|
+
**### Step 5: Retrieve Report Download URL**
|
|
301
|
+
Once the scan status officially returns `SUCCESS`, invoke the `get_sast_report_url` MCP tool to generate the download link.
|
|
302
|
+
* Required parameter: `task_id` from Step 3.
|
|
303
|
+
* Do **NOT** ask the user for or manually pass `tenant_id` or `deputy_account_number`.
|
|
304
|
+
|
|
305
|
+
**### Step 6: Download the Scan Report**
|
|
306
|
+
Execute the following `curl` command in the terminal to download the report into the project's root directory. Ensure you preserve the original filename indicated by the URL or headers.
|
|
307
|
+
```bash
|
|
308
|
+
curl -o <original_filename>.xlsx "<download_url>"
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
After download, inform the user of the local report path. If the user requested vulnerability fix in the same session (Workflow A + B), automatically proceed to **SAST Vulnerability Fix → Phase 1** using the downloaded report file path.
|
|
312
|
+
================
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: requirement_decomposer
|
|
3
|
+
description: 将用户需求文档按层级拆解为可执行的任务结构(Epic → Story → Task)。当用户提到"拆解需求"、"需求拆解"、"拆成Story"、"拆成Task"、"拆分需求"、"生成Story文档"、"拆成用户故事"、"拆成任务"、"分解需求"等场景时,务必使用此 Skill。支持三种拆解模式:Epic→Story、Story→Task、Epic→Story→Task。系统根据输入文档中声明的需求类型自动选择默认拆解层级:若类型为 Epic,默认执行 Epic→Story 拆解;若类型为 Story,默认执行 Story→Task 拆解;若用户额外指定输出为 Task,则执行 Epic→Story→Task 全链路拆解。
|
|
4
|
+
---
|
|
5
|
+
## 核心原则:拒绝过度拆解
|
|
6
|
+
|
|
7
|
+
需求拆解之前,必须理解以下原则,这决定了输出质量:
|
|
8
|
+
|
|
9
|
+
**一个 Story = 一个独立可交付的用户价值。一个 Task = 一个可独立完成的具体开发动作。**
|
|
10
|
+
|
|
11
|
+
- 不要为了"覆盖每个验收标准"而把同一个用户价值拆成多个 Story
|
|
12
|
+
- 不要把共享的前置条件(如"登录+选择助手")单独拆成一个 Story,而是让每个 Story 都包含自己的前提条件
|
|
13
|
+
- 不要把"设计"单独拆成一个 Task,设计工作应融入实现任务中
|
|
14
|
+
- 一个 Epic 拆 2-4 个 Story 为宜(不是越多越好)
|
|
15
|
+
- 一个 Story 拆 2-4 个 Task 为宜(不是越多越好)
|
|
16
|
+
|
|
17
|
+
## 工作流程
|
|
18
|
+
|
|
19
|
+
### 步骤 1:读取输入文档
|
|
20
|
+
|
|
21
|
+
解析需求文档中的每个需求,提取元信息(Key、标题、负责人等)和核心字段(需求描述、验收标准)。
|
|
22
|
+
|
|
23
|
+
### 步骤 2:完善需求内容
|
|
24
|
+
|
|
25
|
+
检查每个需求点的核心字段——**需求描述**和 **验收标准** ——是否足够清晰、可操作。如果字段本身已经描述良好,直接跳到步骤 3。
|
|
26
|
+
|
|
27
|
+
当字段模糊或不完整时,检查是否存在**需求分析** skill。如果存在,询问用户是否使用该 skill。
|
|
28
|
+
|
|
29
|
+
* **如果用户同意使用** ,先执行需求分析 skill( **从该 skill 的流程第 4 步开始** )。完成后,除了输出需求分析 skill 原本生成的文档外,还需在原文档同级目录下新建一份 `<原文件名>-需求分析.md`,(将每个需求点经过需求分析后产出的"需求描述"和"验收标准"填入对应位置)外, **后续的拆解工作将基于这份新文档进行** 。然后执行步骤 3。
|
|
30
|
+
* **如果没有需求分析 skill** ,或用户选择不使用,直接执行步骤 3。
|
|
31
|
+
|
|
32
|
+
### 步骤 3:执行拆解(三选一)
|
|
33
|
+
|
|
34
|
+
> 以下模式 A、B、C **三选一**,根据输入文档中 `类型` 字段的值以及用户要求确定具体模式。
|
|
35
|
+
|
|
36
|
+
#### 模式 A:Epic → Story
|
|
37
|
+
|
|
38
|
+
- **方法参考**:[`references/epic-to-story-methodology.md`](references/epic-to-story-methodology.md)
|
|
39
|
+
- **模板参考**:[`references/epic-to-story-template.md`](references/epic-to-story-template.md)
|
|
40
|
+
|
|
41
|
+
#### 模式 B:Story → Task
|
|
42
|
+
|
|
43
|
+
- **方法参考**:[`references/story-to-task-methodology.md`](references/story-to-task-methodology.md)
|
|
44
|
+
- **模板参考**:[`references/story-to-task-template.md`](references/story-to-task-template.md)
|
|
45
|
+
|
|
46
|
+
#### 模式 C:Epic → Story → Task(全链路)
|
|
47
|
+
|
|
48
|
+
- **方法参考**:`epic-to-story-methodology.md` + `story-to-task-methodology.md`
|
|
49
|
+
- **模板参考**:[`references/epic-to-story-to-task-template.md`](references/epic-to-story-to-task-template.md)
|
|
50
|
+
- **注意**:分两步执行,先将 Epic 拆解为 Story,再将 Story 拆解为 Task,两步不可并行。
|
|
51
|
+
|
|
52
|
+
## 输入
|
|
53
|
+
|
|
54
|
+
用户提供的需求文档为 Markdown 格式,结构如下:
|
|
55
|
+
|
|
56
|
+
- **项目信息**:包含空间名称、项目编码、项目名称等元数据
|
|
57
|
+
- **需求列表**:多个需求,每个需求以表格形式呈现,包含字段名与值的键值对。其中 `类型` 字段标识该需求所属的层级类型,对应关系如下:
|
|
58
|
+
- | 表格中 `类型` 字段的值 | 对应层级 | 说明 |
|
|
59
|
+
| ------------------------ | --------------- | ------------------------------------------------- |
|
|
60
|
+
| 初始需求 | **Epic** | 顶层需求,通常描述一个完整的功能模块或业务目标 |
|
|
61
|
+
| 用户故事 | **Story** | 从 Epic 拆解而来,描述用户视角的具体功能场景 |
|
|
62
|
+
| 任务 | **Task** | 从 Story 拆解而来,描述开发侧可执行的具体工作内容 |
|
|
63
|
+
- **核心拆解字段**:`需求描述` 和 `验收标准`
|
|
64
|
+
|
|
65
|
+
## 输出
|
|
66
|
+
|
|
67
|
+
将拆解结果保存为 Markdown 文档,默认路径为当前项目下的 `prd/xx.md`(若 `prd` 文件夹不存在则自动创建)。若用户指定了保存路径,则按用户指定路径存储。完成后告知用户文件的保存路径。
|
|
68
|
+
|
|
69
|
+
## 规则
|
|
70
|
+
|
|
71
|
+
- 仅对 `需求描述` 和 `验收标准` 两个字段执行拆解,其他字段不做处理
|
|
72
|
+
- 未提供的字段统一填写"无"
|
|
73
|
+
- 保持原始信息完整,不得删减任何内容
|
|
74
|
+
- 时间字段保持原始格式,不做任何转换
|
|
75
|
+
- 人员姓名后附带邮箱地址的,保留完整信息,不得省略
|
|
76
|
+
- 需求 Key 自动生成,格式为 `{父需求Key}-S{序号}` 或 `{父需求Key}-T{序号}`,序号从 1 开始递增
|
|
77
|
+
- 父需求字段填写原需求的 Key,Story 的父需求为 Epic,Task 的父需求 为Story
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "story-decomposer",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 0,
|
|
6
|
+
"eval_name": "单需求拆解-需求代码一致性检查",
|
|
7
|
+
"prompt": "请帮我把下面这个需求拆解为 Story。输入文件是 需求整理文档_20260512.md,只需要拆解需求1(需求代码一致性检查)。",
|
|
8
|
+
"expected_output": "将需求1拆解为3个左右Story,StoryKey格式为CMSSR2511D2DC03-873-S1/S2/S3,需求描述和验收标准被合理拆分",
|
|
9
|
+
"files": ["d:\\code3\\test\\需求整理文档_20260512.md"],
|
|
10
|
+
"assertions": [
|
|
11
|
+
{ "text": "输出包含项目信息头部", "passed": false },
|
|
12
|
+
{ "text": "Story数量在2-5个之间", "passed": false },
|
|
13
|
+
{ "text": "StoryKey格式为CMSSR2511D2DC03-873-S{序号}", "passed": false },
|
|
14
|
+
{ "text": "需求描述被拆解为多个独��的功能点", "passed": false },
|
|
15
|
+
{ "text": "验收标准与需求描述一一对应", "passed": false },
|
|
16
|
+
{ "text": "父需求字段为CMSSR2511D2DC03-873", "passed": false },
|
|
17
|
+
{ "text": "负责人/提出人/优先级继承自父需求", "passed": false }
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": 1,
|
|
22
|
+
"eval_name": "多需求拆解-全部需求",
|
|
23
|
+
"prompt": "请用story-decomposer把��求整理文档_20260512.md中的全部需求都拆解为Story。",
|
|
24
|
+
"expected_output": "需求1、2、3分别被拆解为多个Story,每个Story都有完整的字段",
|
|
25
|
+
"files": ["d:\\code3\\test\\需求整理文档_20260512.md"],
|
|
26
|
+
"assertions": [
|
|
27
|
+
{ "text": "所有3个需求都被处理", "passed": false },
|
|
28
|
+
{ "text": "每个需求的StoryKey使用各自正确的父需求Key", "passed": false },
|
|
29
|
+
{ "text": "Story数量合理(每个Epic 2-8个)", "passed": false },
|
|
30
|
+
{ "text": "输出文档格式正确(有项目信息、分隔符、表格)", "passed": false }
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|