@devflow-tools/claude-code-plugin 0.12.5 → 0.13.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.
Files changed (37) hide show
  1. package/dist/command-registry.json +84 -19
  2. package/dist/hooks/hook-client.js +6 -6
  3. package/dist/hooks/hook-daemon.js +8 -4
  4. package/dist/hooks/post-tool-use.js +2 -2
  5. package/dist/hooks/pre-tool-use.js +2 -2
  6. package/dist/skills/devflow:animation/SKILL.md +63 -0
  7. package/dist/skills/devflow:css/SKILL.md +63 -0
  8. package/dist/skills/devflow:git/SKILL.md +67 -0
  9. package/dist/skills/devflow:graphql/SKILL.md +4 -4
  10. package/dist/skills/devflow:nest/SKILL.md +4 -4
  11. package/dist/skills/devflow:nextjs/SKILL.md +4 -4
  12. package/dist/skills/devflow:react/SKILL.md +6 -6
  13. package/dist/skills/devflow:tailwind/SKILL.md +4 -2
  14. package/dist/skills/devflow:ui-layout/SKILL.md +63 -0
  15. package/dist/skills/devflow:vue/SKILL.md +4 -4
  16. package/hooks/post-tool-use +6 -2
  17. package/hooks/session-start +33 -22
  18. package/package.json +3 -3
  19. package/skills/devflow:animation/SKILL.md +38 -7
  20. package/skills/devflow:context/SKILL.md +36 -17
  21. package/skills/devflow:css/SKILL.md +38 -7
  22. package/skills/devflow:docker/SKILL.md +38 -8
  23. package/skills/devflow:electron/SKILL.md +38 -8
  24. package/skills/devflow:git/SKILL.md +38 -8
  25. package/skills/devflow:graph/SKILL.md +33 -15
  26. package/skills/devflow:graphql/SKILL.md +39 -8
  27. package/skills/devflow:knowledge/SKILL.md +33 -15
  28. package/skills/devflow:memory/SKILL.md +34 -16
  29. package/skills/devflow:nest/SKILL.md +39 -8
  30. package/skills/devflow:nextjs/SKILL.md +39 -7
  31. package/skills/devflow:performance/SKILL.md +38 -8
  32. package/skills/devflow:react/SKILL.md +16 -12
  33. package/skills/devflow:tailwind/SKILL.md +38 -7
  34. package/skills/devflow:taro/SKILL.md +38 -8
  35. package/skills/devflow:ui-layout/SKILL.md +38 -7
  36. package/skills/devflow:vue/SKILL.md +40 -9
  37. package/skills/devflow:workflow/SKILL.md +33 -15
@@ -2,13 +2,13 @@
2
2
  name: devflow:nextjs
3
3
  description: Next.js 专家 — App Router、SSR/SSG/ISR、Server Components、Middleware、部署
4
4
  required_mcp_tools:
5
- - nextjs_new_page
6
5
  - nextjs_diagnose_bug
6
+ - nextjs_new_page
7
7
  ---
8
8
 
9
9
  <HARD-GATE>
10
10
  收到 devflow:nextjs 时,必须先调用以下 MCP 工具之一:
11
- nextjs_new_page / nextjs_diagnose_bug
11
+ nextjs_diagnose_bug / nextjs_new_page
12
12
  </HARD-GATE>
13
13
 
14
14
  ## MANDATORY FIRST STEP - Skill Registration
@@ -16,12 +16,12 @@ nextjs_new_page / nextjs_diagnose_bug
16
16
  > **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
17
17
 
18
18
  ```bash
19
- mkdir -p ~/.devflow && echo '{"name":"devflow:nextjs","required_mcp_tools":["nextjs_new_page","nextjs_diagnose_bug"],"description":"devflow:nextjs skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
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
20
  ```
21
21
 
22
22
  After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
23
- - `mcp__devflow__nextjs_new_page`
24
23
  - `mcp__devflow__nextjs_diagnose_bug`
24
+ - `mcp__devflow__nextjs_new_page`
25
25
 
26
26
  **Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
27
27
 
@@ -3,16 +3,16 @@ name: devflow:react
3
3
  description: React 18 专家能力 — Bug 诊断、组件重构、性能优化、Hooks 审查
4
4
  required_mcp_tools:
5
5
  - react_diagnose_bug
6
- - react_new_feature
7
6
  - react_audit_performance
7
+ - react_new_component
8
8
  - react_review_hooks
9
9
  - react_refactor_component
10
- - react_new_component
10
+ - react_new_feature
11
11
  ---
12
12
 
13
13
  <HARD-GATE>
14
14
  收到 devflow:react 时,必须先调用以下 MCP 工具之一:
15
- react_diagnose_bug / react_new_feature / react_audit_performance / react_review_hooks / react_refactor_component / react_new_component
15
+ react_diagnose_bug / react_audit_performance / react_new_component / react_review_hooks / react_refactor_component / react_new_feature
16
16
  </HARD-GATE>
17
17
 
18
18
  ## MANDATORY FIRST STEP - Skill Registration
@@ -20,16 +20,16 @@ react_diagnose_bug / react_new_feature / react_audit_performance / react_review_
20
20
  > **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
21
21
 
22
22
  ```bash
23
- mkdir -p ~/.devflow && echo '{"name":"devflow:react","required_mcp_tools":["react_diagnose_bug","react_new_feature","react_audit_performance","react_review_hooks","react_refactor_component","react_new_component"],"description":"devflow:react skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
23
+ mkdir -p ~/.devflow && echo '{"name":"devflow:react","required_mcp_tools":["react_diagnose_bug","react_audit_performance","react_new_component","react_review_hooks","react_refactor_component","react_new_feature"],"description":"devflow:react skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
24
24
  ```
25
25
 
26
26
  After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
27
27
  - `mcp__devflow__react_diagnose_bug`
28
- - `mcp__devflow__react_new_feature`
29
28
  - `mcp__devflow__react_audit_performance`
29
+ - `mcp__devflow__react_new_component`
30
30
  - `mcp__devflow__react_review_hooks`
31
31
  - `mcp__devflow__react_refactor_component`
32
- - `mcp__devflow__react_new_component`
32
+ - `mcp__devflow__react_new_feature`
33
33
 
34
34
  **Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
35
35
 
@@ -3,11 +3,12 @@ name: devflow:tailwind
3
3
  description: Tailwind 专家 — 响应式设计、主题定制、Purge 检查、Utility 审查
4
4
  required_mcp_tools:
5
5
  - tailwind_new_component
6
+ - tailwind_optimize_classes
6
7
  ---
7
8
 
8
9
  <HARD-GATE>
9
10
  收到 devflow:tailwind 时,必须先调用以下 MCP 工具之一:
10
- tailwind_new_component
11
+ tailwind_new_component / tailwind_optimize_classes
11
12
  </HARD-GATE>
12
13
 
13
14
  ## MANDATORY FIRST STEP - Skill Registration
@@ -15,11 +16,12 @@ tailwind_new_component
15
16
  > **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
16
17
 
17
18
  ```bash
18
- mkdir -p ~/.devflow && echo '{"name":"devflow:tailwind","required_mcp_tools":["tailwind_new_component"],"description":"devflow:tailwind skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
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
19
20
  ```
20
21
 
21
22
  After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
22
23
  - `mcp__devflow__tailwind_new_component`
24
+ - `mcp__devflow__tailwind_optimize_classes`
23
25
 
24
26
  **Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
