@devflow-tools/claude-code-plugin 0.18.73 → 0.19.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/.claude-plugin/plugin.json +1 -1
- package/dist/hooks/hook-daemon.js +26 -26
- package/dist/hooks/post-tool-use-failure.js +2 -2
- package/dist/hooks/post-tool-use.js +4 -4
- package/dist/hooks/pre-tool-use.js +4 -4
- package/dist/hooks/session-end.js +6 -6
- package/dist/hooks/stop.js +9 -9
- package/dist/runtime-manifest.json +4 -4
- package/hooks/constitution.md +7 -16
- package/hooks/hooks.json +35 -14
- package/hooks/post-tool-use +7 -0
- package/hooks/post-tool-use-failure +7 -0
- package/hooks/pre-compact +7 -0
- package/hooks/pre-tool-use +17 -9
- package/hooks/runtime-node +11 -0
- package/hooks/session-end +7 -0
- package/hooks/session-start +28 -27
- package/hooks/stop +7 -0
- package/hooks/user-prompt-submit +7 -0
- package/package.json +13 -13
package/hooks/session-start
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
5
|
+
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(cd "${SCRIPT_DIR}/.." && pwd)}"
|
|
6
|
+
source "${PLUGIN_ROOT}/hooks/runtime-node"
|
|
7
|
+
|
|
8
|
+
# Global kill switch: exit with no opinion before spawning any runtime.
|
|
9
|
+
if devflow_is_disabled; then
|
|
10
|
+
cat >/dev/null 2>&1 || true
|
|
11
|
+
exit 0
|
|
12
|
+
fi
|
|
13
|
+
|
|
4
14
|
PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
|
|
5
15
|
SESSION_START_INPUT="$(cat)"
|
|
6
16
|
|
|
@@ -18,14 +28,6 @@ RECEIPT_FILE="$RECEIPT_DIR/${SESSION_ID}.json"
|
|
|
18
28
|
OVERRIDE_FILE="$RECEIPT_DIR/${SESSION_ID}.override"
|
|
19
29
|
rm -f "$RECEIPT_FILE" "$OVERRIDE_FILE" 2>/dev/null || true
|
|
20
30
|
|
|
21
|
-
# Determine plugin root directory (same way as superpowers)
|
|
22
|
-
if [ -z "${CLAUDE_PLUGIN_ROOT:-}" ]; then
|
|
23
|
-
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
24
|
-
PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
25
|
-
else
|
|
26
|
-
PLUGIN_ROOT="$CLAUDE_PLUGIN_ROOT"
|
|
27
|
-
fi
|
|
28
|
-
source "${PLUGIN_ROOT}/hooks/runtime-node"
|
|
29
31
|
DEVFLOW_NODE="$(devflow_resolve_node "$PLUGIN_ROOT")"
|
|
30
32
|
|
|
31
33
|
# The registry points at an immutable build directory. Verify that this
|
|
@@ -113,17 +115,16 @@ else
|
|
|
113
115
|
fi
|
|
114
116
|
GATEWAY_STATUS="${GATEWAY_STATUS}━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
115
117
|
|
|
116
|
-
# ──
|
|
118
|
+
# ── DevFlow capability declaration (injected into every session) ──
|
|
117
119
|
MCP_PROTOCOL="
|
|
118
120
|
|
|
119
|
-
## DevFlow MCP
|
|
121
|
+
## DevFlow MCP 使用指南
|
|
120
122
|
|
|
121
|
-
|
|
123
|
+
用户使用 /devflow: 技能时(如 /devflow:react、/devflow:vue、/devflow:context),推荐流程:
|
|
122
124
|
|
|
123
|
-
### Step 1:
|
|
125
|
+
### Step 1: 获取上下文
|
|
124
126
|
调用 mcp__plugin_devflow_devflow__get_project_context,参数格式:{\"query\": \"用户的问题描述\", \"projectRoot\": \"\${CLAUDE_PROJECT_DIR}\"}
|
|
125
|
-
|
|
126
|
-
不要跳过这一步。不要用 Explore、Agent、Grep 或 Bash 代替。
|
|
127
|
+
返回相关文件、符号、风险提示与下一步建议——通常比自行搜索更快更准。
|
|
127
128
|
|
|
128
129
|
### Step 2: 按需调用领域工具
|
|
129
130
|
根据已加载 Skill 和 command registry 调用对应的 MCP 工具。以下仅为高频示例,完整能力以 /devflow 列表和 command registry 为准:
|
|
@@ -138,21 +139,21 @@ MCP_PROTOCOL="
|
|
|
138
139
|
### Step 3: 基于工具返回结果进行分析
|
|
139
140
|
用 Read 确认工具返回的关键文件,然后给出分析结论。
|
|
140
141
|
|
|
141
|
-
###
|
|
142
|
-
- 永远不要用 Explore、Agent、Grep 或 Glob 替代 MCP 工具的第一步上下文获取
|
|
142
|
+
### 约定
|
|
143
143
|
- Every mcp__plugin_devflow_devflow__ tool MUST pass projectRoot = \${CLAUDE_PROJECT_DIR}; missing projectRoot is rejected; no cwd fallback.
|
|
144
|
-
-
|
|
144
|
+
- MCP 工具失败时重试一次;再失败则回退直接读文件,并如实说明已降级"
|
|
145
145
|
|
|
146
146
|
COMPACT_PROTOCOL="
|
|
147
147
|
|
|
148
|
-
## DevFlow
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
## DevFlow
|
|
149
|
+
You have DevFlow — project intelligence for this repo: scoped context packs, symbol and dependency search, project memory, knowledge base, and standardized workflows. /devflow lists every installed capability; /devflow:<stack> skills pair a task with the right tool. mcp__plugin_devflow_devflow__get_project_context is the fastest way to scope a task before searching.
|
|
150
|
+
|
|
151
|
+
How DevFlow reports truth (whenever you use it):
|
|
152
|
+
- A memory save counts only with a DevFlow canonical receipt; queue acceptance or host-local memory is not a saved memory.
|
|
152
153
|
- Static findings are not runtime measurements. Do not claim observed bottlenecks, severity, or quantified benefit without evidence.
|
|
153
154
|
- Workflow success requires canonical host-action and verification evidence. Never convert degraded, cancelled, failed, or unknown state into success.
|
|
154
155
|
- Full versioned rules: devflow://protocol/core, devflow://protocol/memory, devflow://protocol/evidence.
|
|
155
|
-
-
|
|
156
|
+
- If an MCP call fails, retry once, then fall back to direct file inspection and say so."
|
|
156
157
|
|
|
157
158
|
DEVFLOW_DAEMON_REACHABLE=0
|
|
158
159
|
DEVFLOW_DAEMON_LAUNCHING=0
|
|
@@ -341,13 +342,13 @@ COMPACT_SESSION_START_MODE="${DEVFLOW_ROLLOUT_COMPACT_SESSION_START:-}"
|
|
|
341
342
|
if [ -z "$COMPACT_SESSION_START_MODE" ] && [ -f "$CONFIG_FILE" ] && command -v python3 >/dev/null 2>&1; then
|
|
342
343
|
COMPACT_SESSION_START_MODE=$(python3 - "$CONFIG_FILE" 2>/dev/null <<'PY'
|
|
343
344
|
import json,sys
|
|
344
|
-
try: value=json.load(open(sys.argv[1])).get('rollout',{}).get('compactSessionStart','
|
|
345
|
-
except Exception: value='
|
|
346
|
-
print(value if value in ('off','shadow','on') else '
|
|
345
|
+
try: value=json.load(open(sys.argv[1])).get('rollout',{}).get('compactSessionStart','on')
|
|
346
|
+
except Exception: value='on'
|
|
347
|
+
print(value if value in ('off','shadow','on') else 'on')
|
|
347
348
|
PY
|
|
348
|
-
) || COMPACT_SESSION_START_MODE="
|
|
349
|
+
) || COMPACT_SESSION_START_MODE="on"
|
|
349
350
|
fi
|
|
350
|
-
case "$COMPACT_SESSION_START_MODE" in off|shadow|on) ;; *) COMPACT_SESSION_START_MODE="
|
|
351
|
+
case "$COMPACT_SESSION_START_MODE" in off|shadow|on) ;; *) COMPACT_SESSION_START_MODE="on" ;; esac
|
|
351
352
|
if [ "${DEVFLOW_TEST_PROTOCOL_RESOURCE_FAIL:-0}" = "1" ]; then
|
|
352
353
|
COMPACT_SESSION_START_MODE="off"
|
|
353
354
|
fi
|
package/hooks/stop
CHANGED
|
@@ -5,6 +5,13 @@ set -euo pipefail
|
|
|
5
5
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
6
|
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$SCRIPT_DIR/..}"
|
|
7
7
|
source "$SCRIPT_DIR/runtime-node"
|
|
8
|
+
|
|
9
|
+
# Global kill switch: exit with no opinion before spawning any runtime.
|
|
10
|
+
if devflow_is_disabled; then
|
|
11
|
+
cat >/dev/null 2>&1 || true
|
|
12
|
+
exit 0
|
|
13
|
+
fi
|
|
14
|
+
|
|
8
15
|
DEVFLOW_NODE="$(devflow_resolve_node "$PLUGIN_ROOT")"
|
|
9
16
|
|
|
10
17
|
# 1. Use the daemon as the authoritative Stop handler.
|
package/hooks/user-prompt-submit
CHANGED
|
@@ -4,6 +4,13 @@ set -euo pipefail
|
|
|
4
4
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
5
|
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$SCRIPT_DIR/..}"
|
|
6
6
|
source "$SCRIPT_DIR/runtime-node"
|
|
7
|
+
|
|
8
|
+
# Global kill switch: exit with no opinion before spawning any runtime.
|
|
9
|
+
if devflow_is_disabled; then
|
|
10
|
+
cat >/dev/null 2>&1 || true
|
|
11
|
+
exit 0
|
|
12
|
+
fi
|
|
13
|
+
|
|
7
14
|
DEVFLOW_NODE="$(devflow_resolve_node "$PLUGIN_ROOT")"
|
|
8
15
|
CLIENT_JS="$PLUGIN_ROOT/dist/hooks/hook-client.js"
|
|
9
16
|
FALLBACK_JS="$PLUGIN_ROOT/dist/hooks/user-prompt-submit.js"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devflow-tools/claude-code-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Claude Code hooks and skills for the DevFlow development intelligence runtime.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -12,17 +12,17 @@
|
|
|
12
12
|
"verify:runtime-dependencies": "node --import tsx scripts/verify-runtime-dependencies.ts"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@devflow-tools/benchmark": "0.
|
|
16
|
-
"@devflow-tools/context-engine": "0.
|
|
17
|
-
"@devflow-tools/database": "0.
|
|
18
|
-
"@devflow-tools/mcp-server": "0.
|
|
19
|
-
"@devflow-tools/memory-engine": "0.
|
|
20
|
-
"@devflow-tools/sdk": "0.
|
|
21
|
-
"@devflow-tools/semantic-engine": "0.
|
|
22
|
-
"@devflow-tools/server": "0.
|
|
23
|
-
"@devflow-tools/task-runtime": "0.
|
|
24
|
-
"@devflow-tools/telemetry": "0.
|
|
25
|
-
"@devflow-tools/workflow-engine": "0.
|
|
15
|
+
"@devflow-tools/benchmark": "0.19.0",
|
|
16
|
+
"@devflow-tools/context-engine": "0.19.0",
|
|
17
|
+
"@devflow-tools/database": "0.19.0",
|
|
18
|
+
"@devflow-tools/mcp-server": "0.19.0",
|
|
19
|
+
"@devflow-tools/memory-engine": "0.19.0",
|
|
20
|
+
"@devflow-tools/sdk": "0.19.0",
|
|
21
|
+
"@devflow-tools/semantic-engine": "0.19.0",
|
|
22
|
+
"@devflow-tools/server": "0.19.0",
|
|
23
|
+
"@devflow-tools/task-runtime": "0.19.0",
|
|
24
|
+
"@devflow-tools/telemetry": "0.19.0",
|
|
25
|
+
"@devflow-tools/workflow-engine": "0.19.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@devflow-tools/devflow": "0.18.65"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"hooks",
|
|
51
51
|
"skills"
|
|
52
52
|
],
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "d4f681428ac2f83d868e152a10c85ec892afda8b",
|
|
54
54
|
"license": "MIT",
|
|
55
55
|
"repository": {
|
|
56
56
|
"type": "git",
|