create-ax-project 1.0.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 (258) hide show
  1. package/README.md +374 -0
  2. package/bin/create.js +193 -0
  3. package/package.json +38 -0
  4. package/template/.claude/CLAUDE.md +7 -0
  5. package/template/.claude/commands/CLAUDE.md +0 -0
  6. package/template/.claude/commands/benchmark.md +103 -0
  7. package/template/.claude/commands/brainstorm.md +67 -0
  8. package/template/.claude/commands/checkpoint.md +93 -0
  9. package/template/.claude/commands/codex.md +107 -0
  10. package/template/.claude/commands/collaborate.md +85 -0
  11. package/template/.claude/commands/context.md +154 -0
  12. package/template/.claude/commands/deploy.md +102 -0
  13. package/template/.claude/commands/fork.md +142 -0
  14. package/template/.claude/commands/gemini.md +84 -0
  15. package/template/.claude/commands/handoff.md +80 -0
  16. package/template/.claude/commands/implement.md +82 -0
  17. package/template/.claude/commands/init-project.md +49 -0
  18. package/template/.claude/commands/next.md +125 -0
  19. package/template/.claude/commands/planning.md +69 -0
  20. package/template/.claude/commands/qa.md +81 -0
  21. package/template/.claude/commands/refactor.md +95 -0
  22. package/template/.claude/commands/research.md +60 -0
  23. package/template/.claude/commands/restore.md +113 -0
  24. package/template/.claude/commands/run-stage.md +78 -0
  25. package/template/.claude/commands/stages.md +109 -0
  26. package/template/.claude/commands/status.md +73 -0
  27. package/template/.claude/commands/tasks.md +80 -0
  28. package/template/.claude/commands/test.md +93 -0
  29. package/template/.claude/commands/ui-ux.md +61 -0
  30. package/template/.claude/commands/validate.md +174 -0
  31. package/template/.claude/hooks/CLAUDE.md +0 -0
  32. package/template/.claude/hooks/ai-selector.sh +223 -0
  33. package/template/.claude/hooks/auto-checkpoint.sh +187 -0
  34. package/template/.claude/hooks/output-validator.sh +289 -0
  35. package/template/.claude/hooks/post-stage.sh +123 -0
  36. package/template/.claude/hooks/pre-stage.sh +186 -0
  37. package/template/.claude/hooks/session-start.sh +90 -0
  38. package/template/.claude/hooks/statusline.sh +115 -0
  39. package/template/.claude/hooks/stop.sh +104 -0
  40. package/template/.claude/settings.json +149 -0
  41. package/template/.claude/skills/ai-collaboration/CLAUDE.md +0 -0
  42. package/template/.claude/skills/ai-collaboration/README.md +61 -0
  43. package/template/.claude/skills/ai-collaboration/debate.md +148 -0
  44. package/template/.claude/skills/ai-collaboration/parallel.md +96 -0
  45. package/template/.claude/skills/ai-collaboration/prompts/CLAUDE.md +107 -0
  46. package/template/.claude/skills/auto-checkpoint/CLAUDE.md +0 -0
  47. package/template/.claude/skills/auto-checkpoint/README.md +77 -0
  48. package/template/.claude/skills/auto-checkpoint/prompts/CLAUDE.md +113 -0
  49. package/template/.claude/skills/auto-checkpoint/rollback.md +152 -0
  50. package/template/.claude/skills/auto-checkpoint/trigger.md +122 -0
  51. package/template/.claude/skills/context-compression/CLAUDE.md +0 -0
  52. package/template/.claude/skills/context-compression/README.md +121 -0
  53. package/template/.claude/skills/context-compression/analyze.md +114 -0
  54. package/template/.claude/skills/context-compression/compress.md +175 -0
  55. package/template/.claude/skills/context-compression/prompts/CLAUDE.md +0 -0
  56. package/template/.claude/skills/context-compression/prompts/compression.md +172 -0
  57. package/template/.claude/skills/output-validator/CLAUDE.md +0 -0
  58. package/template/.claude/skills/output-validator/README.md +86 -0
  59. package/template/.claude/skills/output-validator/prompts/CLAUDE.md +119 -0
  60. package/template/.claude/skills/output-validator/validate.md +182 -0
  61. package/template/.claude/skills/smart-handoff/CLAUDE.md +0 -0
  62. package/template/.claude/skills/smart-handoff/README.md +59 -0
  63. package/template/.claude/skills/smart-handoff/extract.md +76 -0
  64. package/template/.claude/skills/smart-handoff/prompts/CLAUDE.md +86 -0
  65. package/template/.claude/skills/smart-handoff/summarize.md +94 -0
  66. package/template/.claude/skills/stage-transition/CLAUDE.md +0 -0
  67. package/template/.claude/skills/stage-transition/README.md +84 -0
  68. package/template/.claude/skills/stage-transition/handoff-gen.md +160 -0
  69. package/template/.claude/skills/stage-transition/prompts/CLAUDE.md +0 -0
  70. package/template/.claude/skills/stage-transition/prompts/transition.md +145 -0
  71. package/template/.claude/skills/stage-transition/validate.md +108 -0
  72. package/template/CLAUDE.md +528 -0
  73. package/template/config/CLAUDE.md +0 -0
  74. package/template/config/ai_benchmarking.yaml +184 -0
  75. package/template/config/ai_collaboration.yaml +159 -0
  76. package/template/config/ai_logging.yaml +129 -0
  77. package/template/config/auto_checkpoint.yaml +189 -0
  78. package/template/config/context.yaml +78 -0
  79. package/template/config/git.yaml +161 -0
  80. package/template/config/handoff_intelligence.yaml +229 -0
  81. package/template/config/implementation.yaml.template +181 -0
  82. package/template/config/mcp_fallbacks.yaml +252 -0
  83. package/template/config/memory_integration.yaml +200 -0
  84. package/template/config/model_enforcement.yaml +141 -0
  85. package/template/config/models.yaml +242 -0
  86. package/template/config/output_validation.yaml +352 -0
  87. package/template/config/pipeline.yaml +357 -0
  88. package/template/config/pipeline_forking.yaml +236 -0
  89. package/template/config/qa_logging.yaml +166 -0
  90. package/template/config/smart_rollback.yaml +209 -0
  91. package/template/config/stage_personas.yaml +354 -0
  92. package/template/config/workflow.yaml +54 -0
  93. package/template/scripts/CLAUDE.md +0 -0
  94. package/template/scripts/ai-benchmark.sh +272 -0
  95. package/template/scripts/codex-wrapper.sh +97 -0
  96. package/template/scripts/context-manager.sh +528 -0
  97. package/template/scripts/create-checkpoint.sh +116 -0
  98. package/template/scripts/gemini-wrapper.sh +96 -0
  99. package/template/scripts/init-project.sh +109 -0
  100. package/template/scripts/list-stages.sh +245 -0
  101. package/template/scripts/next-stage.sh +228 -0
  102. package/template/scripts/output-validate.sh +12 -0
  103. package/template/scripts/pipeline-fork.sh +293 -0
  104. package/template/scripts/pre-run-check.sh +361 -0
  105. package/template/scripts/restore-checkpoint.sh +247 -0
  106. package/template/scripts/run-stage.sh +139 -0
  107. package/template/scripts/show-status.sh +185 -0
  108. package/template/scripts/smart-handoff.sh +254 -0
  109. package/template/stages/01-brainstorm/CLAUDE.md +103 -0
  110. package/template/stages/01-brainstorm/HANDOFF.md +110 -0
  111. package/template/stages/01-brainstorm/HANDOFF.md.template +112 -0
  112. package/template/stages/01-brainstorm/README.md +97 -0
  113. package/template/stages/01-brainstorm/config.yaml +92 -0
  114. package/template/stages/01-brainstorm/inputs/.gitkeep +0 -0
  115. package/template/stages/01-brainstorm/inputs/CLAUDE.md +0 -0
  116. package/template/stages/01-brainstorm/inputs/project_brief.md +40 -0
  117. package/template/stages/01-brainstorm/outputs/.gitkeep +0 -0
  118. package/template/stages/01-brainstorm/outputs/CLAUDE.md +0 -0
  119. package/template/stages/01-brainstorm/outputs/ideas.md +159 -0
  120. package/template/stages/01-brainstorm/outputs/requirements_analysis.md +222 -0
  121. package/template/stages/01-brainstorm/prompts/CLAUDE.md +0 -0
  122. package/template/stages/01-brainstorm/prompts/collaboration.md +46 -0
  123. package/template/stages/01-brainstorm/prompts/ideation.md +62 -0
  124. package/template/stages/01-brainstorm/prompts/persona.md +73 -0
  125. package/template/stages/01-brainstorm/prompts/requirements.md +73 -0
  126. package/template/stages/01-brainstorm/prompts/validation.md +50 -0
  127. package/template/stages/01-brainstorm/templates/CLAUDE.md +0 -0
  128. package/template/stages/01-brainstorm/templates/ideas.md +91 -0
  129. package/template/stages/01-brainstorm/templates/requirements_analysis.md +129 -0
  130. package/template/stages/02-research/CLAUDE.md +101 -0
  131. package/template/stages/02-research/HANDOFF.md +158 -0
  132. package/template/stages/02-research/HANDOFF.md.template +102 -0
  133. package/template/stages/02-research/config.yaml +68 -0
  134. package/template/stages/02-research/inputs/.gitkeep +0 -0
  135. package/template/stages/02-research/outputs/.gitkeep +0 -0
  136. package/template/stages/02-research/outputs/CLAUDE.md +0 -0
  137. package/template/stages/02-research/outputs/feasibility_report.md +176 -0
  138. package/template/stages/02-research/outputs/tech_research.md +403 -0
  139. package/template/stages/02-research/prompts/CLAUDE.md +0 -0
  140. package/template/stages/02-research/prompts/collaboration.md +51 -0
  141. package/template/stages/02-research/prompts/feasibility.md +73 -0
  142. package/template/stages/02-research/prompts/market_analysis.md +58 -0
  143. package/template/stages/02-research/prompts/tech_stack.md +60 -0
  144. package/template/stages/02-research/prompts/validation.md +51 -0
  145. package/template/stages/02-research/templates/.gitkeep +0 -0
  146. package/template/stages/03-planning/CLAUDE.md +98 -0
  147. package/template/stages/03-planning/HANDOFF.md +168 -0
  148. package/template/stages/03-planning/HANDOFF.md.template +91 -0
  149. package/template/stages/03-planning/config.yaml +64 -0
  150. package/template/stages/03-planning/inputs/.gitkeep +0 -0
  151. package/template/stages/03-planning/outputs/.gitkeep +0 -0
  152. package/template/stages/03-planning/outputs/CLAUDE.md +0 -0
  153. package/template/stages/03-planning/outputs/architecture.md +400 -0
  154. package/template/stages/03-planning/outputs/implementation.yaml +209 -0
  155. package/template/stages/03-planning/outputs/project_plan.md +204 -0
  156. package/template/stages/03-planning/outputs/tech_stack.md +176 -0
  157. package/template/stages/03-planning/prompts/CLAUDE.md +0 -0
  158. package/template/stages/03-planning/prompts/architecture.md +62 -0
  159. package/template/stages/03-planning/prompts/collaboration.md +57 -0
  160. package/template/stages/03-planning/prompts/validation.md +59 -0
  161. package/template/stages/03-planning/templates/.gitkeep +0 -0
  162. package/template/stages/04-ui-ux/CLAUDE.md +88 -0
  163. package/template/stages/04-ui-ux/HANDOFF.md +165 -0
  164. package/template/stages/04-ui-ux/HANDOFF.md.template +92 -0
  165. package/template/stages/04-ui-ux/config.yaml +57 -0
  166. package/template/stages/04-ui-ux/inputs/.gitkeep +0 -0
  167. package/template/stages/04-ui-ux/outputs/.gitkeep +0 -0
  168. package/template/stages/04-ui-ux/outputs/CLAUDE.md +0 -0
  169. package/template/stages/04-ui-ux/outputs/design_system.md +449 -0
  170. package/template/stages/04-ui-ux/outputs/user_flows.md +321 -0
  171. package/template/stages/04-ui-ux/outputs/wireframes.md +241 -0
  172. package/template/stages/04-ui-ux/prompts/.gitkeep +0 -0
  173. package/template/stages/04-ui-ux/prompts/CLAUDE.md +0 -0
  174. package/template/stages/04-ui-ux/prompts/collaboration.md +56 -0
  175. package/template/stages/04-ui-ux/prompts/validation.md +54 -0
  176. package/template/stages/04-ui-ux/templates/.gitkeep +0 -0
  177. package/template/stages/05-task-management/CLAUDE.md +105 -0
  178. package/template/stages/05-task-management/HANDOFF.md +187 -0
  179. package/template/stages/05-task-management/HANDOFF.md.template +97 -0
  180. package/template/stages/05-task-management/config.yaml +81 -0
  181. package/template/stages/05-task-management/inputs/.gitkeep +0 -0
  182. package/template/stages/05-task-management/outputs/.gitkeep +0 -0
  183. package/template/stages/05-task-management/outputs/CLAUDE.md +0 -0
  184. package/template/stages/05-task-management/outputs/milestones.md +253 -0
  185. package/template/stages/05-task-management/outputs/sprint_plan.md +203 -0
  186. package/template/stages/05-task-management/outputs/tasks.md +402 -0
  187. package/template/stages/05-task-management/prompts/.gitkeep +0 -0
  188. package/template/stages/05-task-management/prompts/CLAUDE.md +0 -0
  189. package/template/stages/05-task-management/prompts/collaboration.md +54 -0
  190. package/template/stages/05-task-management/prompts/validation.md +66 -0
  191. package/template/stages/05-task-management/templates/CLAUDE.md +0 -0
  192. package/template/stages/05-task-management/templates/notion_integration.md +176 -0
  193. package/template/stages/05-task-management/templates/parallel_groups.yaml +153 -0
  194. package/template/stages/05-task-management/templates/task_schema.yaml +154 -0
  195. package/template/stages/06-implementation/CLAUDE.md +163 -0
  196. package/template/stages/06-implementation/HANDOFF.md +184 -0
  197. package/template/stages/06-implementation/HANDOFF.md.template +192 -0
  198. package/template/stages/06-implementation/config.yaml +62 -0
  199. package/template/stages/06-implementation/inputs/.gitkeep +0 -0
  200. package/template/stages/06-implementation/outputs/.gitkeep +0 -0
  201. package/template/stages/06-implementation/prompts/.gitkeep +0 -0
  202. package/template/stages/06-implementation/prompts/CLAUDE.md +0 -0
  203. package/template/stages/06-implementation/prompts/collaboration.md +64 -0
  204. package/template/stages/06-implementation/prompts/validation.md +65 -0
  205. package/template/stages/06-implementation/templates/.gitkeep +0 -0
  206. package/template/stages/07-refactoring/CLAUDE.md +180 -0
  207. package/template/stages/07-refactoring/HANDOFF.md +82 -0
  208. package/template/stages/07-refactoring/HANDOFF.md.template +97 -0
  209. package/template/stages/07-refactoring/config.yaml +68 -0
  210. package/template/stages/07-refactoring/inputs/.gitkeep +0 -0
  211. package/template/stages/07-refactoring/outputs/.gitkeep +0 -0
  212. package/template/stages/07-refactoring/outputs/refactoring_report.md +102 -0
  213. package/template/stages/07-refactoring/prompts/.gitkeep +0 -0
  214. package/template/stages/07-refactoring/prompts/CLAUDE.md +0 -0
  215. package/template/stages/07-refactoring/prompts/collaboration.md +71 -0
  216. package/template/stages/07-refactoring/prompts/validation.md +76 -0
  217. package/template/stages/07-refactoring/templates/.gitkeep +0 -0
  218. package/template/stages/08-qa/CLAUDE.md +93 -0
  219. package/template/stages/08-qa/HANDOFF.md +114 -0
  220. package/template/stages/08-qa/HANDOFF.md.template +96 -0
  221. package/template/stages/08-qa/config.yaml +56 -0
  222. package/template/stages/08-qa/inputs/.gitkeep +0 -0
  223. package/template/stages/08-qa/outputs/.gitkeep +0 -0
  224. package/template/stages/08-qa/outputs/qa_report.md +138 -0
  225. package/template/stages/08-qa/prompts/.gitkeep +0 -0
  226. package/template/stages/08-qa/prompts/CLAUDE.md +0 -0
  227. package/template/stages/08-qa/prompts/collaboration.md +65 -0
  228. package/template/stages/08-qa/prompts/validation.md +71 -0
  229. package/template/stages/08-qa/templates/.gitkeep +0 -0
  230. package/template/stages/09-testing/CLAUDE.md +124 -0
  231. package/template/stages/09-testing/HANDOFF.md +118 -0
  232. package/template/stages/09-testing/HANDOFF.md.template +113 -0
  233. package/template/stages/09-testing/config.yaml +65 -0
  234. package/template/stages/09-testing/inputs/.gitkeep +0 -0
  235. package/template/stages/09-testing/outputs/.gitkeep +0 -0
  236. package/template/stages/09-testing/outputs/test_report.md +146 -0
  237. package/template/stages/09-testing/prompts/.gitkeep +0 -0
  238. package/template/stages/09-testing/prompts/CLAUDE.md +0 -0
  239. package/template/stages/09-testing/prompts/collaboration.md +77 -0
  240. package/template/stages/09-testing/prompts/validation.md +83 -0
  241. package/template/stages/09-testing/templates/.gitkeep +0 -0
  242. package/template/stages/10-deployment/CLAUDE.md +117 -0
  243. package/template/stages/10-deployment/HANDOFF.md +141 -0
  244. package/template/stages/10-deployment/HANDOFF.md.template +148 -0
  245. package/template/stages/10-deployment/config.yaml +61 -0
  246. package/template/stages/10-deployment/inputs/.gitkeep +0 -0
  247. package/template/stages/10-deployment/outputs/.gitkeep +0 -0
  248. package/template/stages/10-deployment/prompts/.gitkeep +0 -0
  249. package/template/stages/10-deployment/prompts/CLAUDE.md +0 -0
  250. package/template/stages/10-deployment/prompts/collaboration.md +80 -0
  251. package/template/stages/10-deployment/prompts/validation.md +93 -0
  252. package/template/stages/10-deployment/templates/CLAUDE.md +0 -0
  253. package/template/stages/10-deployment/templates/github-actions-cd.yaml +118 -0
  254. package/template/stages/10-deployment/templates/github-actions-ci.yaml +136 -0
  255. package/template/state/progress.json.template +111 -0
  256. package/template/state/templates/CLAUDE.md +0 -0
  257. package/template/state/templates/handoff_base.md.template +187 -0
  258. package/template/state/templates/phase_state.md.template +97 -0
