@leocm/flowcraft 2.1.0 → 2.3.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 (96) hide show
  1. package/README.md +19 -2
  2. package/bin/cli.js +108 -108
  3. package/flowcraft.yaml +30 -30
  4. package/install.sh +24 -24
  5. package/lib/args.js +38 -38
  6. package/lib/config.js +20 -20
  7. package/lib/copy.js +131 -131
  8. package/lib/fix.js +110 -110
  9. package/lib/fsutil.js +104 -104
  10. package/lib/global.js +229 -229
  11. package/lib/init.js +43 -43
  12. package/lib/runtime.js +84 -84
  13. package/lib/version.js +55 -55
  14. package/lib/wizard.js +125 -125
  15. package/package.json +33 -33
  16. package/presets/backend.yaml +20 -20
  17. package/presets/default.yaml +15 -15
  18. package/presets/frontend.yaml +20 -20
  19. package/presets/quick-fix.yaml +15 -15
  20. package/setup/.claude/hooks/check-phase-test.py +152 -152
  21. package/setup/.claude/hooks/check-phase-write.py +235 -235
  22. package/setup/.claude/hooks/dispatch.py +67 -67
  23. package/setup/.claude/hooks/file-suggestion.py +45 -45
  24. package/setup/.claude/hooks/flowcraft_env.py +162 -137
  25. package/setup/.claude/hooks/permission-request.py +132 -125
  26. package/setup/.claude/hooks/post-tool-failure.py +36 -36
  27. package/setup/.claude/hooks/pre-compact.py +66 -66
  28. package/setup/.claude/hooks/review-runner.py +846 -846
  29. package/setup/.claude/hooks/setup-keys.py +282 -282
  30. package/setup/.claude/hooks/statusline.py +63 -63
  31. package/setup/.claude/hooks/stop-check.py +186 -171
  32. package/setup/.claude/hooks/subagent-start.py +50 -50
  33. package/setup/.claude/hooks/subagent-stop.py +63 -63
  34. package/setup/.claude/hooks/task-completed.py +57 -57
  35. package/setup/.claude/hooks/task_manager.py +592 -592
  36. package/setup/.claude/hooks/user-prompt-submit.py +91 -85
  37. package/setup/.claude/settings.json +233 -237
  38. package/setup/.claude/skills/Pstatus/SKILL.md +68 -68
  39. package/setup/.claude/skills/archive/SKILL.md +195 -195
  40. package/setup/.claude/skills/brainstorming/SKILL.md +5 -5
  41. package/setup/.claude/skills/brainstorming/scripts/server.cjs +723 -723
  42. package/setup/.claude/skills/brainstorming/scripts/start-server.py +245 -245
  43. package/setup/.claude/skills/brainstorming/scripts/stop-server.py +178 -178
  44. package/setup/.claude/skills/brainstorming/visual-companion.md +298 -298
  45. package/setup/.claude/skills/chrome-integration/SKILL.md +66 -66
  46. package/setup/.claude/skills/code-review/SKILL.md +264 -264
  47. package/setup/.claude/skills/executing-plans/SKILL.md +1 -1
  48. package/setup/.claude/skills/gitnexus/gitnexus-cli/SKILL.md +67 -67
  49. package/setup/.claude/skills/gitnexus/gitnexus-debugging/SKILL.md +1 -1
  50. package/setup/.claude/skills/gitnexus/gitnexus-exploring/SKILL.md +1 -1
  51. package/setup/.claude/skills/gitnexus/gitnexus-guide/SKILL.md +1 -1
  52. package/setup/.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +1 -1
  53. package/setup/.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md +1 -1
  54. package/setup/.claude/skills/methodology/SKILL.md +124 -0
  55. package/setup/.claude/skills/phase/SKILL.md +62 -62
  56. package/setup/.claude/skills/playwright/SKILL.md +85 -85
  57. package/setup/.claude/skills/review/SKILL.md +97 -97
  58. package/setup/.claude/skills/task/SKILL.md +26 -26
  59. package/setup/.claude/skills/test-driven-development/SKILL.md +1 -1
  60. package/setup/.claude/skills/ui-ux-pro-max/SKILL.md +1 -1
  61. package/setup/.claude/skills/verification-before-completion/SKILL.md +1 -1
  62. package/setup/.claude/skills/writing-plans/SKILL.md +1 -1
  63. package/setup/.codex/.agents/skills/archive/SKILL.md +195 -195
  64. package/setup/.codex/.agents/skills/brainstorming/SKILL.md +5 -5
  65. package/setup/.codex/.agents/skills/brainstorming/scripts/server.cjs +723 -723
  66. package/setup/.codex/.agents/skills/brainstorming/scripts/start-server.py +245 -245
  67. package/setup/.codex/.agents/skills/brainstorming/scripts/stop-server.py +178 -178
  68. package/setup/.codex/.agents/skills/brainstorming/visual-companion.md +298 -298
  69. package/setup/.codex/.agents/skills/chrome-integration/SKILL.md +66 -66
  70. package/setup/.codex/.agents/skills/code-review/SKILL.md +264 -264
  71. package/setup/.codex/.agents/skills/executing-plans/SKILL.md +1 -1
  72. package/setup/.codex/.agents/skills/gitnexus/gitnexus-cli/SKILL.md +67 -67
  73. package/setup/.codex/.agents/skills/gitnexus/gitnexus-debugging/SKILL.md +1 -1
  74. package/setup/.codex/.agents/skills/gitnexus/gitnexus-exploring/SKILL.md +1 -1
  75. package/setup/.codex/.agents/skills/gitnexus/gitnexus-guide/SKILL.md +1 -1
  76. package/setup/.codex/.agents/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +1 -1
  77. package/setup/.codex/.agents/skills/gitnexus/gitnexus-refactoring/SKILL.md +1 -1
  78. package/setup/.codex/.agents/skills/methodology/SKILL.md +124 -0
  79. package/setup/.codex/.agents/skills/phase/SKILL.md +62 -62
  80. package/setup/.codex/.agents/skills/playwright/SKILL.md +85 -85
  81. package/setup/.codex/.agents/skills/review/SKILL.md +97 -97
  82. package/setup/.codex/.agents/skills/task/SKILL.md +27 -27
  83. package/setup/.codex/.agents/skills/test-driven-development/SKILL.md +1 -1
  84. package/setup/.codex/.agents/skills/ui-ux-pro-max/SKILL.md +1 -1
  85. package/setup/.codex/.agents/skills/verification-before-completion/SKILL.md +1 -1
  86. package/setup/.codex/.agents/skills/writing-plans/SKILL.md +1 -1
  87. package/setup/.codex/hooks/review-runner.py +851 -851
  88. package/setup/.codex/hooks/setup-keys.py +287 -287
  89. package/setup/AGENTS.md +11 -1
  90. package/setup/CLAUDE.md +11 -1
  91. package/setup/install.sh +24 -24
  92. package/setup/tests/test_decision_timeout.py +241 -241
  93. package/setup/tests/test_hook_guards.py +357 -357
  94. package/setup/tests/test_sdlc_bootstrap.py +167 -167
  95. package/setup/tests/test_sessionlog_switch.py +199 -0
  96. package/setup/tests/test_task_manager.py +148 -148
