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,115 @@
1
+ #!/bin/bash
2
+ # statusline.sh - Claude Code Statusline API를 통한 실시간 컨텍스트 모니터링
3
+ # ax-templates workflow pipeline
4
+ #
5
+ # Claude Code가 ~300ms마다 JSON을 stdin으로 전달합니다.
6
+ # 이 스크립트는 remaining_percentage를 분석하여 임계값 도달 시 자동 조치를 수행합니다.
7
+
8
+ set -e
9
+
10
+ PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
11
+ STATE_FILE="$PROJECT_ROOT/state/context/auto-trigger.json"
12
+ PROGRESS_FILE="$PROJECT_ROOT/state/progress.json"
13
+ CONTEXT_DIR="$PROJECT_ROOT/state/context"
14
+
15
+ # 컨텍스트 디렉토리 확인
16
+ mkdir -p "$CONTEXT_DIR"
17
+
18
+ # stdin에서 JSON 읽기
19
+ input=$(cat)
20
+
21
+ # JSON 파싱 (jq 필요)
22
+ if ! command -v jq &> /dev/null; then
23
+ echo "[CTX] jq 필요"
24
+ exit 0
25
+ fi
26
+
27
+ # 컨텍스트 데이터 추출
28
+ REMAINING=$(echo "$input" | jq -r '.context_window.remaining_percentage // 100' 2>/dev/null || echo "100")
29
+ USED=$(echo "$input" | jq -r '.context_window.used_percentage // 0' 2>/dev/null || echo "0")
30
+ MODEL=$(echo "$input" | jq -r '.model.display_name // "Claude"' 2>/dev/null || echo "Claude")
31
+ CONTEXT_SIZE=$(echo "$input" | jq -r '.context_window.context_window_size // 200000' 2>/dev/null || echo "200000")
32
+
33
+ # 현재 스테이지 가져오기
34
+ if [ -f "$PROGRESS_FILE" ]; then
35
+ CURRENT_STAGE=$(jq -r '.current_stage // "none"' "$PROGRESS_FILE" 2>/dev/null || echo "none")
36
+ else
37
+ CURRENT_STAGE="none"
38
+ fi
39
+
40
+ # 숫자 비교를 위한 정수 변환
41
+ REMAINING_INT=$(printf "%.0f" "$REMAINING" 2>/dev/null || echo "100")
42
+
43
+ # 상태 및 색상 결정
44
+ # 임계값: 60% 경고, 50% 자동저장, 40% 크리티컬
45
+ if [ "$REMAINING_INT" -le 40 ]; then
46
+ # 40% 이하: 크리티컬 - /clear 권고
47
+ STATUS_ICON="🔴"
48
+ STATUS_TEXT="CTX≤40%"
49
+ NEEDS_ACTION="critical"
50
+ elif [ "$REMAINING_INT" -le 50 ]; then
51
+ # 50% 이하: 자동 스냅샷 트리거
52
+ STATUS_ICON="⚠️"
53
+ STATUS_TEXT="CTX≤50%"
54
+ NEEDS_ACTION="warning"
55
+ elif [ "$REMAINING_INT" -le 60 ]; then
56
+ # 60% 이하: 경고 표시
57
+ STATUS_ICON="⚡"
58
+ STATUS_TEXT="CTX≤60%"
59
+ NEEDS_ACTION="notice"
60
+ else
61
+ # 정상
62
+ STATUS_ICON="✓"
63
+ STATUS_TEXT=""
64
+ NEEDS_ACTION="none"
65
+ fi
66
+
67
+ # 50% 이하일 때 자동 조치
68
+ if [ "$NEEDS_ACTION" = "warning" ] || [ "$NEEDS_ACTION" = "critical" ]; then
69
+ # 이미 트리거 되었는지 확인 (중복 방지)
70
+ ALREADY_TRIGGERED=false
71
+ if [ -f "$STATE_FILE" ]; then
72
+ TRIGGERED=$(jq -r '.triggered // false' "$STATE_FILE" 2>/dev/null || echo "false")
73
+ TRIGGER_REMAINING=$(jq -r '.remaining // 100' "$STATE_FILE" 2>/dev/null || echo "100")
74
+
75
+ # 같은 레벨에서 이미 트리거 되었으면 스킵
76
+ if [ "$TRIGGERED" = "true" ]; then
77
+ # 더 낮은 레벨로 떨어지면 다시 트리거
78
+ if [ "$REMAINING_INT" -lt "$TRIGGER_REMAINING" ]; then
79
+ ALREADY_TRIGGERED=false
80
+ else
81
+ ALREADY_TRIGGERED=true
82
+ fi
83
+ fi
84
+ fi
85
+
86
+ if [ "$ALREADY_TRIGGERED" = false ]; then
87
+ # 트리거 상태 기록
88
+ cat > "$STATE_FILE" << EOF
89
+ {
90
+ "triggered": true,
91
+ "timestamp": "$(date -Iseconds)",
92
+ "remaining": $REMAINING_INT,
93
+ "level": "$NEEDS_ACTION",
94
+ "stage": "$CURRENT_STAGE"
95
+ }
96
+ EOF
97
+
98
+ # 자동 스냅샷 생성 (백그라운드)
99
+ if [ -x "$PROJECT_ROOT/scripts/context-manager.sh" ]; then
100
+ "$PROJECT_ROOT/scripts/context-manager.sh" --auto-compact "$NEEDS_ACTION" 2>/dev/null &
101
+ fi
102
+ fi
103
+ fi
104
+
105
+ # 컨텍스트가 충분해지면 (70% 이상) 트리거 상태 리셋
106
+ if [ "$REMAINING_INT" -ge 70 ] && [ -f "$STATE_FILE" ]; then
107
+ rm -f "$STATE_FILE"
108
+ fi
109
+
110
+ # 상태줄 출력
111
+ if [ -n "$STATUS_TEXT" ]; then
112
+ echo "[$MODEL] $STATUS_ICON $STATUS_TEXT ${REMAINING_INT}% | Stage: $CURRENT_STAGE"
113
+ else
114
+ echo "[$MODEL] $STATUS_ICON ${REMAINING_INT}% | Stage: $CURRENT_STAGE"
115
+ fi
@@ -0,0 +1,104 @@
1
+ #!/bin/bash
2
+ # stop.sh - Claude 응답 완료 후 컨텍스트 자동 관리
3
+ # ax-templates workflow pipeline
4
+ #
5
+ # Stop hook: Claude 응답이 완료된 후 실행됨
6
+ # 컨텍스트가 50% 이하이면 자동으로 /compact 실행
7
+
8
+ set -e
9
+
10
+ PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
11
+ TRIGGER_FILE="$PROJECT_ROOT/state/context/auto-trigger.json"
12
+ COOLDOWN_FILE="$PROJECT_ROOT/state/context/.last-compact"
13
+ CONTEXT_DIR="$PROJECT_ROOT/state/context"
14
+ PROGRESS_FILE="$PROJECT_ROOT/state/progress.json"
15
+
16
+ # 쿨다운 시간 (초) - 5분
17
+ COOLDOWN_SECONDS=300
18
+
19
+ # 컨텍스트 디렉토리 확인
20
+ mkdir -p "$CONTEXT_DIR"
21
+
22
+ # jq 필요
23
+ if ! command -v jq &> /dev/null; then
24
+ exit 0
25
+ fi
26
+
27
+ # stdin에서 hook 데이터 읽기
28
+ input=$(cat)
29
+
30
+ # 1. 트리거 파일 확인 (statusline.sh에서 생성)
31
+ if [ ! -f "$TRIGGER_FILE" ]; then
32
+ exit 0 # 트리거 없음 - 정상 상태
33
+ fi
34
+
35
+ TRIGGERED=$(jq -r '.triggered // false' "$TRIGGER_FILE" 2>/dev/null || echo "false")
36
+ if [ "$TRIGGERED" != "true" ]; then
37
+ exit 0
38
+ fi
39
+
40
+ REMAINING=$(jq -r '.remaining // 100' "$TRIGGER_FILE" 2>/dev/null || echo "100")
41
+ LEVEL=$(jq -r '.level // "warning"' "$TRIGGER_FILE" 2>/dev/null || echo "warning")
42
+
43
+ # 50% 이하가 아니면 스킵
44
+ if [ "$REMAINING" -gt 50 ]; then
45
+ exit 0
46
+ fi
47
+
48
+ # 2. 쿨다운 확인 (5분 내 재실행 방지)
49
+ if [ -f "$COOLDOWN_FILE" ]; then
50
+ LAST_COMPACT=$(cat "$COOLDOWN_FILE" 2>/dev/null || echo "0")
51
+ NOW=$(date +%s)
52
+ ELAPSED=$((NOW - LAST_COMPACT))
53
+
54
+ if [ "$ELAPSED" -lt "$COOLDOWN_SECONDS" ]; then
55
+ # 쿨다운 중 - 스킵
56
+ REMAINING_COOLDOWN=$((COOLDOWN_SECONDS - ELAPSED))
57
+ exit 0
58
+ fi
59
+ fi
60
+
61
+ # 3. tmux 세션 확인
62
+ if [ -z "$TMUX" ]; then
63
+ # tmux 세션이 아님 - 수동 안내만 제공
64
+ echo ""
65
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
66
+ echo "⚠️ 컨텍스트 ${REMAINING}% - /compact 실행을 권장합니다"
67
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
68
+ exit 0
69
+ fi
70
+
71
+ # 4. 스냅샷 저장 확인 (이미 statusline.sh에서 저장했어야 함)
72
+ LATEST_SNAPSHOT=$(ls -1t "$CONTEXT_DIR"/auto-snapshot-*.md 2>/dev/null | head -1)
73
+ if [ -z "$LATEST_SNAPSHOT" ]; then
74
+ # 스냅샷 없음 - 먼저 저장
75
+ "$PROJECT_ROOT/scripts/context-manager.sh" --auto-compact "$LEVEL" 2>/dev/null || true
76
+ LATEST_SNAPSHOT=$(ls -1t "$CONTEXT_DIR"/auto-snapshot-*.md 2>/dev/null | head -1)
77
+ fi
78
+
79
+ # 스냅샷이 여전히 없으면 안전을 위해 스킵
80
+ if [ -z "$LATEST_SNAPSHOT" ]; then
81
+ echo ""
82
+ echo "⚠️ 스냅샷 저장 실패 - /compact 자동 실행 취소"
83
+ exit 0
84
+ fi
85
+
86
+ # 5. 사전 알림
87
+ echo ""
88
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
89
+ echo "🔄 컨텍스트 ${REMAINING}% - 자동 /compact 실행 중..."
90
+ echo " 스냅샷: $(basename "$LATEST_SNAPSHOT")"
91
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
92
+
93
+ # 6. 쿨다운 타이머 기록
94
+ date +%s > "$COOLDOWN_FILE"
95
+
96
+ # 7. 트리거 파일에 compact 예정 표시
97
+ jq '. + {"compact_scheduled": true, "compact_time": "'"$(date -Iseconds)"'"}' \
98
+ "$TRIGGER_FILE" > "$TRIGGER_FILE.tmp" && mv "$TRIGGER_FILE.tmp" "$TRIGGER_FILE"
99
+
100
+ # 8. tmux send-keys로 /compact 실행 (현재 pane에)
101
+ sleep 1 # 잠시 대기 (출력이 보이도록)
102
+ tmux send-keys "/compact" Enter
103
+
104
+ exit 0
@@ -0,0 +1,149 @@
1
+ {
2
+ "name": "ax-templates",
3
+ "version": "1.2.0",
4
+ "description": "Multi-AI Workflow Pipeline Template System",
5
+
6
+ "statusline": {
7
+ "script": ".claude/hooks/statusline.sh",
8
+ "enabled": true
9
+ },
10
+
11
+ "context_management": {
12
+ "warning_threshold_percent": 60,
13
+ "action_threshold_percent": 50,
14
+ "critical_threshold_percent": 40,
15
+ "auto_snapshot_on_warning": true,
16
+ "auto_compact_enabled": true,
17
+ "auto_recovery_enabled": true,
18
+ "compact_cooldown_seconds": 300,
19
+ "snapshot_dir": "state/context"
20
+ },
21
+
22
+ "hooks_info": {
23
+ "note": "실제 hooks 설정은 settings.local.json에 있음",
24
+ "stop": ".claude/hooks/stop.sh - 자동 /compact",
25
+ "session_start": ".claude/hooks/session-start.sh - 자동 복구"
26
+ },
27
+
28
+ "commands": {
29
+ "init-project": {
30
+ "description": "새 프로젝트 초기화",
31
+ "file": "commands/init-project.md"
32
+ },
33
+ "run-stage": {
34
+ "description": "스테이지 실행",
35
+ "file": "commands/run-stage.md"
36
+ },
37
+ "handoff": {
38
+ "description": "핸드오프 문서 생성",
39
+ "file": "commands/handoff.md"
40
+ },
41
+ "checkpoint": {
42
+ "description": "체크포인트 생성",
43
+ "file": "commands/checkpoint.md"
44
+ },
45
+ "gemini": {
46
+ "description": "Gemini CLI 호출 (tmux)",
47
+ "file": "commands/gemini.md"
48
+ },
49
+ "codex": {
50
+ "description": "Codex CLI 호출 (tmux)",
51
+ "file": "commands/codex.md"
52
+ },
53
+ "status": {
54
+ "description": "파이프라인 상태 확인",
55
+ "file": "commands/status.md"
56
+ },
57
+ "stages": {
58
+ "description": "스테이지 목록 및 상세",
59
+ "file": "commands/stages.md"
60
+ },
61
+ "restore": {
62
+ "description": "체크포인트 복구",
63
+ "file": "commands/restore.md"
64
+ },
65
+ "next": {
66
+ "description": "다음 스테이지 전환",
67
+ "file": "commands/next.md"
68
+ },
69
+ "context": {
70
+ "description": "컨텍스트 상태 관리",
71
+ "file": "commands/context.md"
72
+ },
73
+ "brainstorm": {
74
+ "description": "01-brainstorm 스테이지 시작",
75
+ "file": "commands/brainstorm.md"
76
+ },
77
+ "research": {
78
+ "description": "02-research 스테이지 시작",
79
+ "file": "commands/research.md"
80
+ },
81
+ "planning": {
82
+ "description": "03-planning 스테이지 시작",
83
+ "file": "commands/planning.md"
84
+ },
85
+ "ui-ux": {
86
+ "description": "04-ui-ux 스테이지 시작",
87
+ "file": "commands/ui-ux.md"
88
+ },
89
+ "tasks": {
90
+ "description": "05-task-management 스테이지 시작",
91
+ "file": "commands/tasks.md"
92
+ },
93
+ "implement": {
94
+ "description": "06-implementation 스테이지 시작",
95
+ "file": "commands/implement.md"
96
+ },
97
+ "refactor": {
98
+ "description": "07-refactoring 스테이지 시작",
99
+ "file": "commands/refactor.md"
100
+ },
101
+ "qa": {
102
+ "description": "08-qa 스테이지 시작",
103
+ "file": "commands/qa.md"
104
+ },
105
+ "test": {
106
+ "description": "09-testing 스테이지 시작",
107
+ "file": "commands/test.md"
108
+ },
109
+ "deploy": {
110
+ "description": "10-deployment 스테이지 시작",
111
+ "file": "commands/deploy.md"
112
+ },
113
+ "collaborate": {
114
+ "description": "Multi-AI 협업 실행",
115
+ "file": "commands/collaborate.md"
116
+ },
117
+ "benchmark": {
118
+ "description": "AI 모델 벤치마킹",
119
+ "file": "commands/benchmark.md"
120
+ },
121
+ "fork": {
122
+ "description": "파이프라인 분기 관리",
123
+ "file": "commands/fork.md"
124
+ },
125
+ "validate": {
126
+ "description": "산출물 검증 실행",
127
+ "file": "commands/validate.md"
128
+ }
129
+ },
130
+
131
+ "skills": {
132
+ "smart-handoff": {
133
+ "description": "스마트 컨텍스트 추출 및 HANDOFF 생성",
134
+ "directory": "skills/smart-handoff"
135
+ },
136
+ "ai-collaboration": {
137
+ "description": "Multi-AI 협업 오케스트레이션",
138
+ "directory": "skills/ai-collaboration"
139
+ },
140
+ "auto-checkpoint": {
141
+ "description": "자동 체크포인트 생성",
142
+ "directory": "skills/auto-checkpoint"
143
+ },
144
+ "output-validator": {
145
+ "description": "산출물 검증 및 품질 확인",
146
+ "directory": "skills/output-validator"
147
+ }
148
+ }
149
+ }
@@ -0,0 +1,61 @@
1
+ # AI Collaboration Skill
2
+
3
+ Multi-AI 협업 및 오케스트레이션 스킬
4
+
5
+ ## 개요
6
+
7
+ 여러 AI 모델(Claude, Gemini, Codex)을 협업시켜 더 나은 결과물을 생성합니다:
8
+ - 병렬 실행으로 다양한 관점 확보
9
+ - 순차 핸드오프로 점진적 개선
10
+ - 토론 모드로 최적 결론 도출
11
+
12
+ ## 트리거
13
+
14
+ - `/collaborate` 명령어
15
+ - 복잡한 태스크 감지 시 자동 제안
16
+ - 낮은 확신도 감지 시
17
+
18
+ ## 협업 모드
19
+
20
+ ### 1. Parallel Execution (병렬 실행)
21
+ 동일 작업을 여러 AI가 동시 수행 → 최적 결과 선택
22
+
23
+ ```bash
24
+ /collaborate --mode parallel --task "아이디어 생성" --models "gemini,claude"
25
+ ```
26
+
27
+ ### 2. Sequential Handoff (순차 핸드오프)
28
+ AI 간 릴레이로 결과물 점진적 개선
29
+
30
+ ```bash
31
+ /collaborate --mode sequential --chain "code_review"
32
+ ```
33
+
34
+ ### 3. Debate Mode (토론 모드)
35
+ AI 간 토론으로 다양한 관점에서 최적 결론 도출
36
+
37
+ ```bash
38
+ /collaborate --mode debate --topic "아키텍처 선택" --rounds 3
39
+ ```
40
+
41
+ ## 파일 구조
42
+
43
+ ```
44
+ ai-collaboration/
45
+ ├── README.md # 이 파일
46
+ ├── parallel.md # 병렬 실행 가이드
47
+ ├── debate.md # 토론 모드 가이드
48
+ └── prompts/
49
+ └── CLAUDE.md # AI 지침
50
+ ```
51
+
52
+ ## 설정
53
+
54
+ `config/ai_collaboration.yaml` 참조
55
+
56
+ ## 출력
57
+
58
+ - 각 AI 결과물
59
+ - 비교 분석 리포트
60
+ - 최종 선택/병합 결과
61
+ - `state/collaborations/` 저장
@@ -0,0 +1,148 @@
1
+ # AI Collaboration - Debate Mode
2
+
3
+ ## 토론 모드
4
+
5
+ 여러 AI 모델이 다양한 관점에서 토론하여 최적의 결론을 도출합니다.
6
+
7
+ ## 사용 시나리오
8
+
9
+ 1. **아키텍처 결정**: 여러 설계 대안 비교
10
+ 2. **기술 선택**: 프레임워크/라이브러리 선택
11
+ 3. **트레이드오프 분석**: 성능 vs 유지보수성 등
12
+
13
+ ## 토론 구조
14
+
15
+ ### 참가자 역할
16
+
17
+ ```yaml
18
+ participants:
19
+ advocate:
20
+ model: "claude"
21
+ perspective: "기술적 실현 가능성"
22
+ stance: "안정적이고 검증된 접근법"
23
+
24
+ challenger:
25
+ model: "gemini"
26
+ perspective: "혁신적 접근법"
27
+ stance: "새로운 기술과 방법론"
28
+ ```
29
+
30
+ ### 토론 라운드
31
+
32
+ ```
33
+ Round 1: 초기 입장 제시
34
+ - Advocate: [입장 + 근거]
35
+ - Challenger: [반대 입장 + 근거]
36
+
37
+ Round 2: 반박 및 보완
38
+ - Advocate: [반박 + 추가 근거]
39
+ - Challenger: [반박 + 추가 근거]
40
+
41
+ Round 3: 수렴 및 결론
42
+ - 공통점 도출
43
+ - 합의점 정리
44
+ - 최종 권장사항
45
+ ```
46
+
47
+ ## 토론 규칙
48
+
49
+ ```yaml
50
+ rules:
51
+ rounds: 3
52
+ max_tokens_per_turn: 2000
53
+ require_evidence: true
54
+ convergence_check: true
55
+ ```
56
+
57
+ ### 증거 요구사항
58
+ - 주장에는 반드시 근거 제시
59
+ - 가능한 경우 수치/데이터 포함
60
+ - 사례 인용 권장
61
+
62
+ ## 실행 방법
63
+
64
+ ### 1. 토론 주제 설정
65
+ ```bash
66
+ /collaborate --mode debate --topic "모놀리식 vs 마이크로서비스"
67
+ ```
68
+
69
+ ### 2. 관점 할당
70
+ ```yaml
71
+ debate_setup:
72
+ topic: "모놀리식 vs 마이크로서비스"
73
+ advocate:
74
+ model: "claude"
75
+ position: "모놀리식 (초기 단계)"
76
+ challenger:
77
+ model: "gemini"
78
+ position: "마이크로서비스 (확장성)"
79
+ ```
80
+
81
+ ### 3. 토론 진행
82
+ 각 라운드별로 순차적으로 응답 수집
83
+
84
+ ### 4. 결론 도출
85
+ ```yaml
86
+ conclusion:
87
+ method: "consensus" # or "vote", "weighted"
88
+ include_dissenting: true
89
+ ```
90
+
91
+ ## 출력 형식
92
+
93
+ ```markdown
94
+ # Debate Results
95
+
96
+ ## Topic
97
+ [토론 주제]
98
+
99
+ ## Round 1: Initial Positions
100
+
101
+ ### Advocate (Claude)
102
+ **Position**: [입장]
103
+ **Arguments**:
104
+ 1. [근거 1]
105
+ 2. [근거 2]
106
+
107
+ ### Challenger (Gemini)
108
+ **Position**: [입장]
109
+ **Arguments**:
110
+ 1. [근거 1]
111
+ 2. [근거 2]
112
+
113
+ ## Round 2: Rebuttals
114
+ [반박 내용]
115
+
116
+ ## Round 3: Convergence
117
+ [수렴 과정]
118
+
119
+ ## Conclusion
120
+
121
+ ### Consensus Points
122
+ - [합의점 1]
123
+ - [합의점 2]
124
+
125
+ ### Remaining Differences
126
+ - [의견 차이]
127
+
128
+ ### Recommendation
129
+ [최종 권장사항]
130
+
131
+ ### Dissenting Opinion
132
+ [소수 의견 - 선택적]
133
+ ```
134
+
135
+ ## 결론 도출 방법
136
+
137
+ ### Consensus (합의)
138
+ - 공통점 추출
139
+ - 차이점 명시
140
+ - 절충안 제시
141
+
142
+ ### Vote (투표)
143
+ - 각 AI의 최종 선택
144
+ - 다수결
145
+
146
+ ### Weighted (가중치)
147
+ - 전문성에 따른 가중치
148
+ - 가중 평균으로 결정
@@ -0,0 +1,96 @@
1
+ # AI Collaboration - Parallel Execution
2
+
3
+ ## 병렬 실행 모드
4
+
5
+ 동일한 작업을 여러 AI 모델이 동시에 수행하여 다양한 결과물 중 최적을 선택합니다.
6
+
7
+ ## 사용 시나리오
8
+
9
+ 1. **아이디어 생성**: 다양한 관점의 아이디어 수집
10
+ 2. **코드 구현**: 여러 접근법 비교
11
+ 3. **문서 작성**: 스타일 비교
12
+
13
+ ## 실행 프로세스
14
+
15
+ ### 1. 작업 정의
16
+ ```yaml
17
+ task:
18
+ description: "사용자 인증 시스템 설계"
19
+ type: "design"
20
+ constraints:
21
+ - "JWT 기반"
22
+ - "OAuth 지원"
23
+ ```
24
+
25
+ ### 2. 모델 선택
26
+ ```yaml
27
+ models:
28
+ - gemini:
29
+ focus: "창의적 접근"
30
+ - claude:
31
+ focus: "실용적 구현"
32
+ ```
33
+
34
+ ### 3. 병렬 실행
35
+ ```bash
36
+ # tmux 세션을 통한 동시 실행
37
+ scripts/gemini-wrapper.sh "prompts/task.md" &
38
+ # Claude는 현재 세션에서 실행
39
+ ```
40
+
41
+ ### 4. 결과 수집
42
+ 각 AI의 출력을 `state/collaborations/{task_id}/` 에 저장
43
+
44
+ ### 5. 평가 및 선택
45
+ ```yaml
46
+ evaluation:
47
+ metrics:
48
+ - completeness: 0.3
49
+ - creativity: 0.3
50
+ - feasibility: 0.4
51
+ ```
52
+
53
+ ## 병합 전략
54
+
55
+ ### Best-of-N
56
+ - 점수가 가장 높은 결과 선택
57
+ - 임계값 이상(0.85)이면 자동 선택
58
+
59
+ ### Synthesis
60
+ - 각 결과의 장점만 추출
61
+ - 새로운 통합 결과물 생성
62
+
63
+ ## 출력 형식
64
+
65
+ ```markdown
66
+ # Parallel Execution Results
67
+
68
+ ## Task
69
+ [작업 설명]
70
+
71
+ ## Results
72
+
73
+ ### Gemini Result
74
+ [결과 내용]
75
+ **Score**: 0.82
76
+
77
+ ### Claude Result
78
+ [결과 내용]
79
+ **Score**: 0.88
80
+
81
+ ## Analysis
82
+ | Metric | Gemini | Claude |
83
+ |--------|--------|--------|
84
+ | Completeness | 0.80 | 0.90 |
85
+ | Creativity | 0.90 | 0.85 |
86
+ | Feasibility | 0.75 | 0.90 |
87
+
88
+ ## Selected: Claude Result
89
+ **Reason**: 높은 실현 가능성과 완성도
90
+ ```
91
+
92
+ ## 리소스 관리
93
+
94
+ - 최대 동시 실행: 2개 모델
95
+ - 토큰 예산: 협업당 50,000
96
+ - 타임아웃: 모델당 5분