25
27
 
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: devflow:ui-layout
3
+ description: UI Layout 专家 — 布局模式、组件组合、响应式架构、设计系统
4
+ required_mcp_tools:
5
+ - ui_layout_generate
6
+ ---
7
+
8
+ <HARD-GATE>
9
+ 收到 devflow:ui-layout 时,必须先调用以下 MCP 工具之一:
10
+ ui_layout_generate
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:ui-layout","required_mcp_tools":["ui_layout_generate"],"description":"devflow:ui-layout 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__devflow__ui_layout_generate`
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
+ # 📐 UI-LAYOUT
32
+
33
+ 你是一个 UI Layout 专家。精通 CSS Grid、Flexbox 和响应式设计。使用 Design Token 体系管理样式变量。
34
+
35
+ ## 适用场景
36
+
37
+ **布局审计:一致性检查 → 响应式问题 → 可访问性评估**
38
+
39
+ **响应式改造:断点分析 → 移动适配 → Container Queries**
40
+
41
+ **Design Token 体系建设:提取 → 分层 → 代码化**
42
+
43
+ ## 核心规则
44
+
45
+ - 优先使用 CSS Grid 做页面布局,Flexbox 做组件内排列
46
+ - 使用容器查询实现组件级响应式
47
+ - 间距遵循 4px 倍数的 Scale 体系
48
+ - 使用语义化 HTML(header/nav/main/aside/footer)
49
+ - 移动优先设计,渐进增强
50
+ - 使用 CSS 变量管理 Design Token
51
+ - 确保触控目标 ≥ 44×44px,对比度 ≥ 4.5:1
52
+
53
+ ## 当前版本
54
+
55
+ - web-dev-layout: 2024 — https://web.dev/learn/design/
56
+
57
+ ## 工作流
58
+
59
+ | 场景 | 触发方式 |
60
+ |------|----------|
61
+ | 布局审计:一致性检查 → 响应式问题 → 可访问性评估 | 调用 MCP 工具 `ui-layout_audit:layout` |
62
+ | 响应式改造:断点分析 → 移动适配 → Container Queries | 调用 MCP 工具 `ui-layout_design:responsive` |
63
+ | Design Token 体系建设:提取 → 分层 → 代码化 | 调用 MCP 工具 `ui-layout_setup:design-tokens` |
@@ -3,13 +3,13 @@ name: devflow:vue
3
3
  description: Vue 3 专家 — Bug 诊断、Composition API、响应式调试、组件重构
4
4
  required_mcp_tools:
5
5
  - vue_diagnose_bug
6
- - vue_new_component
7
6
  - vue_debug_reactivity
7
+ - vue_new_component
8
8
  ---
9
9
 
10
10
  <HARD-GATE>
11
11
  收到 devflow:vue 时,必须先调用以下 MCP 工具之一:
12
- vue_diagnose_bug / vue_new_component / vue_debug_reactivity
12
+ vue_diagnose_bug / vue_debug_reactivity / vue_new_component
13
13
  </HARD-GATE>
14
14
 
15
15
  ## MANDATORY FIRST STEP - Skill Registration
@@ -17,13 +17,13 @@ vue_diagnose_bug / vue_new_component / vue_debug_reactivity
17
17
  > **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
18
18
 
19
19
  ```bash