@@ -1,85 +1,91 @@
1
- #!/usr/bin/env python3
2
- """UserPromptSubmit - record the user prompt into session_log.json."""
3
- import json
4
- import os
5
- import subprocess
6
- import sys
7
- import tempfile
8
- from pathlib import Path
9
-
10
-
11
- def _sanitize(text: str) -> str:
12
- """Strip UTF-16 surrogates that json.loads may preserve on Windows."""
13
- return text.encode("utf-8", errors="surrogatepass").decode("utf-8", errors="replace")
14
-
15
-
16
- def main() -> int:
17
- project_dir = os.environ.get("CLAUDE_PROJECT_DIR") or "."
18
- state_file = Path(project_dir) / ".claude" / "project-state.md"
19
- session_log = Path(project_dir) / ".claude" / "session_log.json"
20
- log_script = Path(project_dir) / ".claude" / "hooks" / "log_session.py"
21
-
22
- # Exit silently when the project is not SDLC-initialised
23
- if not state_file.is_file():
24
- return 0
25
-
26
- # User input arrives via args or stdin
27
- if len(sys.argv) > 1:
28
- user_input = " ".join(sys.argv[1:])
29
- else:
30
- user_input = sys.stdin.read()
31
- if not user_input.strip():
32
- return 0
33
-
34
- # If the input is JSON, extract the prompt field
35
- try:
36
- data = json.loads(user_input)
37
- if isinstance(data, dict) and "prompt" in data:
38
- user_input = data.get("prompt") or ""
39
- except Exception:
40
- pass
41
-
42
- user_input = _sanitize(user_input)
43
-
44
- # R7: any user input resolves the pending decision → delete the marker
45
- marker = Path(project_dir) / ".claude" / "decision-pending.json"
46
- if marker.is_file():
47
- try:
48
- marker.unlink()
49
- except OSError:
50
- pass
51
-
52
- # Get the git user name
53
- git_user = "unknown"
54
- try:
55
- r = subprocess.run(
56
- ["git", "config", "user.name"],
57
- capture_output=True,
58
- text=True,
59
- timeout=3,
60
- )
61
- if r.returncode == 0 and r.stdout.strip():
62
- git_user = r.stdout.strip()
63
- except Exception:
64
- pass
65
-
66
- # Use a temp file to pass Chinese args and avoid encoding issues
67
- fd, temp_input = tempfile.mkstemp()
68
- try:
69
- with os.fdopen(fd, "w", encoding="utf-8") as tf:
70
- tf.write(user_input)
71
- env = dict(os.environ)
72
- env["SESSION_LOG"] = str(session_log)
73
- env["GIT_USER"] = git_user
74
- env["TEMP_INPUT"] = temp_input
75
- subprocess.run([sys.executable, str(log_script), "user"], env=env)
76
- finally:
77
- try:
78
- os.unlink(temp_input)
79
- except OSError:
80
- pass
81
- return 0
82
-
83
-
84
- if __name__ == "__main__":
85
- sys.exit(main())
1
+ #!/usr/bin/env python3
2
+ """UserPromptSubmit - record the user prompt into session_log.json."""
3
+ import json
4
+ import os
5
+ import subprocess
6
+ import sys
7
+ import tempfile
8
+ from pathlib import Path
9
+
10
+ from flowcraft_env import sessionlog_local_enabled # R1: 本地日志开关
11
+
12
+
13
+ def _sanitize(text: str) -> str:
14
+ """Strip UTF-16 surrogates that json.loads may preserve on Windows."""
15
+ return text.encode("utf-8", errors="surrogatepass").decode("utf-8", errors="replace")
16
+
17
+
18
+ def main() -> int:
19
+ project_dir = os.environ.get("CLAUDE_PROJECT_DIR") or "."
20
+ state_file = Path(project_dir) / ".claude" / "project-state.md"
21
+ session_log = Path(project_dir) / ".claude" / "session_log.json"
22
+ log_script = Path(project_dir) / ".claude" / "hooks" / "log_session.py"
23
+
24
+ # Exit silently when the project is not SDLC-initialised
25
+ if not state_file.is_file():
26
+ return 0
27
+
28
+ # User input arrives via args or stdin
29
+ if len(sys.argv) > 1:
30
+ user_input = " ".join(sys.argv[1:])
31
+ else:
32
+ user_input = sys.stdin.read()
33
+ if not user_input.strip():
34
+ return 0
35
+
36
+ # If the input is JSON, extract the prompt field
37
+ try:
38
+ data = json.loads(user_input)
39
+ if isinstance(data, dict) and "prompt" in data:
40
+ user_input = data.get("prompt") or ""
41
+ except Exception:
42
+ pass
43
+
44
+ user_input = _sanitize(user_input)
45
+
46
+ # R7: any user input resolves the pending decision → delete the marker
47
+ marker = Path(project_dir) / ".claude" / "decision-pending.json"
48
+ if marker.is_file():
49
+ try:
50
+ marker.unlink()
51
+ except OSError:
52
+ pass
53
+
54
+ # R1: 本地日志开关——sessionlog.local=false 时跳过写入(默认开)
55
+ if not sessionlog_local_enabled(Path(project_dir)):
56
+ return 0
57
+
58
+ # Get the git user name
59
+ git_user = "unknown"
60
+ try:
61
+ r = subprocess.run(
62
+ ["git", "config", "user.name"],
63
+ capture_output=True,
64
+ text=True,
65
+ timeout=3,
66
+ )
67
+ if r.returncode == 0 and r.stdout.strip():
68
+ git_user = r.stdout.strip()
69
+ except Exception:
70
+ pass
71
+
72
+ # Use a temp file to pass Chinese args and avoid encoding issues
73
+ fd, temp_input = tempfile.mkstemp()
74
+ try:
75
+ with os.fdopen(fd, "w", encoding="utf-8") as tf:
76
+ tf.write(user_input)
77
+ env = dict(os.environ)
78
+ env["SESSION_LOG"] = str(session_log)
79
+ env["GIT_USER"] = git_user
80
+ env["TEMP_INPUT"] = temp_input
81
+ subprocess.run([sys.executable, str(log_script), "user"], env=env)
82
+ finally:
83
+ try:
84
+ os.unlink(temp_input)
85
+ except OSError:
86
+ pass
87
+ return 0
88
+
89
+
90
+ if __name__ == "__main__":
91
+ sys.exit(main())
@@ -1,237 +1,233 @@
1
- {
2
- "$schema": "https://json.schemastore.org/claude-code-settings.json",
3
- "fileSuggestion": {
4
- "type": "command",
5
- "command": "python ~/.flowcraft/hooks/dispatch.py file-suggestion"
6
- },
7
- "env": {
8
- "SUPERPOWERS_PROJECT": "true"
9
- },
10
- "permissions": {
11
- "allow": [
12
- "Bash(git status)",
13
- "Bash(git status *)",
14
- "Bash(git diff *)",
15
- "Bash(git log *)",
16
- "Bash(git branch)",
17
- "Bash(git branch --list *)",
18
- "Bash(git stash *)",
19
- "Bash(npm run lint *)",
20
- "Bash(npm run lint)",
21
- "Bash(npm run build *)",
22
- "Bash(npm run build)",
23
- "Bash(npx eslint *)",
24
- "Bash(npx tsc *)",
25
- "Bash(npm test *)",
26
- "Bash(npm test)",
27
- "Bash(npx vitest *)",
28
- "Bash(npx jest *)",
29
- "Bash(npx mocha *)",
30
- "Bash(pytest *)",
31
- "Bash(go test *)",
32
- "Bash(cargo test *)",
33
- "Read(*)",
34
- "Glob(*)",
35
- "Grep(*)",
36
- "Bash(bash *)",
37
- "Bash(python ~/.flowcraft/hooks/*)",
38
- "Bash(~/.flowcraft/hooks/dispatch.py statusline)",
39
- "Edit(.claude/project-state.md)",
40
- "Write(.claude/project-state.md)"
41
- ],
42
- "deny": [
43
- "Read(./.env)",
44
- "Read(./.env.*)",
45
- "Edit(./.env)",
46
- "Edit(./.env.*)",
47
- "Write(./.env)",
48
- "Write(./.env.*)"
49
- ],
50
- "ask": [
51
- "Bash(rm -rf *)",
52
- "Bash(git push --force *)",
53
- "Bash(git reset --hard *)",
54
- "Bash(git branch -D *)"
55
- ],
56
- "defaultMode": "default"
57
- },
58
- "hooks": {
59
- "SessionStart": [
60
- {
61
- "matcher": "startup|resume|compact",
62
- "hooks": [
63
- {
64
- "type": "command",
65
- "command": "python ~/.flowcraft/hooks/dispatch.py session-start",
66
- "timeout": 5
67
- }
68
- ]
69
- }
70
- ],
71
- "UserPromptSubmit": [
72
- {
73
- "hooks": [
74
- {
75
- "type": "command",
76
- "command": "python ~/.flowcraft/hooks/dispatch.py user-prompt-submit",
77
- "timeout": 3
78
- }
79
- ]
80
- }
81
- ],
82
- "PreToolUse": [
83
- {
84
- "matcher": "Write|Edit",
85
- "hooks": [
86
- {
87
- "type": "command",
88
- "command": "python ~/.flowcraft/hooks/dispatch.py check-phase-advancement",
89
- "timeout": 3,
90
- "statusMessage": "检查阶段产出物..."
91
- },
92
- {
93
- "type": "command",
94
- "command": "python ~/.flowcraft/hooks/dispatch.py check-phase-write",
95
- "timeout": 3,
96
- "statusMessage": "检查写入权限..."
97
- }
98
- ]
99
- },
100
- {
101
- "matcher": "Bash",
102
- "hooks": [
103
- {
104
- "type": "command",
105
- "command": "python ~/.flowcraft/hooks/dispatch.py check-phase-test",
106
- "timeout": 3,
107
- "statusMessage": "检查命令权限..."
108
- }
109
- ]
110
- }
111
- ],
112
- "PostToolUse": [],
113
- "Stop": [
114
- {
115
- "hooks": [
116
- {
117
- "type": "command",
118
- "command": "python ~/.flowcraft/hooks/dispatch.py stop-check",
119
- "timeout": 5
120
- }
121
- ]
122
- }
123
- ],
124
- "PreCompact": [
125
- {
126
- "hooks": [
127
- {
128
- "type": "command",
129
- "command": "python ~/.flowcraft/hooks/dispatch.py pre-compact",
130
- "timeout": 5
131
- }
132
- ]
133
- }
134
- ],
135
- "SubagentStart": [
136
- {
137
- "hooks": [
138
- {
139
- "type": "command",
140
- "command": "python ~/.flowcraft/hooks/dispatch.py subagent-start",
141
- "timeout": 5,
142
- "statusMessage": "注入 SDLC 上下文..."
143
- }
144
- ]
145
- }
146
- ],
147
- "TaskCompleted": [
148
- {
149
- "hooks": [
150
- {
151
- "type": "command",
152
- "command": "python ~/.flowcraft/hooks/dispatch.py task-completed",
153
- "timeout": 3
154
- }
155
- ]
156
- }
157
- ],
158
- "SubagentStop": [
159
- {
160
- "hooks": [
161
- {
162
- "type": "command",
163
- "command": "python ~/.flowcraft/hooks/dispatch.py subagent-stop",
164
- "timeout": 5,
165
- "statusMessage": "验证子 Agent 输出..."
166
- }
167
- ]
168
- }
169
- ],
170
- "PostToolUseFailure": [
171
- {
172
- "hooks": [
173
- {
174
- "type": "command",
175
- "command": "python ~/.flowcraft/hooks/dispatch.py post-tool-failure",
176
- "timeout": 5
177
- }
178
- ]
179
- }
180
- ],
181
- "PermissionRequest": [
182
- {
183
- "hooks": [
184
- {
185
- "type": "command",
186
- "command": "python ~/.flowcraft/hooks/dispatch.py permission-request",
187
- "timeout": 5,
188
- "statusMessage": "SDLC 权限决策..."
189
- }
190
- ]
191
- }
192
- ],
193
- "SessionEnd": [
194
- {
195
- "hooks": [
196
- {
197
- "type": "command",
198
- "command": "python ~/.flowcraft/hooks/dispatch.py session-end",
199
- "timeout": 5
200
- }
201
- ]
202
- }
203
- ]
204
- },
205
- "statusLine": {
206
- "type": "command",
207
- "command": "python ~/.flowcraft/hooks/dispatch.py statusline",
208
- "padding": 1
209
- },
210
- "enabledPlugins": {
211
- "superpowers@claude-plugins-official": true,
212
- "context-hub-plugin@forgetful-plugins": true
213
- },
214
- "language": "zh-CN",
215
- "sandbox": {
216
- "enabled": true,
217
- "network": {
218
- "allowedDomains": [
219
- "github.com",
220
- "*.npmjs.org",
221
- "registry.npmmirror.com",
222
- "pypi.org"
223
- ]
224
- }
225
- },
226
- "spinnerVerbs": {
227
- "mode": "append",
228
- "verbs": [
229
- "审查中",
230
- "编码中",
231
- "测试中",
232
- "分析需求",
233
- "设计方案",
234
- "检查合规"
235
- ]
236
- }
237
- }
1
+ {
2
+ "$schema": "https://json.schemastore.org/claude-code-settings.json",
3
+ "fileSuggestion": {
4
+ "type": "command",
5
+ "command": "python ~/.flowcraft/hooks/dispatch.py file-suggestion"
6
+ },
7
+ "env": {
8
+ "SUPERPOWERS_PROJECT": "true"
9
+ },
10
+ "permissions": {
11
+ "allow": [
12
+ "Bash(git status)",
13
+ "Bash(git status *)",
14
+ "Bash(git diff *)",
15
+ "Bash(git log *)",
16
+ "Bash(git branch)",
17
+ "Bash(git branch --list *)",
18
+ "Bash(git stash *)",
19
+ "Bash(npm run lint *)",
20
+ "Bash(npm run lint)",
21
+ "Bash(npm run build *)",
22
+ "Bash(npm run build)",
23
+ "Bash(npx eslint *)",
24
+ "Bash(npx tsc *)",
25
+ "Bash(npm test *)",
26
+ "Bash(npm test)",
27
+ "Bash(npx vitest *)",
28
+ "Bash(npx jest *)",
29
+ "Bash(npx mocha *)",
30
+ "Bash(pytest *)",
31
+ "Bash(go test *)",
32
+ "Bash(cargo test *)",
33
+ "Read(*)",
34
+ "Glob(*)",
35
+ "Grep(*)",
36
+ "Bash(bash *)",
37
+ "Bash(python ~/.flowcraft/hooks/*)",
38
+ "Bash(~/.flowcraft/hooks/dispatch.py statusline)",
39
+ "Edit(.claude/project-state.md)",
40
+ "Write(.claude/project-state.md)"
41
+ ],
42
+ "deny": [
43
+ "Read(./.env)",
44
+ "Read(./.env.*)",
45
+ "Edit(./.env)",
46
+ "Edit(./.env.*)",
47
+ "Write(./.env)",
48
+ "Write(./.env.*)"
49
+ ],
50
+ "ask": [
51
+ "Bash(rm -rf *)",
52
+ "Bash(git push --force *)",
53
+ "Bash(git reset --hard *)",
54
+ "Bash(git branch -D *)"
55
+ ],
56
+ "defaultMode": "default"
57
+ },
58
+ "hooks": {
59
+ "SessionStart": [
60
+ {
61
+ "matcher": "startup|resume|compact",
62
+ "hooks": [
63
+ {
64
+ "type": "command",
65
+ "command": "python ~/.flowcraft/hooks/dispatch.py session-start",
66
+ "timeout": 5
67
+ }
68
+ ]
69
+ }
70
+ ],
71
+ "UserPromptSubmit": [
72
+ {
73
+ "hooks": [
74
+ {
75
+ "type": "command",
76
+ "command": "python ~/.flowcraft/hooks/dispatch.py user-prompt-submit",
77
+ "timeout": 3
78
+ }
79
+ ]
80
+ }
81
+ ],
82
+ "PreToolUse": [
83
+ {
84
+ "matcher": "Write|Edit",
85
+ "hooks": [
86
+ {
87
+ "type": "command",
88
+ "command": "python ~/.flowcraft/hooks/dispatch.py check-phase-advancement",
89
+ "timeout": 3,
90
+ "statusMessage": "检查阶段产出物..."
91
+ },
92
+ {
93
+ "type": "command",
94
+ "command": "python ~/.flowcraft/hooks/dispatch.py check-phase-write",
95
+ "timeout": 3,
96
+ "statusMessage": "检查写入权限..."
97
+ }
98
+ ]
99
+ },
100
+ {
101
+ "matcher": "Bash",
102
+ "hooks": [
103
+ {
104
+ "type": "command",
105
+ "command": "python ~/.flowcraft/hooks/dispatch.py check-phase-test",
106
+ "timeout": 3,
107
+ "statusMessage": "检查命令权限..."
108
+ }
109
+ ]
110
+ }
111
+ ],
112
+ "PostToolUse": [],
113
+ "Stop": [
114
+ {
115
+ "hooks": [
116
+ {
117
+ "type": "command",
118
+ "command": "python ~/.flowcraft/hooks/dispatch.py stop-check",
119
+ "timeout": 5
120
+ }
121
+ ]
122
+ }
123
+ ],
124
+ "PreCompact": [
125
+ {
126
+ "hooks": [
127
+ {
128
+ "type": "command",
129
+ "command": "python ~/.flowcraft/hooks/dispatch.py pre-compact",
130
+ "timeout": 5
131
+ }
132
+ ]
133
+ }
134
+ ],
135
+ "SubagentStart": [
136
+ {
137
+ "hooks": [
138
+ {
139
+ "type": "command",
140
+ "command": "python ~/.flowcraft/hooks/dispatch.py subagent-start",
141
+ "timeout": 5,
142
+ "statusMessage": "注入 SDLC 上下文..."
143
+ }
144
+ ]
145
+ }
146
+ ],
147
+ "TaskCompleted": [
148
+ {
149
+ "hooks": [
150
+ {
151
+ "type": "command",
152
+ "command": "python ~/.flowcraft/hooks/dispatch.py task-completed",
153
+ "timeout": 3
154
+ }
155
+ ]
156
+ }
157
+ ],
158
+ "SubagentStop": [
159
+ {
160
+ "hooks": [
161
+ {
162
+ "type": "command",
163
+ "command": "python ~/.flowcraft/hooks/dispatch.py subagent-stop",
164
+ "timeout": 5,
165
+ "statusMessage": "验证子 Agent 输出..."
166
+ }
167
+ ]
168
+ }
169
+ ],
170
+ "PostToolUseFailure": [
171
+ {
172
+ "hooks": [
173
+ {
174
+ "type": "command",
175
+ "command": "python ~/.flowcraft/hooks/dispatch.py post-tool-failure",
176
+ "timeout": 5
177
+ }
178
+ ]
179
+ }
180
+ ],
181
+ "PermissionRequest": [
182
+ {
183
+ "hooks": [
184
+ {
185
+ "type": "command",
186
+ "command": "python ~/.flowcraft/hooks/dispatch.py permission-request",
187
+ "timeout": 5,
188
+ "statusMessage": "SDLC 权限决策..."
189
+ }
190
+ ]
191
+ }
192
+ ],
193
+ "SessionEnd": [
194
+ {
195
+ "hooks": [
196
+ {
197
+ "type": "command",
198
+ "command": "python ~/.flowcraft/hooks/dispatch.py session-end",
199
+ "timeout": 5
200
+ }
201
+ ]
202
+ }
203
+ ]
204
+ },
205
+ "statusLine": {
206
+ "type": "command",
207
+ "command": "python ~/.flowcraft/hooks/dispatch.py statusline",
208
+ "padding": 1
209
+ },
210
+ "language": "zh-CN",
211
+ "sandbox": {
212
+ "enabled": true,
213
+ "network": {
214
+ "allowedDomains": [
215
+ "github.com",
216
+ "*.npmjs.org",
217
+ "registry.npmmirror.com",
218
+ "pypi.org"
219
+ ]
220
+ }
221
+ },
222
+ "spinnerVerbs": {
223
+ "mode": "append",
224
+ "verbs": [
225
+ "审查中",
226
+ "编码中",
227
+ "测试中",
228
+ "分析需求",
229
+ "设计方案",
230
+ "检查合规"
231
+ ]
232
+ }
233
+ }