@leocm/flowcraft 2.2.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 +7 -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 -162
  25. package/setup/.claude/hooks/permission-request.py +132 -132
  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 -186
  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 -91
  37. package/setup/.claude/settings.json +233 -233
  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 -199
  96. 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())