20
- mkdir -p ~/.devflow && echo '{"name":"devflow:vue","required_mcp_tools":["vue_diagnose_bug","vue_new_component","vue_debug_reactivity"],"description":"devflow:vue skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
20
+ mkdir -p ~/.devflow && echo '{"name":"devflow:vue","required_mcp_tools":["vue_diagnose_bug","vue_debug_reactivity","vue_new_component"],"description":"devflow:vue skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
21
21
  ```
22
22
 
23
23
  After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
24
24
  - `mcp__devflow__vue_diagnose_bug`
25
- - `mcp__devflow__vue_new_component`
26
25
  - `mcp__devflow__vue_debug_reactivity`
26
+ - `mcp__devflow__vue_new_component`
27
27
 
28
28
  **Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
29
29
 
@@ -7,10 +7,14 @@ PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$SCRIPT_DIR/..}"
7
7
  CLIENT_JS="$PLUGIN_ROOT/dist/hooks/hook-client.js"
8
8
  FALLBACK_JS="$PLUGIN_ROOT/dist/hooks/post-tool-use.js"
9
9
 
10
+ INPUT="$(cat)"
11
+
10
12
  if [ -f "$CLIENT_JS" ]; then
11
- node "$CLIENT_JS" post-tool-use "$(cat)" 2>/dev/null || true
13
+ node "$CLIENT_JS" post-tool-use "$INPUT" 2>/dev/null || {
14
+ echo "$INPUT" | node "$FALLBACK_JS" 2>/dev/null || true
15
+ }
12
16
  elif [ -f "$FALLBACK_JS" ]; then
13
- node "$FALLBACK_JS" 2>/dev/null || true
17
+ echo "$INPUT" | node "$FALLBACK_JS" 2>/dev/null || true
14
18
  fi
15
19
 
16
20
  exit 0
@@ -25,18 +25,6 @@ else
25
25
  fi
26
26
 
27
27
  # Generate session token for MCP Gateway authentication
28
- SESSION_TOKEN=""
29
- if command -v devflow &>/dev/null; then
30
- SESSION_TOKEN=$(devflow session token --expires 3600 2>/dev/null || echo "")
31
- elif command -v npx &>/dev/null; then
32
- SESSION_TOKEN=$(npx --yes @devflow-tools/cli session token --expires 3600 2>/dev/null || echo "")
33
- fi
34
-
35
- TOKEN_VALUE=""
36
- if [ -n "$SESSION_TOKEN" ] && echo "$SESSION_TOKEN" | python3 -c "import sys,json; json.load(sys.stdin)" 2>/dev/null; then
37
- TOKEN_VALUE=$(echo "$SESSION_TOKEN" | python3 -c "import sys,json; print(json.load(sys.stdin).get('token',''))" 2>/dev/null || echo "")
38
- fi
39
-
40
28
  # Clean up stale receipt from previous session
41
29
  PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
42
30
  RECEIPT_DIR="${TMPDIR:-/tmp}/.devflow-receipts"
@@ -116,20 +104,43 @@ else
116
104
  fi
117
105
  GATEWAY_STATUS="${GATEWAY_STATUS}━━━━━━━━━━━━━━━━━━━━━━━━━━━"
118
106
 
119
- SUMMARY="${SUMMARY}${GLOBAL_CONSTRAINT}${GATEWAY_STATUS}"
107
+ # ── MCP Tool Usage Protocol (injected into every session) ──
108
+ MCP_PROTOCOL="
109
+
110
+ ## DevFlow MCP 工具使用协议(必须遵守)
111
+
112
+ 当用户使用 /devflow: 开头的技能时(如 /devflow:react、/devflow:vue、/devflow:context 等),你必须按以下流程操作:
113
+
114
+ ### Step 1: 获取上下文(必须先执行)
115
+ 调用 mcp__devflow__get_project_context,参数格式:{\"query\": \"用户的问题描述\"}
116
+ 这个工具返回项目中的相关文件、符号、风险提示和下一步建议。
117
+ 不要跳过这一步。不要用 Explore、Agent、Grep 或 Bash 代替。
118
+
119
+ ### Step 2: 按需调用领域工具
120
+ 根据技能类型调用对应的 MCP 工具:
121
+ - React 性能问题 → mcp__devflow__react_audit_performance(无需参数)
122
+ - React Bug → mcp__devflow__react_diagnose_bug
123
+ - React Hooks 审查 → mcp__devflow__react_review_hooks
124
+ - Vue 问题 → mcp__devflow__vue_diagnose_bug
125
+ - NestJS 问题 → mcp__devflow__nest_diagnose_bug
126
+ - 代码搜索 → mcp__devflow__search_symbol
127
+ - 知识查询 → mcp__devflow__get_knowledge
128
+
129
+ ### Step 3: 基于工具返回结果进行分析
130
+ 用 Read 确认工具返回的关键文件,然后给出分析结论。
131
+
132
+ ### 铁律
133
+ - 永远不要用 Explore、Agent、Grep 或 Glob 替代 MCP 工具的第一步上下文获取
134
+ - 所有 mcp__devflow__ 工具的 projectRoot 参数都是可选的,无需传
135
+ - 如果 MCP 工具返回错误,重试一次;再失败则回退到直接读文件"
136
+
137
+ SUMMARY="${SUMMARY}${MCP_PROTOCOL}${GLOBAL_CONSTRAINT}${GATEWAY_STATUS}"
120
138
 
121
139
  # Escape for JSON
122
140
  ESCAPED=$(echo "$SUMMARY" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))")
123
141
 
124
- # Output context injection in Claude Code format
125
- if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ]; then
126
- if [ -n "$TOKEN_VALUE" ]; then
127
- ESCAPED_TOKEN=$(echo "$TOKEN_VALUE" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))")
128
- printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": %s\n },\n "env": {\n "DEVFLOW_SESSION_TOKEN": %s\n }\n}\n' "$ESCAPED" "$ESCAPED_TOKEN"
129
- else
130
- printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": %s\n }\n}\n' "$ESCAPED"
131
- fi
132
- fi
142
+ # Output context injection in Claude Code format (always output, even without CLAUDE_PLUGIN_ROOT)
143
+ printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": %s\n }\n}\n' "$ESCAPED"
133
144
 
134
145
  # ── Start hook daemon (background, Unix socket) ──
135
146
  DAEMON_JS="${PLUGIN_ROOT}/dist/hooks/hook-daemon.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/claude-code-plugin",
3
- "version": "0.12.5",
3
+ "version": "0.13.0",
4
4
  "description": "DevFlow — Developer Intelligence Platform for Claude Code",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -8,7 +8,7 @@
8
8
  "deploy": "npx tsx scripts/inject-gates.ts --deploy"
9
9
  },
10
10
  "devDependencies": {
11
- "@devflow-tools/mcp-server": "^0.12.5"
11
+ "@devflow-tools/mcp-server": "^0.13.0"
12
12
  },
13
13
  "keywords": [
14
14
  "pi-package",
@@ -28,5 +28,5 @@
28
28
  "hooks.json",
29
29
  "skills"
30
30
  ],
31
- "gitHead": "e8440cff84139ca0cc1786ee39be3b453974e000"
31
+ "gitHead": "6e5878a1ab2bba3a21bd42a5f7e236d4f7375d4f"
32
32
  }
@@ -3,6 +3,44 @@ name: devflow:animation
3
3
  description: Animation 动画专家 — CSS 动画、Framer Motion、GSAP、Lottie、性能优化
4
4
  ---
5
5
 
6
+ ## 工作流(必须按顺序执行)
7
+
8
+ ### Step 1: 获取精确上下文
9
+ 调用 `mcp__devflow__get_project_context` 获取与用户问题相关的代码、记忆和知识库信息。
10
+ 这一步确保你拿到的是项目真实状态,而非凭空猜测。
11
+
12
+ ### Step 2: 分析
13
+ 基于 Step 1 返回的上下文,分析问题根因或设计方案。
14
+ 此时可以自由使用 Read 查看具体文件。
15
+
16
+ ### Step 3: 执行
17
+ 根据分析结果修改代码,逐文件编辑。
18
+
19
+ ### Step 4: 验证
20
+ 运行类型检查和测试,确保改动正确。
21
+
22
+ ## 可用工具
23
+
24
+ | 工具 | 何时调用 |
25
+ |------|----------|
26
+ | `mcp__devflow__get_project_context` | 每次任务第一步(必须) |
27
+ | `mcp__devflow__animation_suggest` | 按需调用 |
28
+
29
+ ## 规则
30
+ - 永远从 `mcp__devflow__get_project_context` 开始——你不知道项目里有什么
31
+ - 上下文返回后,用 Read 确认关键文件
32
+ - 改完代码后跑类型检查
33
+
34
+ ## 规则
35
+ - 永远从 `get_project_context` 开始——你不知道项目里有什么
36
+ - 上下文返回后,用 Read 确认关键文件
37
+ - 改完代码后跑类型检查
38
+
39
+ ## 规则
40
+ - 永远从 `animation_suggest` 开始——你不知道项目里有什么
41
+ - 上下文返回后,用 Read 确认关键文件
42
+ - 改完代码后跑类型检查
43
+
6
44
  # ✨ ANIMATION
7
45
 
8
46
  你是一个动画专家。精通 CSS Animation、Framer Motion、GSAP。动画必须 60fps 且支持 prefers-reduced-motion。
@@ -29,10 +67,3 @@ description: Animation 动画专家 — CSS 动画、Framer Motion、GSAP、Lott
29
67
 
30
68
  - animation-docs: 2024 — https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animations
31
69
 
32
- ## 工作流
33
-
34
- | 场景 | 触发方式 |
35
- |------|----------|
36
- | 动画审计:性能检查 → 可访问性 → 实现质量 | 调用 MCP 工具 `animation_audit:animation` |
37
- | 新建动画:需求分析 → 选型建议 → 实现 → 性能验证 | 调用 MCP 工具 `animation_new:animation` |
38
- | 动画 GPU 迁移:扫描 → 替换为 GPU 属性 → 验证 | 调用 MCP 工具 `animation_migrate:gpu-animation` |
@@ -1,36 +1,53 @@
1
1
  ---
2
2
  name: devflow:context
3
3
  description: 检索项目上下文 — 自然语言查询相关代码、符号、依赖关系
4
- required_mcp_tools:
5
- - get_project_context
6
- - search_symbol
7
4
  ---
8
- ## MANDATORY FIRST STEP - Skill Registration
9
5
 
10
- > **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**
6
+ ## 工作流(必须按顺序执行)
11
7
 
12
- ```bash
13
- mkdir -p ~/.devflow && echo '{"name":"devflow:context","required_mcp_tools":["get_project_context","search_symbol"],"description":"devflow:context skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
14
- ```
8
+ ### Step 1: 获取精确上下文
9
+ 调用 `mcp__devflow__get_project_context` 获取与用户问题相关的代码、记忆和知识库信息。
10
+ 这一步确保你拿到的是项目真实状态,而非凭空猜测。
15
11
 
16
- After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
17
- - `mcp__devflow__get_project_context`
18
- - `mcp__devflow__search_symbol`
12
+ ### Step 2: 分析
13
+ 基于 Step 1 返回的上下文,分析问题根因或设计方案。
14
+ 此时可以自由使用 Read 查看具体文件。
19
15
 
20
- **Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.
16
+ ### Step 3: 执行
17
+ 根据分析结果修改代码,逐文件编辑。
21
18
 
22
- When the skill execution is complete, clean up:
23
- ```bash
24
- rm -f ~/.devflow/current-skill.json ~/.devflow/current-execution-id
25
- ```
19
+ ### Step 4: 验证
20
+ 运行类型检查和测试,确保改动正确。
21
+
22
+ ## 可用工具
23
+
24
+ | 工具 | 何时调用 |
25
+ |------|----------|
26
+ | `mcp__devflow__get_project_context` | 每次任务第一步(必须) |
27
+ | `mcp__devflow__get_project_context` | 按需调用 |
28
+ | `mcp__devflow__search_symbol` | 按需调用 |
26
29
 
30
+ ## 规则
31
+ - 永远从 `mcp__devflow__get_project_context` 开始——你不知道项目里有什么
32
+ - 上下文返回后,用 Read 确认关键文件
33
+ - 改完代码后跑类型检查
34
+
35
+ ## 规则
36
+ - 永远从 `get_project_context` 开始——你不知道项目里有什么
37
+ - 上下文返回后,用 Read 确认关键文件
38
+ - 改完代码后跑类型检查
39
+
40
+ ## 规则
41
+ - 永远从 `get_project_context` 开始——你不知道项目里有什么
42
+ - 上下文返回后,用 Read 确认关键文件
43
+ - 改完代码后跑类型检查
27
44
 
28
45
  # /devflow:context
29
46
 
30
47
  ## 执行
31
48
 
32
49
  1. 如果用户的查询包含中文,先将其中的中文关键词翻译为英文代码术语(空格分隔)
33
- 2. 调用 `get_project_context` MCP 工具:
50
+ 2. 调用 `mcp__devflow__get_project_context` MCP 工具:
34
51
 
35
52
  ```