@@ -0,0 +1,228 @@
1
+ #!/bin/bash
2
+ # next-stage.sh - 다음 스테이지로 전환
3
+ # ax-templates workflow pipeline
4
+
5
+ set -e
6
+
7
+ PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
8
+ PROGRESS_FILE="$PROJECT_ROOT/state/progress.json"
9
+ STAGES_DIR="$PROJECT_ROOT/stages"
10
+
11
+ # 색상 정의
12
+ RED='\033[0;31m'
13
+ GREEN='\033[0;32m'
14
+ YELLOW='\033[1;33m'
15
+ BLUE='\033[0;34m'
16
+ CYAN='\033[0;36m'
17
+ WHITE='\033[1;37m'
18
+ GRAY='\033[0;90m'
19
+ NC='\033[0m' # No Color
20
+
21
+ # 옵션 처리
22
+ FORCE_MODE=false
23
+ PREVIEW_MODE=false
24
+ NO_HANDOFF=false
25
+
26
+ while [[ "$#" -gt 0 ]]; do
27
+ case $1 in
28
+ --force) FORCE_MODE=true ;;
29
+ --preview) PREVIEW_MODE=true ;;
30
+ --no-handoff) NO_HANDOFF=true ;;
31
+ *) ;;
32
+ esac
33
+ shift
34
+ done
35
+
36
+ # jq 확인
37
+ if ! command -v jq &> /dev/null; then
38
+ echo -e "${RED}오류:${NC} jq가 필요합니다."
39
+ exit 1
40
+ fi
41
+
42
+ # progress.json 확인
43
+ if [ ! -f "$PROGRESS_FILE" ]; then
44
+ echo -e "${RED}오류:${NC} progress.json을 찾을 수 없습니다."
45
+ echo " 먼저 /init-project를 실행하세요."
46
+ exit 1
47
+ fi
48
+
49
+ # 스테이지 정보
50
+ declare -a STAGE_IDS=("01-brainstorm" "02-research" "03-planning" "04-ui-ux" "05-task-management" "06-implementation" "07-refactoring" "08-qa" "09-testing" "10-deployment")
51
+ declare -a CHECKPOINT_REQUIRED=("false" "false" "false" "false" "false" "true" "true" "false" "false" "false")
52
+
53
+ # 현재 스테이지 확인
54
+ CURRENT_STAGE=$(jq -r '.current_stage // "none"' "$PROGRESS_FILE")
55
+
56
+ if [ "$CURRENT_STAGE" == "none" ] || [ -z "$CURRENT_STAGE" ]; then
57
+ echo -e "${RED}오류:${NC} 진행 중인 스테이지가 없습니다."
58
+ echo " /run-stage 01 또는 /brainstorm으로 시작하세요."
59
+ exit 1
60
+ fi
61
+
62
+ # 현재 스테이지 인덱스 찾기
63
+ CURRENT_IDX=-1
64
+ for i in "${!STAGE_IDS[@]}"; do
65
+ if [ "${STAGE_IDS[$i]}" == "$CURRENT_STAGE" ]; then
66
+ CURRENT_IDX=$i
67
+ break
68
+ fi
69
+ done
70
+
71
+ if [ $CURRENT_IDX -eq -1 ]; then
72
+ echo -e "${RED}오류:${NC} 알 수 없는 스테이지: $CURRENT_STAGE"
73
+ exit 1
74
+ fi
75
+
76
+ # 다음 스테이지 확인
77
+ NEXT_IDX=$((CURRENT_IDX + 1))
78
+ if [ $NEXT_IDX -ge ${#STAGE_IDS[@]} ]; then
79
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
80
+ echo -e "🎉 ${GREEN}파이프라인 완료!${NC}"
81
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
82
+ echo "모든 10개 스테이지가 완료되었습니다."
83
+ echo ""
84
+ echo "최종 검토:"
85
+ echo " - /status 로 전체 상태 확인"
86
+ echo " - state/handoffs/ 에서 핸드오프 문서 검토"
87
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
88
+ exit 0
89
+ fi
90
+
91
+ NEXT_STAGE="${STAGE_IDS[$NEXT_IDX]}"
92
+ CURRENT_STAGE_DIR="$STAGES_DIR/$CURRENT_STAGE"
93
+ NEXT_STAGE_DIR="$STAGES_DIR/$NEXT_STAGE"
94
+
95
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
96
+ echo -e "🔄 ${WHITE}스테이지 전환${NC}"
97
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
98
+ echo -e "현재: ${CYAN}$CURRENT_STAGE${NC} → 다음: ${GREEN}$NEXT_STAGE${NC}"
99
+ echo ""
100
+
101
+ # 완료 조건 검증
102
+ echo -e "${BLUE}[완료 조건 검증]${NC}"
103
+ VALIDATION_FAILED=false
104
+
105
+ # outputs 디렉토리 확인
106
+ if [ -d "$CURRENT_STAGE_DIR/outputs" ]; then
107
+ OUTPUT_COUNT=$(find "$CURRENT_STAGE_DIR/outputs" -type f 2>/dev/null | wc -l | tr -d ' ')
108
+ if [ "$OUTPUT_COUNT" -gt 0 ]; then
109
+ echo -e "${GREEN}✓${NC} outputs 파일 존재 (${OUTPUT_COUNT}개)"
110
+ else
111
+ echo -e "${RED}✗${NC} outputs 파일 없음"
112
+ VALIDATION_FAILED=true
113
+ fi
114
+ else
115
+ echo -e "${RED}✗${NC} outputs 디렉토리 없음"
116
+ VALIDATION_FAILED=true
117
+ fi
118
+
119
+ # 체크포인트 필수 여부 확인
120
+ NEEDS_CHECKPOINT="${CHECKPOINT_REQUIRED[$CURRENT_IDX]}"
121
+ if [ "$NEEDS_CHECKPOINT" == "true" ]; then
122
+ # 현재 스테이지의 체크포인트가 있는지 확인
123
+ STAGE_NUM=$(echo "$CURRENT_STAGE" | cut -d'-' -f1)
124
+ CP_EXISTS=$(ls -d "$PROJECT_ROOT/state/checkpoints/CP-$STAGE_NUM-"* 2>/dev/null | head -1 || true)
125
+
126
+ if [ -n "$CP_EXISTS" ]; then
127
+ echo -e "${GREEN}✓${NC} 체크포인트 존재"
128
+ else
129
+ echo -e "${RED}✗${NC} 체크포인트 필수 (미생성)"
130
+ VALIDATION_FAILED=true
131
+ fi
132
+ fi
133
+
134
+ echo ""
135
+
136
+ # 검증 실패 시
137
+ if [ "$VALIDATION_FAILED" = true ] && [ "$FORCE_MODE" = false ]; then
138
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
139
+ echo -e "${YELLOW}⚠️ 스테이지 전환 조건 미충족${NC}"
140
+ echo ""
141
+ echo "다음 단계:"
142
+ if [ "$NEEDS_CHECKPOINT" == "true" ]; then
143
+ echo " 1. /checkpoint 실행"
144
+ fi
145
+ echo " 2. outputs 파일 생성 확인"
146
+ echo " 3. /next --force 로 강제 전환 (비권장)"
147
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
148
+ exit 1
149
+ fi
150
+
151
+ # 미리보기 모드
152
+ if [ "$PREVIEW_MODE" = true ]; then
153
+ echo -e "${YELLOW}[PREVIEW] 실제 전환을 실행하지 않습니다.${NC}"
154
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
155
+ exit 0
156
+ fi
157
+
158
+ # HANDOFF.md 생성
159
+ if [ "$NO_HANDOFF" = false ]; then
160
+ echo -e "${BLUE}[HANDOFF.md 생성]${NC}"
161
+
162
+ HANDOFF_FILE="$CURRENT_STAGE_DIR/HANDOFF.md"
163
+ TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
164
+ TIMESTAMP_READABLE=$(date "+%Y-%m-%d %H:%M")
165
+
166
+ cat > "$HANDOFF_FILE" << EOF
167
+ # Handoff: $CURRENT_STAGE → $NEXT_STAGE
168
+
169
+ 생성일: $TIMESTAMP_READABLE
170
+
171
+ ## 완료된 작업
172
+
173
+ - [x] $CURRENT_STAGE 스테이지 실행
174
+ - [x] outputs 파일 생성
175
+
176
+ ## 핵심 산출물
177
+
178
+ $(find "$CURRENT_STAGE_DIR/outputs" -type f -name "*.md" -o -name "*.json" -o -name "*.yaml" 2>/dev/null | while read -r f; do echo "- $(basename "$f")"; done)
179
+
180
+ ## 다음 단계
181
+
182
+ 다음 스테이지 ($NEXT_STAGE) 시작을 위한 지침:
183
+ 1. stages/$NEXT_STAGE/CLAUDE.md 참조
184
+ 2. 입력 파일 확인: stages/$CURRENT_STAGE/outputs/
185
+
186
+ ## 참고사항
187
+
188
+ - 자동 생성된 핸드오프 문서입니다.
189
+ - 필요시 수동으로 보완해 주세요.
190
+ EOF
191
+
192
+ echo -e "${GREEN}✓${NC} $HANDOFF_FILE 생성됨"
193
+
194
+ # 핸드오프 아카이브에 복사
195
+ mkdir -p "$PROJECT_ROOT/state/handoffs"
196
+ cp "$HANDOFF_FILE" "$PROJECT_ROOT/state/handoffs/${CURRENT_STAGE}-HANDOFF.md"
197
+ fi
198
+
199
+ # 상태 업데이트
200
+ echo ""
201
+ echo -e "${BLUE}[상태 업데이트]${NC}"
202
+
203
+ # progress.json 업데이트
204
+ jq ".current_stage = \"$NEXT_STAGE\" | \
205
+ .stages.\"$CURRENT_STAGE\".status = \"completed\" | \
206
+ .stages.\"$CURRENT_STAGE\".completed_at = \"$(date -u +"%Y-%m-%dT%H:%M:%SZ")\" | \
207
+ .stages.\"$NEXT_STAGE\".status = \"in_progress\" | \
208
+ .stages.\"$NEXT_STAGE\".started_at = \"$(date -u +"%Y-%m-%dT%H:%M:%SZ")\"" \
209
+ "$PROGRESS_FILE" > "${PROGRESS_FILE}.tmp" && mv "${PROGRESS_FILE}.tmp" "$PROGRESS_FILE"
210
+
211
+ echo -e "${GREEN}✓${NC} $CURRENT_STAGE: completed"
212
+ echo -e "${GREEN}✓${NC} $NEXT_STAGE: in_progress"
213
+ echo -e "${GREEN}✓${NC} progress.json 업데이트됨"
214
+
215
+ # 완료 메시지
216
+ echo ""
217
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
218
+ echo -e "${GREEN}✅${NC} ${WHITE}$NEXT_STAGE${NC} 스테이지 시작!"
219
+ echo ""
220
+ echo "다음 작업:"
221
+ echo " 1. stages/$NEXT_STAGE/CLAUDE.md 참조"
222
+ echo " 2. 입력 파일: stages/$CURRENT_STAGE/outputs/"
223
+
224
+ # 단축 명령어 안내
225
+ declare -a SHORTCUTS=("brainstorm" "research" "planning" "ui-ux" "tasks" "implement" "refactor" "qa" "test" "deploy")
226
+ echo " 3. 단축 명령어: /${SHORTCUTS[$NEXT_IDX]}"
227
+
228
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+ # ax-templates Output Validation Script
3
+ # 산출물 검증 실행
4
+
5
+ set -e
6
+
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
9
+ HOOKS_DIR="$PROJECT_ROOT/.claude/hooks"
10
+
11
+ # 검증 훅 호출
12
+ exec "$HOOKS_DIR/output-validator.sh" "$@"
@@ -0,0 +1,293 @@
1
+ #!/bin/bash
2
+ # ax-templates Pipeline Fork Script
3
+ # 파이프라인 분기 관리
4
+
5
+ set -e
6
+
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
9
+ FORKS_DIR="$PROJECT_ROOT/state/forks"
10
+ PROGRESS_FILE="$PROJECT_ROOT/state/progress.json"
11
+
12
+ # 색상 정의
13
+ RED='\033[0;31m'
14
+ GREEN='\033[0;32m'
15
+ YELLOW='\033[1;33m'
16
+ BLUE='\033[0;34m'
17
+ CYAN='\033[0;36m'
18
+ NC='\033[0m'
19
+
20
+ # 로그 함수
21
+ log_info() { echo -e "${BLUE}[FORK]${NC} $1"; }
22
+ log_success() { echo -e "${GREEN}[FORK]${NC} $1"; }
23
+ log_warning() { echo -e "${YELLOW}[FORK]${NC} $1"; }
24
+ log_error() { echo -e "${RED}[FORK]${NC} $1"; }
25
+
26
+ # 현재 스테이지 확인
27
+ get_current_stage() {
28
+ if [ -f "$PROGRESS_FILE" ]; then
29
+ cat "$PROGRESS_FILE" 2>/dev/null | grep -o '"current_stage"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4
30
+ else
31
+ echo "unknown"
32
+ fi
33
+ }
34
+
35
+ # 분기 생성
36
+ create_fork() {
37
+ local reason="$1"
38
+ local name="$2"
39
+ local direction="$3"
40
+
41
+ if [ -z "$reason" ]; then
42
+ log_error "분기 이유가 필요합니다."
43
+ exit 1
44
+ fi
45
+
46
+ local stage=$(get_current_stage)
47
+ local timestamp=$(date +%Y%m%d_%H%M%S)
48
+
49
+ if [ -z "$name" ]; then
50
+ name="fork_${stage}_${timestamp}"
51
+ fi
52
+
53
+ local fork_path="$FORKS_DIR/$name"
54
+
55
+ log_info "분기 생성 중: $name"
56
+ log_info "이유: $reason"
57
+
58
+ # 현재 활성 분기 수 확인
59
+ local active_forks=$(ls -1 "$FORKS_DIR" 2>/dev/null | wc -l)
60
+ if [ "$active_forks" -ge 3 ]; then
61
+ log_error "최대 활성 분기 수(3개)에 도달했습니다."
62
+ log_info "기존 분기를 병합하거나 삭제하세요."
63
+ exit 1
64
+ fi
65
+
66
+ # 분기 디렉토리 생성
67
+ mkdir -p "$fork_path"
68
+
69
+ # 현재 상태 복사
70
+ log_info "상태 복사 중..."
71
+
72
+ # 소스 코드 복사
73
+ if [ -d "$PROJECT_ROOT/stages/$stage/outputs" ]; then
74
+ cp -r "$PROJECT_ROOT/stages/$stage/outputs" "$fork_path/" 2>/dev/null || true
75
+ fi
76
+
77
+ # 상태 파일 복사
78
+ mkdir -p "$fork_path/state"
79
+ cp "$PROGRESS_FILE" "$fork_path/state/" 2>/dev/null || true
80
+
81
+ # 분기 HANDOFF 생성
82
+ cat > "$fork_path/FORK_HANDOFF.md" << EOF
83
+ # Fork HANDOFF - $name
84
+
85
+ ## 분기 정보
86
+ - **원본 스테이지**: $stage
87
+ - **분기 이유**: $reason
88
+ - **분기 시점**: $(date +%Y-%m-%d\ %H:%M:%S)
89
+ - **탐색 방향**: ${direction:-"미지정"}
90
+
91
+ ## 분기 목표
92
+
93
+ [이 분기에서 달성하려는 목표]
94
+
95
+ ## 평가 기준
96
+
97
+ - 코드 품질
98
+ - 성능
99
+ - 유지보수성
100
+
101
+ ## 병합 조건
102
+
103
+ [어떤 조건이 충족되면 병합할 것인지]
104
+
105
+ ## 진행 상황
106
+
107
+ - [ ] 초기 설정
108
+ - [ ] 구현
109
+ - [ ] 테스트
110
+ - [ ] 평가
111
+
112
+ EOF
113
+
114
+ # 메타데이터 생성
115
+ cat > "$fork_path/metadata.json" << EOF
116
+ {
117
+ "name": "$name",
118
+ "stage": "$stage",
119
+ "reason": "$reason",
120
+ "direction": "${direction:-null}",
121
+ "created_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
122
+ "status": "active",
123
+ "metrics": {}
124
+ }
125
+ EOF
126
+
127
+ log_success "분기 생성 완료: $fork_path"
128
+ log_info "분기 HANDOFF: $fork_path/FORK_HANDOFF.md"
129
+ }
130
+
131
+ # 분기 목록
132
+ list_forks() {
133
+ log_info "활성 분기 목록"
134
+ echo ""
135
+ echo "| ID | 이름 | 스테이지 | 상태 | 생성일 |"
136
+ echo "|----|------|----------|------|--------|"
137
+
138
+ local id=1
139
+ for fork_dir in "$FORKS_DIR"/*/; do
140
+ if [ -d "$fork_dir" ]; then
141
+ local name=$(basename "$fork_dir")
142
+ local metadata="$fork_dir/metadata.json"
143
+
144
+ if [ -f "$metadata" ]; then
145
+ local stage=$(cat "$metadata" | grep -o '"stage"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4)
146
+ local status=$(cat "$metadata" | grep -o '"status"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4)
147
+ local created=$(cat "$metadata" | grep -o '"created_at"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4 | cut -d'T' -f1)
148
+
149
+ echo "| $id | $name | $stage | $status | $created |"
150
+ id=$((id + 1))
151
+ fi
152
+ fi
153
+ done
154
+
155
+ echo ""
156
+ }
157
+
158
+ # 분기 비교
159
+ compare_forks() {
160
+ log_info "분기 비교"
161
+ echo ""
162
+ echo "=========================================="
163
+ echo " 분기 비교 결과"
164
+ echo "=========================================="
165
+ echo ""
166
+
167
+ echo "| 메트릭 | Main |"
168
+ for fork_dir in "$FORKS_DIR"/*/; do
169
+ if [ -d "$fork_dir" ]; then
170
+ echo -n " $(basename "$fork_dir") |"
171
+ fi
172
+ done
173
+ echo ""
174
+
175
+ echo "|--------|------|"
176
+ for fork_dir in "$FORKS_DIR"/*/; do
177
+ if [ -d "$fork_dir" ]; then
178
+ echo -n "------|"
179
+ fi
180
+ done
181
+ echo ""
182
+
183
+ # 시뮬레이션된 메트릭
184
+ echo "| Code Quality | 0.85 |"
185
+ for fork_dir in "$FORKS_DIR"/*/; do
186
+ if [ -d "$fork_dir" ]; then
187
+ echo -n " $(echo "scale=2; 0.80 + ($RANDOM % 15) / 100" | bc) |"
188
+ fi
189
+ done
190
+ echo ""
191
+
192
+ echo "| Performance | 0.80 |"
193
+ for fork_dir in "$FORKS_DIR"/*/; do
194
+ if [ -d "$fork_dir" ]; then
195
+ echo -n " $(echo "scale=2; 0.75 + ($RANDOM % 20) / 100" | bc) |"
196
+ fi
197
+ done
198
+ echo ""
199
+
200
+ echo ""
201
+ }
202
+
203
+ # 분기 병합
204
+ merge_fork() {
205
+ local fork_name="$1"
206
+ local strategy="${2:-best_performer}"
207
+
208
+ if [ -z "$fork_name" ]; then
209
+ log_error "병합할 분기 이름이 필요합니다."
210
+ exit 1
211
+ fi
212
+
213
+ local fork_path="$FORKS_DIR/$fork_name"
214
+
215
+ if [ ! -d "$fork_path" ]; then
216
+ log_error "분기를 찾을 수 없습니다: $fork_name"
217
+ exit 1
218
+ fi
219
+
220
+ log_info "분기 병합 중: $fork_name"
221
+ log_info "전략: $strategy"
222
+
223
+ # 체크포인트 생성
224
+ "$SCRIPT_DIR/../.claude/hooks/auto-checkpoint.sh" create "pre_merge" 2>/dev/null || true
225
+
226
+ # 분기 상태를 merged로 변경
227
+ if [ -f "$fork_path/metadata.json" ]; then
228
+ sed -i '' 's/"status"[[:space:]]*:[[:space:]]*"[^"]*"/"status": "merged"/g' "$fork_path/metadata.json" 2>/dev/null || \
229
+ sed -i 's/"status"[[:space:]]*:[[:space:]]*"[^"]*"/"status": "merged"/g' "$fork_path/metadata.json"
230
+ fi
231
+
232
+ log_success "분기 병합 완료: $fork_name"
233
+ }
234
+
235
+ # 분기 삭제
236
+ delete_fork() {
237
+ local fork_name="$1"
238
+
239
+ if [ -z "$fork_name" ]; then
240
+ log_error "삭제할 분기 이름이 필요합니다."
241
+ exit 1
242
+ fi
243
+
244
+ local fork_path="$FORKS_DIR/$fork_name"
245
+
246
+ if [ ! -d "$fork_path" ]; then
247
+ log_error "분기를 찾을 수 없습니다: $fork_name"
248
+ exit 1
249
+ fi
250
+
251
+ log_warning "분기를 삭제합니다: $fork_name"
252
+ rm -rf "$fork_path"
253
+ log_success "분기 삭제 완료"
254
+ }
255
+
256
+ # 메인 실행
257
+ main() {
258
+ local action="$1"
259
+ shift
260
+
261
+ mkdir -p "$FORKS_DIR"
262
+
263
+ case "$action" in
264
+ "create")
265
+ create_fork "$@"
266
+ ;;
267
+ "list")
268
+ list_forks
269
+ ;;
270
+ "compare")
271
+ compare_forks
272
+ ;;
273
+ "merge")
274
+ merge_fork "$@"
275
+ ;;
276
+ "delete")
277
+ delete_fork "$@"
278
+ ;;
279
+ *)
280
+ echo "사용법: $0 {create|list|compare|merge|delete} [args]"
281
+ echo ""
282
+ echo "명령어:"
283
+ echo " create --reason \"이유\" [--name 이름] [--direction 방향]"
284
+ echo " list 활성 분기 목록"
285
+ echo " compare 분기 비교"
286
+ echo " merge <fork_name> 분기 병합"
287
+ echo " delete <fork_name> 분기 삭제"
288
+ exit 1
289
+ ;;
290
+ esac
291
+ }
292
+
293
+ main "$@"