@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,63 +1,63 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""SubagentStop - verify a sub-agent's completion."""
|
|
3
|
-
import json
|
|
4
|
-
import os
|
|
5
|
-
import re
|
|
6
|
-
import sys
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
|
|
9
|
-
import flowcraft_env # noqa: F401 — UTF-8 stdio 双保险(R2)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def _clean(value: str) -> str:
|
|
13
|
-
value = re.sub(r"\s*#.*$", "", value)
|
|
14
|
-
return value.strip().strip('"')
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def count_modified_files(content: str) -> int:
|
|
18
|
-
lines = content.split("\n")
|
|
19
|
-
in_files = False
|
|
20
|
-
count = 0
|
|
21
|
-
for line in lines:
|
|
22
|
-
if line.startswith("modified_files:"):
|
|
23
|
-
in_files = True
|
|
24
|
-
continue
|
|
25
|
-
if in_files:
|
|
26
|
-
if line and not line[0].isspace():
|
|
27
|
-
break
|
|
28
|
-
if re.match(r"^\s*-\s+", line):
|
|
29
|
-
count += 1
|
|
30
|
-
return count
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def main() -> int:
|
|
34
|
-
state_file = Path(os.environ.get("CLAUDE_PROJECT_DIR") or ".") / ".claude" / "project-state.md"
|
|
35
|
-
if not state_file.is_file():
|
|
36
|
-
return 0
|
|
37
|
-
content = state_file.read_text(encoding="utf-8")
|
|
38
|
-
|
|
39
|
-
task = ""
|
|
40
|
-
m = re.search(r"^task_description:\s*(.*)$", content, re.M)
|
|
41
|
-
if m:
|
|
42
|
-
task = _clean(m.group(1))
|
|
43
|
-
files_count = count_modified_files(content)
|
|
44
|
-
|
|
45
|
-
if not task:
|
|
46
|
-
return 0
|
|
47
|
-
|
|
48
|
-
context = (
|
|
49
|
-
f"[子 Agent 完成] 任务={task},已修改{files_count}个文件。请验证:"
|
|
50
|
-
"(1) 代码符合需求 (2) 无多余变更 (3) modified_files 已更新。"
|
|
51
|
-
)
|
|
52
|
-
out = {
|
|
53
|
-
"hookSpecificOutput": {
|
|
54
|
-
"hookEventName": "SubagentStop",
|
|
55
|
-
"additionalContext": context,
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
print(json.dumps(out, ensure_ascii=False))
|
|
59
|
-
return 0
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if __name__ == "__main__":
|
|
63
|
-
sys.exit(main())
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""SubagentStop - verify a sub-agent's completion."""
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
import re
|
|
6
|
+
import sys
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
import flowcraft_env # noqa: F401 — UTF-8 stdio 双保险(R2)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _clean(value: str) -> str:
|
|
13
|
+
value = re.sub(r"\s*#.*$", "", value)
|
|
14
|
+
return value.strip().strip('"')
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def count_modified_files(content: str) -> int:
|
|
18
|
+
lines = content.split("\n")
|
|
19
|
+
in_files = False
|
|
20
|
+
count = 0
|
|
21
|
+
for line in lines:
|
|
22
|
+
if line.startswith("modified_files:"):
|
|
23
|
+
in_files = True
|
|
24
|
+
continue
|
|
25
|
+
if in_files:
|
|
26
|
+
if line and not line[0].isspace():
|
|
27
|
+
break
|
|
28
|
+
if re.match(r"^\s*-\s+", line):
|
|
29
|
+
count += 1
|
|
30
|
+
return count
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def main() -> int:
|
|
34
|
+
state_file = Path(os.environ.get("CLAUDE_PROJECT_DIR") or ".") / ".claude" / "project-state.md"
|
|
35
|
+
if not state_file.is_file():
|
|
36
|
+
return 0
|
|
37
|
+
content = state_file.read_text(encoding="utf-8")
|
|
38
|
+
|
|
39
|
+
task = ""
|
|
40
|
+
m = re.search(r"^task_description:\s*(.*)$", content, re.M)
|
|
41
|
+
if m:
|
|
42
|
+
task = _clean(m.group(1))
|
|
43
|
+
files_count = count_modified_files(content)
|
|
44
|
+
|
|
45
|
+
if not task:
|
|
46
|
+
return 0
|
|
47
|
+
|
|
48
|
+
context = (
|
|
49
|
+
f"[子 Agent 完成] 任务={task},已修改{files_count}个文件。请验证:"
|
|
50
|
+
"(1) 代码符合需求 (2) 无多余变更 (3) modified_files 已更新。"
|
|
51
|
+
)
|
|
52
|
+
out = {
|
|
53
|
+
"hookSpecificOutput": {
|
|
54
|
+
"hookEventName": "SubagentStop",
|
|
55
|
+
"additionalContext": context,
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
print(json.dumps(out, ensure_ascii=False))
|
|
59
|
+
return 0
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
if __name__ == "__main__":
|
|
63
|
+
sys.exit(main())
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""TaskCompleted - verify completion when a task finishes."""
|
|
3
|
-
import json
|
|
4
|
-
import os
|
|
5
|
-
import re
|
|
6
|
-
import sys
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
|
|
9
|
-
import flowcraft_env # noqa: F401 — UTF-8 stdio 双保险(R2)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def _clean(value: str) -> str:
|
|
13
|
-
value = re.sub(r"\s*#.*$", "", value)
|
|
14
|
-
return value.strip().strip('"')
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def count_modified_files(content: str) -> int:
|
|
18
|
-
lines = content.split("\n")
|
|
19
|
-
in_files = False
|
|
20
|
-
count = 0
|
|
21
|
-
for line in lines:
|
|
22
|
-
if line.startswith("modified_files:"):
|
|
23
|
-
in_files = True
|
|
24
|
-
continue
|
|
25
|
-
if in_files:
|
|
26
|
-
if line and not line[0].isspace():
|
|
27
|
-
break
|
|
28
|
-
if re.match(r"^\s*-\s+", line):
|
|
29
|
-
count += 1
|
|
30
|
-
return count
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def main() -> int:
|
|
34
|
-
state_file = Path(os.environ.get("CLAUDE_PROJECT_DIR") or ".") / ".claude" / "project-state.md"
|
|
35
|
-
if not state_file.is_file():
|
|
36
|
-
return 0
|
|
37
|
-
content = state_file.read_text(encoding="utf-8")
|
|
38
|
-
|
|
39
|
-
task = ""
|
|
40
|
-
m = re.search(r"^task_description:\s*(.*)$", content, re.M)
|
|
41
|
-
if m:
|
|
42
|
-
task = _clean(m.group(1))
|
|
43
|
-
files_count = count_modified_files(content)
|
|
44
|
-
|
|
45
|
-
if not task:
|
|
46
|
-
return 0
|
|
47
|
-
|
|
48
|
-
context = (
|
|
49
|
-
f"[任务完成] 任务={task},已修改{files_count}个文件。请验证:"
|
|
50
|
-
"(1) 修改的文件已追加到 modified_files (2) 代码正确 (3) 无多余变更。"
|
|
51
|
-
)
|
|
52
|
-
print(json.dumps({"stopReason": context}, ensure_ascii=False))
|
|
53
|
-
return 0
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if __name__ == "__main__":
|
|
57
|
-
sys.exit(main())
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""TaskCompleted - verify completion when a task finishes."""
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
import re
|
|
6
|
+
import sys
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
import flowcraft_env # noqa: F401 — UTF-8 stdio 双保险(R2)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _clean(value: str) -> str:
|
|
13
|
+
value = re.sub(r"\s*#.*$", "", value)
|
|
14
|
+
return value.strip().strip('"')
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def count_modified_files(content: str) -> int:
|
|
18
|
+
lines = content.split("\n")
|
|
19
|
+
in_files = False
|
|
20
|
+
count = 0
|
|
21
|
+
for line in lines:
|
|
22
|
+
if line.startswith("modified_files:"):
|
|
23
|
+
in_files = True
|
|
24
|
+
continue
|
|
25
|
+
if in_files:
|
|
26
|
+
if line and not line[0].isspace():
|
|
27
|
+
break
|
|
28
|
+
if re.match(r"^\s*-\s+", line):
|
|
29
|
+
count += 1
|
|
30
|
+
return count
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def main() -> int:
|
|
34
|
+
state_file = Path(os.environ.get("CLAUDE_PROJECT_DIR") or ".") / ".claude" / "project-state.md"
|
|
35
|
+
if not state_file.is_file():
|
|
36
|
+
return 0
|
|
37
|
+
content = state_file.read_text(encoding="utf-8")
|
|
38
|
+
|
|
39
|
+
task = ""
|
|
40
|
+
m = re.search(r"^task_description:\s*(.*)$", content, re.M)
|
|
41
|
+
if m:
|
|
42
|
+
task = _clean(m.group(1))
|
|
43
|
+
files_count = count_modified_files(content)
|
|
44
|
+
|
|
45
|
+
if not task:
|
|
46
|
+
return 0
|
|
47
|
+
|
|
48
|
+
context = (
|
|
49
|
+
f"[任务完成] 任务={task},已修改{files_count}个文件。请验证:"
|
|
50
|
+
"(1) 修改的文件已追加到 modified_files (2) 代码正确 (3) 无多余变更。"
|
|
51
|
+
)
|
|
52
|
+
print(json.dumps({"stopReason": context}, ensure_ascii=False))
|
|
53
|
+
return 0
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
if __name__ == "__main__":
|
|
57
|
+
sys.exit(main())
|