@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.
- package/README.md +19 -2
- package/bin/cli.js +108 -108
- package/flowcraft.yaml +30 -30
- package/install.sh +24 -24
- package/lib/args.js +38 -38
- package/lib/config.js +20 -20
- package/lib/copy.js +131 -131
- package/lib/fix.js +110 -110
- package/lib/fsutil.js +104 -104
- package/lib/global.js +229 -229
- package/lib/init.js +43 -43
- package/lib/runtime.js +84 -84
- package/lib/version.js +55 -55
- package/lib/wizard.js +125 -125
- package/package.json +33 -33
- package/presets/backend.yaml +20 -20
- package/presets/default.yaml +15 -15
- package/presets/frontend.yaml +20 -20
- package/presets/quick-fix.yaml +15 -15
- package/setup/.claude/hooks/check-phase-test.py +152 -152
- package/setup/.claude/hooks/check-phase-write.py +235 -235
- package/setup/.claude/hooks/dispatch.py +67 -67
- package/setup/.claude/hooks/file-suggestion.py +45 -45
- package/setup/.claude/hooks/flowcraft_env.py +162 -137
- package/setup/.claude/hooks/permission-request.py +132 -125
- package/setup/.claude/hooks/post-tool-failure.py +36 -36
- package/setup/.claude/hooks/pre-compact.py +66 -66
- package/setup/.claude/hooks/review-runner.py +846 -846
- package/setup/.claude/hooks/setup-keys.py +282 -282
- package/setup/.claude/hooks/statusline.py +63 -63
- package/setup/.claude/hooks/stop-check.py +186 -171
- package/setup/.claude/hooks/subagent-start.py +50 -50
- package/setup/.claude/hooks/subagent-stop.py +63 -63
- package/setup/.claude/hooks/task-completed.py +57 -57
- package/setup/.claude/hooks/task_manager.py +592 -592
- package/setup/.claude/hooks/user-prompt-submit.py +91 -85
- package/setup/.claude/settings.json +233 -237
- package/setup/.claude/skills/Pstatus/SKILL.md +68 -68
- package/setup/.claude/skills/archive/SKILL.md +195 -195
- package/setup/.claude/skills/brainstorming/SKILL.md +5 -5
- package/setup/.claude/skills/brainstorming/scripts/server.cjs +723 -723
- package/setup/.claude/skills/brainstorming/scripts/start-server.py +245 -245
- package/setup/.claude/skills/brainstorming/scripts/stop-server.py +178 -178
- package/setup/.claude/skills/brainstorming/visual-companion.md +298 -298
- package/setup/.claude/skills/chrome-integration/SKILL.md +66 -66
- package/setup/.claude/skills/code-review/SKILL.md +264 -264
- package/setup/.claude/skills/executing-plans/SKILL.md +1 -1
- package/setup/.claude/skills/gitnexus/gitnexus-cli/SKILL.md +67 -67
- package/setup/.claude/skills/gitnexus/gitnexus-debugging/SKILL.md +1 -1
- package/setup/.claude/skills/gitnexus/gitnexus-exploring/SKILL.md +1 -1
- package/setup/.claude/skills/gitnexus/gitnexus-guide/SKILL.md +1 -1
- package/setup/.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +1 -1
- package/setup/.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md +1 -1
- package/setup/.claude/skills/methodology/SKILL.md +124 -0
- package/setup/.claude/skills/phase/SKILL.md +62 -62
- package/setup/.claude/skills/playwright/SKILL.md +85 -85
- package/setup/.claude/skills/review/SKILL.md +97 -97
- package/setup/.claude/skills/task/SKILL.md +26 -26
- package/setup/.claude/skills/test-driven-development/SKILL.md +1 -1
- package/setup/.claude/skills/ui-ux-pro-max/SKILL.md +1 -1
- package/setup/.claude/skills/verification-before-completion/SKILL.md +1 -1
- package/setup/.claude/skills/writing-plans/SKILL.md +1 -1
- package/setup/.codex/.agents/skills/archive/SKILL.md +195 -195
- package/setup/.codex/.agents/skills/brainstorming/SKILL.md +5 -5
- package/setup/.codex/.agents/skills/brainstorming/scripts/server.cjs +723 -723
- package/setup/.codex/.agents/skills/brainstorming/scripts/start-server.py +245 -245
- package/setup/.codex/.agents/skills/brainstorming/scripts/stop-server.py +178 -178
- package/setup/.codex/.agents/skills/brainstorming/visual-companion.md +298 -298
- package/setup/.codex/.agents/skills/chrome-integration/SKILL.md +66 -66
- package/setup/.codex/.agents/skills/code-review/SKILL.md +264 -264
- package/setup/.codex/.agents/skills/executing-plans/SKILL.md +1 -1
- package/setup/.codex/.agents/skills/gitnexus/gitnexus-cli/SKILL.md +67 -67
- package/setup/.codex/.agents/skills/gitnexus/gitnexus-debugging/SKILL.md +1 -1
- package/setup/.codex/.agents/skills/gitnexus/gitnexus-exploring/SKILL.md +1 -1
- package/setup/.codex/.agents/skills/gitnexus/gitnexus-guide/SKILL.md +1 -1
- package/setup/.codex/.agents/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +1 -1
- package/setup/.codex/.agents/skills/gitnexus/gitnexus-refactoring/SKILL.md +1 -1
- package/setup/.codex/.agents/skills/methodology/SKILL.md +124 -0
- package/setup/.codex/.agents/skills/phase/SKILL.md +62 -62
- package/setup/.codex/.agents/skills/playwright/SKILL.md +85 -85
- package/setup/.codex/.agents/skills/review/SKILL.md +97 -97
- package/setup/.codex/.agents/skills/task/SKILL.md +27 -27
- package/setup/.codex/.agents/skills/test-driven-development/SKILL.md +1 -1
- package/setup/.codex/.agents/skills/ui-ux-pro-max/SKILL.md +1 -1
- package/setup/.codex/.agents/skills/verification-before-completion/SKILL.md +1 -1
- package/setup/.codex/.agents/skills/writing-plans/SKILL.md +1 -1
- package/setup/.codex/hooks/review-runner.py +851 -851
- package/setup/.codex/hooks/setup-keys.py +287 -287
- package/setup/AGENTS.md +11 -1
- package/setup/CLAUDE.md +11 -1
- package/setup/install.sh +24 -24
- package/setup/tests/test_decision_timeout.py +241 -241
- package/setup/tests/test_hook_guards.py +357 -357
- package/setup/tests/test_sdlc_bootstrap.py +167 -167
- package/setup/tests/test_sessionlog_switch.py +199 -0
- 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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
user_input = sys.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
"
|
|
211
|
-
|
|
212
|
-
"
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
|
+
}
|