@curdx/flow 2.0.18 → 2.0.19

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.
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Claude Code Discipline Layer — spec-driven workflow + goal-backward verification + Karpathy 4 principles enforced via gates. Stops Claude from faking \"done\" on non-trivial features.",
9
- "version": "2.0.18"
9
+ "version": "2.0.19"
10
10
  },
11
11
  "plugins": [
12
12
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "curdx-flow",
3
- "version": "2.0.18",
3
+ "version": "2.0.19",
4
4
  "description": "Claude Code Discipline Layer — spec-driven workflow + goal-backward verification + Karpathy 4 principles enforced via gates. Stops Claude from faking \"done\" on non-trivial features.",
5
5
  "author": {
6
6
  "name": "wdx",
package/README.zh.md CHANGED
@@ -19,11 +19,11 @@ CurdX-Flow 是一个 Claude Code 插件,把 6 个验证过的 AI 工程工作
19
19
  ## 一览(v2)
20
20
 
21
21
  - **9 个命令** — 初始化 / 启动规格 / 规格 / 执行 / 验证 / 审查 / 调试 / fast / 帮助
22
- - **15 个内部代理** — 由命令调度,不再暴露 v1 的人格角色
22
+ - **15 个内部代理** — 由命令调度,按职能分工执行
23
23
  - **8 个可组合 Gate** — Karpathy / Verification / TDD / Coverage / Adversarial / Edge-Case / Security / DevEx
24
24
  - **4 种执行策略** — linear / subagent / stop-hook / wave(自动路由)
25
25
  - **10 个知识文档** — 规格驱动 / POC-First / 原子提交 / 执行策略 / ...
26
- - **5 个 hook 事件** — SessionStart / InstructionsLoaded / PostToolUseFailure / Stop / PreToolUse
26
+ - **4 个 hook 事件** — SessionStart / SessionStart(startup|clear|compact) / Stop / PreToolUse
27
27
  - **必需文档/推理工具 + 4 个推荐插件** — Context7 官方插件 / sequential-thinking MCP + pua / claude-mem / frontend-design / chrome-devtools-mcp
28
28
  - **优雅降级** — 依赖缺失时进入 fallback 模式并清晰告知
29
29
 
@@ -37,7 +37,7 @@ CurdX-Flow 是一个 Claude Code 插件,把 6 个验证过的 AI 工程工作
37
37
  | 无工程纪律(AI 跳步、幻觉) | Karpathy L1 + verification-gate + TDD-gate |
38
38
  | 最佳实践分散 | 6 个工作流蒸馏到一个元框架 |
39
39
  | 验证薄弱(无证据声称"完成") | 目标反向验证 + 禁用词检测 |
40
- | 单视角决策 | Party Mode(真正多代理,非角色扮演)+ 对抗审查 |
40
+ | 单视角决策 | 多代理协作 + 对抗审查 |
41
41
 
42
42
  ## 安装
43
43
 
@@ -91,7 +91,7 @@ claude --plugin-dir ./curdx-flow
91
91
 
92
92
  1. **Mind(L1 基线)** — Karpathy 4 原则 + 必用工具规则 + 三条红线
93
93
  2. **Spec(规格)** — 研究 → 需求 → 设计 → 任务(可伸缩,4 文件 lite 到 12 文件 enterprise)
94
- 3. **Agents(代理)** — 15 职能 + 9 人格(Mary / John / Winston / ...)
94
+ 3. **Agents(代理)** — 15 个内部代理,按命令和流程调度
95
95
  4. **Flow(流程)** — 4 种执行策略,自动路由
96
96
  5. **Memory(记忆)** — claude-mem(隐式)+ `.flow/STATE.md`(显式决策 D-NN)
97
97
 
@@ -126,7 +126,7 @@ CurdX-Flow 是蒸馏,不是原创。深深致谢:
126
126
  - [**andrej-karpathy-skills**](https://github.com/forrestchang/andrej-karpathy-skills) — 4 原则
127
127
  - [**smart-ralph**](https://github.com/Nibzard/smart-ralph) — 规格引擎 + stop-hook 循环
128
128
  - [**superpowers**](https://github.com/obra/superpowers) — Subagent 纪律 + TDD + 两阶段审查
129
- - [**BMAD-METHOD**](https://github.com/bmad-code-org/BMAD-METHOD) — 人格 + Party Mode + 对抗审查
129
+ - [**BMAD-METHOD**](https://github.com/bmad-code-org/BMAD-METHOD) — 协作流程 + 对抗审查
130
130
  - [**get-shit-done**](https://github.com/ryangentry/get-shit-done) — 波形执行 + 决策锁定 + 多源审计
131
131
  - [**gstack**](https://github.com/garrytan/gstack)(Garry Tan) — 规划审查 + DX 哲学
132
132
  - [**pua**](https://github.com/tanweai/pua) — 持续性 + 三条红线
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env bash
2
+
3
+ has_python3() {
4
+ command -v python3 >/dev/null 2>&1
5
+ }
6
+
7
+ json_escape() {
8
+ local value="${1:-}"
9
+
10
+ if has_python3; then
11
+ printf '%s' "$value" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))'
12
+ return
13
+ fi
14
+
15
+ printf '%s' "$value" \
16
+ | sed 's/\\/\\\\/g; s/"/\\"/g' \
17
+ | awk 'BEGIN{printf "\""} {printf "%s\\n", $0} END{printf "\""}'
18
+ }
19
+
20
+ emit_session_start_context() {
21
+ local context="${1:-}"
22
+ printf '{"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":%s}}\n' \
23
+ "$(json_escape "$context")"
24
+ }
25
+
26
+ emit_pretooluse_deny() {
27
+ local reason="${1:-}"
28
+ printf '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":%s}}\n' \
29
+ "$(json_escape "$reason")"
30
+ }
31
+
32
+ emit_stop_block() {
33
+ local reason="${1:-}"
34
+ printf '{"decision":"block","reason":%s}\n' "$(json_escape "$reason")"
35
+ }
@@ -3,14 +3,14 @@
3
3
  # Injects the L1 baseline (Karpathy 4 principles + mandatory tool rules + 3 red lines)
4
4
  # as additionalContext at every session boot (startup, /clear, post-compact).
5
5
  #
6
- # Wired under SessionStart rather than InstructionsLoaded because Claude Code's
7
- # InstructionsLoaded event is observability-only its hook schema rejects
8
- # hookSpecificOutput / additionalContext. SessionStart with matcher
9
- # "startup|clear|compact" gives the same "baseline is always on, even after
10
- # compaction" property while staying within the supported schema.
6
+ # Wired under SessionStart with matcher "startup|clear|compact" so the
7
+ # baseline survives startup, /clear, and post-compact resume.
11
8
 
12
9
  set -u
13
10
 
11
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
+ . "$SCRIPT_DIR/common.sh"
13
+
14
14
  CONTEXT='## CurDX-Flow Mind Baseline (L1 — always on)
15
15
 
16
16
  ### 1. Think Before Coding
@@ -46,10 +46,8 @@ CONTEXT='## CurDX-Flow Mind Baseline (L1 — always on)
46
46
  2. **Fact-driven**: verify before saying "probably". An unverified attribution is blame-shifting
47
47
  3. **Exhaust everything**: before saying "I cannot", complete the systematic 4-stage debugging'
48
48
 
49
- # Emit JSON with safe encoding
50
- if command -v python3 >/dev/null 2>&1; then
51
- ESCAPED="$(printf '%s' "$CONTEXT" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))')"
52
- printf '{"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":%s}}\n' "$ESCAPED"
49
+ if has_python3; then
50
+ emit_session_start_context "$CONTEXT"
53
51
  fi
54
52
 
55
53
  exit 0
@@ -8,6 +8,9 @@
8
8
 
9
9
  set -u
10
10
 
11
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
+ . "$SCRIPT_DIR/common.sh"
13
+
11
14
  # Read input (Claude sends JSON on stdin for PreToolUse)
12
15
  INPUT=$(cat 2>/dev/null || echo "{}")
13
16
 
@@ -58,8 +61,7 @@ except Exception:
58
61
  if [ "$QUICK_MODE" = "true" ]; then
59
62
  # Block and inject guidance
60
63
  MSG="[CurDX-Flow quick-mode-guard] Active spec '$ACTIVE' is in quick mode or autonomous mode — AskUserQuestion is forbidden. Decide autonomously based on user preferences in .flow/CONTEXT.md plus the most reasonable assumption, and record your assumption in .progress.md."
61
- ESCAPED=$(printf '%s' "$MSG" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))')
62
- printf '{"decision":"block","reason":%s}\n' "$ESCAPED"
64
+ emit_pretooluse_deny "$MSG"
63
65
  exit 0
64
66
  fi
65
67
 
@@ -11,6 +11,9 @@
11
11
 
12
12
  set -u
13
13
 
14
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15
+ . "$SCRIPT_DIR/common.sh"
16
+
14
17
  DATA_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.claude/plugins/data/curdx-flow}"
15
18
  MARKER="$DATA_DIR/.deps-checked"
16
19
  TODAY="$(date +%Y-%m-%d)"
@@ -63,14 +66,7 @@ fi
63
66
 
64
67
  # ---------- 3. Emit hook output ----------
65
68
  if [ -n "$ADDITIONAL_CONTEXT" ]; then
66
- # Use python3 for safe JSON encoding (handles newlines, quotes)
67
- if command -v python3 >/dev/null 2>&1; then
68
- ESCAPED="$(printf '%s' "$ADDITIONAL_CONTEXT" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))')"
69
- else
70
- # Fallback: naive escape (only newlines and quotes)
71
- ESCAPED="$(printf '%s' "$ADDITIONAL_CONTEXT" | sed 's/\\/\\\\/g; s/"/\\"/g' | awk 'BEGIN{printf "\""} {printf "%s\\n", $0} END{printf "\""}')"
72
- fi
73
- printf '{"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":%s}}\n' "$ESCAPED"
69
+ emit_session_start_context "$ADDITIONAL_CONTEXT"
74
70
  fi
75
71
 
76
72
  exit 0
@@ -15,6 +15,9 @@
15
15
 
16
16
  set -u
17
17
 
18
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
19
+ . "$SCRIPT_DIR/common.sh"
20
+
18
21
  DATA_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.claude/plugins/data/curdx-flow}"
19
22
 
20
23
  # ---------- helper: exit with "allow stop" ----------
@@ -26,15 +29,7 @@ allow_stop() {
26
29
  # ---------- helper: block and inject continuation ----------
27
30
  block_continue() {
28
31
  local reason="$1"
29
- # Safely JSON-encode via python3 if available
30
- if command -v python3 >/dev/null 2>&1; then
31
- printf '{"decision":"block","reason":%s}\n' \
32
- "$(printf '%s' "$reason" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))')"
33
- else
34
- # Fallback: escape quotes and newlines naively
35
- local escaped=$(printf '%s' "$reason" | sed 's/\\/\\\\/g; s/"/\\"/g' | tr '\n' ' ')
36
- printf '{"decision":"block","reason":"%s"}\n' "$escaped"
37
- fi
32
+ emit_stop_block "$reason"
38
33
  exit 0
39
34
  }
40
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curdx/flow",
3
- "version": "2.0.18",
3
+ "version": "2.0.19",
4
4
  "description": "CLI installer for CurdX-Flow — AI engineering workflow meta-framework for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {