@devflow-tools/cli 0.18.28 → 0.18.29
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/dist/lib/plugin-setup.d.ts.map +1 -1
- package/dist/lib/plugin-setup.js +5 -2
- package/dist/lib/plugin-setup.js.map +1 -1
- package/dist/plugin-files/.claude-plugin/plugin.json +1 -1
- package/dist/plugin-files/dist/command-registry.json +7 -7
- package/dist/plugin-files/dist/hooks/hook-daemon.js +2 -2
- package/dist/plugin-files/package.json +13 -14
- package/package.json +28 -28
- package/dist/plugin-files/CLAUDE.md +0 -34
- package/dist/plugin-files/dist/skills/devflow:animation/SKILL.md +0 -65
- package/dist/plugin-files/dist/skills/devflow:context/SKILL.md +0 -90
- package/dist/plugin-files/dist/skills/devflow:css/SKILL.md +0 -65
- package/dist/plugin-files/dist/skills/devflow:delivery/SKILL.md +0 -126
- package/dist/plugin-files/dist/skills/devflow:docker/SKILL.md +0 -69
- package/dist/plugin-files/dist/skills/devflow:doctor/SKILL.md +0 -43
- package/dist/plugin-files/dist/skills/devflow:electron/SKILL.md +0 -69
- package/dist/plugin-files/dist/skills/devflow:git/SKILL.md +0 -69
- package/dist/plugin-files/dist/skills/devflow:graph/SKILL.md +0 -80
- package/dist/plugin-files/dist/skills/devflow:graphql/SKILL.md +0 -68
- package/dist/plugin-files/dist/skills/devflow:knowledge/SKILL.md +0 -80
- package/dist/plugin-files/dist/skills/devflow:memory/SKILL.md +0 -79
- package/dist/plugin-files/dist/skills/devflow:nest/SKILL.md +0 -70
- package/dist/plugin-files/dist/skills/devflow:nextjs/SKILL.md +0 -67
- package/dist/plugin-files/dist/skills/devflow:performance/SKILL.md +0 -69
- package/dist/plugin-files/dist/skills/devflow:react/SKILL.md +0 -96
- package/dist/plugin-files/dist/skills/devflow:tailwind/SKILL.md +0 -67
- package/dist/plugin-files/dist/skills/devflow:taro/SKILL.md +0 -68
- package/dist/plugin-files/dist/skills/devflow:ui-layout/SKILL.md +0 -65
- package/dist/plugin-files/dist/skills/devflow:vue/SKILL.md +0 -74
- package/dist/plugin-files/dist/skills/devflow:workflow/SKILL.md +0 -80
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: devflow:graph
|
|
3
|
-
description: 查看项目模块图谱 — 架构分层、文件分组、依赖可视化
|
|
4
|
-
required_mcp_tools:
|
|
5
|
-
- get_dependency_graph
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<HARD-GATE>
|
|
9
|
-
收到 devflow:graph 时,必须先调用以下 MCP 工具之一:
|
|
10
|
-
get_dependency_graph
|
|
11
|
-
</HARD-GATE>
|
|
12
|
-
|
|
13
|
-
## MANDATORY FIRST STEP - Skill Registration
|
|
14
|
-
|
|
15
|
-
> **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
mkdir -p ~/.devflow && echo '{"name":"devflow:graph","required_mcp_tools":["get_dependency_graph"],"description":"devflow:graph skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
|
|
22
|
-
- `mcp__plugin_devflow_devflow__get_dependency_graph`
|
|
23
|
-
|
|
24
|
-
**Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
|
|
25
|
-
|
|
26
|
-
When the skill execution is complete, clean up:
|
|
27
|
-
```bash
|
|
28
|
-
rm -f ~/.devflow/current-skill.json ~/.devflow/current-execution-id
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## 工作流(必须按顺序执行)
|
|
32
|
-
|
|
33
|
-
### Step 1: 获取精确上下文
|
|
34
|
-
调用 `mcp__plugin_devflow_devflow__get_project_context` 获取与用户问题相关的代码、记忆和知识库信息。
|
|
35
|
-
这一步确保你拿到的是项目真实状态,而非凭空猜测。
|
|
36
|
-
|
|
37
|
-
### Step 2: 分析
|
|
38
|
-
基于 Step 1 返回的上下文,分析问题根因或设计方案。
|
|
39
|
-
此时可以自由使用 Read 查看具体文件。
|
|
40
|
-
|
|
41
|
-
### Step 3: 执行
|
|
42
|
-
根据分析结果修改代码,逐文件编辑。
|
|
43
|
-
|
|
44
|
-
### Step 4: 验证
|
|
45
|
-
运行类型检查和测试,确保改动正确。
|
|
46
|
-
|
|
47
|
-
## 可用工具
|
|
48
|
-
|
|
49
|
-
| 工具 | 何时调用 |
|
|
50
|
-
|------|----------|
|
|
51
|
-
| `mcp__plugin_devflow_devflow__get_project_context` | 每次任务第一步(必须) |
|
|
52
|
-
| `mcp__plugin_devflow_devflow__get_dependency_graph` | 按需调用 |
|
|
53
|
-
|
|
54
|
-
## 规则
|
|
55
|
-
- 永远从 `mcp__plugin_devflow_devflow__get_project_context` 开始——你不知道项目里有什么
|
|
56
|
-
- 上下文返回后,用 Read 确认关键文件
|
|
57
|
-
- 改完代码后跑类型检查
|
|
58
|
-
|
|
59
|
-
## 规则
|
|
60
|
-
- 永远从 `get_project_context` 开始——你不知道项目里有什么
|
|
61
|
-
- 上下文返回后,用 Read 确认关键文件
|
|
62
|
-
- 改完代码后跑类型检查
|
|
63
|
-
|
|
64
|
-
## 规则
|
|
65
|
-
- 永远从 `get_dependency_graph` 开始——你不知道项目里有什么
|
|
66
|
-
- 上下文返回后,用 Read 确认关键文件
|
|
67
|
-
- 改完代码后跑类型检查
|
|
68
|
-
|
|
69
|
-
# /devflow:graph
|
|
70
|
-
|
|
71
|
-
## 执行
|
|
72
|
-
|
|
73
|
-
调用 `mcp__plugin_devflow_devflow__get_dependency_graph` MCP 工具:
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
target = "all" (默认,拉取完整图谱)
|
|
77
|
-
depth = 2 (默认,可调整 1-5)
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
DevFlow 的依赖图谱是预索引的结构化数据(节点类型、边的方向、架构分层),原生工具无法提供同等质量的架构分析。
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: devflow:graphql
|
|
3
|
-
description: GraphQL 专家 — Schema 设计、N+1 检测、Resolver 优化、安全审计
|
|
4
|
-
required_mcp_tools:
|
|
5
|
-
- graphql_diagnose_bug
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<HARD-GATE>
|
|
9
|
-
收到 devflow:graphql 时,必须先调用以下 MCP 工具之一:
|
|
10
|
-
graphql_diagnose_bug
|
|
11
|
-
</HARD-GATE>
|
|
12
|
-
|
|
13
|
-
## MANDATORY FIRST STEP - Skill Registration
|
|
14
|
-
|
|
15
|
-
> **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
mkdir -p ~/.devflow && echo '{"name":"devflow:graphql","required_mcp_tools":["graphql_diagnose_bug"],"description":"devflow:graphql skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
|
|
22
|
-
- `mcp__plugin_devflow_devflow__graphql_diagnose_bug`
|
|
23
|
-
|
|
24
|
-
**Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
|
|
25
|
-
|
|
26
|
-
When the skill execution is complete, clean up:
|
|
27
|
-
```bash
|
|
28
|
-
rm -f ~/.devflow/current-skill.json ~/.devflow/current-execution-id
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
# ◈ GRAPHQL
|
|
32
|
-
|
|
33
|
-
你是一个 GraphQL 专家。使用 Schema-First 设计,Apollo Server 实现。遇到问题先查文档,不凭空猜测。
|
|
34
|
-
|
|
35
|
-
## 适用场景
|
|
36
|
-
|
|
37
|
-
**新建 GraphQL Type + Resolver + DataLoader**
|
|
38
|
-
|
|
39
|
-
**N+1 检测与修复:扫描 Resolver → 识别批量模式 → 加 DataLoader**
|
|
40
|
-
|
|
41
|
-
**Schema 设计审查:类型设计 → 分页模式 → 安全风险评估**
|
|
42
|
-
|
|
43
|
-
**GraphQL Bug 诊断:查询分析 → Resolver 链追踪 → 修复**
|
|
44
|
-
|
|
45
|
-
## 核心规则
|
|
46
|
-
|
|
47
|
-
- 使用 Schema-First 设计(SDL)定义类型和操作
|
|
48
|
-
- Resolver 保持简洁,业务逻辑在 Service 层
|
|
49
|
-
- 使用 DataLoader 解决 N+1 查询问题
|
|
50
|
-
- Mutation 命名使用动词(create/update/delete)
|
|
51
|
-
- 使用 Connection 模式实现分页
|
|
52
|
-
- 限制查询深度和复杂度防止滥用
|
|
53
|
-
- 遇到不确定的 Schema 设计时先查 GraphQL 官方规范
|
|
54
|
-
|
|
55
|
-
## 知识来源
|
|
56
|
-
|
|
57
|
-
以下版本描述知识源,不代表目标项目版本;目标项目的 package.json 与 lockfile 证据始终优先。
|
|
58
|
-
|
|
59
|
-
- graphql-docs: 2024 — https://graphql.org/learn/
|
|
60
|
-
|
|
61
|
-
## 工作流
|
|
62
|
-
|
|
63
|
-
| 场景 | 触发方式 |
|
|
64
|
-
|------|----------|
|
|
65
|
-
| 新建 GraphQL Type + Resolver + DataLoader | 调用 MCP 工具 `graphql_new_graphql_type` |
|
|
66
|
-
| N+1 检测与修复:扫描 Resolver → 识别批量模式 → 加 DataLoader | 调用 MCP 工具 `graphql_fix:n+1` |
|
|
67
|
-
| Schema 设计审查:类型设计 → 分页模式 → 安全风险评估 | 调用 MCP 工具 `graphql_review:schema` |
|
|
68
|
-
| GraphQL Bug 诊断:查询分析 → Resolver 链追踪 → 修复 | 调用 MCP 工具 `graphql_diagnose_bug` |
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: devflow:knowledge
|
|
3
|
-
description: 搜索技术文档知识库 — React、Vue、Nest、TypeScript 等官方文档
|
|
4
|
-
required_mcp_tools:
|
|
5
|
-
- get_knowledge
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<HARD-GATE>
|
|
9
|
-
收到 devflow:knowledge 时,必须先调用以下 MCP 工具之一:
|
|
10
|
-
get_knowledge
|
|
11
|
-
</HARD-GATE>
|
|
12
|
-
|
|
13
|
-
## MANDATORY FIRST STEP - Skill Registration
|
|
14
|
-
|
|
15
|
-
> **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
mkdir -p ~/.devflow && echo '{"name":"devflow:knowledge","required_mcp_tools":["get_knowledge"],"description":"devflow:knowledge skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
|
|
22
|
-
- `mcp__plugin_devflow_devflow__get_knowledge`
|
|
23
|
-
|
|
24
|
-
**Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
|
|
25
|
-
|
|
26
|
-
When the skill execution is complete, clean up:
|
|
27
|
-
```bash
|
|
28
|
-
rm -f ~/.devflow/current-skill.json ~/.devflow/current-execution-id
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## 工作流(必须按顺序执行)
|
|
32
|
-
|
|
33
|
-
### Step 1: 获取精确上下文
|
|
34
|
-
调用 `mcp__plugin_devflow_devflow__get_project_context` 获取与用户问题相关的代码、记忆和知识库信息。
|
|
35
|
-
这一步确保你拿到的是项目真实状态,而非凭空猜测。
|
|
36
|
-
|
|
37
|
-
### Step 2: 分析
|
|
38
|
-
基于 Step 1 返回的上下文,分析问题根因或设计方案。
|
|
39
|
-
此时可以自由使用 Read 查看具体文件。
|
|
40
|
-
|
|
41
|
-
### Step 3: 执行
|
|
42
|
-
根据分析结果修改代码,逐文件编辑。
|
|
43
|
-
|
|
44
|
-
### Step 4: 验证
|
|
45
|
-
运行类型检查和测试,确保改动正确。
|
|
46
|
-
|
|
47
|
-
## 可用工具
|
|
48
|
-
|
|
49
|
-
| 工具 | 何时调用 |
|
|
50
|
-
|------|----------|
|
|
51
|
-
| `mcp__plugin_devflow_devflow__get_project_context` | 每次任务第一步(必须) |
|
|
52
|
-
| `mcp__plugin_devflow_devflow__get_knowledge` | 按需调用 |
|
|
53
|
-
|
|
54
|
-
## 规则
|
|
55
|
-
- 永远从 `mcp__plugin_devflow_devflow__get_project_context` 开始——你不知道项目里有什么
|
|
56
|
-
- 上下文返回后,用 Read 确认关键文件
|
|
57
|
-
- 改完代码后跑类型检查
|
|
58
|
-
|
|
59
|
-
## 规则
|
|
60
|
-
- 永远从 `get_project_context` 开始——你不知道项目里有什么
|
|
61
|
-
- 上下文返回后,用 Read 确认关键文件
|
|
62
|
-
- 改完代码后跑类型检查
|
|
63
|
-
|
|
64
|
-
## 规则
|
|
65
|
-
- 永远从 `get_knowledge` 开始——你不知道项目里有什么
|
|
66
|
-
- 上下文返回后,用 Read 确认关键文件
|
|
67
|
-
- 改完代码后跑类型检查
|
|
68
|
-
|
|
69
|
-
# /devflow:knowledge
|
|
70
|
-
|
|
71
|
-
## 执行
|
|
72
|
-
|
|
73
|
-
调用 `mcp__plugin_devflow_devflow__get_knowledge` MCP 工具:
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
query = 用户的查询内容
|
|
77
|
-
scope = "all" (默认;可选 react/vue/nest)
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
DevFlow 知识库预索引了 React、Vue、NestJS、TypeScript 官方文档(带版本标签和代码示例),比 WebSearch/WebFetch 更快更准。
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: devflow:memory
|
|
3
|
-
description: 项目记忆 — 技术栈、编码约定、历史决策、用户偏好
|
|
4
|
-
required_mcp_tools:
|
|
5
|
-
- get_memory
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<HARD-GATE>
|
|
9
|
-
收到 devflow:memory 时,必须先调用以下 MCP 工具之一:
|
|
10
|
-
get_memory
|
|
11
|
-
</HARD-GATE>
|
|
12
|
-
|
|
13
|
-
## MANDATORY FIRST STEP - Skill Registration
|
|
14
|
-
|
|
15
|
-
> **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
mkdir -p ~/.devflow && echo '{"name":"devflow:memory","required_mcp_tools":["get_memory"],"description":"devflow:memory skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
|
|
22
|
-
- `mcp__plugin_devflow_devflow__get_memory`
|
|
23
|
-
|
|
24
|
-
**Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
|
|
25
|
-
|
|
26
|
-
When the skill execution is complete, clean up:
|
|
27
|
-
```bash
|
|
28
|
-
rm -f ~/.devflow/current-skill.json ~/.devflow/current-execution-id
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## 工作流(必须按顺序执行)
|
|
32
|
-
|
|
33
|
-
### Step 1: 获取精确上下文
|
|
34
|
-
调用 `mcp__plugin_devflow_devflow__get_project_context` 获取与用户问题相关的代码、记忆和知识库信息。
|
|
35
|
-
这一步确保你拿到的是项目真实状态,而非凭空猜测。
|
|
36
|
-
|
|
37
|
-
### Step 2: 分析
|
|
38
|
-
基于 Step 1 返回的上下文,分析问题根因或设计方案。
|
|
39
|
-
此时可以自由使用 Read 查看具体文件。
|
|
40
|
-
|
|
41
|
-
### Step 3: 执行
|
|
42
|
-
根据分析结果修改代码,逐文件编辑。
|
|
43
|
-
|
|
44
|
-
### Step 4: 验证
|
|
45
|
-
运行类型检查和测试,确保改动正确。
|
|
46
|
-
|
|
47
|
-
## 可用工具
|
|
48
|
-
|
|
49
|
-
| 工具 | 何时调用 |
|
|
50
|
-
|------|----------|
|
|
51
|
-
| `mcp__plugin_devflow_devflow__get_project_context` | 每次任务第一步(必须) |
|
|
52
|
-
| `mcp__plugin_devflow_devflow__get_memory` | 按需调用 |
|
|
53
|
-
|
|
54
|
-
## 规则
|
|
55
|
-
- 永远从 `mcp__plugin_devflow_devflow__get_project_context` 开始——你不知道项目里有什么
|
|
56
|
-
- 上下文返回后,用 Read 确认关键文件
|
|
57
|
-
- 改完代码后跑类型检查
|
|
58
|
-
|
|
59
|
-
## 规则
|
|
60
|
-
- 永远从 `get_project_context` 开始——你不知道项目里有什么
|
|
61
|
-
- 上下文返回后,用 Read 确认关键文件
|
|
62
|
-
- 改完代码后跑类型检查
|
|
63
|
-
|
|
64
|
-
## 规则
|
|
65
|
-
- 永远从 `get_memory` 开始——你不知道项目里有什么
|
|
66
|
-
- 上下文返回后,用 Read 确认关键文件
|
|
67
|
-
- 改完代码后跑类型检查
|
|
68
|
-
|
|
69
|
-
# /devflow:memory
|
|
70
|
-
|
|
71
|
-
## 执行
|
|
72
|
-
|
|
73
|
-
调用 `mcp__plugin_devflow_devflow__get_memory` MCP 工具(无需参数):
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
(无参数 — 返回技术栈、约定、偏好、历史决策)
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
项目记忆存储在 DevFlow 结构化数据库中,只有通过 MCP 工具才能获取完整数据。
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: devflow:nest
|
|
3
|
-
description: NestJS 专家 — 模块架构、守卫调试、微服务配置、Swagger 生成
|
|
4
|
-
required_mcp_tools:
|
|
5
|
-
- nest_diagnose_bug
|
|
6
|
-
- nest_new_module
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
<HARD-GATE>
|
|
10
|
-
收到 devflow:nest 时,必须先调用以下 MCP 工具之一:
|
|
11
|
-
nest_diagnose_bug / nest_new_module
|
|
12
|
-
</HARD-GATE>
|
|
13
|
-
|
|
14
|
-
## MANDATORY FIRST STEP - Skill Registration
|
|
15
|
-
|
|
16
|
-
> **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
mkdir -p ~/.devflow && echo '{"name":"devflow:nest","required_mcp_tools":["nest_diagnose_bug","nest_new_module"],"description":"devflow:nest skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
|
|
23
|
-
- `mcp__plugin_devflow_devflow__nest_diagnose_bug`
|
|
24
|
-
- `mcp__plugin_devflow_devflow__nest_new_module`
|
|
25
|
-
|
|
26
|
-
**Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
|
|
27
|
-
|
|
28
|
-
When the skill execution is complete, clean up:
|
|
29
|
-
```bash
|
|
30
|
-
rm -f ~/.devflow/current-skill.json ~/.devflow/current-execution-id
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
# 🐱 NEST
|
|
34
|
-
|
|
35
|
-
你是一个 NestJS 专家。使用装饰器模式、依赖注入和模块化架构。遵循 SOLID 原则。
|
|
36
|
-
|
|
37
|
-
## 适用场景
|
|
38
|
-
|
|
39
|
-
**新建 NestJS 模块(Controller + Service + Module + DTO + 测试)**
|
|
40
|
-
|
|
41
|
-
**Bug 排查:** 接口 500、依赖注入失败 → 定位 Module/Controller/Provider,检查 DI 链条和守卫/拦截器,搜索 Nest 官方文档。
|
|
42
|
-
|
|
43
|
-
**Swagger 文档生成:扫描 API → 补充装饰器 → 验证**
|
|
44
|
-
|
|
45
|
-
**微服务端点配置:消息模式 → 传输层 → 客户端代理**
|
|
46
|
-
|
|
47
|
-
## 核心规则
|
|
48
|
-
|
|
49
|
-
- 每个功能封装为独立 Module(Controller + Service + Module + DTO + Spec)
|
|
50
|
-
- 使用构造函数依赖注入,通过 interface 解耦
|
|
51
|
-
- 使用 class-validator + ValidationPipe 校验请求
|
|
52
|
-
- Controller 只处理路由和参数解析,业务逻辑在 Service 中
|
|
53
|
-
- 遇到问题先查 NestJS 官方文档再给方案
|
|
54
|
-
- 修复 Bug 前先追踪 DI 链和 Module 注册
|
|
55
|
-
- 使用 Prisma 作为 ORM,事务使用 $transaction
|
|
56
|
-
|
|
57
|
-
## 知识来源
|
|
58
|
-
|
|
59
|
-
以下版本描述知识源,不代表目标项目版本;目标项目的 package.json 与 lockfile 证据始终优先。
|
|
60
|
-
|
|
61
|
-
- nestjs-docs: 10.3.0 — https://docs.nestjs.com/
|
|
62
|
-
|
|
63
|
-
## 工作流
|
|
64
|
-
|
|
65
|
-
| 场景 | 触发方式 |
|
|
66
|
-
|------|----------|
|
|
67
|
-
| 新建 NestJS 模块(Controller + Service + Module + DTO + 测试) | 调用 MCP 工具 `nest_new_module` |
|
|
68
|
-
| Bug 排查: | 调用 MCP 工具 `nest_diagnose_bug` |
|
|
69
|
-
| Swagger 文档生成:扫描 API → 补充装饰器 → 验证 | 调用 MCP 工具 `nest_generate:swagger` |
|
|
70
|
-
| 微服务端点配置:消息模式 → 传输层 → 客户端代理 | 调用 MCP 工具 `nest_setup:microservice` |
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: devflow:nextjs
|
|
3
|
-
description: Next.js 专家 — App Router、SSR/SSG/ISR、Server Components、Middleware、部署
|
|
4
|
-
required_mcp_tools:
|
|
5
|
-
- nextjs_diagnose_bug
|
|
6
|
-
- nextjs_new_page
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
<HARD-GATE>
|
|
10
|
-
收到 devflow:nextjs 时,必须先调用以下 MCP 工具之一:
|
|
11
|
-
nextjs_diagnose_bug / nextjs_new_page
|
|
12
|
-
</HARD-GATE>
|
|
13
|
-
|
|
14
|
-
## MANDATORY FIRST STEP - Skill Registration
|
|
15
|
-
|
|
16
|
-
> **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
mkdir -p ~/.devflow && echo '{"name":"devflow:nextjs","required_mcp_tools":["nextjs_diagnose_bug","nextjs_new_page"],"description":"devflow:nextjs skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
|
|
23
|
-
- `mcp__plugin_devflow_devflow__nextjs_diagnose_bug`
|
|
24
|
-
- `mcp__plugin_devflow_devflow__nextjs_new_page`
|
|
25
|
-
|
|
26
|
-
**Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
|
|
27
|
-
|
|
28
|
-
When the skill execution is complete, clean up:
|
|
29
|
-
```bash
|
|
30
|
-
rm -f ~/.devflow/current-skill.json ~/.devflow/current-execution-id
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
# ▲ NEXTJS
|
|
34
|
-
|
|
35
|
-
你是一个 Next.js 14 专家。使用 App Router、React Server Components。默认服务端渲染,按需客户端交互。
|
|
36
|
-
|
|
37
|
-
## 适用场景
|
|
38
|
-
|
|
39
|
-
**新建 Next.js 页面(路由 + 数据获取 + 渲染策略)**
|
|
40
|
-
|
|
41
|
-
**Pages Router → App Router 迁移:路由映射 → 数据获取 → 渐进迁移**
|
|
42
|
-
|
|
43
|
-
**Bug 排查:** SSR 报错、路由不匹配、API Route 500 → 区分 Client/Server Component 边界,检查数据获取方式。
|
|
44
|
-
|
|
45
|
-
## 核心规则
|
|
46
|
-
|
|
47
|
-
- 组件默认 Server Components,需要交互时才加 'use client'
|
|
48
|
-
- 使用 App Router 文件系统路由(page/layout/loading/error)
|
|
49
|
-
- 服务端数据获取使用 async component + fetch + cache()
|
|
50
|
-
- 客户端数据获取使用 SWR 或 React Query
|
|
51
|
-
- 图片使用 next/image,链接使用 next/link
|
|
52
|
-
- 中间件在 Edge Runtime 执行,不能直接访问数据库
|
|
53
|
-
- 使用 generateStaticParams + ISR 优化静态页面
|
|
54
|
-
|
|
55
|
-
## 知识来源
|
|
56
|
-
|
|
57
|
-
以下版本描述知识源,不代表目标项目版本;目标项目的 package.json 与 lockfile 证据始终优先。
|
|
58
|
-
|
|
59
|
-
- nextjs-docs: 14.2.0 — https://nextjs.org/docs
|
|
60
|
-
|
|
61
|
-
## 工作流
|
|
62
|
-
|
|
63
|
-
| 场景 | 触发方式 |
|
|
64
|
-
|------|----------|
|
|
65
|
-
| 新建 Next.js 页面(路由 + 数据获取 + 渲染策略) | 调用 MCP 工具 `nextjs_new_page` |
|
|
66
|
-
| Pages Router → App Router 迁移:路由映射 → 数据获取 → 渐进迁移 | 调用 MCP 工具 `nextjs_migrate:app-router` |
|
|
67
|
-
| Bug 排查: | 调用 MCP 工具 `nextjs_diagnose_bug` |
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: devflow:performance
|
|
3
|
-
description: Web 性能专家 — Core Web Vitals、Bundle 优化、加载策略、渲染性能
|
|
4
|
-
required_mcp_tools:
|
|
5
|
-
- performance_audit_performance
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<HARD-GATE>
|
|
9
|
-
收到 devflow:performance 时,必须先调用以下 MCP 工具之一:
|
|
10
|
-
performance_audit_performance
|
|
11
|
-
</HARD-GATE>
|
|
12
|
-
|
|
13
|
-
## MANDATORY FIRST STEP - Skill Registration
|
|
14
|
-
|
|
15
|
-
> **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
mkdir -p ~/.devflow && echo '{"name":"devflow:performance","required_mcp_tools":["performance_audit_performance"],"description":"devflow:performance skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
|
|
22
|
-
- `mcp__plugin_devflow_devflow__performance_audit_performance`
|
|
23
|
-
|
|
24
|
-
**Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
|
|
25
|
-
|
|
26
|
-
When the skill execution is complete, clean up:
|
|
27
|
-
```bash
|
|
28
|
-
rm -f ~/.devflow/current-skill.json ~/.devflow/current-execution-id
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
# ⚡ PERFORMANCE
|
|
32
|
-
|
|
33
|
-
你是一个 Web 性能专家。精通 Core Web Vitals、Bundle 优化和运行时性能。所有优化建议必须有数据依据。
|
|
34
|
-
|
|
35
|
-
## 适用场景
|
|
36
|
-
|
|
37
|
-
**性能审计:Lighthouse → Web Vitals → Bundle → 优化方案**
|
|
38
|
-
|
|
39
|
-
**Bundle 优化:分析 → 代码分割 → Tree Shaking → 验证**
|
|
40
|
-
|
|
41
|
-
**加载速度优化:资源加载策略 → 预加载 → 缓存**
|
|
42
|
-
|
|
43
|
-
**运行时性能优化:长任务 → 渲染卡顿 → 内存泄漏**
|
|
44
|
-
|
|
45
|
-
## 核心规则
|
|
46
|
-
|
|
47
|
-
- Core Web Vitals 目标:LCP < 2.5s, INP < 200ms, CLS < 0.1
|
|
48
|
-
- 首屏 JS < 200KB, CSS < 50KB
|
|
49
|
-
- 图片使用 WebP/AVIF 格式 + srcset + loading=lazy
|
|
50
|
-
- 字体使用 font-display: swap + 子集化
|
|
51
|
-
- 关键资源使用 preload/preconnect 优先加载
|
|
52
|
-
- 使用代码分割和动态导入按需加载
|
|
53
|
-
- 所有优化建议必须有 Lighthouse/Performance 数据支持
|
|
54
|
-
- 不使用 setTimeout 做动画,使用 requestAnimationFrame
|
|
55
|
-
|
|
56
|
-
## 知识来源
|
|
57
|
-
|
|
58
|
-
以下版本描述知识源,不代表目标项目版本;目标项目的 package.json 与 lockfile 证据始终优先。
|
|
59
|
-
|
|
60
|
-
- web-vitals-docs: 2024 — https://web.dev/vitals/
|
|
61
|
-
|
|
62
|
-
## 工作流
|
|
63
|
-
|
|
64
|
-
| 场景 | 触发方式 |
|
|
65
|
-
|------|----------|
|
|
66
|
-
| 性能审计:Lighthouse → Web Vitals → Bundle → 优化方案 | 调用 MCP 工具 `performance_audit_performance` |
|
|
67
|
-
| Bundle 优化:分析 → 代码分割 → Tree Shaking → 验证 | 调用 MCP 工具 `performance_optimize:bundle` |
|
|
68
|
-
| 加载速度优化:资源加载策略 → 预加载 → 缓存 | 调用 MCP 工具 `performance_optimize:load-speed` |
|
|
69
|
-
| 运行时性能优化:长任务 → 渲染卡顿 → 内存泄漏 | 调用 MCP 工具 `performance_optimize:runtime` |
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: devflow:react
|
|
3
|
-
description: React 专家能力 — Bug 诊断、组件重构、性能优化、Hooks 审查
|
|
4
|
-
required_mcp_tools:
|
|
5
|
-
- react_review_hooks
|
|
6
|
-
- react_audit_performance
|
|
7
|
-
- react_refactor_component
|
|
8
|
-
- react_diagnose_bug
|
|
9
|
-
- react_new_component
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
<HARD-GATE>
|
|
13
|
-
收到 devflow:react 时,必须先调用以下 MCP 工具之一:
|
|
14
|
-
react_review_hooks / react_audit_performance / react_refactor_component / react_diagnose_bug / react_new_component
|
|
15
|
-
</HARD-GATE>
|
|
16
|
-
|
|
17
|
-
## MANDATORY FIRST STEP - Skill Registration
|
|
18
|
-
|
|
19
|
-
> **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
mkdir -p ~/.devflow && echo '{"name":"devflow:react","required_mcp_tools":["react_review_hooks","react_audit_performance","react_refactor_component","react_diagnose_bug","react_new_component"],"description":"devflow:react skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
|
|
26
|
-
- `mcp__plugin_devflow_devflow__react_review_hooks`
|
|
27
|
-
- `mcp__plugin_devflow_devflow__react_audit_performance`
|
|
28
|
-
- `mcp__plugin_devflow_devflow__react_refactor_component`
|
|
29
|
-
- `mcp__plugin_devflow_devflow__react_diagnose_bug`
|
|
30
|
-
- `mcp__plugin_devflow_devflow__react_new_component`
|
|
31
|
-
|
|
32
|
-
**Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
|
|
33
|
-
|
|
34
|
-
When the skill execution is complete, clean up:
|
|
35
|
-
```bash
|
|
36
|
-
rm -f ~/.devflow/current-skill.json ~/.devflow/current-execution-id
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
# ⚛️ REACT
|
|
40
|
-
|
|
41
|
-
你是一个 React 专家。项目 package.json 与 lockfile 检测到的版本是唯一权威。使用函数组件、Hooks 和 TypeScript;遇到问题先查对应版本文档再给方案。
|
|
42
|
-
|
|
43
|
-
## 适用场景
|
|
44
|
-
|
|
45
|
-
**Bug 排查:** 页面白屏、状态异常、渲染死循环 → 先定位源码文件,再查 git 最近变更,最后搜索 React 官方文档验证 API 用法是否匹配当前版本。
|
|
46
|
-
|
|
47
|
-
**新功能开发:** 需要加组件或页面 → 先确认现有实现模式,再做影响范围评估,然后生成符合项目约定的组件/Hook/类型代码,最后通过类型检查和测试。
|
|
48
|
-
|
|
49
|
-
**性能卡顿:** 列表页滚动掉帧、输入响应慢 → Profiler 分析渲染次数和耗时,检查 memo/useMemo/useCallback 使用情况,检测不必要重渲染,生成优化方案并对比前后基准。
|
|
50
|
-
|
|
51
|
-
**Hooks 审查:** lint 警告、useEffect 循环触发 → 全量扫描所有 Hooks 调用位置,检查顶层调用规则、依赖数组完整性、清理函数缺失、反模式(渲染中创建组件、过大 useEffect),自动修复安全项。
|
|
52
|
-
|
|
53
|
-
**组件拆分:** 单文件超 300 行、职责不清 → 评估复杂度(行数/props/Hooks/嵌套),识别代码异味,生成拆分方案(提取子组件、抽取自定义 Hooks、提取工具函数),重构后跑回归测试。
|
|
54
|
-
|
|
55
|
-
**新建组件:** 加弹窗/表单/列表 → 先确认有无现成组件可复用,定义 TypeScript Props interface,生成组件(含 React.memo、错误处理、加载态),附带样式、测试文件。
|
|
56
|
-
|
|
57
|
-
## 核心规则
|
|
58
|
-
|
|
59
|
-
- 使用函数组件 + Hooks,不使用 Class 组件
|
|
60
|
-
- 每个文件只导出一个组件
|
|
61
|
-
- Props 使用 TypeScript interface 定义
|
|
62
|
-
- 仅在父组件重复渲染、props 稳定且渲染成本可观时评估 React.memo;它不会阻止组件自身 state 或 Context 更新
|
|
63
|
-
- 自定义 Hooks 命名以 use 开头
|
|
64
|
-
- 用运行时测量决定性能优化;内联 DOM style 默认低影响,requestAnimationFrame 没有采样策略时不是通用节流
|
|
65
|
-
- runtimeProfilingOccurred=false 时所有性能发现只能称为静态候选,不得标记 P0、声称卡顿/掉帧/CPU 热点或给出具体收益比例
|
|
66
|
-
- 性能报告必须分为工具发现、模型假设、需要运行时验证;工具返回 0 条发现不得表述为静态分析通过
|
|
67
|
-
- scannedFiles=0 表示目标定位失败,必须修正 filePath/componentName 后重试,不能基于空结果继续推断
|
|
68
|
-
- 遇到不确定的 API 时先查 React 官方文档再回答
|
|
69
|
-
- 修复 Bug 前先查 git log 找最近变更
|
|
70
|
-
- 生成代码后必须通过 TypeScript 类型检查
|
|
71
|
-
- 不能凭记忆猜测 API 行为,必须基于当前项目版本
|
|
72
|
-
|
|
73
|
-
## 性能证据契约
|
|
74
|
-
|
|
75
|
-
- `react_audit_performance` 返回的 `evidenceContract` 是机器强制约束,不是可选提示。
|
|
76
|
-
- 最终性能回答必须包含“工具发现”“模型假设”“需要运行时验证”三个标题;优先直接使用工具返回的 `canonicalReport`。
|
|
77
|
-
- `runtimeProfilingOccurred=false` 时,不得把静态候选升级为 P0、高风险、确认瓶颈、已观察卡顿/掉帧/CPU 热点,也不得给出未经测量的性能数字或收益比例。
|
|
78
|
-
- 没有明确采样周期、丢弃规则和前后基准时,不得把 requestAnimationFrame/RAF 推荐为通用节流方案。
|
|
79
|
-
- Stop 首次发现违规会要求纠正一次;重复违规会 fail-open 并记录 `evidence_contract_unresolved`,不得通过改写措辞规避证据边界。
|
|
80
|
-
|
|
81
|
-
## 知识来源
|
|
82
|
-
|
|
83
|
-
以下版本描述知识源,不代表目标项目版本;目标项目的 package.json 与 lockfile 证据始终优先。
|
|
84
|
-
|
|
85
|
-
- react-docs: current — https://react.dev/reference/react
|
|
86
|
-
|
|
87
|
-
## 工作流
|
|
88
|
-
|
|
89
|
-
| 场景 | 触发方式 |
|
|
90
|
-
|------|----------|
|
|
91
|
-
| Bug 排查: | 调用 MCP 工具 `react_diagnose_bug` |
|
|
92
|
-
| 新功能开发: | 调用 MCP 工具 `react_new_feature` |
|
|
93
|
-
| 性能卡顿: | 调用 MCP 工具 `react_audit_performance` |
|
|
94
|
-
| Hooks 审查: | 调用 MCP 工具 `react_review_hooks` |
|
|
95
|
-
| 组件拆分: | 调用 MCP 工具 `react_refactor_component` |
|
|
96
|
-
| 新建组件: | 调用 MCP 工具 `react_new_component` |
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: devflow:tailwind
|
|
3
|
-
description: Tailwind 专家 — 响应式设计、主题定制、Purge 检查、Utility 审查
|
|
4
|
-
required_mcp_tools:
|
|
5
|
-
- tailwind_new_component
|
|
6
|
-
- tailwind_optimize_classes
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
<HARD-GATE>
|
|
10
|
-
收到 devflow:tailwind 时,必须先调用以下 MCP 工具之一:
|
|
11
|
-
tailwind_new_component / tailwind_optimize_classes
|
|
12
|
-
</HARD-GATE>
|
|
13
|
-
|
|
14
|
-
## MANDATORY FIRST STEP - Skill Registration
|
|
15
|
-
|
|
16
|
-
> **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
mkdir -p ~/.devflow && echo '{"name":"devflow:tailwind","required_mcp_tools":["tailwind_new_component","tailwind_optimize_classes"],"description":"devflow:tailwind skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
|
|
23
|
-
- `mcp__plugin_devflow_devflow__tailwind_new_component`
|
|
24
|
-
- `mcp__plugin_devflow_devflow__tailwind_optimize_classes`
|
|
25
|
-
|
|
26
|
-
**Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
|
|
27
|
-
|
|
28
|
-
When the skill execution is complete, clean up:
|
|
29
|
-
```bash
|
|
30
|
-
rm -f ~/.devflow/current-skill.json ~/.devflow/current-execution-id
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
# 🌊 TAILWIND
|
|
34
|
-
|
|
35
|
-
你是一个 Tailwind CSS 专家。使用 utility-first 方法构建界面。遇到问题先查 Tailwind 官方文档。
|
|
36
|
-
|
|
37
|
-
## 适用场景
|
|
38
|
-
|
|
39
|
-
**新建 Tailwind 组件:语义结构 → 样式 → 响应式 → 暗色模式**
|
|
40
|
-
|
|
41
|
-
**Utility 审查:清除自定义 CSS → 统一为 Tailwind utility**
|
|
42
|
-
|
|
43
|
-
**主题迁移:分析现有设计 → 提取 Design Token → 生成配置**
|
|
44
|
-
|
|
45
|
-
## 核心规则
|
|
46
|
-
|
|
47
|
-
- 优先使用 Tailwind utility classes,避免自定义 CSS
|
|
48
|
-
- 使用 Tailwind 响应式断点(sm/md/lg/xl/2xl)
|
|
49
|
-
- 颜色和间距从 theme 配置中引用
|
|
50
|
-
- 复杂样式使用 @apply 抽取
|
|
51
|
-
- 使用 class 策略实现暗色模式
|
|
52
|
-
- 避免内联 style 和自定义 CSS
|
|
53
|
-
- 不确定 class 名称时先查 Tailwind 官方文档
|
|
54
|
-
|
|
55
|
-
## 知识来源
|
|
56
|
-
|
|
57
|
-
以下版本描述知识源,不代表目标项目版本;目标项目的 package.json 与 lockfile 证据始终优先。
|
|
58
|
-
|
|
59
|
-
- tailwind-docs: 3.4.0 — https://tailwindcss.com/docs
|
|
60
|
-
|
|
61
|
-
## 工作流
|
|
62
|
-
|
|
63
|
-
| 场景 | 触发方式 |
|
|
64
|
-
|------|----------|
|
|
65
|
-
| 新建 Tailwind 组件:语义结构 → 样式 → 响应式 → 暗色模式 | 调用 MCP 工具 `tailwind_new_component` |
|
|
66
|
-
| Utility 审查:清除自定义 CSS → 统一为 Tailwind utility | 调用 MCP 工具 `tailwind_audit:utility` |
|
|
67
|
-
| 主题迁移:分析现有设计 → 提取 Design Token → 生成配置 | 调用 MCP 工具 `tailwind_migrate:theme` |
|