@devflow-tools/cli 0.13.0 → 0.13.1

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 (25) hide show
  1. package/dist/plugin-files/.claude-plugin/plugin.json +1 -10
  2. package/dist/plugin-files/dist/command-registry.json +11 -12
  3. package/dist/plugin-files/dist/skills/devflow:animation/SKILL.md +38 -7
  4. package/dist/plugin-files/dist/skills/devflow:context/SKILL.md +39 -0
  5. package/dist/plugin-files/dist/skills/devflow:css/SKILL.md +38 -7
  6. package/dist/plugin-files/dist/skills/devflow:docker/SKILL.md +38 -8
  7. package/dist/plugin-files/dist/skills/devflow:electron/SKILL.md +38 -8
  8. package/dist/plugin-files/dist/skills/devflow:git/SKILL.md +38 -8
  9. package/dist/plugin-files/dist/skills/devflow:graph/SKILL.md +38 -0
  10. package/dist/plugin-files/dist/skills/devflow:graphql/SKILL.md +43 -12
  11. package/dist/plugin-files/dist/skills/devflow:knowledge/SKILL.md +38 -0
  12. package/dist/plugin-files/dist/skills/devflow:memory/SKILL.md +38 -0
  13. package/dist/plugin-files/dist/skills/devflow:nest/SKILL.md +43 -12
  14. package/dist/plugin-files/dist/skills/devflow:nextjs/SKILL.md +43 -11
  15. package/dist/plugin-files/dist/skills/devflow:performance/SKILL.md +38 -8
  16. package/dist/plugin-files/dist/skills/devflow:react/SKILL.md +22 -18
  17. package/dist/plugin-files/dist/skills/devflow:tailwind/SKILL.md +40 -11
  18. package/dist/plugin-files/dist/skills/devflow:taro/SKILL.md +38 -8
  19. package/dist/plugin-files/dist/skills/devflow:ui-layout/SKILL.md +38 -7
  20. package/dist/plugin-files/dist/skills/devflow:vue/SKILL.md +44 -13
  21. package/dist/plugin-files/dist/skills/devflow:workflow/SKILL.md +38 -0
  22. package/dist/plugin-files/hooks/post-tool-use +6 -2
  23. package/dist/plugin-files/hooks/session-start +33 -22
  24. package/dist/plugin-files/package.json +3 -3
  25. package/package.json +27 -27
@@ -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"
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@devflow-tools/claude-code-plugin",
3
- "version": "0.12.6",
4
- "description": "DevFlow \u2014 Developer Intelligence Platform for Claude Code",
3
+ "version": "0.13.0",
4
+ "description": "DevFlow — Developer Intelligence Platform for Claude Code",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "npx tsx scripts/inject-gates.ts",
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/cli",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -12,31 +12,31 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@colbymchenry/codegraph": "^1.1.1",
15
- "@devflow-tools/adapters": "^0.13.0",
16
- "@devflow-tools/benchmark": "^0.13.0",
17
- "@devflow-tools/context-engine": "^0.13.0",
18
- "@devflow-tools/database": "^0.13.0",
19
- "@devflow-tools/knowledge-engine": "^0.13.0",
20
- "@devflow-tools/mcp-server": "^0.13.0",
21
- "@devflow-tools/memory-engine": "^0.13.0",
22
- "@devflow-tools/plugin-animation": "^0.13.0",
23
- "@devflow-tools/plugin-css": "^0.13.0",
24
- "@devflow-tools/plugin-docker": "^0.13.0",
25
- "@devflow-tools/plugin-electron": "^0.13.0",
26
- "@devflow-tools/plugin-git": "^0.13.0",
27
- "@devflow-tools/plugin-graphql": "^0.13.0",
28
- "@devflow-tools/plugin-nest": "^0.13.0",
29
- "@devflow-tools/plugin-nextjs": "^0.13.0",
30
- "@devflow-tools/plugin-performance": "^0.13.0",
31
- "@devflow-tools/plugin-react": "^0.13.0",
32
- "@devflow-tools/plugin-tailwind": "^0.13.0",
33
- "@devflow-tools/plugin-taro": "^0.13.0",
34
- "@devflow-tools/plugin-ui-layout": "^0.13.0",
35
- "@devflow-tools/plugin-vue": "^0.13.0",
36
- "@devflow-tools/sdk": "^0.13.0",
37
- "@devflow-tools/server": "^0.13.0",
38
- "@devflow-tools/telemetry": "^0.13.0",
39
- "@devflow-tools/workflow-engine": "^0.13.0",
15
+ "@devflow-tools/adapters": "^0.13.1",
16
+ "@devflow-tools/benchmark": "^0.13.1",
17
+ "@devflow-tools/context-engine": "^0.13.1",
18
+ "@devflow-tools/database": "^0.13.1",
19
+ "@devflow-tools/knowledge-engine": "^0.13.1",
20
+ "@devflow-tools/mcp-server": "^0.13.1",
21
+ "@devflow-tools/memory-engine": "^0.13.1",
22
+ "@devflow-tools/plugin-animation": "^0.13.1",
23
+ "@devflow-tools/plugin-css": "^0.13.1",
24
+ "@devflow-tools/plugin-docker": "^0.13.1",
25
+ "@devflow-tools/plugin-electron": "^0.13.1",
26
+ "@devflow-tools/plugin-git": "^0.13.1",
27
+ "@devflow-tools/plugin-graphql": "^0.13.1",
28
+ "@devflow-tools/plugin-nest": "^0.13.1",
29
+ "@devflow-tools/plugin-nextjs": "^0.13.1",
30
+ "@devflow-tools/plugin-performance": "^0.13.1",
31
+ "@devflow-tools/plugin-react": "^0.13.1",
32
+ "@devflow-tools/plugin-tailwind": "^0.13.1",
33
+ "@devflow-tools/plugin-taro": "^0.13.1",
34
+ "@devflow-tools/plugin-ui-layout": "^0.13.1",
35
+ "@devflow-tools/plugin-vue": "^0.13.1",
36
+ "@devflow-tools/sdk": "^0.13.1",
37
+ "@devflow-tools/server": "^0.13.1",
38
+ "@devflow-tools/telemetry": "^0.13.1",
39
+ "@devflow-tools/workflow-engine": "^0.13.1",
40
40
  "@inquirer/prompts": "^7.10.1",
41
41
  "chalk": "^5.3.0",
42
42
  "commander": "^12.0.0"
@@ -49,5 +49,5 @@
49
49
  "dist",
50
50
  "bin"
51
51
  ],
52
- "gitHead": "6e5878a1ab2bba3a21bd42a5f7e236d4f7375d4f"
52
+ "gitHead": "28618c4d84bea33bdd4f433bfc740c1ce2591d51"
53
53
  }