36
53
  query = 用户的原始查询内容(包含中文)
@@ -38,6 +55,8 @@ expandedTerms = 你翻译的英文关键词(如 "code review audit module")
38
55
  mode = "fast" (首次调用;如需更深入结果,再改用 "deep")
39
56
  ```
40
57
 
58
+ 也可以使用 `mcp__devflow__search_symbol` 按符号名搜索代码。
59
+
41
60
  示例:
42
61
  - 用户查询 "代码审核模块的流程" → expandedTerms = "code review audit module workflow pipeline process"
43
62
  - 用户查询 "用户登录认证逻辑" → expandedTerms = "user login authentication auth logic service handler"
@@ -3,6 +3,44 @@ name: devflow:css
3
3
  description: CSS 专家 — 布局调试、响应式审查、BEM 规范、性能优化
4
4
  ---
5
5
 
6
+ ## 工作流(必须按顺序执行)
7
+
8
+ ### Step 1: 获取精确上下文
9
+ 调用 `mcp__devflow__get_project_context` 获取与用户问题相关的代码、记忆和知识库信息。
10
+ 这一步确保你拿到的是项目真实状态,而非凭空猜测。
11
+
12
+ ### Step 2: 分析
13
+ 基于 Step 1 返回的上下文,分析问题根因或设计方案。
14
+ 此时可以自由使用 Read 查看具体文件。
15
+
16
+ ### Step 3: 执行
17
+ 根据分析结果修改代码,逐文件编辑。
18
+
19
+ ### Step 4: 验证
20
+ 运行类型检查和测试,确保改动正确。
21
+
22
+ ## 可用工具
23
+
24
+ | 工具 | 何时调用 |
25
+ |------|----------|
26
+ | `mcp__devflow__get_project_context` | 每次任务第一步(必须) |
27
+ | `mcp__devflow__css_audit_selectors` | 按需调用 |
28
+
29
+ ## 规则
30
+ - 永远从 `mcp__devflow__get_project_context` 开始——你不知道项目里有什么
31
+ - 上下文返回后,用 Read 确认关键文件
32
+ - 改完代码后跑类型检查
33
+
34
+ ## 规则
35
+ - 永远从 `get_project_context` 开始——你不知道项目里有什么
36
+ - 上下文返回后,用 Read 确认关键文件
37
+ - 改完代码后跑类型检查
38
+
39
+ ## 规则
40
+ - 永远从 `css_audit_selectors` 开始——你不知道项目里有什么
41
+ - 上下文返回后,用 Read 确认关键文件
42
+ - 改完代码后跑类型检查
43
+
6
44
  # 🎨 CSS
7
45
 
8
46
  你是一个 CSS 专家。使用现代布局方案(Flexbox/Grid),遵循 BEM 命名,移动优先响应式设计。遇到问题先查 MDN 文档。
@@ -29,10 +67,3 @@ description: CSS 专家 — 布局调试、响应式审查、BEM 规范、性能
29
67
 
30
68
  - mdn-css: 2024 — https://developer.mozilla.org/en-US/docs/Web/CSS
31
69
 
32
- ## 工作流
33
-
34
- | 场景 | 触发方式 |
35
- |------|----------|
36
- | 布局调试:检查元素定位 → 弹性/网格属性 → 修复 | 调用 MCP 工具 `css_debug:layout` |
37
- | 响应式审查:断点检查 → 媒体查询 → 流体方案 | 调用 MCP 工具 `css_audit:responsive` |
38
- | BEM 命名审查:扫描类名 → 规范检查 → 修复建议 | 调用 MCP 工具 `css_review:bem` |
@@ -3,6 +3,44 @@ name: devflow:docker
3
3
  description: Docker 专家 — 镜像优化、Compose 编排、安全扫描、多阶段构建
4
4
  ---
5
5
 
6
+ ## 工作流(必须按顺序执行)
7
+
8
+ ### Step 1: 获取精确上下文
9
+ 调用 `mcp__devflow__get_project_context` 获取与用户问题相关的代码、记忆和知识库信息。
10
+ 这一步确保你拿到的是项目真实状态,而非凭空猜测。
11
+
12
+ ### Step 2: 分析
13
+ 基于 Step 1 返回的上下文,分析问题根因或设计方案。
14
+ 此时可以自由使用 Read 查看具体文件。
15
+
16
+ ### Step 3: 执行
17
+ 根据分析结果修改代码,逐文件编辑。
18
+
19
+ ### Step 4: 验证
20
+ 运行类型检查和测试,确保改动正确。
21
+
22
+ ## 可用工具
23
+
24
+ | 工具 | 何时调用 |
25
+ |------|----------|
26
+ | `mcp__devflow__get_project_context` | 每次任务第一步(必须) |
27
+ | `mcp__devflow__docker_dockerize_project` | 按需调用 |
28
+
29
+ ## 规则
30
+ - 永远从 `mcp__devflow__get_project_context` 开始——你不知道项目里有什么
31
+ - 上下文返回后,用 Read 确认关键文件
32
+ - 改完代码后跑类型检查
33
+
34
+ ## 规则
35
+ - 永远从 `get_project_context` 开始——你不知道项目里有什么
36
+ - 上下文返回后,用 Read 确认关键文件
37
+ - 改完代码后跑类型检查
38
+
39
+ ## 规则
40
+ - 永远从 `docker_dockerize_project` 开始——你不知道项目里有什么
41
+ - 上下文返回后,用 Read 确认关键文件
42
+ - 改完代码后跑类型检查
43
+
6
44
  # 🐳 DOCKER
7
45
 
8
46
  你是一个 Docker 专家。使用多阶段构建优化镜像,遵循安全和性能最佳实践。遇到问题先查官方文档。
@@ -32,11 +70,3 @@ description: Docker 专家 — 镜像优化、Compose 编排、安全扫描、
32
70
 
33
71
  - docker-docs: 26.0.0 — https://docs.docker.com/reference/
34
72
 
35
- ## 工作流
36
-
37
- | 场景 | 触发方式 |
38
- |------|----------|
39
- | 项目 Docker 化:分析项目 → 多阶段 Dockerfile → Compose → 构建验证 | 调用 MCP 工具 `docker_dockerize_project` |
40
- | 镜像优化:体积分析 → 层优化 → 多阶段重构 | 调用 MCP 工具 `docker_optimize:image` |
41
- | 安全扫描:漏洞检测 → 配置审查 → 修复建议 | 调用 MCP 工具 `docker_scan:security` |
42
- | 多服务 Compose 编排:依赖分析 → 网络设计 → 环境管理 | 调用 MCP 工具 `docker_setup:compose` |
@@ -3,6 +3,44 @@ name: devflow:electron
3
3
  description: Electron 专家 — IPC 通信、窗口管理、原生模块、自动更新、安全配置
4
4
  ---
5
5
 
6
+ ## 工作流(必须按顺序执行)
7
+
8
+ ### Step 1: 获取精确上下文
9
+ 调用 `mcp__devflow__get_project_context` 获取与用户问题相关的代码、记忆和知识库信息。
10
+ 这一步确保你拿到的是项目真实状态,而非凭空猜测。
11
+
12
+ ### Step 2: 分析
13
+ 基于 Step 1 返回的上下文,分析问题根因或设计方案。
14
+ 此时可以自由使用 Read 查看具体文件。
15
+
16
+ ### Step 3: 执行
17
+ 根据分析结果修改代码,逐文件编辑。
18
+
19
+ ### Step 4: 验证
20
+ 运行类型检查和测试,确保改动正确。
21
+
22
+ ## 可用工具
23
+
24
+ | 工具 | 何时调用 |
25
+ |------|----------|
26
+ | `mcp__devflow__get_project_context` | 每次任务第一步(必须) |
27
+ | `mcp__devflow__electron_diagnose_bug` | 按需调用 |
28
+
29
+ ## 规则
30
+ - 永远从 `mcp__devflow__get_project_context` 开始——你不知道项目里有什么
31
+ - 上下文返回后,用 Read 确认关键文件
32
+ - 改完代码后跑类型检查
33
+
34
+ ## 规则
35
+ - 永远从 `get_project_context` 开始——你不知道项目里有什么
36
+ - 上下文返回后,用 Read 确认关键文件
37
+ - 改完代码后跑类型检查
38
+
39
+ ## 规则
40
+ - 永远从 `electron_diagnose_bug` 开始——你不知道项目里有什么
41
+ - 上下文返回后,用 Read 确认关键文件
42
+ - 改完代码后跑类型检查
43
+
6
44
  # ⚛️ ELECTRON
7
45
 
8
46
  你是一个 Electron 专家。使用 contextBridge + IPC 安全通信模式。严格遵循 Electron 安全最佳实践。
@@ -32,11 +70,3 @@ description: Electron 专家 — IPC 通信、窗口管理、原生模块、自
32
70
 
33
71
  - electron-docs: 30.0.0 — https://www.electronjs.org/docs/latest/
34
72
 
35
- ## 工作流
36
-
37
- | 场景 | 触发方式 |
38
- |------|----------|
39
- | 新建 IPC 通道:定义 API → Preload 暴露 → 主进程处理 | 调用 MCP 工具 `electron_new:ipc` |
40
- | 安全审计:配置检查 → IPC 暴露面 → CSP → 第三方依赖 | 调用 MCP 工具 `electron_audit:security` |
41
- | 自动更新配置:electron-updater → 发布渠道 → 更新 UI | 调用 MCP 工具 `electron_setup:auto-update` |
42
- | Electron Bug 诊断:进程分类 → IPC 追踪 → 原生调试 | 调用 MCP 工具 `electron_diagnose_bug` |